From: Kevin Day Date: Tue, 1 Sep 2020 01:14:23 +0000 (-0500) Subject: Refactor: Append '_t' to all types and related macros. X-Git-Tag: 0.5.0~31 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=ea15157da2963d6899e9ddce62606a126dd87be3;p=fll Refactor: Append '_t' to all types and related macros. After using uint8_t and similar, I have decided to adopt the '_t' notation for types. This helps further reduce the possibility of naming conflicts. With this change a function, for example, for file mode could be 'f_file_mode' whereas a type for file mode would be 'f_file_mode_t'. This further allows me to change the design of the *int*_t types used as an array. Such as renaming 'f_uint8_tss' to 'f_uint8ss_t'. --- diff --git a/level_0/f_account/c/account.c b/level_0/f_account/c/account.c index bdaf7b4..a1091e0 100644 --- a/level_0/f_account/c/account.c +++ b/level_0/f_account/c/account.c @@ -5,8 +5,8 @@ extern "C" { #endif #ifndef _di_f_account_id_group_by_name_ - f_return_status f_account_id_group_by_name(const f_string name, gid_t *id) { - f_status status = F_none; + f_return_status f_account_id_group_by_name(const f_string_t name, gid_t *id) { + f_status_t status = F_none; const size_t length_max = sysconf(_SC_GETPW_R_SIZE_MAX); @@ -80,8 +80,8 @@ extern "C" { #endif // _di_f_account_id_group_by_name_ #ifndef _di_f_account_id_user_by_name_ - f_return_status f_account_id_user_by_name(const f_string name, uid_t *id) { - f_status status = F_none; + f_return_status f_account_id_user_by_name(const f_string_t name, uid_t *id) { + f_status_t status = F_none; const size_t length_max = sysconf(_SC_GETPW_R_SIZE_MAX); diff --git a/level_0/f_account/c/account.h b/level_0/f_account/c/account.h index a06397a..8567713 100644 --- a/level_0/f_account/c/account.h +++ b/level_0/f_account/c/account.h @@ -63,7 +63,7 @@ extern "C" { * @see getgrnam_r() */ #ifndef _di_f_account_id_group_by_name_ - extern f_return_status f_account_id_group_by_name(const f_string name, gid_t *id); + extern f_return_status f_account_id_group_by_name(const f_string_t name, gid_t *id); #endif // _di_f_account_id_group_by_name_ /** @@ -89,7 +89,7 @@ extern "C" { * @see getpwnam_r() */ #ifndef _di_f_account_id_user_by_name_ - extern f_return_status f_account_id_user_by_name(const f_string name, uid_t *id); + extern f_return_status f_account_id_user_by_name(const f_string_t name, uid_t *id); #endif // _di_f_account_id_user_by_name_ #ifdef __cplusplus diff --git a/level_0/f_color/c/color.h b/level_0/f_color/c/color.h index c1da063..5f233aa 100644 --- a/level_0/f_color/c/color.h +++ b/level_0/f_color/c/color.h @@ -22,13 +22,13 @@ extern "C" { #define f_color_max_size 7 #endif // _di_f_color_max_size_ -#ifndef _di_f_color_types_ - typedef uint8_t f_color_code; +#ifndef _di_f_color_types_t_ + typedef uint8_t f_color_code_t; #define f_color_code_none 0 #define f_color_code_linux 1 #define f_color_code_xterminal 2 -#endif // _di_f_color_types_ +#endif // _di_f_color_types_t_ /** * Specify color modes. @@ -38,35 +38,35 @@ extern "C" { * The f_color_mode_none define designates that there is no assigned mode (the mode is undefined). * The f_color_mode_no_color define designates that the color mode is set to no color (disable colors). */ -#ifndef _di_f_color_mode_ - typedef uint8_t f_color_mode; +#ifndef _di_f_color_mode_t_ + typedef uint8_t f_color_mode_t; #define f_color_mode_none 0 #define f_color_mode_no_color 1 #define f_color_mode_dark 2 #define f_color_mode_light 3 -#endif // _di_f_color_mode_ +#endif // _di_f_color_mode_t_ /** * The purpose behind these data types are not to dynamically allocate data. * instead, they are intended to only point to existing data, so these should neither be allocated nor deallocated. */ -#ifndef _di_f_color_control_ +#ifndef _di_f_color_control_t_ typedef struct { const int8_t *blink; const int8_t *bold; const int8_t *conceal; const int8_t *reverse; const int8_t *underline; - } f_color_control; + } f_color_control_t; - #define f_color_control_names_initialize { "blink", "bold", "conceal", "reverse", "underline" } -#endif // _di_f_color_control_ + #define f_color_control_t_initialize_names { "blink", "bold", "conceal", "reverse", "underline" } +#endif // _di_f_color_control_t_ /** * strong represents emphasis. */ -#ifndef _di_f_color_standard_io_ +#ifndef _di_f_color_standard_io_t_ typedef struct { const int8_t *error; const int8_t *message; @@ -74,10 +74,10 @@ extern "C" { const int8_t *strong_error; const int8_t *strong_message; const int8_t *strong_warning; - } f_color_standard_io; + } f_color_standard_io_t; - #define f_color_standard_io_names_initialize { "error", "message", "warning", "strong_error", "strong_message", "strong_warning" } -#endif // _di_f_color_standard_io_ + #define f_color_standard_io_t_initialize_names { "error", "message", "warning", "strong_error", "strong_message", "strong_warning" } +#endif // _di_f_color_standard_io_t_ /** * alert = some form of alert such as 'Not Implemented Yet'. @@ -90,7 +90,7 @@ extern "C" { * topic = topic such as 'Usage'. * version = version printed. */ -#ifndef _di_f_color_help_ +#ifndef _di_f_color_help_t_ typedef struct { const int8_t *alert; const int8_t *command; @@ -101,21 +101,21 @@ extern "C" { const int8_t *title; const int8_t *topic; const int8_t *version; - } f_color_help; + } f_color_help_t; - #define f_color_help_names_initialize { "alert", "command", "comment", "emphasize", "standard", "syntax", "title", "topic", "version" } -#endif // _di_f_color_help_ + #define f_color_help_t_initialize_names { "alert", "command", "comment", "emphasize", "standard", "syntax", "title", "topic", "version" } +#endif // _di_f_color_help_t_ -#ifndef _di_f_color_format_ +#ifndef _di_f_color_format_t_ typedef struct { const int8_t *begin; const int8_t *end; const int8_t *medium; - } f_color_format; + } f_color_format_t; - #define f_color_format_initialize_linux { "\033[", "m", ";" } - #define f_color_format_initialize_xterminal { "\033[", "m", ";" } -#endif // _di_f_color_format_ + #define f_color_format_t_initialize_linux { "\033[", "m", ";" } + #define f_color_format_t_initialize_xterminal { "\033[", "m", ";" } +#endif // _di_f_color_format_t_ /** * A structure containing all supported color codes. @@ -123,10 +123,10 @@ extern "C" { * Different system will support a different set. * * Custom initializers are provided for common defaults: - * - f_color_initialize_linux: ideal for linux console. - * - f_color_initialize_xterminal: ideal for linux x-terminal. + * - f_color_t_initialize_linux: ideal for linux console. + * - f_color_t_initialize_xterminal: ideal for linux x-terminal. */ -#ifndef _di_f_color_ +#ifndef _di_f_color_t_ typedef struct { const int8_t *reset; const int8_t *bold; @@ -166,25 +166,25 @@ extern "C" { const int8_t *bright_purple_bg; const int8_t *bright_teal_bg; const int8_t *bright_white_bg; - } f_color; + } f_color_t; - #define f_color_initialize_linux { "0", "1", "4", "5", "7", "8", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47" } - #define f_color_initialize_xterminal { "0", "1", "4", "5", "7", "8", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47", "90", "91", "92", "93", "94", "95", "96", "97", "100", "101", "102", "103", "104", "105", "106", "107" } -#endif // _di_f_color_ + #define f_color_t_initialize_linux { "0", "1", "4", "5", "7", "8", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47" } + #define f_color_t_initialize_xterminal { "0", "1", "4", "5", "7", "8", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47", "90", "91", "92", "93", "94", "95", "96", "97", "100", "101", "102", "103", "104", "105", "106", "107" } +#endif // _di_f_color_t_ /** - * Provide global default global instances of f_color structures. + * Provide global default global instances of f_color_t structures. * * Supported instances: * - f_color_format_linux: ideal for linux console. * - f_color_format_xterminal: ideal for linux x-terminal. */ #ifndef _di_f_color_default_ - static const f_color_format f_color_format_linux = f_color_format_initialize_linux; - static const f_color_format f_color_format_xterminal = f_color_format_initialize_xterminal; + static const f_color_format_t f_color_format_linux = f_color_format_t_initialize_linux; + static const f_color_format_t f_color_format_xterminal = f_color_format_t_initialize_xterminal; - static const f_color f_color_linux = f_color_initialize_linux; - static const f_color f_color_xterminal = f_color_initialize_xterminal; + static const f_color_t f_color_linux = f_color_t_initialize_linux; + static const f_color_t f_color_xterminal = f_color_t_initialize_xterminal; #endif // _di_f_color_default_ #ifdef __cplusplus diff --git a/level_0/f_console/c/console.c b/level_0/f_console/c/console.c index a0d9eb8..e789cee 100644 --- a/level_0/f_console/c/console.c +++ b/level_0/f_console/c/console.c @@ -5,12 +5,12 @@ extern "C" { #endif #ifndef _di_f_console_identify_ - f_return_status f_console_identify(const f_string input, f_console_id *result) { + f_return_status f_console_identify(const f_string_t input, f_console_id_t *result) { #ifndef _di_level_0_parameter_checking_ if (result == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_f - const f_string_length length = strnlen(input, 3); + const f_string_length_t length = strnlen(input, 3); if (length == 0) { *result = f_console_none; @@ -48,26 +48,26 @@ extern "C" { #endif // _di_f_console_identify_ #ifndef _di_f_console_parameter_process_ - f_return_status f_console_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, f_string_lengths *remaining) { + f_return_status f_console_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, f_string_lengths_t *remaining) { #ifndef _di_level_0_parameter_checking_ if (remaining == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; - f_console_id result = 0; + f_status_t status = F_none; + f_console_id_t result = 0; bool found = F_false; unsigned long location = 1; // Parameter 0 represents the program name so skip it. - f_string_length sub_location = 0; - f_string_length increment_by = 0; - f_string_length string_length = 0; - f_array_length i = 0; + f_string_length_t sub_location = 0; + f_string_length_t increment_by = 0; + f_string_length_t string_length = 0; + f_array_length_t i = 0; uint8_t console_short = f_console_none; uint8_t console_long = f_console_none; uint8_t console_type = f_console_type_normal; - f_string_lengths needs_additional = f_string_lengths_initialize; + f_string_lengths_t needs_additional = f_string_lengths_t_initialize; uint8_t width = 0; @@ -79,10 +79,10 @@ extern "C" { i = needs_additional.array[0]; if (parameters.parameter[i].additional.used == parameters.parameter[i].additional.size) { - f_macro_string_lengths_resize(status, parameters.parameter[i].additional, parameters.parameter[i].additional.size + f_console_default_allocation_step); + f_macro_string_lengths_t_resize(status, parameters.parameter[i].additional, parameters.parameter[i].additional.size + f_console_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(needs_additional); + f_macro_string_lengths_t_delete_simple(needs_additional); return status; } } @@ -94,7 +94,7 @@ extern "C" { needs_additional.used--; // Pop the matched parameter off of the top of the needs_additional array. - for (f_string_length i = 0; i < needs_additional.used; i++) { + for (f_string_length_t i = 0; i < needs_additional.used; i++) { needs_additional.array[i] = needs_additional.array[i + 1]; } // for @@ -154,24 +154,24 @@ extern "C" { if (arguments.argv[location][sub_location] != *parameters.parameter[i].symbol_short) continue; if (width > 0) { - f_utf_character character_argument_utf = 0; - f_utf_character character_console_utf = 0; + f_utf_character_t character_argument_utf = 0; + f_utf_character_t character_console_utf = 0; - f_number_unsigned width_max = string_length - sub_location; + f_number_unsigned_t width_max = string_length - sub_location; status = f_utf_char_to_character(arguments.argv[location] + sub_location, width_max, &character_argument_utf); if (status != F_none) { - f_macro_string_lengths_delete_simple(needs_additional); + f_macro_string_lengths_t_delete_simple(needs_additional); return status; } width_max = strlen(parameters.parameter[i].symbol_short); - status = f_utf_char_to_character((f_string) parameters.parameter[i].symbol_short, width_max, &character_console_utf); + status = f_utf_char_to_character((f_string_t) parameters.parameter[i].symbol_short, width_max, &character_console_utf); if (status != F_none) { - f_macro_string_lengths_delete_simple(needs_additional); + f_macro_string_lengths_t_delete_simple(needs_additional); return status; } @@ -194,10 +194,10 @@ extern "C" { } if (parameters.parameter[i].locations.used == parameters.parameter[i].locations.size) { - f_macro_string_lengths_resize(status, parameters.parameter[i].locations, parameters.parameter[i].locations.size + f_console_default_allocation_step); + f_macro_string_lengths_t_resize(status, parameters.parameter[i].locations, parameters.parameter[i].locations.size + f_console_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(needs_additional); + f_macro_string_lengths_t_delete_simple(needs_additional); return status; } } @@ -216,15 +216,15 @@ extern "C" { if (parameters.parameter[i].has_additional) { if (needs_additional.used + parameters.parameter[i].has_additional > needs_additional.size) { - f_macro_string_lengths_resize(status, needs_additional, needs_additional.used + parameters.parameter[i].has_additional); + f_macro_string_lengths_t_resize(status, needs_additional, needs_additional.used + parameters.parameter[i].has_additional); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(needs_additional); + f_macro_string_lengths_t_delete_simple(needs_additional); return status; } } - for (f_array_length additional = 0; additional < parameters.parameter[i].has_additional; additional++) { + for (f_array_length_t additional = 0; additional < parameters.parameter[i].has_additional; additional++) { needs_additional.array[needs_additional.used] = i; needs_additional.used++; } // for @@ -247,10 +247,10 @@ extern "C" { if (strncmp(arguments.argv[location], parameters.parameter[i].symbol_other, string_length + 1) != 0) continue; if (parameters.parameter[i].locations.used == parameters.parameter[i].locations.size) { - f_macro_string_lengths_resize(status, parameters.parameter[i].locations, parameters.parameter[i].locations.size + f_console_default_allocation_step); + f_macro_string_lengths_t_resize(status, parameters.parameter[i].locations, parameters.parameter[i].locations.size + f_console_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(needs_additional); + f_macro_string_lengths_t_delete_simple(needs_additional); return status; } } @@ -265,15 +265,15 @@ extern "C" { if (parameters.parameter[i].has_additional) { if (needs_additional.used + parameters.parameter[i].has_additional > needs_additional.size) { - f_macro_string_lengths_resize(status, needs_additional, needs_additional.used + parameters.parameter[i].has_additional); + f_macro_string_lengths_t_resize(status, needs_additional, needs_additional.used + parameters.parameter[i].has_additional); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(needs_additional); + f_macro_string_lengths_t_delete_simple(needs_additional); return status; } } - for (f_array_length additional = 0; additional < parameters.parameter[i].has_additional; additional++) { + for (f_array_length_t additional = 0; additional < parameters.parameter[i].has_additional; additional++) { needs_additional.array[needs_additional.used] = i; needs_additional.used++; } // for @@ -286,9 +286,9 @@ extern "C" { if (!found) { // populate list of remaining parameters.parameter not associated with anything. if (remaining->used == remaining->size) { - f_macro_memory_structure_macro_increment(status, (*remaining), 1, f_console_default_allocation_step, f_macro_string_lengths_resize, F_buffer_too_large); + f_macro_memory_structure_macro_increment(status, (*remaining), 1, f_console_default_allocation_step, f_macro_string_lengths_t_resize, F_buffer_too_large); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(needs_additional); + f_macro_string_lengths_t_delete_simple(needs_additional); return status; } } @@ -308,14 +308,14 @@ extern "C" { status = F_none; } - f_macro_string_lengths_delete_simple(needs_additional); + f_macro_string_lengths_t_delete_simple(needs_additional); return status; } #endif // _di_f_console_parameter_process_ #ifndef _di_f_console_parameter_prioritize_left_ - f_return_status f_console_parameter_prioritize_left(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision) { + f_return_status f_console_parameter_prioritize_left(const f_console_parameters_t parameters, const f_console_parameter_ids_t choices, f_console_parameter_id_t *decision) { #ifndef _di_level_0_parameter_checking_ if (decision == 0) return F_status_set_error(F_parameter); if (choices.id == 0) return F_status_set_error(F_parameter); @@ -324,11 +324,11 @@ extern "C" { if (choices.used == 0) return F_data_not; if (parameters.used == 0) return F_data_not; - f_array_length location = 0; - f_array_length location_sub = 0; - f_console_parameter_id priority = 0; + f_array_length_t location = 0; + f_array_length_t location_sub = 0; + f_console_parameter_id_t priority = 0; - for (f_array_length i = 0; i < choices.used; i++) { + for (f_array_length_t i = 0; i < choices.used; i++) { if (choices.id[i] > parameters.used) return F_status_set_error(F_parameter); if (parameters.parameter[choices.id[i]].result == f_console_result_found) { @@ -356,7 +356,7 @@ extern "C" { #endif // _di_f_console_parameter_prioritize_left_ #ifndef _di_f_console_parameter_prioritize_right_ - f_return_status f_console_parameter_prioritize_right(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision) { + f_return_status f_console_parameter_prioritize_right(const f_console_parameters_t parameters, const f_console_parameter_ids_t choices, f_console_parameter_id_t *decision) { #ifndef _di_level_0_parameter_checking_ if (decision == 0) return F_status_set_error(F_parameter); if (choices.id == 0) return F_status_set_error(F_parameter); @@ -365,11 +365,11 @@ extern "C" { if (choices.used == 0) return F_data_not; if (parameters.used == 0) return F_data_not; - f_array_length location = 0; - f_array_length location_sub = 0; - f_console_parameter_id priority = 0; + f_array_length_t location = 0; + f_array_length_t location_sub = 0; + f_console_parameter_id_t priority = 0; - for (f_array_length i = 0; i < choices.used; i++) { + for (f_array_length_t i = 0; i < choices.used; i++) { if (choices.id[i] > parameters.used) return F_status_set_error(F_parameter); if (parameters.parameter[choices.id[i]].result == f_console_result_found) { diff --git a/level_0/f_console/c/console.h b/level_0/f_console/c/console.h index 1d151ba..4759efb 100644 --- a/level_0/f_console/c/console.h +++ b/level_0/f_console/c/console.h @@ -139,7 +139,7 @@ extern "C" { * The maximum size for a single parameter. */ #ifndef _di_f_console_length_size_ - #define f_console_length_size f_string_length_size + #define f_console_length_size f_string_length_t_size #endif // _di_f_console_length_size_ /** @@ -162,8 +162,8 @@ extern "C" { * - inverse: parameters using plus sign, such as '++version'. * - other: parameters using neither minus nor plus sign, such as 'build'. */ -#ifndef _di_f_console_types_ - typedef uint16_t f_console_id; +#ifndef _di_f_console_types_t_ + typedef uint16_t f_console_id_t; enum { f_console_result_none = 1, @@ -176,7 +176,7 @@ extern "C" { f_console_type_inverse, f_console_type_other, }; -#endif // _di_f_console_types_ +#endif // _di_f_console_types_t_ /** * Provide a structure for describing console parameters for the console processing functions to use. @@ -200,7 +200,7 @@ extern "C" { * - locations: All locations within argv where this parameter is found (order is preserved). * - additional: An array of locations representing where in the argv[] the additional arguments are found. */ -#ifndef _di_f_console_parameter_ +#ifndef _di_f_console_parameter_t_ typedef struct { const int8_t *symbol_short; const int8_t *symbol_long; @@ -212,54 +212,54 @@ extern "C" { uint8_t result; uint8_t total; - f_string_length location; - f_string_length location_sub; - f_string_lengths locations; - f_string_lengths additional; - } f_console_parameter; + f_string_length_t location; + f_string_length_t location_sub; + f_string_lengths_t locations; + f_string_lengths_t additional; + } f_console_parameter_t; - #define f_console_parameter_initialize(symbol_short, symbol_long, symbol_other, has_additional, type_value) { symbol_short, symbol_long, symbol_other, has_additional, type_value, f_console_result_none, 0, 0, 0, f_string_lengths_initialize, f_string_lengths_initialize } -#endif // _di_f_console_parameter_ + #define f_console_parameter_t_initialize(symbol_short, symbol_long, symbol_other, has_additional, type_value) { symbol_short, symbol_long, symbol_other, has_additional, type_value, f_console_result_none, 0, 0, 0, f_string_lengths_t_initialize, f_string_lengths_t_initialize } +#endif // _di_f_console_parameter_t_ /** * Provide a helper structure for references and processing parameters. * * Designed for passing this to a function as a single argument. * - * parameter: Intended to be populated with an array of f_console_parameter_id whose size is defined by the "used" property. + * parameter: Intended to be populated with an array of f_console_parameter_id_t whose size is defined by the "used" property. * This is not intended to be dynamically allocated, so there is no "size" property. * order: */ -#ifndef _di_f_console_parameters_ +#ifndef _di_f_console_parameters_t_ typedef struct { - f_console_parameter *parameter; + f_console_parameter_t *parameter; - f_array_length used; - } f_console_parameters; + f_array_length_t used; + } f_console_parameters_t; - #define f_console_parameters_initialize { 0, 0 } -#endif // _di_f_console_parameters_ + #define f_console_parameters_t_initialize { 0, 0 } +#endif // _di_f_console_parameters_t_ /** * Provide a helper structure for references and processing standard C main() arguments. * - * The f_console_parameter_id is designed to be used for the enums to represent a any given parameter by the ID. + * The f_console_parameter_id_t is designed to be used for the enums to represent a any given parameter by the ID. * - * The f_console_parameter_ids is designed for passing this to a function as a single argument. - * The "id" property is intended to be populated with an aray of f_console_parameter_id whose size is defined by the "used" property. - * This follows the idea of f_string_dynamic and has a "used" instead of length, but because this is not intended to be dynamically allocated there is no "size" property. + * The f_console_parameter_ids_t is designed for passing this to a function as a single argument. + * The "id" property is intended to be populated with an aray of f_console_parameter_id_t whose size is defined by the "used" property. + * This follows the idea of f_string_dynamic_t and has a "used" instead of length, but because this is not intended to be dynamically allocated there is no "size" property. */ -#ifndef _di_f_console_parameter_id_ - typedef uint16_t f_console_parameter_id; +#ifndef _di_f_console_parameter_id_t_ + typedef uint16_t f_console_parameter_id_t; typedef struct { - f_console_parameter_id *id; + f_console_parameter_id_t *id; - f_array_length used; - } f_console_parameter_ids; + f_array_length_t used; + } f_console_parameter_ids_t; - #define f_console_parameter_ids_initialize { 0, 0 } -#endif // _di_f_console_parameter_id_ + #define f_console_parameter_ids_t_initialize { 0, 0 } +#endif // _di_f_console_parameter_id_t_ /** * Provide a helper structure for referencing the argc and argv standard main arguments. @@ -268,13 +268,13 @@ extern "C" { * * No structure initializer is provided due to the use of constant properties. */ -#ifndef _di_f_console_arguments_ +#ifndef _di_f_console_arguments_t_ typedef struct { - const f_number_unsigned argc; + const f_number_unsigned_t argc; - const f_string *argv; - } f_console_arguments; -#endif // _di_f_console_arguments_ + const f_string_t *argv; + } f_console_arguments_t; +#endif // _di_f_console_arguments_t_ /** * Determine the type code the given input parameter represents. @@ -290,7 +290,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_f_console_identify_ - extern f_return_status f_console_identify(const f_string input, f_console_id *result); + extern f_return_status f_console_identify(const f_string_t input, f_console_id_t *result); #endif // _di_f_console_identify_ /** @@ -334,7 +334,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_f_console_parameter_process_ - extern f_return_status f_console_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, f_string_lengths *remaining); + extern f_return_status f_console_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, f_string_lengths_t *remaining); #endif // _di_f_console_parameter_process_ /** @@ -364,7 +364,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_console_parameter_prioritize_left_ - extern f_return_status f_console_parameter_prioritize_left(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision); + extern f_return_status f_console_parameter_prioritize_left(const f_console_parameters_t parameters, const f_console_parameter_ids_t choices, f_console_parameter_id_t *decision); #endif // _di_f_console_parameter_prioritize_left_ /** @@ -394,7 +394,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_console_parameter_prioritize_right_ - extern f_return_status f_console_parameter_prioritize_right(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision); + extern f_return_status f_console_parameter_prioritize_right(const f_console_parameters_t parameters, const f_console_parameter_ids_t choices, f_console_parameter_id_t *decision); #endif // _di_f_console_parameter_prioritize_right_ #ifdef __cplusplus diff --git a/level_0/f_conversion/c/conversion.c b/level_0/f_conversion/c/conversion.c index b4ab419..410b961 100644 --- a/level_0/f_conversion/c/conversion.c +++ b/level_0/f_conversion/c/conversion.c @@ -74,7 +74,7 @@ extern "C" { #endif // _di_f_conversion_character_is_octal_ #ifndef _di_f_conversion_character_to_binary_ - f_return_status f_conversion_character_to_binary(const int8_t character, f_number_unsigned *number) { + f_return_status f_conversion_character_to_binary(const int8_t character, f_number_unsigned_t *number) { #ifndef _di_level_0_parameter_checking_ if (number == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -91,7 +91,7 @@ extern "C" { #endif // _di_f_conversion_character_to_binary_ #ifndef _di_f_conversion_character_to_decimal_ - f_return_status f_conversion_character_to_decimal(const int8_t character, f_number_unsigned *number) { + f_return_status f_conversion_character_to_decimal(const int8_t character, f_number_unsigned_t *number) { #ifndef _di_level_0_parameter_checking_ if (number == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -116,7 +116,7 @@ extern "C" { #endif // _di_f_conversion_character_to_decimal_ #ifndef _di_f_conversion_character_to_duodecimal_ - f_return_status f_conversion_character_to_duodecimal(const int8_t character, f_number_unsigned *decimal) { + f_return_status f_conversion_character_to_duodecimal(const int8_t character, f_number_unsigned_t *decimal) { #ifndef _di_level_0_parameter_checking_ if (decimal == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -145,7 +145,7 @@ extern "C" { #endif // _di_f_conversion_character_to_duodecimal_ #ifndef _di_f_conversion_character_to_hexidecimal_ - f_return_status f_conversion_character_to_hexidecimal(const int8_t character, f_number_unsigned *decimal) { + f_return_status f_conversion_character_to_hexidecimal(const int8_t character, f_number_unsigned_t *decimal) { #ifndef _di_level_0_parameter_checking_ if (decimal == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -182,7 +182,7 @@ extern "C" { #endif // _di_f_conversion_character_to_hexidecimal_ #ifndef _di_f_conversion_character_to_octal_ - f_return_status f_conversion_character_to_octal(const int8_t character, f_number_unsigned *number) { + f_return_status f_conversion_character_to_octal(const int8_t character, f_number_unsigned_t *number) { #ifndef _di_level_0_parameter_checking_ if (number == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -205,16 +205,16 @@ extern "C" { #endif // _di_f_conversion_character_to_octal_ #ifndef _di_f_conversion_number_signed_to_string_ - f_return_status f_conversion_number_signed_to_string(const f_number_signed number, const uint8_t base, f_string_dynamic *destination) { + f_return_status f_conversion_number_signed_to_string(const f_number_signed_t number, const uint8_t base, f_string_dynamic_t *destination) { #ifndef _di_level_0_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); if (base < 2 || base > 16) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; if (number == 0) { - f_macro_string_dynamic_resize(status, (*destination), destination->used + 2); + f_macro_string_dynamic_t_resize(status, (*destination), destination->used + 2); if (F_status_is_error(status)) return status; destination->string[destination->used] = '0'; @@ -225,30 +225,30 @@ extern "C" { } bool negative = F_false; - f_number_unsigned current = number; + f_number_unsigned_t current = number; if (number < 0) { current = 0 - number; negative = F_true; } - f_string_length total = 0; + f_string_length_t total = 0; - for (register f_number_signed work = current; work; total++) { + for (register f_number_signed_t work = current; work; total++) { work /= base; } // for if (negative) { - f_macro_string_dynamic_resize(status, (*destination), destination->used + total + 2); + f_macro_string_dynamic_t_resize(status, (*destination), destination->used + total + 2); } else { - f_macro_string_dynamic_resize(status, (*destination), destination->used + total + 1); + f_macro_string_dynamic_t_resize(status, (*destination), destination->used + total + 1); } if (F_status_is_error(status)) return status; - f_number_unsigned work = 0; - f_number_unsigned power = 1; + f_number_unsigned_t work = 0; + f_number_unsigned_t power = 1; if (negative) { destination->string[destination->used] = '-'; @@ -326,16 +326,16 @@ extern "C" { #endif // _di_f_conversion_decimal_signed_to_string_ #ifndef _di_f_conversion_number_unsigned_to_string_ - f_return_status f_conversion_number_unsigned_to_string(const f_number_unsigned number, const uint8_t base, f_string_dynamic *destination) { + f_return_status f_conversion_number_unsigned_to_string(const f_number_unsigned_t number, const uint8_t base, f_string_dynamic_t *destination) { #ifndef _di_level_0_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); if (base < 2 || base > 16) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; if (number == 0) { - f_macro_string_dynamic_resize(status, (*destination), destination->used + 2); + f_macro_string_dynamic_t_resize(status, (*destination), destination->used + 2); if (F_status_is_error(status)) return status; destination->string[destination->used] = '0'; @@ -345,18 +345,18 @@ extern "C" { return F_none; } - f_string_length total = 0; + f_string_length_t total = 0; - for (register f_number_unsigned work = number; work; total++) { + for (register f_number_unsigned_t work = number; work; total++) { work /= base; } // for - f_macro_string_dynamic_resize(status, (*destination), destination->used + total + 1); + f_macro_string_dynamic_t_resize(status, (*destination), destination->used + total + 1); if (F_status_is_error(status)) return status; - f_number_unsigned current = number; - f_number_unsigned work = 0; - f_number_unsigned power = 1; + f_number_unsigned_t current = number; + f_number_unsigned_t work = 0; + f_number_unsigned_t power = 1; for (register uint8_t i = 1; i < total; i++) { power *= base; diff --git a/level_0/f_conversion/c/conversion.h b/level_0/f_conversion/c/conversion.h index 9903840..7bef680 100644 --- a/level_0/f_conversion/c/conversion.h +++ b/level_0/f_conversion/c/conversion.h @@ -32,7 +32,7 @@ extern "C" { * * 64-bit is the designed default. */ -#ifndef _di_f_type_number_64_ +#ifndef _di_f_type_number_64_t_ #define f_conversion_scale_binary_unsigned 64 #define f_conversion_scale_binary_signed 63 @@ -47,9 +47,9 @@ extern "C" { #define f_conversion_scale_hexidecimal_unsigned 15 #define f_conversion_scale_hexidecimal_signed 15 -#endif // _di_f_type_number_64_ +#endif // _di_f_type_number_64_t_ -#ifdef _en_f_type_number_32_ +#ifdef _en_f_type_number_32_t_ #define f_conversion_scale_binary_unsigned 32 #define f_conversion_scale_binary_signed 31 @@ -64,9 +64,9 @@ extern "C" { #define f_conversion_scale_hexidecimal_unsigned 7 #define f_conversion_scale_hexidecimal_signed 7 -#endif // _en_f_type_number_32_ +#endif // _en_f_type_number_32_t_ -#ifdef _en_f_type_number_128_ +#ifdef _en_f_type_number_128_t_ #define f_conversion_scale_binary_unsigned 128 #define f_conversion_scale_binary_signed 127 @@ -81,7 +81,7 @@ extern "C" { #define f_conversion_scale_hexidecimal_unsigned 31 #define f_conversion_scale_hexidecimal_signed 31 -#endif // _en_f_type_number_128_ +#endif // _en_f_type_number_128_t_ /** * Convert a single character into the binary digit that it represents. @@ -168,7 +168,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_binary_ - extern f_return_status f_conversion_character_to_binary(const int8_t character, f_number_unsigned *number); + extern f_return_status f_conversion_character_to_binary(const int8_t character, f_number_unsigned_t *number); #endif // _di_f_conversion_character_to_binary_ /** @@ -186,7 +186,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_decimal_ - extern f_return_status f_conversion_character_to_decimal(const int8_t character, f_number_unsigned *number); + extern f_return_status f_conversion_character_to_decimal(const int8_t character, f_number_unsigned_t *number); #endif // _di_f_conversion_character_to_decimal_ /** @@ -204,7 +204,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_duodecimal_ - extern f_return_status f_conversion_character_to_duodecimal(const int8_t character, f_number_unsigned *number); + extern f_return_status f_conversion_character_to_duodecimal(const int8_t character, f_number_unsigned_t *number); #endif // _di_f_conversion_character_to_duodecimal_ /** @@ -222,7 +222,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_hexidecimal_ - extern f_return_status f_conversion_character_to_hexidecimal(const int8_t character, f_number_unsigned *number); + extern f_return_status f_conversion_character_to_hexidecimal(const int8_t character, f_number_unsigned_t *number); #endif // _di_f_conversion_character_to_hexidecimal_ /** @@ -240,7 +240,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_octal_ - extern f_return_status f_conversion_character_to_octal(const int8_t character, f_number_unsigned *number); + extern f_return_status f_conversion_character_to_octal(const int8_t character, f_number_unsigned_t *number); #endif // _di_f_conversion_character_to_octal_ /** @@ -263,7 +263,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_f_conversion_number_signed_to_string_ - extern f_return_status f_conversion_number_signed_to_string(const f_number_signed number, const uint8_t base, f_string_dynamic *destination); + extern f_return_status f_conversion_number_signed_to_string(const f_number_signed_t number, const uint8_t base, f_string_dynamic_t *destination); #endif // _di_f_conversion_number_signed_to_string_ /** @@ -286,7 +286,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_f_conversion_number_unsigned_to_string_ - extern f_return_status f_conversion_number_unsigned_to_string(const f_number_unsigned number, const uint8_t base, f_string_dynamic *destination); + extern f_return_status f_conversion_number_unsigned_to_string(const f_number_unsigned_t number, const uint8_t base, f_string_dynamic_t *destination); #endif // _di_f_conversion_number_unsigned_to_string_ #ifdef __cplusplus diff --git a/level_0/f_directory/c/directory.c b/level_0/f_directory/c/directory.c index 8ed053b..0e34916 100644 --- a/level_0/f_directory/c/directory.c +++ b/level_0/f_directory/c/directory.c @@ -6,13 +6,13 @@ extern "C" { #endif #ifndef _di_f_directory_create_ - f_return_status f_directory_create(const f_string path, const mode_t mode) { + f_return_status f_directory_create(const f_string_t path, const mode_t mode) { return private_f_directory_create(path, mode); } #endif // _di_f_directory_create_ #ifndef _di_f_directory_create_at_ - f_return_status f_directory_create_at(const int at_id, const f_string path, const mode_t mode) { + f_return_status f_directory_create_at(const int at_id, const f_string_t path, const mode_t mode) { #ifndef _di_level_0_parameter_checking_ if (at_id <= 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -22,7 +22,7 @@ extern "C" { #endif // _di_f_directory_create_at_ #ifndef _di_f_directory_exists_ - f_return_status f_directory_exists(const f_string path) { + f_return_status f_directory_exists(const f_string_t path) { struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); @@ -47,7 +47,7 @@ extern "C" { #endif // _di_f_directory_exists_ #ifndef _di_f_directory_exists_at_ - f_return_status f_directory_exists_at(const int at_id, const f_string path, const int flag) { + f_return_status f_directory_exists_at(const int at_id, const f_string_t path, const int flag) { struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); @@ -73,7 +73,7 @@ extern "C" { #endif // _di_f_directory_exists_at_ #ifndef _di_f_directory_is_ - f_return_status f_directory_is(const f_string path) { + f_return_status f_directory_is(const f_string_t path) { struct stat file_stat; memset(&file_stat, AT_SYMLINK_NOFOLLOW, sizeof(struct stat)); @@ -98,7 +98,7 @@ extern "C" { #endif // _di_f_directory_is_ #ifndef _di_f_directory_is_at_ - f_return_status f_directory_is_at(const int at_id, const f_string path, const int flag) { + f_return_status f_directory_is_at(const int at_id, const f_string_t path, const int flag) { struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); @@ -124,15 +124,15 @@ extern "C" { #endif // _di_f_directory_is_at_ #ifndef _di_f_directory_list_ - f_return_status f_directory_list(const f_string path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), f_string_dynamics *names) { + f_return_status f_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), f_string_dynamics_t *names) { #ifndef _di_level_0_parameter_checking_ if (names == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ struct dirent **listing = 0; size_t i = 0; - f_string_length size = 0; - f_status status = F_none; + f_string_length_t size = 0; + f_status_t status = F_none; const size_t length = scandir(path, &listing, filter, sort); @@ -155,7 +155,7 @@ extern "C" { if (F_status_is_error(status)) break; } - f_macro_string_dynamic_new(status, names->array[names->used], size); + f_macro_string_dynamic_t_new(status, names->array[names->used], size); if (F_status_is_error(status)) break; memcpy(names->array[names->used].string, listing[i]->d_name, size); @@ -179,7 +179,7 @@ extern "C" { #endif // _di_f_directory_list_ #ifndef _di_f_directory_open_ - f_return_status f_directory_open(const f_string path, const bool dereference, int *id) { + f_return_status f_directory_open(const f_string_t path, const bool dereference, int *id) { #ifndef _di_level_0_parameter_checking_ if (id == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -216,7 +216,7 @@ extern "C" { #endif // _di_f_directory_open_ #ifndef _di_f_directory_open_at_ - f_return_status f_directory_open_at(const int at_id, const f_string path, const bool dereference, int *id) { + f_return_status f_directory_open_at(const int at_id, const f_string_t path, const bool dereference, int *id) { #ifndef _di_level_0_parameter_checking_ if (at_id <= 0) return F_status_set_error(F_parameter); if (id == 0) return F_status_set_error(F_parameter); @@ -255,7 +255,7 @@ extern "C" { #endif // _di_f_directory_open_at_ #ifndef _di_f_directory_remove_ - f_return_status f_directory_remove(const f_string path, const int recursion_max, const bool preserve) { + f_return_status f_directory_remove(const f_string_t path, const int recursion_max, const bool preserve) { #ifndef _di_level_0_parameter_checking_ if (recursion_max < 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -302,7 +302,7 @@ extern "C" { #endif // _di_f_directory_remove_ #ifndef _di_f_directory_remove_custom_ - f_return_status f_directory_remove_custom(const f_string path, const int recursion_max, const bool preserve, int (*custom) (const char *, const struct stat *, int, struct FTW *)) { + f_return_status f_directory_remove_custom(const f_string_t path, const int recursion_max, const bool preserve, int (*custom) (const char *, const struct stat *, int, struct FTW *)) { #ifndef _di_level_0_parameter_checking_ if (recursion_max < 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -349,12 +349,12 @@ extern "C" { #endif // _di_f_directory_remove_custom_ #ifndef _di_f_directory_touch_ - f_return_status f_directory_touch(const f_string path, const mode_t mode) { + f_return_status f_directory_touch(const f_string_t path, const mode_t mode) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); @@ -398,12 +398,12 @@ extern "C" { #endif // _di_f_directory_touch_ #ifndef _di_f_directory_touch_at_ - f_return_status f_directory_touch_at(const int at_id, const f_string path, const mode_t mode, const int flag) { + f_return_status f_directory_touch_at(const int at_id, const f_string_t path, const mode_t mode, const int flag) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); diff --git a/level_0/f_directory/c/directory.h b/level_0/f_directory/c/directory.h index 9277ab2..19f998a 100644 --- a/level_0/f_directory/c/directory.h +++ b/level_0/f_directory/c/directory.h @@ -125,7 +125,7 @@ extern "C" { * @see mkdir() */ #ifndef _di_f_directory_create_ - extern f_return_status f_directory_create(const f_string path, const mode_t mode); + extern f_return_status f_directory_create(const f_string_t path, const mode_t mode); #endif // _di_f_directory_create_ /** @@ -159,7 +159,7 @@ extern "C" { * @see mkdirat() */ #ifndef _di_f_directory_create_at_ - extern f_return_status f_directory_create_at(const int at_id, const f_string path, const mode_t mode); + extern f_return_status f_directory_create_at(const int at_id, const f_string_t path, const mode_t mode); #endif // _di_f_directory_create_at_ /** @@ -182,7 +182,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_directory_exists_ - extern f_return_status f_directory_exists(const f_string path); + extern f_return_status f_directory_exists(const f_string_t path); #endif // _di_f_directory_exists_ /** @@ -210,7 +210,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_directory_exists_at_ - extern f_return_status f_directory_exists_at(const int at_id, const f_string path, const int flag); + extern f_return_status f_directory_exists_at(const int at_id, const f_string_t path, const int flag); #endif // _di_f_directory_exists_at_ /** @@ -233,7 +233,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_directory_is_ - extern f_return_status f_directory_is(const f_string path); + extern f_return_status f_directory_is(const f_string_t path); #endif // _di_f_directory_is_ /** @@ -261,7 +261,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_directory_is_at_ - extern f_return_status f_directory_is_at(const int at_id, const f_string path, const int flag); + extern f_return_status f_directory_is_at(const int at_id, const f_string_t path, const int flag); #endif // _di_f_directory_is_at_ /** @@ -294,7 +294,7 @@ extern "C" { * @see versionsort() */ #ifndef _di_f_directory_list_ - extern f_return_status f_directory_list(const f_string path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), f_string_dynamics *names); + extern f_return_status f_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), f_string_dynamics_t *names); #endif // _di_f_directory_list_ /** @@ -332,7 +332,7 @@ extern "C" { * @see open() */ #ifndef _di_f_directory_open_ - extern f_return_status f_directory_open(const f_string path, const bool dereference, int *id); + extern f_return_status f_directory_open(const f_string_t path, const bool dereference, int *id); #endif // _di_f_directory_open_ /** @@ -373,7 +373,7 @@ extern "C" { * @see openat() */ #ifndef _di_f_directory_open_at_ - extern f_return_status f_directory_open_at(const int at_id, const f_string path, const bool dereference, int *id); + extern f_return_status f_directory_open_at(const int at_id, const f_string_t path, const bool dereference, int *id); #endif // _di_f_directory_open_at_ /** @@ -412,7 +412,7 @@ extern "C" { * @see remove() */ #ifndef _di_f_directory_remove_ - extern f_return_status f_directory_remove(const f_string path, const int recursion_max, const bool preserve); + extern f_return_status f_directory_remove(const f_string_t path, const int recursion_max, const bool preserve); #endif // _di_f_directory_remove_ /** @@ -454,7 +454,7 @@ extern "C" { * @see remove() */ #ifndef _di_f_directory_remove_custom_ - extern f_return_status f_directory_remove_custom(const f_string path, const int recursion_max, const bool preserve, int (*custom) (const char *, const struct stat *, int, struct FTW *)); + extern f_return_status f_directory_remove_custom(const f_string_t path, const int recursion_max, const bool preserve, int (*custom) (const char *, const struct stat *, int, struct FTW *)); #endif // _di_f_directory_remove_custom_ /** @@ -492,7 +492,7 @@ extern "C" { * @see utimensat() */ #ifndef _di_f_directory_touch_ - extern f_return_status f_directory_touch(const f_string path, const mode_t mode); + extern f_return_status f_directory_touch(const f_string_t path, const mode_t mode); #endif // _di_f_directory_touch_ /** @@ -534,7 +534,7 @@ extern "C" { * @see utimensat() */ #ifndef _di_f_directory_touch_at_ - extern f_return_status f_directory_touch_at(const int at_id, const f_string path, const mode_t mode, const int flag); + extern f_return_status f_directory_touch_at(const int at_id, const f_string_t path, const mode_t mode, const int flag); #endif // _di_f_directory_touch_at_ #ifdef __cplusplus diff --git a/level_0/f_directory/c/directory_type.h b/level_0/f_directory/c/directory_type.h index fa16113..9393d23 100644 --- a/level_0/f_directory/c/directory_type.h +++ b/level_0/f_directory/c/directory_type.h @@ -25,69 +25,69 @@ extern "C" { * * Each property represents a set of paths grouped by directory entity file type. */ -#ifndef _di_f_directory_listing_ +#ifndef _di_f_directory_listing_t_ typedef struct { - f_string_dynamics block; // S_IFBLK - f_string_dynamics character; // S_IFCHR - f_string_dynamics directory; // S_IFDIR - f_string_dynamics regular; // S_IFREG - f_string_dynamics link; // S_IFLNK - f_string_dynamics fifo; // S_IFIFO - f_string_dynamics socket; // S_IFSOCK - f_string_dynamics unknown; - } f_directory_listing; - - #define f_directory_listing_initialize { \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ + f_string_dynamics_t block; // S_IFBLK + f_string_dynamics_t character; // S_IFCHR + f_string_dynamics_t directory; // S_IFDIR + f_string_dynamics_t regular; // S_IFREG + f_string_dynamics_t link; // S_IFLNK + f_string_dynamics_t fifo; // S_IFIFO + f_string_dynamics_t socket; // S_IFSOCK + f_string_dynamics_t unknown; + } f_directory_listing_t; + + #define f_directory_listing_t_initialize { \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ } - #define f_macro_directory_listing_delete(status, listing) \ - f_macro_string_dynamics_delete(status, listing.block) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_delete(status, listing.character) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_delete(status, listing.directory) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_delete(status, listing.regular) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_delete(status, listing.link) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_delete(status, listing.fifo) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_delete(status, listing.socket) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_delete(status, listing.unknown) - - #define f_macro_directory_listing_destroy(status, listing) \ - f_macro_string_dynamics_destroy(status, listing.block) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_destroy(status, listing.character) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_destroy(status, listing.directory) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_destroy(status, listing.regular) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_destroy(status, listing.link) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_destroy(status, listing.fifo) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_destroy(status, listing.socket) \ - if (F_status_is_not_error(status)) f_macro_string_dynamics_delete(status, listing.unknown) - - #define f_macro_directory_listing_delete_simple(listing) \ - f_macro_string_dynamics_delete_simple(listing.block) \ - f_macro_string_dynamics_delete_simple(listing.character) \ - f_macro_string_dynamics_delete_simple(listing.directory) \ - f_macro_string_dynamics_delete_simple(listing.regular) \ - f_macro_string_dynamics_delete_simple(listing.link) \ - f_macro_string_dynamics_delete_simple(listing.fifo) \ - f_macro_string_dynamics_delete_simple(listing.socket) \ - f_macro_string_dynamics_delete_simple(listing.unknown) - - #define f_macro_directory_listing_destroy_simple(listing) \ - f_macro_string_dynamics_destroy_simple(listing.block) \ - f_macro_string_dynamics_destroy_simple(listing.character) \ - f_macro_string_dynamics_destroy_simple(listing.directory) \ - f_macro_string_dynamics_destroy_simple(listing.regular) \ - f_macro_string_dynamics_destroy_simple(listing.link) \ - f_macro_string_dynamics_destroy_simple(listing.fifo) \ - f_macro_string_dynamics_destroy_simple(listing.socket) \ - f_macro_string_dynamics_destroy_simple(listing.unknown) -#endif // _di_f_directory_listing_ + #define f_macro_directory_listing_t_delete(status, listing) \ + f_macro_string_dynamics_t_delete(status, listing.block) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_delete(status, listing.character) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_delete(status, listing.directory) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_delete(status, listing.regular) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_delete(status, listing.link) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_delete(status, listing.fifo) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_delete(status, listing.socket) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_delete(status, listing.unknown) + + #define f_macro_directory_listing_t_destroy(status, listing) \ + f_macro_string_dynamics_t_destroy(status, listing.block) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_destroy(status, listing.character) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_destroy(status, listing.directory) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_destroy(status, listing.regular) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_destroy(status, listing.link) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_destroy(status, listing.fifo) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_destroy(status, listing.socket) \ + if (F_status_is_not_error(status)) f_macro_string_dynamics_t_delete(status, listing.unknown) + + #define f_macro_directory_listing_t_delete_simple(listing) \ + f_macro_string_dynamics_t_delete_simple(listing.block) \ + f_macro_string_dynamics_t_delete_simple(listing.character) \ + f_macro_string_dynamics_t_delete_simple(listing.directory) \ + f_macro_string_dynamics_t_delete_simple(listing.regular) \ + f_macro_string_dynamics_t_delete_simple(listing.link) \ + f_macro_string_dynamics_t_delete_simple(listing.fifo) \ + f_macro_string_dynamics_t_delete_simple(listing.socket) \ + f_macro_string_dynamics_t_delete_simple(listing.unknown) + + #define f_macro_directory_listing_t_destroy_simple(listing) \ + f_macro_string_dynamics_t_destroy_simple(listing.block) \ + f_macro_string_dynamics_t_destroy_simple(listing.character) \ + f_macro_string_dynamics_t_destroy_simple(listing.directory) \ + f_macro_string_dynamics_t_destroy_simple(listing.regular) \ + f_macro_string_dynamics_t_destroy_simple(listing.link) \ + f_macro_string_dynamics_t_destroy_simple(listing.fifo) \ + f_macro_string_dynamics_t_destroy_simple(listing.socket) \ + f_macro_string_dynamics_t_destroy_simple(listing.unknown) +#endif // _di_f_directory_listing_t_ /** * An association of a path and a status code. @@ -97,29 +97,29 @@ extern "C" { * status: the status code. * path: the dynamically allocated path associated with the status code. */ -#ifndef _di_f_directory_status_ +#ifndef _di_f_directory_status_t_ typedef struct { - f_status status; - f_string_dynamic path; - } f_directory_status; + f_status_t status; + f_string_dynamic_t path; + } f_directory_status_t; - #define f_directory_status_initialize { 0, f_string_dynamic_initialize } + #define f_directory_status_t_initialize { 0, f_string_dynamic_t_initialize } - #define f_macro_directory_status_clear(directory) \ + #define f_macro_directory_status_t_clear(directory) \ directory.status = 0; \ - f_macro_string_dynamic_clear(directory.path); + f_macro_string_dynamic_t_clear(directory.path); - #define f_macro_directory_status_new(status, statuses, length) f_macro_string_dynamic_new(status, statuses.path, length) + #define f_macro_directory_status_t_new(status, statuses, length) f_macro_string_dynamic_t_new(status, statuses.path, length) - #define f_macro_directory_status_delete(status, statuses) f_macro_string_dynamic_delete(status, statuses.path) - #define f_macro_directory_status_destroy(status, statuses) f_macro_string_dynamic_destroy(status, statuses.path) + #define f_macro_directory_status_t_delete(status, statuses) f_macro_string_dynamic_t_delete(status, statuses.path) + #define f_macro_directory_status_t_destroy(status, statuses) f_macro_string_dynamic_t_destroy(status, statuses.path) - #define f_macro_directory_status_delete_simple(statuses) f_macro_string_dynamic_delete_simple(statuses.path) - #define f_macro_directory_status_destroy_simple(statuses) f_macro_string_dynamic_destroy_simple(statuses.path) + #define f_macro_directory_status_t_delete_simple(statuses) f_macro_string_dynamic_t_delete_simple(statuses.path) + #define f_macro_directory_status_t_destroy_simple(statuses) f_macro_string_dynamic_t_destroy_simple(statuses.path) - #define f_macro_directory_status_resize(status, statuses, new_length) f_macro_string_dynamic_resize(status, statuses.path, new_length) - #define f_macro_directory_status_adjust(status, statuses, new_length) f_macro_string_dynamic_adjust(status, statuses.path, new_length) -#endif // _di_f_directory_status_ + #define f_macro_directory_status_t_resize(status, statuses, new_length) f_macro_string_dynamic_t_resize(status, statuses.path, new_length) + #define f_macro_directory_status_t_adjust(status, statuses, new_length) f_macro_string_dynamic_t_adjust(status, statuses.path, new_length) +#endif // _di_f_directory_status_t_ /** * An array of directory status. @@ -128,103 +128,103 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_f_directory_statuss_ +#ifndef _di_f_directory_statuss_t_ typedef struct { - f_directory_status *array; - f_array_length size; - f_array_length used; - } f_directory_statuss; + f_directory_status_t *array; + f_array_length_t size; + f_array_length_t used; + } f_directory_statuss_t; - #define f_directory_statuss_initialize { 0, 0, 0 } + #define f_directory_statuss_t_initialize { 0, 0, 0 } - #define f_macro_directory_statuss_clear(structures) f_macro_memory_structures_clear(structures) + #define f_macro_directory_statuss_t_clear(structures) f_macro_memory_structures_t_clear(structures) - #define f_macro_directory_statuss_new(status, structures, length) f_macro_memory_structures_new(status, structures, f_directory_status, length) + #define f_macro_directory_statuss_t_new(status, structures, length) f_macro_memory_structures_t_new(status, structures, f_directory_status_t, length) - #define f_macro_directory_statuss_delete(status, structures) \ + #define f_macro_directory_statuss_t_delete(status, structures) \ status = F_none; \ structures.used = structures.size; \ while (structures.used > 0) { \ structures.used--; \ - f_macro_directory_status_delete(status, structures.array[structures.used]); \ + f_macro_directory_status_t_delete(status, structures.array[structures.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & structures.array, sizeof(f_directory_status), structures.size); \ + if (status == F_none) status = f_memory_delete((void **) & structures.array, sizeof(f_directory_status_t), structures.size); \ if (status == F_none) structures.size = 0; - #define f_macro_directory_statuss_destroy(status, structures) \ + #define f_macro_directory_statuss_t_destroy(status, structures) \ status = F_none; \ structures.used = structures.size; \ while (structures.used > 0) { \ structures.used--; \ - f_macro_directory_status_destroy(status, structures.array[structures.used]); \ + f_macro_directory_status_t_destroy(status, structures.array[structures.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_destroy((void **) & structures.array, sizeof(f_directory_status), structures.size); \ + if (status == F_none) status = f_memory_destroy((void **) & structures.array, sizeof(f_directory_status_t), structures.size); \ if (status == F_none) structures.size = 0; - #define f_macro_directory_statuss_delete_simple(structures) \ + #define f_macro_directory_statuss_t_delete_simple(structures) \ structures.used = structures.size; \ while (structures.used > 0) { \ structures.used--; \ - f_macro_directory_status_delete_simple(structures.array[structures.used]); \ + f_macro_directory_status_t_delete_simple(structures.array[structures.used]); \ } \ if (structures.used == 0) { \ - if (f_memory_delete((void **) & structures.array, sizeof(f_directory_status), structures.size)) { \ + if (f_memory_delete((void **) & structures.array, sizeof(f_directory_status_t), structures.size)) { \ structures.size = 0; \ } \ } - #define f_macro_directory_statuss_destroy_simple(structures) \ + #define f_macro_directory_statuss_t_destroy_simple(structures) \ structures.used = structures.size; \ while (structures.used > 0) { \ structures.used--; \ - f_macro_directory_status_destroy_simple(structures.array[structures.used]); \ + f_macro_directory_status_t_destroy_simple(structures.array[structures.used]); \ } \ if (structures.used == 0) { \ - if (f_memory_destroy((void **) & structures.array, sizeof(f_directory_status), structures.size)) { \ + if (f_memory_destroy((void **) & structures.array, sizeof(f_directory_status_t), structures.size)) { \ structures.size = 0; \ } \ } - #define f_macro_directory_statuss_resize(status, structures, new_length) \ + #define f_macro_directory_statuss_t_resize(status, structures, new_length) \ status = F_none; \ if (new_length < structures.size) { \ - for (f_array_length _macro__i = structures.size - new_length; _macro__i < structures.size; _macro__i++) { \ - f_macro_directory_status_delete(status, structures.array[_macro__i]); \ + for (f_array_length_t _macro__i = structures.size - new_length; _macro__i < structures.size; _macro__i++) { \ + f_macro_directory_status_t_delete(status, structures.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(f_directory_status), structures.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(f_directory_status_t), structures.size, new_length); \ if (status == F_none) { \ if (new_length > structures.size) { \ - for (f_array_length _macro__i = structures.size; _macro__i < new_length; _macro__i++) { \ - memset(&structures.array[_macro__i], 0, sizeof(f_directory_status)); \ + for (f_array_length_t _macro__i = structures.size; _macro__i < new_length; _macro__i++) { \ + memset(&structures.array[_macro__i], 0, sizeof(f_directory_status_t)); \ } \ } \ structures.size = new_length; \ if (structures.used > structures.size) structures.used = new_length; \ } - #define f_macro_directory_statuss_adjust(status, structures, new_length) \ + #define f_macro_directory_statuss_t_adjust(status, structures, new_length) \ status = F_none; \ if (new_length < structures.size) { \ - for (f_array_length _macro__i = structures.size - new_length; _macro__i < structures.size; _macro__i++) { \ - f_macro_directory_status_destroy(status, structures.array[_macro__i]); \ + for (f_array_length_t _macro__i = structures.size - new_length; _macro__i < structures.size; _macro__i++) { \ + f_macro_directory_status_t_destroy(status, structures.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & structures.array, sizeof(f_directory_status), structures.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & structures.array, sizeof(f_directory_status_t), structures.size, new_length); \ if (status == F_none) { \ if (new_length > structures.size) { \ - for (f_array_length _macro__i = structures.size; _macro__i < new_length; _macro__i++) { \ - memset(&structures.array[_macro__i], 0, sizeof(f_directory_status)); \ + for (f_array_length_t _macro__i = structures.size; _macro__i < new_length; _macro__i++) { \ + memset(&structures.array[_macro__i], 0, sizeof(f_directory_status_t)); \ } \ } \ structures.size = new_length; \ if (structures.used > structures.size) structures.used = new_length; \ } -#endif // _di_f_directory_statuss_ +#endif // _di_f_directory_statuss_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_directory/c/private-directory.c b/level_0/f_directory/c/private-directory.c index d631dec..8caa5e3 100644 --- a/level_0/f_directory/c/private-directory.c +++ b/level_0/f_directory/c/private-directory.c @@ -6,7 +6,7 @@ extern "C" { #endif #if !defined(_di_f_directory_create_) || !defined(_di_f_directory_touch_) - f_return_status private_f_directory_create(const f_string path, const mode_t mode) { + f_return_status private_f_directory_create(const f_string_t path, const mode_t mode) { if (mkdir(path, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -32,7 +32,7 @@ extern "C" { #endif // !defined(_di_f_directory_create_) || !defined(_di_f_directory_touch_) #if !defined(_di_f_directory_create_at_) || !defined(_di_f_directory_touch_at_) - f_return_status private_f_directory_create_at(const int at_id, const f_string path, const mode_t mode) { + f_return_status private_f_directory_create_at(const int at_id, const f_string_t path, const mode_t mode) { if (mkdirat(at_id, path, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); diff --git a/level_0/f_directory/c/private-directory.h b/level_0/f_directory/c/private-directory.h index 51eb71e..305f2fd 100644 --- a/level_0/f_directory/c/private-directory.h +++ b/level_0/f_directory/c/private-directory.h @@ -45,7 +45,7 @@ extern "C" { * @see f_directory_touch() */ #if !defined(_di_f_directory_create_) || !defined(_di_f_directory_touch_) - extern f_return_status private_f_directory_create(const f_string path, const mode_t mode) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_directory_create(const f_string_t path, const mode_t mode) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_directory_create_) || !defined(_di_f_directory_touch_) /** @@ -82,7 +82,7 @@ extern "C" { * @see f_directory_touch_at() */ #if !defined(_di_f_directory_create_at_) || !defined(_di_f_directory_touch_at_) - extern f_return_status private_f_directory_create_at(const int at_id, const f_string path, const mode_t mode) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_directory_create_at(const int at_id, const f_string_t path, const mode_t mode) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_directory_create_at_) || !defined(_di_f_directory_touch_at_) /** diff --git a/level_0/f_environment/c/environment.c b/level_0/f_environment/c/environment.c index 76313d9..2a62111 100644 --- a/level_0/f_environment/c/environment.c +++ b/level_0/f_environment/c/environment.c @@ -16,13 +16,13 @@ extern "C" { #endif // _di_f_environment_clear_ #ifndef _di_f_environment_get_ - f_return_status f_environment_get(const f_string name, f_string_dynamic *value) { + f_return_status f_environment_get(const f_string_t name, f_string_dynamic_t *value) { return private_f_environment_get(name, value); } #endif // _di_f_environment_get_ #ifndef _di_f_environment_get_dynamic_ - f_return_status f_environment_get_dynamic(const f_string_static name, f_string_dynamic *value) { + f_return_status f_environment_get_dynamic(const f_string_static_t name, f_string_dynamic_t *value) { #ifndef _di_level_0_parameter_checking_ if (name.used > name.size) return F_status_set_error(F_parameter); if (value->used > value->size) return F_status_set_error(F_parameter); @@ -44,13 +44,13 @@ extern "C" { #endif // _di_f_environment_get_dynamic_ #ifndef _di_f_environment_set_ - f_return_status f_environment_set(const f_string name, const f_string value, const bool replace) { + f_return_status f_environment_set(const f_string_t name, const f_string_t value, const bool replace) { return private_f_environment_set(name, value, replace); } #endif // _di_f_environment_set_ #ifndef _di_f_environment_set_dynamic_ - f_return_status f_environment_set_dynamic(const f_string_static name, const f_string_static value, const bool replace) { + f_return_status f_environment_set_dynamic(const f_string_static_t name, const f_string_static_t value, const bool replace) { #ifndef _di_level_0_parameter_checking_ if (name.used > name.size) return F_status_set_error(F_parameter); if (value.used > value.size) return F_status_set_error(F_parameter); @@ -96,13 +96,13 @@ extern "C" { #endif // _di_f_environment_set_dynamic_ #ifndef _di_f_environment_unset_ - f_return_status f_environment_unset(const f_string name) { + f_return_status f_environment_unset(const f_string_t name) { return private_f_environment_unset(name); } #endif // _di_f_environment_unset_ #ifndef _di_f_environment_unset_ - f_return_status f_environment_unset_dynamic(const f_string_static name) { + f_return_status f_environment_unset_dynamic(const f_string_static_t name) { #ifndef _di_level_0_parameter_checking_ if (name.used > name.size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ diff --git a/level_0/f_environment/c/environment.h b/level_0/f_environment/c/environment.h index be12382..ff104d2 100644 --- a/level_0/f_environment/c/environment.h +++ b/level_0/f_environment/c/environment.h @@ -28,7 +28,7 @@ extern "C" { * Environment related defines. */ #ifndef _di_f_environment_defines_ - #define f_environment_max_length f_string_length_size + #define f_environment_max_length f_string_length_t_size #endif // _di_f_environment_defines_ /** @@ -67,7 +67,7 @@ extern "C" { * @see getenv() */ #ifndef _di_f_environment_get_ - extern f_return_status f_environment_get(const f_string name, f_string_dynamic *value); + extern f_return_status f_environment_get(const f_string_t name, f_string_dynamic_t *value); #endif // _di_f_environment_get_ /** @@ -95,7 +95,7 @@ extern "C" { * @see getenv() */ #ifndef _di_f_environment_get_dynamic_ - extern f_return_status f_environment_get_dynamic(const f_string_static name, f_string_dynamic *value); + extern f_return_status f_environment_get_dynamic(const f_string_static_t name, f_string_dynamic_t *value); #endif // _di_f_environment_get_dynamic_ /** @@ -123,7 +123,7 @@ extern "C" { * @see setenv() */ #ifndef _di_f_environment_set_ - extern f_return_status f_environment_set(const f_string name, const f_string value, const bool replace); + extern f_return_status f_environment_set(const f_string_t name, const f_string_t value, const bool replace); #endif // _di_f_environment_set_ /** @@ -153,7 +153,7 @@ extern "C" { * @see setenv() */ #ifndef _di_f_environment_set_dynamic_ - extern f_return_status f_environment_set_dynamic(const f_string_static name, const f_string_static value, const bool replace); + extern f_return_status f_environment_set_dynamic(const f_string_static_t name, const f_string_static_t value, const bool replace); #endif // _di_f_environment_set_dynamic_ /** @@ -173,7 +173,7 @@ extern "C" { * @see unsetenv() */ #ifndef _di_f_environment_unset_ - extern f_return_status f_environment_unset(const f_string name); + extern f_return_status f_environment_unset(const f_string_t name); #endif // _di_f_environment_unset_ /** @@ -194,7 +194,7 @@ extern "C" { * @see unsetenv() */ #ifndef _di_f_environment_unset_dynamic_ - extern f_return_status f_environment_unset_dynamic(const f_string_static name); + extern f_return_status f_environment_unset_dynamic(const f_string_static_t name); #endif // _di_f_environment_unset_dynamic_ #ifdef __cplusplus diff --git a/level_0/f_environment/c/private-environment.c b/level_0/f_environment/c/private-environment.c index 9e93a2f..3004d01 100644 --- a/level_0/f_environment/c/private-environment.c +++ b/level_0/f_environment/c/private-environment.c @@ -6,14 +6,14 @@ extern "C" { #endif #if !defined(_di_f_environment_get_) || !defined(_di_f_environment_get_dynamic_) - f_return_status private_f_environment_get(const f_string name, f_string_dynamic *value) { - const f_string result = getenv(name); + f_return_status private_f_environment_get(const f_string_t name, f_string_dynamic_t *value) { + const f_string_t result = getenv(name); if (result == 0) { return F_exist_not; } - const f_string_length size = strnlen(result, f_environment_max_length); + const f_string_length_t size = strnlen(result, f_environment_max_length); if (size == 0) { value->used = 0; @@ -24,9 +24,9 @@ extern "C" { } if (value->used + size > value->size) { - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_resize(status, (*value), size); + f_macro_string_dynamic_t_resize(status, (*value), size); if (F_status_is_error(status)) return status; } @@ -39,7 +39,7 @@ extern "C" { #endif // !defined(_di_f_environment_get_) || !defined(_di_f_environment_get_dynamic_) #if !defined(_di_f_environment_set_) || !defined(_di_f_environment_set_dynamic_) - f_return_status private_f_environment_set(const f_string name, const f_string value, const bool replace) { + f_return_status private_f_environment_set(const f_string_t name, const f_string_t value, const bool replace) { if (setenv(name, value, replace) < 0) { if (errno == EINVAL) { return F_status_set_error(F_invalid); @@ -56,7 +56,7 @@ extern "C" { #endif // !defined(_di_f_environment_set_) || !defined(_di_f_environment_set_dynamic_) #if !defined(_di_f_environment_unset_) || !defined(_di_f_environment_unset_dynamic_) - f_return_status private_f_environment_unset(const f_string name) { + f_return_status private_f_environment_unset(const f_string_t name) { if (unsetenv(name) < 0) { if (errno == EINVAL) { return F_status_set_error(F_invalid); diff --git a/level_0/f_environment/c/private-environment.h b/level_0/f_environment/c/private-environment.h index f142126..f99f6e4 100644 --- a/level_0/f_environment/c/private-environment.h +++ b/level_0/f_environment/c/private-environment.h @@ -38,7 +38,7 @@ extern "C" { * @see f_environment_get_dynamic() */ #if !defined(_di_f_environment_get_) || !defined(_di_f_environment_get_dynamic_) - extern f_return_status private_f_environment_get(const f_string name, f_string_dynamic *value) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_environment_get(const f_string_t name, f_string_dynamic_t *value) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_environment_get_) || !defined(_di_f_environment_get_dynamic_) /** @@ -65,7 +65,7 @@ extern "C" { * @see f_environment_set_dynamic() */ #if !defined(_di_f_environment_set_) || !defined(_di_f_environment_set_dynamic_) - extern f_return_status private_f_environment_set(const f_string name, const f_string value, const bool replace) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_environment_set(const f_string_t name, const f_string_t value, const bool replace) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_environment_set_) || !defined(_di_f_environment_set_dynamic_) /** @@ -85,7 +85,7 @@ extern "C" { * @see f_environment_unset_dynamic() */ #if !defined(_di_f_environment_unset_) || !defined(_di_f_environment_unset_dynamic_) - extern f_return_status private_f_environment_unset(const f_string name) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_environment_unset(const f_string_t name) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_environment_unset_) || !defined(_di_f_environment_unset_dynamic_) #ifdef __cplusplus diff --git a/level_0/f_file/c/file.c b/level_0/f_file/c/file.c index e932512..f61e07d 100644 --- a/level_0/f_file/c/file.c +++ b/level_0/f_file/c/file.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_f_file_access_ - f_return_status f_file_access(const f_string path) { + f_return_status f_file_access(const f_string_t path) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -29,13 +29,13 @@ extern "C" { #endif // _di_f_file_access_ #ifndef _di_f_file_clone_ - f_return_status f_file_clone(const f_string source, const f_string destination, const bool role, const f_number_unsigned size_block, const bool exclusive) { + f_return_status f_file_clone(const f_string_t source, const f_string_t destination, const bool role, const f_number_unsigned_t size_block, const bool exclusive) { #ifndef _di_level_0_parameter_checking_ if (source == 0) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; struct stat source_stat; memset(&source_stat, 0, sizeof(struct stat)); @@ -94,13 +94,13 @@ extern "C" { #endif // _di_f_file_close_ #ifndef _di_f_file_copy_ - f_return_status f_file_copy(const f_string source, const f_string destination, const f_mode mode, const f_number_unsigned size_block, const bool exclusive) { + f_return_status f_file_copy(const f_string_t source, const f_string_t destination, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive) { #ifndef _di_level_0_parameter_checking_ if (source == 0) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; struct stat source_stat; memset(&source_stat, 0, sizeof(struct stat)); @@ -135,17 +135,17 @@ extern "C" { return F_none; } else if (f_macro_file_type_is_link(source_stat.st_mode)) { - f_string_dynamic target = f_string_dynamic_initialize; + f_string_dynamic_t target = f_string_dynamic_t_initialize; status = private_f_file_link_read(source, source_stat, &target); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(target); + f_macro_string_dynamic_t_delete_simple(target); return status; } status = private_f_file_link(target.string, destination); - f_macro_string_dynamic_delete_simple(target); + f_macro_string_dynamic_t_delete_simple(target); if (F_status_is_error(status)) { if (F_status_set_fine(status) != F_file_found || exclusive) { @@ -203,7 +203,7 @@ extern "C" { #endif // _di_f_file_copy_ #ifndef _di_f_file_create_ - f_return_status f_file_create(const f_string path, const mode_t mode, const bool exclusive) { + f_return_status f_file_create(const f_string_t path, const mode_t mode, const bool exclusive) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -213,7 +213,7 @@ extern "C" { #endif // _di_f_file_create_ #ifndef _di_f_file_create_at_ - f_return_status f_file_create_at(const int at_id, const f_string path, const mode_t mode, const bool exclusive) { + f_return_status f_file_create_at(const int at_id, const f_string_t path, const mode_t mode, const bool exclusive) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -223,7 +223,7 @@ extern "C" { #endif // _di_f_file_create_at_ #ifndef _di_f_file_create_device_ - f_return_status f_file_create_device(const f_string path, const mode_t mode, const unsigned int major, const unsigned int minor) { + f_return_status f_file_create_device(const f_string_t path, const mode_t mode, const unsigned int major, const unsigned int minor) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -240,7 +240,7 @@ extern "C" { #endif // _di_f_file_create_device_ #ifndef _di_f_file_create_device_at_ - f_return_status f_file_create_device_at(const int at_id, const f_string path, const mode_t mode, const unsigned int major, const unsigned int minor) { + f_return_status f_file_create_device_at(const int at_id, const f_string_t path, const mode_t mode, const unsigned int major, const unsigned int minor) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -256,7 +256,7 @@ extern "C" { #endif // _di_f_file_create_device_at_ #ifndef _di_f_file_create_fifo_ - f_return_status f_file_create_fifo(const f_string path, const mode_t mode) { + f_return_status f_file_create_fifo(const f_string_t path, const mode_t mode) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -266,7 +266,7 @@ extern "C" { #endif // _di_f_file_create_fifo_ #ifndef _di_f_file_create_fifo_at_ - f_return_status f_file_create_fifo_at(const int at_id, const f_string path, const mode_t mode) { + f_return_status f_file_create_fifo_at(const int at_id, const f_string_t path, const mode_t mode) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -276,7 +276,7 @@ extern "C" { #endif // _di_f_file_create_fifo_at_ #ifndef _di_f_file_create_node_ - f_return_status f_file_create_node(const f_string path, const mode_t mode, const dev_t device) { + f_return_status f_file_create_node(const f_string_t path, const mode_t mode, const dev_t device) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -290,7 +290,7 @@ extern "C" { #endif // _di_f_file_create_node_ #ifndef _di_f_file_create_node_at_ - f_return_status f_file_create_node_at(const int at_id, const f_string path, const mode_t mode, const dev_t device) { + f_return_status f_file_create_node_at(const int at_id, const f_string_t path, const mode_t mode, const dev_t device) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -304,12 +304,12 @@ extern "C" { #endif // _di_f_file_create_node_at_ #ifndef _di_f_file_exists_ - f_return_status f_file_exists(const f_string path) { + f_return_status f_file_exists(const f_string_t path) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); @@ -327,12 +327,12 @@ extern "C" { #endif // _di_f_file_exists_ #ifndef _di_f_file_exists_at_ - f_return_status f_file_exists_at(const int at_id, const f_string path, const int flag) { + f_return_status f_file_exists_at(const int at_id, const f_string_t path, const int flag) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); @@ -356,7 +356,7 @@ extern "C" { #endif // _di_f_file_flush_ #ifndef _di_f_file_is_ - f_return_status f_file_is(const f_string path, const int type) { + f_return_status f_file_is(const f_string_t path, const int type) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -385,7 +385,7 @@ extern "C" { #endif // _di_f_file_is_ #ifndef _di_f_file_is_at_ - f_return_status f_file_is_at(const int at_id, const f_string path, const int type, const int flag) { + f_return_status f_file_is_at(const int at_id, const f_string_t path, const int type, const int flag) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -415,7 +415,7 @@ extern "C" { #endif // _di_f_file_is_at_ #ifndef _di_f_file_link_ - f_return_status f_file_link(const f_string target, const f_string point) { + f_return_status f_file_link(const f_string_t target, const f_string_t point) { #ifndef _di_level_0_parameter_checking_ if (target == 0) return F_status_set_error(F_parameter); if (point == 0) return F_status_set_error(F_parameter); @@ -426,7 +426,7 @@ extern "C" { #endif // _di_f_file_link_ #ifndef _di_f_file_link_at_ - f_return_status f_file_link_at(const int at_id, const f_string target, const f_string point) { + f_return_status f_file_link_at(const int at_id, const f_string_t target, const f_string_t point) { #ifndef _di_level_0_parameter_checking_ if (target == 0) return F_status_set_error(F_parameter); if (point == 0) return F_status_set_error(F_parameter); @@ -437,7 +437,7 @@ extern "C" { #endif // _di_f_file_link_at_ #ifndef _di_f_file_link_hard_ - f_return_status f_file_link_hard(const f_string target, const f_string point) { + f_return_status f_file_link_hard(const f_string_t target, const f_string_t point) { #ifndef _di_level_0_parameter_checking_ if (target == 0) return F_status_set_error(F_parameter); if (point == 0) return F_status_set_error(F_parameter); @@ -469,7 +469,7 @@ extern "C" { #endif // _di_f_file_link_hard_ #ifndef _di_f_file_link_hard_at_ - f_return_status f_file_link_hard_at(const int at_id_target, const int at_id_point, const f_string target, const f_string point, const int flag) { + f_return_status f_file_link_hard_at(const int at_id_target, const int at_id_point, const f_string_t target, const f_string_t point, const int flag) { #ifndef _di_level_0_parameter_checking_ if (target == 0) return F_status_set_error(F_parameter); if (point == 0) return F_status_set_error(F_parameter); @@ -502,7 +502,7 @@ extern "C" { #endif // _di_f_file_link_hard_at_ #ifndef _di_f_file_link_read_ - f_return_status f_file_link_read(const f_string path, const struct stat link_stat, f_string_dynamic *target) { + f_return_status f_file_link_read(const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (link_stat.st_size == 0) return F_status_set_error(F_parameter); @@ -514,7 +514,7 @@ extern "C" { #endif // _di_f_file_link_read_ #ifndef _di_f_file_link_read_at_ - f_return_status f_file_link_read_at(const int at_id, const f_string path, const struct stat link_stat, f_string_dynamic *target) { + f_return_status f_file_link_read_at(const int at_id, const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) { #ifndef _di_level_0_parameter_checking_ if (link_stat.st_size == 0) return F_status_set_error(F_parameter); if (target == 0) return F_status_set_error(F_parameter); @@ -831,7 +831,7 @@ extern "C" { #endif // _di_f_file_mode_determine_ #ifndef _di_f_file_mode_from_string_ - f_return_status f_file_mode_from_string(const f_string string, const mode_t umask, f_file_mode *mode, uint8_t *replace) { + f_return_status f_file_mode_from_string(const f_string_t string, const mode_t umask, f_file_mode *mode, uint8_t *replace) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (string[0] == 0) return F_status_set_error(F_parameter); @@ -954,7 +954,7 @@ extern "C" { mode_umask |= f_file_mode_block_world & f_file_mode_mask_bit_execute; } - for (f_string_length i = 0; syntax && string[i]; i++) { + for (f_string_length_t i = 0; syntax && string[i]; i++) { switch (string[i]) { case 'o': @@ -1089,7 +1089,7 @@ extern "C" { // 1 = add, 2 = replace, 3 = subtract. uint8_t how = 0; - f_string_length i = 0; + f_string_length_t i = 0; *replace = 0; @@ -1120,7 +1120,7 @@ extern "C" { } if (string[i]) { - f_string_length j = 0; + f_string_length_t j = 0; for (; string[i + j] && j < 4; j++) { @@ -1181,7 +1181,7 @@ extern "C" { #endif // _di_f_file_mode_from_string_ #ifndef _di_f_file_mode_read_ - f_return_status f_file_mode_read(const f_string path, mode_t *mode) { + f_return_status f_file_mode_read(const f_string_t path, mode_t *mode) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (mode == 0) return F_status_set_error(F_parameter); @@ -1191,7 +1191,7 @@ extern "C" { memset(&stat_file, 0, sizeof(struct stat)); - f_status status = private_f_file_stat(path, F_true, &stat_file); + f_status_t status = private_f_file_stat(path, F_true, &stat_file); if (F_status_is_error(status)) { return status; } @@ -1203,7 +1203,7 @@ extern "C" { #endif // _di_f_file_mode_read_ #ifndef _di_f_file_mode_read_at_ - f_return_status f_file_mode_read_at(const int at_id, const f_string path, mode_t *mode) { + f_return_status f_file_mode_read_at(const int at_id, const f_string_t path, mode_t *mode) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (mode == 0) return F_status_set_error(F_parameter); @@ -1213,7 +1213,7 @@ extern "C" { memset(&stat_file, 0, sizeof(struct stat)); - f_status status = private_f_file_stat(path, F_true, &stat_file); + f_status_t status = private_f_file_stat(path, F_true, &stat_file); if (F_status_is_error(status)) { return status; } @@ -1225,7 +1225,7 @@ extern "C" { #endif // _di_f_file_mode_read_at_ #ifndef _di_f_file_mode_set_ - f_return_status f_file_mode_set(const f_string path, const mode_t mode) { + f_return_status f_file_mode_set(const f_string_t path, const mode_t mode) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1235,7 +1235,7 @@ extern "C" { #endif // _di_f_file_mode_set_ #ifndef _di_f_file_mode_set_at_ - f_return_status f_file_mode_set_at(const int at_id, const f_string path, const mode_t mode) { + f_return_status f_file_mode_set_at(const int at_id, const f_string_t path, const mode_t mode) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1257,7 +1257,7 @@ extern "C" { #endif // _di_f_file_mode_determine_ #ifndef _di_f_file_name_base_ - f_return_status f_file_name_base(const f_string path, const f_string_length length, f_string_dynamic *name_base) { + f_return_status f_file_name_base(const f_string_t path, const f_string_length_t length, f_string_dynamic_t *name_base) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (name_base == 0) return F_status_set_error(F_parameter); @@ -1265,23 +1265,23 @@ extern "C" { // POSIX basename() modifies the path, so protect it (and add a terminating NULL). char path_argument[length + 1]; - f_string path_to_name; + f_string_t path_to_name; memcpy(path_argument, path, length); path_argument[length] = 0; path_to_name = basename(path_argument); - f_string_length size = strnlen(path_to_name, length); + f_string_length_t size = strnlen(path_to_name, length); if (name_base->used + size > name_base->size) { - if (name_base->used + size > f_string_length_size) { + if (name_base->used + size > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_resize(status, (*name_base), name_base->used + size); + f_macro_string_dynamic_t_resize(status, (*name_base), name_base->used + size); if (F_status_is_error(status)) return status; } @@ -1293,7 +1293,7 @@ extern "C" { #endif // _di_f_file_name_base_ #ifndef _di_f_file_name_directory_ - f_return_status f_file_name_directory(const f_string path, const f_string_length length, f_string_dynamic *name_directory) { + f_return_status f_file_name_directory(const f_string_t path, const f_string_length_t length, f_string_dynamic_t *name_directory) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (name_directory == 0) return F_status_set_error(F_parameter); @@ -1301,23 +1301,23 @@ extern "C" { // POSIX dirname() modifies the path, so protect it (and add a terminating NULL). char path_argument[length + 1]; - f_string path_to_name; + f_string_t path_to_name; memcpy(path_argument, path, length); path_argument[length] = 0; path_to_name = dirname(path_argument); - f_string_length size = strnlen(path_to_name, length); + f_string_length_t size = strnlen(path_to_name, length); if (name_directory->used + size > name_directory->size) { - if (name_directory->used + size > f_string_length_size) { + if (name_directory->used + size > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_resize(status, (*name_directory), name_directory->used + size); + f_macro_string_dynamic_t_resize(status, (*name_directory), name_directory->used + size); if (F_status_is_error(status)) return status; } @@ -1329,7 +1329,7 @@ extern "C" { #endif // _di_f_file_name_directory_ #ifndef _di_f_file_open_ - f_return_status f_file_open(const f_string path, const mode_t mode, f_file *file) { + f_return_status f_file_open(const f_string_t path, const mode_t mode, f_file_t *file) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (file == 0) return F_status_set_error(F_parameter); @@ -1340,7 +1340,7 @@ extern "C" { #endif // _di_f_file_open_ #ifndef _di_f_file_open_at_ - f_return_status f_file_open_at(const int at_id, const f_string path, const mode_t mode, f_file *file) { + f_return_status f_file_open_at(const int at_id, const f_string_t path, const mode_t mode, f_file_t *file) { #ifndef _di_level_0_parameter_checking_ if (file == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1350,7 +1350,7 @@ extern "C" { #endif // _di_f_file_open_at_ #ifndef _di_f_file_read_ - f_return_status f_file_read(const f_file file, f_string_dynamic *buffer) { + f_return_status f_file_read(const f_file_t file, f_string_dynamic_t *buffer) { #ifndef _di_level_0_parameter_checking_ if (file.size_read == 0) return F_status_set_error(F_parameter); if (buffer->used > buffer->size) return F_status_set_error(F_parameter); @@ -1359,7 +1359,7 @@ extern "C" { if (file.id < 0) return F_status_set_error(F_file); if (file.id == 0) return F_status_set_error(F_file_closed); - f_status status = F_none; + f_status_t status = F_none; ssize_t size_read = 0; char buffer_read[file.size_read]; @@ -1368,11 +1368,11 @@ extern "C" { while ((size_read = read(file.id, buffer_read, file.size_read)) > 0) { if (buffer->used + size_read > buffer->size) { - if (buffer->size + size_read > f_string_length_size) { + if (buffer->size + size_read > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); + f_macro_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); if (F_status_is_error(status)) return status; } @@ -1401,7 +1401,7 @@ extern "C" { #endif // _di_f_file_read_ #ifndef _di_f_file_read_block_ - f_return_status f_file_read_block(const f_file file, f_string_dynamic *buffer) { + f_return_status f_file_read_block(const f_file_t file, f_string_dynamic_t *buffer) { #ifndef _di_level_0_parameter_checking_ if (file.size_read == 0) return F_status_set_error(F_parameter); if (buffer->used > buffer->size) return F_status_set_error(F_parameter); @@ -1410,7 +1410,7 @@ extern "C" { if (file.id < 0) return F_status_set_error(F_file); if (file.id == 0) return F_status_set_error(F_file_closed); - f_status status = F_none; + f_status_t status = F_none; ssize_t size_read = 0; char buffer_read[file.size_read]; @@ -1419,11 +1419,11 @@ extern "C" { if ((size_read = read(file.id, buffer_read, file.size_read)) > 0) { if (buffer->used + size_read > buffer->size) { - if (buffer->size + size_read > f_string_length_size) { + if (buffer->size + size_read > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); + f_macro_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); if (F_status_is_error(status)) return status; } @@ -1452,7 +1452,7 @@ extern "C" { #endif // _di_f_file_read_block_ #ifndef _di_f_file_read_until_ - f_return_status f_file_read_until(const f_file file, f_string_dynamic *buffer, const f_string_length total) { + f_return_status f_file_read_until(const f_file_t file, f_string_dynamic_t *buffer, const f_string_length_t total) { #ifndef _di_level_0_parameter_checking_ if (file.size_read == 0) return F_status_set_error(F_parameter); if (buffer->used > buffer->size) return F_status_set_error(F_parameter); @@ -1461,11 +1461,11 @@ extern "C" { if (file.id < 0) return F_status_set_error(F_file); if (file.id == 0) return F_status_set_error(F_file_closed); - f_status status = F_none; + f_status_t status = F_none; ssize_t size_read = 0; - f_string_length buffer_size = file.size_read; - f_string_length buffer_count = 0; + f_string_length_t buffer_size = file.size_read; + f_string_length_t buffer_count = 0; if (total < buffer_size) { buffer_size = total; @@ -1477,11 +1477,11 @@ extern "C" { while (buffer_count < total && (size_read = read(file.id, buffer_read, buffer_size)) > 0) { if (buffer->used + size_read > buffer->size) { - if (buffer->size + size_read > f_string_length_size) { + if (buffer->size + size_read > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); + f_macro_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); if (F_status_is_error(status)) return status; } @@ -1511,7 +1511,7 @@ extern "C" { #endif // _di_f_file_read_until_ #ifndef _di_f_file_remove_ - f_return_status f_file_remove(const f_string path) { + f_return_status f_file_remove(const f_string_t path) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1538,7 +1538,7 @@ extern "C" { #endif // _di_f_file_remove_ #ifndef _di_f_file_remove_at_ - f_return_status f_file_remove_at(const int at_id, const f_string path, const int flag) { + f_return_status f_file_remove_at(const int at_id, const f_string_t path, const int flag) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1566,7 +1566,7 @@ extern "C" { #endif // _di_f_file_remove_at_ #ifndef _di_f_file_role_change_ - f_return_status f_file_role_change(const f_string path, const uid_t uid, const gid_t gid, const bool dereference) { + f_return_status f_file_role_change(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (uid == -1 && gid == -1) return F_status_set_error(F_parameter); @@ -1577,7 +1577,7 @@ extern "C" { #endif // _di_f_file_role_change_ #ifndef _di_f_file_role_change_at_ - f_return_status f_file_role_change_at(const int at_id, const f_string path, const uid_t uid, const gid_t gid, const int flag) { + f_return_status f_file_role_change_at(const int at_id, const f_string_t path, const uid_t uid, const gid_t gid, const int flag) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (uid == -1 && gid == -1) return F_status_set_error(F_parameter); @@ -1588,7 +1588,7 @@ extern "C" { #endif // _di_f_file_role_change_at_ #ifndef _di_f_file_seek_ - f_return_status f_file_seek(const int id, const int whence, const f_string_length offset, f_string_length *seeked) { + f_return_status f_file_seek(const int id, const int whence, const f_string_length_t offset, f_string_length_t *seeked) { #ifndef _di_level_0_parameter_checking_ if (id <= 0) return F_status_set_error(F_parameter); if (whence < 0) return F_status_set_error(F_parameter); @@ -1611,7 +1611,7 @@ extern "C" { #endif // _di_f_file_seek_ #ifndef _di_f_file_size_ - f_return_status f_file_size(const f_string path, const bool dereference, f_string_length *size) { + f_return_status f_file_size(const f_string_t path, const bool dereference, f_string_length_t *size) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (size == 0) return F_status_set_error(F_parameter); @@ -1621,7 +1621,7 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); - f_status status = private_f_file_stat(path, dereference, &file_stat); + f_status_t status = private_f_file_stat(path, dereference, &file_stat); if (F_status_is_error(status)) return status; @@ -1632,7 +1632,7 @@ extern "C" { #endif // _di_f_file_size_ #ifndef _di_f_file_size_at_ - f_return_status f_file_size_at(const int at_id, const f_string path, const bool dereference, f_string_length *size) { + f_return_status f_file_size_at(const int at_id, const f_string_t path, const bool dereference, f_string_length_t *size) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (at_id <= 0) return F_status_set_error(F_parameter); @@ -1643,7 +1643,7 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); - f_status status = private_f_file_stat_at(at_id, path, dereference, &file_stat); + f_status_t status = private_f_file_stat_at(at_id, path, dereference, &file_stat); if (F_status_is_error(status)) return status; @@ -1654,7 +1654,7 @@ extern "C" { #endif // _di_f_file_size_at_ #ifndef _di_f_file_size_by_id_ - f_return_status f_file_size_by_id(const int id, f_string_length *size) { + f_return_status f_file_size_by_id(const int id, f_string_length_t *size) { #ifndef _di_level_0_parameter_checking_ if (id <= 0) return F_status_set_error(F_parameter); if (size == 0) return F_status_set_error(F_parameter); @@ -1664,7 +1664,7 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); - f_status status = private_f_file_stat_by_id(id, &file_stat); + f_status_t status = private_f_file_stat_by_id(id, &file_stat); if (F_status_is_error(status)) return status; @@ -1675,7 +1675,7 @@ extern "C" { #endif // _di_f_file_size_by_id_ #ifndef _di_f_file_stat_ - f_return_status f_file_stat(const f_string path, const bool dereference, struct stat *file_stat) { + f_return_status f_file_stat(const f_string_t path, const bool dereference, struct stat *file_stat) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (file_stat == 0) return F_status_set_error(F_parameter); @@ -1686,7 +1686,7 @@ extern "C" { #endif // _di_f_file_stat_ #ifndef _di_f_file_stat_at_ - f_return_status f_file_stat_at(const int at_id, const f_string path, const int flag, struct stat *file_stat) { + f_return_status f_file_stat_at(const int at_id, const f_string_t path, const int flag, struct stat *file_stat) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (at_id <= 0) return F_status_set_error(F_parameter); @@ -1709,12 +1709,12 @@ extern "C" { #endif // _di_f_file_stat_by_id_ #ifndef _di_f_file_touch_ - f_return_status f_file_touch(const f_string path, const mode_t mode, const bool dereference) { + f_return_status f_file_touch(const f_string_t path, const mode_t mode, const bool dereference) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); @@ -1749,12 +1749,12 @@ extern "C" { #endif // _di_f_file_touch_ #ifndef _di_f_file_touch_at_ - f_return_status f_file_touch_at(const int at_id, const f_string path, const mode_t mode, const int flag) { + f_return_status f_file_touch_at(const int at_id, const f_string_t path, const mode_t mode, const int flag) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); @@ -1789,7 +1789,7 @@ extern "C" { #endif // _di_f_file_touch_at_ #ifndef _di_f_file_type_ - f_return_status f_file_type(const f_string path, int *type) { + f_return_status f_file_type(const f_string_t path, int *type) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (type == 0) return F_status_set_error(F_parameter); @@ -1819,7 +1819,7 @@ extern "C" { #endif // _di_f_file_type_ #ifndef _di_f_file_type_at_ - f_return_status f_file_type_at(const int at_id, const f_string path, const int flag, int *type) { + f_return_status f_file_type_at(const int at_id, const f_string_t path, const int flag, int *type) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); if (type == 0) return F_status_set_error(F_parameter); @@ -1850,7 +1850,7 @@ extern "C" { #endif // _di_f_file_type_at_ #ifndef _di_f_file_write_ - f_return_status f_file_write(const f_file file, const f_string_static buffer, f_string_length *written) { + f_return_status f_file_write(const f_file_t file, const f_string_static_t buffer, f_string_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (file.size_write == 0) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); @@ -1864,7 +1864,7 @@ extern "C" { return F_data_not; } - f_status status = F_none; + f_status_t status = F_none; if (written) { private_f_file_write_until(file, buffer.string, buffer.used, written); @@ -1872,7 +1872,7 @@ extern "C" { if (status == F_none && *written == buffer.used) return F_none_eos; } else { - f_string_length written_local = 0; + f_string_length_t written_local = 0; private_f_file_write_until(file, buffer.string, buffer.used, &written_local); @@ -1886,7 +1886,7 @@ extern "C" { #endif // _di_f_file_write_ #ifndef _di_f_file_write_block_ - f_return_status f_file_write_block(const f_file file, const f_string_static buffer, f_string_length *written) { + f_return_status f_file_write_block(const f_file_t file, const f_string_static_t buffer, f_string_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (file.size_write == 0) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); @@ -1900,13 +1900,13 @@ extern "C" { return F_data_not; } - f_string_length write_max = file.size_write; + f_string_length_t write_max = file.size_write; if (write_max > buffer.used) { write_max = buffer.used; } - f_status status = F_none; + f_status_t status = F_none; if (written) { private_f_file_write_until(file, buffer.string, write_max, written); @@ -1917,7 +1917,7 @@ extern "C" { } } else { - f_string_length written_local = 0; + f_string_length_t written_local = 0; private_f_file_write_until(file, buffer.string, write_max, &written_local); @@ -1932,7 +1932,7 @@ extern "C" { #endif // _di_f_file_write_block_ #ifndef _di_f_file_write_until_ - f_return_status f_file_write_until(const f_file file, const f_string_static buffer, const f_string_length total, f_string_length *written) { + f_return_status f_file_write_until(const f_file_t file, const f_string_static_t buffer, const f_string_length_t total, f_string_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (file.size_write == 0) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); @@ -1946,13 +1946,13 @@ extern "C" { return F_data_not; } - f_string_length write_max = file.size_write; + f_string_length_t write_max = file.size_write; if (write_max > buffer.used) { write_max = buffer.used; } - f_status status = F_none; + f_status_t status = F_none; if (written) { private_f_file_write_until(file, buffer.string, write_max, written); @@ -1963,7 +1963,7 @@ extern "C" { } } else { - f_string_length written_local = 0; + f_string_length_t written_local = 0; private_f_file_write_until(file, buffer.string, buffer.used, &written_local); @@ -1978,7 +1978,7 @@ extern "C" { #endif // _di_f_file_write_until_ #ifndef _di_f_file_write_range_ - f_return_status f_file_write_range(const f_file file, const f_string_static buffer, const f_string_range range, f_string_length *written) { + f_return_status f_file_write_range(const f_file_t file, const f_string_static_t buffer, const f_string_range_t range, f_string_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (file.size_write == 0) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); @@ -1994,14 +1994,14 @@ extern "C" { return F_data_not; } - const f_string_length total = (range.stop - range.start) + 1; - f_string_length write_max = total; + const f_string_length_t total = (range.stop - range.start) + 1; + f_string_length_t write_max = total; if (write_max > buffer.used) { write_max = buffer.used; } - f_status status = F_none; + f_status_t status = F_none; if (written) { private_f_file_write_until(file, buffer.string + range.start, write_max, written); @@ -2012,7 +2012,7 @@ extern "C" { } } else { - f_string_length written_local = 0; + f_string_length_t written_local = 0; private_f_file_write_until(file, buffer.string + range.start, write_max, &written_local); diff --git a/level_0/f_file/c/file.h b/level_0/f_file/c/file.h index 5507571..e764c50 100644 --- a/level_0/f_file/c/file.h +++ b/level_0/f_file/c/file.h @@ -119,28 +119,28 @@ extern "C" { * size_read: The default number of 1-byte characters to read at a time and is often used for the read buffer size. * size_write: The default number of 1-byte characters to read at a time and is often used for the write buffer size. */ -#ifndef _di_f_file_ +#ifndef _di_f_file_t_ typedef struct { int id; int flag; size_t size_read; size_t size_write; - } f_file; + } f_file_t; - #define f_file_initialize { 0, f_file_flag_read_only, f_file_default_read_size, f_file_default_write_size } + #define f_file_t_initialize { 0, f_file_flag_read_only, f_file_default_read_size, f_file_default_write_size } - #define f_macro_file_clear(file) \ + #define f_macro_file_t_clear(file) \ file.id = 0; \ file.flag = 0; \ file.size_read = 0; \ file.size_write = 0; - #define f_macro_file_reset(file) \ + #define f_macro_file_t_reset(file) \ file.id = 0; \ file.flag = f_file_flag_read_only; \ file.size_read = f_file_default_read_size; \ file.size_write = f_file_default_write_size; -#endif // _di_f_file_ +#endif // _di_f_file_t_ /** * File AT_* define related functionality. @@ -376,7 +376,7 @@ extern "C" { * @see access() */ #ifndef _di_f_file_access_ - extern f_return_status f_file_access(const f_string path); + extern f_return_status f_file_access(const f_string_t path); #endif // _di_f_file_access_ /** @@ -430,7 +430,7 @@ extern "C" { * F_failure (with error bit) for any other error. */ #ifndef _di_f_file_clone_ - extern f_return_status f_file_clone(const f_string source, const f_string destination, const bool role, const f_number_unsigned size_block, const bool exclusive); + extern f_return_status f_file_clone(const f_string_t source, const f_string_t destination, const bool role, const f_number_unsigned_t size_block, const bool exclusive); #endif // _di_f_file_clone_ /** @@ -507,7 +507,7 @@ extern "C" { * F_failure (with error bit) for any other error. */ #ifndef _di_f_file_copy_ - extern f_return_status f_file_copy(const f_string source, const f_string destination, const f_mode mode, const f_number_unsigned size_block, const bool exclusive); + extern f_return_status f_file_copy(const f_string_t source, const f_string_t destination, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive); #endif // _di_f_file_copy_ /** @@ -545,7 +545,7 @@ extern "C" { * @see open() */ #ifndef _di_f_file_create_ - extern f_return_status f_file_create(const f_string path, const mode_t mode, const bool exclusive); + extern f_return_status f_file_create(const f_string_t path, const mode_t mode, const bool exclusive); #endif // _di_f_file_create_ /** @@ -585,7 +585,7 @@ extern "C" { * @see openat() */ #ifndef _di_f_file_create_at_ - extern f_return_status f_file_create_at(const int at_id, const f_string path, const mode_t mode, const bool exclusive); + extern f_return_status f_file_create_at(const int at_id, const f_string_t path, const mode_t mode, const bool exclusive); #endif // _di_f_file_create_at_ /** @@ -623,7 +623,7 @@ extern "C" { * @see mknod() */ #ifndef _di_f_file_create_device_ - extern f_return_status f_file_create_device(const f_string path, const mode_t mode, const unsigned int major, const unsigned int minor); + extern f_return_status f_file_create_device(const f_string_t path, const mode_t mode, const unsigned int major, const unsigned int minor); #endif // _di_f_file_create_device_ /** @@ -664,7 +664,7 @@ extern "C" { * @see mknodat() */ #ifndef _di_f_file_create_device_at_ - extern f_return_status f_file_create_device_at(const int at_id, const f_string path, const mode_t mode, const unsigned int major, const unsigned int minor); + extern f_return_status f_file_create_device_at(const int at_id, const f_string_t path, const mode_t mode, const unsigned int major, const unsigned int minor); #endif // _di_f_file_create_device_at_ /** @@ -693,7 +693,7 @@ extern "C" { * @see mkfifo() */ #ifndef _di_f_file_create_fifo_ - extern f_return_status f_file_create_fifo(const f_string path, const mode_t mode); + extern f_return_status f_file_create_fifo(const f_string_t path, const mode_t mode); #endif // _di_f_file_create_fifo_ /** @@ -725,7 +725,7 @@ extern "C" { * @see mkfifoat() */ #ifndef _di_f_file_create_fifo_at_ - extern f_return_status f_file_create_fifo_at(const int at_id, const f_string path, const mode_t mode); + extern f_return_status f_file_create_fifo_at(const int at_id, const f_string_t path, const mode_t mode); #endif // _di_f_file_create_fifo_at_ /** @@ -757,7 +757,7 @@ extern "C" { * @see mknod() */ #ifndef _di_f_file_create_node_ - extern f_return_status f_file_create_node(const f_string path, const mode_t mode, const dev_t device); + extern f_return_status f_file_create_node(const f_string_t path, const mode_t mode, const dev_t device); #endif // _di_f_file_create_node_ /** @@ -792,7 +792,7 @@ extern "C" { * @see mknodat() */ #ifndef _di_f_file_create_node_at_ - extern f_return_status f_file_create_node_at(const int at_id, const f_string path, const mode_t mode, const dev_t device); + extern f_return_status f_file_create_node_at(const int at_id, const f_string_t path, const mode_t mode, const dev_t device); #endif // _di_f_file_create_node_at_ /** @@ -818,7 +818,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_file_exists_ - extern f_return_status f_file_exists(const f_string path); + extern f_return_status f_file_exists(const f_string_t path); #endif // _di_f_file_exists_ /** @@ -849,7 +849,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_file_exists_at_ - extern f_return_status f_file_exists_at(const int at_id, const f_string path, const int flag); + extern f_return_status f_file_exists_at(const int at_id, const f_string_t path, const int flag); #endif // _di_f_file_exists_at_ /** @@ -900,7 +900,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_file_is_ - extern f_return_status f_file_is(const f_string path, const int type); + extern f_return_status f_file_is(const f_string_t path, const int type); #endif // _di_f_file_is_ /** @@ -930,7 +930,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_file_is_at_ - extern f_return_status f_file_is_at(const int at_id, const f_string path, const int type, const int flag); + extern f_return_status f_file_is_at(const int at_id, const f_string_t path, const int type, const int flag); #endif // _di_f_file_is_at_ /** @@ -966,7 +966,7 @@ extern "C" { * @see symlink() */ #ifndef _di_f_file_link_ - extern f_return_status f_file_link(const f_string target, const f_string point); + extern f_return_status f_file_link(const f_string_t target, const f_string_t point); #endif // _di_f_file_link_ /** @@ -1005,7 +1005,7 @@ extern "C" { * @see symlinkat() */ #ifndef _di_f_file_link_at_ - extern f_return_status f_file_link_at(const int at_id, const f_string target, const f_string point); + extern f_return_status f_file_link_at(const int at_id, const f_string_t target, const f_string_t point); #endif // _di_f_file_link_at_ /** @@ -1040,7 +1040,7 @@ extern "C" { * @see link() */ #ifndef _di_f_file_link_hard_ - extern f_return_status f_file_link_hard(const f_string target, const f_string point); + extern f_return_status f_file_link_hard(const f_string_t target, const f_string_t point); #endif // _di_f_file_link_hard_ /** @@ -1082,7 +1082,7 @@ extern "C" { * @see linkat() */ #ifndef _di_f_file_link_hard_at_ - extern f_return_status f_file_link_hard_at(const int at_id_target, const int at_id_point, const f_string target, const f_string point, const int flag); + extern f_return_status f_file_link_hard_at(const int at_id_target, const int at_id_point, const f_string_t target, const f_string_t point, const int flag); #endif // _di_f_file_link_hard_at_ /** @@ -1116,7 +1116,7 @@ extern "C" { * @see readlink() */ #ifndef _di_f_file_link_read_ - extern f_return_status f_file_link_read(const f_string path, const struct stat link_stat, f_string_dynamic *target); + extern f_return_status f_file_link_read(const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target); #endif // _di_f_file_link_read_ /** @@ -1153,7 +1153,7 @@ extern "C" { * @see readlinkat() */ #ifndef _di_f_file_link_read_at_ - extern f_return_status f_file_link_read_at(const int at_id, const f_string path, const struct stat link_stat, f_string_dynamic *target); + extern f_return_status f_file_link_read_at(const int at_id, const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target); #endif // _di_f_file_link_read_at_ /** @@ -1271,7 +1271,7 @@ extern "C" { * @see private_f_file_mode_determine() */ #ifndef _di_f_file_mode_from_string_ - extern f_return_status f_file_mode_from_string(const f_string string, const mode_t umask, f_file_mode *mode, uint8_t *replace); + extern f_return_status f_file_mode_from_string(const f_string_t string, const mode_t umask, f_file_mode *mode, uint8_t *replace); #endif // _di_f_file_mode_from_string_ /** @@ -1296,7 +1296,7 @@ extern "C" { * @see fstat() */ #ifndef _di_f_file_mode_read_ - extern f_return_status f_file_mode_read(const f_string path, mode_t *mode); + extern f_return_status f_file_mode_read(const f_string_t path, mode_t *mode); #endif // _di_f_file_mode_read_ /** @@ -1323,7 +1323,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_file_mode_read_at_ - extern f_return_status f_file_mode_read_at(const int at_id, const f_string path, mode_t *mode); + extern f_return_status f_file_mode_read_at(const int at_id, const f_string_t path, mode_t *mode); #endif // _di_f_file_mode_read_at_ /** @@ -1354,7 +1354,7 @@ extern "C" { * @see chmod() */ #ifndef _di_f_file_mode_set_ - extern f_return_status f_file_mode_set(const f_string path, const mode_t mode); + extern f_return_status f_file_mode_set(const f_string_t path, const mode_t mode); #endif // _di_f_file_mode_set_ /** @@ -1387,7 +1387,7 @@ extern "C" { * @see fchmodat() */ #ifndef _di_f_file_mode_set_at_ - extern f_return_status f_file_mode_set_at(const int at_id, const f_string path, const mode_t mode); + extern f_return_status f_file_mode_set_at(const int at_id, const f_string_t path, const mode_t mode); #endif // _di_f_file_mode_set_at_ /** @@ -1431,7 +1431,7 @@ extern "C" { * @see basename() */ #ifndef _di_f_file_name_base_ - extern f_return_status f_file_name_base(const f_string path, const f_string_length length, f_string_dynamic *name_base); + extern f_return_status f_file_name_base(const f_string_t path, const f_string_length_t length, f_string_dynamic_t *name_base); #endif // _di_f_file_name_base_ /** @@ -1455,7 +1455,7 @@ extern "C" { * @see dirname() */ #ifndef _di_f_file_name_directory_ - extern f_return_status f_file_name_directory(const f_string path, const f_string_length length, f_string_dynamic *name_directory); + extern f_return_status f_file_name_directory(const f_string_t path, const f_string_length_t length, f_string_dynamic_t *name_directory); #endif // _di_f_file_name_directory_ /** @@ -1482,7 +1482,7 @@ extern "C" { * @see open() */ #ifndef _di_f_file_open_ - extern f_return_status f_file_open(const f_string path, const mode_t mode, f_file *file); + extern f_return_status f_file_open(const f_string_t path, const mode_t mode, f_file_t *file); #endif // _di_f_file_open_ /** @@ -1511,7 +1511,7 @@ extern "C" { * @see openat() */ #ifndef _di_f_file_open_at_ - extern f_return_status f_file_open_at(const int at_id, const f_string path, const mode_t mode, f_file *file); + extern f_return_status f_file_open_at(const int at_id, const f_string_t path, const mode_t mode, f_file_t *file); #endif // _di_f_file_open_at_ /** @@ -1542,7 +1542,7 @@ extern "C" { * @see read() */ #ifndef _di_f_file_read_ - extern f_return_status f_file_read(const f_file file, f_string_dynamic *buffer); + extern f_return_status f_file_read(const f_file_t file, f_string_dynamic_t *buffer); #endif // _di_f_file_read_ /** @@ -1573,7 +1573,7 @@ extern "C" { * @see read() */ #ifndef _di_f_file_read_ - extern f_return_status f_file_read_block(const f_file file, f_string_dynamic *buffer); + extern f_return_status f_file_read_block(const f_file_t file, f_string_dynamic_t *buffer); #endif // _di_f_file_read_ /** @@ -1605,7 +1605,7 @@ extern "C" { * @see read() */ #ifndef _di_f_file_read_until_ - extern f_return_status f_file_read_until(const f_file file, f_string_dynamic *buffer, const f_string_length total); + extern f_return_status f_file_read_until(const f_file_t file, f_string_dynamic_t *buffer, const f_string_length_t total); #endif // _di_f_file_read_until_ /** @@ -1633,7 +1633,7 @@ extern "C" { * @see unlink() */ #ifndef _di_f_file_remove_ - extern f_return_status f_file_remove(const f_string path); + extern f_return_status f_file_remove(const f_string_t path); #endif // _di_f_file_remove_ /** @@ -1665,7 +1665,7 @@ extern "C" { * @see unlinkat() */ #ifndef _di_f_file_remove_at_ - extern f_return_status f_file_remove_at(const int at_id, const f_string path, const int flag); + extern f_return_status f_file_remove_at(const int at_id, const f_string_t path, const int flag); #endif // _di_f_file_remove_at_ /** @@ -1705,7 +1705,7 @@ extern "C" { * @see lchown() */ #ifndef _di_f_file_role_change_ - extern f_return_status f_file_role_change(const f_string path, const uid_t uid, const gid_t gid, const bool dereference); + extern f_return_status f_file_role_change(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference); #endif // _di_f_file_role_change_ /** @@ -1746,7 +1746,7 @@ extern "C" { * @see fchownat() */ #ifndef _di_f_file_role_change_at_ - extern f_return_status f_file_role_change_at(const int at_id, const f_string path, const uid_t uid, const gid_t gid, const int flag); + extern f_return_status f_file_role_change_at(const int at_id, const f_string_t path, const uid_t uid, const gid_t gid, const int flag); #endif // _di_f_file_role_change_at_ /** @@ -1774,7 +1774,7 @@ extern "C" { * @see lseek */ #ifndef _di_f_file_seek_ - extern f_return_status f_file_seek(const int id, const int whence, const f_string_length offset, f_string_length *seeked); + extern f_return_status f_file_seek(const int id, const int whence, const f_string_length_t offset, f_string_length_t *seeked); #endif // _di_f_file_seek_ /** @@ -1802,7 +1802,7 @@ extern "C" { * @see f_file_stat() */ #ifndef _di_f_file_size_ - extern f_return_status f_file_size(const f_string path, const bool dereference, f_string_length *size); + extern f_return_status f_file_size(const f_string_t path, const bool dereference, f_string_length_t *size); #endif // _di_f_file_size_ /** @@ -1832,7 +1832,7 @@ extern "C" { * @see f_file_stat_at() */ #ifndef _di_f_file_size_at_ - extern f_return_status f_file_size_at(const int at_id, const f_string path, const bool dereference, f_string_length *size); + extern f_return_status f_file_size_at(const int at_id, const f_string_t path, const bool dereference, f_string_length_t *size); #endif // _di_f_file_size_at_ /** @@ -1857,7 +1857,7 @@ extern "C" { * @see f_file_stat_by_id() */ #ifndef _di_f_file_size_by_id_ - extern f_return_status f_file_size_by_id(const int id, f_string_length *size); + extern f_return_status f_file_size_by_id(const int id, f_string_length_t *size); #endif // _di_f_file_size_by_id_ /** @@ -1885,7 +1885,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_file_stat_ - extern f_return_status f_file_stat(const f_string path, const bool dereference, struct stat *file_stat); + extern f_return_status f_file_stat(const f_string_t path, const bool dereference, struct stat *file_stat); #endif // _di_f_file_stat_ /** @@ -1914,7 +1914,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_file_stat_at_ - extern f_return_status f_file_stat_at(const int at_id, const f_string path, const int flag, struct stat *file_stat); + extern f_return_status f_file_stat_at(const int at_id, const f_string_t path, const int flag, struct stat *file_stat); #endif // _di_f_file_stat_at_ /** @@ -1980,7 +1980,7 @@ extern "C" { * @see utimensat() */ #ifndef _di_f_file_touch_ - extern f_return_status f_file_touch(const f_string path, const mode_t mode, const bool dereference); + extern f_return_status f_file_touch(const f_string_t path, const mode_t mode, const bool dereference); #endif // _di_f_file_touch_ /** @@ -2022,7 +2022,7 @@ extern "C" { * @see utimensat() */ #ifndef _di_f_file_touch_at_ - extern f_return_status f_file_touch_at(const int at_id, const f_string path, const mode_t mode, const int flag); + extern f_return_status f_file_touch_at(const int at_id, const f_string_t path, const mode_t mode, const int flag); #endif // _di_f_file_touch_at_ /** @@ -2050,7 +2050,7 @@ extern "C" { * @see stat() */ #ifndef _di_f_file_type_ - extern f_return_status f_file_type(const f_string path, int *type); + extern f_return_status f_file_type(const f_string_t path, int *type); #endif // _di_f_file_type_ /** @@ -2079,7 +2079,7 @@ extern "C" { * @see fstatat() */ #ifndef _di_f_file_type_at_ - extern f_return_status f_file_type_at(const int at_id, const f_string path, const int flag, int *type); + extern f_return_status f_file_type_at(const int at_id, const f_string_t path, const int flag, int *type); #endif // _di_f_file_type_at_ /** @@ -2110,7 +2110,7 @@ extern "C" { * @see write() */ #ifndef _di_f_file_write_ - extern f_return_status f_file_write(const f_file file, const f_string_static buffer, f_string_length *written); + extern f_return_status f_file_write(const f_file_t file, const f_string_static_t buffer, f_string_length_t *written); #endif // _di_f_file_write_ /** @@ -2143,7 +2143,7 @@ extern "C" { * @see write() */ #ifndef _di_f_file_write_block_ - extern f_return_status f_file_write_block(const f_file file, const f_string_static buffer, f_string_length *written); + extern f_return_status f_file_write_block(const f_file_t file, const f_string_static_t buffer, f_string_length_t *written); #endif // _di_f_file_write_block_ /** @@ -2177,7 +2177,7 @@ extern "C" { * @see write() */ #ifndef _di_f_file_write_until_ - extern f_return_status f_file_write_until(const f_file file, const f_string_static buffer, const f_string_length total, f_string_length *written); + extern f_return_status f_file_write_until(const f_file_t file, const f_string_static_t buffer, const f_string_length_t total, f_string_length_t *written); #endif // _di_f_file_write_until_ /** @@ -2211,7 +2211,7 @@ extern "C" { * @see write() */ #ifndef _di_f_file_write_range_ - extern f_return_status f_file_write_range(const f_file file, const f_string_static buffer, const f_string_range range, f_string_length *written); + extern f_return_status f_file_write_range(const f_file_t file, const f_string_static_t buffer, const f_string_range_t range, f_string_length_t *written); #endif // _di_f_file_write_range_ #ifdef __cplusplus diff --git a/level_0/f_file/c/private-file.c b/level_0/f_file/c/private-file.c index f274d85..5fa715e 100644 --- a/level_0/f_file/c/private-file.c +++ b/level_0/f_file/c/private-file.c @@ -25,14 +25,14 @@ extern "C" { #endif // !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_copy_) || !defined(_di_f_file_clone_) - f_return_status private_f_file_copy_content(const f_string source, const f_string destination, const f_number_unsigned size_block) { - f_file file_source = f_file_initialize; - f_file file_destination = f_file_initialize; + f_return_status private_f_file_copy_content(const f_string_t source, const f_string_t destination, const f_number_unsigned_t size_block) { + f_file_t file_source = f_file_t_initialize; + f_file_t file_destination = f_file_t_initialize; file_source.flag = f_file_flag_read_only; file_destination.flag = f_file_flag_write_only | f_file_flag_no_follow; - f_status status = private_f_file_open(source, 0, &file_source); + f_status_t status = private_f_file_open(source, 0, &file_source); if (F_status_is_error(status)) return status; status = private_f_file_open(destination, 0, &file_destination); @@ -68,14 +68,14 @@ extern "C" { #endif // !defined(_di_f_file_copy_) || !defined(_di_f_file_clone_) #if !defined(_di_f_file_copy_at_) || !defined(_di_f_file_clone_at_) - f_return_status private_f_file_copy_content_at(const int at_id, const f_string source, const f_string destination, const f_number_unsigned size_block) { - f_file file_source = f_file_initialize; - f_file file_destination = f_file_initialize; + f_return_status private_f_file_copy_content_at(const int at_id, const f_string_t source, const f_string_t destination, const f_number_unsigned_t size_block) { + f_file_t file_source = f_file_t_initialize; + f_file_t file_destination = f_file_t_initialize; file_source.flag = f_file_flag_read_only; file_destination.flag = f_file_flag_write_only | f_file_flag_no_follow; - f_status status = private_f_file_open_at(at_id, source, 0, &file_source); + f_status_t status = private_f_file_open_at(at_id, source, 0, &file_source); if (F_status_is_error(status)) return status; status = private_f_file_open_at(at_id, destination, 0, &file_destination); @@ -111,8 +111,8 @@ extern "C" { #endif // !defined(_di_f_file_copy_at_) || !defined(_di_f_file_clone_at_) #if !defined(_di_f_file_create_) || !defined(_di_f_file_copy_) - f_return_status private_f_file_create(const f_string path, const mode_t mode, const bool exclusive) { - f_file file = f_file_initialize; + f_return_status private_f_file_create(const f_string_t path, const mode_t mode, const bool exclusive) { + f_file_t file = f_file_t_initialize; file.flag = f_file_flag_close_execute | f_file_flag_create | f_file_flag_write_only; @@ -120,7 +120,7 @@ extern "C" { file.flag |= f_file_flag_exclusive; } - f_status status = private_f_file_open(path, mode, &file); + f_status_t status = private_f_file_open(path, mode, &file); if (file.id > 0) { return private_f_file_close(&file.id); @@ -131,8 +131,8 @@ extern "C" { #endif // !defined(_di_f_file_create_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_create_at_) || !defined(_di_f_file_copy_at_) - f_return_status private_f_file_create_at(const int at_id, const f_string path, const mode_t mode, const bool exclusive) { - f_file file = f_file_initialize; + f_return_status private_f_file_create_at(const int at_id, const f_string_t path, const mode_t mode, const bool exclusive) { + f_file_t file = f_file_t_initialize; file.flag = f_file_flag_close_execute | f_file_flag_create | f_file_flag_write_only; @@ -140,7 +140,7 @@ extern "C" { file.flag |= f_file_flag_exclusive; } - f_status status = private_f_file_open_at(at_id, path, mode, &file); + f_status_t status = private_f_file_open_at(at_id, path, mode, &file); if (file.id > 0) { return private_f_file_close(&file.id); @@ -151,7 +151,7 @@ extern "C" { #endif // !defined(_di_f_file_create_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_copy_) - f_return_status private_f_file_create_directory(const f_string path, const mode_t mode) { + f_return_status private_f_file_create_directory(const f_string_t path, const mode_t mode) { if (mkdir(path, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -177,7 +177,7 @@ extern "C" { #endif // !defined(_di_f_file_copy_) #if !defined(_di_f_file_copy_at_) - f_return_status private_f_file_create_directory_at(const int at_id, const f_string path, const mode_t mode) { + f_return_status private_f_file_create_directory_at(const int at_id, const f_string_t path, const mode_t mode) { if (mkdirat(at_id, path, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -204,7 +204,7 @@ extern "C" { #endif // !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_create_fifo_) || !defined(_di_f_file_copy_) - f_return_status private_f_file_create_fifo(const f_string path, const mode_t mode) { + f_return_status private_f_file_create_fifo(const f_string_t path, const mode_t mode) { if (mkfifo(path, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -225,7 +225,7 @@ extern "C" { #endif // !defined(_di_f_file_create_fifo_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_create_fifo_at_) || !defined(_di_f_file_copy_at_) - f_return_status private_f_file_create_fifo_at(const int at_id, const f_string path, const mode_t mode) { + f_return_status private_f_file_create_fifo_at(const int at_id, const f_string_t path, const mode_t mode) { if (mkfifoat(at_id, path, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -247,7 +247,7 @@ extern "C" { #endif // !defined(_di_f_file_create_fifo_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_create_device_) || !defined(_di_f_file_create_node_) || !defined(_di_f_file_copy_) - f_return_status private_f_file_create_node(const f_string path, const mode_t mode, const dev_t device) { + f_return_status private_f_file_create_node(const f_string_t path, const mode_t mode, const dev_t device) { if (mknod(path, mode, device) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -273,7 +273,7 @@ extern "C" { #endif // !defined(_di_f_file_create_device_) || !defined(_di_f_file_create_node_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_create_device_at_) || !defined(_di_f_file_create_node_at_) || !defined(_di_f_file_copy_at_) - f_return_status private_f_file_create_node_at(const int at_id, const f_string path, const mode_t mode, const dev_t device) { + f_return_status private_f_file_create_node_at(const int at_id, const f_string_t path, const mode_t mode, const dev_t device) { if (mknodat(at_id, path, mode, device) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -317,7 +317,7 @@ extern "C" { #endif // !defined(_di_f_file_flush_) || !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_link_) || !defined(_di_f_file_copy_) - f_return_status private_f_file_link(const f_string target, const f_string point) { + f_return_status private_f_file_link(const f_string_t target, const f_string_t point) { if (symlink(target, point) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -345,7 +345,7 @@ extern "C" { #endif // !defined(_di_f_file_link_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_link_at_) || !defined(_di_f_file_copy_at_) - f_return_status private_f_file_link_at(const int at_id, const f_string target, const f_string point) { + f_return_status private_f_file_link_at(const int at_id, const f_string_t target, const f_string_t point) { if (symlinkat(target, at_id, point) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -374,16 +374,16 @@ extern "C" { #endif // !defined(_di_f_file_link_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_link_read_) || !defined(_di_f_file_copy_) - f_return_status private_f_file_link_read(const f_string path, const struct stat link_stat, f_string_dynamic *target) { + f_return_status private_f_file_link_read(const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) { // create a NULL terminated string based on file stat. if (link_stat.st_size + 1 > target->size) { - if (link_stat.st_size + 1 > f_string_length_size) { + if (link_stat.st_size + 1 > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_resize(status, (*target), link_stat.st_size + 1); + f_macro_string_dynamic_t_resize(status, (*target), link_stat.st_size + 1); if (F_status_is_error(status)) return status; } @@ -410,16 +410,16 @@ extern "C" { #endif // !defined(_di_f_file_link_read_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_link_read_at_) || !defined(_di_f_file_copy_at_) - f_return_status private_f_file_link_read_at(const int at_id, const f_string path, const struct stat link_stat, f_string_dynamic *target) { + f_return_status private_f_file_link_read_at(const int at_id, const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) { // create a NULL terminated string based on file stat. if (link_stat.st_size + 1 > target->size) { - if (link_stat.st_size + 1 > f_string_length_size) { + if (link_stat.st_size + 1 > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_resize(status, (*target), link_stat.st_size + 1); + f_macro_string_dynamic_t_resize(status, (*target), link_stat.st_size + 1); if (F_status_is_error(status)) return status; } @@ -447,7 +447,7 @@ extern "C" { #endif // !defined(_di_f_file_link_read_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_mode_set_) || !defined(_di_f_file_copy_) - f_return_status private_f_file_mode_set(const f_string path, const mode_t mode) { + f_return_status private_f_file_mode_set(const f_string_t path, const mode_t mode) { if (chmod(path, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -469,7 +469,7 @@ extern "C" { #endif // !defined(_di_f_file_mode_set_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_mode_set_at_) || !defined(_di_f_file_copy_at_) - f_return_status private_f_file_mode_set_at(const int at_id, const f_string path, const mode_t mode) { + f_return_status private_f_file_mode_set_at(const int at_id, const f_string_t path, const mode_t mode) { if (fchmodat(at_id, path, mode, 0) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -492,7 +492,7 @@ extern "C" { #endif // !defined(_di_f_file_mode_set_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_open_) || !defined(_di_f_file_copy_) - f_return_status private_f_file_open(const f_string path, const mode_t mode, f_file *file) { + f_return_status private_f_file_open(const f_string_t path, const mode_t mode, f_file_t *file) { if (mode == 0) { file->id = open(path, file->flag); } @@ -529,7 +529,7 @@ extern "C" { #endif // !defined(_di_f_file_open_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_open_at_) || !defined(_di_f_file_copy_at_) - f_return_status private_f_file_open_at(const int at_id, const f_string path, const mode_t mode, f_file *file) { + f_return_status private_f_file_open_at(const int at_id, const f_string_t path, const mode_t mode, f_file_t *file) { if (mode == 0) { file->id = openat(at_id, path, file->flag); } @@ -567,7 +567,7 @@ extern "C" { #endif // !defined(_di_f_file_open_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_role_change_) || !defined(_di_f_file_copy_) - f_return_status private_f_file_role_change(const f_string path, const uid_t uid, const gid_t gid, const bool dereference) { + f_return_status private_f_file_role_change(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference) { int result = 0; if (dereference) { @@ -616,7 +616,7 @@ extern "C" { #endif // !defined(_di_f_file_role_change_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_role_change_at_) || !defined(_di_f_file_copy_at_) - f_return_status private_f_file_role_change_at(const int at_id, const f_string path, const uid_t uid, const gid_t gid, const int flag) { + f_return_status private_f_file_role_change_at(const int at_id, const f_string_t path, const uid_t uid, const gid_t gid, const int flag) { int result = 0; if (uid != -1) { @@ -651,7 +651,7 @@ extern "C" { #endif // !defined(_di_f_file_role_change_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_stat_) || !defined(_di_f_file_copy_) - f_return_status private_f_file_stat(const f_string path, const bool dereference, struct stat *file_stat) { + f_return_status private_f_file_stat(const f_string_t path, const bool dereference, struct stat *file_stat) { if ((dereference ? stat(path, file_stat) : lstat(path, file_stat)) < 0) { if (errno == ENAMETOOLONG) return F_status_set_error(F_name); @@ -671,7 +671,7 @@ extern "C" { #endif // !defined(_di_f_file_stat_) || !defined(_di_f_file_copy_) #if !defined(_di_f_file_stat_at_) || !defined(_di_f_file_copy_at_) - f_return_status private_f_file_stat_at(const int at_id, const f_string path, const int flag, struct stat *file_stat) { + f_return_status private_f_file_stat_at(const int at_id, const f_string_t path, const int flag, struct stat *file_stat) { if (fstatat(at_id, path, file_stat, flag) < 0) { if (errno == ENAMETOOLONG) return F_status_set_error(F_name); @@ -714,12 +714,12 @@ extern "C" { #endif // !defined(_di_f_file_stat_by_id_) || !defined(_di_f_file_size_by_id_) #if !defined(f_file_write) || !defined(f_file_write_until) || !defined(f_file_write_range) - f_return_status private_f_file_write_until(const f_file file, const f_string string, const f_string_length total, f_string_length *written) { + f_return_status private_f_file_write_until(const f_file_t file, const f_string_t string, const f_string_length_t total, f_string_length_t *written) { *written = 0; - f_status status = F_none; - f_string_length write_size = file.size_write; - f_string_length write_max = total; + f_status_t status = F_none; + f_string_length_t write_size = file.size_write; + f_string_length_t write_max = total; ssize_t size_write = 0; diff --git a/level_0/f_file/c/private-file.h b/level_0/f_file/c/private-file.h index 0ebfba2..8057114 100644 --- a/level_0/f_file/c/private-file.h +++ b/level_0/f_file/c/private-file.h @@ -86,7 +86,7 @@ extern "C" { * @see f_file_clone() */ #if !defined(_di_f_file_copy_) || !defined(_di_f_file_clone_) - extern f_return_status private_f_file_copy_content(const f_string source, const f_string destination, const f_number_unsigned size_block) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_copy_content(const f_string_t source, const f_string_t destination, const f_number_unsigned_t size_block) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_copy_) || !defined(_di_f_file_clone_) /** @@ -129,7 +129,7 @@ extern "C" { * @see f_file_create() */ #if !defined(_di_f_file_create_) || !defined(_di_f_file_copy_) - extern f_return_status private_f_file_create(const f_string path, const mode_t mode, const bool exclusive) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_create(const f_string_t path, const mode_t mode, const bool exclusive) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_create_) || !defined(_di_f_file_copy_) /** @@ -173,7 +173,7 @@ extern "C" { * @see f_file_create_at() */ #if !defined(_di_f_file_create_at_) - extern f_return_status private_f_file_create_at(const int at_id, const f_string path, const mode_t mode, const bool exclusive) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_create_at(const int at_id, const f_string_t path, const mode_t mode, const bool exclusive) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_create_at_) /** @@ -208,7 +208,7 @@ extern "C" { * @see mkdir() */ #if !defined(_di_f_file_copy_) - extern f_return_status private_f_file_create_directory(const f_string path, const mode_t mode) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_create_directory(const f_string_t path, const mode_t mode) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_copy_) /** @@ -245,7 +245,7 @@ extern "C" { * @see mkdirat() */ #if !defined(_di_f_file_copy_at_) - extern f_return_status private_f_file_create_directory_at(const int at_id, const f_string path, const mode_t mode) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_create_directory_at(const int at_id, const f_string_t path, const mode_t mode) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_copy_at_) /** @@ -276,7 +276,7 @@ extern "C" { * @see mkfifo() */ #if !defined(_di_f_file_create_fifo_) || !defined(_di_f_file_copy_) - extern f_return_status private_f_file_create_fifo(const f_string path, const mode_t mode) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_create_fifo(const f_string_t path, const mode_t mode) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_create_fifo_) || !defined(_di_f_file_copy_) /** @@ -310,7 +310,7 @@ extern "C" { * @see mkfifoat() */ #if !defined(_di_f_file_create_fifo_at_) || !defined(_di_f_file_copy_at_) - extern f_return_status private_f_file_create_fifo_at(const int at_id, const f_string path, const mode_t mode) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_create_fifo_at(const int at_id, const f_string_t path, const mode_t mode) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_create_fifo_at_) || !defined(_di_f_file_copy_at_) /** @@ -348,7 +348,7 @@ extern "C" { * @see f_file_create_node() */ #if !defined(_di_f_file_create_device_) || !defined(_di_f_file_create_node_) || !defined(_di_f_file_copy_) - extern f_return_status private_f_file_create_node(const f_string path, const mode_t mode, const dev_t device) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_create_node(const f_string_t path, const mode_t mode, const dev_t device) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_create_device_) || !defined(_di_f_file_create_node_) || !defined(_di_f_file_copy_) /** @@ -389,7 +389,7 @@ extern "C" { * @see f_file_create_node_at() */ #if !defined(_di_f_file_create_device_at_) || !defined(_di_f_file_create_node_at_) || !defined(_di_f_file_copy_at_) - extern f_return_status private_f_file_create_node_at(const int at_id, const f_string path, const mode_t mode, const dev_t device) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_create_node_at(const int at_id, const f_string_t path, const mode_t mode, const dev_t device) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_create_device_at_) || !defined(_di_f_file_create_node_at_) || !defined(_di_f_file_copy_at_) /** @@ -451,7 +451,7 @@ extern "C" { * @see f_file_link() */ #if !defined(_di_f_file_link_) || !defined(_di_f_file_copy_) - extern f_return_status private_f_file_link(const f_string target, const f_string point) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_link(const f_string_t target, const f_string_t point) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_link_) || !defined(_di_f_file_copy_) /** @@ -489,7 +489,7 @@ extern "C" { * @see f_file_link_at() */ #if !defined(_di_f_file_link_at_) - extern f_return_status private_f_file_link_at(const int at_id, const f_string target, const f_string point) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_link_at(const int at_id, const f_string_t target, const f_string_t point) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_link_at_) /** @@ -522,7 +522,7 @@ extern "C" { * @see f_file_link_read() */ #if !defined(_di_f_file_link_read_) || !defined(_di_f_file_copy_) - extern f_return_status private_f_file_link_read(const f_string path, const struct stat link_stat, f_string_dynamic *target) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_link_read(const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_link_read_) || !defined(_di_f_file_copy_) /** @@ -558,7 +558,7 @@ extern "C" { * @see f_file_link_read_at() */ #if !defined(_di_f_file_link_read_at_) || !defined(_di_f_file_copy_at_) - extern f_return_status private_f_file_link_read_at(const int at_id, const f_string path, const struct stat link_stat, f_string_dynamic *target) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_link_read_at(const int at_id, const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_link_read_at_) || !defined(_di_f_file_copy_at_) /** @@ -589,7 +589,7 @@ extern "C" { * @see f_file_copy() */ #if !defined(_di_f_file_mode_set_) || !defined(_di_f_file_copy_) - extern f_return_status private_f_file_mode_set(const f_string path, const mode_t mode) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_mode_set(const f_string_t path, const mode_t mode) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_mode_set_) || !defined(_di_f_file_copy_) /** @@ -621,7 +621,7 @@ extern "C" { * @see f_file_mode_set_at() */ #if !defined(_di_f_file_mode_set_at_) - extern f_return_status private_f_file_mode_set_at(const int at_id, const f_string path, const mode_t mode) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_mode_set_at(const int at_id, const f_string_t path, const mode_t mode) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_mode_set_at_) /** @@ -649,7 +649,7 @@ extern "C" { * @see f_file_open() */ #if !defined(_di_f_file_open_) || !defined(_di_f_file_copy_) - extern f_return_status private_f_file_open(const f_string path, const mode_t mode, f_file *file) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_open(const f_string_t path, const mode_t mode, f_file_t *file) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_open_) || !defined(_di_f_file_copy_) /** @@ -678,7 +678,7 @@ extern "C" { * @see f_file_open_at() */ #if !defined(_di_f_file_open_at_) - extern f_return_status private_f_file_open_at(const int at_id, const f_string path, const mode_t mode, f_file *file) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_open_at(const int at_id, const f_string_t path, const mode_t mode, f_file_t *file) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_open_at_) /** @@ -716,7 +716,7 @@ extern "C" { * @see f_file_copy() */ #if !defined(_di_f_file_role_change_) || !defined(_di_f_file_copy_) - extern f_return_status private_f_file_role_change(const f_string path, const uid_t uid, const gid_t gid, const bool dereference) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_role_change(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_role_change_) || !defined(_di_f_file_copy_) /** @@ -755,7 +755,7 @@ extern "C" { * @see f_file_role_change_at() */ #if !defined(_di_f_file_role_change_at_) - extern f_return_status private_f_file_role_change_at(const int at_id, const f_string path, const uid_t uid, const gid_t gid, const int flag) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_role_change_at(const int at_id, const f_string_t path, const uid_t uid, const gid_t gid, const int flag) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_role_change_at_) /** @@ -788,7 +788,7 @@ extern "C" { * @see f_file_touch() */ #if !defined(_di_f_file_stat_) || !defined(_di_f_file_copy_) || !defined(_di_f_file_exists_) || !defined(_di_f_file_touch_) - extern f_return_status private_f_file_stat(const f_string file_name, const bool dereference, struct stat *file_stat) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_stat(const f_string_t file_name, const bool dereference, struct stat *file_stat) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_stat_) || !defined(_di_f_file_copy_) || !defined(_di_f_file_exists_) || !defined(_di_f_file_touch_) /** @@ -821,7 +821,7 @@ extern "C" { * @see f_file_touch_at() */ #if !defined(_di_f_file_stat_at_) || !defined(_di_f_file_exists_at_) || !defined(_di_f_file_touch_at_) - extern f_return_status private_f_file_stat_at(const int at_id, const f_string file_name, const int flag, struct stat *file_stat) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_stat_at(const int at_id, const f_string_t file_name, const int flag, struct stat *file_stat) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_file_stat_at_) || !defined(_di_f_file_exists_at_) || !defined(_di_f_file_touch_at_) /** @@ -885,7 +885,7 @@ extern "C" { * @see f_file_write_until() */ #if !defined(f_file_write) || !defined(f_file_write_until) || !defined(f_file_write_range) - extern f_return_status private_f_file_write_until(const f_file file, const f_string string, const f_string_length total, f_string_length *written) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_file_write_until(const f_file_t file, const f_string_t string, const f_string_length_t total, f_string_length_t *written) f_gcc_attribute_visibility_internal; #endif // !defined(f_file_write) || !defined(f_file_write_until) || !defined(f_file_write_range) #ifdef __cplusplus diff --git a/level_0/f_fss/c/fss-common.h b/level_0/f_fss/c/fss-common.h index 64f47cc..9ef4305 100644 --- a/level_0/f_fss/c/fss-common.h +++ b/level_0/f_fss/c/fss-common.h @@ -19,7 +19,7 @@ extern "C" { /** * FSS-specific types. */ -#ifndef _di_f_fss_types_ +#ifndef _di_f_fss_types_t_ #define f_fss_comment '#' #define f_fss_space ' ' #define f_fss_space_holder '_' @@ -40,8 +40,8 @@ extern "C" { #define f_fss_type_header_part5 '-' #define f_fss_type_header_close '\n' - typedef unsigned long f_fss_id; -#endif // _di_f_fss_types_ + typedef unsigned long f_fss_id_t; +#endif // _di_f_fss_types_t_ /** * FSS-specific delimiters. @@ -101,23 +101,23 @@ extern "C" { /** * An array of string locations representing where a delimit was applied or is to be applied with respect to some string. */ -#ifndef _di_f_fss_delimits_ - typedef f_string_ranges f_fss_delimits; +#ifndef _di_f_fss_delimits_t_ + typedef f_string_ranges_t f_fss_delimits_t; - #define f_fss_delimits_initialize f_string_ranges_initialize + #define f_fss_delimits_initialize f_string_ranges_t_initialize - #define f_macro_fss_delimits_clear(delimits) f_macro_memory_structure_clear(delimits) + #define f_macro_fss_delimits_clear(delimits) f_macro_memory_structure_t_clear(delimits) - #define f_macro_fss_delimits_new(status, delimits) f_macro_string_ranges_new(status, delimits) - #define f_macro_fss_delimits_delete(status, delimits) f_macro_string_ranges_delete(status, delimits) - #define f_macro_fss_delimits_destroy(status, delimits) f_macro_string_ranges_destroy(status, delimits) + #define f_macro_fss_delimits_new(status, delimits) f_macro_string_ranges_t_new(status, delimits) + #define f_macro_fss_delimits_delete(status, delimits) f_macro_string_ranges_t_delete(status, delimits) + #define f_macro_fss_delimits_destroy(status, delimits) f_macro_string_ranges_t_destroy(status, delimits) - #define f_macro_fss_delimits_delete_simple(delimits) f_macro_string_ranges_delete_simple(delimits) - #define f_macro_fss_delimits_destroy_simple(delimits) f_macro_string_ranges_destroy_simple(delimits) + #define f_macro_fss_delimits_delete_simple(delimits) f_macro_string_ranges_t_delete_simple(delimits) + #define f_macro_fss_delimits_destroy_simple(delimits) f_macro_string_ranges_t_destroy_simple(delimits) - #define f_macro_fss_delimits_resize(status, delimits, new_length) f_macro_string_ranges_resize(status, delimits, new_length) - #define f_macro_fss_delimits_adjust(status, delimits, new_length) f_macro_string_ranges_adjust(status, delimits, new_length) -#endif // _di_f_fss_delimits_ + #define f_macro_fss_delimits_resize(status, delimits, new_length) f_macro_string_ranges_t_resize(status, delimits, new_length) + #define f_macro_fss_delimits_adjust(status, delimits, new_length) f_macro_string_ranges_t_adjust(status, delimits, new_length) +#endif // _di_f_fss_delimits_t_ /** * Stores information about a particular fss file, otherwise known as its header. @@ -127,15 +127,15 @@ extern "C" { * type: the kind of fss file is this. * length: Total length of the header. */ -#ifndef _di_f_fss_header_ +#ifndef _di_f_fss_header_t_ typedef struct { - f_fss_id type; + f_fss_id_t type; - f_string_length length; - } f_fss_header; + f_string_length_t length; + } f_fss_header_t; #define f_fss_header_initialize { 0, 0 } -#endif // _di_f_fss_header_ +#endif // _di_f_fss_header_t_ /** * This holds an array of fss_headers. @@ -144,40 +144,40 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_f_fss_headers_ +#ifndef _di_f_fss_headers_t_ typedef struct { - f_fss_header *array; + f_fss_header_t *array; - f_string_length size; - f_string_length used; - } f_fss_headers; + f_string_length_t size; + f_string_length_t used; + } f_fss_headers_t; #define f_fss_headers_initialize { 0, 0, 0 } - #define f_macro_fss_headers_clear(headers) f_macro_memory_structure_clear(headers) + #define f_macro_fss_headers_clear(headers) f_macro_memory_structure_t_clear(headers) - #define f_macro_fss_headers_new(status, headers, length) f_macro_memory_structure_new(status, headers, f_fss_header, length) + #define f_macro_fss_headers_new(status, headers, length) f_macro_memory_structure_t_new(status, headers, f_fss_header_t, length) - #define f_macro_fss_headers_delete(status, headers) f_macro_memory_structure_delete(status, headers, f_fss_header) - #define f_macro_fss_headers_destroy(status, headers) f_macro_memory_structure_destroy(status, headers, f_fss_header) + #define f_macro_fss_headers_delete(status, headers) f_macro_memory_structure_t_delete(status, headers, f_fss_header_t) + #define f_macro_fss_headers_destroy(status, headers) f_macro_memory_structure_t_destroy(status, headers, f_fss_header_t) - #define f_macro_fss_headers_delete_simple(headers) f_macro_memory_structure_delete_simple(headers, f_fss_header) - #define f_macro_fss_headers_destroy_simple(headers) f_macro_memory_structure_destroy_simple(headers, f_fss_header) + #define f_macro_fss_headers_delete_simple(headers) f_macro_memory_structure_t_delete_simple(headers, f_fss_header_t) + #define f_macro_fss_headers_destroy_simple(headers) f_macro_memory_structure_t_destroy_simple(headers, f_fss_header_t) - #define f_macro_fss_headers_resize(status, headers, new_length) f_macro_memory_structure_resize(status, headers, f_fss_header, new_length) - #define f_macro_fss_headers_adjust(status, headers, new_length) f_macro_memory_structure_adjust(status, headers, f_fss_header, new_length) -#endif // _di_f_fss_headers_ + #define f_macro_fss_headers_resize(status, headers, new_length) f_macro_memory_structure_t_resize(status, headers, f_fss_header_t, new_length) + #define f_macro_fss_headers_adjust(status, headers, new_length) f_macro_memory_structure_t_adjust(status, headers, f_fss_header_t, new_length) +#endif // _di_f_fss_headers_t_ /** * This is a range that represents an object. */ -#ifndef _di_fss_object_ - typedef f_string_range f_fss_object; +#ifndef _di_fss_object_t_ + typedef f_string_range_t f_fss_object_t; - #define f_fss_object_initialize f_string_range_initialize + #define f_fss_object_t_initialize f_string_range_initialize - #define f_macro_fss_object_clear(object) f_macro_string_range_clear(object) -#endif // _di_fss_object_ + #define f_macro_fss_object_t_clear(object) f_macro_string_range_clear(object) +#endif // _di_fss_object_t_ /** * This holds an array of fss_object. @@ -186,24 +186,24 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_fss_objects_ - typedef f_string_ranges f_fss_objects; +#ifndef _di_fss_objects_t_ + typedef f_string_ranges_t f_fss_objects_t; - #define f_fss_objects_initialize f_string_ranges_initialize + #define f_fss_objects_t_initialize f_string_ranges_t_initialize - #define f_macro_fss_objects_clear(objects) f_macro_string_ranges_clear(objects) + #define f_macro_fss_objects_t_clear(objects) f_macro_string_ranges_t_clear(objects) - #define f_macro_fss_objects_new(status, objects, length) f_macro_string_ranges_new(status, objects, length) + #define f_macro_fss_objects_t_new(status, objects, length) f_macro_string_ranges_t_new(status, objects, length) - #define f_macro_fss_objects_delete(status, objects) f_macro_string_ranges_delete(status, objects) - #define f_macro_fss_objects_destroy(status, objects) f_macro_string_ranges_destroy(status, objects) + #define f_macro_fss_objects_t_delete(status, objects) f_macro_string_ranges_t_delete(status, objects) + #define f_macro_fss_objects_t_destroy(status, objects) f_macro_string_ranges_t_destroy(status, objects) - #define f_macro_fss_objects_delete_simple(objects) f_macro_string_ranges_delete_simple(objects) - #define f_macro_fss_objects_destroy_simple(objects) f_macro_string_ranges_destroy_simple(objects) + #define f_macro_fss_objects_t_delete_simple(objects) f_macro_string_ranges_t_delete_simple(objects) + #define f_macro_fss_objects_t_destroy_simple(objects) f_macro_string_ranges_t_destroy_simple(objects) - #define f_macro_fss_objects_resize(status, objects, new_length) f_macro_string_ranges_resize(status, objects, new_length) - #define f_macro_fss_objects_adjust(status, objects, new_length) f_macro_string_ranges_destroy(status, objects, new_length) -#endif // _di_fss_objects_ + #define f_macro_fss_objects_t_resize(status, objects, new_length) f_macro_string_ranges_t_resize(status, objects, new_length) + #define f_macro_fss_objects_t_adjust(status, objects, new_length) f_macro_string_ranges_t_destroy(status, objects, new_length) +#endif // _di_fss_objects_t_ /** * This holds an array of string ranges that represent the content. @@ -215,22 +215,22 @@ extern "C" { * used: Total number of allocated spaces used. */ #ifndef _di_fss_content_ - typedef f_string_ranges f_fss_content; + typedef f_string_ranges_t f_fss_content_t; - #define f_fss_content_initialize f_string_ranges_initialize + #define f_fss_content_t_initialize f_string_ranges_t_initialize - #define f_macro_fss_content_clear(content) f_macro_string_ranges_clear(content) + #define f_macro_fss_content_t_clear(content) f_macro_string_ranges_t_clear(content) - #define f_macro_fss_content_new(status, content, length) f_macro_string_ranges_new(status, content, length) + #define f_macro_fss_content_t_new(status, content, length) f_macro_string_ranges_t_new(status, content, length) - #define f_macro_fss_content_delete(status, content) f_macro_string_ranges_delete(status, content) - #define f_macro_fss_content_destroy(status, content) f_macro_string_ranges_destroy(status, content) + #define f_macro_fss_content_t_delete(status, content) f_macro_string_ranges_t_delete(status, content) + #define f_macro_fss_content_t_destroy(status, content) f_macro_string_ranges_t_destroy(status, content) - #define f_macro_fss_content_delete_simple(content) f_macro_string_ranges_delete_simple(content) - #define f_macro_fss_content_destroy_simple(content) f_macro_string_ranges_destroy_simple(content) + #define f_macro_fss_content_t_delete_simple(content) f_macro_string_ranges_t_delete_simple(content) + #define f_macro_fss_content_t_destroy_simple(content) f_macro_string_ranges_t_destroy_simple(content) - #define f_macro_fss_content_resize(status, content, new_length) f_macro_string_ranges_resize(status, content, new_length) - #define f_macro_fss_content_adjust(status, content, new_length) f_macro_string_ranges_adjust(status, content, new_length) + #define f_macro_fss_content_t_resize(status, content, new_length) f_macro_string_ranges_t_resize(status, content, new_length) + #define f_macro_fss_content_t_adjust(status, content, new_length) f_macro_string_ranges_t_adjust(status, content, new_length) #endif // _di_fss_content_ /** @@ -240,24 +240,24 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_f_fss_contents_ - typedef f_string_rangess f_fss_contents; +#ifndef _di_f_fss_contents_t_ + typedef f_string_rangess_t f_fss_contents_t; - #define f_fss_contents_initialize f_string_rangess_initialize + #define f_fss_contents_t_initialize f_string_rangess_t_initialize - #define f_macro_fss_contents_clear(contents) f_macro_string_rangess_clear(contents) + #define f_macro_fss_contents_t_clear(contents) f_macro_string_rangess_t_clear(contents) - #define f_macro_fss_contents_new(status, contents, length) f_macro_string_rangess_new(status, contents, length) + #define f_macro_fss_contents_t_new(status, contents, length) f_macro_string_rangess_t_new(status, contents, length) - #define f_macro_fss_contents_delete(status, contents) f_macro_string_rangess_delete(status, contents) - #define f_macro_fss_contents_destroy(status, contents) f_macro_string_rangess_destroy(status, contents) + #define f_macro_fss_contents_t_delete(status, contents) f_macro_string_rangess_t_delete(status, contents) + #define f_macro_fss_contents_t_destroy(status, contents) f_macro_string_rangess_t_destroy(status, contents) - #define f_macro_fss_contents_delete_simple(contents) f_macro_string_rangess_delete_simple(contents) - #define f_macro_fss_contents_destroy_simple(contents) f_macro_string_rangess_destroy_simple(contents) + #define f_macro_fss_contents_t_delete_simple(contents) f_macro_string_rangess_t_delete_simple(contents) + #define f_macro_fss_contents_t_destroy_simple(contents) f_macro_string_rangess_t_destroy_simple(contents) - #define f_macro_fss_contents_resize(status, contents, new_length) f_macro_string_rangess_resize(status, contents, new_length) - #define f_macro_fss_contents_adjust(status, contents, new_length) f_macro_string_rangess_adjust(status, contents, new_length) -#endif // _di_f_fss_contents_ + #define f_macro_fss_contents_t_resize(status, contents, new_length) f_macro_string_rangess_t_resize(status, contents, new_length) + #define f_macro_fss_contents_t_adjust(status, contents, new_length) f_macro_string_rangess_t_adjust(status, contents, new_length) +#endif // _di_f_fss_contents_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_fss/c/fss-named.h b/level_0/f_fss/c/fss-named.h index 2dac9dc..dcbc0a4 100644 --- a/level_0/f_fss/c/fss-named.h +++ b/level_0/f_fss/c/fss-named.h @@ -27,104 +27,104 @@ extern "C" { * contents: The array of contents. * quotedss: The array of quoted for each content. */ -#ifndef _di_f_fss_named_ +#ifndef _di_f_fss_named_t_ typedef struct { - f_fss_object name; + f_fss_object_t name; - f_fss_objects objects; - f_fss_contents contents; - f_fss_quotedss quotedss; - } f_fss_named; + f_fss_objects_t objects; + f_fss_contents_t contents; + f_fss_quotedss_t quotedss; + } f_fss_named_t; - #define f_fss_named_initialize { f_fss_object_initialize, f_fss_objects_initialize, f_fss_contents_initialize, f_fss_quotedss_initialize } + #define f_fss_named_t_initialize { f_fss_object_t_initialize, f_fss_objects_t_initialize, f_fss_contents_t_initialize, f_fss_quotedss_t_initialize } - #define f_macro_fss_named_clear(set) \ - f_macro_fss_object_clear(set.object) \ - f_macro_fss_objects_clear(set.objects) \ - f_macro_fss_contents_clear(set.contents) \ - f_macro_fss_quotedss_clear(set.quotedss) + #define f_macro_fss_named_t_clear(set) \ + f_macro_fss_object_t_clear(set.object) \ + f_macro_fss_objects_t_clear(set.objects) \ + f_macro_fss_contents_t_clear(set.contents) \ + f_macro_fss_quotedss_t_clear(set.quotedss) - #define f_macro_fss_named_new(status, set, length) \ - f_macro_fss_objects_new(status, set.objects, length) \ + #define f_macro_fss_named_t_new(status, set, length) \ + f_macro_fss_objects_t_new(status, set.objects, length) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_new(status, set.contents, length) \ + f_macro_fss_contents_t_new(status, set.contents, length) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quotedss_new(status, set.quotedss, length) \ + f_macro_fss_quotedss_t_new(status, set.quotedss, length) \ } - #define f_macro_fss_named_delete(status, set) \ - f_macro_fss_objects_delete(status, set.objects) \ + #define f_macro_fss_named_t_delete(status, set) \ + f_macro_fss_objects_t_delete(status, set.objects) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_delete(status, set.contents) \ + f_macro_fss_contents_t_delete(status, set.contents) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quotedss_delete(status, set.quotedss) \ + f_macro_fss_quotedss_t_delete(status, set.quotedss) \ } - #define f_macro_fss_named_destroy(status, set) \ - f_macro_fss_objects_destroy(status, set.objects) \ + #define f_macro_fss_named_t_destroy(status, set) \ + f_macro_fss_objects_t_destroy(status, set.objects) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_destroy(status, set.contents) \ + f_macro_fss_contents_t_destroy(status, set.contents) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quotedss_destroy(status, set.quotedss) \ + f_macro_fss_quotedss_t_destroy(status, set.quotedss) \ } - #define f_macro_fss_named_delete_simple(set) \ - f_macro_fss_objects_delete_simple(set.objects) \ - f_macro_fss_contents_delete_simple(set.contents) \ - f_macro_fss_quotedss_delete_simple(set.quotedss) + #define f_macro_fss_named_t_delete_simple(set) \ + f_macro_fss_objects_t_delete_simple(set.objects) \ + f_macro_fss_contents_t_delete_simple(set.contents) \ + f_macro_fss_quotedss_t_delete_simple(set.quotedss) - #define f_macro_fss_named_destroy_simple(set) \ - f_macro_fss_objects_destroy_simple(set.objects) \ - f_macro_fss_contents_destroy_simple(set.contents) \ - f_macro_fss_quotedss_destroy_simple(set.quotedss) + #define f_macro_fss_named_t_destroy_simple(set) \ + f_macro_fss_objects_t_destroy_simple(set.objects) \ + f_macro_fss_contents_t_destroy_simple(set.contents) \ + f_macro_fss_quotedss_t_destroy_simple(set.quotedss) - #define f_macro_fss_named_resize(status, set, new_length) \ - f_macro_fss_objects_resize(status, set.objects, new_length) \ + #define f_macro_fss_named_t_resize(status, set, new_length) \ + f_macro_fss_objects_t_resize(status, set.objects, new_length) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_resize(status, set.contents, new_length) \ + f_macro_fss_contents_t_resize(status, set.contents, new_length) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quotedss_resize(status, set.quotedss, new_length) \ + f_macro_fss_quotedss_t_resize(status, set.quotedss, new_length) \ } - #define f_macro_fss_named_adjust(status, set, new_length) \ - f_macro_fss_objects_adjust(status, set.objects, new_length) \ + #define f_macro_fss_named_t_adjust(status, set, new_length) \ + f_macro_fss_objects_t_adjust(status, set.objects, new_length) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_adjust(status, set.contents, new_length) \ + f_macro_fss_contents_t_adjust(status, set.contents, new_length) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quotedss_adjust(status, set.quotedss, new_length) \ + f_macro_fss_quotedss_t_adjust(status, set.quotedss, new_length) \ } -#endif // _di_f_fss_named_ +#endif // _di_f_fss_named_t_ /** - * This holds an array of f_fss_named. + * This holds an array of f_fss_named_t. * - * array: an array of f_fss_named. + * array: an array of f_fss_named_t. * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_fss_nameds_ +#ifndef _di_fss_nameds_t_ typedef struct { - f_fss_named *array; + f_fss_named_t *array; - f_array_length size; - f_array_length used; - } f_fss_nameds; + f_array_length_t size; + f_array_length_t used; + } f_fss_nameds_t; - #define f_fss_nameds_initialize { 0, 0, 0 } + #define f_fss_nameds_t_initialize { 0, 0, 0 } /** * Reset a fss content sets to 0 (clear all values). * * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * - * sets: the f_fss_nameds structure to operate on. + * sets: the f_fss_nameds_t structure to operate on. */ - #define f_macro_fss_nameds_clear(sets) \ + #define f_macro_fss_nameds_t_clear(sets) \ sets.array = 0; \ sets.size = 0; \ sets.used = 0; @@ -135,14 +135,14 @@ extern "C" { * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * * status: the status to return. - * sets: the f_fss_nameds structure to operate on. + * sets: the f_fss_nameds_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_nameds_new(status, sets, length) \ + #define f_macro_fss_nameds_t_new(status, sets, length) \ sets.array = 0; \ sets.size = 0; \ sets.used = 0; \ - status = f_memory_new((void **) & sets.array, sizeof(f_fss_named), length); \ + status = f_memory_new((void **) & sets.array, sizeof(f_fss_named_t), length); \ if (status == F_none) { \ sets.size = length; \ sets.used = 0; \ @@ -152,48 +152,48 @@ extern "C" { * Delete a fss content sets. * * status: the status to return. - * sets: the f_fss_nameds structure to operate on. + * sets: the f_fss_nameds_t structure to operate on. */ - #define f_macro_fss_nameds_delete(status, sets) \ + #define f_macro_fss_nameds_t_delete(status, sets) \ status = F_none; \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_named_delete(status, sets.array[sets.used]); \ + f_macro_fss_named_t_delete(status, sets.array[sets.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & sets.array, sizeof(f_fss_named), sets.size); \ + if (status == F_none) status = f_memory_delete((void **) & sets.array, sizeof(f_fss_named_t), sets.size); \ if (status == F_none) sets.size = 0; /** * Destroy a fss content sets. * * status: the status to return. - * sets: the f_fss_nameds structure to operate on. + * sets: the f_fss_nameds_t structure to operate on. */ - #define f_macro_fss_nameds_destroy(status, sets) \ + #define f_macro_fss_nameds_t_destroy(status, sets) \ status = F_none; \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_named_destroy(status, sets.array[sets.used]); \ + f_macro_fss_named_t_destroy(status, sets.array[sets.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_destroy((void **) & sets.array, sizeof(f_fss_named), sets.size); \ + if (status == F_none) status = f_memory_destroy((void **) & sets.array, sizeof(f_fss_named_t), sets.size); \ if (status == F_none) sets.size = 0; /** * Delete a fss content sets. * - * sets: the f_fss_nameds structure to operate on. + * sets: the f_fss_nameds_t structure to operate on. */ - #define f_macro_fss_nameds_delete_simple(sets) \ + #define f_macro_fss_nameds_t_delete_simple(sets) \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_named_delete_simple(sets.array[sets.used]); \ + f_macro_fss_named_t_delete_simple(sets.array[sets.used]); \ if (sets.used == 0) { \ - if (f_memory_delete((void **) & sets.array, sizeof(f_fss_named), sets.size)) { \ + if (f_memory_delete((void **) & sets.array, sizeof(f_fss_named_t), sets.size)) { \ sets.size = 0; \ } \ } \ @@ -202,15 +202,15 @@ extern "C" { /** * Destroy a fss content sets. * - * sets: the f_fss_nameds structure to operate on. + * sets: the f_fss_nameds_t structure to operate on. */ - #define f_macro_fss_nameds_destroy_simple(sets) \ + #define f_macro_fss_nameds_t_destroy_simple(sets) \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_named_destroy_simple(sets.array[sets.used]); \ + f_macro_fss_named_t_destroy_simple(sets.array[sets.used]); \ if (sets.used == 0) { \ - if (f_memory_destroy((void **) & sets.array, sizeof(f_fss_named), sets.size)) { \ + if (f_memory_destroy((void **) & sets.array, sizeof(f_fss_named_t), sets.size)) { \ sets.size = 0; \ } \ } \ @@ -220,22 +220,22 @@ extern "C" { * Resize a fss content sets. * * status: the status to return. - * sets: the f_fss_nameds structure to operate on. + * sets: the f_fss_nameds_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_nameds_resize(status, sets, new_length) \ + #define f_macro_fss_nameds_t_resize(status, sets, new_length) \ status = F_none; \ if (new_length < sets.size) { \ - for (f_array_length _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ - f_macro_fss_named_delete(status, sets.array[_macro__i]); \ + for (f_array_length_t _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ + f_macro_fss_named_t_delete(status, sets.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & sets.array, sizeof(f_fss_named), sets.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & sets.array, sizeof(f_fss_named_t), sets.size, new_length); \ if (status == F_none) { \ if (new_length > sets.size) { \ - for (f_array_length _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_named)); \ + for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ + memset(&sets.array[_macro__i], 0, sizeof(f_fss_named_t)); \ } \ } \ sets.size = new_length; \ @@ -246,28 +246,28 @@ extern "C" { * Adjust a fss content sets. * * status: the status to return. - * sets: the f_fss_nameds structure to operate on. + * sets: the f_fss_nameds_t structure to operate on. * new_length: he new size of the array. */ - #define f_macro_fss_nameds_adjust(status, sets, new_length) \ + #define f_macro_fss_nameds_t_adjust(status, sets, new_length) \ status = F_none; \ if (new_length < sets.size) { \ - for (f_array_length _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ - f_macro_fss_named_destroy(status, sets.array[_macro__i]); \ + for (f_array_length_t _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ + f_macro_fss_named_t_destroy(status, sets.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & sets.array, sizeof(f_fss_named), sets.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & sets.array, sizeof(f_fss_named_t), sets.size, new_length); \ if (status == F_none) { \ if (new_length > sets.size) { \ - for (f_array_length _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_named)); \ + for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ + memset(&sets.array[_macro__i], 0, sizeof(f_fss_named_t)); \ } \ } \ sets.size = new_length; \ if (sets.used > sets.size) sets.used = new_length; \ } -#endif // _di_fss_nameds_ +#endif // _di_fss_nameds_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_fss/c/fss-nest.h b/level_0/f_fss/c/fss-nest.h index 94d0359..88910a0 100644 --- a/level_0/f_fss/c/fss-nest.h +++ b/level_0/f_fss/c/fss-nest.h @@ -28,26 +28,26 @@ extern "C" { * content: The content associated with the object. * parent: A location referencing a parrent object or content that this object content is nested under. */ -#ifndef _di_fss_item_ +#ifndef _di_fss_item_t_ typedef struct { - f_fss_object object; - f_fss_content content; - f_array_length parent; - } f_fss_item; + f_fss_object_t object; + f_fss_content_t content; + f_array_length_t parent; + } f_fss_item_t; - #define f_fss_item_initialize { f_fss_object_initialize, f_fss_content_initialize, f_array_length_initialize } + #define f_fss_item_t_initialize { f_fss_object_t_initialize, f_fss_content_t_initialize, f_array_length_t_initialize } /** * Reset a fss item stucture to 0 (clear all values). * * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * - * item: the f_fss_item structure to operate on. + * item: the f_fss_item_t structure to operate on. */ - #define f_macro_fss_item_clear(item) \ + #define f_macro_fss_item_t_clear(item) \ item.object.start = 1; \ item.object.stop = 0; \ - f_macro_fss_content_clear(item.content); \ + f_macro_fss_content_t_clear(item.content); \ item.parent = 0; /** @@ -60,20 +60,20 @@ extern "C" { * type: the structure type. * length: the new size of the array. */ - #define f_macro_fss_item_new(status, item, length) \ + #define f_macro_fss_item_t_new(status, item, length) \ item.object.start = 1; \ item.object.stop = 0; \ - f_macro_fss_content_new(status, item.content, length) \ + f_macro_fss_content_t_new(status, item.content, length) \ item.parent = 0; /** * Delete a fss item. * * status: the status to return. - * item: the f_fss_item structure to operate on. + * item: the f_fss_item_t structure to operate on. */ - #define f_macro_fss_item_delete(status, item) \ - f_macro_fss_content_delete(status, item.content) \ + #define f_macro_fss_item_t_delete(status, item) \ + f_macro_fss_content_t_delete(status, item.content) \ if (status == F_none) { \ item.object.start = 1; \ item.object.stop = 0; \ @@ -84,10 +84,10 @@ extern "C" { * Destroy a fss item. * * status: the status to return. - * item: the f_fss_item structure to operate on. + * item: the f_fss_item_t structure to operate on. */ - #define f_macro_fss_item_destroy(status, item) \ - f_macro_fss_content_destroy(status, item.content) \ + #define f_macro_fss_item_t_destroy(status, item) \ + f_macro_fss_content_t_destroy(status, item.content) \ if (status == F_none) { \ item.object.start = 1; \ item.object.stop = 0; \ @@ -97,10 +97,10 @@ extern "C" { /** * Delete a fss item. * - * item: the f_fss_item structure to operate on. + * item: the f_fss_item_t structure to operate on. */ - #define f_macro_fss_item_delete_simple(item) \ - f_macro_fss_content_delete_simple(item.content); \ + #define f_macro_fss_item_t_delete_simple(item) \ + f_macro_fss_content_t_delete_simple(item.content); \ item.object.start = 1; \ item.object.stop = 0; \ item.parent = 0; @@ -108,10 +108,10 @@ extern "C" { /** * Destroy a fss item. * - * item: the f_fss_item structure to operate on. + * item: the f_fss_item_t structure to operate on. */ - #define f_macro_fss_item_destroy_simple(item) \ - f_macro_fss_content_destroy_simple(item.content); \ + #define f_macro_fss_item_t_destroy_simple(item) \ + f_macro_fss_content_t_destroy_simple(item.content); \ item.object.start = 1; \ item.object.stop = 0; \ item.parent = 0; @@ -120,26 +120,26 @@ extern "C" { * Resize a fss item. * * status: the status to return. - * item: the f_fss_item structure to operate on. + * item: the f_fss_item_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_item_resize(status, item, new_length) f_macro_fss_content_resize(status, item.content, new_length); + #define f_macro_fss_item_t_resize(status, item, new_length) f_macro_fss_content_t_resize(status, item.content, new_length); /** * Adjust a fss item. * * status: the status to return. - * item: the f_fss_item structure to operate on. + * item: the f_fss_item_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_item_adjust(status, item, new_length) f_macro_fss_content_adjust(status, item.content, new_length); + #define f_macro_fss_item_t_adjust(status, item, new_length) f_macro_fss_content_t_adjust(status, item.content, new_length); -#endif // _di_fss_item_ +#endif // _di_fss_item_t_ /** * This holds an array of fss_item. * - * This is designed to be used as a part of f_fss_nest. + * This is designed to be used as a part of f_fss_nest_t. * * For example: * object { @@ -164,24 +164,24 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_fss_items_ +#ifndef _di_fss_items_t_ typedef struct { - f_fss_item *array; + f_fss_item_t *array; - f_array_length size; - f_array_length used; - } f_fss_items; + f_array_length_t size; + f_array_length_t used; + } f_fss_items_t; - #define f_fss_items_initialize { 0, 0, 0 } + #define f_fss_items_t_initialize { 0, 0, 0 } /** * Reset a fss items to 0 (clear all values). * * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * - * items: the f_fss_items structure to operate on. + * items: the f_fss_items_t structure to operate on. */ - #define f_macro_fss_items_clear(items) \ + #define f_macro_fss_items_t_clear(items) \ items.array = 0; \ items.size = 0; \ items.used = 0; @@ -192,14 +192,14 @@ extern "C" { * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * * status: the status to return. - * items: the f_fss_items structure to operate on. + * items: the f_fss_items_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_items_new(status, items, length) \ + #define f_macro_fss_items_t_new(status, items, length) \ items.array = 0; \ items.size = 0; \ items.used = 0; \ - status = f_memory_new((void **) & items.array, sizeof(f_fss_item), length); \ + status = f_memory_new((void **) & items.array, sizeof(f_fss_item_t), length); \ if (status == F_none) { \ items.size = length; \ items.used = 0; \ @@ -209,48 +209,48 @@ extern "C" { * Delete a fss items. * * status: the status to return. - * items: the f_fss_items structure to operate on. + * items: the f_fss_items_t structure to operate on. */ - #define f_macro_fss_items_delete(status, items) \ + #define f_macro_fss_items_t_delete(status, items) \ status = F_none; \ items.used = items.size; \ while (items.used > 0) { \ items.used--; \ - f_macro_fss_item_delete(status, items.array[items.used]); \ + f_macro_fss_item_t_delete(status, items.array[items.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & items.array, sizeof(f_fss_item), items.size); \ + if (status == F_none) status = f_memory_delete((void **) & items.array, sizeof(f_fss_item_t), items.size); \ if (status == F_none) items.size = 0; /** * Destroy a fss items. * * status: the status to return. - * items: the f_fss_items structure to operate on. + * items: the f_fss_items_t structure to operate on. */ - #define f_macro_fss_items_destroy(status, items) \ + #define f_macro_fss_items_t_destroy(status, items) \ status = F_none; \ items.used = items.size; \ while (items.used > 0) { \ items.used--; \ - f_macro_fss_item_destroy(status, items.array[items.used]); \ + f_macro_fss_item_t_destroy(status, items.array[items.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & items.array, sizeof(f_fss_item), items.size); \ + if (status == F_none) status = f_memory_delete((void **) & items.array, sizeof(f_fss_item_t), items.size); \ if (status == F_none) items.size = 0; /** * Delete a fss items. * - * items: the f_fss_items structure to operate on. + * items: the f_fss_items_t structure to operate on. */ - #define f_macro_fss_items_delete_simple(items) \ + #define f_macro_fss_items_t_delete_simple(items) \ items.used = items.size; \ while (items.used > 0) { \ items.used--; \ - f_macro_fss_item_delete_simple(items.array[items.used]); \ + f_macro_fss_item_t_delete_simple(items.array[items.used]); \ if (items.used == 0) { \ - if (f_memory_delete((void **) & items.array, sizeof(f_fss_item), items.size)) { \ + if (f_memory_delete((void **) & items.array, sizeof(f_fss_item_t), items.size)) { \ items.size = 0; \ } \ } \ @@ -259,15 +259,15 @@ extern "C" { /** * Destroy a fss items. * - * items: the f_fss_items structure to operate on. + * items: the f_fss_items_t structure to operate on. */ - #define f_macro_fss_items_destroy_simple(items) \ + #define f_macro_fss_items_t_destroy_simple(items) \ items.used = items.size; \ while (items.used > 0) { \ items.used--; \ - f_macro_fss_item_destroy_simple(status, items.array[items.used]); \ + f_macro_fss_item_t_destroy_simple(status, items.array[items.used]); \ if (items.used == 0) { \ - if (f_memory_destroy((void **) & items.array, sizeof(f_fss_item), items.size)) { \ + if (f_memory_destroy((void **) & items.array, sizeof(f_fss_item_t), items.size)) { \ items.size = 0; \ } \ } \ @@ -277,22 +277,22 @@ extern "C" { * Resize a fss items. * * status: the status to return. - * items: the f_fss_items structure to operate on. + * items: the f_fss_items_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_items_resize(status, items, new_length) \ + #define f_macro_fss_items_t_resize(status, items, new_length) \ status = F_none; \ if (new_length < items.size) { \ - for (f_array_length _macro__i = items.size - new_length; _macro__i < items.size; _macro__i++) { \ - f_macro_fss_item_delete(status, items.array[_macro__i]); \ + for (f_array_length_t _macro__i = items.size - new_length; _macro__i < items.size; _macro__i++) { \ + f_macro_fss_item_t_delete(status, items.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & items.array, sizeof(f_fss_item), items.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & items.array, sizeof(f_fss_item_t), items.size, new_length); \ if (status == F_none) { \ if (new_length > items.size) { \ - for (f_array_length _macro__i = items.size; _macro__i < new_length; _macro__i++) { \ - memset(&items.array[_macro__i], 0, sizeof(f_fss_item)); \ + for (f_array_length_t _macro__i = items.size; _macro__i < new_length; _macro__i++) { \ + memset(&items.array[_macro__i], 0, sizeof(f_fss_item_t)); \ } \ } \ items.size = new_length; \ @@ -303,59 +303,59 @@ extern "C" { * Adjust a fss items. * * status: the status to return. - * items: the f_fss_items structure to operate on. + * items: the f_fss_items_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_items_adjust(status, items, new_length) \ + #define f_macro_fss_items_t_adjust(status, items, new_length) \ status = F_none; \ if (new_length < items.size) { \ for (length_variable _macro__i = items.size - new_length; _macro__i < items.size; _macro__i++) { \ - f_macro_fss_item_destroy(status, items.array[_macro__i]); \ + f_macro_fss_item_t_destroy(status, items.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & items.array, sizeof(f_fss_item), items.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & items.array, sizeof(f_fss_item_t), items.size, new_length); \ if (status == F_none) { \ if (new_length > items.size) { \ for (length_variable _macro__i = items.size; _macro__i < new_length; _macro__i++) { \ - memset(&items.array[_macro__i], 0, sizeof(f_fss_item)); \ + memset(&items.array[_macro__i], 0, sizeof(f_fss_item_t)); \ } \ } \ items.size = new_length; \ if (items.used > items.size) items.used = new_length; \ } -#endif // _di_fss_items_ +#endif // _di_fss_items_t_ /** - * This holds an array of f_fss_items. + * This holds an array of f_fss_items_t. * * Each array row represents the nesting depth. * The top-level will not have any parent, so "parent" must be ignored on anything at index 0. * The parent identifier is expected to reference a position in the nesting depth immediately above it. * @todo: consider instead of using a "parent", have setting set to 0 to represent no data. * - * depth: An array of f_fss_items, with each index representing the depth. + * depth: An array of f_fss_items_t, with each index representing the depth. * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_fss_nest_ +#ifndef _di_fss_nest_t_ typedef struct { - f_fss_items *depth; + f_fss_items_t *depth; - f_array_length size; - f_array_length used; - } f_fss_nest; + f_array_length_t size; + f_array_length_t used; + } f_fss_nest_t; - #define f_fss_nest_initialize { 0, 0, 0 } + #define f_fss_nest_t_initialize { 0, 0, 0 } /** * Reset a fss content nest to 0 (clear all values). * * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * - * nest: the f_fss_nest structure to operate on. + * nest: the f_fss_nest_t structure to operate on. */ - #define f_macro_fss_nest_clear(nest) \ + #define f_macro_fss_nest_t_clear(nest) \ nest.depth = 0; \ nest.size = 0; \ nest.used = 0; @@ -366,14 +366,14 @@ extern "C" { * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * * status: the status to return. - * nest: the f_fss_nest structure to operate on. + * nest: the f_fss_nest_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_nest_new(status, nest, length) \ + #define f_macro_fss_nest_t_new(status, nest, length) \ nest.depth = 0; \ nest.size = 0; \ nest.used = 0; \ - status = f_memory_new((void **) & nest.depth, sizeof(f_fss_items), length); \ + status = f_memory_new((void **) & nest.depth, sizeof(f_fss_items_t), length); \ if (status == F_none) { \ nest.size = length; \ nest.used = 0; \ @@ -383,48 +383,48 @@ extern "C" { * Delete a fss content nest. * * status: the status to return. - * nest: the f_fss_nest structure to operate on. + * nest: the f_fss_nest_t structure to operate on. */ - #define f_macro_fss_nest_delete(status, nest) \ + #define f_macro_fss_nest_t_delete(status, nest) \ status = F_none; \ nest.used = nest.size; \ while (nest.used > 0) { \ nest.used--; \ - f_macro_fss_items_delete(status, nest.depth[nest.used]); \ + f_macro_fss_items_t_delete(status, nest.depth[nest.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & nest.depth, sizeof(f_fss_items), nest.size); \ + if (status == F_none) status = f_memory_delete((void **) & nest.depth, sizeof(f_fss_items_t), nest.size); \ if (status == F_none) nest.size = 0; /** * Destroy a fss content nest. * * status: the status to return. - * nest: the f_fss_nest structure to operate on. + * nest: the f_fss_nest_t structure to operate on. */ - #define f_macro_fss_nest_destroy(status, nest) \ + #define f_macro_fss_nest_t_destroy(status, nest) \ status = F_none; \ nest.used = nest.size; \ while (nest.used > 0) { \ nest.used--; \ - f_macro_fss_items_destroy(status, nest.depth[nest.used]); \ + f_macro_fss_items_t_destroy(status, nest.depth[nest.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & nest.depth, sizeof(f_fss_items), nest.size); \ + if (status == F_none) status = f_memory_delete((void **) & nest.depth, sizeof(f_fss_items_t), nest.size); \ if (status == F_none) nest.size = 0; /** * Delete a fss content nest. * - * nest: the f_fss_nest structure to operate on. + * nest: the f_fss_nest_t structure to operate on. */ - #define f_macro_fss_nest_delete_simple(nest) \ + #define f_macro_fss_nest_t_delete_simple(nest) \ nest.used = nest.size; \ while (nest.used > 0) { \ nest.used--; \ - f_macro_fss_items_delete_simple(nest.depth[nest.used]); \ + f_macro_fss_items_t_delete_simple(nest.depth[nest.used]); \ if (nest.used == 0) { \ - if (f_memory_delete((void **) & nest.depth, sizeof(f_fss_items), nest.size)) { \ + if (f_memory_delete((void **) & nest.depth, sizeof(f_fss_items_t), nest.size)) { \ nest.size = 0; \ } \ } \ @@ -433,15 +433,15 @@ extern "C" { /** * Destroy a fss content nest. * - * nest: the f_fss_nest structure to operate on. + * nest: the f_fss_nest_t structure to operate on. */ - #define f_macro_fss_nest_destroy_simple(nest) \ + #define f_macro_fss_nest_t_destroy_simple(nest) \ nest.used = nest.size; \ while (nest.used > 0) { \ nest.used--; \ - f_macro_fss_items_destroy_simple(nest.depth[nest.used]); \ + f_macro_fss_items_t_destroy_simple(nest.depth[nest.used]); \ if (nest.used == 0) { \ - if (f_memory_destroy((void **) & nest.depth, sizeof(f_fss_items), nest.size)) { \ + if (f_memory_destroy((void **) & nest.depth, sizeof(f_fss_items_t), nest.size)) { \ nest.size = 0; \ } \ } \ @@ -451,22 +451,22 @@ extern "C" { * Resize a fss content nest. * * status: the status to return. - * nest: the f_fss_nest structure to operate on. + * nest: the f_fss_nest_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_nest_resize(status, nest, new_length) \ + #define f_macro_fss_nest_t_resize(status, nest, new_length) \ status = F_none; \ if (new_length < nest.size) { \ - for (f_array_length _macro__i = nest.size - new_length; _macro__i < nest.size; _macro__i++) { \ - f_macro_fss_items_delete(status, nest.depth[_macro__i]); \ + for (f_array_length_t _macro__i = nest.size - new_length; _macro__i < nest.size; _macro__i++) { \ + f_macro_fss_items_t_delete(status, nest.depth[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & nest.depth, sizeof(f_fss_items), nest.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & nest.depth, sizeof(f_fss_items_t), nest.size, new_length); \ if (status == F_none) { \ if (new_length > nest.size) { \ - for (f_array_length _macro__i = nest.size; _macro__i < new_length; _macro__i++) { \ - memset(&nest.depth[_macro__i], 0, sizeof(f_fss_items)); \ + for (f_array_length_t _macro__i = nest.size; _macro__i < new_length; _macro__i++) { \ + memset(&nest.depth[_macro__i], 0, sizeof(f_fss_items_t)); \ } \ } \ nest.size = new_length; \ @@ -477,54 +477,54 @@ extern "C" { * Adjust a fss content nest. * * status: the status to return. - * nest: the f_fss_nest structure to operate on. + * nest: the f_fss_nest_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_nest_adjust(status, nest, new_length) \ + #define f_macro_fss_nest_t_adjust(status, nest, new_length) \ status = F_none; \ if (new_length < nest.size) { \ - for (f_array_length _macro__i = nest.size - new_length; _macro__i < nest.size; _macro__i++) { \ - f_macro_fss_items_destroy(status, nest.depth[_macro__i]); \ + for (f_array_length_t _macro__i = nest.size - new_length; _macro__i < nest.size; _macro__i++) { \ + f_macro_fss_items_t_destroy(status, nest.depth[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & nest.depth, sizeof(f_fss_item), nest.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & nest.depth, sizeof(f_fss_item_t), nest.size, new_length); \ if (status == F_none) { \ if (new_length > nest.size) { \ - for (f_array_length _macro__i = nest.size; _macro__i < new_length; _macro__i++) { \ - memset(&items.depth[_macro__i], 0, sizeof(f_fss_item)); \ + for (f_array_length_t _macro__i = nest.size; _macro__i < new_length; _macro__i++) { \ + memset(&items.depth[_macro__i], 0, sizeof(f_fss_item_t)); \ } \ } \ nest.size = new_length; \ if (nest.used > nest.size) nest.used = new_length; \ } -#endif // _di_fss_nest_ +#endif // _di_fss_nest_t_ /** - * This holds an array of f_fss_nest. + * This holds an array of f_fss_nest_t. * - * array: an array of f_fss_nest. + * array: an array of f_fss_nest_t. * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_fss_nests_ +#ifndef _di_fss_nests_t_ typedef struct { - f_fss_nest *array; + f_fss_nest_t *array; - f_array_length size; - f_array_length used; - } f_fss_nests; + f_array_length_t size; + f_array_length_t used; + } f_fss_nests_t; - #define f_fss_nests_initialize { 0, 0, 0 } + #define f_fss_nests_t_initialize { 0, 0, 0 } /** * Reset a fss content nests to 0 (clear all values). * * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * - * nests: the f_fss_nests structure to operate on. + * nests: the f_fss_nests_t structure to operate on. */ - #define f_macro_fss_nests_clear(nests) \ + #define f_macro_fss_nests_t_clear(nests) \ nests.array = 0; \ nests.size = 0; \ nests.used = 0; @@ -535,14 +535,14 @@ extern "C" { * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * * status: the status to return. - * nests: the f_fss_nests structure to operate on. + * nests: the f_fss_nests_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_nests_new(status, nests, length) \ + #define f_macro_fss_nests_t_new(status, nests, length) \ nests.array = 0; \ nests.size = 0; \ nests.used = 0; \ - status = f_memory_new((void **) & nests.array, sizeof(f_fss_nest), length); \ + status = f_memory_new((void **) & nests.array, sizeof(f_fss_nest_t), length); \ if (status == F_none) { \ nests.size = length; \ nests.used = 0; \ @@ -552,48 +552,48 @@ extern "C" { * Delete a fss content nests. * * status: the status to return. - * nests: the f_fss_nests structure to operate on. + * nests: the f_fss_nests_t structure to operate on. */ - #define f_macro_fss_nests_delete(nests) \ + #define f_macro_fss_nests_t_delete(nests) \ status = F_none; \ nests.used = nests.size; \ while (nests.used > 0) { \ nests.used--; \ - f_macro_fss_nest_delete(status, nests.array[nests.used]); \ + f_macro_fss_nest_t_delete(status, nests.array[nests.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & nests.array, sizeof(f_fss_nest), nests.size); \ + if (status == F_none) status = f_memory_delete((void **) & nests.array, sizeof(f_fss_nest_t), nests.size); \ if (status == F_none) nests.size = 0; /** * Destroy a fss content nests. * * status: the status to return. - * nests: the f_fss_nests structure to operate on. + * nests: the f_fss_nests_t structure to operate on. */ - #define f_macro_fss_nests_destroy(nests) \ + #define f_macro_fss_nests_t_destroy(nests) \ status = F_none; \ nests.used = nests.size; \ while (nests.used > 0) { \ nests.used--; \ - f_macro_fss_nest_destroy(status, nests.array[nests.used]); \ + f_macro_fss_nest_t_destroy(status, nests.array[nests.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_destroy((void **) & nests.array, sizeof(f_fss_nest), nests.size); \ + if (status == F_none) status = f_memory_destroy((void **) & nests.array, sizeof(f_fss_nest_t), nests.size); \ if (status == F_none) nests.size = 0; /** * Delete a fss content nests. * - * nests: the f_fss_nests structure to operate on. + * nests: the f_fss_nests_t structure to operate on. */ - #define f_macro_fss_nests_delete_simple(nests) \ + #define f_macro_fss_nests_t_delete_simple(nests) \ nests.used = nests.size; \ while (nests.used > 0) { \ nests.used--; \ - f_macro_fss_nest_delete_simple(nests.array[nests.used]); \ + f_macro_fss_nest_t_delete_simple(nests.array[nests.used]); \ if (nests.used == 0) { \ - if (f_memory_delete((void **) & nests.array, sizeof(f_fss_nest), nests.size)) { \ + if (f_memory_delete((void **) & nests.array, sizeof(f_fss_nest_t), nests.size)) { \ nests.size = 0; \ } \ } \ @@ -602,15 +602,15 @@ extern "C" { /** * Destroy a fss content nests. * - * nests: the f_fss_nests structure to operate on. + * nests: the f_fss_nests_t structure to operate on. */ - #define f_macro_fss_nests_destroy_simple(nests) \ + #define f_macro_fss_nests_t_destroy_simple(nests) \ nests.used = nests.size; \ while (nests.used > 0) { \ nests.used--; \ - f_macro_fss_nest_destroy_simple(nests.array[nests.used]); \ + f_macro_fss_nest_t_destroy_simple(nests.array[nests.used]); \ if (nests.used == 0) { \ - if (f_memory_destroy((void **) & nests.array, sizeof(f_fss_nest), nests.size)) { \ + if (f_memory_destroy((void **) & nests.array, sizeof(f_fss_nest_t), nests.size)) { \ nests.size = 0; \ } \ } \ @@ -620,22 +620,22 @@ extern "C" { * Resize a fss content nests. * * status: the status to return. - * nests: the f_fss_nests structure to operate on. + * nests: the f_fss_nests_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_nests_resize(status, nests, new_length) \ + #define f_macro_fss_nests_t_resize(status, nests, new_length) \ status = F_none; \ if (new_length < nests.size) { \ - for (f_array_length _macro__i = nests.size - new_length; _macro__i < nests.size; _macro__i++) { \ - f_macro_fss_nest_delete(status, nests.array[_macro__i]); \ + for (f_array_length_t _macro__i = nests.size - new_length; _macro__i < nests.size; _macro__i++) { \ + f_macro_fss_nest_t_delete(status, nests.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & nests.array, sizeof(f_fss_nest), nests.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & nests.array, sizeof(f_fss_nest_t), nests.size, new_length); \ if (status == F_none) { \ if (new_length > nests.size) { \ - for (f_array_length _macro__i = nests.size; _macro__i < new_length; _macro__i++) { \ - memset(&nests.array[_macro__i], 0, sizeof(f_fss_nest)); \ + for (f_array_length_t _macro__i = nests.size; _macro__i < new_length; _macro__i++) { \ + memset(&nests.array[_macro__i], 0, sizeof(f_fss_nest_t)); \ } \ } \ nests.size = new_length; \ @@ -646,28 +646,28 @@ extern "C" { * Adjust a fss content nests. * * status: the status to return. - * nests: the f_fss_nests structure to operate on. + * nests: the f_fss_nests_t structure to operate on. * new_length: he new size of the array. */ - #define f_macro_fss_nests_adjust(status, nests, new_length) \ + #define f_macro_fss_nests_t_adjust(status, nests, new_length) \ status = F_none; \ if (new_length < nests.size) { \ - for (f_array_length _macro__i = nests.size - new_length; _macro__i < nests.size; _macro__i++) { \ - f_macro_fss_nest_destroy(status, nests.array[_macro__i]); \ + for (f_array_length_t _macro__i = nests.size - new_length; _macro__i < nests.size; _macro__i++) { \ + f_macro_fss_nest_t_destroy(status, nests.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & nests.array, sizeof(f_fss_nest), nests.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & nests.array, sizeof(f_fss_nest_t), nests.size, new_length); \ if (status == F_none) { \ if (new_length > nests.size) { \ - for (f_array_length _macro__i = nests.size; _macro__i < new_length; _macro__i++) { \ - memset(&nests.array[_macro__i], 0, sizeof(f_fss_nest)); \ + for (f_array_length_t _macro__i = nests.size; _macro__i < new_length; _macro__i++) { \ + memset(&nests.array[_macro__i], 0, sizeof(f_fss_nest_t)); \ } \ } \ nests.size = new_length; \ if (nests.used > nests.size) nests.used = new_length; \ } -#endif // _di_fss_nests_ +#endif // _di_fss_nests_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_fss/c/fss-quoted.h b/level_0/f_fss/c/fss-quoted.h index ed9493c..648d7f7 100644 --- a/level_0/f_fss/c/fss-quoted.h +++ b/level_0/f_fss/c/fss-quoted.h @@ -29,61 +29,61 @@ extern "C" { /** * Designate an fss quoted. */ -#ifndef _di_f_fss_quoted_ - typedef uint8_t f_fss_quoted; -#endif // _di_f_fss_quoted_ +#ifndef _di_f_fss_quoted_t_ + typedef uint8_t f_fss_quoted_t; +#endif // _di_f_fss_quoted_t_ /** - * An array of f_fss_quoted. + * An array of f_fss_quoted_t. * * array: the array of fss quoted. * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_fss_quoteds_ - typedef f_uint8_ts f_fss_quoteds; +#ifndef _di_f_fss_quoteds_t_ + typedef f_uint8s_t f_fss_quoteds_t; - #define f_fss_quoteds_initialize f_uint8_ts_initialize + #define f_fss_quoteds_t_initialize f_uint8s_t_initialize - #define f_macro_fss_quoteds_clear(quoteds) f_macro_uint8_ts_clear(quoteds) + #define f_macro_fss_quoteds_t_clear(quoteds) f_macro_uint8s_t_clear(quoteds) - #define f_macro_fss_quoteds_new(status, quoteds, length) f_macro_uint8_ts_new(status, quoteds, length) + #define f_macro_fss_quoteds_t_new(status, quoteds, length) f_macro_uint8s_t_new(status, quoteds, length) - #define f_macro_fss_quoteds_delete(status, quoteds) f_macro_uint8_ts_delete(status, quoteds) - #define f_macro_fss_quoteds_destroy(status, quoteds) f_macro_uint8_ts_destroy(status, quoteds) + #define f_macro_fss_quoteds_t_delete(status, quoteds) f_macro_uint8s_t_delete(status, quoteds) + #define f_macro_fss_quoteds_t_destroy(status, quoteds) f_macro_uint8s_t_destroy(status, quoteds) - #define f_macro_fss_quoteds_delete_simple(quoteds) f_macro_uint8_ts_delete_simple(quoteds) - #define f_macro_fss_quoteds_destroy_simple(quoteds) f_macro_uint8_ts_destroy_simple(quoteds) + #define f_macro_fss_quoteds_t_delete_simple(quoteds) f_macro_uint8s_t_delete_simple(quoteds) + #define f_macro_fss_quoteds_t_destroy_simple(quoteds) f_macro_uint8s_t_destroy_simple(quoteds) - #define f_macro_fss_quoteds_resize(status, quoteds, new_length) f_macro_uint8_ts_resize(status, quoteds, new_length) - #define f_macro_fss_quoteds_adjust(status, quoteds, new_length) f_macro_uint8_ts_adjust(status, quoteds, new_length) -#endif // _di_f_fss_quoteds_ + #define f_macro_fss_quoteds_t_resize(status, quoteds, new_length) f_macro_uint8s_t_resize(status, quoteds, new_length) + #define f_macro_fss_quoteds_t_adjust(status, quoteds, new_length) f_macro_uint8s_t_adjust(status, quoteds, new_length) +#endif // _di_f_fss_quoteds_t_ /** - * An array of f_fss_quoteds. + * An array of f_fss_quoteds_t. * * array: the array of fss quoteds. * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_fss_quotedss_ - typedef f_uint8_tss f_fss_quotedss; +#ifndef _di_f_fss_quotedss_t_ + typedef f_uint8ss_t f_fss_quotedss_t; - #define f_fss_quotedss_initialize f_uint8_tss_initialize + #define f_fss_quotedss_t_initialize f_uint8ss_t_initialize - #define f_macro_fss_quotedss_clear(quotedss) f_macro_uint8_tss_clear(quotedss) + #define f_macro_fss_quotedss_t_clear(quotedss) f_macro_uint8ss_t_clear(quotedss) - #define f_macro_fss_quotedss_new(status, quotedss, length) f_macro_uint8_tss_new(status, quotedss, length) + #define f_macro_fss_quotedss_t_new(status, quotedss, length) f_macro_uint8ss_t_new(status, quotedss, length) - #define f_macro_fss_quotedss_delete(status, quotedss) f_macro_uint8_tss_delete(status, quotedss) - #define f_macro_fss_quotedss_destroy(status, quotedss) f_macro_uint8_tss_destroy(status, quotedss) + #define f_macro_fss_quotedss_t_delete(status, quotedss) f_macro_uint8ss_t_delete(status, quotedss) + #define f_macro_fss_quotedss_t_destroy(status, quotedss) f_macro_uint8ss_t_destroy(status, quotedss) - #define f_macro_fss_quotedss_delete_simple(quotedss) f_macro_uint8_tss_delete_simple(quotedss) - #define f_macro_fss_quotedss_destroy_simple(quotedss) f_macro_uint8_tss_destroy_simple(quotedss) + #define f_macro_fss_quotedss_t_delete_simple(quotedss) f_macro_uint8ss_t_delete_simple(quotedss) + #define f_macro_fss_quotedss_t_destroy_simple(quotedss) f_macro_uint8ss_t_destroy_simple(quotedss) - #define f_macro_fss_quotedss_resize(status, quotedss, new_length) f_macro_uint8_tss_resize(status, quotedss, new_length) - #define f_macro_fss_quotedss_adjust(status, quotedss, new_length) f_macro_uint8_tss_adjust(status, quotedss, new_length) -#endif // _di_f_fss_quotedss_ + #define f_macro_fss_quotedss_t_resize(status, quotedss, new_length) f_macro_uint8ss_t_resize(status, quotedss, new_length) + #define f_macro_fss_quotedss_t_adjust(status, quotedss, new_length) f_macro_uint8ss_t_adjust(status, quotedss, new_length) +#endif // _di_f_fss_quotedss_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_fss/c/fss-set.h b/level_0/f_fss/c/fss-set.h index d47a429..72bd804 100644 --- a/level_0/f_fss/c/fss-set.h +++ b/level_0/f_fss/c/fss-set.h @@ -25,82 +25,82 @@ extern "C" { * objects: the array of objects. * contents: the array of contents. */ -#ifndef _di_f_fss_set_ +#ifndef _di_f_fss_set_t_ typedef struct { - f_fss_objects objects; - f_fss_contents contents; - } f_fss_set; + f_fss_objects_t objects; + f_fss_contents_t contents; + } f_fss_set_t; - #define f_fss_set_initialize { f_fss_objects_initialize, f_fss_contents_initialize } + #define f_fss_set_t_initialize { f_fss_objects_t_initialize, f_fss_contents_t_initialize } - #define f_macro_fss_set_clear(set) \ - f_macro_fss_objects_clear(set.objects) \ - f_macro_fss_contents_clear(set.contents) + #define f_macro_fss_set_t_clear(set) \ + f_macro_fss_objects_t_clear(set.objects) \ + f_macro_fss_contents_t_clear(set.contents) - #define f_macro_fss_set_new(status, set, length) \ - f_macro_fss_objects_new(status, set.objects, length) \ + #define f_macro_fss_set_t_new(status, set, length) \ + f_macro_fss_objects_t_new(status, set.objects, length) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_new(status, set.contents, length) \ + f_macro_fss_contents_t_new(status, set.contents, length) \ } - #define f_macro_fss_set_delete(status, set) \ - f_macro_fss_objects_delete(status, set.objects) \ + #define f_macro_fss_set_t_delete(status, set) \ + f_macro_fss_objects_t_delete(status, set.objects) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_delete(status, set.contents) \ + f_macro_fss_contents_t_delete(status, set.contents) \ } - #define f_macro_fss_set_destroy(status, set) \ - f_macro_fss_objects_destroy(status, set.objects) \ + #define f_macro_fss_set_t_destroy(status, set) \ + f_macro_fss_objects_t_destroy(status, set.objects) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_destroy(status, set.contents) \ + f_macro_fss_contents_t_destroy(status, set.contents) \ } - #define f_macro_fss_set_delete_simple(set) \ - f_macro_fss_objects_delete_simple(set.objects) \ - f_macro_fss_contents_delete_simple(set.contents) + #define f_macro_fss_set_t_delete_simple(set) \ + f_macro_fss_objects_t_delete_simple(set.objects) \ + f_macro_fss_contents_t_delete_simple(set.contents) - #define f_macro_fss_set_destroy_simple(set) \ - f_macro_fss_objects_destroy_simple(set.objects) \ - f_macro_fss_contents_destroy_simple(set.contents) + #define f_macro_fss_set_t_destroy_simple(set) \ + f_macro_fss_objects_t_destroy_simple(set.objects) \ + f_macro_fss_contents_t_destroy_simple(set.contents) - #define f_macro_fss_set_resize(status, set, new_length) \ - f_macro_fss_objects_resize(status, set.objects, new_length) \ + #define f_macro_fss_set_t_resize(status, set, new_length) \ + f_macro_fss_objects_t_resize(status, set.objects, new_length) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_resize(status, set.contents, new_length) \ + f_macro_fss_contents_t_resize(status, set.contents, new_length) \ } - #define f_macro_fss_set_adjust(status, set, new_length) \ - f_macro_fss_objects_resize(status, set.objects, new_length) \ + #define f_macro_fss_set_t_adjust(status, set, new_length) \ + f_macro_fss_objects_t_resize(status, set.objects, new_length) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_resize(status, set.contents, new_length) \ + f_macro_fss_contents_t_resize(status, set.contents, new_length) \ } -#endif // _di_f_fss_set_ +#endif // _di_f_fss_set_t_ /** - * This holds an array of f_fss_set. + * This holds an array of f_fss_set_t. * - * array: an array of f_fss_set. + * array: an array of f_fss_set_t. * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_fss_sets_ +#ifndef _di_f_fss_sets_t_ typedef struct { - f_fss_set *array; + f_fss_set_t *array; - f_array_length size; - f_array_length used; - } f_fss_sets; + f_array_length_t size; + f_array_length_t used; + } f_fss_sets_t; - #define f_fss_sets_initialize { 0, 0, 0 } + #define f_fss_sets_t_initialize { 0, 0, 0 } /** * Reset a fss content sets to 0 (clear all values). * * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * - * sets: the f_fss_sets structure to operate on. + * sets: the f_fss_sets_t structure to operate on. */ - #define f_macro_fss_sets_clear(sets) \ + #define f_macro_fss_sets_t_clear(sets) \ sets.array = 0; \ sets.size = 0; \ sets.used = 0; @@ -111,14 +111,14 @@ extern "C" { * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * * status: the status to return. - * sets: the f_fss_sets structure to operate on. + * sets: the f_fss_sets_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_sets_new(status, sets, length) \ + #define f_macro_fss_sets_t_new(status, sets, length) \ sets.array = 0; \ sets.size = 0; \ sets.used = 0; \ - status = f_memory_new((void **) & sets.array, sizeof(f_fss_set), length); \ + status = f_memory_new((void **) & sets.array, sizeof(f_fss_set_t), length); \ if (status == F_none) { \ sets.size = length; \ sets.used = 0; \ @@ -128,48 +128,48 @@ extern "C" { * Delete a fss content sets. * * status: the status to return. - * sets: the f_fss_sets structure to operate on. + * sets: the f_fss_sets_t structure to operate on. */ - #define f_macro_fss_sets_delete(status, sets) \ + #define f_macro_fss_sets_t_delete(status, sets) \ status = F_none; \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_set_delete(status, sets.array[sets.used]); \ + f_macro_fss_set_t_delete(status, sets.array[sets.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & sets.array, sizeof(f_fss_set), sets.size); \ + if (status == F_none) status = f_memory_delete((void **) & sets.array, sizeof(f_fss_set_t), sets.size); \ if (status == F_none) sets.size = 0; /** * Destroy a fss content sets. * * status: the status to return. - * sets: the f_fss_sets structure to operate on. + * sets: the f_fss_sets_t structure to operate on. */ - #define f_macro_fss_sets_destroy(status, sets) \ + #define f_macro_fss_sets_t_destroy(status, sets) \ status = F_none; \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_set_destroy(status, sets.array[sets.used]); \ + f_macro_fss_set_t_destroy(status, sets.array[sets.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_destroy((void **) & sets.array, sizeof(f_fss_set), sets.size); \ + if (status == F_none) status = f_memory_destroy((void **) & sets.array, sizeof(f_fss_set_t), sets.size); \ if (status == F_none) sets.size = 0; /** * Delete a fss content sets. * - * sets: the f_fss_sets structure to operate on. + * sets: the f_fss_sets_t structure to operate on. */ - #define f_macro_fss_sets_delete_simple(sets) \ + #define f_macro_fss_sets_t_delete_simple(sets) \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_set_delete_simple(sets.array[sets.used]); \ + f_macro_fss_set_t_delete_simple(sets.array[sets.used]); \ if (sets.used == 0) { \ - if (f_memory_delete((void **) & sets.array, sizeof(f_fss_set), sets.size)) { \ + if (f_memory_delete((void **) & sets.array, sizeof(f_fss_set_t), sets.size)) { \ sets.size = 0; \ } \ } \ @@ -178,15 +178,15 @@ extern "C" { /** * Destroy a fss content sets. * - * sets: the f_fss_sets structure to operate on. + * sets: the f_fss_sets_t structure to operate on. */ - #define f_macro_fss_sets_destroy_simple(sets) \ + #define f_macro_fss_sets_t_destroy_simple(sets) \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_set_destroy_simple(sets.array[sets.used]); \ + f_macro_fss_set_t_destroy_simple(sets.array[sets.used]); \ if (sets.used == 0) { \ - if (f_memory_destroy((void **) & sets.array, sizeof(f_fss_set), sets.size)) { \ + if (f_memory_destroy((void **) & sets.array, sizeof(f_fss_set_t), sets.size)) { \ sets.size = 0; \ } \ } \ @@ -196,22 +196,22 @@ extern "C" { * Resize a fss content sets. * * status: the status to return. - * sets: the f_fss_sets structure to operate on. + * sets: the f_fss_sets_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_sets_resize(status, sets, new_length) \ + #define f_macro_fss_sets_t_resize(status, sets, new_length) \ status = F_none; \ if (new_length < sets.size) { \ - for (f_array_length _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ - f_macro_fss_set_delete(status, sets.array[_macro__i]); \ + for (f_array_length_t _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ + f_macro_fss_set_t_delete(status, sets.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & sets.array, sizeof(f_fss_set), sets.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & sets.array, sizeof(f_fss_set_t), sets.size, new_length); \ if (status == F_none) { \ if (new_length > sets.size) { \ - for (f_array_length _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_set)); \ + for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ + memset(&sets.array[_macro__i], 0, sizeof(f_fss_set_t)); \ } \ } \ sets.size = new_length; \ @@ -222,28 +222,28 @@ extern "C" { * Adjust a fss content sets. * * status: the status to return. - * sets: the f_fss_sets structure to operate on. + * sets: the f_fss_sets_t structure to operate on. * new_length: he new size of the array. */ - #define f_macro_fss_sets_adjust(status, sets, new_length) \ + #define f_macro_fss_sets_t_adjust(status, sets, new_length) \ status = F_none; \ if (new_length < sets.size) { \ - for (f_array_length _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ - f_macro_fss_set_destroy(status, sets.array[_macro__i]); \ + for (f_array_length_t _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ + f_macro_fss_set_t_destroy(status, sets.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & sets.array, sizeof(f_fss_set), sets.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & sets.array, sizeof(f_fss_set_t), sets.size, new_length); \ if (status == F_none) { \ if (new_length > sets.size) { \ - for (f_array_length _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_set)); \ + for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ + memset(&sets.array[_macro__i], 0, sizeof(f_fss_set_t)); \ } \ } \ sets.size = new_length; \ if (sets.used > sets.size) sets.used = new_length; \ } -#endif // _di_fss_sets_ +#endif // _di_f_fss_sets_t_ /** * This holds an fss object with a set of fss content, along with their quoted types. @@ -256,121 +256,121 @@ extern "C" { * objects_quoted: the array of objects quoted types. * contents_quoted: the array of contents quoted types. */ -#ifndef _di_f_fss_set_quoted_ +#ifndef _di_f_fss_set_quoted_t_ typedef struct { - f_fss_objects objects; - f_fss_contents contents; + f_fss_objects_t objects; + f_fss_contents_t contents; - f_fss_quoteds objects_quoted; - f_fss_quotedss contents_quoted; - } f_fss_set_quoted; + f_fss_quoteds_t objects_quoted; + f_fss_quotedss_t contents_quoted; + } f_fss_set_quoted_t; - #define f_fss_set_quoted_initialize { f_fss_objects_initialize, f_fss_contents_initialize, f_fss_quoteds_initialize, f_fss_quotedss_initialize } + #define f_fss_set_quoted_t_initialize { f_fss_objects_t_initialize, f_fss_contents_t_initialize, f_fss_quoteds_t_initialize, f_fss_quotedss_t_initialize } - #define f_macro_fss_set_quoted_clear(set) \ - f_macro_fss_objects_clear(set.objects) \ - f_macro_fss_contents_clear(set.contents) \ - f_macro_fss_quoteds_clear(set.objects_quoted) \ - f_macro_fss_quotedss_clear(set.contents_quoted) + #define f_macro_fss_set_quoted_t_clear(set) \ + f_macro_fss_objects_t_clear(set.objects) \ + f_macro_fss_contents_t_clear(set.contents) \ + f_macro_fss_quoteds_t_clear(set.objects_quoted) \ + f_macro_fss_quotedss_t_clear(set.contents_quoted) - #define f_macro_fss_set_quoted_new(status, set, length) \ - f_macro_fss_objects_new(status, set.objects, length) \ + #define f_macro_fss_set_quoted_t_new(status, set, length) \ + f_macro_fss_objects_t_new(status, set.objects, length) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_new(status, set.contents, length) \ + f_macro_fss_contents_t_new(status, set.contents, length) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quoteds_new(status, set.objects_quoted, length) \ + f_macro_fss_quoteds_t_new(status, set.objects_quoted, length) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quotedss_new(status, set.contents_quoted, length) \ + f_macro_fss_quotedss_t_new(status, set.contents_quoted, length) \ } - #define f_macro_fss_set_quoted_delete(status, set) \ - f_macro_fss_objects_delete(status, set.objects) \ + #define f_macro_fss_set_quoted_t_delete(status, set) \ + f_macro_fss_objects_t_delete(status, set.objects) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_delete(status, set.contents) \ + f_macro_fss_contents_t_delete(status, set.contents) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quoteds_delete(status, set.objects_quoted) \ + f_macro_fss_quoteds_t_delete(status, set.objects_quoted) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quotedss_delete(status, set.contents_quoted) \ + f_macro_fss_quotedss_t_delete(status, set.contents_quoted) \ } - #define f_macro_fss_set_quoted_destroy(status, set) \ - f_macro_fss_objects_destroy(status, set.objects) \ + #define f_macro_fss_set_quoted_t_destroy(status, set) \ + f_macro_fss_objects_t_destroy(status, set.objects) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_destroy(status, set.contents) \ + f_macro_fss_contents_t_destroy(status, set.contents) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quoteds_destroy(status, set.objects_quoted) \ + f_macro_fss_quoteds_t_destroy(status, set.objects_quoted) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quotedss_destroy(status, set.contents_quoted) \ + f_macro_fss_quotedss_t_destroy(status, set.contents_quoted) \ } - #define f_macro_fss_set_quoted_delete_simple(set) \ - f_macro_fss_objects_delete_simple(set.objects) \ - f_macro_fss_contents_delete_simple(set.contents) \ - f_macro_fss_quoteds_delete_simple(set.objects_quoted) \ - f_macro_fss_quotedss_delete_simple(set.contents_quoted) + #define f_macro_fss_set_quoted_t_delete_simple(set) \ + f_macro_fss_objects_t_delete_simple(set.objects) \ + f_macro_fss_contents_t_delete_simple(set.contents) \ + f_macro_fss_quoteds_t_delete_simple(set.objects_quoted) \ + f_macro_fss_quotedss_t_delete_simple(set.contents_quoted) - #define f_macro_fss_set_quoted_destroy_simple(set) \ - f_macro_fss_objects_destroy_simple(set.objects) \ - f_macro_fss_contents_destroy_simple(set.contents) \ - f_macro_fss_quoteds_destroy_simple(set.objects_quoted) \ - f_macro_fss_quotedss_destroy_simple(set.contents_quoted) + #define f_macro_fss_set_quoted_t_destroy_simple(set) \ + f_macro_fss_objects_t_destroy_simple(set.objects) \ + f_macro_fss_contents_t_destroy_simple(set.contents) \ + f_macro_fss_quoteds_t_destroy_simple(set.objects_quoted) \ + f_macro_fss_quotedss_t_destroy_simple(set.contents_quoted) - #define f_macro_fss_set_quoted_resize(status, set, new_length) \ - f_macro_fss_objects_resize(status, set.objects, new_length) \ + #define f_macro_fss_set_quoted_t_resize(status, set, new_length) \ + f_macro_fss_objects_t_resize(status, set.objects, new_length) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_resize(status, set.contents, new_length) \ + f_macro_fss_contents_t_resize(status, set.contents, new_length) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quoteds_resize(status, set.objects_quoted, new_length) \ + f_macro_fss_quoteds_t_resize(status, set.objects_quoted, new_length) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quotedss_resize(status, set.contents_quoted, new_length) \ + f_macro_fss_quotedss_t_resize(status, set.contents_quoted, new_length) \ } - #define f_macro_fss_set_quoted_adjust(status, set, new_length) \ - f_macro_fss_objects_resize(status, set.objects, new_length) \ + #define f_macro_fss_set_quoted_t_adjust(status, set, new_length) \ + f_macro_fss_objects_t_resize(status, set.objects, new_length) \ if (F_status_is_fine(status)) { \ - f_macro_fss_contents_resize(status, set.contents, new_length) \ + f_macro_fss_contents_t_resize(status, set.contents, new_length) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quoteds_resize(status, set.objects_quoted, new_length) \ + f_macro_fss_quoteds_t_resize(status, set.objects_quoted, new_length) \ } \ if (F_status_is_fine(status)) { \ - f_macro_fss_quotedss_resize(status, set.contents_quoted, new_length) \ + f_macro_fss_quotedss_t_resize(status, set.contents_quoted, new_length) \ } -#endif // _di_f_fss_set_quoted_ +#endif // _di_f_fss_set_quoted_t_ /** - * This holds an array of f_fss_set_quoted. + * This holds an array of f_fss_set_quoted_t. * - * array: an array of f_fss_set_quoted. + * array: an array of f_fss_set_quoted_t. * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_fss_set_quoteds_ +#ifndef _di_fss_set_quoteds_t_ typedef struct { - f_fss_set *array; + f_fss_set_t *array; - f_array_length size; - f_array_length used; - } f_fss_set_quoteds; + f_array_length_t size; + f_array_length_t used; + } f_fss_set_quoteds_t; - #define f_fss_set_quoteds_initialize { 0, 0, 0 } + #define f_fss_set_quoteds_t_initialize { 0, 0, 0 } /** * Reset a fss content sets to 0 (clear all values). * * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * - * sets: the f_fss_set_quoteds structure to operate on. + * sets: the f_fss_set_quoteds_t structure to operate on. */ - #define f_macro_fss_set_quoteds_clear(sets) \ + #define f_macro_fss_set_quoteds_t_clear(sets) \ sets.array = 0; \ sets.size = 0; \ sets.used = 0; @@ -381,14 +381,14 @@ extern "C" { * This does not deallocate memory, be certain that memory is not allocated before calling this to avoid potential memory leaks. * * status: the status to return. - * sets: the f_fss_set_quoteds structure to operate on. + * sets: the f_fss_set_quoteds_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_set_quoteds_new(status, sets, length) \ + #define f_macro_fss_set_quoteds_t_new(status, sets, length) \ sets.array = 0; \ sets.size = 0; \ sets.used = 0; \ - status = f_memory_new((void **) & sets.array, sizeof(f_fss_set_quoted), length); \ + status = f_memory_new((void **) & sets.array, sizeof(f_fss_set_quoted_t), length); \ if (status == F_none) { \ sets.size = length; \ sets.used = 0; \ @@ -398,48 +398,48 @@ extern "C" { * Delete a fss content sets. * * status: the status to return. - * sets: the f_fss_set_quoteds structure to operate on. + * sets: the f_fss_set_quoteds_t structure to operate on. */ - #define f_macro_fss_set_quoteds_delete(status, sets) \ + #define f_macro_fss_set_quoteds_t_delete(status, sets) \ status = F_none; \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_set_quoted_delete(status, sets.array[sets.used]); \ + f_macro_fss_set_quoted_t_delete(status, sets.array[sets.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & sets.array, sizeof(f_fss_set_quoted), sets.size); \ + if (status == F_none) status = f_memory_delete((void **) & sets.array, sizeof(f_fss_set_quoted_t), sets.size); \ if (status == F_none) sets.size = 0; /** * Destroy a fss content sets. * * status: the status to return. - * sets: the f_fss_set_quoteds structure to operate on. + * sets: the f_fss_set_quoteds_t structure to operate on. */ - #define f_macro_fss_set_quoteds_destroy(status, sets) \ + #define f_macro_fss_set_quoteds_t_destroy(status, sets) \ status = F_none; \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_set_quoted_destroy(status, sets.array[sets.used]); \ + f_macro_fss_set_quoted_t_destroy(status, sets.array[sets.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_destroy((void **) & sets.array, sizeof(f_fss_set_quoted), sets.size); \ + if (status == F_none) status = f_memory_destroy((void **) & sets.array, sizeof(f_fss_set_quoted_t), sets.size); \ if (status == F_none) sets.size = 0; /** * Delete a fss content sets. * - * sets: the f_fss_set_quoteds structure to operate on. + * sets: the f_fss_set_quoteds_t structure to operate on. */ - #define f_macro_fss_set_quoteds_delete_simple(sets) \ + #define f_macro_fss_set_quoteds_t_delete_simple(sets) \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_set_quoted_delete_simple(sets.array[sets.used]); \ + f_macro_fss_set_quoted_t_delete_simple(sets.array[sets.used]); \ if (sets.used == 0) { \ - if (f_memory_delete((void **) & sets.array, sizeof(f_fss_set_quoted), sets.size)) { \ + if (f_memory_delete((void **) & sets.array, sizeof(f_fss_set_quoted_t), sets.size)) { \ sets.size = 0; \ } \ } \ @@ -448,15 +448,15 @@ extern "C" { /** * Destroy a fss content sets. * - * sets: the f_fss_set_quoteds structure to operate on. + * sets: the f_fss_set_quoteds_t structure to operate on. */ - #define f_macro_fss_set_quoteds_destroy_simple(sets) \ + #define f_macro_fss_set_quoteds_t_destroy_simple(sets) \ sets.used = sets.size; \ while (sets.used > 0) { \ sets.used--; \ - f_macro_fss_set_quoted_destroy_simple(sets.array[sets.used]); \ + f_macro_fss_set_quoted_t_destroy_simple(sets.array[sets.used]); \ if (sets.used == 0) { \ - if (f_memory_destroy((void **) & sets.array, sizeof(f_fss_set_quoted), sets.size)) { \ + if (f_memory_destroy((void **) & sets.array, sizeof(f_fss_set_quoted_t), sets.size)) { \ sets.size = 0; \ } \ } \ @@ -466,22 +466,22 @@ extern "C" { * Resize a fss content sets. * * status: the status to return. - * sets: the f_fss_set_quoteds structure to operate on. + * sets: the f_fss_set_quoteds_t structure to operate on. * new_length: the new size of the array. */ - #define f_macro_fss_set_quoteds_resize(status, sets, new_length) \ + #define f_macro_fss_set_quoteds_t_resize(status, sets, new_length) \ status = F_none; \ if (new_length < sets.size) { \ - for (f_array_length _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ - f_macro_fss_set_quoted_delete(status, sets.array[_macro__i]); \ + for (f_array_length_t _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ + f_macro_fss_set_quoted_t_delete(status, sets.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & sets.array, sizeof(f_fss_set_quoted), sets.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & sets.array, sizeof(f_fss_set_quoted_t), sets.size, new_length); \ if (status == F_none) { \ if (new_length > sets.size) { \ - for (f_array_length _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_set_quoted)); \ + for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ + memset(&sets.array[_macro__i], 0, sizeof(f_fss_set_quoted_t)); \ } \ } \ sets.size = new_length; \ @@ -492,28 +492,28 @@ extern "C" { * Adjust a fss content sets. * * status: the status to return. - * sets: the f_fss_set_quoteds structure to operate on. + * sets: the f_fss_set_quoteds_t structure to operate on. * new_length: he new size of the array. */ - #define f_macro_fss_set_quoteds_adjust(status, sets, new_length) \ + #define f_macro_fss_set_quoteds_t_adjust(status, sets, new_length) \ status = F_none; \ if (new_length < sets.size) { \ - for (f_array_length _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ - f_macro_fss_set_quoted_destroy(status, sets.array[_macro__i]); \ + for (f_array_length_t _macro__i = sets.size - new_length; _macro__i < sets.size; _macro__i++) { \ + f_macro_fss_set_quoted_t_destroy(status, sets.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & sets.array, sizeof(f_fss_set_quoted), sets.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & sets.array, sizeof(f_fss_set_quoted_t), sets.size, new_length); \ if (status == F_none) { \ if (new_length > sets.size) { \ - for (f_array_length _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ - memset(&sets.array[_macro__i], 0, sizeof(f_fss_set_quoted)); \ + for (f_array_length_t _macro__i = sets.size; _macro__i < new_length; _macro__i++) { \ + memset(&sets.array[_macro__i], 0, sizeof(f_fss_set_quoted_t)); \ } \ } \ sets.size = new_length; \ if (sets.used > sets.size) sets.used = new_length; \ } -#endif // _di_fss_set_quoteds_ +#endif // _di_fss_set_quoteds_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_fss/c/fss.c b/level_0/f_fss/c/fss.c index 266693d..58f1dde 100644 --- a/level_0/f_fss/c/fss.c +++ b/level_0/f_fss/c/fss.c @@ -5,14 +5,14 @@ extern "C" { #endif #ifndef _di_f_fss_count_lines_ - f_return_status f_fss_count_lines(const f_string_static buffer, const f_string_length before, f_string_length *line) { + f_return_status f_fss_count_lines(const f_string_static_t buffer, const f_string_length_t before, f_string_length_t *line) { #ifndef _di_level_0_parameter_checking_ if (buffer.used == 0) return F_status_set_error(F_parameter); if (before >= buffer.used) return F_status_set_error(F_parameter); if (line == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_string_length i = before; + f_string_length_t i = before; for (; i > 0; i--) { if (buffer.string[i] == f_string_eol[0]) { @@ -29,7 +29,7 @@ extern "C" { #endif // _di_f_fss_count_lines_ #ifndef _di_f_fss_count_lines_range_ - f_return_status f_fss_count_lines_range(const f_string_static buffer, const f_string_range range, const f_string_length before, f_string_length *line) { + f_return_status f_fss_count_lines_range(const f_string_static_t buffer, const f_string_range_t range, const f_string_length_t before, f_string_length_t *line) { #ifndef _di_level_0_parameter_checking_ if (buffer.used == 0) return F_status_set_error(F_parameter); if (range.start > range.stop) return F_status_set_error(F_parameter); @@ -39,7 +39,7 @@ extern "C" { if (line == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_string_length i = before; + f_string_length_t i = before; for (; i > range.start; i--) { if (buffer.string[i] == f_string_eol[0]) { @@ -56,7 +56,7 @@ extern "C" { #endif // _di_f_fss_count_lines_range_ #ifndef _di_f_fss_is_graph_ - f_return_status f_fss_is_graph(const f_string_static buffer, const f_string_range range) { + f_return_status f_fss_is_graph(const f_string_static_t buffer, const f_string_range_t range) { #ifndef _di_level_0_parameter_checking_ if (buffer.used == 0) return F_status_set_error(F_parameter); if (range.start < 0) return F_status_set_error(F_parameter); @@ -64,7 +64,7 @@ extern "C" { if (range.start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_string_length width_max = (range.stop - range.start) + 1; + f_string_length_t width_max = (range.stop - range.start) + 1; if (width_max > buffer.used - range.start) { width_max = buffer.used - range.start; @@ -75,7 +75,7 @@ extern "C" { #endif // _di_f_fss_is_graph_ #ifndef _di_f_fss_is_space_ - f_return_status f_fss_is_space(const f_string_static buffer, const f_string_range range) { + f_return_status f_fss_is_space(const f_string_static_t buffer, const f_string_range_t range) { #ifndef _di_level_0_parameter_checking_ if (buffer.used == 0) return F_status_set_error(F_parameter); if (range.start < 0) return F_status_set_error(F_parameter); @@ -83,9 +83,9 @@ extern "C" { if (range.start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; - f_string_length width_max = (range.stop - range.start) + 1; + f_string_length_t width_max = (range.stop - range.start) + 1; if (width_max > buffer.used - range.start) { width_max = buffer.used - range.start; @@ -112,7 +112,7 @@ extern "C" { #endif // _di_f_fss_is_space_ #ifndef _di_f_fss_is_zero_width_ - f_return_status f_fss_is_zero_width(const f_string_static buffer, const f_string_range range) { + f_return_status f_fss_is_zero_width(const f_string_static_t buffer, const f_string_range_t range) { #ifndef _di_level_0_parameter_checking_ if (buffer.used == 0) return F_status_set_error(F_parameter); if (range.start < 0) return F_status_set_error(F_parameter); @@ -120,7 +120,7 @@ extern "C" { if (range.start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_string_length width_max = (range.stop - range.start) + 1; + f_string_length_t width_max = (range.stop - range.start) + 1; if (width_max > buffer.used - range.start) { width_max = buffer.used - range.start; @@ -131,7 +131,7 @@ extern "C" { #endif // _di_f_fss_is_zero_width_ #ifndef _di_f_fss_shift_delimiters_ - f_return_status f_fss_shift_delimiters(f_string_dynamic *buffer, const f_string_range range) { + f_return_status f_fss_shift_delimiters(f_string_dynamic_t *buffer, const f_string_range_t range) { #ifndef _di_level_0_parameter_checking_ if (buffer->used == 0) return F_status_set_error(F_parameter); if (range.start < 0) return F_status_set_error(F_parameter); @@ -139,8 +139,8 @@ extern "C" { if (range.start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_string_length position = 0; - f_string_length distance = 0; + f_string_length_t position = 0; + f_string_length_t distance = 0; unsigned short utf_width = 0; unsigned short i = 0; @@ -194,7 +194,7 @@ extern "C" { #endif // _di_f_fss_shift_delimiters_ #ifndef _di_f_fss_skip_past_space_ - f_return_status f_fss_skip_past_space(const f_string_static buffer, f_string_range *range) { + f_return_status f_fss_skip_past_space(const f_string_static_t buffer, f_string_range_t *range) { #ifndef _di_level_0_parameter_checking_ if (buffer.used == 0) return F_status_set_error(F_parameter); if (range == 0) return F_status_set_error(F_parameter); @@ -202,10 +202,10 @@ extern "C" { if (range->start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; uint8_t width = 0; - f_string_length width_max = (range->stop - range->start) + 1; + f_string_length_t width_max = (range->stop - range->start) + 1; if (width_max > buffer.used - range->start) { width_max = buffer.used - range->start; @@ -268,7 +268,7 @@ extern "C" { #endif // _di_f_fss_skip_past_space_ #ifndef _di_f_fss_skip_past_non_graph_ - f_return_status f_fss_skip_past_non_graph(const f_string_static buffer, f_string_range *range) { + f_return_status f_fss_skip_past_non_graph(const f_string_static_t buffer, f_string_range_t *range) { #ifndef _di_level_0_parameter_checking_ if (buffer.used == 0) return F_status_set_error(F_parameter); if (range == 0) return F_status_set_error(F_parameter); @@ -276,10 +276,10 @@ extern "C" { if (range->start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; unsigned short width = 0; - f_string_length width_max = (range->stop - range->start) + 1; + f_string_length_t width_max = (range->stop - range->start) + 1; if (width_max > buffer.used - range->start) { width_max = buffer.used - range->start; @@ -297,9 +297,9 @@ extern "C" { status = f_utf_is_zero_width(buffer.string + range->start, width_max); if (status == F_true) { - f_string_length next_width_max = 0; + f_string_length_t next_width_max = 0; - for (f_string_length next = range->start + 1; next < buffer.used && next <= range->stop; next += f_macro_utf_byte_width_is(buffer.string[next])) { + for (f_string_length_t next = range->start + 1; next < buffer.used && next <= range->stop; next += f_macro_utf_byte_width_is(buffer.string[next])) { next_width_max = (range->stop - next) + 1; status = f_utf_is_graph(buffer.string + next, width_max); diff --git a/level_0/f_fss/c/fss.h b/level_0/f_fss/c/fss.h index a321930..bb08930 100644 --- a/level_0/f_fss/c/fss.h +++ b/level_0/f_fss/c/fss.h @@ -53,7 +53,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_fss_count_lines_ - extern f_return_status f_fss_count_lines(const f_string_static buffer, const f_string_length before, f_string_length *line); + extern f_return_status f_fss_count_lines(const f_string_static_t buffer, const f_string_length_t before, f_string_length_t *line); #endif // _di_f_fss_count_lines_ /** @@ -77,7 +77,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_fss_count_lines_range_ - extern f_return_status f_fss_count_lines_range(const f_string_static buffer, const f_string_range range, const f_string_length before, f_string_length *line); + extern f_return_status f_fss_count_lines_range(const f_string_static_t buffer, const f_string_range_t range, const f_string_length_t before, f_string_length_t *line); #endif // _di_f_fss_count_lines_range_ /** @@ -100,7 +100,7 @@ extern "C" { * @see f_utf_is_graph() */ #ifndef _di_f_fss_is_graph_ - extern f_return_status f_fss_is_graph(const f_string_static buffer, const f_string_range range); + extern f_return_status f_fss_is_graph(const f_string_static_t buffer, const f_string_range_t range); #endif // _di_f_fss_is_graph_ /** @@ -125,7 +125,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #ifndef _di_f_fss_is_space_ - extern f_return_status f_fss_is_space(const f_string_static buffer, const f_string_range range); + extern f_return_status f_fss_is_space(const f_string_static_t buffer, const f_string_range_t range); #endif // _di_f_fss_is_space_ /** @@ -149,7 +149,7 @@ extern "C" { * @see f_utf_is_zero_width() */ #ifndef _di_f_fss_is_zero_width_ - extern f_return_status f_fss_is_zero_width(const f_string_static buffer, const f_string_range range); + extern f_return_status f_fss_is_zero_width(const f_string_static_t buffer, const f_string_range_t range); #endif // _di_f_fss_is_zero_width_ /** @@ -170,7 +170,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_fss_shift_delimiters_ - extern f_return_status f_fss_shift_delimiters(f_string_dynamic *buffer, const f_string_range range); + extern f_return_status f_fss_shift_delimiters(f_string_dynamic_t *buffer, const f_string_range_t range); #endif // _di_f_fss_shift_delimiters_ /** @@ -204,7 +204,7 @@ extern "C" { * @see f_utf_is_zero_width() */ #ifndef _di_f_fss_skip_past_space_ - extern f_return_status f_fss_skip_past_space(const f_string_static buffer, f_string_range *range); + extern f_return_status f_fss_skip_past_space(const f_string_static_t buffer, f_string_range_t *range); #endif // _di_f_fss_skip_past_space_ /** @@ -236,7 +236,7 @@ extern "C" { * @see f_utf_is_zero_width() */ #ifndef _di_f_fss_skip_past_non_graph_ - extern f_return_status f_fss_skip_past_non_graph(const f_string_static buffer, f_string_range *range); + extern f_return_status f_fss_skip_past_non_graph(const f_string_static_t buffer, f_string_range_t *range); #endif // _di_f_fss_skip_past_non_graph_ #ifdef __cplusplus diff --git a/level_0/f_iki/c/iki-common.h b/level_0/f_iki/c/iki-common.h index 10d3f2d..14e14b3 100644 --- a/level_0/f_iki/c/iki-common.h +++ b/level_0/f_iki/c/iki-common.h @@ -68,24 +68,24 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_iki_variable_ - typedef f_string_ranges f_iki_variable; +#ifndef _di_iki_variable_t_ + typedef f_string_ranges_t f_iki_variable_t; - #define f_iki_variable_initialize f_string_ranges_initialize + #define f_iki_variable_t_initialize f_string_ranges_t_initialize - #define f_macro_iki_variable_clear(variable) f_macro_string_ranges_clear(variable) + #define f_macro_iki_variable_t_clear(variable) f_macro_string_ranges_t_clear(variable) - #define f_macro_iki_variable_new(status, variable, length) f_macro_string_ranges_new(status, variable, length) + #define f_macro_iki_variable_t_new(status, variable, length) f_macro_string_ranges_t_new(status, variable, length) - #define f_macro_iki_variable_delete(status, variable) f_macro_string_ranges_delete(status, variable) - #define f_macro_iki_variable_destroy(status, variable) f_macro_string_ranges_destroy(status, variable) + #define f_macro_iki_variable_t_delete(status, variable) f_macro_string_ranges_t_delete(status, variable) + #define f_macro_iki_variable_t_destroy(status, variable) f_macro_string_ranges_t_destroy(status, variable) - #define f_macro_iki_variable_delete_simple(variable) f_macro_string_ranges_delete_simple(variable) - #define f_macro_iki_variable_destroy_simple(variable) f_macro_string_ranges_destroy_simple(variable) + #define f_macro_iki_variable_t_delete_simple(variable) f_macro_string_ranges_t_delete_simple(variable) + #define f_macro_iki_variable_t_destroy_simple(variable) f_macro_string_ranges_t_destroy_simple(variable) - #define f_macro_iki_variable_resize(status, variable, new_length) f_macro_string_ranges_resize(status, variable, new_length) - #define f_macro_iki_variable_adjust(status, variable, new_length) f_macro_string_ranges_destroy(status, variable, new_length) -#endif // _di_iki_variable_ + #define f_macro_iki_variable_t_resize(status, variable, new_length) f_macro_string_ranges_t_resize(status, variable, new_length) + #define f_macro_iki_variable_t_adjust(status, variable, new_length) f_macro_string_ranges_t_destroy(status, variable, new_length) +#endif // _di_iki_variable_t_ /** * This holds an array of string ranges that represent the vocabulary names. @@ -94,50 +94,50 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_iki_vocabulary_ - typedef f_string_ranges f_iki_vocabulary; +#ifndef _di_iki_vocabulary_t_ + typedef f_string_ranges_t f_iki_vocabulary_t; - #define f_iki_vocabulary_initialize f_string_ranges_initialize + #define f_iki_vocabulary_t_initialize f_string_ranges_t_initialize - #define f_macro_iki_vocabulary_clear(vocabulary) f_macro_string_ranges_clear(vocabulary) + #define f_macro_iki_vocabulary_t_clear(vocabulary) f_macro_string_ranges_t_clear(vocabulary) - #define f_macro_iki_vocabulary_new(status, vocabulary, length) f_macro_string_ranges_new(status, vocabulary, length) + #define f_macro_iki_vocabulary_t_new(status, vocabulary, length) f_macro_string_ranges_t_new(status, vocabulary, length) - #define f_macro_iki_vocabulary_delete(status, vocabulary) f_macro_string_ranges_delete(status, vocabulary) - #define f_macro_iki_vocabulary_destroy(status, vocabulary) f_macro_string_ranges_destroy(status, vocabulary) + #define f_macro_iki_vocabulary_t_delete(status, vocabulary) f_macro_string_ranges_t_delete(status, vocabulary) + #define f_macro_iki_vocabulary_t_destroy(status, vocabulary) f_macro_string_ranges_t_destroy(status, vocabulary) - #define f_macro_iki_vocabulary_delete_simple(vocabulary) f_macro_string_ranges_delete_simple(vocabulary) - #define f_macro_iki_vocabulary_destroy_simple(vocabulary) f_macro_string_ranges_destroy_simple(vocabulary) + #define f_macro_iki_vocabulary_t_delete_simple(vocabulary) f_macro_string_ranges_t_delete_simple(vocabulary) + #define f_macro_iki_vocabulary_t_destroy_simple(vocabulary) f_macro_string_ranges_t_destroy_simple(vocabulary) - #define f_macro_iki_vocabulary_resize(status, vocabulary, new_length) f_macro_string_ranges_resize(status, vocabulary, new_length) - #define f_macro_iki_vocabulary_adjust(status, vocabulary, new_length) f_macro_string_ranges_destroy(status, vocabulary, new_length) -#endif // _di_iki_vocabulary_ + #define f_macro_iki_vocabulary_t_resize(status, vocabulary, new_length) f_macro_string_ranges_t_resize(status, vocabulary, new_length) + #define f_macro_iki_vocabulary_t_adjust(status, vocabulary, new_length) f_macro_string_ranges_t_destroy(status, vocabulary, new_length) +#endif // _di_iki_vocabulary_t_ /** - * This holds an array of f_iki_vocabulary. + * This holds an array of f_iki_vocabulary_t. * * array: The array of content. * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_iki_vocabularys_ - typedef f_string_rangess f_iki_vocabularys; +#ifndef _di_iki_vocabularys_t_ + typedef f_string_rangess_t f_iki_vocabularys_t; - #define f_iki_vocabularys_initialize f_string_rangess_initialize + #define f_iki_vocabularys_t_initialize f_string_rangess_t_initialize - #define f_macro_iki_vocabularys_clear(content) f_macro_string_rangess_clear(content) + #define f_macro_iki_vocabularys_t_clear(content) f_macro_string_rangess_t_clear(content) - #define f_macro_iki_vocabularys_new(status, content, length) f_macro_string_rangess_new(status, content, length) + #define f_macro_iki_vocabularys_t_new(status, content, length) f_macro_string_rangess_t_new(status, content, length) - #define f_macro_iki_vocabularys_delete(status, content) f_macro_string_rangess_delete(status, content) - #define f_macro_iki_vocabularys_destroy(status, content) f_macro_string_rangess_destroy(status, content) + #define f_macro_iki_vocabularys_t_delete(status, content) f_macro_string_rangess_t_delete(status, content) + #define f_macro_iki_vocabularys_t_destroy(status, content) f_macro_string_rangess_t_destroy(status, content) - #define f_macro_iki_vocabularys_delete_simple(content) f_macro_string_rangess_delete_simple(content) - #define f_macro_iki_vocabularys_destroy_simple(content) f_macro_string_rangess_destroy_simple(content) + #define f_macro_iki_vocabularys_t_delete_simple(content) f_macro_string_rangess_t_delete_simple(content) + #define f_macro_iki_vocabularys_t_destroy_simple(content) f_macro_string_rangess_t_destroy_simple(content) - #define f_macro_iki_vocabularys_resize(status, content, new_length) f_macro_string_rangess_resize(status, content, new_length) - #define f_macro_iki_vocabularys_adjust(status, content, new_length) f_macro_string_rangess_adjust(status, content, new_length) -#endif // _di_iki_vocabularys_ + #define f_macro_iki_vocabularys_t_resize(status, content, new_length) f_macro_string_rangess_t_resize(status, content, new_length) + #define f_macro_iki_vocabularys_t_adjust(status, content, new_length) f_macro_string_rangess_t_adjust(status, content, new_length) +#endif // _di_iki_vocabularys_t_ /** * This holds an array of string ranges that represent the content. @@ -148,50 +148,50 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_iki_content_ - typedef f_string_ranges f_iki_content; +#ifndef _di_iki_content_t_ + typedef f_string_ranges_t f_iki_content_t; - #define f_iki_content_initialize f_string_ranges_initialize + #define f_iki_content_t_initialize f_string_ranges_t_initialize - #define f_macro_iki_content_clear(content) f_macro_string_ranges_clear(content) + #define f_macro_iki_content_t_clear(content) f_macro_string_ranges_t_clear(content) - #define f_macro_iki_content_new(status, content, length) f_macro_string_ranges_new(status, content, length) + #define f_macro_iki_content_t_new(status, content, length) f_macro_string_ranges_t_new(status, content, length) - #define f_macro_iki_content_delete(status, content) f_macro_string_ranges_delete(status, content) - #define f_macro_iki_content_destroy(status, content) f_macro_string_ranges_destroy(status, content) + #define f_macro_iki_content_t_delete(status, content) f_macro_string_ranges_t_delete(status, content) + #define f_macro_iki_content_t_destroy(status, content) f_macro_string_ranges_t_destroy(status, content) - #define f_macro_iki_content_delete_simple(content) f_macro_string_ranges_delete_simple(content) - #define f_macro_iki_content_destroy_simple(content) f_macro_string_ranges_destroy_simple(content) + #define f_macro_iki_content_t_delete_simple(content) f_macro_string_ranges_t_delete_simple(content) + #define f_macro_iki_content_t_destroy_simple(content) f_macro_string_ranges_t_destroy_simple(content) - #define f_macro_iki_content_resize(status, content, new_length) f_macro_string_ranges_resize(status, content, new_length) - #define f_macro_iki_content_adjust(status, content, new_length) f_macro_string_ranges_adjust(status, content, new_length) -#endif // _di_iki_content_ + #define f_macro_iki_content_t_resize(status, content, new_length) f_macro_string_ranges_t_resize(status, content, new_length) + #define f_macro_iki_content_t_adjust(status, content, new_length) f_macro_string_ranges_t_adjust(status, content, new_length) +#endif // _di_iki_content_t_ /** - * This holds an array of f_iki_content. + * This holds an array of f_iki_content_t. * * array: The array of content. * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_iki_contents_ - typedef f_string_rangess f_iki_contents; +#ifndef _di_iki_contents_t_ + typedef f_string_rangess_t f_iki_contents_t; - #define f_iki_contents_initialize f_string_rangess_initialize + #define f_iki_contents_t_initialize f_string_rangess_t_initialize - #define f_macro_iki_contents_clear(content) f_macro_string_rangess_clear(content) + #define f_macro_iki_contents_t_clear(content) f_macro_string_rangess_t_clear(content) - #define f_macro_iki_contents_new(status, content, length) f_macro_string_rangess_new(status, content, length) + #define f_macro_iki_contents_t_new(status, content, length) f_macro_string_rangess_t_new(status, content, length) - #define f_macro_iki_contents_delete(status, content) f_macro_string_rangess_delete(status, content) - #define f_macro_iki_contents_destroy(status, content) f_macro_string_rangess_destroy(status, content) + #define f_macro_iki_contents_t_delete(status, content) f_macro_string_rangess_t_delete(status, content) + #define f_macro_iki_contents_t_destroy(status, content) f_macro_string_rangess_t_destroy(status, content) - #define f_macro_iki_contents_delete_simple(content) f_macro_string_rangess_delete_simple(content) - #define f_macro_iki_contents_destroy_simple(content) f_macro_string_rangess_destroy_simple(content) + #define f_macro_iki_contents_t_delete_simple(content) f_macro_string_rangess_t_delete_simple(content) + #define f_macro_iki_contents_t_destroy_simple(content) f_macro_string_rangess_t_destroy_simple(content) - #define f_macro_iki_contents_resize(status, content, new_length) f_macro_string_rangess_resize(status, content, new_length) - #define f_macro_iki_contents_adjust(status, content, new_length) f_macro_string_rangess_adjust(status, content, new_length) -#endif // _di_iki_contents_ + #define f_macro_iki_contents_t_resize(status, content, new_length) f_macro_string_rangess_t_resize(status, content, new_length) + #define f_macro_iki_contents_t_adjust(status, content, new_length) f_macro_string_rangess_t_adjust(status, content, new_length) +#endif // _di_iki_contents_t_ /** * Provide a default allocation step. @@ -212,16 +212,16 @@ extern "C" { #define f_macro_iki_allocate_delimits_if_necessary(status, delimits) \ status = F_none; \ if (delimits.used == delimits.size) { \ - if (delimits.used + f_iki_default_allocation_step > f_string_length_size) { \ - if (delimits.used == f_string_length_size) { \ + if (delimits.used + f_iki_default_allocation_step > f_string_length_t_size) { \ + if (delimits.used == f_string_length_t_size) { \ status = F_status_set_error(F_string_too_large); \ } \ else { \ - f_macro_string_lengths_resize(status, delimits, delimits.size + 1); \ + f_macro_string_lengths_t_resize(status, delimits, delimits.size + 1); \ } \ } \ else { \ - f_macro_string_lengths_resize(status, delimits, delimits.size + f_iki_default_allocation_step); \ + f_macro_string_lengths_t_resize(status, delimits, delimits.size + f_iki_default_allocation_step); \ } \ } #endif // _di_f_macro_iki_allocate_delimits_if_necessary_ @@ -236,16 +236,16 @@ extern "C" { #define f_macro_iki_allocate_ranges_if_necessary(status, ranges) \ status = F_none; \ if (ranges.used == ranges.size) { \ - if (ranges.used + f_iki_default_allocation_step > f_string_length_size) { \ - if (ranges.used == f_string_length_size) { \ + if (ranges.used + f_iki_default_allocation_step > f_string_length_t_size) { \ + if (ranges.used == f_string_length_t_size) { \ status = F_status_set_error(F_string_too_large); \ } \ else { \ - f_macro_string_ranges_resize(status, ranges, ranges.size + 1); \ + f_macro_string_ranges_t_resize(status, ranges, ranges.size + 1); \ } \ } \ else { \ - f_macro_string_ranges_resize(status, ranges, ranges.size + f_iki_default_allocation_step); \ + f_macro_string_ranges_t_resize(status, ranges, ranges.size + f_iki_default_allocation_step); \ } \ } #endif // _di_f_macro_iki_allocate_ranges_if_necessary_ diff --git a/level_0/f_iki/c/iki.c b/level_0/f_iki/c/iki.c index a92b365..40911f0 100644 --- a/level_0/f_iki/c/iki.c +++ b/level_0/f_iki/c/iki.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_f_iki_read_ - f_return_status f_iki_read(f_string_static *buffer, f_string_range *range, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content) { + f_return_status f_iki_read(f_string_static_t *buffer, f_string_range_t *range, f_iki_variable_t *variable, f_iki_vocabulary_t *vocabulary, f_iki_content_t *content) { #ifndef _di_level_0_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (buffer->used == 0) return F_status_set_error(F_parameter); @@ -17,9 +17,9 @@ extern "C" { if (range->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; - f_string_length width_max = 0; + f_string_length_t width_max = 0; if (width_max > buffer->used - range->start) { width_max = buffer->used - range->start; @@ -38,12 +38,12 @@ extern "C" { return F_data_not_eos; } - f_string_range found_vocabulary = f_string_range_initialize; - f_string_length found_content = 0; + f_string_range_t found_vocabulary = f_string_range_initialize; + f_string_length_t found_content = 0; found_vocabulary.start = range->start; - f_string_length vocabulary_slash_first = range->start; + f_string_length_t vocabulary_slash_first = range->start; uint8_t quote = 0; @@ -51,7 +51,7 @@ extern "C" { bool find_next = F_false; // delimits must only be applied once a valid object is found. - f_string_lengths delimits = f_string_lengths_initialize; + f_string_lengths_t delimits = f_string_lengths_t_initialize; do { // find the start and end of the vocabulary name. @@ -65,7 +65,7 @@ extern "C" { if (range->start == found_vocabulary.start) { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } @@ -80,7 +80,7 @@ extern "C" { } while (F_status_is_fine(status) && buffer->string[range->start] == f_iki_syntax_placeholder); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } @@ -94,7 +94,7 @@ extern "C" { // this is not a valid vocabulary name so seek until a non-word, non-dash, or non-plus character. f_macro_iki_seek_word_dash_plus(status, buffer, range, width_max, F_false); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } @@ -136,7 +136,7 @@ extern "C" { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } } // while @@ -148,7 +148,7 @@ extern "C" { status = f_utf_is_word_dash_plus(buffer->string + range->start, width_max, F_false); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } @@ -157,15 +157,15 @@ extern "C" { f_macro_iki_seek_word_dash_plus(status, buffer, range, width_max, F_true); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } else if (range->start > range->stop) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return F_data_not_stop; } else if (range->start >= buffer->used) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return F_data_not_eos; } @@ -175,7 +175,7 @@ extern "C" { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } } // while @@ -196,7 +196,7 @@ extern "C" { if (vocabulary_delimited) { f_macro_iki_allocate_delimits_if_necessary(status, delimits); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } @@ -222,7 +222,7 @@ extern "C" { } if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } @@ -238,11 +238,11 @@ extern "C" { content->array[content->used].stop = range->start - 1; content->used++; - for (f_array_length i = 0; i < delimits.used; i++) { + for (f_array_length_t i = 0; i < delimits.used; i++) { buffer->string[delimits.array[i]] = f_iki_syntax_placeholder; } // for - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); if (F_status_is_error(status)) return status; range->start++; @@ -259,8 +259,8 @@ extern "C" { } } else if (buffer->string[range->start] == f_iki_syntax_slash) { - f_string_length content_slash_first = range->start; - f_array_length content_slash_total = 0; + f_string_length_t content_slash_first = range->start; + f_array_length_t content_slash_total = 0; while (range->start <= range->stop && range->start < buffer->used) { if (buffer->string[range->start] == f_iki_syntax_placeholder) { @@ -269,24 +269,24 @@ extern "C" { } if (buffer->string[range->start] == quote) { - f_array_length content_slash_delimits = content_slash_total / 2; - f_string_range content_range = f_string_range_initialize; - f_array_length i = 0; + f_array_length_t content_slash_delimits = content_slash_total / 2; + f_string_range_t content_range = f_string_range_initialize; + f_array_length_t i = 0; if (content_slash_total % 2) { content_slash_delimits++; } if (delimits.used + content_slash_delimits > delimits.size) { - if (delimits.used + content_slash_delimits > f_string_length_size) { + if (delimits.used + content_slash_delimits > f_string_length_t_size) { status = F_status_set_error(F_string_too_large); } else { - f_macro_string_lengths_resize(status, delimits, delimits.used + content_slash_delimits); + f_macro_string_lengths_t_resize(status, delimits, delimits.used + content_slash_delimits); } if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } } @@ -304,7 +304,7 @@ extern "C" { status = f_utf_buffer_increment(*buffer, (&content_range), 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } } // while @@ -316,7 +316,7 @@ extern "C" { if (vocabulary_delimited) { f_macro_iki_allocate_delimits_if_necessary(status, delimits); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } @@ -345,7 +345,7 @@ extern "C" { } if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } @@ -361,11 +361,11 @@ extern "C" { content->array[content->used].stop = range->start - 1; content->used++; - for (f_array_length i = 0; i < delimits.used; i++) { + for (f_array_length_t i = 0; i < delimits.used; i++) { buffer->string[delimits.array[i]] = f_iki_syntax_placeholder; } // for - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); if (F_status_is_error(status)) return status; range->start++; @@ -392,7 +392,7 @@ extern "C" { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } } // while @@ -400,7 +400,7 @@ extern "C" { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); return status; } } // while @@ -418,11 +418,11 @@ extern "C" { } } while (range->start <= range->stop && range->start < buffer->used); - for (f_array_length i = 0; i < delimits.used; i++) { + for (f_array_length_t i = 0; i < delimits.used; i++) { buffer->string[delimits.array[i]] = f_iki_syntax_placeholder; } // for - f_macro_string_lengths_delete(status, delimits); + f_macro_string_lengths_t_delete(status, delimits); if (F_status_is_error(status)) return status; if (range->start > range->stop) { diff --git a/level_0/f_iki/c/iki.h b/level_0/f_iki/c/iki.h index 0fb55d9..503277c 100644 --- a/level_0/f_iki/c/iki.h +++ b/level_0/f_iki/c/iki.h @@ -67,7 +67,7 @@ extern "C" { * F_string_too_large (with error bit) if a string length is too large to store in the buffer. */ #ifndef _di_f_iki_read_ - extern f_return_status f_iki_read(f_string_static *buffer, f_string_range *range, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content); + extern f_return_status f_iki_read(f_string_static_t *buffer, f_string_range_t *range, f_iki_variable_t *variable, f_iki_vocabulary_t *vocabulary, f_iki_content_t *content); #endif // _di_f_iki_read_ #ifdef __cplusplus diff --git a/level_0/f_memory/c/memory-structure.h b/level_0/f_memory/c/memory-structure.h index 7ba974a..700a8f6 100644 --- a/level_0/f_memory/c/memory-structure.h +++ b/level_0/f_memory/c/memory-structure.h @@ -24,7 +24,7 @@ extern "C" { * structure: the structure to operate on. */ #ifndef _di_f_macro_memory_structure_clear_ - #define f_macro_memory_structure_clear(structure) \ + #define f_macro_memory_structure_t_clear(structure) \ structure.array = 0; \ structure.size = 0; \ structure.used = 0; @@ -41,8 +41,8 @@ extern "C" { * length: the new size of the array. */ #ifndef _di_f_macro_memory_structure_new_ - #define f_macro_memory_structure_new(status, structure, type, length) \ - f_macro_memory_structure_clear(structure) \ + #define f_macro_memory_structure_t_new(status, structure, type, length) \ + f_macro_memory_structure_t_clear(structure) \ status = f_memory_new((void **) & structure.array, sizeof(type), length); \ if (status == F_none) { \ structure.size = length; \ @@ -58,7 +58,7 @@ extern "C" { * type: the structure type. */ #ifndef _di_f_macro_memory_structure_delete_ - #define f_macro_memory_structure_delete(status, structure, type) \ + #define f_macro_memory_structure_t_delete(status, structure, type) \ status = f_memory_delete((void **) & structure.array, sizeof(type), structure.size); \ if (status == F_none) { \ structure.size = 0; \ @@ -74,7 +74,7 @@ extern "C" { * type: the structure type. */ #ifndef _di_f_macro_memory_structure_destroy_ - #define f_macro_memory_structure_destroy(status, structure, type) \ + #define f_macro_memory_structure_t_destroy(status, structure, type) \ status = f_memory_destroy((void **) & structure.array, sizeof(type), structure.size); \ if (status == F_none) { \ structure.size = 0; \ @@ -89,7 +89,7 @@ extern "C" { * type: the structure type. */ #ifndef _di_f_macro_memory_structure_delete_simple_ - #define f_macro_memory_structure_delete_simple(structure, type) \ + #define f_macro_memory_structure_t_delete_simple(structure, type) \ if (f_memory_delete((void **) & structure.array, sizeof(type), structure.size) == F_none) { \ structure.size = 0; \ structure.used = 0; \ @@ -103,7 +103,7 @@ extern "C" { * type: the structure type. */ #ifndef _di_f_macro_memory_structure_destroy_simple_ - #define f_macro_memory_structure_destroy_simple(structure, type) \ + #define f_macro_memory_structure_t_destroy_simple(structure, type) \ if (f_memory_destroy((void **) & structure.array, sizeof(type), structure.size) == F_none) { \ structure.size = 0; \ structure.used = 0; \ @@ -119,7 +119,7 @@ extern "C" { * new_length: the new size of the array. */ #ifndef _di_f_macro_memory_structure_resize_ - #define f_macro_memory_structure_resize(status, structure, type, new_length) \ + #define f_macro_memory_structure_t_resize(status, structure, type, new_length) \ status = f_memory_resize((void **) & structure.array, sizeof(type), structure.size, new_length); \ if (status == F_none) { \ structure.size = new_length; \ @@ -136,7 +136,7 @@ extern "C" { * new_length: the new size of the array. */ #ifndef _di_f_macro_memory_structure_adjust_ - #define f_macro_memory_structure_adjust(status, structure, type, new_length) \ + #define f_macro_memory_structure_t_adjust(status, structure, type, new_length) \ status = f_memory_adjust((void **) & structure.array, sizeof(type), structure.size, new_length); \ if (status == F_none) { \ structure.size = new_length; \ @@ -152,7 +152,7 @@ extern "C" { * structures: the structures to operate on. */ #ifndef _di_f_macro_memory_structures_clear_ - #define f_macro_memory_structures_clear(structures) \ + #define f_macro_memory_structures_t_clear(structures) \ structures.array = 0; \ structures.size = 0; \ structures.used = 0; @@ -169,8 +169,8 @@ extern "C" { * new_length: the new size of the array. */ #ifndef _di_f_macro_memory_structures_new_ - #define f_macro_memory_structures_new(status, structures, type_structures, new_length) \ - f_macro_memory_structures_clear(structures) \ + #define f_macro_memory_structures_t_new(status, structures, type_structures, new_length) \ + f_macro_memory_structures_t_clear(structures) \ status = f_memory_new((void **) & structures.array, sizeof(type_structures), new_length); \ if (status == F_none) { \ structures.size = new_length; \ @@ -187,12 +187,12 @@ extern "C" { * type_stuctures: the structure type. */ #ifndef _di_f_macro_memory_structures_delete_ - #define f_macro_memory_structures_delete(status, structures, type_structure, type_structures) \ + #define f_macro_memory_structures_t_delete(status, structures, type_structure, type_structures) \ status = F_none; \ structures.used = structures.size; \ while (structures.used > 0) { \ structures.used--; \ - f_macro_memory_structure_delete(status, structures.array[structures.used], type_structure); \ + f_macro_memory_structure_t_delete(status, structures.array[structures.used], type_structure); \ if (status != F_none) break; \ } \ if (status == F_none) status = f_memory_delete((void **) & structures.array, sizeof(type_structures), structures.size); \ @@ -208,12 +208,12 @@ extern "C" { * type_stuctures: the structure type. */ #ifndef _di_f_macro_memory_structures_destroy_ - #define f_macro_memory_structures_destroy(status, structures, type_structure, type_structures) \ + #define f_macro_memory_structures_t_destroy(status, structures, type_structure, type_structures) \ status = F_none; \ structures.used = structures.size; \ while (structures.used > 0) { \ structures.used--; \ - f_macro_memory_structure_destroy(status, structures.array[structures.used], type_structure); \ + f_macro_memory_structure_t_destroy(status, structures.array[structures.used], type_structure); \ if (status != F_none) break; \ } \ if (status == F_none) status = f_memory_destroy((void **) & structures.array, sizeof(type_structures), structures.size); \ @@ -228,11 +228,11 @@ extern "C" { * type_stuctures: the structure type. */ #ifndef _di_f_macro_memory_structures_delete_simple_ - #define f_macro_memory_structures_delete_simple(structures, type_structure, type_structures) \ + #define f_macro_memory_structures_t_delete_simple(structures, type_structure, type_structures) \ structures.used = structures.size; \ while (structures.used > 0) { \ structures.used--; \ - f_macro_memory_structure_delete_simple(structures.array[structures.used], type_structure); \ + f_macro_memory_structure_t_delete_simple(structures.array[structures.used], type_structure); \ } \ if (structures.used == 0) { \ if (f_memory_delete((void **) & structures.array, sizeof(type_structures), structures.size)) { \ @@ -249,11 +249,11 @@ extern "C" { * type_stuctures: the structure type. */ #ifndef _di_f_macro_memory_structures_destroy_simple_ - #define f_macro_memory_structures_destroy_simple(structures, type_structure, type_structures) \ + #define f_macro_memory_structures_t_destroy_simple(structures, type_structure, type_structures) \ structures.used = structures.size; \ while (structures.used > 0) { \ structures.used--; \ - f_macro_memory_structure_destroy_simple(structures.array[structures.used], type_structure); \ + f_macro_memory_structure_t_destroy_simple(structures.array[structures.used], type_structure); \ } \ if (structures.used == 0) { \ if (f_memory_destroy((void **) & structures.array, sizeof(type_structures), structures.size)) { \ @@ -273,11 +273,11 @@ extern "C" { * length_variable: the data type of the length variable. */ #ifndef _di_f_macro_memory_structures_resize_ - #define f_macro_memory_structures_resize(status, structures, type_structure, type_structures, new_length, length_variable) \ + #define f_macro_memory_structures_t_resize(status, structures, type_structure, type_structures, new_length, length_variable) \ status = F_none; \ if (new_length < structures.size) { \ for (length_variable _macro__i = structures.size - new_length; _macro__i < structures.size; _macro__i++) { \ - f_macro_memory_structure_delete(status, structures.array[_macro__i], type_structure); \ + f_macro_memory_structure_t_delete(status, structures.array[_macro__i], type_structure); \ if (status != F_none) break; \ } \ } \ @@ -304,11 +304,11 @@ extern "C" { * length_variable: the data type of the length variable. */ #ifndef _di_f_macro_memory_structures_adjust_ - #define f_macro_memory_structures_adjust(status, structures, type_structure, type_structures, new_length, length_variable) \ + #define f_macro_memory_structures_t_adjust(status, structures, type_structure, type_structures, new_length, length_variable) \ status = F_none; \ if (new_length < structures.size) { \ for (length_variable _macro__i = structures.size - new_length; _macro__i < structures.size; _macro__i++) { \ - f_macro_memory_structure_destroy(status, structures.array[_macro__i], type_structure); \ + f_macro_memory_structure_t_destroy(status, structures.array[_macro__i], type_structure); \ if (status != F_none) break; \ } \ } \ @@ -328,8 +328,8 @@ extern "C" { * Provide a macro for calling other macros for incrementing a buffer. * * If the used + step is greater than size, then increase by step_default. - * If step_default exceeds f_array_length_size, then attempt to increment by step. - * If step exceeds f_array_length_size, set status to error_too_large. + * If step_default exceeds f_array_length_t_size, then attempt to increment by step. + * If step exceeds f_array_length_t_size, set status to error_too_large. * * Be sure to check size for error after calling this. * @@ -338,13 +338,13 @@ extern "C" { * step: the step to increase by, must be less than or equal to step_default. * step_default: the default step to increase by if memory allows. * macro_resize: the resize structure macro to call that excepts the exact arguments: (status, structure, new_length). - * error_too_large: the error status to return when f_array_length_size would be exceeded. + * error_too_large: the error status to return when f_array_length_t_size would be exceeded. */ #ifndef _di_f_macro_memory_structure_macro_increment_ #define f_macro_memory_structure_macro_increment(status, structure, step, step_default, macro_resize, error_too_large) \ if (structure.used + step > structure.size) { \ - if (structure.used + step_default > f_array_length_size) { \ - if (structure.used + step > structure.size > f_array_length_size) { \ + if (structure.used + step_default > f_array_length_t_size) { \ + if (structure.used + step > structure.size > f_array_length_t_size) { \ status = F_status_set_error(error_too_large); \ } \ else { \ diff --git a/level_0/f_path/c/path.c b/level_0/f_path/c/path.c index 4f59e0c..c4d6d56 100644 --- a/level_0/f_path/c/path.c +++ b/level_0/f_path/c/path.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_f_path_change_ - f_return_status f_path_change(const f_string path) { + f_return_status f_path_change(const f_string_t path) { if (chdir(path) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); @@ -50,7 +50,7 @@ extern "C" { #endif // _di_f_path_change_at_ #ifndef _di_f_path_current_ - f_return_status f_path_current(const bool real, f_string_dynamic *path) { + f_return_status f_path_current(const bool real, f_string_dynamic_t *path) { #ifndef _di_level_0_parameter_checking_ if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -73,12 +73,12 @@ extern "C" { return private_f_path_real(buffer, path); } - const f_string_length length = strnlen(buffer, f_path_max); + const f_string_length_t length = strnlen(buffer, f_path_max); if (length + 1 > path->size) { - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_new(status, (*path), length + 1); + f_macro_string_dynamic_t_new(status, (*path), length + 1); if (F_status_is_error(status)) return status; } @@ -92,7 +92,7 @@ extern "C" { #endif // _di_f_path_current_ #ifndef _di_f_path_real_ - f_return_status f_path_real(const f_string path, f_string_dynamic *real) { + f_return_status f_path_real(const f_string_t path, f_string_dynamic_t *real) { #ifndef _di_level_0_parameter_checking_ if (real == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ diff --git a/level_0/f_path/c/path.h b/level_0/f_path/c/path.h index 1490d6b..aa400d7 100644 --- a/level_0/f_path/c/path.h +++ b/level_0/f_path/c/path.h @@ -84,7 +84,7 @@ extern "C" { * @see chdir() */ #ifndef _di_f_path_change_ - extern f_return_status f_path_change(const f_string path); + extern f_return_status f_path_change(const f_string_t path); #endif // _di_f_path_change_ /** @@ -142,7 +142,7 @@ extern "C" { * @see getcwd() */ #ifndef _di_f_path_current_ - extern f_return_status f_path_current(const bool real, f_string_dynamic *path); + extern f_return_status f_path_current(const bool real, f_string_dynamic_t *path); #endif // _di_f_path_current_ /** @@ -179,7 +179,7 @@ extern "C" { * @see realpath() */ #ifndef _di_f_path_real_ - extern f_return_status f_path_real(const f_string path, f_string_dynamic *real); + extern f_return_status f_path_real(const f_string_t path, f_string_dynamic_t *real); #endif // _di_f_path_real_ #ifdef __cplusplus diff --git a/level_0/f_path/c/private-path.c b/level_0/f_path/c/private-path.c index c9ddf7a..85bdcdc 100644 --- a/level_0/f_path/c/private-path.c +++ b/level_0/f_path/c/private-path.c @@ -6,7 +6,7 @@ extern "C" { #endif #if !defined(_di_f_path_current_) || !defined(_di_f_path_real_) - f_return_status private_f_path_real(const f_string path, f_string_dynamic *real) { + f_return_status private_f_path_real(const f_string_t path, f_string_dynamic_t *real) { char buffer[f_path_max]; if (!realpath(path, buffer)) { @@ -22,12 +22,12 @@ extern "C" { return F_status_set_error(F_failure); } - const f_string_length length = strnlen(buffer, f_path_max); + const f_string_length_t length = strnlen(buffer, f_path_max); if (length + 1 > real->size) { - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_resize(status, (*real), length + 1); + f_macro_string_dynamic_t_resize(status, (*real), length + 1); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_path/c/private-path.h b/level_0/f_path/c/private-path.h index 7c37cdc..0502398 100644 --- a/level_0/f_path/c/private-path.h +++ b/level_0/f_path/c/private-path.h @@ -42,7 +42,7 @@ extern "C" { * @see f_path_real() */ #if !defined(_di_f_path_current_) || !defined(_di_f_path_real_) - extern f_return_status private_f_path_real(const f_string path, f_string_dynamic *real) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_path_real(const f_string_t path, f_string_dynamic_t *real) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_path_current_) || !defined(_di_f_path_real_) #ifdef __cplusplus diff --git a/level_0/f_print/c/print.c b/level_0/f_print/c/print.c index 70d4590..64eed4e 100644 --- a/level_0/f_print/c/print.c +++ b/level_0/f_print/c/print.c @@ -5,14 +5,14 @@ extern "C" { #endif #ifndef _di_f_print_string_ - f_return_status f_print_string(FILE *output, const f_string string, const f_string_length length) { + f_return_status f_print_string(FILE *output, const f_string_t string, const f_string_length_t length) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (length == 0) return F_data_not; - register f_string_length i = 0; + register f_string_length_t i = 0; for (; i < length; i++) { if (string[i] != 0) { @@ -27,10 +27,10 @@ extern "C" { #endif // _di_f_print_string_ #ifndef _di_f_print_string_dynamic_ - f_return_status f_print_string_dynamic(FILE *output, const f_string_static buffer) { + f_return_status f_print_string_dynamic(FILE *output, const f_string_static_t buffer) { if (buffer.used == 0) return F_data_not; - register f_string_length i = 0; + register f_string_length_t i = 0; for (; i < buffer.used; i++) { if (buffer.string[i] != 0) { @@ -45,7 +45,7 @@ extern "C" { #endif // _di_f_print_string_dynamic_ #ifndef _di_f_print_string_dynamic_partial_ - f_return_status f_print_string_dynamic_partial(FILE *output, const f_string_static buffer, const f_string_range range) { + f_return_status f_print_string_dynamic_partial(FILE *output, const f_string_static_t buffer, const f_string_range_t range) { #ifndef _di_level_0_parameter_checking_ if (range.start < 0) return F_status_set_error(F_parameter); if (range.start > range.stop) return F_status_set_error(F_parameter); @@ -55,7 +55,7 @@ extern "C" { if (buffer.used == 0) return F_data_not; - register f_string_length i = range.start; + register f_string_length_t i = range.start; for (; i <= range.stop; i++) { if (buffer.string[i] != 0) { diff --git a/level_0/f_print/c/print.h b/level_0/f_print/c/print.h index 167bbae..213daf0 100644 --- a/level_0/f_print/c/print.h +++ b/level_0/f_print/c/print.h @@ -50,7 +50,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_print_string_ - extern f_return_status f_print_string(FILE *output, const f_string string, const f_string_length length); + extern f_return_status f_print_string(FILE *output, const f_string_t string, const f_string_length_t length); #endif // _di_f_print_string_ /** @@ -74,7 +74,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_print_string_dynamic_ - extern f_return_status f_print_string_dynamic(FILE *output, const f_string_static buffer); + extern f_return_status f_print_string_dynamic(FILE *output, const f_string_static_t buffer); #endif // _di_f_print_string_dynamic_ /** @@ -100,7 +100,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_print_string_dynamic_partial_ - extern f_return_status f_print_string_dynamic_partial(FILE *output, const f_string_static buffer, const f_string_range range); + extern f_return_status f_print_string_dynamic_partial(FILE *output, const f_string_static_t buffer, const f_string_range_t range); #endif // _di_f_print_string_dynamic_partial_ #ifdef __cplusplus diff --git a/level_0/f_serialize/c/private-serialize.c b/level_0/f_serialize/c/private-serialize.c index 3b92ecb..5d69b08 100644 --- a/level_0/f_serialize/c/private-serialize.c +++ b/level_0/f_serialize/c/private-serialize.c @@ -6,12 +6,12 @@ extern "C" { #endif #if !defined(_di_f_serialize_un_simple_find_) || !defined(_di_f_serialize_un_simple_get_) - f_return_status private_f_serialize_un_simple_find(const f_string_static serialize, const f_array_length index, f_string_range *location) { - f_status status = F_none; + f_return_status private_f_serialize_un_simple_find(const f_string_static_t serialize, const f_array_length_t index, f_string_range_t *location) { + f_status_t status = F_none; - f_array_length i = 0; - f_array_length start = 0; - f_array_length current = 0; + f_array_length_t i = 0; + f_array_length_t start = 0; + f_array_length_t current = 0; unsigned short width = 0; diff --git a/level_0/f_serialize/c/private-serialize.h b/level_0/f_serialize/c/private-serialize.h index dbf038b..3a9fb21 100644 --- a/level_0/f_serialize/c/private-serialize.h +++ b/level_0/f_serialize/c/private-serialize.h @@ -35,7 +35,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #if !defined(_di_f_serialize_un_simple_find_) || !defined(_di_f_serialize_un_simple_get_) - extern f_return_status private_f_serialize_un_simple_find(const f_string_static serialize, const f_array_length index, f_string_range *location) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_serialize_un_simple_find(const f_string_static_t serialize, const f_array_length_t index, f_string_range_t *location) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_serialize_un_simple_find_) || !defined(_di_f_serialize_un_simple_get_) #ifdef __cplusplus diff --git a/level_0/f_serialize/c/serialize.c b/level_0/f_serialize/c/serialize.c index b3e4b36..a50acbe 100644 --- a/level_0/f_serialize/c/serialize.c +++ b/level_0/f_serialize/c/serialize.c @@ -6,15 +6,15 @@ extern "C" { #endif #ifndef _di_f_serialize_simple_ - f_return_status f_serialize_simple(const f_string_static value, f_string_dynamic *serialize) { + f_return_status f_serialize_simple(const f_string_static_t value, f_string_dynamic_t *serialize) { #ifndef _di_level_0_parameter_checking_ if (serialize == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; if (serialize->used + value.used + 1 >= serialize->size) { - f_macro_string_dynamic_resize(status, (*serialize), serialize->size + value.used + 1); + f_macro_string_dynamic_t_resize(status, (*serialize), serialize->size + value.used + 1); if (F_status_is_error(status)) return status; } @@ -33,16 +33,16 @@ extern "C" { #endif // _di_f_serialize_simple_ #ifndef _di_f_serialize_un_simple_ - f_return_status f_serialize_un_simple(const f_string_static serialize, f_string_dynamics *strings) { + f_return_status f_serialize_un_simple(const f_string_static_t serialize, f_string_dynamics_t *strings) { #ifndef _di_level_0_parameter_checking_ if (serialize.used == 0) return F_status_set_error(F_parameter); if (strings == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; - f_array_length i = 0; - f_array_length start = 0; + f_array_length_t i = 0; + f_array_length_t start = 0; uint8_t width = 0; @@ -58,7 +58,7 @@ extern "C" { strings->used++; } else { - f_string_length total; + f_string_length_t total; if (i + 1 >= serialize.used) { total = (i - start) + 1; @@ -69,7 +69,7 @@ extern "C" { } if (total > strings->array[strings->used].size) { - f_macro_string_dynamic_new(status, strings->array[strings->used], total); + f_macro_string_dynamic_t_new(status, strings->array[strings->used], total); if (F_status_is_error(status)) return status; strings->array[strings->used].size = total; @@ -99,16 +99,16 @@ extern "C" { #endif // _di_f_serialize_un_simple_ #ifndef _di_f_serialize_un_simple_map_ - f_return_status f_serialize_un_simple_map(const f_string_static serialize, f_string_ranges *locations) { + f_return_status f_serialize_un_simple_map(const f_string_static_t serialize, f_string_ranges_t *locations) { #ifndef _di_level_0_parameter_checking_ if (serialize.used == 0) return F_status_set_error(F_parameter); if (locations == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; - f_array_length i = 0; - f_array_length start = 0; + f_array_length_t i = 0; + f_array_length_t start = 0; uint8_t width = 0; @@ -116,7 +116,7 @@ extern "C" { width = f_macro_utf_byte_width(serialize.string[i]); if (serialize.string[i] == f_serialize_simple_splitter || i + 1 >= serialize.used) { - f_macro_memory_structure_macro_increment(status, (*locations), 1, f_serialize_default_allocation_step, f_macro_string_ranges_resize, F_buffer_too_large); + f_macro_memory_structure_macro_increment(status, (*locations), 1, f_serialize_default_allocation_step, f_macro_string_ranges_t_resize, F_buffer_too_large); if (F_status_is_error(status)) return status; if (start == i) { @@ -152,7 +152,7 @@ extern "C" { #endif // _di_f_serialize_un_simple_map_ #ifndef _di_f_serialize_un_simple_find_ - f_return_status f_serialize_un_simple_find(const f_string_static serialize, const f_array_length index, f_string_range *range) { + f_return_status f_serialize_un_simple_find(const f_string_static_t serialize, const f_array_length_t index, f_string_range_t *range) { #ifndef _di_level_0_parameter_checking_ if (serialize.used == 0) return F_status_set_error(F_parameter); if (range == 0) return F_status_set_error(F_parameter); @@ -163,15 +163,15 @@ extern "C" { #endif // _di_f_serialize_un_simple_find_ #ifndef _di_f_serialize_un_simple_get_ - f_return_status f_serialize_un_simple_get(const f_string_static serialize, const f_array_length index, f_string_dynamic *dynamic) { + f_return_status f_serialize_un_simple_get(const f_string_static_t serialize, const f_array_length_t index, f_string_dynamic_t *dynamic) { #ifndef _di_level_0_parameter_checking_ if (serialize.used == 0) return F_status_set_error(F_parameter); if (dynamic == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_string_range range = f_string_range_initialize; + f_string_range_t range = f_string_range_initialize; - f_status status = private_f_serialize_un_simple_find(serialize, index, &range); + f_status_t status = private_f_serialize_un_simple_find(serialize, index, &range); if (F_status_is_error(status)) return status; if (status == F_data_not_eos) { @@ -179,12 +179,12 @@ extern "C" { return status; } - f_string_length total = (range.stop - range.start) + 1; + f_string_length_t total = (range.stop - range.start) + 1; if (total >= dynamic->size) { - f_status status_allocation = F_none; + f_status_t status_allocation = F_none; - f_macro_string_dynamic_resize(status_allocation, (*dynamic), total); + f_macro_string_dynamic_t_resize(status_allocation, (*dynamic), total); if (F_status_is_error(status_allocation)) return status_allocation; } diff --git a/level_0/f_serialize/c/serialize.h b/level_0/f_serialize/c/serialize.h index 1012cb1..89539d1 100644 --- a/level_0/f_serialize/c/serialize.h +++ b/level_0/f_serialize/c/serialize.h @@ -62,7 +62,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_serialize_simple_ - extern f_return_status f_serialize_simple(const f_string_static value, f_string_dynamic *serialize); + extern f_return_status f_serialize_simple(const f_string_static_t value, f_string_dynamic_t *serialize); #endif // _di_f_serialize_simple_ /** @@ -88,7 +88,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_serialize_un_simple_ - extern f_return_status f_serialize_un_simple(const f_string_static serialize, f_string_dynamics *strings); + extern f_return_status f_serialize_un_simple(const f_string_static_t serialize, f_string_dynamics_t *strings); #endif // _di_f_serialize_un_simple_ /** @@ -114,7 +114,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_serialize_un_simple_map_ - extern f_return_status f_serialize_un_simple_map(const f_string_static serialize, f_string_ranges *locations); + extern f_return_status f_serialize_un_simple_map(const f_string_static_t serialize, f_string_ranges_t *locations); #endif // _di_f_serialize_un_simple_map_ /** @@ -142,7 +142,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_serialize_un_simple_find_ - extern f_return_status f_serialize_un_simple_find(const f_string_static serialize, const f_array_length index, f_string_range *location); + extern f_return_status f_serialize_un_simple_find(const f_string_static_t serialize, const f_array_length_t index, f_string_range_t *location); #endif // _di_f_serialize_un_simple_find_ /** @@ -171,7 +171,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_serialize_un_simple_get_ - extern f_return_status f_serialize_un_simple_get(const f_string_static serialize, const f_array_length index, f_string_dynamic *dynamic); + extern f_return_status f_serialize_un_simple_get(const f_string_static_t serialize, const f_array_length_t index, f_string_dynamic_t *dynamic); #endif // _di_f_serialize_un_simple_get_ #ifdef __cplusplus diff --git a/level_0/f_socket/c/socket.c b/level_0/f_socket/c/socket.c index f5edec3..f61d584 100644 --- a/level_0/f_socket/c/socket.c +++ b/level_0/f_socket/c/socket.c @@ -5,7 +5,7 @@ extern "C"{ #endif #ifndef _di_f_socket_file_bind_ - f_return_status f_socket_file_bind(const f_string path, const int id, struct sockaddr_un *address) { + f_return_status f_socket_file_bind(const f_string_t path, const int id, struct sockaddr_un *address) { memset(&address, 0, sizeof(struct sockaddr_un)); address->sun_family = AF_UNIX; strncpy(address->sun_path, path, sizeof(address->sun_path) - 1); diff --git a/level_0/f_socket/c/socket.h b/level_0/f_socket/c/socket.h index 22d4efc..2bbe77e 100644 --- a/level_0/f_socket/c/socket.h +++ b/level_0/f_socket/c/socket.h @@ -69,7 +69,7 @@ extern "C"{ * @see bind() */ #ifndef _di_f_socket_file_bind_ - extern f_return_status f_socket_file_bind(const f_string path, const int id, struct sockaddr_un *address); + extern f_return_status f_socket_file_bind(const f_string_t path, const int id, struct sockaddr_un *address); #endif // _di_f_socket_file_bind_ /** diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index e426b53..2ddb67e 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -23,7 +23,7 @@ extern "C" { * Status masks. */ #ifndef _di_F_status_masks_ - // f_status is required to be exactly 16 bits, the first two high order bits represent error and warning respectively. + // f_status_t is required to be exactly 16 bits, the first two high order bits represent error and warning respectively. #define F_status_bit_error 0x8000 // 1000 0000 0000 0000 #define F_status_bit_signal 0xc000 // 1100 0000 0000 0000 #define F_status_bit_warning 0x4000 // 0100 0000 0000 0000 diff --git a/level_0/f_status/c/status_array.h b/level_0/f_status/c/status_array.h index 6e766f9..ce810ce 100644 --- a/level_0/f_status/c/status_array.h +++ b/level_0/f_status/c/status_array.h @@ -26,28 +26,28 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_f_statuss_ +#ifndef _di_f_statuss_t_ typedef struct { - f_status *array; - f_array_length size; - f_array_length used; - } f_statuss; + f_status_t *array; + f_array_length_t size; + f_array_length_t used; + } f_statuss_t; - #define f_statuss_initialize { 0, 0, 0 } + #define f_statuss_t_initialize { 0, 0, 0 } - #define f_macro_statuss_clear(statuss) f_macro_memory_structure_clear(statuss) + #define f_macro_statuss_t_clear(statuss) f_macro_memory_structure_t_clear(statuss) - #define f_macro_statuss_new(status, statuss, length) f_macro_memory_structure_new(status, statuss, f_status, length) + #define f_macro_statuss_t_new(status, statuss, length) f_macro_memory_structure_t_new(status, statuss, f_status_t, length) - #define f_macro_statuss_delete(status, statuss) f_macro_memory_structure_delete(status, statuss, f_status) - #define f_macro_statuss_destroy(status, statuss) f_macro_memory_structure_destroy(status, statuss, f_status) + #define f_macro_statuss_t_delete(status, statuss) f_macro_memory_structure_t_delete(status, statuss, f_status_t) + #define f_macro_statuss_t_destroy(status, statuss) f_macro_memory_structure_t_destroy(status, statuss, f_status_t) - #define f_macro_statuss_delete_simple(statuss) f_macro_memory_structure_delete_simple(statuss, f_status) - #define f_macro_statuss_destroy_simple(statuss) f_macro_memory_structure_destroy_simple(statuss, f_status) + #define f_macro_statuss_t_delete_simple(statuss) f_macro_memory_structure_t_delete_simple(statuss, f_status_t) + #define f_macro_statuss_t_destroy_simple(statuss) f_macro_memory_structure_t_destroy_simple(statuss, f_status_t) - #define f_macro_statuss_resize(status, statuss, new_length) f_macro_memory_structure_resize(status, statuss, f_status, new_length) - #define f_macro_statuss_adjust(status, statuss, new_length) f_macro_memory_structure_adjust(status, statuss, f_status, new_length) -#endif // _di_f_statuss_ + #define f_macro_statuss_t_resize(status, statuss, new_length) f_macro_memory_structure_t_resize(status, statuss, f_status_t, new_length) + #define f_macro_statuss_t_adjust(status, statuss, new_length) f_macro_memory_structure_t_adjust(status, statuss, f_status_t, new_length) +#endif // _di_f_statuss_t_ /** * An array of an array of status codes. @@ -56,29 +56,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_statusss_ +#ifndef _di_f_statusss_t_ typedef struct { - f_statuss *array; + f_statuss_t *array; - f_array_length size; - f_array_length used; - } f_statusss; + f_array_length_t size; + f_array_length_t used; + } f_statusss_t; - #define f_statusss_initialize { 0, 0, 0 } + #define f_statusss_t_initialize { 0, 0, 0 } - #define f_macro_statusss_clear(statusss) f_macro_memory_structures_clear(statusss) + #define f_macro_statusss_t_clear(statusss) f_macro_memory_structures_t_clear(statusss) - #define f_macro_statusss_new(status, statusss, length) f_macro_memory_structures_new(status, statusss, f_status, f_statuss, length) + #define f_macro_statusss_t_new(status, statusss, length) f_macro_memory_structures_t_new(status, statusss, f_status_t, f_statuss_t, length) - #define f_macro_statusss_delete(status, statusss) f_macro_memory_structures_delete(status, statusss, f_status, f_statuss) - #define f_macro_statusss_destroy(status, statusss) f_macro_memory_structures_destroy(status, statusss, f_status, f_statuss) + #define f_macro_statusss_t_delete(status, statusss) f_macro_memory_structures_t_delete(status, statusss, f_status_t, f_statuss_t) + #define f_macro_statusss_t_destroy(status, statusss) f_macro_memory_structures_t_destroy(status, statusss, f_status_t, f_statuss_t) - #define f_macro_statusss_delete_simple(statusss) f_macro_memory_structures_delete_simple(statusss, f_status, f_statuss) - #define f_macro_statusss_destroy_simple(statusss) f_macro_memory_structures_destroy_simple(statusss, f_status, f_statuss) + #define f_macro_statusss_t_delete_simple(statusss) f_macro_memory_structures_t_delete_simple(statusss, f_status_t, f_statuss_t) + #define f_macro_statusss_t_destroy_simple(statusss) f_macro_memory_structures_t_destroy_simple(statusss, f_status_t, f_statuss_t) - #define f_macro_statusss_resize(status, statusss, new_length) f_macro_memory_structures_resize(status, statusss, f_status, f_statuss, new_length, f_array_length) - #define f_macro_statusss_adjust(status, statusss, new_length) f_macro_memory_structures_adjust(status, statusss, f_status, f_statuss, new_length, f_array_length) -#endif // _di_f_statuss_ + #define f_macro_statusss_t_resize(status, statusss, new_length) f_macro_memory_structures_t_resize(status, statusss, f_status_t, f_statuss_t, new_length, f_array_length_t) + #define f_macro_statusss_t_adjust(status, statusss, new_length) f_macro_memory_structures_t_adjust(status, statusss, f_status_t, f_statuss_t, new_length, f_array_length_t) +#endif // _di_f_statuss_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string.h b/level_0/f_string/c/string.h index a0e777e..639105f 100644 --- a/level_0/f_string/c/string.h +++ b/level_0/f_string/c/string.h @@ -7,8 +7,8 @@ * * Provides string capabilities. * - * It is highly recommended that all string arrays are set to a max size of f_string_length_size. - * Any calculations against the length (aka: string.used) can always perform (A < B) operators such that the B is f_string_length_size + 1 without integer overflow. + * It is highly recommended that all string arrays are set to a max size of f_string_length_t_size. + * Any calculations against the length (aka: string.used) can always perform (A < B) operators such that the B is f_string_length_t_size + 1 without integer overflow. */ #ifndef _F_string_h #define _F_string_h diff --git a/level_0/f_string/c/string_common.h b/level_0/f_string/c/string_common.h index 0fc3553..4dc2d98 100644 --- a/level_0/f_string/c/string_common.h +++ b/level_0/f_string/c/string_common.h @@ -54,43 +54,43 @@ extern "C" { #define string_format_long_long_unsigned "%llu" #endif // _di_string_format_pointers_ -#ifndef _di_f_array_length_printf_ +#ifndef _di_f_array_t_length_printf_ #define f_array_length_printf string_format_integer #define f_array_length_short_printf string_format_short_integer #define f_array_length_long_printf string_format_long_integer -#endif // _di_f_array_length_printf_ +#endif // _di_f_array_t_length_printf_ /** * define the basic string type. */ -#ifndef _di_f_string_ - typedef char *f_string; +#ifndef _di_f_string_t_ + typedef char *f_string_t; - #define f_string_initialize 0 + #define f_string_t_initialize 0 - #define f_macro_string_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_string), length) - #define f_macro_string_delete(status, string, length) status = f_memory_delete((void **) & string, sizeof(f_string), length) - #define f_macro_string_destroy(status, string, length) status = f_memory_destroy((void **) & string, sizeof(f_string), length) + #define f_macro_string_t_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_string_t), length) + #define f_macro_string_t_delete(status, string, length) status = f_memory_delete((void **) & string, sizeof(f_string_t), length) + #define f_macro_string_t_destroy(status, string, length) status = f_memory_destroy((void **) & string, sizeof(f_string_t), length) - #define f_macro_string_delete_simple(string, length) f_memory_delete((void **) & string, sizeof(f_string), length) - #define f_macro_string_destroy_simple(string, length) f_memory_destroy((void **) & string, sizeof(f_string), length) + #define f_macro_string_t_delete_simple(string, length) f_memory_delete((void **) & string, sizeof(f_string_t), length) + #define f_macro_string_t_destroy_simple(string, length) f_memory_destroy((void **) & string, sizeof(f_string_t), length) - #define f_macro_string_resize(status, string, old_length, new_length) \ - status = f_memory_resize((void **) & string, sizeof(f_string), old_length, new_length) + #define f_macro_string_t_resize(status, string, old_length, new_length) \ + status = f_memory_resize((void **) & string, sizeof(f_string_t), old_length, new_length) - #define f_macro_string_adjust(status, string, old_length, new_length) \ - status = f_memory_adjust((void **) & string, sizeof(f_string), old_length, new_length) -#endif // _di_f_string_ + #define f_macro_string_t_adjust(status, string, old_length, new_length) \ + status = f_memory_adjust((void **) & string, sizeof(f_string_t), old_length, new_length) +#endif // _di_f_string_t_ -#ifndef _di_f_string_length_ - typedef f_number_unsigned f_string_length; +#ifndef _di_f_string_length_t_ + typedef f_number_unsigned_t f_string_length_t; // string size is set to (size - 4) to compensate for UTF-8 4-byte character such that it can easily act as a (size - 1) regardless of UTF-8. - #define f_string_length_size 0xfffffffffffffffb - #define f_string_length_size_max f_type_number_size_max_unsigned + #define f_string_length_t_size 0xfffffffffffffffb + #define f_string_length_t_size_max f_number_t_size_max_unsigned - #define f_string_length_printf string_format_long_integer -#endif // _di_f_string_length_ + #define f_string_length_t_printf string_format_long_integer +#endif // _di_f_string_length_t_ /** * A structure containing an array of string lengths. @@ -99,29 +99,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_string_lengths_ +#ifndef _di_f_string_lengths_t_ typedef struct { - f_string_length *array; + f_string_length_t *array; - f_array_length size; - f_array_length used; - } f_string_lengths; + f_array_length_t size; + f_array_length_t used; + } f_string_lengths_t; - #define f_string_lengths_initialize { 0, 0, 0 } + #define f_string_lengths_t_initialize { 0, 0, 0 } - #define f_macro_string_lengths_clear(lengths) f_macro_memory_structure_clear(lengths) + #define f_macro_string_lengths_t_clear(lengths) f_macro_memory_structure_t_clear(lengths) - #define f_macro_string_lengths_new(status, lengths, length) f_macro_memory_structure_new(status, lengths, f_string_length, length) + #define f_macro_string_lengths_t_new(status, lengths, length) f_macro_memory_structure_t_new(status, lengths, f_string_length_t, length) - #define f_macro_string_lengths_delete(status, lengths) f_macro_memory_structure_delete(status, lengths, f_string_length) - #define f_macro_string_lengths_destroy(status, lengths) f_macro_memory_structure_destroy(status, lengths, f_string_length) + #define f_macro_string_lengths_t_delete(status, lengths) f_macro_memory_structure_t_delete(status, lengths, f_string_length_t) + #define f_macro_string_lengths_t_destroy(status, lengths) f_macro_memory_structure_t_destroy(status, lengths, f_string_length_t) - #define f_macro_string_lengths_delete_simple(lengths) f_macro_memory_structure_delete_simple(lengths, f_string_length) - #define f_macro_string_lengths_destroy_simple(lengths) f_macro_memory_structure_destroy_simple(lengths, f_string_length) + #define f_macro_string_lengths_t_delete_simple(lengths) f_macro_memory_structure_t_delete_simple(lengths, f_string_length_t) + #define f_macro_string_lengths_t_destroy_simple(lengths) f_macro_memory_structure_t_destroy_simple(lengths, f_string_length_t) - #define f_macro_string_lengths_resize(status, lengths, new_length) f_macro_memory_structure_resize(status, lengths, f_string_length, new_length) - #define f_macro_string_lengths_adjust(status, lengths, new_length) f_macro_memory_structure_adjust(status, lengths, f_string_length, new_length) -#endif // _di_f_string_lengths_ + #define f_macro_string_lengths_t_resize(status, lengths, new_length) f_macro_memory_structure_t_resize(status, lengths, f_string_length_t, new_length) + #define f_macro_string_lengths_t_adjust(status, lengths, new_length) f_macro_memory_structure_t_adjust(status, lengths, f_string_length_t, new_length) +#endif // _di_f_string_lengths_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string_dynamic.h b/level_0/f_string/c/string_dynamic.h index 827b37e..a3be8f3 100644 --- a/level_0/f_string/c/string_dynamic.h +++ b/level_0/f_string/c/string_dynamic.h @@ -17,99 +17,99 @@ extern "C" { #endif /** - * A string that is analogous to f_string_dynamic but intended for static-only uses. + * A string that is analogous to f_string_dynamic_t but intended for static-only uses. * - * The f_string_static type should never be directly allocated or deallocated. + * The f_string_static_t type should never be directly allocated or deallocated. * - * A special f_macro_string_static_initialize() is provided for the special purpose of easily initialize a static string. + * A special f_macro_string_static_t_initialize() is provided for the special purpose of easily initialize a static string. * * string: the string. * size: total amount of space available. * used: total number of space used. */ -#ifndef _di_f_string_static_ +#ifndef _di_f_string_static_t_ typedef struct { - f_string string; + f_string_t string; - f_string_length size; - f_string_length used; - } f_string_static; + f_string_length_t size; + f_string_length_t used; + } f_string_static_t; - #define f_string_static_initialize { 0, 0, 0 } + #define f_string_static_t_initialize { 0, 0, 0 } - #define f_macro_string_static_clear(string_static) \ + #define f_macro_string_static_t_clear(string_static) \ string_static.string = 0; \ string_static.size = 0; \ string_static.used = 0; - #define f_macro_string_static_initialize(string, length) { string, length, length } -#endif // _di_f_string_static_ + #define f_macro_string_static_t_initialize(string, length) { string, length, length } +#endif // _di_f_string_static_t_ /** * A string that supports contains a size attribute to handle dynamic allocations and deallocations. * * Save the string size along with the string, so that strlen(..) commands can be avoided as much as possible. * - * This is a sub-type of f_string_static, allowing it to be passed into any f_string_static type. - * It is recommended that f_string_static are not otherwise casted into f_string_dynamic to avoid potential memory allocation issues. + * This is a sub-type of f_string_static_t, allowing it to be passed into any f_string_static_t type. + * It is recommended that f_string_static_t are not otherwise casted into f_string_dynamic_t to avoid potential memory allocation issues. * * string: the string. * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_string_dynamic_ - typedef f_string_static f_string_dynamic; +#ifndef _di_f_string_dynamic_t_ + typedef f_string_static_t f_string_dynamic_t; - #define f_string_dynamic_initialize f_string_static_initialize + #define f_string_dynamic_t_initialize f_string_static_t_initialize - #define f_macro_string_dynamic_clear(dynamic) f_macro_string_static_clear(dynamic) + #define f_macro_string_dynamic_t_clear(dynamic) f_macro_string_static_t_clear(dynamic) - #define f_macro_string_dynamic_new(status, dynamic, new_length) \ - f_macro_string_dynamic_clear(dynamic) \ - status = f_memory_new((void **) & dynamic.string, sizeof(f_string), new_length); \ + #define f_macro_string_dynamic_t_new(status, dynamic, new_length) \ + f_macro_string_dynamic_t_clear(dynamic) \ + status = f_memory_new((void **) & dynamic.string, sizeof(f_string_t), new_length); \ if (status == F_none) { \ dynamic.size = new_length; \ dynamic.used = 0; \ } - #define f_macro_string_dynamic_delete(status, dynamic) \ - status = f_memory_delete((void **) & dynamic.string, sizeof(f_string), dynamic.size); \ + #define f_macro_string_dynamic_t_delete(status, dynamic) \ + status = f_memory_delete((void **) & dynamic.string, sizeof(f_string_t), dynamic.size); \ if (status == F_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } - #define f_macro_string_dynamic_destroy(status, dynamic) \ - status = f_memory_destroy((void **) & dynamic.string, sizeof(f_string), dynamic.size); \ + #define f_macro_string_dynamic_t_destroy(status, dynamic) \ + status = f_memory_destroy((void **) & dynamic.string, sizeof(f_string_t), dynamic.size); \ if (status == F_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } - #define f_macro_string_dynamic_delete_simple(dynamic) \ - f_memory_delete((void **) & dynamic.string, sizeof(f_string), dynamic.size); \ + #define f_macro_string_dynamic_t_delete_simple(dynamic) \ + f_memory_delete((void **) & dynamic.string, sizeof(f_string_t), dynamic.size); \ dynamic.size = 0; \ dynamic.used = 0; - #define f_macro_string_dynamic_destroy_simple(dynamic) \ - f_memory_destroy((void **) & dynamic.string, sizeof(f_string), dynamic.size); \ + #define f_macro_string_dynamic_t_destroy_simple(dynamic) \ + f_memory_destroy((void **) & dynamic.string, sizeof(f_string_t), dynamic.size); \ dynamic.size = 0; \ dynamic.used = 0; - #define f_macro_string_dynamic_resize(status, dynamic, new_length) \ - status = f_memory_resize((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \ + #define f_macro_string_dynamic_t_resize(status, dynamic, new_length) \ + status = f_memory_resize((void **) & dynamic.string, sizeof(f_string_t), dynamic.size, new_length); \ if (status == F_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ } - #define f_macro_string_dynamic_adjust(status, dynamic, new_length) \ - status = f_memory_adjust((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \ + #define f_macro_string_dynamic_t_adjust(status, dynamic, new_length) \ + status = f_memory_adjust((void **) & dynamic.string, sizeof(f_string_t), dynamic.size, new_length); \ if (status == F_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ } -#endif // _di_f_string_dynamic_ +#endif // _di_f_string_dynamic_t_ /** * An array of static strings. @@ -118,21 +118,21 @@ extern "C" { * size: total amount of space available. * used: total number of space used. */ -#ifndef _di_f_string_statics_ +#ifndef _di_f_string_statics_t_ typedef struct { - f_string_static *array; + f_string_static_t *array; - f_array_length size; - f_array_length used; - } f_string_statics; + f_array_length_t size; + f_array_length_t used; + } f_string_statics_t; - #define f_string_statics_initialize { 0, 0, 0 } + #define f_string_statics_t_initialize { 0, 0, 0 } - #define f_macro_string_statics_clear(statics) \ + #define f_macro_string_statics_t_clear(statics) \ statics.array = 0; \ statics.size = 0; \ statics.used = 0; -#endif // _di_f_string_statics_ +#endif // _di_f_string_statics_t_ /** * An array of dynamic strings. @@ -141,62 +141,62 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_string_dynamics_ - typedef f_string_statics f_string_dynamics; +#ifndef _di_f_string_dynamics_t_ + typedef f_string_statics_t f_string_dynamics_t; - #define f_string_dynamics_initialize f_string_statics_initialize + #define f_string_dynamics_t_initialize f_string_statics_t_initialize - #define f_macro_string_dynamics_clear(dynamics) f_macro_string_statics_clear(dynamics) + #define f_macro_string_dynamics_clear(dynamics) f_macro_string_statics_t_clear(dynamics) #define f_macro_string_dynamics_new(status, dynamics, length) \ f_macro_string_dynamics_clear(dynamics) \ - status = f_memory_new((void **) & dynamics.array, sizeof(f_string_dynamic), length); \ + status = f_memory_new((void **) & dynamics.array, sizeof(f_string_dynamic_t), length); \ if (status == F_none) { \ dynamics.size = length; \ dynamics.used = 0; \ } - #define f_macro_string_dynamics_delete(status, dynamics) \ + #define f_macro_string_dynamics_t_delete(status, dynamics) \ status = F_none; \ dynamics.used = dynamics.size; \ while (dynamics.used > 0) { \ dynamics.used--; \ - f_macro_string_dynamic_delete(status, dynamics.array[dynamics.used]); \ + f_macro_string_dynamic_t_delete(status, dynamics.array[dynamics.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size); \ + if (status == F_none) status = f_memory_delete((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size); \ if (status == F_none) dynamics.size = 0; - #define f_macro_string_dynamics_destroy(status, dynamics) \ + #define f_macro_string_dynamics_t_destroy(status, dynamics) \ status = F_none; \ dynamics.used = dynamics.size; \ while (dynamics.used > 0) { \ dynamics.used--; \ - f_macro_string_dynamic_destroy(status, dynamics.array[dynamics.used]); \ + f_macro_string_dynamic_t_destroy(status, dynamics.array[dynamics.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_destroy((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size); \ + if (status == F_none) status = f_memory_destroy((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size); \ if (status == F_none) dynamics.size = 0; - #define f_macro_string_dynamics_delete_simple(dynamics) \ + #define f_macro_string_dynamics_t_delete_simple(dynamics) \ dynamics.used = dynamics.size; \ while (dynamics.used > 0) { \ dynamics.used--; \ - f_macro_string_dynamic_delete_simple(dynamics.array[dynamics.used]); \ + f_macro_string_dynamic_t_delete_simple(dynamics.array[dynamics.used]); \ if (dynamics.used == 0) { \ - if (f_memory_delete((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size)) { \ + if (f_memory_delete((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size)) { \ dynamics.size = 0; \ } \ } \ } - #define f_macro_string_dynamics_destroy_simple(dynamics) \ + #define f_macro_string_dynamics_t_destroy_simple(dynamics) \ dynamics.used = dynamics.size; \ while (dynamics.used > 0) { \ dynamics.used--; \ - f_macro_string_dynamic_destroy_simple(dynamics.array[dynamics.used]); \ + f_macro_string_dynamic_t_destroy_simple(dynamics.array[dynamics.used]); \ if (dynamics.used == 0) { \ - if (f_memory_destroy((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size)) { \ + if (f_memory_destroy((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size)) { \ dynamics.size = 0; \ } \ } \ @@ -205,16 +205,16 @@ extern "C" { #define f_macro_string_dynamics_resize(status, dynamics, new_length) \ status = F_none; \ if (new_length < dynamics.size) { \ - for (f_array_length _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \ - f_macro_string_dynamic_delete(status, dynamics.array[_macro__i]); \ + for (f_array_length_t _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \ + f_macro_string_dynamic_t_delete(status, dynamics.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size, new_length); \ if (status == F_none) { \ if (new_length > dynamics.size) { \ - for (f_array_length _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ - memset(&dynamics.array[_macro__i], 0, sizeof(f_string_dynamic)); \ + for (f_array_length_t _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ + memset(&dynamics.array[_macro__i], 0, sizeof(f_string_dynamic_t)); \ } \ } \ dynamics.size = new_length; \ @@ -224,22 +224,22 @@ extern "C" { #define f_macro_string_dynamics_adjust(status, dynamics, new_length) \ status = F_none; \ if (new_length < dynamics.size) { \ - for (f_array_length _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \ - f_macro_string_dynamic_destroy(status, dynamics.array[_macro__i], f_string_dynamic); \ + for (f_array_length_t _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \ + f_macro_string_dynamic_t_destroy(status, dynamics.array[_macro__i], f_string_dynamic_t); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_string_dynamic_t), dynamics.size, new_length); \ if (status == F_none) { \ if (new_length > dynamics.size) { \ - for (f_array_length _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ - memset(&dynamics.array[_macro__i], 0, sizeof(f_string_dynamic)); \ + for (f_array_length_t _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ + memset(&dynamics.array[_macro__i], 0, sizeof(f_string_dynamic_t)); \ } \ } \ dynamics.size = new_length; \ if (dynamics.used > dynamics.size) dynamics.used = new_length; \ } -#endif // _di_f_string_dynamics_ +#endif // _di_f_string_dynamics_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string_map.h b/level_0/f_string/c/string_map.h index bd4781e..b7c4e31 100644 --- a/level_0/f_string/c/string_map.h +++ b/level_0/f_string/c/string_map.h @@ -22,39 +22,39 @@ extern "C" { * name: A string representing the map name. * value: A string representing the map value. */ -#ifndef _di_f_string_map_ +#ifndef _di_f_string_map_t_ typedef struct { - f_string_dynamic name; - f_string_dynamic value; - } f_string_map; + f_string_dynamic_t name; + f_string_dynamic_t value; + } f_string_map_t; - #define f_string_map_initialize { f_string_dynamic_initialize, f_string_dynamic_initialize } + #define f_string_map_t_initialize { f_string_dynamic_t_initialize, f_string_dynamic_t_initialize } - #define f_macro_string_map_clear(map) \ + #define f_macro_string_map_t_clear(map) \ map.array = 0; \ map.size = 0; \ map.used = 0; - #define f_macro_string_map_delete(status, map) \ - f_macro_string_dynamic_delete(status, map.name) \ + #define f_macro_string_map_t_delete(status, map) \ + f_macro_string_dynamic_t_delete(status, map.name) \ if (status == F_none) { \ - f_macro_string_dynamic_delete(status, map.value) \ + f_macro_string_dynamic_t_delete(status, map.value) \ } - #define f_macro_string_map_destroy(status, map) \ - f_macro_string_dynamic_destroy(status, map.name) \ + #define f_macro_string_map_t_destroy(status, map) \ + f_macro_string_dynamic_t_destroy(status, map.name) \ if (status == F_none) { \ - f_macro_string_dynamic_destroy(status, map.value) \ + f_macro_string_dynamic_t_destroy(status, map.value) \ } - #define f_macro_string_map_delete_simple(map) \ - f_macro_string_dynamic_delete_simple(map.name) \ - f_macro_string_dynamic_delete_simple(map.value) + #define f_macro_string_map_t_delete_simple(map) \ + f_macro_string_dynamic_t_delete_simple(map.name) \ + f_macro_string_dynamic_t_delete_simple(map.value) - #define f_macro_string_map_destroy_simple(map) \ - f_macro_string_dynamic_destroy_simple(map.name) \ - f_macro_string_dynamic_destroy_simple(map.value) -#endif // _di_f_string_map_ + #define f_macro_string_map_t_destroy_simple(map) \ + f_macro_string_dynamic_t_destroy_simple(map.name) \ + f_macro_string_dynamic_t_destroy_simple(map.value) +#endif // _di_f_string_map_t_ /** * An array of string maps. @@ -63,113 +63,113 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_string_maps_ +#ifndef _di_f_string_maps_t_ typedef struct { - f_string_map *array; + f_string_map_t *array; - f_array_length size; - f_array_length used; - } f_string_maps; + f_array_length_t size; + f_array_length_t used; + } f_string_maps_t; - #define f_string_maps_initialize f_string_statics_initialize + #define f_string_maps_t_initialize f_string_statics_t_initialize - #define f_macro_string_maps_clear(maps) \ + #define f_macro_string_maps_t_clear(maps) \ maps.array = 0; \ maps.size = 0; \ maps.used = 0; - #define f_macro_string_maps_new(status, maps, length) \ - f_macro_string_maps_clear(maps) \ - status = f_memory_new((void **) & maps.array, sizeof(f_string_map), length); \ + #define f_macro_string_maps_t_new(status, maps, length) \ + f_macro_string_maps_t_clear(maps) \ + status = f_memory_new((void **) & maps.array, sizeof(f_string_map_t), length); \ if (status == F_none) { \ maps.size = length; \ maps.used = 0; \ } - #define f_macro_string_maps_delete(status, maps) \ + #define f_macro_string_maps_t_delete(status, maps) \ status = F_none; \ maps.used = maps.size; \ while (maps.used > 0) { \ maps.used--; \ - f_macro_string_map_delete(status, maps.array[maps.used]); \ + f_macro_string_map_t_delete(status, maps.array[maps.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & maps.array, sizeof(f_string_map), maps.size); \ + if (status == F_none) status = f_memory_delete((void **) & maps.array, sizeof(f_string_map_t), maps.size); \ if (status == F_none) maps.size = 0; - #define f_macro_string_maps_destroy(status, maps) \ + #define f_macro_string_maps_t_destroy(status, maps) \ status = F_none; \ maps.used = maps.size; \ while (maps.used > 0) { \ maps.used--; \ - f_macro_string_map_destroy(status, maps.array[maps.used]); \ + f_macro_string_map_t_destroy(status, maps.array[maps.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_destroy((void **) & maps.array, sizeof(f_string_map), maps.size); \ + if (status == F_none) status = f_memory_destroy((void **) & maps.array, sizeof(f_string_map_t), maps.size); \ if (status == F_none) maps.size = 0; - #define f_macro_string_maps_delete_simple(maps) \ + #define f_macro_string_maps_t_delete_simple(maps) \ maps.used = maps.size; \ while (maps.used > 0) { \ maps.used--; \ - f_macro_string_map_delete_simple(maps.array[maps.used]); \ + f_macro_string_map_t_delete_simple(maps.array[maps.used]); \ if (maps.used == 0) { \ - if (f_memory_delete((void **) & maps.array, sizeof(f_string_map), maps.size)) { \ + if (f_memory_delete((void **) & maps.array, sizeof(f_string_map_t), maps.size)) { \ maps.size = 0; \ } \ } \ } - #define f_macro_string_maps_destroy_simple(maps) \ + #define f_macro_string_maps_t_destroy_simple(maps) \ maps.used = maps.size; \ while (maps.used > 0) { \ maps.used--; \ - f_macro_string_map_destroy_simple(maps.array[maps.used]); \ + f_macro_string_map_t_destroy_simple(maps.array[maps.used]); \ if (maps.used == 0) { \ - if (f_memory_destroy((void **) & maps.array, sizeof(f_string_map), maps.size)) { \ + if (f_memory_destroy((void **) & maps.array, sizeof(f_string_map_t), maps.size)) { \ maps.size = 0; \ } \ } \ } - #define f_macro_string_maps_resize(status, maps, new_length) \ + #define f_macro_string_maps_t_resize(status, maps, new_length) \ status = F_none; \ if (new_length < maps.size) { \ - for (f_array_length _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \ - f_macro_string_map_delete(status, maps.array[_macro__i]); \ + for (f_array_length_t _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \ + f_macro_string_map_t_delete(status, maps.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & maps.array, sizeof(f_string_map), maps.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & maps.array, sizeof(f_string_map_t), maps.size, new_length); \ if (status == F_none) { \ if (new_length > maps.size) { \ - for (f_array_length _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ - memset(&maps.array[_macro__i], 0, sizeof(f_string_map)); \ + for (f_array_length_t _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ + memset(&maps.array[_macro__i], 0, sizeof(f_string_map_t)); \ } \ } \ maps.size = new_length; \ if (maps.used > maps.size) maps.used = new_length; \ } - #define f_macro_string_maps_adjust(status, maps, new_length) \ + #define f_macro_string_maps_t_adjust(status, maps, new_length) \ status = F_none; \ if (new_length < maps.size) { \ - for (f_array_length _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \ - f_macro_string_map_destroy(status, maps.array[_macro__i], f_string_map); \ + for (f_array_length_t _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \ + f_macro_string_map_t_destroy(status, maps.array[_macro__i], f_string_map_t); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & maps.array, sizeof(f_string_map), maps.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & maps.array, sizeof(f_string_map_t), maps.size, new_length); \ if (status == F_none) { \ if (new_length > maps.size) { \ - for (f_array_length _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ - memset(&maps.array[_macro__i], 0, sizeof(f_string_map)); \ + for (f_array_length_t _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ + memset(&maps.array[_macro__i], 0, sizeof(f_string_map_t)); \ } \ } \ maps.size = new_length; \ if (maps.used > maps.size) maps.used = new_length; \ } -#endif // _di_f_string_maps_ +#endif // _di_f_string_maps_t_ /** * A string map consisting of a name and multiple values. @@ -177,38 +177,38 @@ extern "C" { * name: A string representing the map name. * value: An array of strings representing the map value. */ -#ifndef _di_f_string_map_multi_ +#ifndef _di_f_string_map_multi_t_ typedef struct { - f_string_dynamic name; - f_string_dynamics value; - } f_string_map_multi; + f_string_dynamic_t name; + f_string_dynamics_t value; + } f_string_map_multi_t; - #define f_string_map_multi_initialize { f_string_dynamic_initialize, f_string_dynamics_initialize } + #define f_string_map_multi_t_initialize { f_string_dynamic_t_initialize, f_string_dynamics_t_initialize } - #define f_macro_string_map_multi_clear(map) \ - f_macro_string_dynamic_clear(map.name) \ + #define f_macro_string_map_multi_t_clear(map) \ + f_macro_string_dynamic_t_clear(map.name) \ f_macro_string_dynamics_clear(map.value) - #define f_macro_string_map_multi_delete(status, map) \ - f_macro_string_dynamic_delete(status, map.name) \ + #define f_macro_string_map_multi_t_delete(status, map) \ + f_macro_string_dynamic_t_delete(status, map.name) \ if (status == F_none) { \ - f_macro_string_dynamics_delete(status, map.value) \ + f_macro_string_dynamics_t_delete(status, map.value) \ } - #define f_macro_string_map_multi_destroy(status, map) \ - f_macro_string_dynamic_destroy(status, map.name) \ + #define f_macro_string_map_multi_t_destroy(status, map) \ + f_macro_string_dynamic_t_destroy(status, map.name) \ if (status == F_none) { \ - f_macro_string_dynamics_destroy(status, map.value) \ + f_macro_string_dynamics_t_destroy(status, map.value) \ } - #define f_macro_string_map_multi_delete_simple(map) \ - f_macro_string_dynamic_delete_simple(map.name) \ - f_macro_string_dynamics_delete_simple(map.value) + #define f_macro_string_map_multi_t_delete_simple(map) \ + f_macro_string_dynamic_t_delete_simple(map.name) \ + f_macro_string_dynamics_t_delete_simple(map.value) - #define f_macro_string_map_multi_destroy_simple(map) \ - f_macro_string_dynamic_destroy_simple(map.name) \ - f_macro_string_dynamics_destroy_simple(map.value) -#endif // _di_f_string_map_multi_ + #define f_macro_string_map_multi_t_destroy_simple(map) \ + f_macro_string_dynamic_t_destroy_simple(map.name) \ + f_macro_string_dynamics_t_destroy_simple(map.value) +#endif // _di_f_string_map_multi_t_ /** * An array of string maps. @@ -217,110 +217,110 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_string_map_multis_ +#ifndef _di_f_string_map_multis_t_ typedef struct { - f_string_map_multi *array; + f_string_map_multi_t *array; - f_array_length size; - f_array_length used; - } f_string_map_multis; + f_array_length_t size; + f_array_length_t used; + } f_string_map_multis_t; - #define f_string_map_multis_initialize f_string_statics_initialize + #define f_string_map_multis_t_initialize f_string_statics_t_initialize - #define f_macro_string_map_multis_clear(maps) f_macro_string_statics_clear(maps) + #define f_macro_string_map_multis_t_clear(maps) f_macro_string_statics_t_clear(maps) - #define f_macro_string_map_multis_new(status, maps, length) \ - f_macro_string_map_multis_clear(maps) \ - status = f_memory_new((void **) & maps.array, sizeof(f_string_map_multi), length); \ + #define f_macro_string_map_multis_t_new(status, maps, length) \ + f_macro_string_map_multis_t_clear(maps) \ + status = f_memory_new((void **) & maps.array, sizeof(f_string_map_multi_t), length); \ if (status == F_none) { \ maps.size = length; \ maps.used = 0; \ } - #define f_macro_string_map_multis_delete(status, maps) \ + #define f_macro_string_map_multis_t_delete(status, maps) \ status = F_none; \ maps.used = maps.size; \ while (maps.used > 0) { \ maps.used--; \ - f_macro_string_map_multi_delete(status, maps.array[maps.used]); \ + f_macro_string_map_multi_t_delete(status, maps.array[maps.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & maps.array, sizeof(f_string_map_multi), maps.size); \ + if (status == F_none) status = f_memory_delete((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size); \ if (status == F_none) maps.size = 0; - #define f_macro_string_map_multis_destroy(status, maps) \ + #define f_macro_string_map_multis_t_destroy(status, maps) \ status = F_none; \ maps.used = maps.size; \ while (maps.used > 0) { \ maps.used--; \ - f_macro_string_map_multi_destroy(status, maps.array[maps.used]); \ + f_macro_string_map_multi_t_destroy(status, maps.array[maps.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_destroy((void **) & maps.array, sizeof(f_string_map_multi), maps.size); \ + if (status == F_none) status = f_memory_destroy((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size); \ if (status == F_none) maps.size = 0; - #define f_macro_string_map_multis_delete_simple(maps) \ + #define f_macro_string_map_multis_t_delete_simple(maps) \ maps.used = maps.size; \ while (maps.used > 0) { \ maps.used--; \ - f_macro_string_map_multi_delete_simple(maps.array[maps.used]); \ + f_macro_string_map_multi_t_delete_simple(maps.array[maps.used]); \ if (maps.used == 0) { \ - if (f_memory_delete((void **) & maps.array, sizeof(f_string_map_multi), maps.size)) { \ + if (f_memory_delete((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size)) { \ maps.size = 0; \ } \ } \ } - #define f_macro_string_map_multis_destroy_simple(maps) \ + #define f_macro_string_map_multis_t_destroy_simple(maps) \ maps.used = maps.size; \ while (maps.used > 0) { \ maps.used--; \ - f_macro_string_map_multi_destroy_simple(maps.array[maps.used]); \ + f_macro_string_map_multi_t_destroy_simple(maps.array[maps.used]); \ if (maps.used == 0) { \ - if (f_memory_destroy((void **) & maps.array, sizeof(f_string_map_multi), maps.size)) { \ + if (f_memory_destroy((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size)) { \ maps.size = 0; \ } \ } \ } - #define f_macro_string_map_multis_resize(status, maps, new_length) \ + #define f_macro_string_map_multis_t_resize(status, maps, new_length) \ status = F_none; \ if (new_length < maps.size) { \ - for (f_array_length _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \ - f_macro_string_map_multi_delete(status, maps.array[_macro__i]); \ + for (f_array_length_t _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \ + f_macro_string_map_multi_t_delete(status, maps.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & maps.array, sizeof(f_string_map_multi), maps.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size, new_length); \ if (status == F_none) { \ if (new_length > maps.size) { \ - for (f_array_length _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ - memset(&maps.array[_macro__i], 0, sizeof(f_string_map_multi)); \ + for (f_array_length_t _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ + memset(&maps.array[_macro__i], 0, sizeof(f_string_map_multi_t)); \ } \ } \ maps.size = new_length; \ if (maps.used > maps.size) maps.used = new_length; \ } - #define f_macro_string_map_multis_adjust(status, maps, new_length) \ + #define f_macro_string_map_multis_t_adjust(status, maps, new_length) \ status = F_none; \ if (new_length < maps.size) { \ - for (f_array_length _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \ - f_macro_string_map_multi_destroy(status, maps.array[_macro__i], f_string_map_multi); \ + for (f_array_length_t _macro__i = maps.size - new_length; _macro__i < maps.size; _macro__i++) { \ + f_macro_string_map_multi_t_destroy(status, maps.array[_macro__i], f_string_map_multi_t); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & maps.array, sizeof(f_string_map_multi), maps.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & maps.array, sizeof(f_string_map_multi_t), maps.size, new_length); \ if (status == F_none) { \ if (new_length > maps.size) { \ - for (f_array_length _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ - memset(&maps.array[_macro__i], 0, sizeof(f_string_map_multi)); \ + for (f_array_length_t _macro__i = maps.size; _macro__i < new_length; _macro__i++) { \ + memset(&maps.array[_macro__i], 0, sizeof(f_string_map_multi_t)); \ } \ } \ maps.size = new_length; \ if (maps.used > maps.size) maps.used = new_length; \ } -#endif // _di_f_string_map_multis_ +#endif // _di_f_string_map_multis_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string_quantity.h b/level_0/f_string/c/string_quantity.h index 0e69504..789555b 100644 --- a/level_0/f_string/c/string_quantity.h +++ b/level_0/f_string/c/string_quantity.h @@ -19,7 +19,7 @@ extern "C" { /** * Store string quantity. * - * Similar to f_string_range, except total is relative to start and is not an absolute stop position. + * Similar to f_string_range_t, except total is relative to start and is not an absolute stop position. * * Two common uses for when total is 0 is: * 1) Exactly that, process a total of 0 strings bytes. @@ -28,14 +28,14 @@ extern "C" { * start: The position where the string starts (based on some string/buffer). * total: The total number of elements within that string/buffer the quantity represents. */ -#ifndef _di_f_string_quantity_ +#ifndef _di_f_string_quantity_t_ typedef struct { - f_string_length start; - f_string_length total; - } f_string_quantity; + f_string_length_t start; + f_string_length_t total; + } f_string_quantity_t; - #define f_string_quantity_initialize { 0, 0 } -#endif // _di_f_string_quantity_ + #define f_string_quantity_t_initialize { 0, 0 } +#endif // _di_f_string_quantity_t_ /** * An array of string quantities. @@ -44,29 +44,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_string_quantitys_ +#ifndef _di_f_string_quantitys_t_ typedef struct { - f_string_quantity *array; + f_string_quantity_t *array; - f_array_length size; - f_array_length used; - } f_string_quantitys; + f_array_length_t size; + f_array_length_t used; + } f_string_quantitys_t; - #define f_string_quantitys_initialize {0, 0, 0} + #define f_string_quantitys_t_initialize {0, 0, 0} - #define f_macro_string_quantitys_clear(quantitys) f_macro_memory_structure_clear(quantitys) + #define f_macro_string_quantitys_t_clear(quantitys) f_macro_memory_structure_t_clear(quantitys) - #define f_macro_string_quantitys_new(status, quantitys, length) f_macro_memory_structure_new(status, quantitys, f_string_quantity, length) + #define f_macro_string_quantitys_t_new(status, quantitys, length) f_macro_memory_structure_t_new(status, quantitys, f_string_quantity_t, length) - #define f_macro_string_quantitys_delete(status, quantitys) f_macro_memory_structure_delete(status, quantitys, f_string_quantity) - #define f_macro_string_quantitys_destroy(status, quantitys) f_macro_memory_structure_destroy(status, quantitys, f_string_quantity) + #define f_macro_string_quantitys_t_delete(status, quantitys) f_macro_memory_structure_t_delete(status, quantitys, f_string_quantity_t) + #define f_macro_string_quantitys_t_destroy(status, quantitys) f_macro_memory_structure_t_destroy(status, quantitys, f_string_quantity_t) - #define f_macro_string_quantitys_delete_simple(quantitys) f_macro_memory_structure_delete_simple(quantitys, f_string_quantity) - #define f_macro_string_quantitys_destroy_simple(quantitys) f_macro_memory_structure_destroy_simple(quantitys, f_string_quantity) + #define f_macro_string_quantitys_t_delete_simple(quantitys) f_macro_memory_structure_t_delete_simple(quantitys, f_string_quantity_t) + #define f_macro_string_quantitys_t_destroy_simple(quantitys) f_macro_memory_structure_t_destroy_simple(quantitys, f_string_quantity_t) - #define f_macro_string_quantitys_resize(status, quantitys, new_length) f_macro_memory_structure_resize(status, quantitys, f_string_quantity, new_length) - #define f_macro_string_quantitys_adjust(status, quantitys, new_length) f_macro_memory_structure_adjust(status, quantitys, f_string_quantity, new_length) -#endif // _di_f_string_quantitys_ + #define f_macro_string_quantitys_t_resize(status, quantitys, new_length) f_macro_memory_structure_t_resize(status, quantitys, f_string_quantity_t, new_length) + #define f_macro_string_quantitys_t_adjust(status, quantitys, new_length) f_macro_memory_structure_t_adjust(status, quantitys, f_string_quantity_t, new_length) +#endif // _di_f_string_quantitys_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string_range.h b/level_0/f_string/c/string_range.h index c3460b3..f9a2fc6 100644 --- a/level_0/f_string/c/string_range.h +++ b/level_0/f_string/c/string_range.h @@ -28,11 +28,11 @@ extern "C" { * start: the start position. * stop: the stop position. */ -#ifndef _di_f_string_range_ +#ifndef _di_f_string_range_t_ typedef struct { - f_string_length start; - f_string_length stop; - } f_string_range; + f_string_length_t start; + f_string_length_t stop; + } f_string_range_t; #define f_string_range_initialize { 1, 0 } @@ -41,7 +41,7 @@ extern "C" { #define f_macro_string_range_clear(range) \ range.start = 1; \ range.stop = 0; -#endif // _di_f_string_range_ +#endif // _di_f_string_range_t_ /** * An array of string ranges. @@ -50,60 +50,60 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_string_ranges_ +#ifndef _di_f_string_ranges_t_ typedef struct { - f_string_range *array; + f_string_range_t *array; - f_array_length size; - f_array_length used; - } f_string_ranges; + f_array_length_t size; + f_array_length_t used; + } f_string_ranges_t; - #define f_string_ranges_initialize {0, 0, 0} + #define f_string_ranges_t_initialize {0, 0, 0} - #define f_macro_string_ranges_clear(ranges) f_macro_memory_structure_clear(ranges) + #define f_macro_string_ranges_t_clear(ranges) f_macro_memory_structure_t_clear(ranges) - #define f_macro_string_ranges_new(status, ranges, length) f_macro_memory_structure_new(status, ranges, f_string_range, length) + #define f_macro_string_ranges_t_new(status, ranges, length) f_macro_memory_structure_t_new(status, ranges, f_string_range_t, length) - #define f_macro_string_ranges_delete(status, ranges) f_macro_memory_structure_delete(status, ranges, f_string_range) - #define f_macro_string_ranges_destroy(status, ranges) f_macro_memory_structure_destroy(status, ranges, f_string_range) + #define f_macro_string_ranges_t_delete(status, ranges) f_macro_memory_structure_t_delete(status, ranges, f_string_range_t) + #define f_macro_string_ranges_t_destroy(status, ranges) f_macro_memory_structure_t_destroy(status, ranges, f_string_range_t) - #define f_macro_string_ranges_delete_simple(ranges) f_macro_memory_structure_delete_simple(ranges, f_string_range) - #define f_macro_string_ranges_destroy_simple(ranges) f_macro_memory_structure_destroy_simple(ranges, f_string_range) + #define f_macro_string_ranges_t_delete_simple(ranges) f_macro_memory_structure_t_delete_simple(ranges, f_string_range_t) + #define f_macro_string_ranges_t_destroy_simple(ranges) f_macro_memory_structure_t_destroy_simple(ranges, f_string_range_t) - #define f_macro_string_ranges_resize(status, ranges, new_length) f_macro_memory_structure_resize(status, ranges, f_string_range, new_length) - #define f_macro_string_ranges_adjust(status, ranges, new_length) f_macro_memory_structure_adjust(status, ranges, f_string_range, new_length) -#endif // _di_f_string_ranges_ + #define f_macro_string_ranges_t_resize(status, ranges, new_length) f_macro_memory_structure_t_resize(status, ranges, f_string_range_t, new_length) + #define f_macro_string_ranges_t_adjust(status, ranges, new_length) f_macro_memory_structure_t_adjust(status, ranges, f_string_range_t, new_length) +#endif // _di_f_string_ranges_t_ /** - * This holds an array of f_string_ranges. + * This holds an array of f_string_ranges_t. * * array: The array of ranges arrays. * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_f_string_rangess_ +#ifndef _di_f_string_rangess_t_ typedef struct { - f_string_ranges *array; + f_string_ranges_t *array; - f_array_length size; - f_array_length used; - } f_string_rangess; + f_array_length_t size; + f_array_length_t used; + } f_string_rangess_t; - #define f_string_rangess_initialize { 0, 0, 0 } + #define f_string_rangess_t_initialize { 0, 0, 0 } - #define f_macro_string_rangess_clear(rangess) f_macro_memory_structures_clear(rangess) + #define f_macro_string_rangess_t_clear(rangess) f_macro_memory_structures_t_clear(rangess) - #define f_macro_string_rangess_new(status, rangess, length) f_macro_memory_structures_new(status, rangess, f_string_ranges, length) + #define f_macro_string_rangess_t_new(status, rangess, length) f_macro_memory_structures_t_new(status, rangess, f_string_ranges_t, length) - #define f_macro_string_rangess_delete(status, rangess) f_macro_memory_structures_delete(status, rangess, f_string_range, f_string_ranges) - #define f_macro_string_rangess_destroy(status, rangess) f_macro_memory_structures_destroy(status, rangess, f_string_range, f_string_ranges) + #define f_macro_string_rangess_t_delete(status, rangess) f_macro_memory_structures_t_delete(status, rangess, f_string_range_t, f_string_ranges_t) + #define f_macro_string_rangess_t_destroy(status, rangess) f_macro_memory_structures_t_destroy(status, rangess, f_string_range_t, f_string_ranges_t) - #define f_macro_string_rangess_delete_simple(rangess) f_macro_memory_structures_delete_simple(rangess, f_string_range, f_string_ranges) - #define f_macro_string_rangess_destroy_simple(rangess) f_macro_memory_structures_destroy_simple(rangess, f_string_range, f_string_ranges) + #define f_macro_string_rangess_t_delete_simple(rangess) f_macro_memory_structures_t_delete_simple(rangess, f_string_range_t, f_string_ranges_t) + #define f_macro_string_rangess_t_destroy_simple(rangess) f_macro_memory_structures_t_destroy_simple(rangess, f_string_range_t, f_string_ranges_t) - #define f_macro_string_rangess_resize(status, rangess, new_length) f_macro_memory_structures_resize(status, rangess, f_string_range, f_string_ranges, new_length, f_array_length) - #define f_macro_string_rangess_adjust(status, rangess, new_length) f_macro_memory_structures_adjust(status, rangess, f_string_range, f_string_ranges, new_length, f_array_length) -#endif // _di_f_string_rangess_ + #define f_macro_string_rangess_t_resize(status, rangess, new_length) f_macro_memory_structures_t_resize(status, rangess, f_string_range_t, f_string_ranges_t, new_length, f_array_length_t) + #define f_macro_string_rangess_t_adjust(status, rangess, new_length) f_macro_memory_structures_t_adjust(status, rangess, f_string_range_t, f_string_ranges_t, new_length, f_array_length_t) +#endif // _di_f_string_rangess_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_type/c/type.h b/level_0/f_type/c/type.h index edb8cc9..ef82680 100644 --- a/level_0/f_type/c/type.h +++ b/level_0/f_type/c/type.h @@ -23,20 +23,20 @@ extern "C" { /** * Status type. */ -#ifndef _di_f_type_status_ - typedef uint16_t f_status; +#ifndef _di_f_type_status_t_ + typedef uint16_t f_status_t; /** * The c language gives warnings about return types of constants. * Remove the const for c, but keep it for c++, which is only for function call declarations & prototypes. - * Do not declare these for the return data types themselves, instead use f_status; only use these for function prototypes and declarations. + * Do not declare these for the return data types themselves, instead use f_status_t; only use these for function prototypes and declarations. */ #ifdef __cplusplus - #define f_return_status const f_status + #define f_return_status const f_status_t #else - #define f_return_status f_status + #define f_return_status f_status_t #endif // __cplusplus -#endif // _di_f_type_status_ +#endif // _di_f_type_status_t_ /** * Conditional 128-bit support. @@ -44,15 +44,15 @@ extern "C" { * This should work in GCC, but other compilers this may not be available. * When not supported, these will fallback to 64-bit. */ -#ifndef _di_f_type_int_128_ +#ifndef _di_f_type_int_128_t_ #ifdef __SIZEOF_INT128__ - typedef __int128_t f_int_128; - typedef __uint128_t f_uint_128; + typedef __int128_t f_int_128_t; + typedef __uint128_t f_uint_128_t; #else - typedef int64_t f_int_128; - typedef uint64_t f_uint_128; + typedef int64_t f_int_128_t; + typedef uint64_t f_uint_128_t; #endif // __SIZEOF_INT128__ -#endif // _di_f_type_int_128_ +#endif // _di_f_type_int_128_t_ /** * Defines the maximum size to be supported. @@ -85,7 +85,7 @@ extern "C" { #define f_type_size_64_positive 0x7ffffffffffffffe #define f_type_size_64_unsigned 0xfffffffffffffffe - #ifndef _di_f_type_int_128_ + #ifndef _di_f_type_int_128_t_ #define f_type_size_128_negative 0x7fffffffffffffffffffffff #define f_type_size_128_positive 0x7ffffffffffffffffffffffe #define f_type_size_128_unsigned 0xfffffffffffffffffffffffe @@ -93,7 +93,7 @@ extern "C" { #define f_type_size_128_negative f_type_size_64_negative #define f_type_size_128_positive f_type_size_64_positive #define f_type_size_128_unsigned f_type_size_64_unsigned - #endif // _di_f_type_int_128_ + #endif // _di_f_type_int_128_t_ #define f_type_size_max_8_negative 0x80 #define f_type_size_max_8_positive 0x7f @@ -111,7 +111,7 @@ extern "C" { #define f_type_size_max_64_positive 0x7fffffffffffffff #define f_type_size_max_64_unsigned 0xffffffffffffffff - #ifndef _di_f_type_int_128_ + #ifndef _di_f_type_int_128_t_ #define f_type_size_max_128_negative 0x800000000000000000000000 #define f_type_size_max_128_positive 0x7fffffffffffffffffffffff #define f_type_size_max_128_unsigned 0xffffffffffffffffffffffff @@ -119,7 +119,7 @@ extern "C" { #define f_type_size_max_128_negative f_type_size_max_64_negative #define f_type_size_max_128_positive f_type_size_max_64_positive #define f_type_size_max_128_unsigned f_type_size_max_64_unsigned - #endif // _di_f_type_int_128_ + #endif // _di_f_type_int_128_t_ #endif // _di_f_type_sizes_ /** @@ -132,44 +132,44 @@ extern "C" { * * 64-bit is the designed default. */ -#ifndef _di_f_type_number_64_ - typedef int64_t f_number_signed; - typedef uint64_t f_number_unsigned; +#ifndef _di_f_type_number_64_t_ + typedef int64_t f_number_signed_t; + typedef uint64_t f_number_unsigned_t; - #define f_type_number_size_unsigned f_type_size_64_unsigned - #define f_type_number_size_positive f_type_size_64_positive - #define f_type_number_size_negative f_type_size_64_negative + #define f_number_t_size_unsigned f_type_size_64_unsigned + #define f_number_t_size_positive f_type_size_64_positive + #define f_number_t_size_negative f_type_size_64_negative - #define f_type_number_size_max_unsigned f_type_size_max_64_unsigned - #define f_type_number_size_max_positive f_type_size_max_64_positive - #define f_type_number_size_max_negative f_type_size_max_64_negative -#endif // _di_f_type_number_64_ + #define f_number_t_size_max_unsigned f_type_size_max_64_unsigned + #define f_number_t_size_max_positive f_type_size_max_64_positive + #define f_number_t_size_max_negative f_type_size_max_64_negative +#endif // _di_f_type_number_64_t_ -#ifdef _en_f_type_number_32_ - typedef int32_t f_number_signed; - typedef uint32_t f_number_unsigned; +#ifdef _en_f_type_number_32_t_ + typedef int32_t f_number_signed_t; + typedef uint32_t f_number_unsigned_t; - #define f_type_number_size_unsigned f_type_size_32_unsigned - #define f_type_number_size_positive f_type_size_32_positive - #define f_type_number_size_negative f_type_size_32_negative + #define f_number_t_size_unsigned f_type_size_32_unsigned + #define f_number_t_size_positive f_type_size_32_positive + #define f_number_t_size_negative f_type_size_32_negative - #define f_type_number_size_max_unsigned f_type_size_max_32_unsigned - #define f_type_number_size_max_positive f_type_size_max_32_positive - #define f_type_number_size_max_negative f_type_size_max_32_negative -#endif // _en_f_type_number_32_ + #define f_number_t_size_max_unsigned f_type_size_max_32_unsigned + #define f_number_t_size_max_positive f_type_size_max_32_positive + #define f_number_t_size_max_negative f_type_size_max_32_negative +#endif // _en_f_type_number_32_t_ -#ifdef _en_f_type_number_128_ - typedef f_int_128 f_number_signed; - typedef f_uint_128 f_number_unsigned; +#ifdef _en_f_type_number_128_t_ + typedef f_int_128_t f_number_signed_t; + typedef f_uint_128_t f_number_unsigned_t; - #define f_type_number_size_unsigned f_type_size_128_unsigned - #define f_type_number_size_positive f_type_size_128_positive - #define f_type_number_size_negative f_type_size_128_negative + #define f_number_t_size_unsigned f_type_size_128_unsigned + #define f_number_t_size_positive f_type_size_128_positive + #define f_number_t_size_negative f_type_size_128_negative - #define f_type_number_size_max_unsigned f_type_size_max_128_unsigned - #define f_type_number_size_max_positive f_type_size_max_128_positive - #define f_type_number_size_max_negative f_type_size_max_128_negative -#endif // _en_f_type_number_128_ + #define f_number_t_size_max_unsigned f_type_size_max_128_unsigned + #define f_number_t_size_max_positive f_type_size_max_128_positive + #define f_number_t_size_max_negative f_type_size_max_128_negative +#endif // _en_f_type_number_128_t_ /** * Standard Input/Output types. @@ -194,12 +194,12 @@ extern "C" { /** * Defines a variable to be used by arrays. */ -#ifndef _di_f_array_ - typedef f_number_unsigned f_array_length; +#ifndef _di_f_array_t_ + typedef f_number_unsigned_t f_array_length_t; - #define f_array_length_size f_type_number_size_unsigned - #define f_array_length_size_max f_type_number_size_max_unsigned -#endif // _di_f_array_ + #define f_array_length_t_size f_number_t_size_unsigned + #define f_array_length_t_size_max f_number_t_size_max_unsigned +#endif // _di_f_array_t_ /** * A structure designating a row and column, just like a cell in a table. @@ -207,18 +207,18 @@ extern "C" { * row: the row position. * column: the column position. */ -#ifndef _di_f_cell_ +#ifndef _di_f_cell_t_ typedef struct { - f_array_length row; - f_array_length column; - } f_cell; + f_array_length_t row; + f_array_length_t column; + } f_cell_t; - #define f_cell_initialize { 0, 0 } + #define f_cell_t_initialize { 0, 0 } - #define f_macro_cell_clear(cell) \ + #define f_macro_cell_t_clear(cell) \ cell.row = 0; \ cell.column = 0; -#endif // _di_f_cell_ +#endif // _di_f_cell_t_ /** * GCC-specific features. @@ -234,11 +234,10 @@ extern "C" { #define f_gcc_attribute_visibility_protected __attribute__((visibility("protected"))) #endif // _di_f_gcc_specific_ - /** * A structure representing a set of modes intended to be used by file or directory operations. */ -#ifndef _di_f_mode_ +#ifndef _di_f_mode_t_ typedef struct { mode_t block; // S_IFBLK mode_t character; // S_IFCHR @@ -248,9 +247,9 @@ extern "C" { mode_t link; // S_IFLNK mode_t socket; // S_IFSOCK mode_t unknown; - } f_mode; + } f_mode_t; - #define f_mode_initialize { \ + #define f_mode_t_initialize { \ 0, \ 0, \ 0, \ @@ -261,7 +260,7 @@ extern "C" { 0, \ } - #define f_macro_mode_set_default(mode) \ + #define f_macro_mode_t_set_default(mode) \ mode.block = f_file_mode_all_rw; \ mode.character = f_file_mode_all_rw; \ mode.directory = f_file_mode_all_rwx; \ @@ -271,7 +270,7 @@ extern "C" { mode.socket = f_file_mode_all_rw; \ mode.unknown = f_file_mode_all_rw; - #define f_macro_mode_set_default_umask(mode, mask) \ + #define f_macro_mode_t_set_default_umask(mode, mask) \ mode.block = f_file_mode_all_rw & ~mask; \ mode.character = f_file_mode_all_rw & ~mask; \ mode.directory = f_file_mode_all_rwx & ~mask; \ @@ -281,7 +280,7 @@ extern "C" { mode.socket = f_file_mode_all_rw & ~mask; \ mode.unknown = f_file_mode_all_rw & ~mask; - #define f_macro_mode_set_all(mode, value) \ + #define f_macro_mode_t_set_all(mode, value) \ mode.block = value; \ mode.character = value; \ mode.directory = value; \ @@ -291,12 +290,12 @@ extern "C" { mode.socket = value; \ mode.unknown = value; - #define f_macro_mode_set_common(mode, value_directory, value_file, value_link) \ + #define f_macro_mode_t_set_common(mode, value_directory, value_file, value_link) \ mode.directory = value_directory; \ mode.regular = value_file; \ mode.link = value_link; - #define f_macro_mode_set_uncommon(mode, value_block, value_character, value_fifo, value_socket, value_unknown) \ + #define f_macro_mode_t_set_uncommon(mode, value_block, value_character, value_fifo, value_socket, value_unknown) \ mode.block = value_block; \ mode.character = value_character; \ mode.fifo = value_fifo; \ diff --git a/level_0/f_type/c/type_array.h b/level_0/f_type/c/type_array.h index ae93bc0..a9f6563 100644 --- a/level_0/f_type/c/type_array.h +++ b/level_0/f_type/c/type_array.h @@ -27,29 +27,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_f_array_lengths_ +#ifndef _di_f_array_t_lengths_t_ typedef struct { - f_array_length *array; + f_array_length_t *array; - f_array_length size; - f_array_length used; - } f_array_lengths; + f_array_length_t size; + f_array_length_t used; + } f_array_lengths_t; - #define f_array_lengths_initialize { 0, 0, 0 } + #define f_array_lengths_t_initialize { 0, 0, 0 } - #define f_macro_array_lengths_clear(lengths) f_macro_memory_structure_clear(lengths) + #define f_macro_array_lengths_t_clear(lengths) f_macro_memory_structure_t_clear(lengths) - #define f_macro_array_lengths_new(status, lengths, length) f_macro_memory_structure_new(status, lengths, f_array_length, length) + #define f_macro_array_lengths_t_new(status, lengths, length) f_macro_memory_structure_t_new(status, lengths, f_array_length_t, length) - #define f_macro_array_lengths_delete(status, lengths) f_macro_memory_structure_delete(status, lengths, f_array_length) - #define f_macro_array_lengths_destroy(status, lengths) f_macro_memory_structure_destroy(status, lengths, f_array_length) + #define f_macro_array_lengths_t_delete(status, lengths) f_macro_memory_structure_t_delete(status, lengths, f_array_length_t) + #define f_macro_array_lengths_t_destroy(status, lengths) f_macro_memory_structure_t_destroy(status, lengths, f_array_length_t) - #define f_macro_array_lengths_delete_simple(lengths) f_macro_memory_structure_delete_simple(lengths, f_array_length) - #define f_macro_array_lengths_destroy_simple(lengths) f_macro_memory_structure_destroy_simple(lengths, f_array_length) + #define f_macro_array_lengths_t_delete_simple(lengths) f_macro_memory_structure_t_delete_simple(lengths, f_array_length_t) + #define f_macro_array_lengths_t_destroy_simple(lengths) f_macro_memory_structure_t_destroy_simple(lengths, f_array_length_t) - #define f_macro_array_lengths_resize(status, lengths, new_length) f_macro_memory_structure_resize(status, lengths, f_array_length, new_length) - #define f_macro_array_lengths_adjust(status, lengths, new_length) f_macro_memory_structure_adjust(status, lengths, f_array_length, new_length) -#endif // _di_f_array_lengths_ + #define f_macro_array_lengths_t_resize(status, lengths, new_length) f_macro_memory_structure_t_resize(status, lengths, f_array_length_t, new_length) + #define f_macro_array_lengths_t_adjust(status, lengths, new_length) f_macro_memory_structure_t_adjust(status, lengths, f_array_length_t, new_length) +#endif // _di_f_array_t_lengths_t_ /** * An array of an array of array lengths. @@ -58,91 +58,91 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_array_lengthss_ +#ifndef _di_f_array_t_lengthss_t_ typedef struct { - f_array_lengths *array; + f_array_lengths_t *array; - f_array_length size; - f_array_length used; - } f_array_lengthss; + f_array_length_t size; + f_array_length_t used; + } f_array_lengthss_t; - #define f_array_lengthss_initialize { 0, 0, 0 } + #define f_array_lengthss_t_initialize { 0, 0, 0 } - #define f_macro_array_lengthss_clear(lengths) f_macro_memory_structures_clear(lengths) + #define f_macro_array_lengthss_t_clear(lengths) f_macro_memory_structures_t_clear(lengths) - #define f_macro_array_lengthss_new(status, lengths, length) f_macro_memory_structures_new(status, lengths, f_array_length, length) + #define f_macro_array_lengthss_t_new(status, lengths, length) f_macro_memory_structures_t_new(status, lengths, f_array_length_t, length) - #define f_macro_array_lengthss_delete(status, lengths) f_macro_memory_structures_delete(status, lengths, f_array_length, f_array_lengths) - #define f_macro_array_lengthss_destroy(status, lengths) f_macro_memory_structures_destroy(status, lengths, f_array_length, f_array_lengths) + #define f_macro_array_lengthss_t_delete(status, lengths) f_macro_memory_structures_t_delete(status, lengths, f_array_length_t, f_array_lengths_t) + #define f_macro_array_lengthss_t_destroy(status, lengths) f_macro_memory_structures_t_destroy(status, lengths, f_array_length_t, f_array_lengths_t) - #define f_macro_array_lengthss_delete_simple(lengths) f_macro_memory_structures_delete_simple(lengths, f_array_length, f_array_lengths) - #define f_macro_array_lengthss_destroy_simple(lengths) f_macro_memory_structures_destroy_simple(lengths, f_array_length, f_array_lengths) + #define f_macro_array_lengthss_t_delete_simple(lengths) f_macro_memory_structures_t_delete_simple(lengths, f_array_length_t, f_array_lengths_t) + #define f_macro_array_lengthss_t_destroy_simple(lengths) f_macro_memory_structures_t_destroy_simple(lengths, f_array_length_t, f_array_lengths_t) - #define f_macro_array_lengthss_resize(status, lengths, new_length) f_macro_memory_structures_resize(status, lengths, f_array_length, f_array_lengths, new_length, f_array_length) - #define f_macro_array_lengthss_adjust(status, lengths, new_length) f_macro_memory_structures_adjust(status, lengths, f_array_length, f_array_lengths, new_length, f_array_length) -#endif // _di_f_array_lengthss_ + #define f_macro_array_lengthss_t_resize(status, lengths, new_length) f_macro_memory_structures_t_resize(status, lengths, f_array_length_t, f_array_lengths_t, new_length, f_array_length_t) + #define f_macro_array_lengthss_t_adjust(status, lengths, new_length) f_macro_memory_structures_t_adjust(status, lengths, f_array_length_t, f_array_lengths_t, new_length, f_array_length_t) +#endif // _di_f_array_t_lengthss_t_ /** - * An array of f_cell. + * An array of f_cell_t. * - * array: the array of f_cell. + * array: the array of f_cell_t. * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_cells_ +#ifndef _di_f_cells_t_ typedef struct { - f_cell *array; + f_cell_t *array; - f_array_length size; - f_array_length used; - } f_cells; + f_array_length_t size; + f_array_length_t used; + } f_cells_t; - #define f_cells_initialize {0, 0, 0} + #define f_cells_t_initialize {0, 0, 0} - #define f_macro_cells_clear(ranges) f_macro_memory_structure_clear(ranges) + #define f_macro_cells_t_clear(ranges) f_macro_memory_structure_t_clear(ranges) - #define f_macro_cells_new(status, ranges, length) f_macro_memory_structure_new(status, ranges, f_cell, length) + #define f_macro_cells_t_new(status, ranges, length) f_macro_memory_structure_t_new(status, ranges, f_cell_t, length) - #define f_macro_cells_delete(status, ranges) f_macro_memory_structure_delete(status, ranges, f_cell) - #define f_macro_cells_destroy(status, ranges) f_macro_memory_structure_destroy(status, ranges, f_cell) + #define f_macro_cells_t_delete(status, ranges) f_macro_memory_structure_t_delete(status, ranges, f_cell_t) + #define f_macro_cells_t_destroy(status, ranges) f_macro_memory_structure_t_destroy(status, ranges, f_cell_t) - #define f_macro_cells_delete_simple(ranges) f_macro_memory_structure_delete_simple(ranges, f_cell) - #define f_macro_cells_destroy_simple(ranges) f_macro_memory_structure_destroy_simple(ranges, f_cell) + #define f_macro_cells_t_delete_simple(ranges) f_macro_memory_structure_t_delete_simple(ranges, f_cell_t) + #define f_macro_cells_t_destroy_simple(ranges) f_macro_memory_structure_t_destroy_simple(ranges, f_cell_t) - #define f_macro_cells_resize(status, ranges, new_length) f_macro_memory_structure_resize(status, ranges, f_cell, new_length) - #define f_macro_cells_adjust(status, ranges, new_length) f_macro_memory_structure_adjust(status, ranges, f_cell, new_length) -#endif // _di_f_cells_ + #define f_macro_cells_t_resize(status, ranges, new_length) f_macro_memory_structure_t_resize(status, ranges, f_cell_t, new_length) + #define f_macro_cells_t_adjust(status, ranges, new_length) f_macro_memory_structure_t_adjust(status, ranges, f_cell_t, new_length) +#endif // _di_f_cells_t_ /** - * This holds an array of f_cells. + * This holds an array of f_cells_t. * - * array: The array of f_cell arrays. + * array: The array of f_cell_t arrays. * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_f_cellss_ +#ifndef _di_f_cellss_t_ typedef struct { - f_cells *array; + f_cells_t *array; - f_array_length size; - f_array_length used; - } f_cellss; + f_array_length_t size; + f_array_length_t used; + } f_cellss_t; - #define f_cellss_initialize { 0, 0, 0 } + #define f_cellss_t_initialize { 0, 0, 0 } - #define f_macro_cellss_clear(rangess) f_macro_memory_structures_clear(rangess) + #define f_macro_cellss_t_clear(rangess) f_macro_memory_structures_t_clear(rangess) - #define f_macro_cellss_new(status, rangess, length) f_macro_memory_structures_new(status, rangess, f_cells, length) + #define f_macro_cellss_t_new(status, rangess, length) f_macro_memory_structures_t_new(status, rangess, f_cells_t, length) - #define f_macro_cellss_delete(status, rangess) f_macro_memory_structures_delete(status, rangess, f_cell, f_cells) - #define f_macro_cellss_destroy(status, rangess) f_macro_memory_structures_destroy(status, rangess, f_cell, f_cells) + #define f_macro_cellss_t_delete(status, rangess) f_macro_memory_structures_t_delete(status, rangess, f_cell_t, f_cells_t) + #define f_macro_cellss_t_destroy(status, rangess) f_macro_memory_structures_t_destroy(status, rangess, f_cell_t, f_cells_t) - #define f_macro_cellss_delete_simple(rangess) f_macro_memory_structures_delete_simple(rangess, f_cell, f_cells) - #define f_macro_cellss_destroy_simple(rangess) f_macro_memory_structures_destroy_simple(rangess, f_cell, f_cells) + #define f_macro_cellss_t_delete_simple(rangess) f_macro_memory_structures_t_delete_simple(rangess, f_cell_t, f_cells_t) + #define f_macro_cellss_t_destroy_simple(rangess) f_macro_memory_structures_t_destroy_simple(rangess, f_cell_t, f_cells_t) - #define f_macro_cellss_resize(status, rangess, new_length) f_macro_memory_structures_resize(status, rangess, f_cell, f_cells, new_length, f_array_length) - #define f_macro_cellss_adjust(status, rangess, new_length) f_macro_memory_structures_adjust(status, rangess, f_cell, f_cells, new_length, f_array_length) -#endif // _di_f_cellss_ + #define f_macro_cellss_t_resize(status, rangess, new_length) f_macro_memory_structures_t_resize(status, rangess, f_cell_t, f_cells_t, new_length, f_array_length_t) + #define f_macro_cellss_t_adjust(status, rangess, new_length) f_macro_memory_structures_t_adjust(status, rangess, f_cell_t, f_cells_t, new_length, f_array_length_t) +#endif // _di_f_cellss_t_ /** * An array of array int8_t. @@ -151,29 +151,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_f_array_int8_t_ +#ifndef _di_f_array_t_int8_t_ typedef struct { int8_t *array; - f_array_length size; - f_array_length used; - } f_int8_ts; + f_array_length_t size; + f_array_length_t used; + } f_int8s_t; - #define f_int8_ts_initialize { 0, 0, 0 } + #define f_int8s_t_initialize { 0, 0, 0 } - #define f_macro_int8_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_int8s_t_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_int8_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, int8_t, length) + #define f_macro_int8s_t_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, int8_t, length) - #define f_macro_int8_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, int8_t) - #define f_macro_int8_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, int8_t) + #define f_macro_int8s_t_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, int8_t) + #define f_macro_int8s_t_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, int8_t) - #define f_macro_int8_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, int8_t) - #define f_macro_int8_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, int8_t) + #define f_macro_int8s_t_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, int8_t) + #define f_macro_int8s_t_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, int8_t) - #define f_macro_int8_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, int8_t, new_length) - #define f_macro_int8_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, int8_t, new_length) -#endif // _di_int8_ts_ + #define f_macro_int8s_t_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, int8_t, new_length) + #define f_macro_int8s_t_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, int8_t, new_length) +#endif // _di_int8s_t_ /** * An array of an array of array int8_t. @@ -182,29 +182,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_int8_tss_ +#ifndef _di_int8ss_t_ typedef struct { - f_int8_ts *array; + f_int8s_t *array; - f_array_length size; - f_array_length used; - } f_int8_tss; + f_array_length_t size; + f_array_length_t used; + } f_int8ss_t; - #define f_int8_tss_initialize { 0, 0, 0 } + #define f_int8ss_t_initialize { 0, 0, 0 } - #define f_macro_int8_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_int8ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_int8_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, int8_t, length) + #define f_macro_int8ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, int8_t, length) - #define f_macro_int8_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, int8_t, f_int8_ts) - #define f_macro_int8_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, int8_t, f_int8_ts) + #define f_macro_int8ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, int8_t, f_int8s_t) + #define f_macro_int8ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, int8_t, f_int8s_t) - #define f_macro_int8_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, int8_t, f_int8_ts) - #define f_macro_int8_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, int8_t, f_int8_ts) + #define f_macro_int8ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, int8_t, f_int8s_t) + #define f_macro_int8ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, int8_t, f_int8s_t) - #define f_macro_int8_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, int8_t, f_int8_ts, new_length, f_array_length) - #define f_macro_int8_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, int8_t, f_int8_ts, new_length, f_array_length) -#endif // _di_int8_tss_ + #define f_macro_int8ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, int8_t, f_int8s_t, new_length, f_array_length_t) + #define f_macro_int8ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, int8_t, f_int8s_t, new_length, f_array_length_t) +#endif // _di_int8ss_t_ /** * An array of array uint8_t. @@ -213,29 +213,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_uint8_ts_ +#ifndef _di_uint8s_t_ typedef struct { uint8_t *array; - f_array_length size; - f_array_length used; - } f_uint8_ts; + f_array_length_t size; + f_array_length_t used; + } f_uint8s_t; - #define f_uint8_ts_initialize { 0, 0, 0 } + #define f_uint8s_t_initialize { 0, 0, 0 } - #define f_macro_uint8_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_uint8s_t_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_uint8_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, uint8_t, length) + #define f_macro_uint8s_t_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, uint8_t, length) - #define f_macro_uint8_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, uint8_t) - #define f_macro_uint8_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, uint8_t) + #define f_macro_uint8s_t_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, uint8_t) + #define f_macro_uint8s_t_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, uint8_t) - #define f_macro_uint8_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, uint8_t) - #define f_macro_uint8_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, uint8_t) + #define f_macro_uint8s_t_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, uint8_t) + #define f_macro_uint8s_t_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, uint8_t) - #define f_macro_uint8_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, uint8_t, new_length) - #define f_macro_uint8_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, uint8_t, new_length) -#endif // _di_uint8_ts_ + #define f_macro_uint8s_t_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, uint8_t, new_length) + #define f_macro_uint8s_t_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, uint8_t, new_length) +#endif // _di_uint8s_t_ /** * An array of an array of array uint8_t. @@ -244,29 +244,30 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_uint8_tss_ +#ifndef _di_uint8ss_t_ typedef struct { - f_uint8_ts *array; + f_uint8s_t *array; - f_array_length size; - f_array_length used; - } f_uint8_tss; + f_array_length_t size; + f_array_length_t used; + } f_uint8ss_t; - #define f_uint8_tss_initialize { 0, 0, 0 } + #define f_uint8ss_t_initialize { 0, 0, 0 } - #define f_macro_uint8_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_uint8ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_uint8_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, uint8_t, length) + #define f_macro_uint8ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, uint8_t, length) - #define f_macro_uint8_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, uint8_t, f_uint8_ts) - #define f_macro_uint8_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, uint8_t, f_uint8_ts) + #define f_macro_uint8ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, uint8_t, f_uint8s_t) + #define f_macro_uint8ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, uint8_t, f_uint8s_t) + #define f_macro_uint8ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, uint8_t, f_uint8s_t) - #define f_macro_uint8_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, uint8_t, f_uint8_ts) - #define f_macro_uint8_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, uint8_t, f_uint8_ts) + #define f_macro_uint8ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, uint8_t, f_uint8s_t) + #define f_macro_uint8ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, uint8_t, f_uint8s_t) - #define f_macro_uint8_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, uint8_t, f_uint8_ts, new_length, f_array_length) - #define f_macro_uint8_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, uint8_t, f_uint8_ts, new_length, f_array_length) -#endif // _di_uint8_tss_ + #define f_macro_uint8ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, uint8_t, f_uint8s_t, new_length, f_array_length_t) + #define f_macro_uint8ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, uint8_t, f_uint8s_t, new_length, f_array_length_t) +#endif // _di_uint8ss_t_ /** * An array of array int16_t. @@ -275,29 +276,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_int16_ts_ +#ifndef _di_int16s_t_ typedef struct { int16_t *array; - f_array_length size; - f_array_length used; - } f_int16_ts; + f_array_length_t size; + f_array_length_t used; + } f_int16s_t; - #define f_int16_ts_initialize { 0, 0, 0 } + #define f_int16s_t_initialize { 0, 0, 0 } - #define f_macro_int16_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_int16s_t_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_int16_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, int16_t, length) + #define f_macro_int16s_t_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, int16_t, length) - #define f_macro_int16_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, int16_t) - #define f_macro_int16_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, int16_t) + #define f_macro_int16s_t_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, int16_t) + #define f_macro_int16s_t_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, int16_t) - #define f_macro_int16_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, int16_t) - #define f_macro_int16_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, int16_t) + #define f_macro_int16s_t_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, int16_t) + #define f_macro_int16s_t_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, int16_t) - #define f_macro_int16_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, int16_t, new_length) - #define f_macro_int16_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, int16_t, new_length) -#endif // _di_int16_ts_ + #define f_macro_int16s_t_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, int16_t, new_length) + #define f_macro_int16s_t_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, int16_t, new_length) +#endif // _di_int16s_t_ /** * An array of an array of array int16_t. @@ -306,29 +307,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_int16_tss_ +#ifndef _di_int16ss_t_ typedef struct { - f_int16_ts *array; + f_int16s_t *array; - f_array_length size; - f_array_length used; - } f_int16_tss; + f_array_length_t size; + f_array_length_t used; + } f_int16ss_t; - #define f_int16_tss_initialize { 0, 0, 0 } + #define f_int16ss_t_initialize { 0, 0, 0 } - #define f_macro_int16_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_int16ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_int16_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, int16_t, length) + #define f_macro_int16ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, int16_t, length) - #define f_macro_int16_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, int16_t, f_int16_ts) - #define f_macro_int16_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, int16_t, f_int16_ts) + #define f_macro_int16ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, int16_t, f_int16s_t) + #define f_macro_int16ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, int16_t, f_int16s_t) - #define f_macro_int16_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, int16_t, f_int16_ts) - #define f_macro_int16_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, int16_t, f_int16_ts) + #define f_macro_int16ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, int16_t, f_int16s_t) + #define f_macro_int16ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, int16_t, f_int16s_t) - #define f_macro_int16_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, int16_t, f_int16_ts, new_length, f_array_length) - #define f_macro_int16_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, int16_t, f_int16_ts, new_length, f_array_length) -#endif // _di_int16_tss_ + #define f_macro_int16ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, int16_t, f_int16s_t, new_length, f_array_length_t) + #define f_macro_int16ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, int16_t, f_int16s_t, new_length, f_array_length_t) +#endif // _di_int16ss_t_ /** * An array of array uint16_t. @@ -337,29 +338,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_uint16_ts_ +#ifndef _di_uint16s_t_ typedef struct { uint16_t *array; - f_array_length size; - f_array_length used; - } f_uint16_ts; + f_array_length_t size; + f_array_length_t used; + } f_uint16s_t; - #define f_uint16_ts_initialize { 0, 0, 0 } + #define f_uint16s_t_initialize { 0, 0, 0 } - #define f_macro_uint16_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_uint16s_t_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_uint16_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, uint16_t, length) + #define f_macro_uint16s_t_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, uint16_t, length) - #define f_macro_uint16_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, uint16_t) - #define f_macro_uint16_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, uint16_t) + #define f_macro_uint16s_t_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, uint16_t) + #define f_macro_uint16s_t_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, uint16_t) - #define f_macro_uint16_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, uint16_t) - #define f_macro_uint16_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, uint16_t) + #define f_macro_uint16s_t_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, uint16_t) + #define f_macro_uint16s_t_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, uint16_t) - #define f_macro_uint16_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, uint16_t, new_length) - #define f_macro_uint16_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, uint16_t, new_length) -#endif // _di_uint16_ts_ + #define f_macro_uint16s_t_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, uint16_t, new_length) + #define f_macro_uint16s_t_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, uint16_t, new_length) +#endif // _di_uint16s_t_ /** * An array of an array of array uint16_t. @@ -368,29 +369,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_uint16_tss_ +#ifndef _di_uint16ss_t_ typedef struct { - f_uint16_ts *array; + f_uint16s_t *array; - f_array_length size; - f_array_length used; - } f_uint16_tss; + f_array_length_t size; + f_array_length_t used; + } f_uint16ss_t; - #define f_uint16_tss_initialize { 0, 0, 0 } + #define f_uint16ss_t_initialize { 0, 0, 0 } - #define f_macro_uint16_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_uint16ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_uint16_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, uint16_t, length) + #define f_macro_uint16ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, uint16_t, length) - #define f_macro_uint16_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, uint16_t, f_uint16_ts) - #define f_macro_uint16_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, uint16_t, f_uint16_ts) + #define f_macro_uint16ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, uint16_t, f_uint16s_t) + #define f_macro_uint16ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, uint16_t, f_uint16s_t) - #define f_macro_uint16_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, uint16_t, f_uint16_ts) - #define f_macro_uint16_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, uint16_t, f_uint16_ts) + #define f_macro_uint16ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, uint16_t, f_uint16s_t) + #define f_macro_uint16ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, uint16_t, f_uint16s_t) - #define f_macro_uint16_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, uint16_t, f_uint16_ts, new_length, f_array_length) - #define f_macro_uint16_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, uint16_t, f_uint16_ts, new_length, f_array_length) -#endif // _di_uint16_tss_ + #define f_macro_uint16ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, uint16_t, f_uint16s_t, new_length, f_array_length_t) + #define f_macro_uint16ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, uint16_t, f_uint16s_t, new_length, f_array_length_t) +#endif // _di_uint16ss_t_ /** * An array of array int32_t. @@ -399,29 +400,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_int32_ts_ +#ifndef _di_int32s_t_ typedef struct { int32_t *array; - f_array_length size; - f_array_length used; - } f_int32_ts; + f_array_length_t size; + f_array_length_t used; + } f_int32s_t; - #define f_int32_ts_initialize { 0, 0, 0 } + #define f_int32s_t_initialize { 0, 0, 0 } - #define f_macro_int32_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_int32s_t_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_int32_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, int32_t, length) + #define f_macro_int32s_t_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, int32_t, length) - #define f_macro_int32_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, int32_t) - #define f_macro_int32_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, int32_t) + #define f_macro_int32s_t_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, int32_t) + #define f_macro_int32s_t_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, int32_t) - #define f_macro_int32_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, int32_t) - #define f_macro_int32_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, int32_t) + #define f_macro_int32s_t_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, int32_t) + #define f_macro_int32s_t_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, int32_t) - #define f_macro_int32_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, int32_t, new_length) - #define f_macro_int32_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, int32_t, new_length) -#endif // _di_int32_ts_ + #define f_macro_int32s_t_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, int32_t, new_length) + #define f_macro_int32s_t_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, int32_t, new_length) +#endif // _di_int32s_t_ /** * An array of an array of array int32_t. @@ -430,29 +431,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_int32_tss_ +#ifndef _di_int32ss_t_ typedef struct { - f_int32_ts *array; + f_int32s_t *array; - f_array_length size; - f_array_length used; - } f_int32_tss; + f_array_length_t size; + f_array_length_t used; + } f_int32ss_t; - #define f_int32_tss_initialize { 0, 0, 0 } + #define f_int32ss_t_initialize { 0, 0, 0 } - #define f_macro_int32_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_int32ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_int32_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, int32_t, length) + #define f_macro_int32ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, int32_t, length) - #define f_macro_int32_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, int32_t, f_int32_ts) - #define f_macro_int32_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, int32_t, f_int32_ts) + #define f_macro_int32ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, int32_t, f_int32s_t) + #define f_macro_int32ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, int32_t, f_int32s_t) - #define f_macro_int32_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, int32_t, f_int32_ts) - #define f_macro_int32_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, int32_t, f_int32_ts) + #define f_macro_int32ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, int32_t, f_int32s_t) + #define f_macro_int32ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, int32_t, f_int32s_t) - #define f_macro_int32_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, int32_t, f_int32_ts, new_length, f_array_length) - #define f_macro_int32_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, int32_t, f_int32_ts, new_length, f_array_length) -#endif // _di_int32_tss_ + #define f_macro_int32ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, int32_t, f_int32s_t, new_length, f_array_length_t) + #define f_macro_int32ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, int32_t, f_int32s_t, new_length, f_array_length_t) +#endif // _di_int32ss_t_ /** * An array of array uint32_t. @@ -461,29 +462,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_uint32_ts_ +#ifndef _di_uint32s_t_ typedef struct { uint32_t *array; - f_array_length size; - f_array_length used; - } f_uint32_ts; + f_array_length_t size; + f_array_length_t used; + } f_uint32s_t; - #define f_uint32_ts_initialize { 0, 0, 0 } + #define f_uint32s_t_initialize { 0, 0, 0 } - #define f_macro_uint32_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_uint32s_t_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_uint32_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, uint32_t, length) + #define f_macro_uint32s_t_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, uint32_t, length) - #define f_macro_uint32_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, uint32_t) - #define f_macro_uint32_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, uint32_t) + #define f_macro_uint32s_t_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, uint32_t) + #define f_macro_uint32s_t_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, uint32_t) - #define f_macro_uint32_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, uint32_t) - #define f_macro_uint32_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, uint32_t) + #define f_macro_uint32s_t_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, uint32_t) + #define f_macro_uint32s_t_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, uint32_t) - #define f_macro_uint32_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, uint32_t, new_length) - #define f_macro_uint32_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, uint32_t, new_length) -#endif // _di_uint32_ts_ + #define f_macro_uint32s_t_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, uint32_t, new_length) + #define f_macro_uint32s_t_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, uint32_t, new_length) +#endif // _di_uint32s_t_ /** * An array of an array of array uint32_t. @@ -492,29 +493,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_uint32_tss_ +#ifndef _di_uint32ss_t_ typedef struct { - f_uint32_ts *array; + f_uint32s_t *array; - f_array_length size; - f_array_length used; - } f_uint32_tss; + f_array_length_t size; + f_array_length_t used; + } f_uint32ss_t; - #define f_uint32_tss_initialize { 0, 0, 0 } + #define f_uint32ss_t_initialize { 0, 0, 0 } - #define f_macro_uint32_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_uint32ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_uint32_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, uint32_t, length) + #define f_macro_uint32ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, uint32_t, length) - #define f_macro_uint32_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, uint32_t, f_uint32_ts) - #define f_macro_uint32_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, uint32_t, f_uint32_ts) + #define f_macro_uint32ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, uint32_t, f_uint32s_t) + #define f_macro_uint32ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, uint32_t, f_uint32s_t) - #define f_macro_uint32_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, uint32_t, f_uint32_ts) - #define f_macro_uint32_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, uint32_t, f_uint32_ts) + #define f_macro_uint32ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, uint32_t, f_uint32s_t) + #define f_macro_uint32ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, uint32_t, f_uint32s_t) - #define f_macro_uint32_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, uint32_t, f_uint32_ts, new_length, f_array_length) - #define f_macro_uint32_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, uint32_t, f_uint32_ts, new_length, f_array_length) -#endif // _di_uint32_tss_ + #define f_macro_uint32ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, uint32_t, f_uint32s_t, new_length, f_array_length_t) + #define f_macro_uint32ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, uint32_t, f_uint32s_t, new_length, f_array_length_t) +#endif // _di_uint32ss_t_ /** * An array of array int64_t. @@ -523,29 +524,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_int64_ts_ +#ifndef _di_int64s_t_ typedef struct { int64_t *array; - f_array_length size; - f_array_length used; - } f_int64_ts; + f_array_length_t size; + f_array_length_t used; + } f_int64s_t; #define f_int64_ts_initialize { 0, 0, 0 } - #define f_macro_int64_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_int64_ts_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_int64_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, int64_t, length) + #define f_macro_int64_ts_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, int64_t, length) - #define f_macro_int64_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, int64_t) - #define f_macro_int64_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, int64_t) + #define f_macro_int64_ts_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, int64_t) + #define f_macro_int64_ts_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, int64_t) - #define f_macro_int64_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, int64_t) - #define f_macro_int64_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, int64_t) + #define f_macro_int64_ts_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, int64_t) + #define f_macro_int64_ts_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, int64_t) - #define f_macro_int64_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, int64_t, new_length) - #define f_macro_int64_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, int64_t, new_length) -#endif // _di_int64_ts_ + #define f_macro_int64_ts_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, int64_t, new_length) + #define f_macro_int64_ts_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, int64_t, new_length) +#endif // _di_int64s_t_ /** * An array of an array of array int64_t. @@ -554,29 +555,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_int64_tss_ +#ifndef _di_int64ss_t_ typedef struct { - f_int64_ts *array; + f_int64s_t *array; - f_array_length size; - f_array_length used; - } f_int64_tss; + f_array_length_t size; + f_array_length_t used; + } f_int64ss_t; - #define f_int64_tss_initialize { 0, 0, 0 } + #define f_int64ss_t_initialize { 0, 0, 0 } - #define f_macro_int64_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_int64ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_int64_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, int64_t, length) + #define f_macro_int64ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, int64_t, length) - #define f_macro_int64_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, int64_t, f_int64_ts) - #define f_macro_int64_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, int64_t, f_int64_ts) + #define f_macro_int64ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, int64_t, f_int64s_t) + #define f_macro_int64ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, int64_t, f_int64s_t) - #define f_macro_int64_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, int64_t, f_int64_ts) - #define f_macro_int64_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, int64_t, f_int64_ts) + #define f_macro_int64ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, int64_t, f_int64s_t) + #define f_macro_int64ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, int64_t, f_int64s_t) - #define f_macro_int64_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, int64_t, f_int64_ts, new_length, f_array_length) - #define f_macro_int64_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, int64_t, f_int64_ts, new_length, f_array_length) -#endif // _di_int64_tss_ + #define f_macro_int64ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, int64_t, f_int64s_t, new_length, f_array_length_t) + #define f_macro_int64ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, int64_t, f_int64s_t, new_length, f_array_length_t) +#endif // _di_int64ss_t_ /** * An array of array uint64_t. @@ -585,29 +586,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ -#ifndef _di_uint64_ts_ +#ifndef _di_uint64s_t_ typedef struct { uint64_t *array; - f_array_length size; - f_array_length used; - } f_uint64_ts; + f_array_length_t size; + f_array_length_t used; + } f_uint64s_t; - #define f_uint64_ts_initialize { 0, 0, 0 } + #define f_uint64s_t_initialize { 0, 0, 0 } - #define f_macro_uint64_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_uint64s_t_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_uint64_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, uint64_t, length) + #define f_macro_uint64s_t_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, uint64_t, length) - #define f_macro_uint64_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, uint64_t) - #define f_macro_uint64_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, uint64_t) + #define f_macro_uint64s_t_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, uint64_t) + #define f_macro_uint64s_t_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, uint64_t) - #define f_macro_uint64_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, uint64_t) - #define f_macro_uint64_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, uint64_t) + #define f_macro_uint64s_t_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, uint64_t) + #define f_macro_uint64s_t_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, uint64_t) - #define f_macro_uint64_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, uint64_t, new_length) - #define f_macro_uint64_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, uint64_t, new_length) -#endif // _di_uint64_ts_ + #define f_macro_uint64s_t_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, uint64_t, new_length) + #define f_macro_uint64s_t_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, uint64_t, new_length) +#endif // _di_uint64s_t_ /** * An array of an array of array uint64_t. @@ -616,29 +617,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_uint64_tss_ +#ifndef _di_uint64ss_t_ typedef struct { - f_uint64_ts *array; + f_uint64s_t *array; - f_array_length size; - f_array_length used; - } f_uint64_tss; + f_array_length_t size; + f_array_length_t used; + } f_uint64ss_t; - #define f_uint64_tss_initialize { 0, 0, 0 } + #define f_uint64ss_t_initialize { 0, 0, 0 } - #define f_macro_uint64_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_uint64ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_uint64_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, uint64_t, length) + #define f_macro_uint64ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, uint64_t, length) - #define f_macro_uint64_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, uint64_t, f_uint64_ts) - #define f_macro_uint64_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, uint64_t, f_uint64_ts) + #define f_macro_uint64ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, uint64_t, f_uint64s_t) + #define f_macro_uint64ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, uint64_t, f_uint64s_t) - #define f_macro_uint64_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, uint64_t, f_uint64_ts) - #define f_macro_uint64_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, uint64_t, f_uint64_ts) + #define f_macro_uint64ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, uint64_t, f_uint64s_t) + #define f_macro_uint64ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, uint64_t, f_uint64s_t) - #define f_macro_uint64_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, uint64_t, f_uint64_ts, new_length, f_array_length) - #define f_macro_uint64_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, uint64_t, f_uint64_ts, new_length, f_array_length) -#endif // _di_uint64_tss_ + #define f_macro_uint64ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, uint64_t, f_uint64s_t, new_length, f_array_length_t) + #define f_macro_uint64ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, uint64_t, f_uint64s_t, new_length, f_array_length_t) +#endif // _di_uint64ss_t_ #ifndef __SIZEOF_INT128__ /** @@ -648,29 +649,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ - #ifndef _di_int128_ts_ + #ifndef _di_int128s_t_ typedef struct { __int128_t *array; - f_array_length size; - f_array_length used; - } f_int128_ts; + f_array_length_t size; + f_array_length_t used; + } f_int128s_t; #define f_int128_ts_initialize { 0, 0, 0 } - #define f_macro_int128_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_int128_ts_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_int128_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, __int128_t, length) + #define f_macro_int128_ts_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, __int128_t, length) - #define f_macro_int128_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, __int128_t) - #define f_macro_int128_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, __int128_t) + #define f_macro_int128_ts_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, __int128_t) + #define f_macro_int128_ts_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, __int128_t) - #define f_macro_int128_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, __int128_t) - #define f_macro_int128_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, __int128_t) + #define f_macro_int128_ts_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, __int128_t) + #define f_macro_int128_ts_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, __int128_t) - #define f_macro_int128_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, __int128_t, new_length) - #define f_macro_int128_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, __int128_t, new_length) - #endif // _di_int128_ts_ + #define f_macro_int128_ts_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, __int128_t, new_length) + #define f_macro_int128_ts_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, __int128_t, new_length) + #endif // _di_int128s_t_ /** * An array of an array of array __int128_t. @@ -679,29 +680,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ - #ifndef _di_int128_tss_ + #ifndef _di_int128ss_t_ typedef struct { - f_int128_ts *array; + f_int128s_t *array; - f_array_length size; - f_array_length used; - } f_int128_tss; + f_array_length_t size; + f_array_length_t used; + } f_int128ss_t; - #define f_int128_tss_initialize { 0, 0, 0 } + #define f_int128ss_t_initialize { 0, 0, 0 } - #define f_macro_int128_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_int128ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_int128_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, __int128_t, length) + #define f_macro_int128ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, __int128_t, length) - #define f_macro_int128_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, __int128_t, f_int128_ts) - #define f_macro_int128_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, __int128_t, f_int128_ts) + #define f_macro_int128ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, __int128_t, f_int128s_t) + #define f_macro_int128ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, __int128_t, f_int128s_t) - #define f_macro_int128_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, __int128_t, f_int128_ts) - #define f_macro_int128_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, __int128_t, f_int128_ts) + #define f_macro_int128ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, __int128_t, f_int128s_t) + #define f_macro_int128ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, __int128_t, f_int128s_t) - #define f_macro_int128_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, __int128_t, f_int128_ts, new_length, f_array_length) - #define f_macro_int128_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, __int128_t, f_int128_ts, new_length, f_array_length) - #endif // _di_int128_tss_ + #define f_macro_int128ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, __int128_t, f_int128s_t, new_length, f_array_length_t) + #define f_macro_int128ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, __int128_t, f_int128s_t, new_length, f_array_length_t) + #endif // _di_int128ss_t_ /** * An array of array __uint128_t. @@ -710,29 +711,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ - #ifndef _di_uint128_ts_ + #ifndef _di_uint128s_t_ typedef struct { __uint128_t *array; - f_array_length size; - f_array_length used; - } f_uint128_ts; + f_array_length_t size; + f_array_length_t used; + } f_uint128s_t; #define f_uint128_ts_initialize { 0, 0, 0 } - #define f_macro_uint128_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_uint128_ts_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_uint128_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, __uint128_t, length) + #define f_macro_uint128_ts_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, __uint128_t, length) - #define f_macro_uint128_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, __uint128_t) - #define f_macro_uint128_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, __uint128_t) + #define f_macro_uint128_ts_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, __uint128_t) + #define f_macro_uint128_ts_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, __uint128_t) - #define f_macro_uint128_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, __uint128_t) - #define f_macro_uint128_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, __uint128_t) + #define f_macro_uint128_ts_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, __uint128_t) + #define f_macro_uint128_ts_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, __uint128_t) - #define f_macro_uint128_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, __uint128_t, new_length) - #define f_macro_uint128_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, __uint128_t, new_length) - #endif // _di_uint128_ts_ + #define f_macro_uint128_ts_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, __uint128_t, new_length) + #define f_macro_uint128_ts_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, __uint128_t, new_length) + #endif // _di_uint128s_t_ /** * An array of an array of array __uint128_t. @@ -741,29 +742,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ - #ifndef _di_uint128_tss_ + #ifndef _di_uint128ss_t_ typedef struct { - f_uint128_ts *array; + f_uint128s_t *array; - f_array_length size; - f_array_length used; - } f_uint128_tss; + f_array_length_t size; + f_array_length_t used; + } f_uint128ss_t; - #define f_uint128_tss_initialize { 0, 0, 0 } + #define f_uint128ss_t_initialize { 0, 0, 0 } - #define f_macro_uint128_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_uint128ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_uint128_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, __uint128_t, length) + #define f_macro_uint128ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, __uint128_t, length) - #define f_macro_uint128_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, __uint128_t, f_uint128_ts) - #define f_macro_uint128_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, __uint128_t, f_uint128_ts) + #define f_macro_uint128ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, __uint128_t, f_uint128s_t) + #define f_macro_uint128ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, __uint128_t, f_uint128s_t) - #define f_macro_uint128_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, __uint128_t, f_uint128_ts) - #define f_macro_uint128_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, __uint128_t, f_uint128_ts) + #define f_macro_uint128ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, __uint128_t, f_uint128s_t) + #define f_macro_uint128ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, __uint128_t, f_uint128s_t) - #define f_macro_uint128_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, __uint128_t, f_uint128_ts, new_length, f_array_length) - #define f_macro_uint128_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, __uint128_t, f_uint128_ts, new_length, f_array_length) - #endif // _di_uint128_tss_ + #define f_macro_uint128ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, __uint128_t, f_uint128s_t, new_length, f_array_length_t) + #define f_macro_uint128ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, __uint128_t, f_uint128s_t, new_length, f_array_length_t) + #endif // _di_uint128ss_t_ #else /** * An array of array int64_t acting in place of __int128_t when 128 is not supported. @@ -772,29 +773,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ - #ifndef _di_int128_ts_ + #ifndef _di_int128s_t_ typedef struct { int64_t *array; - f_array_length size; - f_array_length used; - } f_int128_ts; + f_array_length_t size; + f_array_length_t used; + } f_int128s_t; #define f_int128_ts_initialize { 0, 0, 0 } - #define f_macro_int128_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_int128_ts_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_int128_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, int64_t, length) + #define f_macro_int128_ts_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, int64_t, length) - #define f_macro_int128_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, int64_t) - #define f_macro_int128_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, int64_t) + #define f_macro_int128_ts_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, int64_t) + #define f_macro_int128_ts_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, int64_t) - #define f_macro_int128_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, int64_t) - #define f_macro_int128_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, int64_t) + #define f_macro_int128_ts_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, int64_t) + #define f_macro_int128_ts_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, int64_t) - #define f_macro_int128_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, int64_t, new_length) - #define f_macro_int128_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, int64_t, new_length) - #endif // _di_int128_ts_ + #define f_macro_int128_ts_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, int64_t, new_length) + #define f_macro_int128_ts_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, int64_t, new_length) + #endif // _di_int128s_t_ /** * An array of an array of array int64_t acting in place of __int128_t when 128 is not supported. @@ -803,29 +804,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ - #ifndef _di_int128_tss_ + #ifndef _di_int128ss_t_ typedef struct { - f_int128_ts *array; + f_int128s_t *array; - f_array_length size; - f_array_length used; - } f_int128_tss; + f_array_length_t size; + f_array_length_t used; + } f_int128ss_t; - #define f_int128_tss_initialize { 0, 0, 0 } + #define f_int128ss_t_initialize { 0, 0, 0 } - #define f_macro_int128_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_int128ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_int128_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, int64_t, length) + #define f_macro_int128ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, int64_t, length) - #define f_macro_int128_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, int64_t, f_int128_ts) - #define f_macro_int128_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, int64_t, f_int128_ts) + #define f_macro_int128ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, int64_t, f_int128s_t) + #define f_macro_int128ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, int64_t, f_int128s_t) - #define f_macro_int128_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, int64_t, f_int128_ts) - #define f_macro_int128_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, int64_t, f_int128_ts) + #define f_macro_int128ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, int64_t, f_int128s_t) + #define f_macro_int128ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, int64_t, f_int128s_t) - #define f_macro_int128_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, int64_t, f_int128_ts, new_length, f_array_length) - #define f_macro_int128_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, int64_t, f_int128_ts, new_length, f_array_length) - #endif // _di_int128_tss_ + #define f_macro_int128ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, int64_t, f_int128s_t, new_length, f_array_length_t) + #define f_macro_int128ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, int64_t, f_int128s_t, new_length, f_array_length_t) + #endif // _di_int128ss_t_ /** * An array of array uint64_t acting in place of __uint128_t when 128 is not supported. @@ -834,29 +835,29 @@ extern "C" { * size: Total amount of allocated space. * used: Total number of allocated spaces used. */ - #ifndef _di_uint128_ts_ + #ifndef _di_uint128s_t_ typedef struct { uint64_t *array; - f_array_length size; - f_array_length used; - } f_uint128_ts; + f_array_length_t size; + f_array_length_t used; + } f_uint128s_t; #define f_uint128_ts_initialize { 0, 0, 0 } - #define f_macro_uint128_ts_clear(numbers) f_macro_memory_structure_clear(numbers) + #define f_macro_uint128_ts_clear(numbers) f_macro_memory_structure_t_clear(numbers) - #define f_macro_uint128_ts_new(status, numbers, length) f_macro_memory_structure_new(status, numbers, uint64_t, length) + #define f_macro_uint128_ts_new(status, numbers, length) f_macro_memory_structure_t_new(status, numbers, uint64_t, length) - #define f_macro_uint128_ts_delete(status, numbers) f_macro_memory_structure_delete(status, numbers, uint64_t) - #define f_macro_uint128_ts_destroy(status, numbers) f_macro_memory_structure_destroy(status, numbers, uint64_t) + #define f_macro_uint128_ts_delete(status, numbers) f_macro_memory_structure_t_delete(status, numbers, uint64_t) + #define f_macro_uint128_ts_destroy(status, numbers) f_macro_memory_structure_t_destroy(status, numbers, uint64_t) - #define f_macro_uint128_ts_delete_simple(numbers) f_macro_memory_structure_delete_simple(numbers, uint64_t) - #define f_macro_uint128_ts_destroy_simple(numbers) f_macro_memory_structure_destroy_simple(numbers, uint64_t) + #define f_macro_uint128_ts_delete_simple(numbers) f_macro_memory_structure_t_delete_simple(numbers, uint64_t) + #define f_macro_uint128_ts_destroy_simple(numbers) f_macro_memory_structure_t_destroy_simple(numbers, uint64_t) - #define f_macro_uint128_ts_resize(status, numbers, new_length) f_macro_memory_structure_resize(status, numbers, uint64_t, new_length) - #define f_macro_uint128_ts_adjust(status, numbers, new_length) f_macro_memory_structure_adjust(status, numbers, uint64_t, new_length) - #endif // _di_uint128_ts_ + #define f_macro_uint128_ts_resize(status, numbers, new_length) f_macro_memory_structure_t_resize(status, numbers, uint64_t, new_length) + #define f_macro_uint128_ts_adjust(status, numbers, new_length) f_macro_memory_structure_t_adjust(status, numbers, uint64_t, new_length) + #endif // _di_uint128s_t_ /** * An array of an array of array uint64_t acting in place of __uint128_t when 128 is not supported. @@ -865,29 +866,29 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ - #ifndef _di_uint128_tss_ + #ifndef _di_uint128ss_t_ typedef struct { - f_uint128_ts *array; + f_uint128s_t *array; - f_array_length size; - f_array_length used; - } f_uint128_tss; + f_array_length_t size; + f_array_length_t used; + } f_uint128ss_t; - #define f_uint128_tss_initialize { 0, 0, 0 } + #define f_uint128ss_t_initialize { 0, 0, 0 } - #define f_macro_uint128_tss_clear(numbers) f_macro_memory_structures_clear(numbers) + #define f_macro_uint128ss_t_clear(numbers) f_macro_memory_structures_t_clear(numbers) - #define f_macro_uint128_tss_new(status, numbers, length) f_macro_memory_structures_new(status, numbers, uint64_t, length) + #define f_macro_uint128ss_t_new(status, numbers, length) f_macro_memory_structures_t_new(status, numbers, uint64_t, length) - #define f_macro_uint128_tss_delete(status, numbers) f_macro_memory_structures_delete(status, numbers, uint64_t, f_uint128_ts) - #define f_macro_uint128_tss_destroy(status, numbers) f_macro_memory_structures_destroy(status, numbers, uint64_t, f_uint128_ts) + #define f_macro_uint128ss_t_delete(status, numbers) f_macro_memory_structures_t_delete(status, numbers, uint64_t, f_uint128s_t) + #define f_macro_uint128ss_t_destroy(status, numbers) f_macro_memory_structures_t_destroy(status, numbers, uint64_t, f_uint128s_t) - #define f_macro_uint128_tss_delete_simple(numbers) f_macro_memory_structures_delete_simple(numbers, uint64_t, f_uint128_ts) - #define f_macro_uint128_tss_destroy_simple(numbers) f_macro_memory_structures_destroy_simple(numbers, uint64_t, f_uint128_ts) + #define f_macro_uint128ss_t_delete_simple(numbers) f_macro_memory_structures_t_delete_simple(numbers, uint64_t, f_uint128s_t) + #define f_macro_uint128ss_t_destroy_simple(numbers) f_macro_memory_structures_t_destroy_simple(numbers, uint64_t, f_uint128s_t) - #define f_macro_uint128_tss_resize(status, numbers, new_length) f_macro_memory_structures_resize(status, numbers, uint64_t, f_uint128_ts, new_length, f_array_length) - #define f_macro_uint128_tss_adjust(status, numbers, new_length) f_macro_memory_structures_adjust(status, numbers, uint64_t, f_uint128_ts, new_length, f_array_length) - #endif // _di_uint128_tss_ + #define f_macro_uint128ss_t_resize(status, numbers, new_length) f_macro_memory_structures_t_resize(status, numbers, uint64_t, f_uint128s_t, new_length, f_array_length_t) + #define f_macro_uint128ss_t_adjust(status, numbers, new_length) f_macro_memory_structures_t_adjust(status, numbers, uint64_t, f_uint128s_t, new_length, f_array_length_t) + #endif // _di_uint128ss_t_ #endif // __SIZEOF_INT128__ #ifdef __cplusplus diff --git a/level_0/f_utf/c/private-utf.c b/level_0/f_utf/c/private-utf.c index 226c14a..87425ba 100644 --- a/level_0/f_utf/c/private-utf.c +++ b/level_0/f_utf/c/private-utf.c @@ -6,7 +6,7 @@ extern "C" { #endif #if !defined(_di_f_utf_character_is_alpha_) || !defined(_di_f_utf_is_alpha_) - f_return_status private_f_utf_character_is_alpha(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_alpha(const f_utf_character_t character, const uint8_t width) { if (private_f_utf_character_is_zero_width(character, width)) { return F_false; @@ -53,7 +53,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_alpha_) || !defined(_di_f_utf_is_alpha_) #if !defined(_di_f_utf_character_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_digit_) - f_return_status private_f_utf_character_is_alpha_digit(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_alpha_digit(const f_utf_character_t character, const uint8_t width) { if (private_f_utf_character_is_digit(character, width)) { return F_true; @@ -100,7 +100,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_digit_) #if !defined(_di_f_utf_character_is_alpha_numeric_) || !defined(_di_f_utf_is_alpha_numeric_) - f_return_status private_f_utf_character_is_alpha_numeric(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_alpha_numeric(const f_utf_character_t character, const uint8_t width) { if (private_f_utf_character_is_numeric(character, width)) { return F_true; @@ -143,10 +143,10 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_alpha_numeric_) || !defined(_di_f_utf_is_alpha_numeric_) #if !defined(_di_f_utf_character_is_ascii_) || !defined(_di_f_utf_is_ascii_) - f_return_status private_f_utf_character_is_ascii(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_ascii(const f_utf_character_t character, const uint8_t width) { if (width == 0) { - const uint8_t byte_first = f_macro_utf_character_to_char_1(character); + const uint8_t byte_first = f_macro_utf_character_t_to_char_1(character); if (byte_first >= 0x00 && byte_first <= 0x7f) { return F_true; @@ -158,7 +158,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_ascii_) || !defined(_di_f_utf_is_ascii_) #if !defined(_di_f_utf_character_is_combining_) || !defined(_di_f_utf_is_combining_) - f_return_status private_f_utf_character_is_combining(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_combining(const f_utf_character_t character, const uint8_t width) { if (width == 2) { @@ -202,7 +202,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_combining_) || !defined(_di_f_utf_is_combining_) #if !defined(_di_f_utf_character_is_control_) || !defined(_di_f_utf_is_control_) - f_return_status private_f_utf_character_is_control(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_control(const f_utf_character_t character, const uint8_t width) { if (width == 2) { @@ -241,7 +241,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_control_) || !defined(_di_f_utf_is_control_) #if !defined(_di_f_utf_character_is_control_picture_) || !defined(_di_f_utf_is_control_picture_) - f_return_status private_f_utf_character_is_control_picture(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_control_picture(const f_utf_character_t character, const uint8_t width) { if (width == 3) { // Control Pictures: U+2400 to U+2426. @@ -260,7 +260,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_control_picture_) || !defined(_di_f_utf_is_control_picture_) #if !defined(_di_f_utf_character_is_digit_) || !defined(_di_f_utf_is_digit_) - f_return_status private_f_utf_character_is_digit(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_digit(const f_utf_character_t character, const uint8_t width) { if (width == 2) { uint16_t bytes = (uint16_t) ((character & 0xffff0000) >> 16); @@ -284,7 +284,7 @@ extern "C" { } // reduce the number of checks by grouping checks by first byte. - const uint8_t byte_first = f_macro_utf_character_to_char_1(character); + const uint8_t byte_first = f_macro_utf_character_t_to_char_1(character); if (width == 3) { uint16_t bytes = (uint16_t) ((character & 0x00ffff00) >> 8); @@ -467,7 +467,7 @@ extern "C" { } // reduce the number of checks by grouping checks by first byte. - const uint8_t byte_second = f_macro_utf_character_to_char_2(character); + const uint8_t byte_second = f_macro_utf_character_t_to_char_2(character); if (width == 4) { uint16_t bytes = (uint16_t) ((character & 0xffff0000) >> 16); @@ -633,10 +633,10 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_digit_) || !defined(_di_f_utf_is_digit_) #if !defined(_di_f_utf_character_is_emoji_) || !defined(_di_f_utf_is_emoji_) - f_return_status private_f_utf_character_is_emoji(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_emoji(const f_utf_character_t character, const uint8_t width) { // reduce the number of checks by grouping checks by first byte. - const uint8_t byte_first = f_macro_utf_character_to_char_1(character); + const uint8_t byte_first = f_macro_utf_character_t_to_char_1(character); if (width == 2) { @@ -1126,7 +1126,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_emoji_) || !defined(_di_f_utf_is_emoji_) #if !defined(_di_f_utf_character_is_numeric_) || !defined(_di_f_utf_is_numeric_) - f_return_status private_f_utf_character_is_numeric(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_numeric(const f_utf_character_t character, const uint8_t width) { if (private_f_utf_character_is_digit(character, width)) { return F_true; @@ -1155,7 +1155,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_numeric_) || !defined(_di_f_utf_is_numeric_) #if !defined(_di_f_utf_character_is_phonetic_) || !defined(_di_f_utf_is_phonetic_) - f_return_status private_f_utf_character_is_phonetic(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_phonetic(const f_utf_character_t character, const uint8_t width) { if (width == 3) { @@ -1175,16 +1175,16 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_phonetic_) || !defined(_di_f_utf_is_phonetic_) #if !defined(_di_f_utf_character_is_private_) || !defined(_di_f_utf_is_private_) - f_return_status private_f_utf_character_is_private(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_private(const f_utf_character_t character, const uint8_t width) { if (width < 3) { return F_false; } // reduce the number of checks by grouping checks by byte. - const uint8_t byte_first = f_macro_utf_character_to_char_1(character); - const uint8_t byte_second = f_macro_utf_character_to_char_2(character); - const uint8_t byte_third = f_macro_utf_character_to_char_3(character); + const uint8_t byte_first = f_macro_utf_character_t_to_char_1(character); + const uint8_t byte_second = f_macro_utf_character_t_to_char_2(character); + const uint8_t byte_third = f_macro_utf_character_t_to_char_3(character); if (width == 3) { if (byte_first >= 0xe0 && byte_first <= 0xef) { @@ -1200,7 +1200,7 @@ extern "C" { return F_false; } - const uint8_t byte_fourth = f_macro_utf_character_to_char_4(character); + const uint8_t byte_fourth = f_macro_utf_character_t_to_char_4(character); if (width == 4) { if (byte_first == 0xf3) { @@ -1233,10 +1233,10 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_private_) || !defined(_di_f_utf_is_private_) #if !defined(_di_f_utf_character_is_punctuation_) || !defined(_di_f_utf_is_punctuation_) - f_return_status private_f_utf_character_is_punctuation(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_punctuation(const f_utf_character_t character, const uint8_t width) { // reduce the number of checks by grouping checks by first byte. - const uint8_t byte_first = f_macro_utf_character_to_char_1(character); + const uint8_t byte_first = f_macro_utf_character_t_to_char_1(character); if (width == 2) { @@ -1661,7 +1661,7 @@ extern "C" { } } else if (width == 4) { - uint8_t byte_second = f_macro_utf_character_to_char_2(character); + uint8_t byte_second = f_macro_utf_character_t_to_char_2(character); if (byte_first == 0xf0) { if (byte_second == 0x90) { @@ -1900,10 +1900,10 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_punctuation_) || !defined(_di_f_utf_is_punctuation_) #if !defined(_di_f_utf_character_is_symbol_) || !defined(_di_f_utf_is_symbol_) - f_return_status private_f_utf_character_is_symbol(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_symbol(const f_utf_character_t character, const uint8_t width) { // reduce the number of checks by grouping checks by first byte. - const uint8_t byte_first = f_macro_utf_character_to_char_1(character); + const uint8_t byte_first = f_macro_utf_character_t_to_char_1(character); // @todo: handle all Unicode "symbol". @@ -1912,10 +1912,10 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_symbol_) || !defined(_di_f_utf_is_symbol_) #if !defined(_di_f_utf_character_is_unassigned_) || !defined(_di_f_utf_is_unassigned_) - f_return_status private_f_utf_character_is_unassigned(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_unassigned(const f_utf_character_t character, const uint8_t width) { // reduce the number of checks by grouping checks by first byte. - const uint8_t byte_first = f_macro_utf_character_to_char_1(character); + const uint8_t byte_first = f_macro_utf_character_t_to_char_1(character); // @todo: Basic Multilingual Plane // @todo: handle all unassigned UTF-8 spaces. @@ -1931,10 +1931,10 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_unassigned_) || !defined(_di_f_utf_is_unassigned_) #if !defined(_di_f_utf_character_is_valid_) || !defined(_di_f_utf_is_valid_) - f_return_status private_f_utf_character_is_valid(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_valid(const f_utf_character_t character, const uint8_t width) { // reduce the number of checks by grouping checks by byte. - const uint8_t byte_first = f_macro_utf_character_to_char_1(character); + const uint8_t byte_first = f_macro_utf_character_t_to_char_1(character); if (width == 0) { if (byte_first >= 0x00 && byte_first <= 0x7f) { @@ -1944,7 +1944,7 @@ extern "C" { return F_false; } - const uint8_t byte_second = f_macro_utf_character_to_char_2(character); + const uint8_t byte_second = f_macro_utf_character_t_to_char_2(character); if (width == 2) { if (byte_first >= 0xc2 && byte_first <= 0xdf) { @@ -1956,7 +1956,7 @@ extern "C" { return F_false; } - const uint8_t byte_third = f_macro_utf_character_to_char_3(character); + const uint8_t byte_third = f_macro_utf_character_t_to_char_3(character); if (width == 3) { if (byte_first == 0xe0) { @@ -1990,7 +1990,7 @@ extern "C" { } } - const uint8_t byte_fourth = f_macro_utf_character_to_char_4(character); + const uint8_t byte_fourth = f_macro_utf_character_t_to_char_4(character); if (width == 4) { if (byte_first == 0xf0) { @@ -2033,7 +2033,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_valid_) || !defined(_di_f_utf_is_valid_) #if !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_) - f_return_status private_f_utf_character_is_whitespace(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_whitespace(const f_utf_character_t character, const uint8_t width) { if (width == 2) { @@ -2045,7 +2045,7 @@ extern "C" { else if (width == 3) { // reduce the number of checks by grouping checks by first byte. - const uint8_t byte_first = f_macro_utf_character_to_char_1(character); + const uint8_t byte_first = f_macro_utf_character_t_to_char_1(character); if (byte_first == 0xe2) { @@ -2073,7 +2073,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_) #if !defined(_di_f_utf_character_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_modifier_) - f_return_status private_f_utf_character_is_whitespace_modifier(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_whitespace_modifier(const f_utf_character_t character, const uint8_t width) { if (width == 2) { @@ -2088,7 +2088,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_modifier_) #if !defined(_di_f_utf_character_is_whitespace_other_) || !defined(_di_f_utf_is_whitespace_other_) - f_return_status private_f_utf_character_is_whitespace_other(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_whitespace_other(const f_utf_character_t character, const uint8_t width) { // Ogham: U+1680 (isn't whitespace but is technically considered one: ( )). if (character == 0xe19a8000) { @@ -2100,7 +2100,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_whitespace_other_) || !defined(_di_f_utf_is_whitespace_other_) #if !defined(_di_f_utf_character_is_word_) || !defined(_di_f_utf_is_word_) - f_return_status private_f_utf_character_is_word(const f_utf_character character, const uint8_t width, const bool strict) { + f_return_status private_f_utf_character_is_word(const f_utf_character_t character, const uint8_t width, const bool strict) { if (private_f_utf_character_is_alpha_digit(character, width)) { return F_true; @@ -2109,7 +2109,7 @@ extern "C" { if (width == 3) { // reduce the number of checks by grouping checks by first byte. - const uint8_t byte_first = f_macro_utf_character_to_char_1(character); + const uint8_t byte_first = f_macro_utf_character_t_to_char_1(character); if (byte_first == 0xe2) { @@ -2144,7 +2144,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_word_) || !defined(_di_f_utf_is_word_) #if !defined(_di_f_utf_character_is_word_dash_) || !defined(_di_f_utf_is_word_dash_) - f_return_status private_f_utf_character_is_word_dash(const f_utf_character character, const uint8_t width, const bool strict) { + f_return_status private_f_utf_character_is_word_dash(const f_utf_character_t character, const uint8_t width, const bool strict) { if (private_f_utf_character_is_word(character, width, strict)) { return F_true; @@ -2163,7 +2163,7 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_word_dash_) || !defined(_di_f_utf_is_word_dash_) #if !defined(_di_f_utf_character_is_word_dash_plus_) || !defined(_di_f_utf_is_word_dash_plus_) - f_return_status private_f_utf_character_is_word_dash_plus(const f_utf_character character, const uint8_t width, const bool strict) { + f_return_status private_f_utf_character_is_word_dash_plus(const f_utf_character_t character, const uint8_t width, const bool strict) { if (private_f_utf_character_is_word_dash(character, width, strict)) { return F_true; @@ -2182,9 +2182,9 @@ extern "C" { #endif // !defined(_di_f_utf_character_is_word_dash_plus_) || !defined(_di_f_utf_is_word_dash_plus_) #if !defined(_di_f_utf_character_is_zero_width_) || !defined(_di_f_utf_is_zero_width_) - f_return_status private_f_utf_character_is_zero_width(const f_utf_character character, const uint8_t width) { + f_return_status private_f_utf_character_is_zero_width(const f_utf_character_t character, const uint8_t width) { // reduce the number of checks by grouping checks by first byte. - const uint8_t byte_first = f_macro_utf_character_to_char_1(character); + const uint8_t byte_first = f_macro_utf_character_t_to_char_1(character); if (byte_first == 0xe1) { diff --git a/level_0/f_utf/c/private-utf.h b/level_0/f_utf/c/private-utf.h index f34a83d..2f0767f 100644 --- a/level_0/f_utf/c/private-utf.h +++ b/level_0/f_utf/c/private-utf.h @@ -36,7 +36,7 @@ extern "C" { * @see f_utf_is_alpha() */ #if !defined(_di_f_utf_character_is_alpha_) || !defined(_di_f_utf_is_alpha_) - extern f_return_status private_f_utf_character_is_alpha(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_alpha(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_alpha_) || !defined(_di_f_utf_is_alpha_) /** @@ -58,7 +58,7 @@ extern "C" { * @see f_utf_is_alpha_digit() */ #if !defined(_di_f_utf_character_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_digit_) - extern f_return_status private_f_utf_character_is_alpha_digit(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_alpha_digit(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_digit_) /** @@ -80,7 +80,7 @@ extern "C" { * @see f_utf_is_alpha_numeric() */ #if !defined(_di_f_utf_character_is_alpha_numeric_) || !defined(_di_f_utf_is_alpha_numeric_) - extern f_return_status private_f_utf_character_is_alpha_numeric(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_alpha_numeric(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_alpha_numeric_) || !defined(_di_f_utf_is_alpha_numeric_) /** @@ -102,7 +102,7 @@ extern "C" { * @see f_utf_is_ascii() */ #if !defined(_di_f_utf_character_is_ascii_) || !defined(_di_f_utf_is_ascii_) - extern f_return_status private_f_utf_character_is_ascii(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_ascii(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_ascii_) || !defined(_di_f_utf_is_ascii_) /** @@ -124,7 +124,7 @@ extern "C" { * @see f_utf_is_combining() */ #if !defined(_di_f_utf_character_is_combining_) || !defined(_di_f_utf_is_combining_) - extern f_return_status private_f_utf_character_is_combining(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_combining(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_combining_) || !defined(_di_f_utf_is_combining_) /** @@ -146,7 +146,7 @@ extern "C" { * @see f_utf_is_control() */ #if !defined(_di_f_utf_character_is_control_) || !defined(_di_f_utf_is_control_) - extern f_return_status private_f_utf_character_is_control(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_control(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_control_) || !defined(_di_f_utf_is_control_) /** @@ -168,7 +168,7 @@ extern "C" { * @see f_utf_is_control_picture() */ #if !defined(_di_f_utf_character_is_control_picture_) || !defined(_di_f_utf_is_control_picture_) - extern f_return_status private_f_utf_character_is_control_picture(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_control_picture(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_control_picture_) || !defined(_di_f_utf_is_control_picture_) /** @@ -190,7 +190,7 @@ extern "C" { * @see f_utf_is_digit() */ #if !defined(_di_f_utf_character_is_digit_) || !defined(_di_f_utf_is_digit_) - extern f_return_status private_f_utf_character_is_digit(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_digit(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_digit_) || !defined(_di_f_utf_is_digit_) /** @@ -212,7 +212,7 @@ extern "C" { * @see f_utf_is_emoji() */ #if !defined(_di_f_utf_character_is_emoji_) || !defined(_di_f_utf_is_emoji_) - extern f_return_status private_f_utf_character_is_emoji(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_emoji(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_emoji_) || !defined(_di_f_utf_is_emoji_) /** @@ -234,7 +234,7 @@ extern "C" { * @see f_utf_is_numeric() */ #if !defined(_di_f_utf_character_is_numeric_) || !defined(_di_f_utf_is_numeric_) - extern f_return_status private_f_utf_character_is_numeric(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_numeric(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_numeric_) || !defined(_di_f_utf_is_numeric_) /** @@ -256,7 +256,7 @@ extern "C" { * @see f_utf_is_phonetic() */ #if !defined(_di_f_utf_character_is_phonetic_) || !defined(_di_f_utf_is_phonetic_) - extern f_return_status private_f_utf_character_is_phonetic(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_phonetic(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_phonetic_) || !defined(_di_f_utf_is_phonetic_) /** @@ -278,7 +278,7 @@ extern "C" { * @see f_utf_is_private() */ #if !defined(_di_f_utf_character_is_private_) || !defined(_di_f_utf_is_private_) - extern f_return_status private_f_utf_character_is_private(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_private(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_private_) || !defined(_di_f_utf_is_private_) /** @@ -300,7 +300,7 @@ extern "C" { * @see f_utf_is_punctuation() */ #if !defined(_di_f_utf_character_is_punctuation_) || !defined(_di_f_utf_is_punctuation_) - extern f_return_status private_f_utf_character_is_punctuation(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_punctuation(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_punctuation_) || !defined(_di_f_utf_is_punctuation_) /** @@ -322,7 +322,7 @@ extern "C" { * @see f_utf_is_symbol() */ #if !defined(_di_f_utf_character_is_symbol_) || !defined(_di_f_utf_is_symbol_) - extern f_return_status private_f_utf_character_is_symbol(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_symbol(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_symbol_) || !defined(_di_f_utf_is_symbol_) /** @@ -344,7 +344,7 @@ extern "C" { * @see f_utf_is_unassigned() */ #if !defined(_di_f_utf_character_is_unassigned_) || !defined(_di_f_utf_is_unassigned_) - extern f_return_status private_f_utf_character_is_unassigned(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_unassigned(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_unassigned_) || !defined(_di_f_utf_is_unassigned_) /** @@ -366,7 +366,7 @@ extern "C" { * @see f_utf_is_valid() */ #if !defined(_di_f_utf_character_is_valid_) || !defined(_di_f_utf_is_valid_) - extern f_return_status private_f_utf_character_is_valid(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_valid(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_valid_) || !defined(_di_f_utf_is_valid_) /** @@ -388,7 +388,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #if !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_) - extern f_return_status private_f_utf_character_is_whitespace(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_whitespace(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_) /** @@ -410,7 +410,7 @@ extern "C" { * @see f_utf_is_whitespace_modifier() */ #if !defined(_di_f_utf_character_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_modifier_) - extern f_return_status private_f_utf_character_is_whitespace_modifier(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_whitespace_modifier(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_modifier_) /** @@ -432,7 +432,7 @@ extern "C" { * @see f_utf_is_whitespace_other() */ #if !defined(_di_f_utf_character_is_whitespace_other_) || !defined(_di_f_utf_is_whitespace_other_) - extern f_return_status private_f_utf_character_is_whitespace_other(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_whitespace_other(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_whitespace_other_) || !defined(_di_f_utf_is_whitespace_other_) /** @@ -458,7 +458,7 @@ extern "C" { * @see f_utf_is_word() */ #if !defined(_di_f_utf_character_is_word_) || !defined(_di_f_utf_is_word_) - extern f_return_status private_f_utf_character_is_word(const f_utf_character character, const uint8_t width, const bool strict) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_word(const f_utf_character_t character, const uint8_t width, const bool strict) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_word_) || !defined(_di_f_utf_is_word_) /** @@ -484,7 +484,7 @@ extern "C" { * @see f_utf_is_word_dash() */ #if !defined(_di_f_utf_character_is_word_dash_) || !defined(_di_f_utf_is_word_dash_) - extern f_return_status private_f_utf_character_is_word_dash(const f_utf_character character, const uint8_t width, const bool strict) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_word_dash(const f_utf_character_t character, const uint8_t width, const bool strict) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_word_dash_) || !defined(_di_f_utf_is_word_dash_) /** @@ -510,7 +510,7 @@ extern "C" { * @see f_utf_is_word_dash_plus() */ #if !defined(_di_f_utf_character_is_word_dash_plus_) || !defined(_di_f_utf_is_word_dash_plus_) - extern f_return_status private_f_utf_character_is_word_dash_plus(const f_utf_character character, const uint8_t width, const bool strict) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_word_dash_plus(const f_utf_character_t character, const uint8_t width, const bool strict) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_word_dash_plus_) || !defined(_di_f_utf_is_word_dash_plus_) /** @@ -532,7 +532,7 @@ extern "C" { * @see f_utf_is_zero_width() */ #if !defined(_di_f_utf_character_is_zero_width_) || !defined(_di_f_utf_is_zero_width_) - extern f_return_status private_f_utf_character_is_zero_width(const f_utf_character character, const uint8_t width) f_gcc_attribute_visibility_internal; + extern f_return_status private_f_utf_character_is_zero_width(const f_utf_character_t character, const uint8_t width) f_gcc_attribute_visibility_internal; #endif // !defined(_di_f_utf_character_is_zero_width_) || !defined(_di_f_utf_is_zero_width_) #ifdef __cplusplus diff --git a/level_0/f_utf/c/utf-common.h b/level_0/f_utf/c/utf-common.h index d5e3960..8788a63 100644 --- a/level_0/f_utf/c/utf-common.h +++ b/level_0/f_utf/c/utf-common.h @@ -65,21 +65,21 @@ extern "C" { * * The byte structure is intended to be read left to right. * - * The f_macro_utf_character_mask_byte_* are used to get the entire character set fo a given width. + * The f_macro_utf_character_t_mask_byte_* are used to get the entire character set fo a given width. * - * The f_macro_utf_character_mask_char_* are used to get a specific UTF-8 block as a single character range. + * The f_macro_utf_character_t_mask_char_* are used to get a specific UTF-8 block as a single character range. * - * The f_macro_utf_character_to_char_* are used to convert a f_utf_character into a int8_t, for a given 8-bit block. + * The f_macro_utf_character_t_to_char_* are used to convert a f_utf_character_t into a int8_t, for a given 8-bit block. * - * The f_macro_utf_character_from_char_* are used to convert a int8_t into part of a f_utf_character, for a given 8-bit block. + * The f_macro_utf_character_t_from_char_* are used to convert a int8_t into part of a f_utf_character_t, for a given 8-bit block. * - * The f_macro_utf_character_width is used to determine the width of the UTF-8 character based on f_macro_utf_byte_width. - * The f_macro_utf_character_width_is is used to determine the width of the UTF-8 character based on f_macro_utf_byte_width_is. + * The f_macro_utf_character_t_width is used to determine the width of the UTF-8 character based on f_macro_utf_byte_width. + * The f_macro_utf_character_t_width_is is used to determine the width of the UTF-8 character based on f_macro_utf_byte_width_is. * * @see f_utf_is_big_endian() */ -#ifndef _di_f_utf_character_ - typedef uint32_t f_utf_character; +#ifndef _di_f_utf_character_t_ + typedef uint32_t f_utf_character_t; #define f_utf_character_mask_byte_1 0xff000000 // 1111 1111, 0000 0000, 0000 0000, 0000 0000 #define f_utf_character_mask_byte_2 0xffff0000 // 1111 1111, 1111 1111, 0000 0000, 0000 0000 @@ -91,119 +91,113 @@ extern "C" { #define f_utf_character_mask_char_3 0x0000ff00 // 0000 0000, 0000 0000, 1111 1111, 0000 0000 #define f_utf_character_mask_char_4 0x000000ff // 0000 0000, 0000 0000, 0000 0000, 1111 1111 - #define f_macro_utf_character_to_char_1(character) (((character) & f_utf_character_mask_char_1) >> 24) // grab first byte. - #define f_macro_utf_character_to_char_2(character) (((character) & f_utf_character_mask_char_2) >> 16) // grab second byte. - #define f_macro_utf_character_to_char_3(character) (((character) & f_utf_character_mask_char_3) >> 8) // grab third byte. - #define f_macro_utf_character_to_char_4(character) ((character) & f_utf_character_mask_char_4) // grab fourth byte. + #define f_macro_utf_character_t_to_char_1(character) (((character) & f_utf_character_mask_char_1) >> 24) // grab first byte. + #define f_macro_utf_character_t_to_char_2(character) (((character) & f_utf_character_mask_char_2) >> 16) // grab second byte. + #define f_macro_utf_character_t_to_char_3(character) (((character) & f_utf_character_mask_char_3) >> 8) // grab third byte. + #define f_macro_utf_character_t_to_char_4(character) ((character) & f_utf_character_mask_char_4) // grab fourth byte. - #define f_macro_utf_character_from_char_1(character) (((character) << 24) & f_utf_character_mask_char_1) // shift to first byte. - #define f_macro_utf_character_from_char_2(character) (((character) << 16) & f_utf_character_mask_char_2) // shift to second byte. - #define f_macro_utf_character_from_char_3(character) (((character) << 8) & f_utf_character_mask_char_3) // shift to third byte. - #define f_macro_utf_character_from_char_4(character) ((character) & f_utf_character_mask_char_4) // shift to fourth byte. + #define f_macro_utf_character_t_from_char_1(character) (((character) << 24) & f_utf_character_mask_char_1) // shift to first byte. + #define f_macro_utf_character_t_from_char_2(character) (((character) << 16) & f_utf_character_mask_char_2) // shift to second byte. + #define f_macro_utf_character_t_from_char_3(character) (((character) << 8) & f_utf_character_mask_char_3) // shift to third byte. + #define f_macro_utf_character_t_from_char_4(character) ((character) & f_utf_character_mask_char_4) // shift to fourth byte. - #define f_macro_utf_character_width(character) (f_macro_utf_byte_width(f_macro_utf_character_to_char_1(character))) - #define f_macro_utf_character_width_is(character) (f_macro_utf_byte_width_is(f_macro_utf_character_to_char_1(character))) -#endif // _di_f_utf_character_ + #define f_macro_utf_character_t_width(character) (f_macro_utf_byte_width(f_macro_utf_character_t_to_char_1(character))) + #define f_macro_utf_character_t_width_is(character) (f_macro_utf_byte_width_is(f_macro_utf_character_t_to_char_1(character))) +#endif // _di_f_utf_character_t_ -#ifndef _di_f_utf_character_have_eol_ - #define f_utf_character_eol 0x0a000000 // 0000 1010, 0000 0000, 0000 0000, 0000 0000 -#endif // _di_f_utf_character_have_eol_ - -#ifndef _di_f_utf_character_have_eos_ - #define f_utf_character_eos 0x00000000 // 0000 0000, 0000 0000, 0000 0000, 0000 0000 -#endif // _di_f_utf_character_have_eos_ - -#ifndef _di_f_utf_character_have_placeholder_ - #define f_utf_character_placeholder 0x00000000 // 0000 0000, 0000 0000, 0000 0000, 0000 0000 -#endif // _di_f_utf_character_have_placeholder_ +#ifndef _di_f_utf_character_t_codes_ + #define f_utf_character_t_eol 0x0a000000 // 0000 1010, 0000 0000, 0000 0000, 0000 0000 + #define f_utf_character_t_eos 0x00000000 // 0000 0000, 0000 0000, 0000 0000, 0000 0000 + #define f_utf_character_t_placeholder 0x00000000 // 0000 0000, 0000 0000, 0000 0000, 0000 0000 +#endif // _di_f_utf_character_t_codes_ /** * Provide a UTF-8 characters set to 4-bits wide as a string. */ -#ifndef _di_f_utf_string_ - typedef f_utf_character *f_utf_string; +#ifndef _di_f_utf_string_t_ + typedef f_utf_character_t *f_utf_string_t; - #define f_utf_string_max_size f_type_number_size_unsigned - #define f_utf_string_initialize f_utf_character_eos + #define f_utf_string_t_size_max f_number_t_size_unsigned + #define f_utf_string_t_initialize f_utf_character_t_eos - #define f_macro_utf_string_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_utf_string), length) + #define f_macro_utf_string_t_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_utf_string_t), length) - #define f_macro_utf_string_delete(status, string, size) status = f_memory_delete((void **) & string, sizeof(f_utf_string), size) - #define f_macro_utf_string_destroy(status, string, size) status = f_memory_destroy((void **) & string, sizeof(f_utf_string), size) + #define f_macro_utf_string_t_delete(status, string, size) status = f_memory_delete((void **) & string, sizeof(f_utf_string_t), size) + #define f_macro_utf_string_t_destroy(status, string, size) status = f_memory_destroy((void **) & string, sizeof(f_utf_string_t), size) - #define f_macro_utf_string_resize(status, string, old_length, new_length) status = f_memory_resize((void **) & string, sizeof(f_utf_string), old_length, new_length) - #define f_macro_utf_string_adjust(status, string, old_length, new_length) status = f_memory_adjust((void **) & string, sizeof(f_utf_string), old_length, new_length) -#endif // _di_f_utf_string_ + #define f_macro_utf_string_t_resize(status, string, old_length, new_length) status = f_memory_resize((void **) & string, sizeof(f_utf_string_t), old_length, new_length) + #define f_macro_utf_string_t_adjust(status, string, old_length, new_length) status = f_memory_adjust((void **) & string, sizeof(f_utf_string_t), old_length, new_length) +#endif // _di_f_utf_string_t_ /** * Provide a type specifically for UTF-8 strings. */ -#ifndef _di_f_utf_string_length_ - typedef f_number_unsigned f_utf_string_length; +#ifndef _di_f_utf_string_length_t_ + typedef f_number_unsigned_t f_utf_string_length_t; - #define f_utf_string_length_size 0xfffffffffffffffe - #define f_utf_string_length_size_max f_type_number_size_max_unsigned + #define f_utf_string_length_t_size 0xfffffffffffffffe + #define f_utf_string_length_t_size_max f_number_t_size_max_unsigned - #define f_macro_utf_string_length_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_utf_string_length), length) + #define f_macro_utf_string_length_t_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_utf_string_length_t), length) - #define f_macro_utf_string_length_delete(status, string, length) status = f_memory_delete((void **) & string, sizeof(f_utf_string_length), length) - #define f_macro_utf_string_length_destroy(status, string, size) status = f_memory_destroy((f_void_P *) & string, sizeof(f_utf_string_length), size) + #define f_macro_utf_string_length_t_delete(status, string, length) status = f_memory_delete((void **) & string, sizeof(f_utf_string_length_t), length) + #define f_macro_utf_string_length_t_destroy(status, string, size) status = f_memory_destroy((f_void_P *) & string, sizeof(f_utf_string_length_t), size) - #define f_macro_utf_string_length_resize(status, length, old_length, new_length) status = f_memory_resize((void **) & length, sizeof(f_utf_string_length), old_length, new_length) - #define f_macro_utf_string_length_adjust(status, length, old_length, new_length) status = f_memory_adjust((void **) & length, sizeof(f_utf_string_length), old_length, new_length) -#endif // _di_f_utf_string_length_ + #define f_macro_utf_string_length_t_resize(status, length, old_length, new_length) status = f_memory_resize((void **) & length, sizeof(f_utf_string_length_t), old_length, new_length) + #define f_macro_utf_string_length_t_adjust(status, length, old_length, new_length) status = f_memory_adjust((void **) & length, sizeof(f_utf_string_length_t), old_length, new_length) +#endif // _di_f_utf_string_length_t_ /** * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_utf_string_lengths_ +#ifndef _di_f_utf_string_lengths_t_ typedef struct { - f_utf_string_length *array; + f_utf_string_length_t *array; - f_array_length size; - f_array_length used; - } f_utf_string_lengths; + f_array_length_t size; + f_array_length_t used; + } f_utf_string_lengths_t; - #define f_utf_string_lengths_initialize { 0, 0, 0 } + #define f_utf_string_lengths_t_initialize { 0, 0, 0 } - #define f_macro_utf_string_lengths_clear(lengths) f_macro_memory_structure_clear(lengths) + #define f_macro_utf_string_lengths_t_clear(lengths) f_macro_memory_structure_t_clear(lengths) - #define f_macro_utf_string_lengths_new(status, lengths, length) f_macro_memory_structure_new(status, lengths, f_utf_string_length, length) + #define f_macro_utf_string_lengths_t_new(status, lengths, length) f_macro_memory_structure_t_new(status, lengths, f_utf_string_length_t, length) - #define f_macro_utf_string_lengths_delete(status, lengths) f_macro_memory_structure_delete(status, lengths, f_utf_string_length) - #define f_macro_utf_string_lengths_destroy(status, lengths) f_macro_memory_structure_destroy(status, lengths, f_utf_string_length) + #define f_macro_utf_string_lengths_t_delete(status, lengths) f_macro_memory_structure_t_delete(status, lengths, f_utf_string_length_t) + #define f_macro_utf_string_lengths_t_destroy(status, lengths) f_macro_memory_structure_t_destroy(status, lengths, f_utf_string_length_t) - #define f_macro_utf_string_lengths_resize(status, lengths, new_length) f_macro_memory_structure_resize(status, lengths, f_utf_string_length, new_length) - #define f_macro_utf_string_lengths_adjust(status, lengths, new_length) f_macro_memory_structure_adjust(status, lengths, f_utf_string_length, new_length) -#endif // _di_f_utf_string_lengths_ + #define f_macro_utf_string_lengths_t_resize(status, lengths, new_length) f_macro_memory_structure_t_resize(status, lengths, f_utf_string_length_t, new_length) + #define f_macro_utf_string_lengths_t_adjust(status, lengths, new_length) f_macro_memory_structure_t_adjust(status, lengths, f_utf_string_length_t, new_length) +#endif // _di_f_utf_string_lengths_t_ /** * Designates a start and stop position that represents a sub-string inside of some parent string. * use this to avoid resizing, restructuring, and reallocating the parent string to separate the sub-string. * - * A special f_macro_utf_string_range_initialize() is provided for the special purpose of easily initialize a static string range. + * A special f_macro_utf_string_range_t_initialize() is provided for the special purpose of easily initialize a static string range. */ -#ifndef _di_f_utf_string_range_ +#ifndef _di_f_utf_string_range_t_ typedef struct { - f_utf_string_length start; - f_utf_string_length stop; - } f_utf_string_range; + f_utf_string_length_t start; + f_utf_string_length_t stop; + } f_utf_string_range_t; - #define f_utf_string_range_initialize { 1, 0 } + #define f_utf_string_range_t_initialize { 1, 0 } - #define f_macro_utf_string_range_initialize(length) { length ? 0 : 1, length ? length - 1 : 0 } + #define f_macro_utf_string_range_t_initialize(length) { length ? 0 : 1, length ? length - 1 : 0 } - #define f_macro_utf_string_range_new(status, utf_string_range, length) status = f_memory_new((void **) & utf_string_range, sizeof(f_utf_string_range), length) - #define f_macro_utf_string_range_delete(status, utf_string_range, size) status = f_memory_delete((void **) & utf_string_range, sizeof(f_utf_string_range), size) - #define f_macro_utf_string_range_destroy(status, utf_string_range, size) status = f_memory_destroy((void **) & utf_string_range, sizeof(f_utf_string_range), size) + #define f_macro_utf_string_range_t_new(status, utf_string_range, length) status = f_memory_new((void **) & utf_string_range, sizeof(f_utf_string_range_t), length) + #define f_macro_utf_string_range_t_delete(status, utf_string_range, size) status = f_memory_delete((void **) & utf_string_range, sizeof(f_utf_string_range_t), size) + #define f_macro_utf_string_range_t_destroy(status, utf_string_range, size) status = f_memory_destroy((void **) & utf_string_range, sizeof(f_utf_string_range_t), size) - #define f_macro_utf_string_range_resize(status, utf_string_range, old_length, new_length) \ - status = f_memory_resize((void **) & utf_string_range, sizeof(f_utf_string_range), old_length, new_length) + #define f_macro_utf_string_range_t_resize(status, utf_string_range, old_length, new_length) \ + status = f_memory_resize((void **) & utf_string_range, sizeof(f_utf_string_range_t), old_length, new_length) - #define f_macro_utf_string_range_adjust(status, utf_string_range, old_length, new_length) \ - status = f_memory_adjust((void **) & utf_string_range, sizeof(f_utf_string_range), old_length, new_length) -#endif // _di_f_utf_string_range_ + #define f_macro_utf_string_range_t_adjust(status, utf_string_range, old_length, new_length) \ + status = f_memory_adjust((void **) & utf_string_range, sizeof(f_utf_string_range_t), old_length, new_length) +#endif // _di_f_utf_string_range_t_ /** * An array of string ranges. @@ -211,31 +205,31 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_utf_string_ranges_ +#ifndef _di_f_utf_string_ranges_t_ typedef struct { - f_utf_string_range *array; + f_utf_string_range_t *array; - f_array_length size; - f_array_length used; - } f_utf_string_ranges; + f_array_length_t size; + f_array_length_t used; + } f_utf_string_ranges_t; - #define f_utf_string_ranges_initialize {0, 0, 0} + #define f_utf_string_ranges_t_initialize {0, 0, 0} - #define f_clear_utf_string_ranges(ranges) f_macro_memory_structure_clear(ranges) + #define f_clear_utf_string_t_ranges(ranges) f_macro_memory_structure_t_clear(ranges) - #define f_macro_utf_string_range_news(status, ranges, length) f_macro_memory_structure_new(status, ranges, f_utf_string_range, length) + #define f_macro_utf_string_range_t_news(status, ranges, length) f_macro_memory_structure_t_new(status, ranges, f_utf_string_range_t, length) - #define f_macro_utf_string_range_deletes(status, ranges) f_macro_memory_structure_delete(status, ranges, f_utf_string_range) - #define f_macro_utf_string_range_destroys(status, ranges) f_macro_memory_structure_destroy(status, ranges, f_utf_string_range) + #define f_macro_utf_string_range_t_deletes(status, ranges) f_macro_memory_structure_t_delete(status, ranges, f_utf_string_range_t) + #define f_macro_utf_string_range_t_destroys(status, ranges) f_macro_memory_structure_t_destroy(status, ranges, f_utf_string_range_t) - #define f_macro_utf_string_range_resizes(status, ranges, new_length) f_macro_memory_structure_resize(status, ranges, f_utf_string_range, new_length) - #define f_macro_utf_string_range_adjusts(status, ranges, new_length) f_macro_memory_structure_adjust(status, ranges, f_utf_string_range, new_length) -#endif // _di_f_utf_string_ranges_ + #define f_macro_utf_string_range_t_resizes(status, ranges, new_length) f_macro_memory_structure_t_resize(status, ranges, f_utf_string_range_t, new_length) + #define f_macro_utf_string_range_t_adjusts(status, ranges, new_length) f_macro_memory_structure_t_adjust(status, ranges, f_utf_string_range_t, new_length) +#endif // _di_f_utf_string_ranges_t_ /** * Store string quantity. * - * Similar to f_utf_string_range, except total is relative to start and is not an absolute stop position. + * Similar to f_utf_string_range_t, except total is relative to start and is not an absolute stop position. * * Two common uses for when total is 0 is: * 1) Exactly that, process a total of 0 strings bytes. @@ -244,14 +238,14 @@ extern "C" { * start: The position where the string starts (based on some string/buffer). * total: The total number of elements within that string/buffer the quantity represents. */ -#ifndef _di_f_utf_string_quantity_ +#ifndef _di_f_utf_string_quantity_t_ typedef struct { - f_utf_string_length start; - f_utf_string_length total; - } f_utf_string_quantity; + f_utf_string_length_t start; + f_utf_string_length_t total; + } f_utf_string_quantity_t; - #define f_utf_string_quantity_initialize { 0, 0 } -#endif // _di_f_utf_string_quantity_ + #define f_utf_string_quantity_t_initialize { 0, 0 } +#endif // _di_f_utf_string_quantity_t_ /** * An array of string quantities. @@ -260,59 +254,59 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_utf_string_quantitys_ +#ifndef _di_f_utf_string_quantitys_t_ typedef struct { - f_utf_string_quantity *array; + f_utf_string_quantity_t *array; - f_array_length size; - f_array_length used; - } f_utf_string_quantitys; + f_array_length_t size; + f_array_length_t used; + } f_utf_string_quantitys_t; - #define f_utf_string_quantitys_initialize {0, 0, 0} + #define f_utf_string_quantitys_t_initialize {0, 0, 0} - #define f_macro_utf_string_quantitys_clear(quantitys) f_macro_memory_structure_clear(quantitys) + #define f_macro_utf_string_quantitys_t_clear(quantitys) f_macro_memory_structure_t_clear(quantitys) - #define f_macro_utf_string_quantitys_new(status, quantitys, length) f_macro_memory_structure_new(status, quantitys, f_utf_string_quantity, length) + #define f_macro_utf_string_quantitys_t_new(status, quantitys, length) f_macro_memory_structure_t_new(status, quantitys, f_utf_string_quantity_t, length) - #define f_macro_utf_string_quantitys_delete(status, quantitys) f_macro_memory_structure_delete(status, quantitys, f_utf_string_quantity) - #define f_macro_utf_string_quantitys_destroy(status, quantitys) f_macro_memory_structure_destroy(status, quantitys, f_utf_string_quantity) + #define f_macro_utf_string_quantitys_t_delete(status, quantitys) f_macro_memory_structure_t_delete(status, quantitys, f_utf_string_quantity_t) + #define f_macro_utf_string_quantitys_t_destroy(status, quantitys) f_macro_memory_structure_t_destroy(status, quantitys, f_utf_string_quantity_t) - #define f_macro_utf_string_quantitys_delete_simple(quantitys) f_macro_memory_structure_delete_simple(quantitys, f_utf_string_quantity) - #define f_macro_utf_string_quantitys_destroy_simple(quantitys) f_macro_memory_structure_destroy_simple(quantitys, f_utf_string_quantity) + #define f_macro_utf_string_quantitys_t_delete_simple(quantitys) f_macro_memory_structure_t_delete_simple(quantitys, f_utf_string_quantity_t) + #define f_macro_utf_string_quantitys_t_destroy_simple(quantitys) f_macro_memory_structure_t_destroy_simple(quantitys, f_utf_string_quantity_t) - #define f_macro_utf_string_quantitys_resize(status, quantitys, new_length) f_macro_memory_structure_resize(status, quantitys, f_utf_string_quantity, new_length) - #define f_macro_utf_string_quantitys_adjust(status, quantitys, new_length) f_macro_memory_structure_adjust(status, quantitys, f_utf_string_quantity, new_length) -#endif // _di_f_utf_string_quantitys_ + #define f_macro_utf_string_quantitys_t_resize(status, quantitys, new_length) f_macro_memory_structure_t_resize(status, quantitys, f_utf_string_quantity_t, new_length) + #define f_macro_utf_string_quantitys_t_adjust(status, quantitys, new_length) f_macro_memory_structure_t_adjust(status, quantitys, f_utf_string_quantity_t, new_length) +#endif // _di_f_utf_string_quantitys_t_ /** - * A string that is analogous to f_utf_string_dynamic but intended for static-only uses. + * A string that is analogous to f_utf_string_dynamic_t but intended for static-only uses. * - * The f_utf_string_static type should never be directly allocated or deallocated. + * The f_utf_string_static_t type should never be directly allocated or deallocated. * - * A special f_macro_utf_string_static_initialize() is provided for the special purpose of easily initialize a static string. + * A special f_macro_utf_string_static_t_initialize() is provided for the special purpose of easily initialize a static string. * * string: the string. * size: total amount of space available. * used: total number of space used. */ -#ifndef _di_f_utf_string_static_ +#ifndef _di_f_utf_string_static_t_ typedef struct { - f_utf_string string; + f_utf_string_t string; - f_utf_string_length size; - f_utf_string_length used; - } f_utf_string_static; + f_utf_string_length_t size; + f_utf_string_length_t used; + } f_utf_string_static_t; - #define f_utf_string_static_initialize { f_utf_string_initialize, 0, 0 } + #define f_utf_string_static_t_initialize { f_utf_string_t_initialize, 0, 0 } - #define f_macro_utf_string_static_clear(string_static) \ + #define f_macro_utf_string_static_t_clear(string_static) \ string_static.string = 0; \ string_static.size = 0; \ string_static.used = 0; - #define f_macro_utf_string_static_initialize(string, length) { string, length, length } -#endif // _di_f_string_static_ + #define f_macro_utf_string_static_t_initialize(string, length) { string, length, length } +#endif // _di_f_string_static_t_ /** * A string that supports contains a size attribute to handle dynamic allocations and deallocations. @@ -321,59 +315,59 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_utf_string_dynamic_ - typedef f_utf_string_static f_utf_string_dynamic; +#ifndef _di_f_utf_string_dynamic_t_ + typedef f_utf_string_static_t f_utf_string_dynamic_t; - #define f_utf_string_dynamic_initialize f_utf_string_static_initialize + #define f_utf_string_dynamic_t_initialize f_utf_string_static_t_initialize - #define f_clear_utf_string_dynamic(dynamic) f_macro_utf_string_static_clear(dynamic) + #define f_clear_utf_string_dynamic_t(dynamic) f_macro_utf_string_static_t_clear(dynamic) - #define f_macro_utf_string_dynamic_new(status, dynamic, new_length) \ - f_clear_utf_string_dynamic(dynamic) \ - status = f_memory_new((void **) & dynamic.string, sizeof(f_utf_string), new_length); \ + #define f_macro_utf_string_dynamic_t_new(status, dynamic, new_length) \ + f_clear_utf_string_dynamic_t(dynamic) \ + status = f_memory_new((void **) & dynamic.string, sizeof(f_utf_string_t), new_length); \ if (status == F_none) { \ dynamic.size = new_length; \ dynamic.used = 0; \ } - #define f_macro_utf_string_dynamic_delete(status, dynamic) \ - status = f_memory_delete((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size); \ + #define f_macro_utf_string_dynamic_t_delete(status, dynamic) \ + status = f_memory_delete((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size); \ if (status == F_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } - #define f_macro_utf_string_dynamic_destroy(status, dynamic) \ - status = f_memory_destroy((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size); \ + #define f_macro_utf_string_dynamic_t_destroy(status, dynamic) \ + status = f_memory_destroy((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size); \ if (status == F_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } - #define f_macro_utf_string_dynamic_delete_simple(dynamic) \ - f_memory_delete((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size); \ + #define f_macro_utf_string_dynamic_t_delete_simple(dynamic) \ + f_memory_delete((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size); \ dynamic.size = 0; \ dynamic.used = 0; - #define f_macro_utf_string_dynamic_destroy_simple(dynamic) \ - f_memory_destroy((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size); \ + #define f_macro_utf_string_dynamic_t_destroy_simple(dynamic) \ + f_memory_destroy((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size); \ dynamic.size = 0; \ dynamic.used = 0; - #define f_macro_utf_string_dynamic_resize(status, dynamic, new_length) \ - status = f_memory_resize((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size, new_length); \ + #define f_macro_utf_string_dynamic_t_resize(status, dynamic, new_length) \ + status = f_memory_resize((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size, new_length); \ if (status == F_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ } - #define f_macro_utf_string_dynamic_adjust(status, dynamic, new_length) \ - status = f_memory_adjust((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size, new_length); \ + #define f_macro_utf_string_dynamic_t_adjust(status, dynamic, new_length) \ + status = f_memory_adjust((void **) & dynamic.string, sizeof(f_utf_string_t), dynamic.size, new_length); \ if (status == F_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ } -#endif // _di_f_utf_string_dynamic_ +#endif // _di_f_utf_string_dynamic_t_ /** * An array of dynamic utf_strings. @@ -381,113 +375,113 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_f_utf_string_dynamics_ +#ifndef _di_f_utf_string_dynamics_t_ typedef struct { - f_utf_string_dynamic *array; + f_utf_string_dynamic_t *array; - f_utf_string_length size; - f_utf_string_length used; - } f_utf_string_dynamics; + f_utf_string_length_t size; + f_utf_string_length_t used; + } f_utf_string_dynamics_t; - #define f_utf_string_dynamics_initialize { 0, 0, 0 } + #define f_utf_string_dynamics_t_initialize { 0, 0, 0 } - #define f_clear_utf_string_dynamics(dynamics) \ + #define f_clear_utf_string_dynamics_t(dynamics) \ dynamics.array = 0; \ dynamics.size = 0; \ dynamics.used = 0; - #define f_macro_utf_string_dynamics_new(status, dynamics, length) \ + #define f_macro_utf_string_dynamics_t_new(status, dynamics, length) \ dynamics.array = 0; \ dynamics.size = 0; \ dynamics.used = 0; \ - status = f_memory_new((void **) & dynamics.array, sizeof(f_utf_string_dynamic), length); \ + status = f_memory_new((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), length); \ if (status == F_none) { \ dynamics.size = length; \ dynamics.used = 0; \ } - #define f_macro_utf_string_dynamics_delete(status, dynamics) \ + #define f_macro_utf_string_dynamics_t_delete(status, dynamics) \ status = F_none; \ while (dynamics.size > 0) { \ --dynamics.size; \ - f_macro_utf_string_dynamic_destroy(status, dynamics.array[dynamics.size]); \ + f_macro_utf_string_dynamic_t_destroy(status, dynamics.array[dynamics.size]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_delete((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size); \ + if (status == F_none) status = f_memory_delete((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size); \ if (status == F_none) dynamics.used = 0; - #define f_macro_utf_string_dynamics_destroy(status, dynamics) \ + #define f_macro_utf_string_dynamics_t_destroy(status, dynamics) \ status = F_none; \ while (dynamics.size > 0) { \ --dynamics.size; \ - f_macro_utf_string_dynamic_destroy(status, dynamics.array[dynamics.size]); \ + f_macro_utf_string_dynamic_t_destroy(status, dynamics.array[dynamics.size]); \ if (status != F_none) break; \ } \ - if (status == F_none) status = f_memory_destroy((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size); \ + if (status == F_none) status = f_memory_destroy((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size); \ if (status == F_none) dynamics.used = 0; - #define f_macro_utf_string_dynamics_delete_simple(dynamics) \ + #define f_macro_utf_string_dynamics_t_delete_simple(dynamics) \ dynamics.used = dynamics.size; \ while (dynamics.used > 0) { \ dynamics.used--; \ - f_macro_string_dynamic_delete_simple(dynamics.array[dynamics.used]); \ + f_macro_string_dynamic_t_delete_simple(dynamics.array[dynamics.used]); \ if (dynamics.used == 0) { \ - if (f_memory_delete((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size)) { \ + if (f_memory_delete((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size)) { \ dynamics.size = 0; \ } \ } \ } - #define f_macro_utf_string_dynamics_destroy_simple(dynamics) \ + #define f_macro_utf_string_dynamics_t_destroy_simple(dynamics) \ dynamics.used = dynamics.size; \ while (dynamics.used > 0) { \ dynamics.used--; \ - f_macro_string_dynamic_destroy_simple(dynamics.array[dynamics.used]); \ + f_macro_string_dynamic_t_destroy_simple(dynamics.array[dynamics.used]); \ if (dynamics.used == 0) { \ - if (f_memory_destroy((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size)) { \ + if (f_memory_destroy((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size)) { \ dynamics.size = 0; \ } \ } \ } - #define f_macro_utf_string_dynamics_resize(status, dynamics, new_length) \ + #define f_macro_utf_string_dynamics_t_resize(status, dynamics, new_length) \ status = F_none; \ if (new_length < dynamics.size) { \ - for (f_utf_string_length _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \ - f_macro_utf_string_dynamic_destroy(status, dynamics.array[_macro__i]); \ + for (f_utf_string_length_t _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \ + f_macro_utf_string_dynamic_t_destroy(status, dynamics.array[_macro__i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size, new_length); \ if (status == F_none) { \ if (new_length > dynamics.size) { \ - for (f_utf_string_length _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ - memset(&dynamics.array[_macro__i], 0, sizeof(f_utf_string_dynamic)); \ + for (f_utf_string_length_t _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ + memset(&dynamics.array[_macro__i], 0, sizeof(f_utf_string_dynamic_t)); \ } \ } \ dynamics.size = new_length; \ if (dynamics.used > dynamics.size) dynamics.used = new_length; \ } - #define f_macro_utf_string_dynamics_adjust(status, dynamics, new_length) \ + #define f_macro_utf_string_dynamics_t_adjust(status, dynamics, new_length) \ status = F_none; \ if (new_length < dynamics.size) { \ - for (f_utf_string_length _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \ - f_macro_utf_string_dynamic_destroy(status, dynamics.array[_macro__i], f_utf_string_dynamic); \ + for (f_utf_string_length_t _macro__i = dynamics.size - new_length; _macro__i < dynamics.size; _macro__i++) { \ + f_macro_utf_string_dynamic_t_destroy(status, dynamics.array[_macro__i], f_utf_string_dynamic_t); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_utf_string_dynamic_t), dynamics.size, new_length); \ if (status == F_none) { \ if (new_length > dynamics.size) { \ - for (f_utf_string_length _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ - memset(&dynamics.array[_macro__i], 0, sizeof(f_utf_string_dynamic)); \ + for (f_utf_string_length_t _macro__i = dynamics.size; _macro__i < new_length; _macro__i++) { \ + memset(&dynamics.array[_macro__i], 0, sizeof(f_utf_string_dynamic_t)); \ } \ } \ dynamics.size = new_length; \ if (dynamics.used > dynamics.size) dynamics.used = new_length; \ } -#endif // _di_f_utf_string_dynamic_ +#endif // _di_f_utf_string_dynamic_t_ /** * Define the UTF-8 general whitespace codes. diff --git a/level_0/f_utf/c/utf.c b/level_0/f_utf/c/utf.c index 32f2363..b103fd6 100644 --- a/level_0/f_utf/c/utf.c +++ b/level_0/f_utf/c/utf.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_f_utf_buffer_decrement_ - f_return_status f_utf_buffer_decrement(const f_string_static buffer, f_string_range *range, const f_string_length step) { + f_return_status f_utf_buffer_decrement(const f_string_static_t buffer, f_string_range_t *range, const f_string_length_t step) { #ifndef _di_level_0_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (range->start > range->stop) return F_status_set_error(F_parameter); @@ -16,7 +16,7 @@ extern "C" { if (buffer.used == 0) return F_data_not; - f_string_length i = 0; + f_string_length_t i = 0; uint8_t width = 0; do { @@ -39,7 +39,7 @@ extern "C" { #endif // _di_f_utf_buffer_decrement_ #ifndef _di_f_utf_buffer_increment_ - f_return_status f_utf_buffer_increment(const f_string_static buffer, f_string_range *range, const f_string_length step) { + f_return_status f_utf_buffer_increment(const f_string_static_t buffer, f_string_range_t *range, const f_string_length_t step) { #ifndef _di_level_0_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (range->start > range->stop) return F_status_set_error(F_parameter); @@ -49,7 +49,7 @@ extern "C" { if (buffer.used == 0) return F_data_not; - f_string_length i = 0; + f_string_length_t i = 0; uint8_t width = 0; do { @@ -81,8 +81,8 @@ extern "C" { #endif // _di_f_utf_buffer_increment_ #ifndef _di_f_utf_character_is_ - f_return_status f_utf_character_is(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { return F_false; @@ -97,11 +97,11 @@ extern "C" { #endif // _di_f_utf_character_is_ #ifndef _di_f_utf_character_is_alpha_ - f_return_status f_utf_character_is_alpha(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_alpha(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (isalpha(f_macro_utf_character_to_char_1(character))) { + if (isalpha(f_macro_utf_character_t_to_char_1(character))) { return F_true; } @@ -117,11 +117,11 @@ extern "C" { #endif // _di_f_utf_character_is_alpha_ #ifndef _di_f_utf_character_is_alpha_digit_ - f_return_status f_utf_character_is_alpha_digit(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_alpha_digit(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (isalnum(f_macro_utf_character_to_char_1(character))) { + if (isalnum(f_macro_utf_character_t_to_char_1(character))) { return F_true; } @@ -137,11 +137,11 @@ extern "C" { #endif // _di_f_utf_character_is_alpha_digit_ #ifndef _di_f_utf_character_is_alpha_numeric_ - f_return_status f_utf_character_is_alpha_numeric(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_alpha_numeric(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (isalnum(f_macro_utf_character_to_char_1(character))) { + if (isalnum(f_macro_utf_character_t_to_char_1(character))) { return F_true; } @@ -157,8 +157,8 @@ extern "C" { #endif // _di_f_utf_character_is_alpha_numeric_ #ifndef _di_f_utf_character_is_ascii_ - f_return_status f_utf_character_is_ascii(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_ascii(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 1) { return F_status_is_error(F_utf); @@ -169,8 +169,8 @@ extern "C" { #endif // _di_f_utf_character_is_ascii_ #ifndef _di_f_utf_character_is_combining_ - f_return_status f_utf_character_is_combining(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_combining(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { // There are no combining characters in ASCII. @@ -190,11 +190,11 @@ extern "C" { #endif // _di_f_utf_character_is_combining_ #ifndef _di_f_utf_character_is_control_ - f_return_status f_utf_character_is_control(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_control(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (iscntrl(f_macro_utf_character_to_char_1(character))) { + if (iscntrl(f_macro_utf_character_t_to_char_1(character))) { return F_true; } @@ -210,8 +210,8 @@ extern "C" { #endif // _di_f_utf_character_is_control_ #ifndef _di_f_utf_character_is_control_picture_ - f_return_status f_utf_character_is_control_picture(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_control_picture(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { // There are no control picture characters in ASCII. @@ -231,11 +231,11 @@ extern "C" { #endif // _di_f_utf_character_is_control_picture_ #ifndef _di_f_utf_character_is_digit_ - f_return_status f_utf_character_is_digit(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_digit(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (isdigit(f_macro_utf_character_to_char_1(character))) { + if (isdigit(f_macro_utf_character_t_to_char_1(character))) { return F_true; } @@ -251,11 +251,11 @@ extern "C" { #endif // _di_f_utf_character_is_digit_ #ifndef _di_f_utf_character_is_emoji_ - f_return_status f_utf_character_is_emoji(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_emoji(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (isdigit(f_macro_utf_character_to_char_1(character))) { + if (isdigit(f_macro_utf_character_t_to_char_1(character))) { return F_true; } @@ -271,8 +271,8 @@ extern "C" { #endif // _di_f_utf_character_is_emoji_ #ifndef _di_f_utf_character_is_fragment_ - f_return_status f_utf_character_is_fragment(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_fragment(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 1) return F_true; @@ -281,11 +281,11 @@ extern "C" { #endif // _di_f_utf_character_is_fragment_ #ifndef _di_f_utf_character_is_graph_ - f_return_status f_utf_character_is_graph(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_graph(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (isgraph(f_macro_utf_character_to_char_1(character))) { + if (isgraph(f_macro_utf_character_t_to_char_1(character))) { return F_true; } @@ -313,11 +313,11 @@ extern "C" { #endif // _di_f_utf_character_is_graph_ #ifndef _di_f_utf_character_is_numeric_ - f_return_status f_utf_character_is_numeric(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_numeric(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (isdigit(f_macro_utf_character_to_char_1(character))) { + if (isdigit(f_macro_utf_character_t_to_char_1(character))) { return F_true; } @@ -333,8 +333,8 @@ extern "C" { #endif // _di_f_utf_character_is_numeric_ #ifndef _di_f_utf_character_is_phonetic_ - f_return_status f_utf_character_is_phonetic(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_phonetic(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { // There are no ASCII phonetic characters. @@ -350,8 +350,8 @@ extern "C" { #endif // _di_f_utf_character_is_phonetic_ #ifndef _di_f_utf_character_is_private_ - f_return_status f_utf_character_is_private(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_private(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { // There are no ASCII private characters. @@ -367,8 +367,8 @@ extern "C" { #endif // _di_f_utf_character_is_phonetic_ #ifndef _di_f_utf_character_is_punctuation_ - f_return_status f_utf_character_is_punctuation(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_punctuation(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { // ASCII: '!' to '#'. @@ -413,8 +413,8 @@ extern "C" { #endif // _di_f_utf_character_is_punctuation_ #ifndef _di_f_utf_character_is_symbol_ - f_return_status f_utf_character_is_symbol(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_symbol(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { // ASCII: '$' or '+'. @@ -444,8 +444,8 @@ extern "C" { #endif // _di_f_utf_character_is_symbol_ #ifndef _di_f_utf_character_is_unassigned_ - f_return_status f_utf_character_is_unassigned(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_unassigned(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0 || width == 1) { return F_false; @@ -456,8 +456,8 @@ extern "C" { #endif // _di_f_utf_character_is_unassigned_ #ifndef _di_f_utf_character_is_valid_ - f_return_status f_utf_character_is_valid(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_valid(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 1) { return F_false; @@ -468,11 +468,11 @@ extern "C" { #endif // _di_f_utf_character_is_valid_ #ifndef _di_f_utf_character_is_whitespace_ - f_return_status f_utf_character_is_whitespace(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_whitespace(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (isspace(f_macro_utf_character_to_char_1(character))) { + if (isspace(f_macro_utf_character_t_to_char_1(character))) { return F_true; } @@ -488,8 +488,8 @@ extern "C" { #endif // _di_f_utf_character_is_whitespace_ #ifndef _di_f_utf_character_is_whitespace_modifier_ - f_return_status f_utf_character_is_whitespace_modifier(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_whitespace_modifier(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { // There are no ASCII whitespace modifiers. @@ -505,8 +505,8 @@ extern "C" { #endif // _di_f_utf_character_is_whitespace_modifier_ #ifndef _di_f_utf_character_is_whitespace_other_ - f_return_status f_utf_character_is_whitespace_other(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_whitespace_other(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { // There are no ASCII whitespace other. @@ -522,11 +522,11 @@ extern "C" { #endif // _di_f_utf_character_is_whitespace_other_ #ifndef _di_f_utf_character_is_word_ - f_return_status f_utf_character_is_word(const f_utf_character character, const bool strict) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_word(const f_utf_character_t character, const bool strict) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (isalnum(f_macro_utf_character_to_char_1(character)) || character == '_') { + if (isalnum(f_macro_utf_character_t_to_char_1(character)) || character == '_') { return F_true; } @@ -542,11 +542,11 @@ extern "C" { #endif // _di_f_utf_character_is_word_ #ifndef _di_f_utf_character_is_word_dash_ - f_return_status f_utf_character_is_word_dash(const f_utf_character character, const bool strict) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_word_dash(const f_utf_character_t character, const bool strict) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (isalnum(f_macro_utf_character_to_char_1(character)) || character == '_' || character == '-') { + if (isalnum(f_macro_utf_character_t_to_char_1(character)) || character == '_' || character == '-') { return F_true; } @@ -562,11 +562,11 @@ extern "C" { #endif // _di_f_utf_character_is_word_dash_ #ifndef _di_f_utf_character_is_word_dash_plus_ - f_return_status f_utf_character_is_word_dash_plus(const f_utf_character character, const bool strict) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_word_dash_plus(const f_utf_character_t character, const bool strict) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - if (isalnum(f_macro_utf_character_to_char_1(character)) || character == '_' || character == '-' || character == '+') { + if (isalnum(f_macro_utf_character_t_to_char_1(character)) || character == '_' || character == '-' || character == '+') { return F_true; } @@ -582,11 +582,11 @@ extern "C" { #endif // _di_f_utf_character_is_word_dash_plus_ #ifndef _di_f_utf_character_is_zero_width_ - f_return_status f_utf_character_is_zero_width(const f_utf_character character) { - const uint8_t width = f_macro_utf_character_width_is(character); + f_return_status f_utf_character_is_zero_width(const f_utf_character_t character) { + const uint8_t width = f_macro_utf_character_t_width_is(character); if (width == 0) { - const uint8_t ascii = f_macro_utf_character_to_char_1(character); + const uint8_t ascii = f_macro_utf_character_t_to_char_1(character); // These control characters are considered zero-width spaces. if (ascii >= 0x00 && ascii <= 0x08) { @@ -614,7 +614,7 @@ extern "C" { #endif // _di_f_utf_character_is_zero_width_ #ifndef _di_f_utf_character_to_char_ - f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, f_string_length *width_max) { + f_return_status f_utf_character_to_char(const f_utf_character_t utf_character, f_string_t *character, f_string_length_t *width_max) { #ifndef _di_level_0_parameter_checking_ if (utf_character == 0) return F_status_set_error(F_parameter); if (width_max == 0 && *character != 0) return F_status_set_error(F_parameter); @@ -622,12 +622,12 @@ extern "C" { if (width_max != 0 && *width_max > 4) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; - uint8_t width = f_macro_utf_character_width_is(utf_character); + uint8_t width = f_macro_utf_character_t_width_is(utf_character); if (width_max == 0) { - f_macro_string_new(status, *character, width); + f_macro_string_t_new(status, *character, width); if (F_status_is_error(status)) return status; @@ -650,16 +650,16 @@ extern "C" { uint32_t utf = 0; if (width == 1) { - utf = f_macro_utf_character_to_char_1(utf_character) << 24; + utf = f_macro_utf_character_t_to_char_1(utf_character) << 24; } else if (width == 2) { - utf = (f_macro_utf_character_to_char_2(utf_character) << 24) | (f_macro_utf_character_to_char_1(utf_character) << 16); + utf = (f_macro_utf_character_t_to_char_2(utf_character) << 24) | (f_macro_utf_character_t_to_char_1(utf_character) << 16); } else if (width == 3) { - utf = (f_macro_utf_character_to_char_3(utf_character) << 24) | (f_macro_utf_character_to_char_2(utf_character) << 16) | (f_macro_utf_character_to_char_1(utf_character) << 8); + utf = (f_macro_utf_character_t_to_char_3(utf_character) << 24) | (f_macro_utf_character_t_to_char_2(utf_character) << 16) | (f_macro_utf_character_t_to_char_1(utf_character) << 8); } else if (width == 4) { - utf = (f_macro_utf_character_to_char_4(utf_character) << 24) | (f_macro_utf_character_to_char_3(utf_character) << 16) | (f_macro_utf_character_to_char_2(utf_character) << 8) | f_macro_utf_character_to_char_1(utf_character); + utf = (f_macro_utf_character_t_to_char_4(utf_character) << 24) | (f_macro_utf_character_t_to_char_3(utf_character) << 16) | (f_macro_utf_character_t_to_char_2(utf_character) << 8) | f_macro_utf_character_t_to_char_1(utf_character); } memcpy(*character, &utf, width); @@ -683,7 +683,7 @@ extern "C" { #endif // _di_f_utf_is_big_endian_ #ifndef _di_f_utf_is_ - f_return_status f_utf_is(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -703,7 +703,7 @@ extern "C" { #endif // _di_f_utf_is_ #ifndef _di_f_utf_is_alpha_ - f_return_status f_utf_is_alpha(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_alpha(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -722,10 +722,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -737,7 +737,7 @@ extern "C" { #endif // _di_f_utf_is_alpha_ #ifndef _di_f_utf_is_alpha_digit_ - f_return_status f_utf_is_alpha_digit(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_alpha_digit(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -756,10 +756,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -771,7 +771,7 @@ extern "C" { #endif // _di_f_utf_is_alpha_digit_ #ifndef _di_f_utf_is_alpha_numeric_ - f_return_status f_utf_is_alpha_numeric(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_alpha_numeric(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -790,10 +790,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -805,7 +805,7 @@ extern "C" { #endif // _di_f_utf_is_alpha_numeric_ #ifndef _di_f_utf_is_ascii_ - f_return_status f_utf_is_ascii(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_ascii(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -816,10 +816,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -831,7 +831,7 @@ extern "C" { #endif // _di_f_utf_is_ascii_ #ifndef _di_f_utf_is_combining_ - f_return_status f_utf_is_combining(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_combining(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -847,10 +847,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -862,7 +862,7 @@ extern "C" { #endif // _di_f_utf_is_combining_ #ifndef _di_f_utf_is_control_ - f_return_status f_utf_is_control(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_control(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -881,10 +881,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -896,7 +896,7 @@ extern "C" { #endif // _di_f_utf_is_control_ #ifndef _di_f_utf_is_control_picture_ - f_return_status f_utf_is_control_picture(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_control_picture(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -912,10 +912,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -927,7 +927,7 @@ extern "C" { #endif // _di_f_utf_is_control_picture_ #ifndef _di_f_utf_is_digit_ - f_return_status f_utf_is_digit(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_digit(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -946,10 +946,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -961,7 +961,7 @@ extern "C" { #endif // _di_f_utf_is_digit_ #ifndef _di_f_utf_is_emoji_ - f_return_status f_utf_is_emoji(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_emoji(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -980,10 +980,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -995,7 +995,7 @@ extern "C" { #endif // _di_f_utf_is_emoji_ #ifndef _di_f_utf_is_fragment_ - f_return_status f_utf_is_fragment(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_fragment(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1011,7 +1011,7 @@ extern "C" { #endif // _di_f_utf_is_fragment_ #ifndef _di_f_utf_is_graph_ - f_return_status f_utf_is_graph(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_graph(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1030,10 +1030,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1058,7 +1058,7 @@ extern "C" { #endif // _di_f_utf_is_graph_ #ifndef _di_f_utf_is_numeric_ - f_return_status f_utf_is_numeric(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_numeric(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1077,10 +1077,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1092,7 +1092,7 @@ extern "C" { #endif // _di_f_utf_is_numeric_ #ifndef _di_f_utf_is_phonetic_ - f_return_status f_utf_is_phonetic(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_phonetic(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1108,10 +1108,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1123,7 +1123,7 @@ extern "C" { #endif // _di_f_utf_is_phonetic_ #ifndef _di_f_utf_is_private_ - f_return_status f_utf_is_private(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_private(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1139,10 +1139,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1154,7 +1154,7 @@ extern "C" { #endif // _di_f_utf_is_private_ #ifndef _di_f_utf_is_punctuation_ - f_return_status f_utf_is_punctuation(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_punctuation(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1199,10 +1199,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1214,7 +1214,7 @@ extern "C" { #endif // _di_f_utf_is_punctuation_ #ifndef _di_f_utf_is_symbol_ - f_return_status f_utf_is_symbol(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_symbol(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1244,10 +1244,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1259,7 +1259,7 @@ extern "C" { #endif // _di_f_utf_is_symbol_ #ifndef _di_f_utf_is_unassigned_ - f_return_status f_utf_is_unassigned(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_unassigned(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1270,10 +1270,10 @@ extern "C" { return F_false; } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1285,7 +1285,7 @@ extern "C" { #endif // _di_f_utf_is_unassigned_ #ifndef _di_f_utf_is_valid_ - f_return_status f_utf_is_valid(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_valid(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1296,10 +1296,10 @@ extern "C" { return F_false; } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1311,7 +1311,7 @@ extern "C" { #endif // _di_f_utf_is_valid_ #ifndef _di_f_utf_is_whitespace_ - f_return_status f_utf_is_whitespace(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_whitespace(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1330,10 +1330,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1345,7 +1345,7 @@ extern "C" { #endif // _di_f_utf_is_whitespace_ #ifndef _di_f_utf_is_whitespace_modifier_ - f_return_status f_utf_is_whitespace_modifier(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_whitespace_modifier(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1361,10 +1361,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1376,7 +1376,7 @@ extern "C" { #endif // _di_f_utf_is_whitespace_modifier_ #ifndef _di_f_utf_is_whitespace_other_ - f_return_status f_utf_is_whitespace_other(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_whitespace_other(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1392,10 +1392,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1407,7 +1407,7 @@ extern "C" { #endif // _di_f_utf_is_whitespace_other_ #ifndef _di_f_utf_is_word_ - f_return_status f_utf_is_word(const f_string character, const f_string_length width_max, const bool strict) { + f_return_status f_utf_is_word(const f_string_t character, const f_string_length_t width_max, const bool strict) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1426,10 +1426,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1441,7 +1441,7 @@ extern "C" { #endif // _di_f_utf_is_word_ #ifndef _di_f_utf_is_word_dash_ - f_return_status f_utf_is_word_dash(const f_string character, const f_string_length width_max, const bool strict) { + f_return_status f_utf_is_word_dash(const f_string_t character, const f_string_length_t width_max, const bool strict) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1460,10 +1460,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1475,7 +1475,7 @@ extern "C" { #endif // _di_f_utf_is_word_dash_ #ifndef _di_f_utf_is_word_dash_plus_ - f_return_status f_utf_is_word_dash_plus(const f_string character, const f_string_length width_max, const bool strict) { + f_return_status f_utf_is_word_dash_plus(const f_string_t character, const f_string_length_t width_max, const bool strict) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1494,10 +1494,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1509,7 +1509,7 @@ extern "C" { #endif // _di_f_utf_is_word_dash_plus_ #ifndef _di_f_utf_is_zero_width_ - f_return_status f_utf_is_zero_width(const f_string character, const f_string_length width_max) { + f_return_status f_utf_is_zero_width(const f_string_t character, const f_string_length_t width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -1535,10 +1535,10 @@ extern "C" { return F_status_is_error(F_incomplete_utf); } - f_utf_character character_utf = 0; + f_utf_character_t character_utf = 0; { - f_status status = 0; + f_status_t status = 0; status = f_utf_char_to_character(character, width_max, &character_utf); @@ -1550,7 +1550,7 @@ extern "C" { #endif // _di_f_utf_is_zero_width_ #ifndef _di_f_utf_char_to_character_ - f_return_status f_utf_char_to_character(const f_string character, const f_string_length width_max, f_utf_character *character_utf) { + f_return_status f_utf_char_to_character(const f_string_t character, const f_string_length_t width_max, f_utf_character_t *character_utf) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); if (character_utf == 0) return F_status_set_error(F_parameter); @@ -1559,7 +1559,7 @@ extern "C" { const uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { - *character_utf = f_macro_utf_character_from_char_1(character[0]); + *character_utf = f_macro_utf_character_t_from_char_1(character[0]); return F_none; } else if (width == 1) { @@ -1570,25 +1570,25 @@ extern "C" { return F_status_set_error(F_failure); } - *character_utf = f_macro_utf_character_from_char_1(character[0]); + *character_utf = f_macro_utf_character_t_from_char_1(character[0]); if (width < 2) { return F_none; } - *character_utf |= f_macro_utf_character_from_char_2(character[1]); + *character_utf |= f_macro_utf_character_t_from_char_2(character[1]); if (width == 2) { return F_none; } - *character_utf |= f_macro_utf_character_from_char_3(character[2]); + *character_utf |= f_macro_utf_character_t_from_char_3(character[2]); if (width == 3) { return F_none; } - *character_utf |= f_macro_utf_character_from_char_4(character[3]); + *character_utf |= f_macro_utf_character_t_from_char_4(character[3]); return F_none; } diff --git a/level_0/f_utf/c/utf.h b/level_0/f_utf/c/utf.h index 209a2a8..ed6ab63 100644 --- a/level_0/f_utf/c/utf.h +++ b/level_0/f_utf/c/utf.h @@ -81,7 +81,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_utf_buffer_decrement_ - extern f_return_status f_utf_buffer_decrement(const f_string_static buffer, f_string_range *range, const f_string_length step); + extern f_return_status f_utf_buffer_decrement(const f_string_static_t buffer, f_string_range_t *range, const f_string_length_t step); #endif // _di_f_utf_buffer_decrement_ /** @@ -113,7 +113,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_utf_buffer_increment_ - extern f_return_status f_utf_buffer_increment(const f_string_static buffer, f_string_range *range, const f_string_length step); + extern f_return_status f_utf_buffer_increment(const f_string_static_t buffer, f_string_range_t *range, const f_string_length_t step); #endif // _di_f_utf_buffer_increment_ /** @@ -132,7 +132,7 @@ extern "C" { * @see f_utf_character_is_valid() */ #ifndef _di_f_utf_character_is_ - extern f_return_status f_utf_character_is(const f_utf_character character); + extern f_return_status f_utf_character_is(const f_utf_character_t character); #endif // _di_f_utf_character_is_ /** @@ -149,7 +149,7 @@ extern "C" { * @see isalpha() */ #ifndef _di_f_utf_character_is_alpha_ - extern f_return_status f_utf_character_is_alpha(const f_utf_character character); + extern f_return_status f_utf_character_is_alpha(const f_utf_character_t character); #endif // _di_f_utf_character_is_alpha_ /** @@ -170,7 +170,7 @@ extern "C" { * @see isalnum() */ #ifndef _di_f_utf_character_is_alpha_digit_ - extern f_return_status f_utf_character_is_alpha_digit(const f_utf_character character); + extern f_return_status f_utf_character_is_alpha_digit(const f_utf_character_t character); #endif // _di_f_utf_character_is_alpha_digit_ /** @@ -189,7 +189,7 @@ extern "C" { * @see isalnum() */ #ifndef _di_f_utf_character_is_alpha_numeric_ - extern f_return_status f_utf_character_is_alpha_numeric(const f_utf_character character); + extern f_return_status f_utf_character_is_alpha_numeric(const f_utf_character_t character); #endif // _di_f_utf_character_is_alpha_numeric_ /** @@ -204,7 +204,7 @@ extern "C" { * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_character_is_ascii_ - extern f_return_status f_utf_character_is_ascii(const f_utf_character character); + extern f_return_status f_utf_character_is_ascii(const f_utf_character_t character); #endif // _di_f_utf_character_is_ascii_ /** @@ -219,7 +219,7 @@ extern "C" { * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_character_is_combining_ - extern f_return_status f_utf_character_is_combining(const f_utf_character character); + extern f_return_status f_utf_character_is_combining(const f_utf_character_t character); #endif // _di_f_utf_character_is_combining_ /** @@ -236,7 +236,7 @@ extern "C" { * @see iscntrl() */ #ifndef _di_f_utf_character_is_control_ - extern f_return_status f_utf_character_is_control(const f_utf_character character); + extern f_return_status f_utf_character_is_control(const f_utf_character_t character); #endif // _di_f_utf_character_is_control_ /** @@ -253,7 +253,7 @@ extern "C" { * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_character_is_control_picture_ - extern f_return_status f_utf_character_is_control_picture(const f_utf_character character); + extern f_return_status f_utf_character_is_control_picture(const f_utf_character_t character); #endif // _di_f_utf_character_is_control_picture_ /** @@ -274,7 +274,7 @@ extern "C" { * @see isdigit() */ #ifndef _di_f_utf_character_is_digit_ - extern f_return_status f_utf_character_is_digit(const f_utf_character character); + extern f_return_status f_utf_character_is_digit(const f_utf_character_t character); #endif // _di_f_utf_character_is_digit_ /** @@ -291,7 +291,7 @@ extern "C" { * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_character_is_emoji_ - extern f_return_status f_utf_character_is_emoji(const f_utf_character character); + extern f_return_status f_utf_character_is_emoji(const f_utf_character_t character); #endif // _di_f_utf_character_is_emoji_ /** @@ -325,7 +325,7 @@ extern "C" { * @see f_utf_character_is_valid() */ #ifndef _di_f_utf_character_is_fragment_ - extern f_return_status f_utf_character_is_fragment(const f_utf_character character); + extern f_return_status f_utf_character_is_fragment(const f_utf_character_t character); #endif // _di_f_utf_character_is_fragment_ /** @@ -342,7 +342,7 @@ extern "C" { * @see isgraph() */ #ifndef _di_f_utf_character_is_graph_ - extern f_return_status f_utf_character_is_graph(const f_utf_character character); + extern f_return_status f_utf_character_is_graph(const f_utf_character_t character); #endif // _di_f_utf_character_is_graph_ /** @@ -361,7 +361,7 @@ extern "C" { * @see isdigit() */ #ifndef _di_f_utf_character_is_numeric_ - extern f_return_status f_utf_character_is_numeric(const f_utf_character character); + extern f_return_status f_utf_character_is_numeric(const f_utf_character_t character); #endif // _di_f_utf_character_is_numeric_ /** @@ -376,7 +376,7 @@ extern "C" { * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_character_is_phonetic_ - extern f_return_status f_utf_character_is_phonetic(const f_utf_character character); + extern f_return_status f_utf_character_is_phonetic(const f_utf_character_t character); #endif // _di_f_utf_character_is_phonetic_ /** @@ -391,7 +391,7 @@ extern "C" { * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_character_is_private_ - extern f_return_status f_utf_character_is_private(const f_utf_character character); + extern f_return_status f_utf_character_is_private(const f_utf_character_t character); #endif // _di_f_utf_character_is_private_ /** @@ -408,7 +408,7 @@ extern "C" { * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_character_is_punctuation_ - extern f_return_status f_utf_character_is_punctuation(const f_utf_character character); + extern f_return_status f_utf_character_is_punctuation(const f_utf_character_t character); #endif // _di_f_utf_character_is_punctuation_ /** @@ -425,7 +425,7 @@ extern "C" { * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_character_is_symbol_ - extern f_return_status f_utf_character_is_symbol(const f_utf_character character); + extern f_return_status f_utf_character_is_symbol(const f_utf_character_t character); #endif // _di_f_utf_character_is_symbol_ /** @@ -446,7 +446,7 @@ extern "C" { * @see f_utf_character_is_fragment() */ #ifndef _di_f_utf_character_is_unassigned_ - extern f_return_status f_utf_character_is_unassigned(const f_utf_character character); + extern f_return_status f_utf_character_is_unassigned(const f_utf_character_t character); #endif // _di_f_utf_character_is_value_ /** @@ -469,7 +469,7 @@ extern "C" { * @see f_utf_character_is_fragment() */ #ifndef _di_f_utf_character_is_valid_ - extern f_return_status f_utf_character_is_valid(const f_utf_character character); + extern f_return_status f_utf_character_is_valid(const f_utf_character_t character); #endif // _di_f_utf_character_is_value_ /** @@ -494,7 +494,7 @@ extern "C" { * @see isspace() */ #ifndef _di_f_utf_character_is_whitespace_ - extern f_return_status f_utf_character_is_whitespace(const f_utf_character character); + extern f_return_status f_utf_character_is_whitespace(const f_utf_character_t character); #endif // _di_f_utf_character_is_whitespace_ /** @@ -514,7 +514,7 @@ extern "C" { * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_character_is_whitespace_modifier_ - extern f_return_status f_utf_character_is_whitespace_modifier(const f_utf_character character); + extern f_return_status f_utf_character_is_whitespace_modifier(const f_utf_character_t character); #endif // _di_f_utf_character_is_whitespace_modifier_ /** @@ -533,7 +533,7 @@ extern "C" { * @see isspace() */ #ifndef _di_f_utf_character_is_whitespace_other_ - extern f_return_status f_utf_character_is_whitespace_other(const f_utf_character character); + extern f_return_status f_utf_character_is_whitespace_other(const f_utf_character_t character); #endif // _di_f_utf_character_is_whitespace_other_ /** @@ -558,7 +558,7 @@ extern "C" { * @see isalnum() */ #ifndef _di_f_utf_character_is_word_ - extern f_return_status f_utf_character_is_word(const f_utf_character character, const bool strict); + extern f_return_status f_utf_character_is_word(const f_utf_character_t character, const bool strict); #endif // _di_f_utf_character_is_word_ /** @@ -588,7 +588,7 @@ extern "C" { * @see isalnum() */ #ifndef _di_f_utf_character_is_word_dash_ - extern f_return_status f_utf_character_is_word_dash(const f_utf_character character, const bool strict); + extern f_return_status f_utf_character_is_word_dash(const f_utf_character_t character, const bool strict); #endif // _di_f_utf_character_is_word_dash_ /** @@ -618,7 +618,7 @@ extern "C" { * @see isalnum() */ #ifndef _di_f_utf_character_is_word_dash_plus_ - extern f_return_status f_utf_character_is_word_dash_plus(const f_utf_character character, const bool strict); + extern f_return_status f_utf_character_is_word_dash_plus(const f_utf_character_t character, const bool strict); #endif // _di_f_utf_character_is_word_dash_plus_ /** @@ -635,11 +635,11 @@ extern "C" { * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_character_is_zero_width_ - extern f_return_status f_utf_character_is_zero_width(const f_utf_character character); + extern f_return_status f_utf_character_is_zero_width(const f_utf_character_t character); #endif // _di_f_utf_character_is_zero_width_ /** - * Convert a specialized f_utf_character type to a int8_t, stored as a string (character buffer). + * Convert a specialized f_utf_character_t type to a int8_t, stored as a string (character buffer). * * This will also convert ASCII characters stored in the utf_character array. * @@ -663,7 +663,7 @@ extern "C" { * F_failure (with error bit) if width is not long enough to convert. */ #ifndef _di_f_utf_character_to_char_ - extern f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, f_string_length *width_max); + extern f_return_status f_utf_character_to_char(const f_utf_character_t utf_character, f_string_t *character, f_string_length_t *width_max); #endif // _di_f_utf_character_to_char_ /** @@ -698,7 +698,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_utf_is_ - extern f_return_status f_utf_is(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_ /** @@ -719,7 +719,7 @@ extern "C" { * @see isalpha() */ #ifndef _di_f_utf_is_alpha_ - extern f_return_status f_utf_is_alpha(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_alpha(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_alpha_ /** @@ -744,7 +744,7 @@ extern "C" { * @see isalnum() */ #ifndef _di_f_utf_is_alpha_digit_ - extern f_return_status f_utf_is_alpha_digit(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_alpha_digit(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_alpha_digit_ /** @@ -767,7 +767,7 @@ extern "C" { * @see isalnum() */ #ifndef _di_f_utf_is_alpha_numeric_ - extern f_return_status f_utf_is_alpha_numeric(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_alpha_numeric(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_alpha_numeric_ /** @@ -786,7 +786,7 @@ extern "C" { * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_f_utf_is_ascii_ - extern f_return_status f_utf_is_ascii(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_ascii(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_ascii_ /** @@ -805,7 +805,7 @@ extern "C" { * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_f_utf_is_combining_ - extern f_return_status f_utf_is_combining(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_combining(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_combining_ /** @@ -826,7 +826,7 @@ extern "C" { * @see iscntrl() */ #ifndef _di_f_utf_is_control_ - extern f_return_status f_utf_is_control(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_control(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_control_ /** @@ -847,7 +847,7 @@ extern "C" { * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_f_utf_is_control_picture_ - extern f_return_status f_utf_is_control_picture(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_control_picture(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_control_picture_ /** @@ -868,7 +868,7 @@ extern "C" { * @see isdigit() */ #ifndef _di_f_utf_is_digit_ - extern f_return_status f_utf_is_digit(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_digit(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_digit_ /** @@ -889,7 +889,7 @@ extern "C" { * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_f_utf_is_emoji_ - extern f_return_status f_utf_is_emoji(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_emoji(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_emoji_ /** @@ -923,7 +923,7 @@ extern "C" { * F_false if not a UTF-8 character. */ #ifndef _di_f_utf_is_fragment_ - extern f_return_status f_utf_is_fragment(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_fragment(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_fragment_ /** @@ -946,7 +946,7 @@ extern "C" { * @see isgraph() */ #ifndef _di_f_utf_is_graph_ - extern f_return_status f_utf_is_graph(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_graph(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_graph_ /** @@ -969,7 +969,7 @@ extern "C" { * @see isdigit() */ #ifndef _di_f_utf_is_numeric_ - extern f_return_status f_utf_is_numeric(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_numeric(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_numeric_ /** @@ -988,7 +988,7 @@ extern "C" { * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_f_utf_is_phonetic_ - extern f_return_status f_utf_is_phonetic(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_phonetic(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_phonetic_ /** @@ -1007,7 +1007,7 @@ extern "C" { * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_f_utf_is_private_ - extern f_return_status f_utf_is_private(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_private(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_private_ /** @@ -1028,7 +1028,7 @@ extern "C" { * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_f_utf_is_punctuation_ - extern f_return_status f_utf_is_punctuation(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_punctuation(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_punctuation_ /** @@ -1049,7 +1049,7 @@ extern "C" { * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_f_utf_is_symbol_ - extern f_return_status f_utf_is_symbol(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_symbol(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_symbol_ /** @@ -1071,7 +1071,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is inunassigned. */ #ifndef _di_f_utf_is_unassigned_ - extern f_return_status f_utf_is_unassigned(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_unassigned(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_unassigned_ /** @@ -1096,7 +1096,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_utf_is_valid_ - extern f_return_status f_utf_is_valid(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_valid(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_valid_ /** @@ -1127,7 +1127,7 @@ extern "C" { * @see isspace() */ #ifndef _di_f_utf_is_whitespace_ - extern f_return_status f_utf_is_whitespace(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_whitespace(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_whitespace_ /** @@ -1153,7 +1153,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_utf_is_whitespace_modifier_ - extern f_return_status f_utf_is_whitespace_modifier(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_whitespace_modifier(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_whitespace_modifier_ /** @@ -1176,7 +1176,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_utf_is_whitespace_other_ - extern f_return_status f_utf_is_whitespace_other(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_whitespace_other(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_whitespace_other_ /** @@ -1205,7 +1205,7 @@ extern "C" { * @see isalnum() */ #ifndef _di_f_utf_is_word_ - extern f_return_status f_utf_is_word(const f_string character, const f_string_length width_max, const bool strict); + extern f_return_status f_utf_is_word(const f_string_t character, const f_string_length_t width_max, const bool strict); #endif // _di_f_utf_is_word_ /** @@ -1239,7 +1239,7 @@ extern "C" { * @see isalnum() */ #ifndef _di_f_utf_is_word_dash_ - extern f_return_status f_utf_is_word_dash(const f_string character, const f_string_length width_max, const bool strict); + extern f_return_status f_utf_is_word_dash(const f_string_t character, const f_string_length_t width_max, const bool strict); #endif // _di_f_utf_is_word_dash_ /** @@ -1273,7 +1273,7 @@ extern "C" { * @see isalnum() */ #ifndef _di_f_utf_is_word_dash_plus_ - extern f_return_status f_utf_is_word_dash_plus(const f_string character, const f_string_length width_max, const bool strict); + extern f_return_status f_utf_is_word_dash_plus(const f_string_t character, const f_string_length_t width_max, const bool strict); #endif // _di_f_utf_is_word_dash_plus_ /** @@ -1296,20 +1296,20 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_utf_is_zero_width_ - extern f_return_status f_utf_is_zero_width(const f_string character, const f_string_length width_max); + extern f_return_status f_utf_is_zero_width(const f_string_t character, const f_string_length_t width_max); #endif // _di_f_utf_is_zero_width_ /** - * Convert an ASCII or UTF-8 character, stored as a string (character buffer), to the specialized f_utf_character type. + * Convert an ASCII or UTF-8 character, stored as a string (character buffer), to the specialized f_utf_character_t type. * * @param character - * The character string to be converted to the f_utf_character type. + * The character string to be converted to the f_utf_character_t type. * There must be enough space allocated to convert against, as limited by width_max. * @param width_max * The maximum width available for converting. * Can be anything greater than 0. * @param character_utf - * The generated character of type f_utf_character. + * The generated character of type f_utf_character_t. * This value may be cleared, even on error. * * @return @@ -1319,7 +1319,7 @@ extern "C" { * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_char_to_character_ - extern f_return_status f_utf_char_to_character(const f_string character, const f_string_length width_max, f_utf_character *character_utf); + extern f_return_status f_utf_char_to_character(const f_string_t character, const f_string_length_t width_max, f_utf_character_t *character_utf); #endif // _di_f_utf_char_to_character_ #ifdef __cplusplus diff --git a/level_1/fl_color/c/color.c b/level_1/fl_color/c/color.c index c891dc1..866f2c6 100644 --- a/level_1/fl_color/c/color.c +++ b/level_1/fl_color/c/color.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fl_color_set_ - f_return_status fl_color_set(FILE *file, const f_color_format format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5) { + f_return_status fl_color_set(FILE *file, const f_color_format_t format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return F_status_set_error(F_parameter); if (color1 == 0) return F_status_set_error(F_parameter); @@ -27,7 +27,7 @@ extern "C" { #endif // _di_fl_color_set_ #ifndef _di_fl_color_save_ - f_return_status fl_color_save(f_string_dynamic *buffer, const f_color_format format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5) { + f_return_status fl_color_save(f_string_dynamic_t *buffer, const f_color_format_t format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (color1 == 0) return F_status_set_error(F_parameter); @@ -38,7 +38,7 @@ extern "C" { if (color4 == 0 && color5 != 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_string_length string_size = strnlen(format.begin, f_color_max_size) + strnlen(format.end, f_color_max_size) + 1; + f_string_length_t string_size = strnlen(format.begin, f_color_max_size) + strnlen(format.end, f_color_max_size) + 1; if (color2 == 0) string_size += strnlen(color1, f_color_max_size); else if (color3 == 0) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size); @@ -48,9 +48,9 @@ extern "C" { // make sure there is enough allocated space, if not, then allocate some more if (buffer->size - buffer->used - 1 < string_size) { - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_resize(status, (*buffer), buffer->used + string_size + 1); // the additional 1 is the EOS + f_macro_string_dynamic_t_resize(status, (*buffer), buffer->used + string_size + 1); // the additional 1 is the EOS if (F_status_is_error(status)) { return status; @@ -114,14 +114,14 @@ extern "C" { #endif // _di_fl_color_save_ #ifndef _di_fl_color_print_ - f_return_status fl_color_print(FILE *file, const f_string_static start_color, const f_string_static end_color, const f_string string, ...) { + f_return_status fl_color_print(FILE *file, const f_string_static_t start_color, const f_string_static_t end_color, const f_string_t string, ...) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return F_status_set_error(F_parameter); if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (start_color.used) { - f_status status = f_print_string_dynamic(file, start_color); + f_status_t status = f_print_string_dynamic(file, start_color); if (F_status_is_error(status)) return status; } @@ -134,7 +134,7 @@ extern "C" { va_end(ap); if (end_color.used) { - f_status status = f_print_string_dynamic(file, end_color); + f_status_t status = f_print_string_dynamic(file, end_color); if (F_status_is_error(status)) return status; } @@ -144,14 +144,14 @@ extern "C" { #endif // _di_fl_color_print_ #ifndef _di_fl_color_print2_ - f_return_status fl_color_print2(FILE *file, const f_string_static start_color, const f_string_static extra_color, const f_string_static end_color, const f_string string, ...) { + f_return_status fl_color_print2(FILE *file, const f_string_static_t start_color, const f_string_static_t extra_color, const f_string_static_t end_color, const f_string_t string, ...) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return F_status_set_error(F_parameter); if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (start_color.used) { - f_status status = f_print_string_dynamic(file, start_color); + f_status_t status = f_print_string_dynamic(file, start_color); if (F_status_is_error(status)) return status; status = f_print_string_dynamic(file, extra_color); @@ -167,7 +167,7 @@ extern "C" { va_end(ap); if (end_color.used) { - f_status status = f_print_string_dynamic(file, end_color); + f_status_t status = f_print_string_dynamic(file, end_color); if (F_status_is_error(status)) return status; } @@ -176,14 +176,14 @@ extern "C" { #endif // _di_fl_color_print2_ #ifndef _di_fl_color_print_line_ - f_return_status fl_color_print_line(FILE *file, const f_string_static start_color, const f_string_static end_color, const f_string string, ...) { + f_return_status fl_color_print_line(FILE *file, const f_string_static_t start_color, const f_string_static_t end_color, const f_string_t string, ...) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return F_status_set_error(F_parameter); if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (start_color.used) { - f_status status = f_print_string_dynamic(file, start_color); + f_status_t status = f_print_string_dynamic(file, start_color); if (F_status_is_error(status)) return status; } @@ -196,7 +196,7 @@ extern "C" { va_end(ap); if (end_color.used) { - f_status status = f_print_string_dynamic(file, end_color); + f_status_t status = f_print_string_dynamic(file, end_color); if (F_status_is_error(status)) return status; } @@ -208,14 +208,14 @@ extern "C" { #endif // _di_fl_color_print_line_ #ifndef _di_fl_color_print2_line_ - f_return_status fl_color_print2_line(FILE *file, const f_string_static start_color, const f_string_static extra_color, const f_string_static end_color, const f_string string, ...) { + f_return_status fl_color_print2_line(FILE *file, const f_string_static_t start_color, const f_string_static_t extra_color, const f_string_static_t end_color, const f_string_t string, ...) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return F_status_set_error(F_parameter); if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (start_color.used) { - f_status status = f_print_string_dynamic(file, start_color); + f_status_t status = f_print_string_dynamic(file, start_color); if (F_status_is_error(status)) return status; status = f_print_string_dynamic(file, extra_color); @@ -231,7 +231,7 @@ extern "C" { va_end(ap); if (end_color.used) { - f_status status = f_print_string_dynamic(file, end_color); + f_status_t status = f_print_string_dynamic(file, end_color); if (F_status_is_error(status)) return status; } @@ -243,9 +243,9 @@ extern "C" { #endif // _di_fl_color_print2_line_ #ifndef _di_fl_color_print_code_ - f_return_status fl_color_print_code(FILE *file, const f_string_static color) { + f_return_status fl_color_print_code(FILE *file, const f_string_static_t color) { if (color.used) { - f_status status = f_print_string_dynamic(file, color); + f_status_t status = f_print_string_dynamic(file, color); if (F_status_is_error(status)) return status; } @@ -254,12 +254,12 @@ extern "C" { #endif // _di_fl_color_print_code_ #ifndef _di_fl_color_load_context_ - f_return_status fl_color_load_context(fl_color_context *context, const bool use_light_colors) { + f_return_status fl_color_load_context(fl_color_context_t *context, const bool use_light_colors) { #ifndef _di_level_1_parameter_checking_ if (context == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; // switch to the appropriate terminal color mode { diff --git a/level_1/fl_color/c/color.h b/level_1/fl_color/c/color.h index 21f63a6..18ba81e 100644 --- a/level_1/fl_color/c/color.h +++ b/level_1/fl_color/c/color.h @@ -28,101 +28,101 @@ extern "C" { #endif -#ifndef _di_fl_color_context_ +#ifndef _di_fl_color_context_t_ typedef struct { - f_color color_list; - f_color_format color_format; - f_color_mode mode; - f_string_dynamic reset; - f_string_dynamic warning; - f_string_dynamic error; - f_string_dynamic title; - f_string_dynamic notable; - f_string_dynamic important; - f_string_dynamic standout; - f_string_dynamic normal; - f_string_dynamic normal_reset; - } fl_color_context; + f_color_t color_list; + f_color_format_t color_format; + f_color_mode_t mode; + f_string_dynamic_t reset; + f_string_dynamic_t warning; + f_string_dynamic_t error; + f_string_dynamic_t title; + f_string_dynamic_t notable; + f_string_dynamic_t important; + f_string_dynamic_t standout; + f_string_dynamic_t normal; + f_string_dynamic_t normal_reset; + } fl_color_context_t; - #define fl_color_context_initialize { f_color_initialize_linux, f_color_format_initialize_linux, f_color_mode_none, f_string_dynamic_initialize, f_string_dynamic_initialize, f_string_dynamic_initialize, f_string_dynamic_initialize, f_string_dynamic_initialize, f_string_dynamic_initialize, f_string_dynamic_initialize, f_string_dynamic_initialize, f_string_dynamic_initialize } + #define fl_color_context_t_initialize { f_color_t_initialize_linux, f_color_format_t_initialize_linux, f_color_mode_none, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize } - #define fl_macro_color_context_new(status, color_context) \ - f_macro_string_dynamic_new(status, color_context.reset, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.warning, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.error, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.title, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.notable, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.important, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.standout, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal_reset, f_color_max_size + 1); + #define fl_macro_color_context_t_new(status, color_context) \ + f_macro_string_dynamic_t_new(status, color_context.reset, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.warning, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.error, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.title, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.notable, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.important, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.standout, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.normal, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.normal_reset, f_color_max_size + 1); - #define fl_macro_color_context_delete(status, color_context) \ - f_macro_string_dynamic_delete(status, color_context.reset); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.warning); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.error); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.title); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.notable); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.important); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.standout); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.normal); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.normal_reset); + #define fl_macro_color_context_t_delete(status, color_context) \ + f_macro_string_dynamic_t_delete(status, color_context.reset); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_delete(status, color_context.warning); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_delete(status, color_context.error); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_delete(status, color_context.title); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_delete(status, color_context.notable); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_delete(status, color_context.important); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_delete(status, color_context.standout); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_delete(status, color_context.normal); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_delete(status, color_context.normal_reset); - #define fl_macro_color_context_destroy(status, color_context, size) \ - f_macro_string_dynamic_destroy(status, color_context.reset); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.warning, size); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.error, size); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.title, size); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.notable, size); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.important, size); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.standout, size); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.normal); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.normal_reset); + #define fl_macro_color_context_t_destroy(status, color_context, size) \ + f_macro_string_dynamic_t_destroy(status, color_context.reset); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_destroy(status, color_context.warning, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_destroy(status, color_context.error, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_destroy(status, color_context.title, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_destroy(status, color_context.notable, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_destroy(status, color_context.important, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_destroy(status, color_context.standout, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_destroy(status, color_context.normal); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_destroy(status, color_context.normal_reset); - #define fl_macro_color_context_delete_simple(color_context) \ - f_macro_string_dynamic_delete_simple(color_context.reset); \ - f_macro_string_dynamic_delete_simple(color_context.warning); \ - f_macro_string_dynamic_delete_simple(color_context.error); \ - f_macro_string_dynamic_delete_simple(color_context.title); \ - f_macro_string_dynamic_delete_simple(color_context.notable); \ - f_macro_string_dynamic_delete_simple(color_context.important); \ - f_macro_string_dynamic_delete_simple(color_context.standout); \ - f_macro_string_dynamic_delete_simple(color_context.normal); \ - f_macro_string_dynamic_delete_simple(color_context.normal_reset); + #define fl_macro_color_context_t_delete_simple(color_context) \ + f_macro_string_dynamic_t_delete_simple(color_context.reset); \ + f_macro_string_dynamic_t_delete_simple(color_context.warning); \ + f_macro_string_dynamic_t_delete_simple(color_context.error); \ + f_macro_string_dynamic_t_delete_simple(color_context.title); \ + f_macro_string_dynamic_t_delete_simple(color_context.notable); \ + f_macro_string_dynamic_t_delete_simple(color_context.important); \ + f_macro_string_dynamic_t_delete_simple(color_context.standout); \ + f_macro_string_dynamic_t_delete_simple(color_context.normal); \ + f_macro_string_dynamic_t_delete_simple(color_context.normal_reset); - #define fl_macro_color_context_destroy_simple(color_context, size) \ - f_macro_string_dynamic_destroy_simple(color_context.reset); \ - f_macro_string_dynamic_destroy_simple(color_context.warning, size); \ - f_macro_string_dynamic_destroy_simple(color_context.error, size); \ - f_macro_string_dynamic_destroy_simple(color_context.title, size); \ - f_macro_string_dynamic_destroy_simple(color_context.notable, size); \ - f_macro_string_dynamic_destroy_simple(color_context.important, size); \ - f_macro_string_dynamic_destroy_simple(color_context.standout, size); \ - f_macro_string_dynamic_destroy_simple(color_context.normal); \ - f_macro_string_dynamic_destroy_simple(color_context.normal_reset); + #define fl_macro_color_context_t_destroy_simple(color_context, size) \ + f_macro_string_dynamic_t_destroy_simple(color_context.reset); \ + f_macro_string_dynamic_t_destroy_simple(color_context.warning, size); \ + f_macro_string_dynamic_t_destroy_simple(color_context.error, size); \ + f_macro_string_dynamic_t_destroy_simple(color_context.title, size); \ + f_macro_string_dynamic_t_destroy_simple(color_context.notable, size); \ + f_macro_string_dynamic_t_destroy_simple(color_context.important, size); \ + f_macro_string_dynamic_t_destroy_simple(color_context.standout, size); \ + f_macro_string_dynamic_t_destroy_simple(color_context.normal); \ + f_macro_string_dynamic_t_destroy_simple(color_context.normal_reset); - #define fl_macro_color_context_resize(status, color_context) \ - f_macro_string_dynamic_resize(status, color_context.reset, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.warning, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.error, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.title, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.notable, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.important, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.standout, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal_reset, f_color_max_size + 1); + #define fl_macro_color_context_t_resize(status, color_context) \ + f_macro_string_dynamic_t_resize(status, color_context.reset, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.warning, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.error, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.title, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.notable, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.important, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.standout, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.normal, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.normal_reset, f_color_max_size + 1); - #define fl_macro_color_context_adjust(status, color_context) \ - f_macro_string_dynamic_adjust(status, color_context.reset, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.warning, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.error, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.title, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.notable, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.important, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.standout, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal, f_color_max_size + 1); \ - if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal_reset, f_color_max_size + 1); -#endif // _di_fl_color_context_ + #define fl_macro_color_context_t_adjust(status, color_context) \ + f_macro_string_dynamic_t_adjust(status, color_context.reset, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.warning, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.error, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.title, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.notable, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.important, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.standout, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.normal, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_t_resize(status, color_context.normal_reset, f_color_max_size + 1); +#endif // _di_fl_color_context_t_ /** * Given some file or standard io, and push color information to that file or standard io. @@ -149,7 +149,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_set_ - extern f_return_status fl_color_set(FILE *file, const f_color_format format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5); + extern f_return_status fl_color_set(FILE *file, const f_color_format_t format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5); #define fl_macro_color_set_1(file, format, color1) fl_color_set(file, format, color1, 0, 0, 0, 0) #define fl_macro_color_set_2(file, format, color1, color2) fl_color_set(file, format, color1, color2, 0, 0, 0) @@ -184,7 +184,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_save_ - extern f_return_status fl_color_save(f_string_dynamic *buffer, const f_color_format format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5); + extern f_return_status fl_color_save(f_string_dynamic_t *buffer, const f_color_format_t format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5); #define fl_macro_color_save_1(buffer, format, color1) fl_color_save(buffer, format, color1, 0, 0, 0, 0) #define fl_macro_color_save_2(buffer, format, color1, color2) fl_color_save(buffer, format, color1, color2, 0, 0, 0) @@ -218,7 +218,7 @@ extern "C" { * Errors from (with error bit): f_print_string_dynamic(). */ #ifndef _di_fl_color_print_ - extern f_return_status fl_color_print(FILE *file, const f_string_static start_color, const f_string_static end_color, const f_string string, ...); + extern f_return_status fl_color_print(FILE *file, const f_string_static_t start_color, const f_string_static_t end_color, const f_string_t string, ...); #endif // _di_fl_color_print_ /** @@ -251,7 +251,7 @@ extern "C" { * Errors from (with error bit): f_print_string_dynamic(). */ #ifndef _di_fl_color_print2_ - extern f_return_status fl_color_print2(FILE *file, const f_string_static start_color, const f_string_static extra_color, const f_string_static end_color, const f_string string, ...); + extern f_return_status fl_color_print2(FILE *file, const f_string_static_t start_color, const f_string_static_t extra_color, const f_string_static_t end_color, const f_string_t string, ...); #endif // _di_fl_color_print2_ /** @@ -279,7 +279,7 @@ extern "C" { * Errors from (with error bit): f_print_string_dynamic(). */ #ifndef _di_fl_color_print_line_ - extern f_return_status fl_color_print_line(FILE *file, const f_string_static start_color, const f_string_static end_color, const f_string string, ...); + extern f_return_status fl_color_print_line(FILE *file, const f_string_static_t start_color, const f_string_static_t end_color, const f_string_t string, ...); #endif // _di_fl_color_print_line_ /** @@ -312,7 +312,7 @@ extern "C" { * Errors from (with error bit): f_print_string_dynamic(). */ #ifndef _di_fl_color_print2_line_ - extern f_return_status fl_color_print2_line(FILE *file, const f_string_static start_color, const f_string_static extra_color, const f_string_static end_color, const f_string string, ...); + extern f_return_status fl_color_print2_line(FILE *file, const f_string_static_t start_color, const f_string_static_t extra_color, const f_string_static_t end_color, const f_string_t string, ...); #endif // _di_fl_color_print2_line_ /** @@ -332,7 +332,7 @@ extern "C" { * Errors from (with error bit): f_print_string_dynamic(). */ #ifndef _di_fl_color_print_code_ - extern f_return_status fl_color_print_code(FILE *file, const f_string_static color); + extern f_return_status fl_color_print_code(FILE *file, const f_string_static_t color); #endif // _di_fl_color_print_code_ /** @@ -353,7 +353,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_load_context_ - extern f_return_status fl_color_load_context(fl_color_context *context, const bool use_light_colors); + extern f_return_status fl_color_load_context(fl_color_context_t *context, const bool use_light_colors); #endif // _di_fl_color_load_context_ #ifdef __cplusplus diff --git a/level_1/fl_console/c/console.c b/level_1/fl_console/c/console.c index 888a8e3..9b2a761 100644 --- a/level_1/fl_console/c/console.c +++ b/level_1/fl_console/c/console.c @@ -5,13 +5,13 @@ extern "C" { #endif #ifndef _fl_console_parameter_to_string_dynamic_directory_ - f_return_status fl_console_parameter_to_string_dynamic_directory(const f_string argument, f_string_dynamic *directory) { + f_return_status fl_console_parameter_to_string_dynamic_directory(const f_string_t argument, f_string_dynamic_t *directory) { #ifndef _di_level_1_parameter_checking_ if (argument == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; - f_string_length length = strlen(argument); + f_status_t status = F_none; + f_string_length_t length = strlen(argument); if (length == 0) { directory->used = 0; @@ -24,7 +24,7 @@ extern "C" { } // while if (argument[0] == '/') { - f_string_length begin = 1; + f_string_length_t begin = 1; while (begin < length && argument[begin] == '/') { begin++; @@ -35,7 +35,7 @@ extern "C" { if (length > 0) { length += 2; - f_macro_string_dynamic_new(status, (*directory), length); + f_macro_string_dynamic_t_new(status, (*directory), length); if (F_status_is_error(status)) return status; memcpy(directory->string + 1, argument + begin, length - 2); @@ -46,7 +46,7 @@ extern "C" { directory->string[length - 1] = '/'; } else { - f_macro_string_dynamic_new(status, (*directory), 1); + f_macro_string_dynamic_t_new(status, (*directory), 1); if (F_status_is_error(status)) return status; directory->used = 1; @@ -55,7 +55,7 @@ extern "C" { } } else if (length > 3 && argument[0] == '.' && argument[1] == '.' && argument[2] == '/') { - f_string_length begin = 3; + f_string_length_t begin = 3; while (begin < length && argument[begin] == '/') { begin++; @@ -66,7 +66,7 @@ extern "C" { if (length > 0) { length += 4; - f_macro_string_dynamic_new(status, (*directory), length); + f_macro_string_dynamic_t_new(status, (*directory), length); if (F_status_is_error(status)) return status; memcpy(directory->string + 3, argument + begin, length - 4); @@ -79,7 +79,7 @@ extern "C" { directory->string[length - 1] = '/'; } else { - f_macro_string_dynamic_new(status, (*directory), 3); + f_macro_string_dynamic_t_new(status, (*directory), 3); if (F_status_is_error(status)) return status; directory->used = 3; @@ -90,7 +90,7 @@ extern "C" { } } else if (length > 2 && argument[0] == '.' && argument[1] == '/') { - f_string_length begin = 2; + f_string_length_t begin = 2; while (begin < length && argument[begin] == '/') { begin++; @@ -101,7 +101,7 @@ extern "C" { if (length > 0) { length += 3; - f_macro_string_dynamic_new(status, (*directory), length); + f_macro_string_dynamic_t_new(status, (*directory), length); if (F_status_is_error(status)) return status; memcpy(directory->string + 2, argument + begin, length - 3); @@ -113,7 +113,7 @@ extern "C" { directory->string[length - 1] = '/'; } else { - f_macro_string_dynamic_new(status, (*directory), 2); + f_macro_string_dynamic_t_new(status, (*directory), 2); if (F_status_is_error(status)) return status; directory->used = 2; @@ -125,7 +125,7 @@ extern "C" { else { length++; - f_macro_string_dynamic_new(status, (*directory), length); + f_macro_string_dynamic_t_new(status, (*directory), length); if (F_status_is_error(status)) return status; memcpy(directory->string, argument, length - 1); @@ -136,7 +136,7 @@ extern "C" { } } else if (argument[0] != '/') { - f_macro_string_dynamic_new(status, (*directory), 2); + f_macro_string_dynamic_t_new(status, (*directory), 2); if (F_status_is_error(status)) return status; memcpy(directory->string, argument, 2); @@ -146,7 +146,7 @@ extern "C" { directory->string[1] = '/'; } else { - f_macro_string_dynamic_new(status, (*directory), 1); + f_macro_string_dynamic_t_new(status, (*directory), 1); if (F_status_is_error(status)) return status; memcpy(directory->string, argument, 1); diff --git a/level_1/fl_console/c/console.h b/level_1/fl_console/c/console.h index 5992d84..201017e 100644 --- a/level_1/fl_console/c/console.h +++ b/level_1/fl_console/c/console.h @@ -56,7 +56,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _fl_console_parameter_to_string_dynamic_directory_ - extern f_return_status fl_console_parameter_to_string_dynamic_directory(const f_string argument, f_string_dynamic *directory); + extern f_return_status fl_console_parameter_to_string_dynamic_directory(const f_string_t argument, f_string_dynamic_t *directory); #endif // _fl_console_parameter_to_string_dynamic_directory_ #ifdef __cplusplus diff --git a/level_1/fl_conversion/c/conversion.c b/level_1/fl_conversion/c/conversion.c index 826b5d9..b0df184 100644 --- a/level_1/fl_conversion/c/conversion.c +++ b/level_1/fl_conversion/c/conversion.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fl_conversion_string_to_binary_signed_ - f_return_status fl_conversion_string_to_binary_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative) { + f_return_status fl_conversion_string_to_binary_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range, const bool negative) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -17,10 +17,10 @@ extern "C" { } uint8_t scale = 0; - f_number_unsigned digit = 0; - f_number_unsigned converted = 0; + f_number_unsigned_t digit = 0; + f_number_unsigned_t converted = 0; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { if (f_conversion_character_to_binary(string[i], &digit) == F_none) { if (scale) { scale++; @@ -64,7 +64,7 @@ extern "C" { #endif // _di_fl_conversion_string_to_binary_signed_ #ifndef _di_fl_conversion_string_to_binary_unsigned_ - f_return_status fl_conversion_string_to_binary_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { + f_return_status fl_conversion_string_to_binary_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -76,10 +76,10 @@ extern "C" { } uint8_t scale = 0; - f_number_unsigned digit = 0; - f_number_unsigned converted = 0; + f_number_unsigned_t digit = 0; + f_number_unsigned_t converted = 0; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { if (f_conversion_character_to_binary(string[i], &digit) == F_none) { if (scale) { scale++; @@ -107,7 +107,7 @@ extern "C" { #endif // _di_fl_conversion_string_to_binary_unsigned_ #ifndef _di_fl_conversion_string_to_decimal_signed_ - f_return_status fl_conversion_string_to_decimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative) { + f_return_status fl_conversion_string_to_decimal_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range, const bool negative) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -119,10 +119,10 @@ extern "C" { } uint8_t scale = 0; - f_number_unsigned digit = 0; - f_number_unsigned converted = 0; + f_number_unsigned_t digit = 0; + f_number_unsigned_t converted = 0; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { if (f_conversion_character_to_decimal(string[i], &digit) == F_none) { if (scale) { @@ -130,7 +130,7 @@ extern "C" { if (negative) { if (scale > f_conversion_scale_decimal_signed) { - if ((converted * 10) - digit < f_type_number_size_negative || (converted * 10) - digit > converted) { + if ((converted * 10) - digit < f_number_t_size_negative || (converted * 10) - digit > converted) { return F_status_set_error(F_number_underflow); } } @@ -140,7 +140,7 @@ extern "C" { } else { if (scale > f_conversion_scale_decimal_signed) { - if ((converted * 10) + digit > f_type_number_size_positive || (converted * 10) + digit < converted) { + if ((converted * 10) + digit > f_number_t_size_positive || (converted * 10) + digit < converted) { return F_status_set_error(F_number_overflow); } } @@ -171,7 +171,7 @@ extern "C" { #endif // _di_fl_conversion_string_to_decimal_signed_ #ifndef _di_fl_conversion_string_to_decimal_unsigned_ - f_return_status fl_conversion_string_to_decimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { + f_return_status fl_conversion_string_to_decimal_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -183,17 +183,17 @@ extern "C" { } uint8_t scale = 0; - f_number_unsigned digit = 0; - f_number_unsigned converted = 0; + f_number_unsigned_t digit = 0; + f_number_unsigned_t converted = 0; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { if (f_conversion_character_to_decimal(string[i], &digit) == F_none) { if (scale) { scale++; if (scale > f_conversion_scale_decimal_unsigned) { - if ((converted * 10) + digit > f_type_number_size_unsigned || (converted * 10) + digit < converted) { + if ((converted * 10) + digit > f_number_t_size_unsigned || (converted * 10) + digit < converted) { return F_status_set_error(F_number_overflow); } } @@ -217,7 +217,7 @@ extern "C" { #endif // _di_fl_conversion_string_to_decimal_unsigned_ #ifndef _di_fl_conversion_string_to_duodecimal_signed_ - f_return_status fl_conversion_string_to_duodecimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative) { + f_return_status fl_conversion_string_to_duodecimal_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range, const bool negative) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -229,10 +229,10 @@ extern "C" { } uint8_t scale = 0; - f_number_unsigned digit = 0; - f_number_unsigned converted = 0; + f_number_unsigned_t digit = 0; + f_number_unsigned_t converted = 0; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { if (f_conversion_character_to_duodecimal(string[i], &digit) == F_none) { if (scale) { @@ -240,7 +240,7 @@ extern "C" { if (negative) { if (scale > f_conversion_scale_duodecimal_signed) { - if ((converted * 12) - digit < f_type_number_size_negative || (converted * 12) - digit > converted) { + if ((converted * 12) - digit < f_number_t_size_negative || (converted * 12) - digit > converted) { return F_status_set_error(F_number_underflow); } } @@ -250,7 +250,7 @@ extern "C" { } else { if (scale > f_conversion_scale_duodecimal_signed) { - if ((converted * 12) + digit > f_type_number_size_positive || (converted * 12) + digit < converted) { + if ((converted * 12) + digit > f_number_t_size_positive || (converted * 12) + digit < converted) { return F_status_set_error(F_number_overflow); } } @@ -281,7 +281,7 @@ extern "C" { #endif // _di_fl_conversion_string_to_duodecimal_signed_ #ifndef _di_fl_conversion_string_to_duodecimal_unsigned_ - f_return_status fl_conversion_string_to_duodecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { + f_return_status fl_conversion_string_to_duodecimal_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -293,17 +293,17 @@ extern "C" { } uint8_t scale = 0; - f_number_unsigned digit = 0; - f_number_unsigned converted = 0; + f_number_unsigned_t digit = 0; + f_number_unsigned_t converted = 0; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { if (f_conversion_character_to_duodecimal(string[i], &digit) == F_none) { if (scale) { scale++; if (scale > f_conversion_scale_duodecimal_unsigned) { - if ((converted * 12) + digit > f_type_number_size_unsigned || (converted * 12) + digit < converted) { + if ((converted * 12) + digit > f_number_t_size_unsigned || (converted * 12) + digit < converted) { return F_status_set_error(F_number_overflow); } } @@ -327,7 +327,7 @@ extern "C" { #endif // _di_fl_conversion_string_to_duodecimal_unsigned_ #ifndef _di_fl_conversion_string_to_hexidecimal_signed_ - f_return_status fl_conversion_string_to_hexidecimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative) { + f_return_status fl_conversion_string_to_hexidecimal_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range, const bool negative) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -339,10 +339,10 @@ extern "C" { } uint8_t scale = 0; - f_number_unsigned digit = 0; - f_number_unsigned converted = 0; + f_number_unsigned_t digit = 0; + f_number_unsigned_t converted = 0; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { if (f_conversion_character_to_hexidecimal(string[i], &digit) == F_none) { if (scale) { @@ -350,7 +350,7 @@ extern "C" { if (negative) { if (scale > f_conversion_scale_hexidecimal_signed) { - if ((converted << 4) - digit < f_type_number_size_negative || (converted << 4) - digit > converted) { + if ((converted << 4) - digit < f_number_t_size_negative || (converted << 4) - digit > converted) { return F_status_set_error(F_number_underflow); } } @@ -360,7 +360,7 @@ extern "C" { } else { if (scale > f_conversion_scale_hexidecimal_signed) { - if ((converted << 4) + digit > f_type_number_size_positive || (converted << 4) + digit < converted) { + if ((converted << 4) + digit > f_number_t_size_positive || (converted << 4) + digit < converted) { return F_status_set_error(F_number_overflow); } } @@ -391,7 +391,7 @@ extern "C" { #endif // _di_fl_conversion_string_to_hexidecimal_signed_ #ifndef _di_fl_conversion_string_to_hexidecimal_unsigned_ - f_return_status fl_conversion_string_to_hexidecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { + f_return_status fl_conversion_string_to_hexidecimal_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -403,17 +403,17 @@ extern "C" { } uint8_t scale = 0; - f_number_unsigned digit = 0; - f_number_unsigned converted = 0; + f_number_unsigned_t digit = 0; + f_number_unsigned_t converted = 0; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { if (f_conversion_character_to_hexidecimal(string[i], &digit) == F_none) { if (scale) { scale++; if (scale > f_conversion_scale_hexidecimal_unsigned) { - if ((converted << 4) + digit > f_type_number_size_unsigned || (converted << 4) + digit < converted) { + if ((converted << 4) + digit > f_number_t_size_unsigned || (converted << 4) + digit < converted) { return F_status_set_error(F_number_overflow); } } @@ -437,7 +437,7 @@ extern "C" { #endif // _di_fl_conversion_string_to_hexidecimal_unsigned_ #ifndef _di_fl_conversion_string_to_octal_signed_ - f_return_status fl_conversion_string_to_octal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative) { + f_return_status fl_conversion_string_to_octal_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range, const bool negative) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -449,10 +449,10 @@ extern "C" { } uint8_t scale = 0; - f_number_unsigned digit = 0; - f_number_unsigned converted = 0; + f_number_unsigned_t digit = 0; + f_number_unsigned_t converted = 0; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { if (f_conversion_character_to_octal(string[i], &digit) == F_none) { if (scale) { @@ -460,7 +460,7 @@ extern "C" { if (negative) { if (scale > f_conversion_scale_octal_signed) { - if ((converted << 3) - digit < f_type_number_size_negative || (converted << 3) - digit > converted) { + if ((converted << 3) - digit < f_number_t_size_negative || (converted << 3) - digit > converted) { return F_status_set_error(F_number_underflow); } } @@ -470,7 +470,7 @@ extern "C" { } else { if (scale > f_conversion_scale_octal_signed) { - if ((converted << 3) + digit > f_type_number_size_positive || (converted << 3) + digit < converted) { + if ((converted << 3) + digit > f_number_t_size_positive || (converted << 3) + digit < converted) { return F_status_set_error(F_number_overflow); } } @@ -501,7 +501,7 @@ extern "C" { #endif // _di_fl_conversion_string_to_octal_signed_ #ifndef _di_fl_conversion_string_to_octal_unsigned_ - f_return_status fl_conversion_string_to_octal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { + f_return_status fl_conversion_string_to_octal_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -513,17 +513,17 @@ extern "C" { } uint8_t scale = 0; - f_number_unsigned digit = 0; - f_number_unsigned converted = 0; + f_number_unsigned_t digit = 0; + f_number_unsigned_t converted = 0; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { if (f_conversion_character_to_octal(string[i], &digit) == F_none) { if (scale) { scale++; if (scale > f_conversion_scale_octal_unsigned) { - if ((converted << 3) + digit > f_type_number_size_unsigned || (converted << 3) + digit < converted) { + if ((converted << 3) + digit > f_number_t_size_unsigned || (converted << 3) + digit < converted) { return F_status_set_error(F_number_overflow); } } @@ -547,7 +547,7 @@ extern "C" { #endif // _di_fl_conversion_string_to_octal_unsigned_ #ifndef _di_fl_conversion_string_to_number_signed_ - f_return_status fl_conversion_string_to_number_signed(const f_string string, f_number_signed *number, const f_string_range range) { + f_return_status fl_conversion_string_to_number_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -562,11 +562,11 @@ extern "C" { uint8_t width_max = 0; uint8_t mode = 0; int8_t vector = 0; // 0 for assumed positive, 1 for explicit positive, -1 for negative. - f_string_length j = 0; - f_string_length offset = 0; - f_status status = F_none; + f_string_length_t j = 0; + f_string_length_t offset = 0; + f_status_t status = F_none; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { width = f_macro_utf_byte_width_is(string[i]); if (width == 0) { @@ -670,7 +670,7 @@ extern "C" { return F_status_set_error(F_number); } - f_string_range location_offset = f_string_range_initialize; + f_string_range_t location_offset = f_string_range_initialize; location_offset.start = range.start + offset; location_offset.stop = range.stop; @@ -699,7 +699,7 @@ extern "C" { #endif // _di_fl_conversion_string_to_number_signed_ #ifndef _di_fl_conversion_string_to_number_unsigned_ - f_return_status fl_conversion_string_to_number_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { + f_return_status fl_conversion_string_to_number_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (number == 0) return F_status_set_error(F_parameter); @@ -713,12 +713,12 @@ extern "C" { uint8_t width = 0; uint8_t width_max = 0; uint8_t mode = 0; - f_string_length j = 0; - f_string_length offset = 0; - f_status status = F_none; + f_string_length_t j = 0; + f_string_length_t offset = 0; + f_status_t status = F_none; int8_t sign_found = 0; - for (f_string_length i = range.start; i <= range.stop; i++) { + for (f_string_length_t i = range.start; i <= range.stop; i++) { width = f_macro_utf_byte_width_is(string[i]); if (width == 0) { @@ -810,7 +810,7 @@ extern "C" { return F_status_set_error(F_number); } - f_string_range location_offset = f_string_range_initialize; + f_string_range_t location_offset = f_string_range_initialize; location_offset.start = range.start + offset; location_offset.stop = range.stop; diff --git a/level_1/fl_conversion/c/conversion.h b/level_1/fl_conversion/c/conversion.h index a218e3e..8b1d1a4 100644 --- a/level_1/fl_conversion/c/conversion.h +++ b/level_1/fl_conversion/c/conversion.h @@ -27,7 +27,7 @@ extern "C" { #endif /** - * Convert a series of positive or negative binary number characters into a f_number_signed. + * Convert a series of positive or negative binary number characters into a f_number_signed_t. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -52,11 +52,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_conversion_string_to_binary_signed_ - extern f_return_status fl_conversion_string_to_binary_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); + extern f_return_status fl_conversion_string_to_binary_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range, const bool negative); #endif // _di_fl_conversion_string_to_binary_signed_ /** - * Convert a series of positive binary number characters into a f_number_unsigned. + * Convert a series of positive binary number characters into a f_number_unsigned_t. * * This will stop at one of the following: range.stop or a non-digit. * This will ignore NULL values. @@ -78,11 +78,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_conversion_string_to_binary_unsigned_ - extern f_return_status fl_conversion_string_to_binary_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); + extern f_return_status fl_conversion_string_to_binary_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range); #endif // _di_fl_conversion_string_to_binary_unsigned_ /** - * Convert a series of positive or negative decimal number characters into an f_number_signed. + * Convert a series of positive or negative decimal number characters into an f_number_signed_t. * * This will stop at one of the following: range.stop or a non-digit. * This will ignore NULL values. @@ -107,11 +107,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_conversion_string_to_decimal_signed_ - extern f_return_status fl_conversion_string_to_decimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); + extern f_return_status fl_conversion_string_to_decimal_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range, const bool negative); #endif // _di_fl_conversion_string_to_decimal_signed_ /** - * Convert a series of positive decimal number characters into an f_number_unsigned. + * Convert a series of positive decimal number characters into an f_number_unsigned_t. * * This will stop at one of the following: range.stop or a non-digit. * This will ignore NULL values. @@ -133,11 +133,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_conversion_string_to_decimal_unsigned_ - extern f_return_status fl_conversion_string_to_decimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); + extern f_return_status fl_conversion_string_to_decimal_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range); #endif // _di_fl_conversion_string_to_decimal_unsigned_ /** - * Convert a series of positive or negative duodecimal number characters into an f_number_signed. + * Convert a series of positive or negative duodecimal number characters into an f_number_signed_t. * * This will stop at one of the following: range.stop or a non-digit. * This will ignore NULL values. @@ -162,11 +162,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_conversion_string_to_duodecimal_signed_ - extern f_return_status fl_conversion_string_to_duodecimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); + extern f_return_status fl_conversion_string_to_duodecimal_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range, const bool negative); #endif // _di_fl_conversion_string_to_duodecimal_signed_ /** - * Convert a series of positive duodecimal number characters into an f_number_unsigned. + * Convert a series of positive duodecimal number characters into an f_number_unsigned_t. * * This will stop at one of the following: range.stop or a non-digit. * This will ignore NULL values. @@ -188,11 +188,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_conversion_string_to_duodecimal_unsigned_ - extern f_return_status fl_conversion_string_to_duodecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); + extern f_return_status fl_conversion_string_to_duodecimal_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range); #endif // _di_fl_conversion_string_to_duodecimal_unsigned_ /** - * Convert a series of positive or negative hexidecimal number characters into an f_number_signed. + * Convert a series of positive or negative hexidecimal number characters into an f_number_signed_t. * * This will stop at one of the following: range.stop or a non-digit. * This will ignore NULL values. @@ -217,11 +217,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_conversion_string_to_hexidecimal_signed_ - extern f_return_status fl_conversion_string_to_hexidecimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); + extern f_return_status fl_conversion_string_to_hexidecimal_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range, const bool negative); #endif // _di_fl_conversion_string_to_hexidecimal_signed_ /** - * Convert a series of positive hexidecimal number characters into an f_number_unsigned. + * Convert a series of positive hexidecimal number characters into an f_number_unsigned_t. * * This will stop at one of the following: range.stop or a non-digit. * This will ignore NULL values. @@ -243,11 +243,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_conversion_string_to_hexidecimal_unsigned_ - extern f_return_status fl_conversion_string_to_hexidecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); + extern f_return_status fl_conversion_string_to_hexidecimal_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range); #endif // _di_fl_conversion_string_to_hexidecimal_unsigned_ /** - * Convert a series of positive or negative octal number characters into an f_number_signed. + * Convert a series of positive or negative octal number characters into an f_number_signed_t. * * This will stop at one of the following: range.stop or a non-digit. * This will ignore NULL values. @@ -271,11 +271,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_conversion_string_to_octal_signed_ - extern f_return_status fl_conversion_string_to_octal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); + extern f_return_status fl_conversion_string_to_octal_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range, const bool negative); #endif // _di_fl_conversion_string_to_octal_signed_ /** - * Convert a series of positive octal number characters into an f_number_unsigned. + * Convert a series of positive octal number characters into an f_number_unsigned_t. * * This will stop at one of the following: range.stop or a non-digit. * This will ignore NULL values. @@ -297,11 +297,11 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_conversion_string_to_octal_unsigned_ - extern f_return_status fl_conversion_string_to_octal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); + extern f_return_status fl_conversion_string_to_octal_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range); #endif // _di_fl_conversion_string_to_octal_unsigned_ /** - * Convert a series of positive or negative number characters into an f_number_signed. + * Convert a series of positive or negative number characters into an f_number_signed_t. * * This will stop at one of the following: range.stop or a non-digit. * This will ignore NULL values. @@ -339,11 +339,11 @@ extern "C" { * @see strtoll() */ #ifndef _di_fl_conversion_string_to_number_signed_ - extern f_return_status fl_conversion_string_to_number_signed(const f_string string, f_number_signed *number, const f_string_range range); + extern f_return_status fl_conversion_string_to_number_signed(const f_string_t string, f_number_signed_t *number, const f_string_range_t range); #endif // _di_fl_conversion_string_to_number_signed_ /** - * Convert a series of positive number characters into an f_number_unsigned. + * Convert a series of positive number characters into an f_number_unsigned_t. * * This will stop at one of the following: range.stop or a non-digit. * This will ignore NULL values. @@ -383,7 +383,7 @@ extern "C" { * @see strtoull() */ #ifndef _di_fl_conversion_string_to_number_unsigned_ - extern f_return_status fl_conversion_string_to_number_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); + extern f_return_status fl_conversion_string_to_number_unsigned(const f_string_t string, f_number_unsigned_t *number, const f_string_range_t range); #endif // _di_fl_conversion_string_to_number_unsigned_ #ifdef __cplusplus diff --git a/level_1/fl_directory/c/directory.c b/level_1/fl_directory/c/directory.c index b1e7617..f27ea3f 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -6,13 +6,13 @@ extern "C" { #endif #ifndef _di_fl_directory_clone_ - f_return_status fl_directory_clone(const f_string source, const f_string destination, const f_string_length source_length, const f_string_length destination_length, const bool role, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) { + f_return_status fl_directory_clone(const f_string_t source, const f_string_t destination, const f_string_length_t source_length, const f_string_length_t destination_length, const bool role, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) { #ifndef _di_level_1_parameter_checking_ if (source) return F_status_set_error(F_parameter); if (destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_directory_exists(source); + f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; if (status == F_false) return F_status_set_error(F_directory); @@ -49,12 +49,12 @@ extern "C" { fprintf(verbose, "Cloned '%s' to '%s'.%c", source, destination, f_string_eol[0]); } - f_string_static static_source = { source, source_length, source_length }; - f_string_static static_destination = { destination, destination_length, destination_length }; + f_string_static_t static_source = { source, source_length, source_length }; + f_string_static_t static_destination = { destination, destination_length, destination_length }; // do not allow null termination or trailing path separators in the string's length calculation. { - f_string_length i = source_length; + f_string_length_t i = source_length; for (; i > 0; i--, static_source.used--) { if (source[i - 1] == 0) continue; @@ -76,13 +76,13 @@ extern "C" { #endif // _di_fl_directory_clone_ #ifndef _di_fl_directory_clone_content_ - f_return_status fl_directory_clone_content(const f_string source, const f_string destination, const f_string_length source_length, const f_string_length destination_length, const bool role, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) { + f_return_status fl_directory_clone_content(const f_string_t source, const f_string_t destination, const f_string_length_t source_length, const f_string_length_t destination_length, const bool role, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) { #ifndef _di_level_1_parameter_checking_ if (source) return F_status_set_error(F_parameter); if (destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_directory_exists(source); + f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; if (status == F_false) return F_status_set_error(F_directory); @@ -91,12 +91,12 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_false) return F_status_set_error(F_directory); - f_string_static static_source = { source, source_length, source_length }; - f_string_static static_destination = { destination, destination_length, destination_length }; + f_string_static_t static_source = { source, source_length, source_length }; + f_string_static_t static_destination = { destination, destination_length, destination_length }; // do not allow null termination or trailing path separators in the string's length calculation. { - f_string_length i = source_length; + f_string_length_t i = source_length; for (; i > 0; i--, static_source.used--) { if (source[i - 1] == 0) continue; @@ -118,13 +118,13 @@ extern "C" { #endif // _di_fl_directory_clone_content_ #ifndef _di_fl_directory_copy_ - f_return_status fl_directory_copy(const f_string source, const f_string destination, const f_string_length source_length, const f_string_length destination_length, const f_mode mode, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) { + f_return_status fl_directory_copy(const f_string_t source, const f_string_t destination, const f_string_length_t source_length, const f_string_length_t destination_length, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) { #ifndef _di_level_1_parameter_checking_ if (source) return F_status_set_error(F_parameter); if (destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_directory_exists(source); + f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; if (status == F_false) return F_status_set_error(F_directory); @@ -149,12 +149,12 @@ extern "C" { fprintf(verbose, "Copied '%s' to '%s'.%c", source, destination, f_string_eol[0]); } - f_string_static static_source = { source, source_length, source_length }; - f_string_static static_destination = { destination, destination_length, destination_length }; + f_string_static_t static_source = { source, source_length, source_length }; + f_string_static_t static_destination = { destination, destination_length, destination_length }; // do not allow null termination or trailing path separators in the string's length calculation. { - f_string_length i = source_length; + f_string_length_t i = source_length; for (; i > 0; i--, static_source.used--) { if (source[i - 1] == 0) continue; @@ -176,13 +176,13 @@ extern "C" { #endif // _di_fl_directory_copy_ #ifndef _di_fl_directory_copy_content_ - f_return_status fl_directory_copy_content(const f_string source, const f_string destination, const f_string_length source_length, const f_string_length destination_length, const f_mode mode, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) { + f_return_status fl_directory_copy_content(const f_string_t source, const f_string_t destination, const f_string_length_t source_length, const f_string_length_t destination_length, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) { #ifndef _di_level_1_parameter_checking_ if (source) return F_status_set_error(F_parameter); if (destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_directory_exists(source); + f_status_t status = f_directory_exists(source); if (F_status_is_error(status)) return status; if (status == F_false) return F_status_set_error(F_directory); @@ -191,12 +191,12 @@ extern "C" { if (F_status_is_error(status)) return status; if (status == F_false) return F_status_set_error(F_directory); - f_string_static static_source = { source, source_length, source_length }; - f_string_static static_destination = { destination, destination_length, destination_length }; + f_string_static_t static_source = { source, source_length, source_length }; + f_string_static_t static_destination = { destination, destination_length, destination_length }; // do not allow null termination or trailing path separators in the string's length calculation. { - f_string_length i = source_length; + f_string_length_t i = source_length; for (; i > 0; i--, static_source.used--) { if (source[i - 1] == 0) continue; @@ -218,7 +218,7 @@ extern "C" { #endif // _di_fl_directory_copy_content_ #ifndef _di_fl_directory_list_ - f_return_status fl_directory_list(const f_string path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing *listing) { + f_return_status fl_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing) { #ifndef _di_level_1_parameter_checking_ if (path) return F_status_set_error(F_parameter); if (listing == 0) return F_status_set_error(F_parameter); @@ -229,7 +229,7 @@ extern "C" { #endif // _di_fl_directory_list_ #ifndef _di_fl_directory_path_pop_ - f_return_status fl_directory_path_pop(f_string_static *path) { + f_return_status fl_directory_path_pop(f_string_static_t *path) { #ifndef _di_level_0_parameter_checking_ if (path->used > path->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -241,10 +241,10 @@ extern "C" { const bool null_terminated = path->string[path->used] == 0; bool first_nulless = F_false; - f_string_length i = path->used - 1; - f_string_length j = 0; + f_string_length_t i = path->used - 1; + f_string_length_t j = 0; - f_status status = F_none; + f_status_t status = F_none; for (; i > 0; i--) { if (path->string[i] == 0) continue; @@ -300,7 +300,7 @@ extern "C" { #endif // _di_fl_directory_path_pop_ #ifndef _di_fl_directory_path_push_ - f_return_status fl_directory_path_push(const f_string source, f_string_length length, f_string_dynamic *destination) { + f_return_status fl_directory_path_push(const f_string_t source, f_string_length_t length, f_string_dynamic_t *destination) { #ifndef _di_level_0_parameter_checking_ if (source) return F_status_set_error(F_parameter); if (destination->used > destination->size) return F_status_set_error(F_parameter); @@ -315,7 +315,7 @@ extern "C" { #endif // _di_fl_directory_path_push_ #ifndef _di_fl_directory_path_push_dynamic_ - f_return_status fl_directory_path_push_dynamic(const f_string_static source, f_string_dynamic *destination) { + f_return_status fl_directory_path_push_dynamic(const f_string_static_t source, f_string_dynamic_t *destination) { #ifndef _di_level_0_parameter_checking_ if (source.used > source.size) return F_status_set_error(F_parameter); if (destination->used > destination->size) return F_status_set_error(F_parameter); diff --git a/level_1/fl_directory/c/directory.h b/level_1/fl_directory/c/directory.h index 71d0176..dbb2e56 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -104,7 +104,7 @@ extern "C" { * @see f_file_clone() */ #ifndef _di_fl_directory_clone_ - extern f_return_status fl_directory_clone(const f_string source, const f_string destination, const f_string_length source_length, const f_string_length destination_length, const bool role, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures); + extern f_return_status fl_directory_clone(const f_string_t source, const f_string_t destination, const f_string_length_t source_length, const f_string_length_t destination_length, const bool role, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures); #endif // _di_fl_directory_clone_ /** @@ -165,7 +165,7 @@ extern "C" { * @see f_file_clone() */ #ifndef _di_fl_directory_clone_content_ - extern f_return_status fl_directory_clone_content(const f_string source, const f_string destination, const f_string_length source_length, const f_string_length destination_length, const bool role, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures); + extern f_return_status fl_directory_clone_content(const f_string_t source, const f_string_t destination, const f_string_length_t source_length, const f_string_length_t destination_length, const bool role, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures); #endif // _di_fl_directory_clone_content_ /** @@ -226,7 +226,7 @@ extern "C" { * @see f_file_copy() */ #ifndef _di_fl_directory_copy_ - extern f_return_status fl_directory_copy(const f_string source, const f_string destination, const f_string_length source_length, const f_string_length destination_length, const f_mode mode, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures); + extern f_return_status fl_directory_copy(const f_string_t source, const f_string_t destination, const f_string_length_t source_length, const f_string_length_t destination_length, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures); #endif // _di_fl_directory_copy_ /** @@ -285,7 +285,7 @@ extern "C" { * @see f_file_copy() */ #ifndef _di_fl_directory_copy_content_ - extern f_return_status fl_directory_copy_content(const f_string source, const f_string destination, const f_string_length source_length, const f_string_length destination_length, const f_mode mode, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures); + extern f_return_status fl_directory_copy_content(const f_string_t source, const f_string_t destination, const f_string_length_t source_length, const f_string_length_t destination_length, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures); #endif // _di_fl_directory_copy_content_ /** @@ -328,7 +328,7 @@ extern "C" { * @see versionsort() */ #ifndef _di_fl_directory_list_ - extern f_return_status fl_directory_list(const f_string path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing *listing); + extern f_return_status fl_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing); #endif // _di_fl_directory_list_ /** @@ -349,7 +349,7 @@ extern "C" { * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. */ #ifndef _di_fl_directory_path_pop_ - extern f_return_status fl_directory_path_pop(f_string_static *path); + extern f_return_status fl_directory_path_pop(f_string_static_t *path); #endif // _di_fl_directory_path_pop_ /** @@ -378,7 +378,7 @@ extern "C" { * Errors from (with error bit): f_utf_is_control(). */ #ifndef _di_fl_directory_path_push_ - extern f_return_status fl_directory_path_push(const f_string source, f_string_length length, f_string_dynamic *destination); + extern f_return_status fl_directory_path_push(const f_string_t source, f_string_length_t length, f_string_dynamic_t *destination); #endif // _di_fl_directory_path_push_ /** @@ -404,7 +404,7 @@ extern "C" { * Errors from (with error bit): f_utf_is_control(). */ #ifndef _di_fl_directory_path_push_dynamic_ - extern f_return_status fl_directory_path_push_dynamic(const f_string_static source, f_string_dynamic *destination); + extern f_return_status fl_directory_path_push_dynamic(const f_string_static_t source, f_string_dynamic_t *destination); #endif // _di_fl_directory_path_push_dynamic_ #ifdef __cplusplus diff --git a/level_1/fl_directory/c/private-directory.c b/level_1/fl_directory/c/private-directory.c index 4878cd3..b921a32 100644 --- a/level_1/fl_directory/c/private-directory.c +++ b/level_1/fl_directory/c/private-directory.c @@ -6,62 +6,62 @@ extern "C" { #endif #if !defined(_di_fl_directory_clone_) - f_return_status private_fl_directory_clone(const f_string_static source, const f_string_static destination, const bool role, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) { - f_status status = F_none; - f_directory_listing listing = f_directory_listing_initialize; + f_return_status private_fl_directory_clone(const f_string_static_t source, const f_string_static_t destination, const bool role, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) { + f_status_t status = F_none; + f_directory_listing_t listing = f_directory_listing_t_initialize; status = private_fl_directory_list(source.string, 0, 0, F_false, &listing); if (F_status_is_error(status)) { - f_macro_directory_listing_delete_simple(listing); + f_macro_directory_listing_t_delete_simple(listing); return status; } status = F_none; - f_array_length i = 0; + f_array_length_t i = 0; int directory_fd = 0; - f_string_length failures_used = failures ? failures->used : 0; + f_string_length_t failures_used = failures ? failures->used : 0; for (; F_status_is_fine(status) && i < listing.block.used; i++) { status = private_fl_directory_clone_file(listing.block.array[i], source, destination, role, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.block); + f_macro_string_dynamics_t_delete_simple(listing.block); for (i = 0; F_status_is_fine(status) && i < listing.character.used; i++) { status = private_fl_directory_clone_file(listing.character.array[i], source, destination, role, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.character); + f_macro_string_dynamics_t_delete_simple(listing.character); for (i = 0; F_status_is_fine(status) && i < listing.regular.used; i++) { status = private_fl_directory_clone_file(listing.regular.array[i], source, destination, role, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.regular); + f_macro_string_dynamics_t_delete_simple(listing.regular); for (i = 0; F_status_is_fine(status) && i < listing.link.used; i++) { status = private_fl_directory_clone_file(listing.link.array[i], source, destination, role, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.link); + f_macro_string_dynamics_t_delete_simple(listing.link); for (i = 0; F_status_is_fine(status) && i < listing.socket.used; i++) { status = private_fl_directory_clone_file(listing.socket.array[i], source, destination, role, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.socket); + f_macro_string_dynamics_t_delete_simple(listing.socket); for (i = 0; F_status_is_fine(status) && i < listing.unknown.used; i++) { status = private_fl_directory_clone_file(listing.unknown.array[i], source, destination, role, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.unknown); + f_macro_string_dynamics_t_delete_simple(listing.unknown); for (i = 0; F_status_is_fine(status) && i < listing.directory.used; i++) { - f_string_static source_sub = f_string_static_initialize; - f_string_static destination_sub = f_string_static_initialize; + f_string_static_t source_sub = f_string_static_t_initialize; + f_string_static_t destination_sub = f_string_static_t_initialize; source_sub.used = source.used + listing.directory.array[i].used + 1; source_sub.size = source_sub.used; @@ -129,7 +129,7 @@ extern "C" { status = private_fl_directory_clone(source_sub, destination_sub, role, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.directory); + f_macro_string_dynamics_t_delete_simple(listing.directory); if (F_status_is_error(status)) return status; @@ -140,7 +140,7 @@ extern "C" { #endif // !defined(_di_fl_directory_clone_) #if !defined(_di_fl_directory_clone_file_) - f_return_status private_fl_directory_clone_file(const f_string_static file, const f_string_static source, const f_string_static destination, const bool role, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) { + f_return_status private_fl_directory_clone_file(const f_string_static_t file, const f_string_static_t source, const f_string_static_t destination, const bool role, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) { char path_source[source.used + file.used + 2]; char path_destination[destination.used + file.used + 2]; @@ -154,7 +154,7 @@ extern "C" { path_destination[destination.used] = f_path_separator[0]; path_destination[destination.used + file.used + 1] = 0; - f_status status = f_file_clone(path_source, path_destination, role, size_block, exclusive); + f_status_t status = f_file_clone(path_source, path_destination, role, size_block, exclusive); if (F_status_is_error(status) || status == F_unsupported) { if (status == F_status_set_error(F_memory_allocation) || status == F_status_set_error(F_memory_reallocation)) { @@ -163,13 +163,13 @@ extern "C" { if (!failures) return F_failure; - const f_status status_failure = status; + const f_status_t status_failure = status; - f_macro_memory_structure_macro_increment(status, (*failures), 1, f_memory_default_allocation_step, f_macro_directory_statuss_resize, F_buffer_too_large); + f_macro_memory_structure_macro_increment(status, (*failures), 1, f_memory_default_allocation_step, f_macro_directory_statuss_t_resize, F_buffer_too_large); if (F_status_is_error(status)) return status; - f_directory_status failure = f_directory_status_initialize; - f_string_length size = 0; + f_directory_status_t failure = f_directory_status_t_initialize; + f_string_length_t size = 0; // identify if failure was because of source or destination. struct stat source_stat; @@ -179,13 +179,13 @@ extern "C" { status = f_file_stat(source.string, F_false, &source_stat); if (F_status_is_error(status)) { if (status == F_status_set_error(F_string_too_large)) { - size = f_string_length_size - 1; + size = f_string_length_t_size - 1; } else { size = source.used + file.used + 1; } - f_macro_directory_status_resize(status, failure, size + 1); + f_macro_directory_status_t_resize(status, failure, size + 1); if (F_status_is_error(status)) return status; memcpy(failure.path.string, path_source, size); @@ -193,13 +193,13 @@ extern "C" { } else { if (status == F_status_set_error(F_string_too_large)) { - size = f_string_length_size - 1; + size = f_string_length_t_size - 1; } else { size = destination.used + file.used + 1; } - f_macro_directory_status_resize(status, failure, size + 1); + f_macro_directory_status_t_resize(status, failure, size + 1); if (F_status_is_error(status)) return status; memcpy(failure.path.string, path_destination, size); @@ -224,68 +224,68 @@ extern "C" { #endif // !defined(_di_fl_directory_clone_file_) #if !defined(_di_fl_directory_copy_) - f_return_status private_fl_directory_copy(const f_string_static source, const f_string_static destination, const f_mode mode, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) { - f_status status = F_none; - f_directory_listing listing = f_directory_listing_initialize; + f_return_status private_fl_directory_copy(const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) { + f_status_t status = F_none; + f_directory_listing_t listing = f_directory_listing_t_initialize; status = private_fl_directory_list(source.string, 0, 0, F_false, &listing); if (F_status_is_error(status)) { - f_macro_directory_listing_delete_simple(listing); + f_macro_directory_listing_t_delete_simple(listing); return status; } status = F_none; - f_array_length i = 0; + f_array_length_t i = 0; int directory_fd = 0; - f_string_length failures_used = failures ? failures->used : 0; + f_string_length_t failures_used = failures ? failures->used : 0; for (; F_status_is_fine(status) && i < listing.block.used; i++) { status = private_fl_directory_copy_file(listing.block.array[i], source, destination, mode, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.block); + f_macro_string_dynamics_t_delete_simple(listing.block); for (i = 0; F_status_is_fine(status) && i < listing.character.used; i++) { status = private_fl_directory_copy_file(listing.character.array[i], source, destination, mode, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.character); + f_macro_string_dynamics_t_delete_simple(listing.character); for (i = 0; F_status_is_fine(status) && i < listing.fifo.used; i++) { status = private_fl_directory_copy_file(listing.fifo.array[i], source, destination, mode, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.fifo); + f_macro_string_dynamics_t_delete_simple(listing.fifo); for (i = 0; F_status_is_fine(status) && i < listing.regular.used; i++) { status = private_fl_directory_copy_file(listing.regular.array[i], source, destination, mode, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.regular); + f_macro_string_dynamics_t_delete_simple(listing.regular); for (i = 0; F_status_is_fine(status) && i < listing.link.used; i++) { status = private_fl_directory_copy_file(listing.link.array[i], source, destination, mode, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.link); + f_macro_string_dynamics_t_delete_simple(listing.link); for (i = 0; F_status_is_fine(status) && i < listing.socket.used; i++) { status = private_fl_directory_copy_file(listing.socket.array[i], source, destination, mode, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.socket); + f_macro_string_dynamics_t_delete_simple(listing.socket); for (i = 0; F_status_is_fine(status) && i < listing.unknown.used; i++) { status = private_fl_directory_copy_file(listing.unknown.array[i], source, destination, mode, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.unknown); + f_macro_string_dynamics_t_delete_simple(listing.unknown); for (i = 0; F_status_is_fine(status) && i < listing.directory.used; i++) { - f_string_static source_sub = f_string_static_initialize; - f_string_static destination_sub = f_string_static_initialize; + f_string_static_t source_sub = f_string_static_t_initialize; + f_string_static_t destination_sub = f_string_static_t_initialize; source_sub.used = source.used + listing.directory.array[i].used + 1; source_sub.size = source_sub.used; @@ -339,7 +339,7 @@ extern "C" { status = private_fl_directory_copy(source_sub, destination_sub, mode, size_block, exclusive, verbose, failures); } // for - f_macro_string_dynamics_delete_simple(listing.directory); + f_macro_string_dynamics_t_delete_simple(listing.directory); if (F_status_is_error(status)) return status; @@ -350,7 +350,7 @@ extern "C" { #endif // !defined(_di_fl_directory_copy_) #if !defined(_di_fl_directory_copy_file_) - f_return_status private_fl_directory_copy_file(const f_string_static file, const f_string_static source, const f_string_static destination, const f_mode mode, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) { + f_return_status private_fl_directory_copy_file(const f_string_static_t file, const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) { char path_source[source.used + file.used + 2]; char path_destination[destination.used + file.used + 2]; @@ -364,7 +364,7 @@ extern "C" { path_destination[destination.used] = f_path_separator[0]; path_destination[destination.used + file.used + 1] = 0; - f_status status = f_file_copy(path_source, path_destination, mode, size_block, exclusive); + f_status_t status = f_file_copy(path_source, path_destination, mode, size_block, exclusive); if (F_status_is_error(status) || status == F_unsupported) { if (status == F_status_set_error(F_memory_allocation) || status == F_status_set_error(F_memory_reallocation)) { @@ -373,13 +373,13 @@ extern "C" { if (!failures) return F_failure; - const f_status status_failure = status; + const f_status_t status_failure = status; - f_macro_memory_structure_macro_increment(status, (*failures), 1, f_memory_default_allocation_step, f_macro_directory_statuss_resize, F_buffer_too_large); + f_macro_memory_structure_macro_increment(status, (*failures), 1, f_memory_default_allocation_step, f_macro_directory_statuss_t_resize, F_buffer_too_large); if (F_status_is_error(status)) return status; - f_directory_status failure = f_directory_status_initialize; - f_string_length size = 0; + f_directory_status_t failure = f_directory_status_t_initialize; + f_string_length_t size = 0; // identify if failure was because of source or destination. struct stat source_stat; @@ -389,13 +389,13 @@ extern "C" { status = f_file_stat(source.string, F_false, &source_stat); if (F_status_is_error(status)) { if (status == F_status_set_error(F_string_too_large)) { - size = f_string_length_size - 1; + size = f_string_length_t_size - 1; } else { size = source.used + file.used + 1; } - f_macro_directory_status_resize(status, failure, size + 1); + f_macro_directory_status_t_resize(status, failure, size + 1); if (F_status_is_error(status)) return status; memcpy(failure.path.string, path_source, size); @@ -403,13 +403,13 @@ extern "C" { } else { if (status == F_status_set_error(F_string_too_large)) { - size = f_string_length_size - 1; + size = f_string_length_t_size - 1; } else { size = destination.used + file.used + 1; } - f_macro_directory_status_resize(status, failure, size + 1); + f_macro_directory_status_t_resize(status, failure, size + 1); if (F_status_is_error(status)) return status; memcpy(failure.path.string, path_destination, size); @@ -434,11 +434,11 @@ extern "C" { #endif // !defined(_di_fl_directory_copy_file_) #if !defined(_di_fl_directory_list_) - f_return_status private_fl_directory_list(const f_string path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing *listing) { + f_return_status private_fl_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing) { struct dirent **entity = 0; - f_string_length size = 0; - f_status status = F_none; + f_string_length_t size = 0; + f_status_t status = F_none; DIR *parent = opendir(path); @@ -492,8 +492,8 @@ extern "C" { else return F_status_set_error(F_failure); } - f_string_dynamics *names = 0; - f_string_length total = 0; + f_string_dynamics_t *names = 0; + f_string_length_t total = 0; struct stat file_stat; int mode = 0; size_t i = 0; @@ -544,18 +544,18 @@ extern "C" { if (F_status_is_error(status)) break; } - f_macro_string_dynamic_new(status, names->array[names->used], size); + f_macro_string_dynamic_t_new(status, names->array[names->used], size); if (F_status_is_error(status)) break; if (names->array[names->used].used > 0 && names->array[names->used].string[names->array[names->used].used - 1] != 0) { - if (names->array[names->used].used == f_string_length_size) { + if (names->array[names->used].used == f_string_length_t_size) { status = F_status_set_error(F_string_too_large); break; } total = names->array[names->used].used + 1; if (total > names->array[names->used].size) { - f_status status = F_none; + f_status_t status = F_none; f_macro_string_dynamics_resize(status, (*names), total); if (F_status_is_error(status)) break; @@ -588,19 +588,19 @@ extern "C" { #endif // !defined(_di_fl_directory_list_) #if !defined(_di_fl_directory_path_push_) || !defined(_di_fl_directory_path_push_dynamic_) - f_return_status private_fl_directory_path_push(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status private_fl_directory_path_push(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { bool terminated_null = F_false; bool separator_prepend = F_false; bool separator_append = F_false; - f_string_length total = 0; - f_string_length start = 0; - f_string_length length_truncated = length; - f_status status = F_none; + f_string_length_t total = 0; + f_string_length_t start = 0; + f_string_length_t length_truncated = length; + f_status_t status = F_none; { - f_string_length i = 0; - f_string_length j = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; if (destination->used > 0) { if (destination->string[destination->used - 1] == 0) { @@ -757,11 +757,11 @@ extern "C" { total += length_truncated - start; if (destination->used + total > destination->size) { - if (destination->used + total > f_string_length_size) { + if (destination->used + total > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_macro_string_dynamic_resize(status, (*destination), destination->used + total); + f_macro_string_dynamic_t_resize(status, (*destination), destination->used + total); if (F_status_is_error(status)) return status; } } diff --git a/level_1/fl_directory/c/private-directory.h b/level_1/fl_directory/c/private-directory.h index 003a234..b8a3128 100644 --- a/level_1/fl_directory/c/private-directory.h +++ b/level_1/fl_directory/c/private-directory.h @@ -59,7 +59,7 @@ extern "C" { * @see fl_directory_clone() */ #if !defined(_di_fl_directory_clone_) - extern f_return_status private_fl_directory_clone(const f_string_static source, const f_string_static destination, const bool role, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_directory_clone(const f_string_static_t source, const f_string_static_t destination, const bool role, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fl_directory_clone_) /** @@ -111,7 +111,7 @@ extern "C" { * @see fl_directory_clone() */ #if !defined(_di_fl_directory_clone_file_) - extern f_return_status private_fl_directory_clone_file(const f_string_static file, const f_string_static source, const f_string_static destination, const bool role, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_directory_clone_file(const f_string_static_t file, const f_string_static_t source, const f_string_static_t destination, const bool role, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fl_directory_clone_file_) /** @@ -157,7 +157,7 @@ extern "C" { * @see fl_directory_copy() */ #if !defined(_di_fl_directory_copy_) - extern f_return_status private_fl_directory_copy(const f_string_static source, const f_string_static destination, const f_mode mode, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_directory_copy(const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fl_directory_copy_) /** @@ -206,7 +206,7 @@ extern "C" { * @see fl_directory_copy() */ #if !defined(_di_fl_directory_copy_file_) - extern f_return_status private_fl_directory_copy_file(const f_string_static file, const f_string_static source, const f_string_static destination, const f_mode mode, const f_number_unsigned size_block, const bool exclusive, FILE *verbose, f_directory_statuss *failures) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_directory_copy_file(const f_string_static_t file, const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const f_number_unsigned_t size_block, const bool exclusive, FILE *verbose, f_directory_statuss_t *failures) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fl_directory_copy_file_) /** @@ -244,7 +244,7 @@ extern "C" { * @see fl_directory_list() */ #if !defined(_di_fl_directory_list_) - extern f_return_status private_fl_directory_list(const f_string path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing *listing) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fl_directory_list_) /** @@ -275,7 +275,7 @@ extern "C" { * @see fl_directory_path_push_dynamic() */ #if !defined(_di_fl_directory_path_push_) || !defined(_di_fl_directory_path_push_dynamic_) - extern f_return_status private_fl_directory_path_push(const f_string source, const f_string_length length, f_string_dynamic *destination) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_directory_path_push(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_directory_path_push_) || !defined(_di_fl_directory_path_push_dynamic_) #ifdef __cplusplus diff --git a/level_1/fl_environment/c/environment.c b/level_1/fl_environment/c/environment.c index b2f4bb3..9144b35 100644 --- a/level_1/fl_environment/c/environment.c +++ b/level_1/fl_environment/c/environment.c @@ -5,14 +5,14 @@ extern "C" { #endif #ifndef _di_fl_environment_path_explode_ - f_return_status fl_environment_path_explode(const f_string path, f_string_dynamics *paths) { + f_return_status fl_environment_path_explode(const f_string_t path, f_string_dynamics_t *paths) { #ifndef _di_level_0_parameter_checking_ if (paths == 0) return F_status_set_error(F_parameter); if (paths->used > paths->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; - const f_string_length length = strnlen(path, PATH_MAX); + f_status_t status = F_none; + const f_string_length_t length = strnlen(path, PATH_MAX); if (length == 0) { // When PATH is "", this is actually a valid search path for PWD. @@ -20,15 +20,15 @@ extern "C" { f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_resize, F_buffer_too_large); if (F_status_is_error(status)) return status; - f_macro_string_dynamic_clear(paths->array[paths->used]); + f_macro_string_dynamic_t_clear(paths->array[paths->used]); paths->used++; return F_none; } - f_string_length i = length; - f_string_length first = 0; - f_string_length total = 0; + f_string_length_t i = length; + f_string_length_t first = 0; + f_string_length_t total = 0; for (i = 0; i <= length; i++) { if (i == length || path[i] == f_path_separator_variable[0]) { @@ -36,26 +36,26 @@ extern "C" { if (F_status_is_error(status)) return status; if (i == 0) { - f_macro_string_dynamic_clear(paths->array[paths->used]); + f_macro_string_dynamic_t_clear(paths->array[paths->used]); paths->used++; first = 1; continue; } - f_string_dynamic part = f_string_dynamic_initialize; + f_string_dynamic_t part = f_string_dynamic_t_initialize; total = i - first; if (total > 0) { if (path[i - 1] == f_path_separator[0]) { - f_macro_string_dynamic_new(status, part, total); + f_macro_string_dynamic_t_new(status, part, total); if (F_status_is_error(status)) return status; part.used = total; } else { - f_macro_string_dynamic_new(status, part, total + 1); + f_macro_string_dynamic_t_new(status, part, total + 1); if (F_status_is_error(status)) return status; part.string[total] = f_path_separator[0]; @@ -79,14 +79,14 @@ extern "C" { #endif // _di_fl_environment_path_explode_ #ifndef _di_fl_environment_path_explode_dynamic_ - f_return_status fl_environment_path_explode_dynamic(const f_string_static path, f_string_dynamics *paths) { + f_return_status fl_environment_path_explode_dynamic(const f_string_static_t path, f_string_dynamics_t *paths) { #ifndef _di_level_0_parameter_checking_ if (path.used > path.size) return F_status_set_error(F_parameter); if (paths == 0) return F_status_set_error(F_parameter); if (paths->used > paths->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; if (path.used == 0) { // When PATH is "", this is actually a valid search path for PWD. @@ -94,18 +94,18 @@ extern "C" { f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_resize, F_buffer_too_large); if (F_status_is_error(status)) return status; - f_macro_string_dynamic_clear(paths->array[paths->used]); + f_macro_string_dynamic_t_clear(paths->array[paths->used]); paths->used++; return F_none; } - f_string_length i = 0; - f_string_length j = 0; - f_string_length first = 0; - f_string_length total = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; + f_string_length_t first = 0; + f_string_length_t total = 0; - f_string_dynamic part = f_string_dynamic_initialize; + f_string_dynamic_t part = f_string_dynamic_t_initialize; for (i = 0; i <= path.used; i++) { if (i == path.used || path.string[i] == f_path_separator_variable[0]) { @@ -113,7 +113,7 @@ extern "C" { if (F_status_is_error(status)) return status; if (i == 0) { - f_macro_string_dynamic_clear(paths->array[paths->used]); + f_macro_string_dynamic_t_clear(paths->array[paths->used]); paths->used++; first = 1; @@ -123,7 +123,7 @@ extern "C" { total = i - first; if (total > 0) { - f_macro_string_dynamic_new(status, part, total); + f_macro_string_dynamic_t_new(status, part, total); if (F_status_is_error(status)) return status; for (j = 0; j < total; j++) { @@ -134,7 +134,7 @@ extern "C" { } // for if (part.string[part.used - 1] != f_path_separator[0]) { - f_macro_string_dynamic_resize(status, part, total + 1); + f_macro_string_dynamic_t_resize(status, part, total + 1); if (F_status_is_error(status)) return status; part.string[part.used] = f_path_separator[0]; @@ -156,14 +156,14 @@ extern "C" { #endif // _di_fl_environment_path_explode_dynamic_ #ifndef _di_fl_environment_path_explode_reverse_ - f_return_status fl_environment_path_explode_reverse(const f_string path, f_string_dynamics *paths) { + f_return_status fl_environment_path_explode_reverse(const f_string_t path, f_string_dynamics_t *paths) { #ifndef _di_level_0_parameter_checking_ if (paths == 0) return F_status_set_error(F_parameter); if (paths->used > paths->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; - const f_string_length length = strnlen(path, PATH_MAX); + f_status_t status = F_none; + const f_string_length_t length = strnlen(path, PATH_MAX); if (length == 0) { // When PATH is "", this is actually a valid search path for PWD. @@ -179,12 +179,12 @@ extern "C" { return F_none; } - f_string_length i = length; - f_string_length j = length; - f_string_length last = length; - f_string_length total = 0; + f_string_length_t i = length; + f_string_length_t j = length; + f_string_length_t last = length; + f_string_length_t total = 0; - f_string_dynamic part = f_string_dynamic_initialize; + f_string_dynamic_t part = f_string_dynamic_t_initialize; for (; i > 0; i--) { j--; @@ -198,13 +198,13 @@ extern "C" { if (total > 0) { if (path[j + total] == f_path_separator[0]) { - f_macro_string_dynamic_new(status, part, total); + f_macro_string_dynamic_t_new(status, part, total); if (F_status_is_error(status)) return status; part.used = total; } else { - f_macro_string_dynamic_new(status, part, total + 1); + f_macro_string_dynamic_t_new(status, part, total + 1); if (F_status_is_error(status)) return status; part.string[total] = f_path_separator[0]; @@ -222,13 +222,13 @@ extern "C" { if (total > 0) { if (path[last - 1] == f_path_separator[0]) { - f_macro_string_dynamic_new(status, part, total); + f_macro_string_dynamic_t_new(status, part, total); if (F_status_is_error(status)) return status; part.used = total; } else { - f_macro_string_dynamic_new(status, part, total + 1); + f_macro_string_dynamic_t_new(status, part, total + 1); if (F_status_is_error(status)) return status; part.used = total + 1; @@ -251,14 +251,14 @@ extern "C" { #endif // _di_fl_environment_path_explode_reverse_ #ifndef _di_fl_environment_path_explode_reverse_dynamic_ - f_return_status fl_environment_path_explode_reverse_dynamic(const f_string_static path, f_string_dynamics *paths) { + f_return_status fl_environment_path_explode_reverse_dynamic(const f_string_static_t path, f_string_dynamics_t *paths) { #ifndef _di_level_0_parameter_checking_ if (path.used > path.size) return F_status_set_error(F_parameter); if (paths == 0) return F_status_set_error(F_parameter); if (paths->used > paths->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; if (path.used == 0) { // When PATH is "", this is actually a valid search path for PWD. @@ -266,19 +266,19 @@ extern "C" { f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_resize, F_buffer_too_large); if (F_status_is_error(status)) return status; - f_macro_string_dynamic_clear(paths->array[paths->used]); + f_macro_string_dynamic_t_clear(paths->array[paths->used]); paths->used++; return F_none; } - f_string_length i = path.used; - f_string_length j = path.used; - f_string_length k = 0; - f_string_length last = path.used; - f_string_length total = 0; + f_string_length_t i = path.used; + f_string_length_t j = path.used; + f_string_length_t k = 0; + f_string_length_t last = path.used; + f_string_length_t total = 0; - f_string_dynamic part = f_string_dynamic_initialize; + f_string_dynamic_t part = f_string_dynamic_t_initialize; for (; i > 0; i--) { j--; @@ -291,7 +291,7 @@ extern "C" { total = last - i; if (total > 0) { - f_macro_string_dynamic_new(status, part, total); + f_macro_string_dynamic_t_new(status, part, total); if (F_status_is_error(status)) return status; for (k = 0; k < total; k++) { @@ -302,7 +302,7 @@ extern "C" { } // for if (part.string[part.used - 1] != f_path_separator[0]) { - f_macro_string_dynamic_resize(status, part, total + 1); + f_macro_string_dynamic_t_resize(status, part, total + 1); if (F_status_is_error(status)) return status; part.string[part.used] = f_path_separator[0]; @@ -316,7 +316,7 @@ extern "C" { // when j = 0, the total is actually the entire length to max. total = last - j; - f_macro_string_dynamic_new(status, part, total); + f_macro_string_dynamic_t_new(status, part, total); if (F_status_is_error(status)) return status; for (k = 0; k < total; k++) { @@ -327,7 +327,7 @@ extern "C" { } // for if (part.string[part.used - 1] != f_path_separator[0]) { - f_macro_string_dynamic_resize(status, part, total + 1); + f_macro_string_dynamic_t_resize(status, part, total + 1); if (F_status_is_error(status)) return status; part.string[part.used - 1] = f_path_separator[0]; diff --git a/level_1/fl_environment/c/environment.h b/level_1/fl_environment/c/environment.h index c3e49b6..038781f 100644 --- a/level_1/fl_environment/c/environment.h +++ b/level_1/fl_environment/c/environment.h @@ -46,7 +46,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_environment_path_explode_ - extern f_return_status fl_environment_path_explode(const f_string path, f_string_dynamics *paths); + extern f_return_status fl_environment_path_explode(const f_string_t path, f_string_dynamics_t *paths); #endif // _di_fl_environment_path_explode_ /** @@ -70,7 +70,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_environment_path_explode_dynamic_ - extern f_return_status fl_environment_path_explode_dynamic(const f_string_static path, f_string_dynamics *paths); + extern f_return_status fl_environment_path_explode_dynamic(const f_string_static_t path, f_string_dynamics_t *paths); #endif // _di_fl_environment_path_explode_dynamic_ /** @@ -96,7 +96,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_environment_path_explode_reverse_ - extern f_return_status fl_environment_path_explode_reverse(const f_string path, f_string_dynamics *paths); + extern f_return_status fl_environment_path_explode_reverse(const f_string_t path, f_string_dynamics_t *paths); #endif // _di_fl_environment_path_explode_reverse_ /** @@ -122,7 +122,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_environment_path_explode_reverse_dynamic_ - extern f_return_status fl_environment_path_explode_reverse_dynamic(const f_string_static path, f_string_dynamics *paths); + extern f_return_status fl_environment_path_explode_reverse_dynamic(const f_string_static_t path, f_string_dynamics_t *paths); #endif // _di_fl_environment_path_explode_reverse_dynamic_ #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index 7a082a7..a080e20 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fl_fss_basic_object_read_ - f_return_status fl_fss_basic_object_read(f_string_dynamic *buffer, f_string_range *range, f_fss_object *found, f_fss_quoted *quoted) { + f_return_status fl_fss_basic_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quoted_t *quoted) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (buffer->used == 0) return F_status_set_error(F_parameter); @@ -16,17 +16,17 @@ extern "C" { if (range->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; - f_string_lengths delimits = f_string_lengths_initialize; + f_status_t status = F_none; + f_string_lengths_t delimits = f_string_lengths_t_initialize; status = private_fl_fss_basic_object_read(buffer, range, found, quoted, &delimits); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } if (status == FL_fss_found_object_not || status == F_data_not || status == F_data_not_eos || status == F_data_not_stop) { - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } @@ -37,7 +37,7 @@ extern "C" { #endif // _di_fl_fss_basic_object_read_ #ifndef _di_fl_fss_basic_content_read_ - f_return_status fl_fss_basic_content_read(f_string_dynamic *buffer, f_string_range *range, f_fss_content *found) { + f_return_status fl_fss_basic_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (buffer->used == 0) return F_status_set_error(F_parameter); @@ -47,10 +47,10 @@ extern "C" { if (range->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; // delimits must only be applied once a valid object is found. - f_string_lengths delimits = f_string_lengths_initialize; + f_string_lengths_t delimits = f_string_lengths_t_initialize; status = f_fss_skip_past_space(*buffer, range); if (F_status_is_error(status)) return status; @@ -92,7 +92,7 @@ extern "C" { #endif // _di_fl_fss_basic_content_read_ #ifndef _di_fl_fss_basic_object_write_ - f_return_status fl_fss_basic_object_write(const f_string_static object, const f_fss_quoted quoted, f_string_range *range, f_string_dynamic *destination) { + f_return_status fl_fss_basic_object_write(const f_string_static_t object, const f_fss_quoted_t quoted, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -102,29 +102,29 @@ extern "C" { #endif // _di_fl_fss_basic_object_write_ #ifndef _di_fl_fss_basic_content_write_ - f_return_status fl_fss_basic_content_write(const f_string_static content, f_string_range *range, f_string_dynamic *destination) { + f_return_status fl_fss_basic_content_write(const f_string_static_t content, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; fl_macro_fss_skip_past_delimit_placeholders(content, (*range)); if (range->start > range->stop) return F_data_not_stop; else if (range->start >= content.used) return F_data_not_eos; - f_string_range input_position = f_string_range_initialize; - f_string_range buffer_position = f_string_range_initialize; + f_string_range_t input_position = f_string_range_initialize; + f_string_range_t buffer_position = f_string_range_initialize; // ensure that there is room for the terminating newline. - f_string_length size_allocate = destination->used + content.used + 1 + f_fss_default_allocation_step_string; + f_string_length_t size_allocate = destination->used + content.used + 1 + f_fss_default_allocation_step_string; buffer_position.start = destination->used; buffer_position.stop = destination->used; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate); if (F_status_is_error(status)) return status; } diff --git a/level_1/fl_fss/c/fss_basic.h b/level_1/fl_fss/c/fss_basic.h index 85d26a2..d2fe451 100644 --- a/level_1/fl_fss/c/fss_basic.h +++ b/level_1/fl_fss/c/fss_basic.h @@ -74,7 +74,7 @@ extern "C" { * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_object_read_ - extern f_return_status fl_fss_basic_object_read(f_string_dynamic *buffer, f_string_range *range, f_fss_object *found, f_fss_quoted *quoted); + extern f_return_status fl_fss_basic_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quoted_t *quoted); #endif // _di_fl_fss_basic_object_read_ /** @@ -117,7 +117,7 @@ extern "C" { * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_content_read_ - extern f_return_status fl_fss_basic_content_read(f_string_dynamic *buffer, f_string_range *range, f_fss_content *found); + extern f_return_status fl_fss_basic_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found); #endif // _di_fl_fss_basic_content_read_ /** @@ -151,7 +151,7 @@ extern "C" { * Errors from (with error bit): f_utf_buffer_increment(). */ #ifndef _di_fl_fss_basic_object_write_ - extern f_return_status fl_fss_basic_object_write(const f_string_static object, const f_fss_quoted quoted, f_string_range *range, f_string_dynamic *destination); + extern f_return_status fl_fss_basic_object_write(const f_string_static_t object, const f_fss_quoted_t quoted, f_string_range_t *range, f_string_dynamic_t *destination); #endif // _di_fl_fss_basic_object_write_ /** @@ -180,7 +180,7 @@ extern "C" { * Errors from (with error bit): f_utf_buffer_increment(). */ #ifndef _di_fl_fss_basic_content_write_ - extern f_return_status fl_fss_basic_content_write(const f_string_static content, f_string_range *range, f_string_dynamic *destination); + extern f_return_status fl_fss_basic_content_write(const f_string_static_t content, f_string_range_t *range, f_string_dynamic_t *destination); #endif // _di_fl_fss_basic_content_write_ #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss_basic_list.c b/level_1/fl_fss/c/fss_basic_list.c index 0a82321..df0589d 100644 --- a/level_1/fl_fss/c/fss_basic_list.c +++ b/level_1/fl_fss/c/fss_basic_list.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fl_fss_basic_list_object_read_ - f_return_status fl_fss_basic_list_object_read(f_string_dynamic *buffer, f_string_range *range, f_fss_object *found) { + f_return_status fl_fss_basic_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (buffer->used == 0) return F_status_set_error(F_parameter); @@ -16,10 +16,10 @@ extern "C" { if (range->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; // delimits must only be applied once a valid object is found. - f_string_lengths delimits = f_string_lengths_initialize; + f_string_lengths_t delimits = f_string_lengths_t_initialize; status = f_fss_skip_past_space(*buffer, range); if (F_status_is_error(status)) return status; @@ -52,8 +52,8 @@ extern "C" { // identify where the object ends. while (range->start < buffer->used && range->start <= range->stop && buffer->string[range->start] != f_string_eol[0]) { if (buffer->string[range->start] == f_fss_delimit_slash) { - f_string_length first_slash = range->start; - f_string_length slash_count = 1; + f_string_length_t first_slash = range->start; + f_string_length_t slash_count = 1; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) return status; @@ -70,7 +70,7 @@ extern "C" { fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), delimits, F_data_not_eos, F_data_not_stop); if (buffer->string[range->start] == f_fss_basic_list_open) { - f_string_length stop_point = range->start - 1; + f_string_length_t stop_point = range->start - 1; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) return status; @@ -90,15 +90,15 @@ extern "C" { fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), delimits, F_data_not_eos, F_data_not_stop); if (buffer->string[range->start] == f_string_eol[0]) { - f_string_length start = range->start; + f_string_length_t start = range->start; range->start = first_slash; if (delimits.used + (slash_count / 2) >= delimits.size) { - f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); + f_macro_string_lengths_t_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } } @@ -134,7 +134,7 @@ extern "C" { continue; } else if (buffer->string[range->start] == f_fss_basic_list_open) { - f_string_length stop_point = range->start - 1; + f_string_length_t stop_point = range->start - 1; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) return status; @@ -187,7 +187,7 @@ extern "C" { #endif // _di_fl_fss_basic_list_object_read_ #ifndef _di_fl_fss_basic_list_content_read_ - f_return_status fl_fss_basic_list_content_read(f_string_dynamic *buffer, f_string_range *range, f_fss_content *found) { + f_return_status fl_fss_basic_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (buffer->used == 0) return F_status_set_error(F_parameter); @@ -197,10 +197,10 @@ extern "C" { if (range->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; // delimits must only be applied once a valid object is found. - f_string_lengths delimits = f_string_lengths_initialize; + f_string_lengths_t delimits = f_string_lengths_t_initialize; fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*range)); fl_macro_fss_content_return_on_overflow((*buffer), (*range), (*found), delimits, F_none_eos, F_none_stop) @@ -208,7 +208,7 @@ extern "C" { fl_macro_fss_allocate_content_if_necessary((*found), delimits); found->array[found->used].start = range->start; - f_string_length last_newline = range->start; + f_string_length_t last_newline = range->start; bool found_newline = F_false; // identify where the content ends. @@ -226,8 +226,8 @@ extern "C" { } if (buffer->string[range->start] == f_fss_delimit_slash) { - f_string_length first_slash = range->start; - f_string_length slash_count = 1; + f_string_length_t first_slash = range->start; + f_string_length_t slash_count = 1; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) return status; @@ -249,7 +249,7 @@ extern "C" { } if (buffer->string[range->start] == f_fss_basic_list_open) { - f_string_length stop_point = range->start - 1; + f_string_length_t stop_point = range->start - 1; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) return status; @@ -274,7 +274,7 @@ extern "C" { } if (buffer->string[range->start] == f_string_eol[0]) { - f_string_length start = range->start; + f_string_length_t start = range->start; range->start = first_slash; @@ -293,10 +293,10 @@ extern "C" { } if (delimits.used + (slash_count / 2) >= delimits.size) { - f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); + f_macro_string_lengths_t_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } } @@ -389,17 +389,17 @@ extern "C" { #endif // _di_fl_fss_basic_list_content_read_ #ifndef _di_fl_fss_basic_list_object_write_ - f_return_status fl_fss_basic_list_object_write(const f_string_static object, f_string_range *range, f_string_dynamic *destination) { + f_return_status fl_fss_basic_list_object_write(const f_string_static_t object, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; - f_string_range buffer_position = f_string_range_initialize; - f_string_length start_position = f_string_initialize; - f_string_length size_allocate = 0; - f_string_length start_buffer = 0; + f_string_range_t buffer_position = f_string_range_initialize; + f_string_length_t start_position = f_string_t_initialize; + f_string_length_t size_allocate = 0; + f_string_length_t start_buffer = 0; fl_macro_fss_skip_past_delimit_placeholders(object, (*range)) @@ -412,7 +412,7 @@ extern "C" { size_allocate = destination->used + (range->stop - range->start) + 2 + f_fss_default_allocation_step_string; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate); if (F_status_is_error(status)) return status; } @@ -442,7 +442,7 @@ extern "C" { while (range->start <= range->stop && range->start < object.used) { if (object.string[range->start] == f_fss_delimit_slash) { - f_string_length slash_count = 1; + f_string_length_t slash_count = 1; destination->string[buffer_position.stop] = object.string[range->start]; buffer_position.stop++; @@ -473,7 +473,7 @@ extern "C" { size_allocate += slash_count; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } @@ -515,18 +515,18 @@ extern "C" { #endif // _di_fl_fss_basic_list_object_write_ #ifndef _di_fl_fss_basic_list_content_write_ - f_return_status fl_fss_basic_list_content_write(const f_string_static content, f_string_range *range, f_string_dynamic *destination) { + f_return_status fl_fss_basic_list_content_write(const f_string_static_t content, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; bool is_comment = F_false; bool has_graph = F_false; - f_string_range buffer_position = f_string_range_initialize; - f_string_length start_position = f_string_initialize; - f_string_length size_allocate = 0; + f_string_range_t buffer_position = f_string_range_initialize; + f_string_length_t start_position = f_string_t_initialize; + f_string_length_t size_allocate = 0; fl_macro_fss_skip_past_delimit_placeholders(content, (*range)) @@ -539,7 +539,7 @@ extern "C" { size_allocate = destination->used + (range->stop - range->start) + 2 + f_fss_default_allocation_step_string; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate); if (F_status_is_error(status)) return status; } @@ -549,7 +549,7 @@ extern "C" { while (range->start <= range->stop && range->start < content.used) { if (content.string[range->start] == f_fss_delimit_slash && !is_comment) { - f_string_length slash_count = 1; + f_string_length_t slash_count = 1; destination->string[buffer_position.stop] = content.string[range->start]; buffer_position.stop++; @@ -579,7 +579,7 @@ extern "C" { } // while if (content.string[range->start] == f_fss_basic_list_open) { - f_string_length start = range->start; + f_string_length_t start = range->start; status = f_utf_buffer_increment(content, range, 1); if (F_status_is_error(status)) return status; @@ -600,7 +600,7 @@ extern "C" { size_allocate += slash_count + 1; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } @@ -623,7 +623,7 @@ extern "C" { } } else if (content.string[range->start] == f_fss_basic_list_open && !is_comment) { - f_string_length start = range->start; + f_string_length_t start = range->start; has_graph = F_true; @@ -646,7 +646,7 @@ extern "C" { size_allocate++; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } diff --git a/level_1/fl_fss/c/fss_basic_list.h b/level_1/fl_fss/c/fss_basic_list.h index 22aa6d2..5c465cd 100644 --- a/level_1/fl_fss/c/fss_basic_list.h +++ b/level_1/fl_fss/c/fss_basic_list.h @@ -72,7 +72,7 @@ extern "C" { * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_list_object_read_ - extern f_return_status fl_fss_basic_list_object_read(f_string_dynamic *buffer, f_string_range *range, f_fss_object *found); + extern f_return_status fl_fss_basic_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found); #endif // _di_fl_fss_basic_list_object_read_ /** @@ -115,7 +115,7 @@ extern "C" { * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_list_content_read_ - extern f_return_status fl_fss_basic_list_content_read(f_string_dynamic *buffer, f_string_range *range, f_fss_content *found); + extern f_return_status fl_fss_basic_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found); #endif // _di_fl_fss_basic_list_content_read_ /** @@ -146,7 +146,7 @@ extern "C" { * Errors from (with error bit): f_utf_buffer_increment(). */ #ifndef _di_fl_fss_basic_list_object_write_ - extern f_return_status fl_fss_basic_list_object_write(const f_string_static object, f_string_range *range, f_string_dynamic *destination); + extern f_return_status fl_fss_basic_list_object_write(const f_string_static_t object, f_string_range_t *range, f_string_dynamic_t *destination); #endif // _di_fl_fss_basic_list_object_write_ /** @@ -176,7 +176,7 @@ extern "C" { * Errors from (with error bit): f_utf_buffer_increment(). */ #ifndef _di_fl_fss_basic_list_content_write_ - extern f_return_status fl_fss_basic_list_content_write(const f_string_static content, f_string_range *range, f_string_dynamic *destination); + extern f_return_status fl_fss_basic_list_content_write(const f_string_static_t content, f_string_range_t *range, f_string_dynamic_t *destination); #endif // _di_fl_fss_basic_list_content_write_ #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index 9839b43..8d16de4 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fl_fss_extended_object_read_ - f_return_status fl_fss_extended_object_read(f_string_dynamic *buffer, f_string_range *range, f_fss_object *found, f_fss_quoted *quoted) { + f_return_status fl_fss_extended_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quoted_t *quoted) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (buffer->used == 0) return F_status_set_error(F_parameter); @@ -16,17 +16,17 @@ extern "C" { if (range->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; - f_string_lengths delimits = f_string_lengths_initialize; + f_status_t status = F_none; + f_string_lengths_t delimits = f_string_lengths_t_initialize; status = private_fl_fss_basic_object_read(buffer, range, found, quoted, &delimits); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } if (status == FL_fss_found_object_not || status == F_data_not || status == F_data_not_eos || status == F_data_not_stop) { - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } @@ -37,7 +37,7 @@ extern "C" { #endif // _di_fl_fss_extended_object_read_ #ifndef _di_fl_fss_extended_content_read_ - f_return_status fl_fss_extended_content_read(f_string_dynamic *buffer, f_string_range *range, f_fss_content *found, f_fss_quoteds *quoteds) { + f_return_status fl_fss_extended_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_quoteds_t *quoteds) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (buffer->used == 0) return F_status_set_error(F_parameter); @@ -47,8 +47,8 @@ extern "C" { if (range->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; - f_status status_allocate = F_none; + f_status_t status = F_none; + f_status_t status_allocate = F_none; status = f_fss_skip_past_space(*buffer, range); if (F_status_is_error(status)) return status; @@ -65,35 +65,35 @@ extern "C" { return F_data_not_stop; } - f_string_lengths delimits = f_string_lengths_initialize; + f_string_lengths_t delimits = f_string_lengths_t_initialize; uint8_t content_found = 0; while (range->start <= range->stop && range->start < buffer->used) { - f_string_range content_partial = f_string_range_initialize; - f_fss_quoted quoted = 0; + f_string_range_t content_partial = f_string_range_initialize; + f_fss_quoted_t quoted = 0; status = private_fl_fss_basic_object_read(buffer, range, &content_partial, "ed, &delimits); if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { if (found->used == found->size) { if (found->used + f_fss_default_allocation_step > found->size) { - if (found->used == f_array_length_size) { - f_macro_string_lengths_delete_simple(delimits); + if (found->used == f_array_length_t_size) { + f_macro_string_lengths_t_delete_simple(delimits); return F_status_set_error(F_buffer_too_large); } else { - f_macro_fss_content_resize(status_allocate, (*found), found->size + f_fss_default_allocation_step); + f_macro_fss_content_t_resize(status_allocate, (*found), found->size + f_fss_default_allocation_step); } } else { - f_macro_fss_content_resize(status_allocate, (*found), found->size + f_fss_default_allocation_step); + f_macro_fss_content_t_resize(status_allocate, (*found), found->size + f_fss_default_allocation_step); } if (F_status_is_error(status_allocate)) return status_allocate; if (quoteds) { - f_macro_fss_quoteds_resize(status_allocate, (*quoteds), found->size); + f_macro_fss_quoteds_t_resize(status_allocate, (*quoteds), found->size); if (F_status_is_error(status_allocate)) return status_allocate; } } @@ -136,7 +136,7 @@ extern "C" { break; } else if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } } // while @@ -156,7 +156,7 @@ extern "C" { #endif // _di_fl_fss_extended_content_read_ #ifndef _di_fl_fss_extended_object_write_ -f_return_status fl_fss_extended_object_write(const f_string_static object, const f_fss_quoted quoted, f_string_range *range, f_string_dynamic *destination) { +f_return_status fl_fss_extended_object_write(const f_string_static_t object, const f_fss_quoted_t quoted, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -166,7 +166,7 @@ f_return_status fl_fss_extended_object_write(const f_string_static object, const #endif // _di_fl_fss_extended_object_write_ #ifndef _di_fl_fss_extended_content_write_ - f_return_status fl_fss_extended_content_write(const f_string_static content, const f_fss_quoted quoted, f_string_range *range, f_string_dynamic *destination) { + f_return_status fl_fss_extended_content_write(const f_string_static_t content, const f_fss_quoted_t quoted, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ diff --git a/level_1/fl_fss/c/fss_extended.h b/level_1/fl_fss/c/fss_extended.h index 2a04fa2..38c0e1d 100644 --- a/level_1/fl_fss/c/fss_extended.h +++ b/level_1/fl_fss/c/fss_extended.h @@ -74,7 +74,7 @@ extern "C" { * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_object_read_ - extern f_return_status fl_fss_extended_object_read(f_string_dynamic *buffer, f_string_range *range, f_fss_object *found, f_fss_quoted *quoted); + extern f_return_status fl_fss_extended_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quoted_t *quoted); #endif // _di_fl_fss_extended_object_read_ /** @@ -120,7 +120,7 @@ extern "C" { * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_content_read_ - extern f_return_status fl_fss_extended_content_read(f_string_dynamic *buffer, f_string_range *range, f_fss_content *found, f_fss_quoteds *quoteds); + extern f_return_status fl_fss_extended_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_quoteds_t *quoteds); #endif // _di_fl_fss_extended_content_read_ /** @@ -154,7 +154,7 @@ extern "C" { * Errors from (with error bit): f_utf_buffer_increment(). */ #ifndef _di_fl_fss_extended_object_write_ - extern f_return_status fl_fss_extended_object_write(const f_string_static object, const f_fss_quoted quoted, f_string_range *range, f_string_dynamic *destination); + extern f_return_status fl_fss_extended_object_write(const f_string_static_t object, const f_fss_quoted_t quoted, f_string_range_t *range, f_string_dynamic_t *destination); #endif // _di_fl_fss_extended_object_write_ /** @@ -187,7 +187,7 @@ extern "C" { * Errors from (with error bit): f_utf_buffer_increment(). */ #ifndef _di_fl_fss_extended_content_write_ - extern f_return_status fl_fss_extended_content_write(const f_string_static content, const f_fss_quoted quoted, f_string_range *range, f_string_dynamic *destination); + extern f_return_status fl_fss_extended_content_write(const f_string_static_t content, const f_fss_quoted_t quoted, f_string_range_t *range, f_string_dynamic_t *destination); #endif // _di_fl_fss_extended_content_write_ #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss_extended_list.c b/level_1/fl_fss/c/fss_extended_list.c index b075aac..a7d5510 100644 --- a/level_1/fl_fss/c/fss_extended_list.c +++ b/level_1/fl_fss/c/fss_extended_list.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fl_fss_extended_list_object_read_ - f_return_status fl_fss_extended_list_object_read(f_string_dynamic *buffer, f_string_range *range, f_fss_object *found) { + f_return_status fl_fss_extended_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (buffer->used == 0) return F_status_set_error(F_parameter); @@ -16,10 +16,10 @@ extern "C" { if (range->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; // delimits must only be applied once a valid object is found. - f_string_lengths delimits = f_string_lengths_initialize; + f_string_lengths_t delimits = f_string_lengths_t_initialize; status = f_fss_skip_past_space(*buffer, range); if (F_status_is_error(status)) return status; @@ -60,8 +60,8 @@ extern "C" { // identify where the object ends. while (range->start < buffer->used && range->start <= range->stop && buffer->string[range->start] != f_string_eol[0]) { if (buffer->string[range->start] == f_fss_delimit_slash) { - f_string_length first_slash = range->start; - f_string_length slash_count = 1; + f_string_length_t first_slash = range->start; + f_string_length_t slash_count = 1; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) return status; @@ -78,7 +78,7 @@ extern "C" { fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), delimits, F_data_not_eos, F_data_not_stop); if (buffer->string[range->start] == f_fss_extended_list_open) { - f_string_length stop_point = range->start - 1; + f_string_length_t stop_point = range->start - 1; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) return status; @@ -97,15 +97,15 @@ extern "C" { fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), delimits, F_data_not_eos, F_data_not_stop); if (buffer->string[range->start] == f_string_eol[0]) { - f_string_length start = range->start; + f_string_length_t start = range->start; range->start = first_slash; if (delimits.used + (slash_count / 2) >= delimits.size) { - f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); + f_macro_string_lengths_t_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } } @@ -141,7 +141,7 @@ extern "C" { continue; } else if (buffer->string[range->start] == f_fss_extended_list_open) { - f_string_length stop_point = range->start - 1; + f_string_length_t stop_point = range->start - 1; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) return status; @@ -194,7 +194,7 @@ extern "C" { #endif // _di_fl_fss_extended_list_object_read_ #ifndef _di_fl_fss_extended_list_content_read_ - f_return_status fl_fss_extended_list_content_read(f_string_dynamic *buffer, f_string_range *range, f_fss_nest *found) { + f_return_status fl_fss_extended_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_nest_t *found) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (buffer->used == 0) return F_status_set_error(F_parameter); @@ -204,41 +204,41 @@ extern "C" { if (range->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; // delimits must only be applied once a valid object is found. - f_string_lengths delimits = f_string_lengths_initialize; - f_string_lengths positions_start = f_string_lengths_initialize; - f_fss_objects objects = f_fss_objects_initialize; + f_string_lengths_t delimits = f_string_lengths_t_initialize; + f_string_lengths_t positions_start = f_string_lengths_t_initialize; + f_fss_objects_t objects = f_fss_objects_t_initialize; fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*range)); fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), positions_start, delimits, objects, F_none_eos, F_none_stop) if (found->used + 1 >= found->size) { - f_macro_fss_nest_resize(status, (*found), found->size + f_fss_default_allocation_step + 1); + f_macro_fss_nest_t_resize(status, (*found), found->size + f_fss_default_allocation_step + 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } } - f_array_length depth = 0; - f_string_length position_previous = range->start; - f_string_length line_start = range->start; - f_string_length last_newline = range->start; + f_array_length_t depth = 0; + f_string_length_t position_previous = range->start; + f_string_length_t line_start = range->start; + f_string_length_t last_newline = range->start; - f_macro_string_lengths_new(status, positions_start, f_fss_default_allocation_step); + f_macro_string_lengths_t_new(status, positions_start, f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(delimits); return status; } - f_macro_fss_objects_new(status, objects, f_fss_default_allocation_step); + f_macro_fss_objects_t_new(status, objects, f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(positions_start); - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_string_lengths_t_delete_simple(delimits); return status; } @@ -266,16 +266,16 @@ extern "C" { } if (buffer->string[range->start] == f_fss_delimit_slash) { - f_string_length slash_first = range->start; - f_string_length slash_last = range->start; - f_string_length slash_count = 1; + f_string_length_t slash_first = range->start; + f_string_length_t slash_last = range->start; + f_string_length_t slash_count = 1; position_previous = range->start; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -290,9 +290,9 @@ extern "C" { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -317,7 +317,7 @@ extern "C" { line_start = range->start; } else if (buffer->string[range->start] == f_fss_extended_list_open || buffer->string[range->start] == f_fss_extended_list_close) { - f_string_length before_list_open = position_previous; + f_string_length_t before_list_open = position_previous; bool is_open = F_false; if (buffer->string[range->start] == f_fss_extended_list_open) { @@ -339,9 +339,9 @@ extern "C" { } if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -349,9 +349,9 @@ extern "C" { position_previous = range->start; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -379,14 +379,14 @@ extern "C" { range->start = slash_first; if (delimits.used + (slash_count / 2) >= delimits.size) { - f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); + f_macro_string_lengths_t_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); if (F_status_is_error(status)) { range->start = last_newline; - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -413,14 +413,14 @@ extern "C" { depth++; if (depth > positions_start.size) { - f_macro_string_lengths_resize(status, positions_start, positions_start.size + f_fss_default_allocation_step); + f_macro_string_lengths_t_resize(status, positions_start, positions_start.size + f_fss_default_allocation_step); if (F_status_is_error(status)) { range->start = last_newline; - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -438,14 +438,14 @@ extern "C" { } else { if (delimits.used + 1 >= delimits.size) { - f_macro_string_lengths_resize(status, delimits, delimits.size + f_fss_default_allocation_step); + f_macro_string_lengths_t_resize(status, delimits, delimits.size + f_fss_default_allocation_step); if (F_status_is_error(status)) { range->start = last_newline; - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -460,14 +460,14 @@ extern "C" { } } else if (buffer->string[range->start] == f_fss_extended_list_open) { - f_string_length before_list_open = position_previous; + f_string_length_t before_list_open = position_previous; position_previous = range->start; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -483,9 +483,9 @@ extern "C" { } if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -493,9 +493,9 @@ extern "C" { position_previous = range->start; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -512,22 +512,22 @@ extern "C" { depth++; if (depth >= positions_start.size) { - f_macro_string_lengths_resize(status, positions_start, positions_start.size + f_fss_default_allocation_step); + f_macro_string_lengths_t_resize(status, positions_start, positions_start.size + f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } - f_macro_fss_objects_resize(status, objects, objects.size + f_fss_default_allocation_step); + f_macro_fss_objects_t_resize(status, objects, objects.size + f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -557,9 +557,9 @@ extern "C" { position_previous = range->start; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -578,9 +578,9 @@ extern "C" { position_previous = range->start; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -594,9 +594,9 @@ extern "C" { } if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -611,38 +611,38 @@ extern "C" { if (buffer->string[range->start] == f_string_eol[0]) { if (depth + 1 >= found->size) { - f_macro_fss_nest_resize(status, (*found), found->size + f_fss_default_allocation_step); + f_macro_fss_nest_t_resize(status, (*found), found->size + f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } } if (found->depth[depth].used == found->depth[depth].size) { - f_macro_fss_items_resize(status, found->depth[depth], found->depth[depth].size + f_fss_default_allocation_step); + f_macro_fss_items_t_resize(status, found->depth[depth], found->depth[depth].size + f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } } - f_array_length position = found->depth[depth].used; + f_array_length_t position = found->depth[depth].used; if (found->depth[depth].array[position].content.size != 1) { - f_macro_fss_content_resize(status, found->depth[depth].array[position].content, 1); + f_macro_fss_content_t_resize(status, found->depth[depth].array[position].content, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -672,9 +672,9 @@ extern "C" { if (depth == 0) { status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -682,9 +682,9 @@ extern "C" { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); fl_macro_fss_nest_delimited_return_on_overflow((*buffer), (*range), (*found), delimits, positions_start, objects, F_none_eos, F_none_stop) - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return FL_fss_found_content; } @@ -703,9 +703,9 @@ extern "C" { position_previous = range->start; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -723,9 +723,9 @@ extern "C" { position_previous = range->start; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } @@ -740,17 +740,17 @@ extern "C" { position_previous = range->start; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) { - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); return status; } } // while - f_macro_string_lengths_delete_simple(delimits); - f_macro_string_lengths_delete_simple(positions_start); - f_macro_fss_objects_delete_simple(objects); + f_macro_string_lengths_t_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(positions_start); + f_macro_fss_objects_t_delete_simple(objects); if (range->start > range->stop) { if (depth == 0) return F_status_set_error(F_unterminated_stop); @@ -765,17 +765,17 @@ extern "C" { #endif // _di_fl_fss_extended_list_content_read_ #ifndef _di_fl_fss_extended_list_object_write_ - f_return_status fl_fss_extended_list_object_write(const f_string_static object, f_string_range *range, f_string_dynamic *destination) { + f_return_status fl_fss_extended_list_object_write(const f_string_static_t object, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; - f_string_range buffer_position = f_string_range_initialize; - f_string_length start_position = f_string_initialize; - f_string_length size_allocate = 0; - f_string_length start_buffer = 0; + f_string_range_t buffer_position = f_string_range_initialize; + f_string_length_t start_position = f_string_t_initialize; + f_string_length_t size_allocate = 0; + f_string_length_t start_buffer = 0; fl_macro_fss_skip_past_delimit_placeholders(object, (*range)) @@ -788,7 +788,7 @@ extern "C" { size_allocate = destination->used + (range->stop - range->start) + 2 + f_fss_default_allocation_step_string; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate); if (F_status_is_error(status)) return status; } @@ -819,7 +819,7 @@ extern "C" { while (range->start <= range->stop && range->start < object.used) { if (object.string[range->start] == f_fss_delimit_slash) { - f_string_length slash_count = 1; + f_string_length_t slash_count = 1; destination->string[buffer_position.stop] = object.string[range->start]; buffer_position.stop++; @@ -850,7 +850,7 @@ extern "C" { size_allocate += slash_count; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } @@ -890,20 +890,20 @@ extern "C" { #endif // _di_fl_fss_extended_list_object_write_ #ifndef _di_fl_fss_extended_list_content_write_ - f_return_status fl_fss_extended_list_content_write(const f_string_static content, f_string_range *range, f_string_dynamic *destination) { + f_return_status fl_fss_extended_list_content_write(const f_string_static_t content, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ // @todo /* - f_status status = F_none; + f_status_t status = F_none; bool is_comment = F_false; bool has_graph = F_false; - f_string_range buffer_position = f_string_range_initialize; - f_string_length start_position = f_string_initialize; - f_string_length size_allocate = 0; + f_string_range_t buffer_position = f_string_range_initialize; + f_string_length_t start_position = f_string_t_initialize; + f_string_length_t size_allocate = 0; fl_macro_fss_skip_past_delimit_placeholders(content, (*range)) @@ -916,7 +916,7 @@ extern "C" { size_allocate = destination->used + (range->stop - range->start) + 2 + f_fss_default_allocation_step_string; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate); if (F_status_is_error(status)) return status; } @@ -925,7 +925,7 @@ extern "C" { while (range->start <= range->stop && range->start < content.used) { if (content.string[range->start] == f_fss_delimit_slash && !is_comment) { - f_string_length slash_count = 1; + f_string_length_t slash_count = 1; destination->string[buffer_position.stop] = content.string[range->start]; buffer_position.stop++; @@ -955,7 +955,7 @@ extern "C" { } // while if (content.string[range->start] == f_fss_extended_list_open) { - f_string_length start = range->start; + f_string_length_t start = range->start; status = f_utf_buffer_increment(content, range, 1); if (F_status_is_error(status)) return status; @@ -975,7 +975,7 @@ extern "C" { size_allocate += slash_count + 1; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } @@ -998,7 +998,7 @@ extern "C" { } } else if (content.string[range->start] == f_fss_extended_list_open && !is_comment) { - f_string_length start = range->start; + f_string_length_t start = range->start; has_graph = F_true; @@ -1020,7 +1020,7 @@ extern "C" { size_allocate++; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } diff --git a/level_1/fl_fss/c/fss_extended_list.h b/level_1/fl_fss/c/fss_extended_list.h index 6e05b82..f3611e2 100644 --- a/level_1/fl_fss/c/fss_extended_list.h +++ b/level_1/fl_fss/c/fss_extended_list.h @@ -72,7 +72,7 @@ extern "C" { * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_list_object_read_ - extern f_return_status fl_fss_extended_list_object_read(f_string_dynamic *buffer, f_string_range *range, f_fss_object *found); + extern f_return_status fl_fss_extended_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found); #endif // _di_fl_fss_extended_list_object_read_ /** @@ -119,7 +119,7 @@ extern "C" { * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_list_content_read_ - extern f_return_status fl_fss_extended_list_content_read(f_string_dynamic *buffer, f_string_range *range, f_fss_nest *found); + extern f_return_status fl_fss_extended_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_nest_t *found); #endif // _di_fl_fss_extended_list_content_read_ /** @@ -150,7 +150,7 @@ extern "C" { * Errors from (with error bit): f_utf_buffer_increment(). */ #ifndef _di_fl_fss_extended_list_object_write_ - extern f_return_status fl_fss_extended_list_object_write(const f_string_static object, f_string_range *range, f_string_dynamic *destination); + extern f_return_status fl_fss_extended_list_object_write(const f_string_static_t object, f_string_range_t *range, f_string_dynamic_t *destination); #endif // _di_fl_fss_extended_list_object_write_ /** @@ -180,7 +180,7 @@ extern "C" { * Errors from (with error bit): f_utf_buffer_increment(). */ #ifndef _di_fl_fss_extended_list_content_write_ - extern f_return_status fl_fss_extended_list_content_write(const f_string_static content, f_string_range *range, f_string_dynamic *destination); + extern f_return_status fl_fss_extended_list_content_write(const f_string_static_t content, f_string_range_t *range, f_string_dynamic_t *destination); #endif // _di_fl_fss_extended_list_content_write_ #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss_macro.h b/level_1/fl_fss/c/fss_macro.h index 24b7da6..96bf9b7 100644 --- a/level_1/fl_fss/c/fss_macro.h +++ b/level_1/fl_fss/c/fss_macro.h @@ -17,11 +17,11 @@ extern "C" { // TODO: check if character to be replaced is UTF and apply placeholder to entire width. #ifndef _di_fl_macro_fss_apply_delimit_placeholders_ #define fl_macro_fss_apply_delimit_placeholders(buffer, delimits) \ - for (f_array_length i = 0; i < delimits.used; i++) { \ + for (f_array_length_t i = 0; i < delimits.used; i++) { \ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \ } \ \ - f_macro_string_lengths_delete_simple(delimits); + f_macro_string_lengths_t_delete_simple(delimits); #endif // _di_fl_macro_fss_apply_delimit_placeholders_ #ifndef _di_fl_macro_fss_skip_past_delimit_placeholders_ @@ -37,13 +37,13 @@ extern "C" { #ifndef _di_fl_macro_fss_object_return_on_overflow_ #define fl_macro_fss_object_return_on_overflow(buffer, range, found, delimits, eos_status, stop_status) \ if (range.start >= buffer.used) { \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.stop = buffer.used - 1; \ return eos_status; \ } \ else if (range.start > range.stop) { \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.stop = range.stop; \ return stop_status; \ @@ -53,20 +53,20 @@ extern "C" { #ifndef _di_fl_macro_fss_object_delimited_return_on_overflow_ #define fl_macro_fss_object_delimited_return_on_overflow(buffer, range, found, delimits, eos_status, stop_status) \ if (range.start >= buffer.used) { \ - for (f_array_length i = 0; i < delimits.used; i++) { \ + for (f_array_length_t i = 0; i < delimits.used; i++) { \ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \ } \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.stop = buffer.used - 1; \ return eos_status; \ } \ else if (range.start > range.stop) { \ - for (f_array_length i = 0; i < delimits.used; i++) { \ + for (f_array_length_t i = 0; i < delimits.used; i++) { \ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \ i++; \ } \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.stop = range.stop; \ return stop_status; \ @@ -76,13 +76,13 @@ extern "C" { #ifndef _di_fl_macro_fss_content_return_on_overflow_ #define fl_macro_fss_content_return_on_overflow(buffer, range, found, delimits, eos_status, stop_status) \ if (range.start >= buffer.used) { \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.array[found.used].stop = buffer.used - 1; \ return eos_status; \ } \ else if (range.start > range.stop) { \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.array[found.used].stop = range.stop; \ return stop_status; \ @@ -92,19 +92,19 @@ extern "C" { #ifndef _di_fl_macro_fss_content_delimited_return_on_overflow_ #define fl_macro_fss_content_delimited_return_on_overflow(buffer, range, found, delimits, eos_status, stop_status) \ if (range.start >= buffer.used) { \ - for (f_array_length i = 0; i < delimits.used; i++) { \ + for (f_array_length_t i = 0; i < delimits.used; i++) { \ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \ } \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.array[found.used].stop = buffer.used - 1; \ return eos_status; \ } \ else if (range.start > range.stop) { \ - for (f_array_length i = 0; i < delimits.used; i++) { \ + for (f_array_length_t i = 0; i < delimits.used; i++) { \ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \ } \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.array[found.used].stop = range.stop; \ return stop_status; \ @@ -114,11 +114,11 @@ extern "C" { #ifndef _di_fl_macro_fss_allocate_content_if_necessary_ #define fl_macro_fss_allocate_content_if_necessary(content, delimits) \ if (content.used == content.size) { \ - f_status status = F_none; \ + f_status_t status = F_none; \ \ - f_macro_fss_content_resize(status, content, content.size + f_fss_default_allocation_step); \ + f_macro_fss_content_t_resize(status, content, content.size + f_fss_default_allocation_step); \ if (F_status_is_error(status)) { \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ return status; \ } \ @@ -128,16 +128,16 @@ extern "C" { #ifndef _di_fl_macro_fss_nest_return_on_overflow_ #define fl_macro_fss_nest_return_on_overflow(buffer, range, found, delimits, positions, objects, eos_status, stop_status) \ if (range.start >= buffer.used) { \ - f_macro_string_lengths_delete_simple(delimits); \ - f_macro_string_lengths_delete_simple(positions); \ - f_macro_fss_objects_delete_simple(objects); \ + f_macro_string_lengths_t_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(positions); \ + f_macro_fss_objects_t_delete_simple(objects); \ \ return eos_status; \ } \ else if (range.start > range.stop) { \ - f_macro_string_lengths_delete_simple(delimits); \ - f_macro_string_lengths_delete_simple(positions); \ - f_macro_fss_objects_delete_simple(objects); \ + f_macro_string_lengths_t_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(positions); \ + f_macro_fss_objects_t_delete_simple(objects); \ \ return stop_status; \ } @@ -146,22 +146,22 @@ extern "C" { #ifndef _di_fl_macro_fss_nest_delimited_return_on_overflow_ #define fl_macro_fss_nest_delimited_return_on_overflow(buffer, range, found, delimits, positions, objects, eos_status, stop_status) \ if (range.start >= buffer.used) { \ - for (f_array_length i = 0; i < delimits.used; i++) { \ + for (f_array_length_t i = 0; i < delimits.used; i++) { \ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \ } \ - f_macro_string_lengths_delete_simple(delimits); \ - f_macro_string_lengths_delete_simple(positions); \ - f_macro_fss_objects_delete_simple(objects); \ + f_macro_string_lengths_t_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(positions); \ + f_macro_fss_objects_t_delete_simple(objects); \ \ return eos_status; \ } \ else if (range.start > range.stop) { \ - for (f_array_length i = 0; i < delimits.used; i++) { \ + for (f_array_length_t i = 0; i < delimits.used; i++) { \ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \ } \ - f_macro_string_lengths_delete_simple(delimits); \ - f_macro_string_lengths_delete_simple(positions); \ - f_macro_fss_objects_delete_simple(objects); \ + f_macro_string_lengths_t_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(positions); \ + f_macro_fss_objects_t_delete_simple(objects); \ \ return stop_status; \ } @@ -172,12 +172,12 @@ extern "C" { while (buffer.string[range.start] != f_string_eol[0]) { \ range.start++; \ if (range.start >= buffer.used) { \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ return eos_status; \ } \ if (range.start > range.stop) { \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ return stop_status; \ } \ @@ -189,18 +189,18 @@ extern "C" { while (buffer.string[range.start] != f_string_eol[0]) { \ range.start++; \ if (range.start >= buffer.used) { \ - for (f_array_length i = 0; i < delimits.used; i++) { \ + for (f_array_length_t i = 0; i < delimits.used; i++) { \ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \ } \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ return eos_status; \ } \ if (range.start > range.stop) { \ - for (f_array_length i = 0; i < delimits.used; i++) { \ + for (f_array_length_t i = 0; i < delimits.used; i++) { \ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \ } \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ return stop_status; \ } \ @@ -212,13 +212,13 @@ extern "C" { while (buffer.string[range.start] != f_string_eol[0]) { \ range.start++; \ if (range.start >= buffer.used) { \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.array[found.used].stop = range.stop; \ return eos_status; \ } \ if (range.start > range.stop) { \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.array[found.used].stop = range.stop; \ return stop_status; \ @@ -231,19 +231,19 @@ extern "C" { while (buffer.string[range.start] != f_string_eol[0]) { \ range.start++; \ if (range.start >= buffer.used) { \ - for (f_array_length i = 0; i < delimits.used; i++) { \ + for (f_array_length_t i = 0; i < delimits.used; i++) { \ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \ } \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.array[found.used].stop = range.stop; \ return eos_status; \ } \ if (range.start > range.stop) { \ - for (f_array_length i = 0; i < delimits.used; i++) { \ + for (f_array_length_t i = 0; i < delimits.used; i++) { \ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \ } \ - f_macro_string_lengths_delete_simple(delimits); \ + f_macro_string_lengths_t_delete_simple(delimits); \ \ found.array[found.used].stop = range.stop; \ return stop_status; \ diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c index 4976c61..f6c5cf7 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -6,8 +6,8 @@ extern "C" { #endif #if !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) || !defined(_di_fl_fss_extended_content_read_) - f_return_status private_fl_fss_basic_object_read(f_string_dynamic *buffer, f_string_range *range, f_fss_object *found, f_fss_quoted *quoted, f_string_lengths *delimits) { - f_status status = F_none; + f_return_status private_fl_fss_basic_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quoted_t *quoted, f_string_lengths_t *delimits) { + f_status_t status = F_none; status = f_fss_skip_past_space(*buffer, range); if (F_status_is_error(status)) return status; @@ -43,7 +43,7 @@ extern "C" { } // delimits must only be applied once a valid object is found-> - const f_string_length delimit_initial = delimits->used; + const f_string_length_t delimit_initial = delimits->used; // handle quoted support. int8_t quote = 0; @@ -54,7 +54,7 @@ extern "C" { // identify where the object begins. if (buffer->string[range->start] == f_fss_delimit_slash) { - f_string_length first_slash = range->start; + f_string_length_t first_slash = range->start; found->start = range->start; @@ -115,16 +115,16 @@ extern "C" { // only the first slash before a quoted needs to be escaped (or not) as once there is a slash before a quoted, this cannot ever be a quote object. // this simplifies the number of slashes needed. if (delimits->used == delimits->size) { - if (delimits->size + f_fss_default_allocation_step > f_array_length_size) { - if (delimits->size + 1 > f_array_length_size) { + if (delimits->size + f_fss_default_allocation_step > f_array_length_t_size) { + if (delimits->size + 1 > f_array_length_t_size) { return F_status_set_error(F_buffer_too_large); } - f_macro_string_lengths_resize(status, (*delimits), delimits->size + 1); + f_macro_string_lengths_t_resize(status, (*delimits), delimits->size + 1); if (F_status_is_error(status)) return status; } else { - f_macro_string_lengths_resize(status, (*delimits), delimits->size + f_fss_default_allocation_step); + f_macro_string_lengths_t_resize(status, (*delimits), delimits->size + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; } } @@ -175,8 +175,8 @@ extern "C" { while (range->start <= range->stop && range->start < buffer->used) { if (buffer->string[range->start] == f_fss_delimit_slash) { - f_string_length first_slash = range->start; - f_string_length slash_count = 1; + f_string_length_t first_slash = range->start; + f_string_length_t slash_count = 1; status = f_utf_buffer_increment(*buffer, range, 1); if (F_status_is_error(status)) return status; @@ -211,7 +211,7 @@ extern "C" { } if (buffer->string[range->start] == quote) { - f_string_length location = range->start; + f_string_length_t location = range->start; // check to see if there is a whitespace, EOS, or EOL after the quoted, if not, then this is not a closing quoted and delimits do not apply. if (range->start + 1 <= range->stop && range->start + 1 < buffer->used) { @@ -249,11 +249,11 @@ extern "C" { if (slash_count % 2 == 0) { if (delimits->used + (slash_count / 2) >= delimits->size) { - if (delimits->used + (slash_count / 2) >= f_array_length_size) { + if (delimits->used + (slash_count / 2) >= f_array_length_t_size) { return F_status_set_error(F_buffer_too_large); } - f_macro_string_lengths_resize(status, (*delimits), delimits->size + (slash_count / 2)); + f_macro_string_lengths_t_resize(status, (*delimits), delimits->size + (slash_count / 2)); if (F_status_is_error(status)) return status; } @@ -319,11 +319,11 @@ extern "C" { } else { if (delimits->used + (slash_count / 2) >= delimits->size) { - if (delimits->used + (slash_count / 2) >= f_array_length_size) { + if (delimits->used + (slash_count / 2) >= f_array_length_t_size) { return F_status_set_error(F_buffer_too_large); } - f_macro_string_lengths_resize(status, (*delimits), delimits->size + (slash_count / 2) + 1); + f_macro_string_lengths_t_resize(status, (*delimits), delimits->size + (slash_count / 2) + 1); if (F_status_is_error(status)) return status; } @@ -352,7 +352,7 @@ extern "C" { else if (buffer->string[range->start] == quote) { // check to see if there is a whitespace, EOS, or EOL after the quoted, if not, then this is not a closing quoted. { - f_string_length location = range->start; + f_string_length_t location = range->start; if (range->start + 1 <= range->stop && range->start + 1 < buffer->used) { range->start++; @@ -488,8 +488,8 @@ extern "C" { #endif // !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) #if !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_extended_object_write_) - f_return_status private_fl_fss_basic_object_write(const f_string_static object, const f_fss_quoted quoted, f_string_range *range, f_string_dynamic *destination) { - f_status status = F_none; + f_return_status private_fl_fss_basic_object_write(const f_string_static_t object, const f_fss_quoted_t quoted, f_string_range_t *range, f_string_dynamic_t *destination) { + f_status_t status = F_none; fl_macro_fss_skip_past_delimit_placeholders(object, (*range)); @@ -497,16 +497,16 @@ extern "C" { else if (range->start >= object.used) return F_data_not_eos; // ensure that there is room for the start and stop quotes or a slash delimit and the object open character. - f_string_length size_allocate = destination->used + (range->stop - range->start) + 3 + f_fss_default_allocation_step_string; + f_string_length_t size_allocate = destination->used + (range->stop - range->start) + 3 + f_fss_default_allocation_step_string; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate); if (F_status_is_error(status)) return status; } - const f_string_length position_start = range->start; + const f_string_length_t position_start = range->start; - f_string_range destination_position = f_string_range_initialize; + f_string_range_t destination_position = f_string_range_initialize; destination_position.start = destination->used; destination_position.stop = destination->used; @@ -550,7 +550,7 @@ extern "C" { size_allocate++; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } @@ -567,7 +567,7 @@ extern "C" { size_allocate++; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } @@ -602,8 +602,8 @@ extern "C" { if (quote) { if (object.string[range->start] == f_fss_delimit_slash) { - f_string_range next = *range; - f_string_length slashes = 1; + f_string_range_t next = *range; + f_string_length_t slashes = 1; bool must_delimit = F_false; @@ -650,7 +650,7 @@ extern "C" { } if (must_delimit) { - for (f_string_length i = 0; i < slashes; i++) { + for (f_string_length_t i = 0; i < slashes; i++) { destination->string[destination_position.stop] = f_fss_delimit_slash; destination_position.stop++; } // for @@ -659,7 +659,7 @@ extern "C" { size_allocate++; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } @@ -669,7 +669,7 @@ extern "C" { } } else if (object.string[range->start] == destination->string[destination_position.start]) { - f_string_range next = *range; + f_string_range_t next = *range; bool must_delimit = F_false; status = f_utf_buffer_increment(object, &next, 1); @@ -695,7 +695,7 @@ extern "C" { size_allocate++; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } @@ -711,7 +711,7 @@ extern "C" { size_allocate++; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } @@ -749,7 +749,7 @@ extern "C" { size_allocate++; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } @@ -761,7 +761,7 @@ extern "C" { size_allocate++; if (size_allocate > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, (*destination), size_allocate + f_fss_default_allocation_step_string); if (F_status_is_error(status)) return status; } diff --git a/level_1/fl_fss/c/private-fss.h b/level_1/fl_fss/c/private-fss.h index 0f2385c..1e22af8 100644 --- a/level_1/fl_fss/c/private-fss.h +++ b/level_1/fl_fss/c/private-fss.h @@ -63,7 +63,7 @@ extern "C" { * @see fl_fss_extended_object_read() */ #if !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) || !defined(_di_fl_fss_extended_content_read_) - extern f_return_status private_fl_fss_basic_object_read(f_string_dynamic *buffer, f_string_range *range, f_fss_object *found, f_fss_quoted *quoted, f_string_lengths *delimits) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_fss_basic_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quoted_t *quoted, f_string_lengths_t *delimits) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) || !defined(_di_fl_fss_extended_content_read_) /** @@ -98,7 +98,7 @@ extern "C" { * @see fl_fss_extended_object_write() */ #if !defined(fl_fss_basic_object_write) || !defined(fl_fss_extended_object_write) - extern f_return_status private_fl_fss_basic_object_write(const f_string_static object, const f_fss_quoted quoted, f_string_range *range, f_string_dynamic *destination) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_fss_basic_object_write(const f_string_static_t object, const f_fss_quoted_t quoted, f_string_range_t *range, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; #endif // !defined(fl_fss_basic_object_write) || !defined(fl_fss_extended_object_write) #ifdef __cplusplus diff --git a/level_1/fl_iki/c/iki.c b/level_1/fl_iki/c/iki.c index e9916d2..bbc9a3f 100644 --- a/level_1/fl_iki/c/iki.c +++ b/level_1/fl_iki/c/iki.c @@ -5,8 +5,8 @@ extern "C" { #endif #ifndef _di_fl_iki_read_ - f_return_status fl_iki_read(f_string_static *buffer, f_string_range *range, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content) { - f_status status = F_none; + f_return_status fl_iki_read(f_string_static_t *buffer, f_string_range_t *range, f_iki_variable_t *variable, f_iki_vocabulary_t *vocabulary, f_iki_content_t *content) { + f_status_t status = F_none; do { status = f_iki_read(buffer, range, variable, vocabulary, content); diff --git a/level_1/fl_iki/c/iki.h b/level_1/fl_iki/c/iki.h index 470b93c..4e89c88 100644 --- a/level_1/fl_iki/c/iki.h +++ b/level_1/fl_iki/c/iki.h @@ -60,7 +60,7 @@ extern "C" { * F_string_too_large (with error bit) if a string length is too large to store in the buffer. */ #ifndef _di_fl_iki_read_ - extern f_return_status fl_iki_read(f_string_static *buffer, f_string_range *range, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content); + extern f_return_status fl_iki_read(f_string_static_t *buffer, f_string_range_t *range, f_iki_variable_t *variable, f_iki_vocabulary_t *vocabulary, f_iki_content_t *content); #endif // _di_fl_iki_read_ #ifdef __cplusplus diff --git a/level_1/fl_print/c/print.c b/level_1/fl_print/c/print.c index 0f7d950..b7d4d7c 100644 --- a/level_1/fl_print/c/print.c +++ b/level_1/fl_print/c/print.c @@ -5,14 +5,14 @@ extern "C" { #endif #ifndef _di_fl_print_trim_string_ - f_return_status fl_print_trim_string(FILE *output, const f_string string, const f_string_length length) { + f_return_status fl_print_trim_string(FILE *output, const f_string_t string, const f_string_length_t length) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (length < 1) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - register f_string_length i = 0; - f_status status = F_none; + register f_string_length_t i = 0; + f_status_t status = F_none; uint8_t width_max = 0; for (; i < length; i += f_macro_utf_byte_width(string[i])) { @@ -41,7 +41,7 @@ extern "C" { } if (status == F_true) { - f_string_length j = i + f_macro_utf_byte_width(string[i]); + f_string_length_t j = i + f_macro_utf_byte_width(string[i]); if (j == length) return F_none; @@ -78,13 +78,13 @@ extern "C" { #endif // _di_fl_print_trim_string_ #ifndef _di_fl_print_trim_string_dynamic_ - f_return_status fl_print_trim_string_dynamic(FILE *output, const f_string_static buffer) { + f_return_status fl_print_trim_string_dynamic(FILE *output, const f_string_static_t buffer) { #ifndef _di_level_1_parameter_checking_ if (buffer.used == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - register f_string_length i = 0; - f_status status = F_none; + register f_string_length_t i = 0; + f_status_t status = F_none; uint8_t width_max = 0; for (; i < buffer.used; i += f_macro_utf_byte_width(buffer.string[i])) { @@ -113,7 +113,7 @@ extern "C" { } if (status == F_true) { - f_string_length j = i + f_macro_utf_byte_width(buffer.string[i]); + f_string_length_t j = i + f_macro_utf_byte_width(buffer.string[i]); if (j == buffer.used) return F_none; @@ -152,7 +152,7 @@ extern "C" { #endif // _di_fl_print_trim_string_dynamic_ #ifndef _di_fl_print_trim_string_dynamic_partial_ - f_return_status fl_print_trim_string_dynamic_partial(FILE *output, const f_string_static buffer, const f_string_range range) { + f_return_status fl_print_trim_string_dynamic_partial(FILE *output, const f_string_static_t buffer, const f_string_range_t range) { #ifndef _di_level_1_parameter_checking_ if (range.start < 0) return F_status_set_error(F_parameter); if (range.stop < range.start) return F_status_set_error(F_parameter); @@ -161,8 +161,8 @@ extern "C" { if (range.stop >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - register f_string_length i = range.start; - f_status status = F_none; + register f_string_length_t i = range.start; + f_status_t status = F_none; uint8_t width_max = 0; @@ -198,7 +198,7 @@ extern "C" { } if (status == F_true) { - f_string_length j = i + width_i; + f_string_length_t j = i + width_i; if (j == range.stop) return F_none; @@ -247,14 +247,14 @@ extern "C" { #endif // _di_fl_print_trim_string_dynamic_partial_ #ifndef _di_fl_print_trim_utf_string_ - f_return_status fl_print_trim_utf_string(FILE *output, const f_utf_string string, const f_utf_string_length length) { + f_return_status fl_print_trim_utf_string(FILE *output, const f_utf_string_t string, const f_utf_string_length_t length) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); if (length < 1) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - register f_string_length i = 0; - f_status status = F_none; + register f_string_length_t i = 0; + f_status_t status = F_none; for (; i < length; i++) { status = f_utf_character_is_whitespace(string[i]); @@ -280,7 +280,7 @@ extern "C" { } if (status == F_true) { - f_string_length j = i + 1; + f_string_length_t j = i + 1; if (j == length) return F_none; @@ -316,13 +316,13 @@ extern "C" { #endif // _di_fl_print_trim_utf_string_ #ifndef _di_fl_print_trim_utf_string_dynamic_ - f_return_status fl_print_trim_utf_string_dynamic(FILE *output, const f_utf_string_static buffer) { + f_return_status fl_print_trim_utf_string_dynamic(FILE *output, const f_utf_string_static_t buffer) { #ifndef _di_level_1_parameter_checking_ if (buffer.used == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - register f_utf_string_length i = 0; - f_status status = F_none; + register f_utf_string_length_t i = 0; + f_status_t status = F_none; for (; i < buffer.used; i++) { status = f_utf_character_is_whitespace(buffer.string[i]); @@ -348,7 +348,7 @@ extern "C" { } if (status == F_true) { - f_string_length j = i + 1; + f_string_length_t j = i + 1; if (j == buffer.used) return F_none; @@ -386,7 +386,7 @@ extern "C" { #endif // _di_fl_print_trim_utf_string_dynamic_ #ifndef _di_fl_print_trim_utf_string_dynamic_partial_ - f_return_status fl_print_trim_utf_string_dynamic_partial(FILE *output, const f_utf_string_static buffer, const f_utf_string_range range) { + f_return_status fl_print_trim_utf_string_dynamic_partial(FILE *output, const f_utf_string_static_t buffer, const f_utf_string_range_t range) { #ifndef _di_level_1_parameter_checking_ if (range.start < 0) return F_status_set_error(F_parameter); if (range.stop < range.start) return F_status_set_error(F_parameter); @@ -395,8 +395,8 @@ extern "C" { if (range.stop >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - register f_string_length i = range.start; - f_status status = F_none; + register f_string_length_t i = range.start; + f_status_t status = F_none; for (; i <= range.stop; i++) { status = f_utf_character_is_whitespace(buffer.string[i]); @@ -422,7 +422,7 @@ extern "C" { } if (status == F_true) { - f_string_length j = i + 1; + f_string_length_t j = i + 1; if (j == range.stop) return F_none; diff --git a/level_1/fl_print/c/print.h b/level_1/fl_print/c/print.h index c3981b8..3940711 100644 --- a/level_1/fl_print/c/print.h +++ b/level_1/fl_print/c/print.h @@ -49,7 +49,7 @@ extern "C" { * Errors from (with error bit): f_utf_is_whitespace(). */ #ifndef _di_fl_print_trim_string_ - extern f_return_status fl_print_trim_string(FILE *output, const f_string string, const f_string_length length); + extern f_return_status fl_print_trim_string(FILE *output, const f_string_t string, const f_string_length_t length); #endif // _di_fl_print_trim_string_ /** @@ -76,7 +76,7 @@ extern "C" { * Errors from (with error bit): f_utf_is_whitespace(). */ #ifndef _di_fl_print_trim_string_dynamic_ - extern f_return_status fl_print_trim_string_dynamic(FILE *output, const f_string_static buffer); + extern f_return_status fl_print_trim_string_dynamic(FILE *output, const f_string_static_t buffer); #endif // _di_fl_print_trim_string_dynamic_ /** @@ -105,7 +105,7 @@ extern "C" { * Errors from (with error bit): f_utf_is_whitespace(). */ #ifndef _di_fl_print_trim_string_dynamic_partial_ - extern f_return_status fl_print_trim_string_dynamic_partial(FILE *output, const f_string_static buffer, const f_string_range range); + extern f_return_status fl_print_trim_string_dynamic_partial(FILE *output, const f_string_static_t buffer, const f_string_range_t range); #endif // _di_fl_print_trim_string_dynamic_partial_ /** @@ -133,7 +133,7 @@ extern "C" { * Errors from (with error bit): f_utf_character_is_whitespace(). */ #ifndef _di_fl_print_trim_utf_string_ - extern f_return_status fl_print_trim_utf_string(FILE *output, const f_utf_string string, const f_utf_string_length length); + extern f_return_status fl_print_trim_utf_string(FILE *output, const f_utf_string_t string, const f_utf_string_length_t length); #endif // _di_fl_print_trim_utf_string_ /** @@ -160,7 +160,7 @@ extern "C" { * Errors from (with error bit): f_utf_character_is_whitespace(). */ #ifndef _di_fl_print_trim_utf_string_dynamic_ - extern f_return_status fl_print_trim_utf_string_dynamic(FILE *output, const f_utf_string_static buffer); + extern f_return_status fl_print_trim_utf_string_dynamic(FILE *output, const f_utf_string_static_t buffer); #endif // _di_fl_print_trim_utf_string_dynamic_ /** @@ -189,7 +189,7 @@ extern "C" { * Errors from (with error bit): f_utf_character_is_whitespace(). */ #ifndef _di_fl_print_trim_utf_string_dynamic_partial_ - extern f_return_status fl_print_trim_utf_string_dynamic_partial(FILE *output, const f_utf_string_static buffer, const f_utf_string_range range); + extern f_return_status fl_print_trim_utf_string_dynamic_partial(FILE *output, const f_utf_string_static_t buffer, const f_utf_string_range_t range); #endif // _di_fl_print_trim_utf_string_dynamic_partial_ #ifdef __cplusplus diff --git a/level_1/fl_status/c/status.c b/level_1/fl_status/c/status.c index 10708f7..c3bba9a 100644 --- a/level_1/fl_status/c/status.c +++ b/level_1/fl_status/c/status.c @@ -5,12 +5,12 @@ extern "C" { #endif #ifndef _di_fl_status_to_string_ - f_return_status fl_status_to_string(const f_status code, f_string *string) { + f_return_status fl_status_to_string(const f_status_t code, f_string_t *string) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status unmasked_code = F_status_set_fine(code); + f_status_t unmasked_code = F_status_set_fine(code); switch (unmasked_code) { #ifndef _di_F_status_boolean_ diff --git a/level_1/fl_status/c/status.h b/level_1/fl_status/c/status.h index 5d055ec..da1356c 100644 --- a/level_1/fl_status/c/status.h +++ b/level_1/fl_status/c/status.h @@ -652,7 +652,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_status_to_string_ - extern f_return_status fl_status_to_string(const f_status code, f_string *string); + extern f_return_status fl_status_to_string(const f_status_t code, f_string_t *string); #endif // _di_fl_status_to_string_ #ifdef __cplusplus diff --git a/level_1/fl_string/c/private-string.c b/level_1/fl_string/c/private-string.c index 91a5146..9779f3a 100644 --- a/level_1/fl_string/c/private-string.c +++ b/level_1/fl_string/c/private-string.c @@ -6,16 +6,16 @@ extern "C" { #endif #if !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_append_mash_) || !defined(_di_fl_string_dynamic_mash_) - f_return_status private_fl_string_append(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status private_fl_string_append(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) { - if (destination->used + length > f_string_length_size) return F_status_set_error(F_string_too_large); + if (destination->used + length > f_string_length_t_size) return F_status_set_error(F_string_too_large); - f_status status = F_none; + f_status_t status = F_none; - const f_string_length total = destination->used + length; + const f_string_length_t total = destination->used + length; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -27,25 +27,25 @@ extern "C" { #endif // !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_append_mash_) || !defined(_di_fl_string_dynamic_mash_) #if !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_) - f_return_status private_fl_string_append_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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_size) return F_status_set_error(F_string_too_large); + if (destination->used + length > f_string_length_t_size) return F_status_set_error(F_string_too_large); - f_status status = F_none; + f_status_t status = F_none; - f_string_length first = 0; + f_string_length_t first = 0; - for (f_string_length i = 0; i <= length; i++) { + for (f_string_length_t i = 0; i <= length; i++) { if (i == length) { if (i > first) { - f_string_length size = i - first; + f_string_length_t size = i - first; - if (destination->used + size > f_string_length_size) return F_status_set_error(F_string_too_large); + if (destination->used + size > f_string_length_t_size) return F_status_set_error(F_string_too_large); - f_string_length total = destination->used + size; + f_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -59,14 +59,14 @@ extern "C" { if (source[i] == 0) { if (i > 0) { if (i > first) { - f_string_length size = i - first; + f_string_length_t size = i - first; - if (destination->used + size > f_string_length_size) return F_status_set_error(F_string_too_large); + if (destination->used + size > f_string_length_t_size) return F_status_set_error(F_string_too_large); - f_string_length total = destination->used + size; + f_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -89,9 +89,9 @@ extern "C" { #endif // !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_) #if !defined(_di_fl_string_compare_) || !defined(_di_fl_string_dynamic_compare_) || !defined(_di_fl_string_dynamic_partial_compare_) - f_return_status private_fl_string_compare(const f_string string1, const f_string string2, const f_string_length offset1, const f_string_length offset2, const f_string_length stop1, const f_string_length stop2) { - f_string_length i1 = offset1; - f_string_length i2 = offset2; + f_return_status 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; + f_string_length_t i2 = offset2; for (; i1 < stop1 && i2 < stop2; i1++, i2++) { // skip past NULL in string1. @@ -119,13 +119,13 @@ extern "C" { #endif // !defined(_di_fl_string_compare_) || !defined(_di_fl_string_dynamic_compare_) || !defined(_di_fl_string_dynamic_partial_compare_) #if !defined(_di_fl_string_compare_trim_) || !defined(_di_fl_string_dynamic_compare_trim_) || !defined(_di_fl_string_dynamic_partial_compare_trim_) - f_return_status private_fl_string_compare_trim(const f_string string1, const f_string string2, const f_string_length offset1, const f_string_length offset2, const f_string_length stop1, const f_string_length stop2) { - f_string_length i1 = offset1; - f_string_length i2 = offset2; + f_return_status private_fl_string_compare_trim(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; + f_string_length_t i2 = offset2; uint8_t width = 0; uint8_t width_max = 0; - f_status status = F_none; + f_status_t status = F_none; // skip past leading whitespace in string1. for (; i1 < stop1; i1 += width) { @@ -165,16 +165,16 @@ extern "C" { width = f_macro_utf_byte_width(string2[i2]); } // for - f_string_length last1 = i1; - f_string_length last2 = i2; + f_string_length_t last1 = i1; + f_string_length_t last2 = i2; { // size1 and size2 are to represent to total number of characters after trim. - f_string_length size1 = 0; - f_string_length size2 = 0; + f_string_length_t size1 = 0; + f_string_length_t size2 = 0; // determine where the last non-whitespace is in string1. - for (f_string_length j = i1; j < stop1; j += width) { + for (f_string_length_t j = i1; j < stop1; j += width) { // skip past NULL in string1. while (j < stop1 && string1[j] == 0) j++; if (j == stop1) break; @@ -196,7 +196,7 @@ extern "C" { } // for // determine where the last non-whitespace is in string2. - for (f_string_length j = i2; j < stop2; j += width) { + for (f_string_length_t j = i2; j < stop2; j += width) { // skip past NULL in string2. while (j < stop2 && string2[j] == 0) j++; if (j == stop2) break; @@ -248,18 +248,18 @@ 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_prepend_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_append_mish_) || !defined(_di_fl_string_dynamic_mish_) - f_return_status private_fl_string_prepend(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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_size) { + if (destination->used + length > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_status status = F_none; + f_status_t status = F_none; - const f_string_length total = destination->used + length; + const f_string_length_t total = destination->used + length; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -277,30 +277,30 @@ extern "C" { #endif // !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_) #if !defined(_di_fl_string_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) - f_return_status private_fl_string_prepend_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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_size) { + if (destination->used + length > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_status status = F_none; + f_status_t status = F_none; - f_string_length first = 0; - f_string_length offset = 0; + f_string_length_t first = 0; + f_string_length_t offset = 0; - for (f_string_length i = 0; i <= length; i++) { + for (f_string_length_t i = 0; i <= length; i++) { if (i == length) { if (i > first) { - const f_string_length size = i - first; + const f_string_length_t size = i - first; - if (destination->used + size > f_string_length_size) { + if (destination->used + size > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - const f_string_length total = destination->used + size; + const f_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -317,16 +317,16 @@ extern "C" { if (source[i] == 0) { if (i > 0) { if (i > first) { - const f_string_length size = i - first; + const f_string_length_t size = i - first; - if (destination->used + size > f_string_length_size) { + if (destination->used + size > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - const f_string_length total = destination->used + size; + const f_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -353,10 +353,10 @@ extern "C" { #endif // !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_append_mish_) || !defined(_di_fl_string_dynamic_mish_) #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_return_status private_fl_string_rip_find_range(const f_string source, f_string_length *start, f_string_length *stop) { - const f_string_length stop_original = *stop; + f_return_status 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; - f_status status = F_none; + f_status_t status = F_none; uint8_t width = 0; diff --git a/level_1/fl_string/c/private-string.h b/level_1/fl_string/c/private-string.h index f95ca72..0739ac3 100644 --- a/level_1/fl_string/c/private-string.h +++ b/level_1/fl_string/c/private-string.h @@ -43,7 +43,7 @@ extern "C" { * @see fl_string_dynamic_mash() */ #if !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_append_mash_) || !defined(_di_fl_string_dynamic_mash_) - extern f_return_status private_fl_string_append(const f_string source, const f_string_length length, f_string_dynamic *destination) f_gcc_attribute_visibility_internal; + extern f_return_status 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_append_mash_) || !defined(_di_fl_string_dynamic_mash_) /** @@ -72,7 +72,7 @@ extern "C" { * @see fl_string_dynamic_mash_nulless() */ #if !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_) - extern f_return_status private_fl_string_append_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) f_gcc_attribute_visibility_internal; + extern f_return_status 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_mash_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_) /** @@ -103,7 +103,7 @@ extern "C" { * @see fl_string_dynamic_partial_compare() */ #if !defined(_di_fl_string_compare_) || !defined(_di_fl_string_dynamic_compare_) || !defined(_di_fl_string_dynamic_partial_compare_) - extern f_return_status private_fl_string_compare(const f_string string1, const f_string string2, const f_string_length offset1, const f_string_length offset2, const f_string_length stop1, const f_string_length stop2) f_gcc_attribute_visibility_internal; + extern f_return_status 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_gcc_attribute_visibility_internal; #endif // !defined(_di_fl_string_compare_) || !defined(_di_fl_string_dynamic_compare_) || !defined(_di_fl_string_dynamic_partial_compare_) /** @@ -134,7 +134,7 @@ extern "C" { * @see fl_string_dynamic_partial_compare_trim() */ #if !defined(_di_fl_string_compare_trim_) || !defined(_di_fl_string_dynamic_compare_trim_) || !defined(_di_fl_string_dynamic_partial_compare_trim_) - extern f_return_status private_fl_string_compare_trim(const f_string string1, const f_string string2, const f_string_length offset1, const f_string_length offset2, const f_string_length stop1, const f_string_length stop2) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_string_compare_trim(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_gcc_attribute_visibility_internal; #endif // !defined(_di_fl_string_compare_trim_) || !defined(_di_fl_string_dynamic_compare_trim_) || !defined(_di_fl_string_dynamic_partial_compare_trim_) /** @@ -160,7 +160,7 @@ extern "C" { * @see fl_string_dynamic_prepend() */ #if !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_append_mish_) || !defined(_di_fl_string_dynamic_mish_) - extern f_return_status private_fl_string_prepend(const f_string source, const f_string_length length, f_string_dynamic *destination) f_gcc_attribute_visibility_internal; + extern f_return_status 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_prepend_) || !defined(_di_fl_string_dynamic_prepend_) || !defined(_di_fl_string_append_mish_) || !defined(_di_fl_string_dynamic_mish_) /** @@ -186,7 +186,7 @@ extern "C" { * @see fl_string_dynamic_prepend_nulless() */ #if !defined(_di_fl_string_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) || !defined(_di_fl_string_append_mish_) || !defined(_di_fl_string_dynamic_mish_) - extern f_return_status private_fl_string_prepend_nulless(const f_string source, f_string_length length, f_string_dynamic *destination) f_gcc_attribute_visibility_internal; + extern f_return_status 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_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) || !defined(_di_fl_string_append_mish_) || !defined(_di_fl_string_dynamic_mish_) /** @@ -214,7 +214,7 @@ extern "C" { * @see fl_string_rip() */ #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_) - extern f_return_status private_fl_string_rip_find_range(const f_string source, f_string_length *start, f_string_length *stop) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_string_rip_find_range(const f_string_t source, f_string_length_t *start, f_string_length_t *stop) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fl_string_rip_) || !defined(_di_fl_string_dynamic_rip_) || !defined(_di_fl_string_rip_nulless_) || !defined(_di_fl_string_dynamic_rip_nulless_) #ifdef __cplusplus diff --git a/level_1/fl_string/c/string.c b/level_1/fl_string/c/string.c index 0166e33..db52543 100644 --- a/level_1/fl_string/c/string.c +++ b/level_1/fl_string/c/string.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fl_string_append_ - f_return_status fl_string_append(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -18,7 +18,7 @@ extern "C" { #endif // _di_fl_string_append_ #ifndef _di_fl_string_append_assure_ - f_return_status fl_string_append_assure(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -26,8 +26,8 @@ extern "C" { if (length == 0) return F_data_not_eos; if (destination->used < length) return private_fl_string_append(source, length, destination); - f_string_length i = 1; - f_string_length j = 1; + f_string_length_t i = 1; + f_string_length_t j = 1; while (i <= length && j <= destination->used) { if (source[length - i] == 0) { @@ -53,7 +53,7 @@ extern "C" { #endif // _di_fl_string_append_assure_ #ifndef _di_fl_string_append_assure_nulless_ - f_return_status fl_string_append_assure_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -64,8 +64,8 @@ extern "C" { return private_fl_string_append_nulless(source, length, destination); } - f_string_length i = 1; - f_string_length j = 1; + f_string_length_t i = 1; + f_string_length_t j = 1; while (i <= length && j <= destination->used) { if (source[length - i] == 0) { @@ -91,7 +91,7 @@ extern "C" { #endif // _di_fl_string_append_assure_nulless_ #ifndef _di_fl_string_append_nulless_ - f_return_status fl_string_append_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -103,19 +103,19 @@ extern "C" { #endif // _di_fl_string_append_nulless_ #ifndef _di_fl_string_compare_ - f_return_status fl_string_compare(const f_string string1, const f_string string2, const f_string_length length1, const f_string_length length2) { + f_return_status 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); } #endif // _di_fl_string_compare_ #ifndef _di_fl_string_compare_trim_ - f_return_status fl_string_compare_trim(const f_string string1, const f_string string2, const f_string_length length1, const f_string_length length2) { + f_return_status fl_string_compare_trim(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_trim(string1, string2, 0, 0, length1, length2); } #endif // _di_fl_string_compare_trim_ #ifndef _di_fl_string_dynamic_append_ - f_return_status fl_string_dynamic_append(const f_string_static source, f_string_dynamic *destination) { + f_return_status fl_string_dynamic_append(const f_string_static_t source, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -127,7 +127,7 @@ extern "C" { #endif // _di_fl_string_dynamic_append_ #ifndef _di_fl_string_dynamic_append_assure_ - f_return_status fl_string_dynamic_append_assure(const f_string_static source, f_string_dynamic *destination) { + f_return_status fl_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -138,8 +138,8 @@ extern "C" { return private_fl_string_append(source.string, source.used, destination); } - f_string_length i = 1; - f_string_length j = 1; + 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] == 0) { @@ -165,7 +165,7 @@ extern "C" { #endif // _di_fl_string_dynamic_append_assure_ #ifndef _di_fl_string_dynamic_append_assure_nulless_ - f_return_status fl_string_dynamic_append_assure_nulless(const f_string_static source, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -176,8 +176,8 @@ extern "C" { return private_fl_string_append_nulless(source.string, source.used, destination); } - f_string_length i = 1; - f_string_length j = 1; + 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] == 0) { @@ -203,7 +203,7 @@ extern "C" { #endif // _di_fl_string_dynamic_append_assure_nulless_ #ifndef _di_fl_string_dynamic_append_nulless_ - f_return_status fl_string_dynamic_append_nulless(const f_string_static source, f_string_dynamic *destination) { + f_return_status fl_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -215,31 +215,31 @@ extern "C" { #endif // _di_fl_string_dynamic_append_nulless_ #ifndef _di_fl_string_dynamic_compare_ - f_return_status fl_string_dynamic_compare(const f_string_static string1, const f_string_static string2) { + f_return_status 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); } #endif // _di_fl_string_dynamic_compare_ #ifndef _di_fl_string_dynamic_compare_string_ - f_return_status fl_string_dynamic_compare_string(const f_string string1, const f_string_static string2, const f_string_length length1) { + f_return_status fl_string_dynamic_compare_string(const f_string_t string1, const f_string_static_t string2, const f_string_length_t length1) { return private_fl_string_compare(string1, string2.string, 0, 0, length1, string2.used); } #endif // _di_fl_string_dynamic_compare_string_ #ifndef _di_fl_string_dynamic_compare_trim_ - f_return_status fl_string_dynamic_compare_trim(const f_string_static string1, const f_string_static string2) { + f_return_status fl_string_dynamic_compare_trim(const f_string_static_t string1, const f_string_static_t string2) { return private_fl_string_compare_trim(string1.string, string2.string, 0, 0, string1.used, string2.used); } #endif // _di_fl_string_dynamic_compare_trim_ #ifndef _di_fl_string_dynamic_compare_trim_string_ - f_return_status fl_string_dynamic_compare_trim_string(const f_string string1, const f_string_static string2, const f_string_length length1) { + f_return_status fl_string_dynamic_compare_trim_string(const f_string_t string1, const f_string_static_t string2, const f_string_length_t length1) { return private_fl_string_compare_trim(string1, string2.string, 0, 0, length1, string2.used); } #endif // _di_fl_string_dynamic_compare_trim_string_ #ifndef _di_fl_string_dynamic_mash_ - f_return_status fl_string_dynamic_mash(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -247,7 +247,7 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (glue_length && destination->used) { - const f_status status = private_fl_string_append(glue, glue_length, destination); + const f_status_t status = private_fl_string_append(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -256,7 +256,7 @@ extern "C" { #endif // _di_fl_string_dynamic_mash_ #ifndef _di_fl_string_dynamic_mash_nulless_ - f_return_status fl_string_dynamic_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -264,7 +264,7 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (glue_length && destination->used) { - const f_status status = private_fl_string_append_nulless(glue, glue_length, destination); + const f_status_t status = private_fl_string_append_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -273,7 +273,7 @@ extern "C" { #endif // _di_fl_string_dynamic_mash_nulless_ #ifndef _di_fl_string_dynamic_mish_ - f_return_status fl_string_dynamic_mish(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -281,7 +281,7 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (glue_length && destination->used) { - const f_status status = private_fl_string_prepend(glue, glue_length, destination); + const f_status_t status = private_fl_string_prepend(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -290,7 +290,7 @@ extern "C" { #endif // _di_fl_string_dynamic_mish_ #ifndef _di_fl_string_dynamic_mish_nulless_ - f_return_status fl_string_dynamic_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -298,7 +298,7 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (glue_length && destination->used) { - const f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination); + const f_status_t status = private_fl_string_prepend_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -307,7 +307,7 @@ extern "C" { #endif // _di_fl_string_dynamic_mish_nulless_ #ifndef _di_fl_string_dynamic_partial_append_ - f_return_status fl_string_dynamic_partial_append(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -321,7 +321,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_append_ #ifndef _di_fl_string_dynamic_partial_append_assure_ - f_return_status fl_string_dynamic_partial_append_assure(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -330,14 +330,14 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (range.start > range.stop) return F_data_not_stop; - const f_string_length length = (range.stop - range.start) + 1; + 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 i = 1; - f_string_length j = 1; + f_string_length_t i = 1; + f_string_length_t j = 1; while (i <= length && j <= destination->used) { if (source.string[range.stop - i] == 0) { @@ -361,7 +361,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_append_assure_ #ifndef _di_fl_string_dynamic_partial_append_assure_nulless_ - f_return_status fl_string_dynamic_partial_append_assure_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -370,14 +370,14 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (range.start > range.stop) return F_data_not_stop; - const f_string_length length = (range.stop - range.start) + 1; + 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 i = 1; - f_string_length j = 1; + f_string_length_t i = 1; + f_string_length_t j = 1; while (i <= length && j <= destination->used) { if (source.string[range.stop - i] == 0) { @@ -401,7 +401,7 @@ extern "C" { #endif // _di_fl_string_dynamic_append_assure_nulless_ #ifndef _di_fl_string_dynamic_partial_append_nulless_ - f_return_status fl_string_dynamic_partial_append_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -415,7 +415,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_append_nulless_ #ifndef _di_fl_string_dynamic_partial_compare_ - f_return_status fl_string_dynamic_partial_compare(const f_string_static string1, const f_string_static string2, const f_string_range range1, const f_string_range range2) { + f_return_status 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_ if (string1.used <= range1.stop) return F_status_set_error(F_parameter); if (string2.used <= range2.stop) return F_status_set_error(F_parameter); @@ -426,7 +426,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_compare_ #ifndef _di_fl_string_dynamic_partial_compare_dynamic_ - f_return_status fl_string_dynamic_partial_compare_dynamic(const f_string_static string1, const f_string_static string2, const f_string_range range2) { + f_return_status fl_string_dynamic_partial_compare_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_ @@ -436,7 +436,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_compare_dynamic_ #ifndef _di_fl_string_dynamic_partial_compare_string_ - f_return_status fl_string_dynamic_partial_compare_string(const f_string string1, const f_string_static string2, const f_string_length length1, const f_string_range range2) { + f_return_status fl_string_dynamic_partial_compare_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_ @@ -446,7 +446,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_compare_string_ #ifndef _di_fl_string_dynamic_partial_compare_trim_ - f_return_status fl_string_dynamic_partial_compare_trim(const f_string_static string1, const f_string_static string2, const f_string_range range1, const f_string_range range2) { + f_return_status 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); @@ -457,7 +457,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_compare_trim_ #ifndef _di_fl_string_dynamic_partial_compare_trim_dynamic_ - f_return_status fl_string_dynamic_partial_compare_trim_dynamic(const f_string_static string1, const f_string_static string2, const f_string_range range2) { + f_return_status 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_ @@ -467,7 +467,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_compare_trim_dynamic_ #ifndef _di_fl_string_dynamic_partial_compare_trim_string_ - f_return_status fl_string_dynamic_partial_compare_trim_string(const f_string string1, const f_string_static string2, const f_string_length length1, const f_string_range range2) { + f_return_status 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_ @@ -477,7 +477,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_compare_trim_string_ #ifndef _di_fl_string_dynamic_partial_mash_ - f_return_status fl_string_dynamic_partial_mash(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -487,7 +487,7 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (glue_length && destination->used) { - f_status status = private_fl_string_append(glue, glue_length, destination); + f_status_t status = private_fl_string_append(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -496,7 +496,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_mash_ #ifndef _di_fl_string_dynamic_partial_mash_nulless_ - f_return_status fl_string_dynamic_partial_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -506,7 +506,7 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (glue_length && destination->used) { - f_status status = private_fl_string_append_nulless(glue, glue_length, destination); + f_status_t status = private_fl_string_append_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -515,7 +515,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_mash_nulless_ #ifndef _di_fl_string_dynamic_partial_mish_ - f_return_status fl_string_partial_dynamic_mish(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -525,7 +525,7 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (glue_length && destination->used) { - f_status status = private_fl_string_prepend(glue, glue_length, destination); + f_status_t status = private_fl_string_prepend(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -534,7 +534,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_mish_ #ifndef _di_fl_string_dynamic_partial_mish_nulless_ - f_return_status fl_string_dynamic_partial_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -544,7 +544,7 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (glue_length && destination->used) { - f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination); + f_status_t status = private_fl_string_prepend_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -553,7 +553,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_mish_nulless_ #ifndef _di_fl_string_dynamic_partial_prepend_ - f_return_status fl_string_dynamic_partial_prepend(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -567,7 +567,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_prepend_ #ifndef _di_fl_string_dynamic_partial_prepend_assure_ - f_return_status fl_string_dynamic_partial_prepend_assure(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -576,14 +576,14 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (range.start > range.stop) return F_data_not_stop; - const f_string_length length = (range.stop - range.start) + 1; + 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 i = 0; - f_string_length j = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; while (i < length && j < destination->used) { if (source.string[i + range.start] == 0) { @@ -609,7 +609,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_prepend_assure_ #ifndef _di_fl_string_dynamic_partial_prepend_assure_nulless_ - f_return_status fl_string_dynamic_partial_prepend_assure_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -618,14 +618,14 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (range.start > range.stop) return F_data_not_stop; - const f_string_length length = (range.stop - range.start) + 1; + 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 i = 0; - f_string_length j = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; while (i < length && j < destination->used) { if (source.string[i + range.start] == 0) { @@ -651,7 +651,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_prepend_assure_nulless #ifndef _di_fl_string_dynamic_partial_prepend_nulless_ - f_return_status fl_string_dynamic_partial_prepend_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); @@ -665,7 +665,7 @@ extern "C" { #endif // _di_fl_string_dynamic_partial_prepend_nulless #ifndef _di_fl_string_dynamic_prepend_ - f_return_status fl_string_dynamic_prepend(const f_string_static source, f_string_dynamic *destination) { + f_return_status fl_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -677,7 +677,7 @@ extern "C" { #endif // _di_fl_string_dynamic_prepend_ #ifndef _di_fl_string_dynamic_prepend_assure_ - f_return_status fl_string_dynamic_prepend_assure(const f_string_static source, f_string_dynamic *destination) { + f_return_status fl_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -688,8 +688,8 @@ extern "C" { return private_fl_string_prepend(source.string, source.used, destination); } - f_string_length i = 0; - f_string_length j = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; while (i < source.used && j < destination->used) { if (source.string[i] == 0) { @@ -715,7 +715,7 @@ extern "C" { #endif // _di_fl_string_dynamic_prepend_assure_ #ifndef _di_fl_string_dynamic_prepend_assure_nulless_ - f_return_status fl_string_dynamic_prepend_assure_nulless(const f_string_static source, f_string_dynamic *destination) { + f_return_status fl_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -726,8 +726,8 @@ extern "C" { return private_fl_string_prepend_nulless(source.string, source.used, destination); } - f_string_length i = 0; - f_string_length j = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; while (i < source.used && j < destination->used) { if (source.string[i] == 0) { @@ -753,7 +753,7 @@ extern "C" { #endif // _di_fl_string_dynamic_prepend_assure_nulless_ #ifndef _di_fl_string_dynamic_prepend_nulless_ - f_return_status fl_string_dynamic_prepend_nulless(const f_string_static source, f_string_dynamic *destination) { + f_return_status fl_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -765,19 +765,19 @@ extern "C" { #endif // _di_fl_string_dynamic_prepend_nulless_ #ifndef _di_fl_string_dynamic_size_decrease_ - f_return_status fl_string_dynamic_size_decrease(const f_string_length length, f_string_dynamic *string) { + f_return_status fl_string_dynamic_size_decrease(const f_string_length_t length, f_string_dynamic_t *string) { #ifndef _di_level_1_parameter_checking_ if (length == 0) return F_status_set_error(F_parameter); if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; if (string->used - length > 0) { - f_macro_string_dynamic_resize(status, (*string), string->size - length); + f_macro_string_dynamic_t_resize(status, (*string), string->size - length); } else if (string->used - length <= 0) { - f_macro_string_dynamic_delete(status, (*string)); + f_macro_string_dynamic_t_delete(status, (*string)); } return status; @@ -785,25 +785,25 @@ extern "C" { #endif // _di_fl_string_dynamic_size_decrease_ #ifndef _di_fl_string_dynamic_size_increase_ - f_return_status fl_string_dynamic_size_increase(const f_string_length length, f_string_dynamic *string) { + f_return_status fl_string_dynamic_size_increase(const f_string_length_t length, f_string_dynamic_t *string) { #ifndef _di_level_1_parameter_checking_ if (length == 0) return F_status_set_error(F_parameter); if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; if (string->used + length > string->size) { - if (string->used + length > f_string_length_size) { - if (string->used == f_string_length_size) { + if (string->used + length > f_string_length_t_size) { + if (string->used == f_string_length_t_size) { status = F_status_set_error(F_string_too_large); } else { - f_macro_string_dynamic_resize(status, (*string), f_string_length_size); + f_macro_string_dynamic_t_resize(status, (*string), f_string_length_t_size); } } else { - f_macro_string_dynamic_resize(status, (*string), string->size + length); + f_macro_string_dynamic_t_resize(status, (*string), string->size + length); } } @@ -812,19 +812,19 @@ extern "C" { #endif // _di_fl_string_dynamic_size_increase_ #ifndef _di_fl_string_dynamics_size_decrease_ - f_return_status fl_string_dynamics_size_decrease(const f_array_length length, f_string_dynamics *strings) { + f_return_status fl_string_dynamics_size_decrease(const f_array_length_t length, f_string_dynamics_t *strings) { #ifndef _di_level_1_parameter_checking_ if (length == 0) return F_status_set_error(F_parameter); if (strings == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; if (strings->used - length > 0) { f_macro_string_dynamics_resize(status, (*strings), strings->size - length); } else if (strings->used - length <= 0) { - f_macro_string_dynamics_delete(status, (*strings)); + f_macro_string_dynamics_t_delete(status, (*strings)); } return status; @@ -832,21 +832,21 @@ extern "C" { #endif // _di_fl_string_dynamics_size_decrease_ #ifndef _di_fl_string_dynamics_size_increase_ - f_return_status fl_string_dynamics_size_increase(const f_array_length length, f_string_dynamics *strings) { + f_return_status fl_string_dynamics_size_increase(const f_array_length_t length, f_string_dynamics_t *strings) { #ifndef _di_level_1_parameter_checking_ if (length == 0) return F_status_set_error(F_parameter); if (strings == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; if (strings->used + length > strings->size) { - if (strings->used + length > f_array_length_size) { - if (strings->used == f_array_length_size) { + if (strings->used + length > f_array_length_t_size) { + if (strings->used == f_array_length_t_size) { status = F_status_set_error(F_string_too_large); } else { - f_macro_string_dynamics_resize(status, (*strings), f_array_length_size); + f_macro_string_dynamics_resize(status, (*strings), f_array_length_t_size); } } else { @@ -859,7 +859,7 @@ extern "C" { #endif // _di_fl_string_dynamics_size_increase_ #ifndef _di_fl_string_dynamic_rip_ - f_return_status fl_string_dynamic_rip(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status fl_string_dynamic_rip(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.start) return F_status_set_error(F_parameter); if (source.used <= range.stop) return F_status_set_error(F_parameter); @@ -874,7 +874,7 @@ extern "C" { #endif // _di_fl_string_dynamic_rip_ #ifndef _di_fl_string_dynamic_rip_nulless_ - f_return_status fl_string_dynamic_rip_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { + f_return_status fl_string_dynamic_rip_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.start) return F_status_set_error(F_parameter); if (source.used <= range.stop) return F_status_set_error(F_parameter); @@ -889,7 +889,7 @@ extern "C" { #endif // _di_fl_string_dynamic_rip_nulless_ #ifndef _di_fl_string_dynamic_seek_line_to_ - f_return_status fl_string_dynamic_seek_line_to(const f_string_static buffer, f_string_range *range, const int8_t seek_to_this) { + f_return_status fl_string_dynamic_seek_line_to(const f_string_static_t buffer, f_string_range_t *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -913,7 +913,7 @@ extern "C" { #endif // _di_fl_string_dynamic_seek_line_to_ #ifndef _di_fl_string_dynamic_seek_line_to_utf_character_ - f_return_status fl_string_dynamic_seek_line_to_utf_character(const f_string_static buffer, f_string_range *range, const f_utf_character seek_to_this) { + f_return_status fl_string_dynamic_seek_line_to_utf_character(const f_string_static_t buffer, f_string_range_t *range, const f_utf_character_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -923,13 +923,13 @@ extern "C" { if (buffer.used == 0) return F_data_not_eos; if (range->start > range->stop) return F_data_not_stop; - const unsigned short seek_width = f_macro_utf_character_width(seek_to_this); + const unsigned short seek_width = f_macro_utf_character_t_width(seek_to_this); - f_status status = F_none; + f_status_t status = F_none; unsigned short width = 0; - f_string_length width_max = 0; + f_string_length_t width_max = 0; while (range->start < buffer.used) { width_max = (range->stop - range->start) + 1; @@ -958,7 +958,7 @@ extern "C" { if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); if (width == seek_width) { - f_utf_character character = 0; + f_utf_character_t character = 0; status = f_utf_char_to_character(buffer.string + range->start, width_max, &character); if (F_status_is_error(status)) return status; @@ -976,7 +976,7 @@ extern "C" { #endif // _di_fl_string_dynamic_seek_line_to_utf_character_ #ifndef _di_fl_string_dynamic_seek_line_until_graph_ - f_return_status fl_string_dynamic_seek_line_until_graph(const f_string_static buffer, f_string_range *range, const int8_t placeholder) { + f_return_status fl_string_dynamic_seek_line_until_graph(const f_string_static_t buffer, f_string_range_t *range, const int8_t placeholder) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -986,10 +986,10 @@ extern "C" { if (buffer.used == 0) return F_data_not_eos; if (range->start > range->stop) return F_data_not_stop; - f_status status = F_none; + f_status_t status = F_none; unsigned short width = 0; - f_string_length width_max = (range->stop - range->start) + 1; + f_string_length_t width_max = (range->stop - range->start) + 1; if (width_max > buffer.used - range->start) { width_max = buffer.used - range->start; @@ -1032,7 +1032,7 @@ extern "C" { #endif // _di_fl_string_dynamic_seek_line_until_graph_ #ifndef _di_fl_string_dynamic_seek_line_until_non_graph_ - f_return_status fl_string_dynamic_seek_line_until_non_graph(const f_string_static buffer, f_string_range *range, const int8_t placeholder) { + f_return_status fl_string_dynamic_seek_line_until_non_graph(const f_string_static_t buffer, f_string_range_t *range, const int8_t placeholder) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -1042,10 +1042,10 @@ extern "C" { if (buffer.used == 0) return F_data_not_eos; if (range->start > range->stop) return F_data_not_stop; - f_status status = F_none; + f_status_t status = F_none; unsigned short width = 0; - f_string_length width_max = (range->stop - range->start) + 1; + f_string_length_t width_max = (range->stop - range->start) + 1; if (width_max > buffer.used - range->start) { width_max = buffer.used - range->start; @@ -1088,7 +1088,7 @@ extern "C" { #endif // _di_fl_string_dynamic_seek_line_until_non_graph_ #ifndef _di_fl_string_dynamic_seek_to_ - f_return_status fl_string_dynamic_seek_to(const f_string_static buffer, f_string_range *range, const int8_t seek_to_this) { + f_return_status fl_string_dynamic_seek_to(const f_string_static_t buffer, f_string_range_t *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -1110,7 +1110,7 @@ extern "C" { #endif // _di_fl_string_dynamic_seek_to_ #ifndef _di_fl_string_dynamic_seek_to_utf_character_ - f_return_status fl_string_dynamic_seek_to_utf_character(const f_string_static buffer, f_string_range *range, const f_utf_character seek_to_this) { + f_return_status fl_string_dynamic_seek_to_utf_character(const f_string_static_t buffer, f_string_range_t *range, const f_utf_character_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -1120,13 +1120,13 @@ extern "C" { if (buffer.used == 0) return F_data_not_eos; if (range->start > range->stop) return F_data_not_stop; - const unsigned short seek_width = f_macro_utf_character_width(seek_to_this); + const unsigned short seek_width = f_macro_utf_character_t_width(seek_to_this); - f_status status = F_none; + f_status_t status = F_none; unsigned short width = 0; - f_string_length width_max = 0; + f_string_length_t width_max = 0; while (range->start < buffer.used) { width_max = (range->stop - range->start) + 1; @@ -1153,7 +1153,7 @@ extern "C" { if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); if (width == seek_width) { - f_utf_character character = 0; + f_utf_character_t character = 0; status = f_utf_char_to_character(buffer.string + range->start, width_max, &character); if (F_status_is_error(status)) return status; @@ -1171,7 +1171,7 @@ extern "C" { #endif // _di_fl_string_dynamic_seek_to_utf_character_ #ifndef _di_fl_string_dynamic_terminate_ - f_return_status fl_string_dynamic_terminate(f_string_dynamic *destination) { + f_return_status fl_string_dynamic_terminate(f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); if (destination->used > destination->size) return F_status_set_error(F_parameter); @@ -1179,14 +1179,14 @@ extern "C" { if (destination->used && destination->string[destination->used - 1] == 0) return F_none; - if (destination->used == f_string_length_size) return F_status_set_error(F_string_too_large); + if (destination->used == f_string_length_t_size) return F_status_set_error(F_string_too_large); - const f_string_length total = destination->used + 1; + const f_string_length_t total = destination->used + 1; if (total > destination->size) { - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -1198,7 +1198,7 @@ extern "C" { #endif // _di_fl_string_dynamic_terminate_ #ifndef _di_fl_string_dynamic_terminate_after_ - f_return_status fl_string_dynamic_terminate_after(f_string_dynamic *destination) { + f_return_status fl_string_dynamic_terminate_after(f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); if (destination->used > destination->size) return F_status_set_error(F_parameter); @@ -1211,14 +1211,14 @@ extern "C" { } // for } - if (destination->used == f_string_length_size) return F_status_set_error(F_string_too_large); + if (destination->used == f_string_length_t_size) return F_status_set_error(F_string_too_large); - const f_string_length total = destination->used + 1; + const f_string_length_t total = destination->used + 1; if (total > destination->size) { - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -1230,19 +1230,19 @@ extern "C" { #endif // _di_fl_string_dynamic_terminate_after_ #ifndef _di_fl_string_lengths_size_decrease_ - f_return_status fl_string_lengths_size_decrease(const f_array_length length, f_string_lengths *lengths) { + f_return_status fl_string_lengths_size_decrease(const f_array_length_t length, f_string_lengths_t *lengths) { #ifndef _di_level_1_parameter_checking_ if (length == 0) return F_status_set_error(F_parameter); if (lengths == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; if (lengths->used - length > 0) { - f_macro_string_lengths_resize(status, (*lengths), lengths->size - length); + f_macro_string_lengths_t_resize(status, (*lengths), lengths->size - length); } else if (lengths->used - length <= 0) { - f_macro_string_lengths_delete(status, (*lengths)); + f_macro_string_lengths_t_delete(status, (*lengths)); } return status; @@ -1250,25 +1250,25 @@ extern "C" { #endif // _di_fl_string_lengths_size_decrease_ #ifndef _di_fl_string_lengths_size_increase_ - f_return_status fl_string_lengths_size_increase(const f_array_length length, f_string_lengths *lengths) { + f_return_status fl_string_lengths_size_increase(const f_array_length_t length, f_string_lengths_t *lengths) { #ifndef _di_level_1_parameter_checking_ if (length == 0) return F_status_set_error(F_parameter); if (lengths == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; if (lengths->used + length > lengths->size) { - if (lengths->used + length > f_array_length_size) { - if (lengths->used == f_array_length_size) { + if (lengths->used + length > f_array_length_t_size) { + if (lengths->used == f_array_length_t_size) { status = F_status_set_error(F_string_too_large); } else { - f_macro_string_lengths_resize(status, (*lengths), f_array_length_size); + f_macro_string_lengths_t_resize(status, (*lengths), f_array_length_t_size); } } else { - f_macro_string_lengths_resize(status, (*lengths), lengths->size + length); + f_macro_string_lengths_t_resize(status, (*lengths), lengths->size + length); } } @@ -1277,7 +1277,7 @@ extern "C" { #endif // _di_fl_string_lengths_size_increase_ #ifndef _di_fl_string_mash_ - f_return_status fl_string_mash(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1285,7 +1285,7 @@ extern "C" { if (length == 0) return F_data_not_eos; if (glue_length && destination->used) { - f_status status = private_fl_string_append(glue, glue_length, destination); + f_status_t status = private_fl_string_append(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -1294,7 +1294,7 @@ extern "C" { #endif // _di_fl_string_mash_ #ifndef _di_fl_string_mash_nulless_ - f_return_status fl_string_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1302,7 +1302,7 @@ extern "C" { if (length == 0) return F_data_not_eos; if (glue_length && destination->used) { - f_status status = private_fl_string_append_nulless(glue, glue_length, destination); + f_status_t status = private_fl_string_append_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -1311,7 +1311,7 @@ extern "C" { #endif // _di_fl_string_mash_nulless_ #ifndef _di_fl_string_mish_ - f_return_status fl_string_mish(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1319,7 +1319,7 @@ extern "C" { if (length == 0) return F_data_not_eos; if (glue_length && destination->used) { - f_status status = private_fl_string_prepend(glue, glue_length, destination); + f_status_t status = private_fl_string_prepend(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -1328,7 +1328,7 @@ extern "C" { #endif // _di_fl_string_mish_ #ifndef _di_fl_string_mish_nulless_ - f_return_status fl_string_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1336,7 +1336,7 @@ extern "C" { if (length == 0) return F_data_not_eos; if (glue_length && destination->used) { - f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination); + f_status_t status = private_fl_string_prepend_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -1345,7 +1345,7 @@ extern "C" { #endif // _di_fl_string_mish_nulless_ #ifndef _di_fl_string_prepend_ - f_return_status fl_string_prepend(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1357,7 +1357,7 @@ extern "C" { #endif // _di_fl_string_prepend_ #ifndef _di_fl_string_prepend_assure_ - f_return_status fl_string_prepend_assure(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1365,8 +1365,8 @@ extern "C" { if (length == 0) return F_data_not_eos; if (destination->used < length) return private_fl_string_prepend(source, length, destination); - f_string_length i = 0; - f_string_length j = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; while (i < length && j < destination->used) { if (source[i] == 0) { @@ -1390,7 +1390,7 @@ extern "C" { #endif // _di_fl_string_prepend_assure_ #ifndef _di_fl_string_prepend_assure_nulless_ - f_return_status fl_string_prepend_assure_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1398,8 +1398,8 @@ extern "C" { if (length == 0) return F_data_not_eos; if (destination->used < length) return private_fl_string_prepend_nulless(source, length, destination); - f_string_length i = 0; - f_string_length j = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; while (i < length && j < destination->used) { if (source[i] == 0) { @@ -1423,7 +1423,7 @@ extern "C" { #endif // _di_fl_string_prepend_assure_nulless_ #ifndef _di_fl_string_prepend_nulless_ - f_return_status fl_string_prepend_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1435,17 +1435,17 @@ extern "C" { #endif // _di_fl_string_prepend_nulless_ #ifndef _di_fl_string_rip_ - f_return_status fl_string_rip(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status 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_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (length == 0) return F_data_not_eos; - f_string_length begin = 0; - f_string_length end = length - 1; + f_string_length_t begin = 0; + f_string_length_t end = length - 1; - f_status status = private_fl_string_rip_find_range(source, &begin, &end); + f_status_t status = private_fl_string_rip_find_range(source, &begin, &end); if (F_status_is_error(status)) return status; if (status == F_data_not) return status; @@ -1455,17 +1455,17 @@ extern "C" { #endif // _di_fl_string_rip_ #ifndef _di_fl_string_rip_nulless_ - f_return_status fl_string_rip_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { + f_return_status fl_string_rip_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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (length == 0) return F_data_not_eos; - f_string_length begin = 0; - f_string_length end = length - 1; + f_string_length_t begin = 0; + f_string_length_t end = length - 1; - f_status status = private_fl_string_rip_find_range(source, &begin, &end); + f_status_t status = private_fl_string_rip_find_range(source, &begin, &end); if (F_status_is_error(status)) return status; if (status == F_data_not) return status; @@ -1475,7 +1475,7 @@ extern "C" { #endif // _di_fl_string_rip_nulless_ #ifndef _di_fl_string_seek_line_to_ - f_return_status fl_string_seek_line_to(const f_string string, const int8_t seek_to, f_string_range *range) { + f_return_status fl_string_seek_line_to(const f_string_t string, const int8_t seek_to, f_string_range_t *range) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1495,20 +1495,20 @@ extern "C" { #endif // _di_fl_string_seek_line_to_ #ifndef _di_fl_string_seek_line_to_utf_character_ - f_return_status fl_string_seek_line_to_utf_character(const f_string string, const f_utf_character seek_to, f_string_range *range) { + f_return_status fl_string_seek_line_to_utf_character(const f_string_t string, const f_utf_character_t seek_to, f_string_range_t *range) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (range->start > range->stop) return F_data_not_stop; - const unsigned short seek_width = f_macro_utf_character_width(seek_to); + const unsigned short seek_width = f_macro_utf_character_t_width(seek_to); - f_status status = F_none; + f_status_t status = F_none; unsigned short width = 0; - f_string_length width_max = (range->stop - range->start) + 1; + f_string_length_t width_max = (range->stop - range->start) + 1; for (; range->start <= range->stop; range->start += width) { width_max = (range->stop - range->start) + 1; @@ -1532,7 +1532,7 @@ extern "C" { if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_eos); if (width == seek_width) { - f_utf_character character = 0; + f_utf_character_t character = 0; status = f_utf_char_to_character(string + range->start, width_max, &character); if (F_status_is_error(status)) return status; @@ -1546,17 +1546,17 @@ extern "C" { #endif // _di_fl_string_seek_line_to_utf_character_ #ifndef _di_fl_string_seek_line_until_graph_ - f_return_status fl_string_seek_line_until_graph(const f_string string, const int8_t placeholder, f_string_range *range) { + f_return_status fl_string_seek_line_until_graph(const f_string_t string, const int8_t placeholder, f_string_range_t *range) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (range->start > range->stop) return F_data_not_stop; - f_status status = F_none; + f_status_t status = F_none; unsigned short width = 0; - f_string_length width_max = (range->stop - range->start) + 1; + f_string_length_t width_max = (range->stop - range->start) + 1; while (string[range->start] == placeholder || (status = f_utf_is_graph(string + range->start, width_max)) == F_false) { if (F_status_is_error(status)) return status; @@ -1589,17 +1589,17 @@ extern "C" { #endif // _di_fl_string_seek_line_until_graph_ #ifndef _di_fl_string_seek_line_until_non_graph_ - f_return_status fl_string_seek_line_until_non_graph(const f_string string, const int8_t placeholder, f_string_range *range) { + f_return_status fl_string_seek_line_until_non_graph(const f_string_t string, const int8_t placeholder, f_string_range_t *range) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (range->start > range->stop) return F_data_not_stop; - f_status status = F_none; + f_status_t status = F_none; unsigned short width = 0; - f_string_length width_max = (range->stop - range->start) + 1; + f_string_length_t width_max = (range->stop - range->start) + 1; while (string[range->start] == placeholder || (status = f_utf_is_whitespace(string + range->start, width_max)) == F_false) { if (F_status_is_error(status)) { @@ -1635,7 +1635,7 @@ extern "C" { #endif // _di_fl_string_seek_line_until_non_graph_ #ifndef _di_fl_string_seek_to_ - f_return_status fl_string_seek_to(const f_string string, const int8_t seek_to, f_string_range *range) { + f_return_status fl_string_seek_to(const f_string_t string, const int8_t seek_to, f_string_range_t *range) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1653,20 +1653,20 @@ extern "C" { #endif // _di_fl_string_seek_to_ #ifndef _di_fl_string_seek_to_utf_character_ - f_return_status fl_string_seek_to_utf_character(const f_string string, const f_utf_character seek_to, f_string_range *range) { + f_return_status fl_string_seek_to_utf_character(const f_string_t string, const f_utf_character_t seek_to, f_string_range_t *range) { #ifndef _di_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (range->start > range->stop) return F_data_not_stop; - const unsigned short seek_width = f_macro_utf_character_width(seek_to); + const unsigned short seek_width = f_macro_utf_character_t_width(seek_to); - f_status status = F_none; + f_status_t status = F_none; unsigned short width = 0; - f_string_length width_max = 0; + f_string_length_t width_max = 0; for (; range->start <= range->stop; range->start += width) { width_max = (range->stop - range->start) + 1; @@ -1688,7 +1688,7 @@ extern "C" { if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); if (width == seek_width) { - f_utf_character character = 0; + f_utf_character_t character = 0; status = f_utf_char_to_character(string + range->start, width_max, &character); if (F_status_is_error(status)) return status; diff --git a/level_1/fl_string/c/string.h b/level_1/fl_string/c/string.h index d53573e..f6becec 100644 --- a/level_1/fl_string/c/string.h +++ b/level_1/fl_string/c/string.h @@ -7,11 +7,11 @@ * * Provides basic string manipulation and processing capabilities. * - * UTF-8 is handled within these functions via normal string characters (f_string). - * Unlike f_utf_string, these f_string base functions do not force padding of ASCII or UTF-8 characters. - * With f_string, a 1-byte wide ASCII character is stored as 1 byte and a 4-byte wide UTF-8 character is stored as 4 bytes. + * UTF-8 is handled within these functions via normal string characters (f_string_t). + * Unlike f_utf_string_t, these f_string_t base functions do not force padding of ASCII or UTF-8 characters. + * With f_string_t, a 1-byte wide ASCII character is stored as 1 byte and a 4-byte wide UTF-8 character is stored as 4 bytes. * - * This shortens the size of the string at the cost of complexity vs f_utf_string. + * This shortens the size of the string at the cost of complexity vs f_utf_string_t. * * Because of the variable width, it is generally unsafe to ignore invalid UTF-8 sequences. * Invalid UTF-8 will be generally result in an error. @@ -53,7 +53,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_append_ - extern f_return_status fl_string_append(const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status fl_string_append(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); #endif // _di_fl_string_append_ /** @@ -77,7 +77,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_append_assure_ - extern f_return_status fl_string_append_assure(const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -102,7 +102,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_append_assure_nulless_ - extern f_return_status fl_string_append_assure_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -126,7 +126,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_append_nulless_ - extern f_return_status fl_string_append_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -150,7 +150,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_string_compare_ - extern f_return_status fl_string_compare(const f_string string1, const f_string string2, const f_string_length length1, const f_string_length length2); + extern f_return_status 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); #endif // _di_fl_string_compare_ /** @@ -179,7 +179,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #ifndef _di_fl_string_compare_trim_ - extern f_return_status fl_string_compare_trim(const f_string string1, const f_string string2, const f_string_length length1, const f_string_length length2); + extern f_return_status fl_string_compare_trim(const f_string_t string1, const f_string_t string2, const f_string_length_t length1, const f_string_length_t length2); #endif // _di_fl_string_compare_trim_ /** @@ -199,7 +199,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_append_ - extern f_return_status fl_string_dynamic_append(const f_string_static source, f_string_dynamic *destination); + extern f_return_status fl_string_dynamic_append(const f_string_static_t source, f_string_dynamic_t *destination); #endif // _di_fl_string_dynamic_append_ /** @@ -219,7 +219,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_append_assure_ - extern f_return_status fl_string_dynamic_append_assure(const f_string_static source, f_string_dynamic *destination); + extern f_return_status fl_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t *destination); #endif // _di_fl_string_dynamic_append_assure_ /** @@ -241,7 +241,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_append_assure_nulless_ - extern f_return_status fl_string_dynamic_append_assure_nulless(const f_string_static source, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -263,7 +263,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_append_nulless_ - extern f_return_status fl_string_dynamic_append_nulless(const f_string_static source, f_string_dynamic *destination); + extern f_return_status fl_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t *destination); #endif // _di_fl_string_dynamic_append_nulless_ /** @@ -283,7 +283,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_string_dynamic_compare_ - extern f_return_status fl_string_dynamic_compare(const f_string_static string1, const f_string_static string2); + extern f_return_status fl_string_dynamic_compare(const f_string_static_t string1, const f_string_static_t string2); #endif // _di_fl_string_dynamic_compare_ /** @@ -312,7 +312,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #ifndef _di_fl_string_dynamic_compare_string_ - extern f_return_status fl_string_dynamic_compare_string(const f_string string1, const f_string_static string2, const f_string_length length1); + extern f_return_status fl_string_dynamic_compare_string(const f_string_t string1, const f_string_static_t string2, const f_string_length_t length1); #endif // _di_fl_string_dynamic_compare_string_ /** @@ -337,7 +337,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #ifndef _di_fl_string_dynamic_compare_trim_ - extern f_return_status fl_string_dynamic_compare_trim(const f_string_static string1, const f_string_static string2); + extern f_return_status fl_string_dynamic_compare_trim(const f_string_static_t string1, const f_string_static_t string2); #endif // _di_fl_string_dynamic_compare_trim_ /** @@ -366,7 +366,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #ifndef _di_fl_string_dynamic_compare_trim_string_ - extern f_return_status fl_string_dynamic_compare_trim_string(const f_string string1, const f_string_static string2, const f_string_length length1); + extern f_return_status fl_string_dynamic_compare_trim_string(const f_string_t string1, const f_string_static_t string2, const f_string_length_t length1); #endif // _di_fl_string_dynamic_compare_trim_string_ /** @@ -392,7 +392,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_mash_ - extern f_return_status fl_string_dynamic_mash(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -420,7 +420,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_mash_nulless_ - extern f_return_status fl_string_dynamic_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -446,7 +446,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_mish_ - extern f_return_status fl_string_dynamic_mish(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -474,7 +474,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_mish_nulless_ - extern f_return_status fl_string_dynamic_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -497,7 +497,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_partial_append_ - extern f_return_status fl_string_dynamic_partial_append(const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -522,7 +522,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_partial_append_assure_ - extern f_return_status fl_string_dynamic_partial_append_assure(const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -549,7 +549,7 @@ extern "C" { * 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_return_status fl_string_dynamic_partial_append_assure_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -574,7 +574,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_partial_append_nulless_ - extern f_return_status fl_string_dynamic_partial_append_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -598,7 +598,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_string_dynamic_partial_compare_ - extern f_return_status fl_string_dynamic_partial_compare(const f_string_static string1, const f_string_static string2, const f_string_range range1, const f_string_range range2); + extern f_return_status 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_ /** @@ -620,7 +620,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_string_dynamic_partial_compare_dynamic_ - extern f_return_status fl_string_dynamic_partial_compare_dynamic(const f_string_static string1, const f_string_static string2, const f_string_range range2); + extern f_return_status fl_string_dynamic_partial_compare_dynamic(const f_string_static_t string1, const f_string_static_t string2, const f_string_range_t range2); #endif // _di_fl_string_dynamic_partial_compare_dynamic_ /** @@ -646,7 +646,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_string_dynamic_partial_compare_string_ - extern f_return_status fl_string_dynamic_partial_compare_string(const f_string string1, const f_string_static string2, const f_string_length length1, const f_string_range range2); + extern f_return_status fl_string_dynamic_partial_compare_string(const f_string_t string1, const f_string_static_t string2, const f_string_length_t length1, const f_string_range_t range2); #endif // _di_fl_string_dynamic_partial_compare_string_ /** @@ -673,7 +673,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #ifndef _di_fl_string_dynamic_partial_compare_trim_dynamic_ - extern f_return_status fl_string_dynamic_partial_compare_trim_dynamic(const f_string_static string1, const f_string_static string2, const f_string_range range2); + extern f_return_status 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); #endif // _di_fl_string_dynamic_partial_compare_trim_dynamic_ /** @@ -704,7 +704,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #ifndef _di_fl_string_dynamic_partial_compare_trim_string_ - extern f_return_status fl_string_dynamic_partial_compare_trim_string(const f_string string1, const f_string_static string2, const f_string_length length1, const f_string_range range2); + extern f_return_status 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); #endif // _di_fl_string_dynamic_partial_compare_trim_string_ /** @@ -733,7 +733,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #ifndef _di_fl_string_dynamic_partial_compare_trim_ - extern f_return_status fl_string_dynamic_partial_compare_trim(const f_string_static string1, const f_string_static string2, const f_string_range range1, const f_string_range range2); + extern f_return_status 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); #endif // _di_fl_string_dynamic_partial_compare_trim_ /** @@ -762,7 +762,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_partial_mash_ - extern f_return_status fl_string_dynamic_partial_mash(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -793,7 +793,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_partial_mash_nulless_ - extern f_return_status fl_string_dynamic_partial_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -822,7 +822,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_partial_mish_ - extern f_return_status fl_string_dynamic_partial_mish(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -853,7 +853,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_partial_mish_nulless_ - extern f_return_status fl_string_dynamic_partial_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -878,7 +878,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_partial_prepend_ - extern f_return_status fl_string_dynamic_partial_prepend(const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -905,7 +905,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_partial_prepend_assure_ - extern f_return_status fl_string_dynamic_partial_prepend_assure(const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -932,7 +932,7 @@ extern "C" { * 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_return_status fl_string_dynamic_partial_prepend_assure_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -957,7 +957,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_partial_prepend_nulless_ - extern f_return_status fl_string_dynamic_partial_prepend_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -980,7 +980,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_prepend_ - extern f_return_status fl_string_dynamic_prepend(const f_string_static source, f_string_dynamic *destination); + extern f_return_status fl_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t *destination); #endif // _di_fl_string_dynamic_prepend_ /** @@ -1005,7 +1005,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_prepend_assure_ - extern f_return_status fl_string_dynamic_prepend_assure(const f_string_static source, f_string_dynamic *destination); + extern f_return_status fl_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t *destination); #endif // _di_fl_string_dynamic_prepend_assure_ /** @@ -1030,7 +1030,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_prepend_assure_nulless_ - extern f_return_status fl_string_dynamic_prepend_assure_nulless(const f_string_static source, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1053,7 +1053,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_prepend_nulless_ - extern f_return_status fl_string_dynamic_prepend_nulless(const f_string_static source, f_string_dynamic *destination); + extern f_return_status fl_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t *destination); #endif // _di_fl_string_dynamic_prepend_nulless_ /** @@ -1076,14 +1076,14 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_size_decrease_ - extern f_return_status fl_string_dynamic_size_decrease(const f_string_length length, f_string_dynamic *string); + extern f_return_status fl_string_dynamic_size_decrease(const f_string_length_t length, f_string_dynamic_t *string); #endif // _di_fl_string_dynamic_size_decrease_ /** * 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_size). + * 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 length @@ -1099,7 +1099,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_size_increase_ - extern f_return_status fl_string_dynamic_size_increase(const f_string_length length, f_string_dynamic *string); + extern f_return_status fl_string_dynamic_size_increase(const f_string_length_t length, f_string_dynamic_t *string); #endif // _di_fl_string_dynamic_size_increase_ /** @@ -1122,14 +1122,14 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamics_size_decrease_ - extern f_return_status fl_string_dynamics_size_decrease(const f_array_length length, f_string_dynamics *strings); + extern f_return_status fl_string_dynamics_size_decrease(const f_array_length_t length, f_string_dynamics_t *strings); #endif // _di_fl_string_dynamics_size_decrease_ /** * Resize the array of dynamic strings 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_size). + * 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 length @@ -1145,7 +1145,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamics_size_increase_ - extern f_return_status fl_string_dynamics_size_increase(const f_array_length length, f_string_dynamics *strings); + extern f_return_status fl_string_dynamics_size_increase(const f_array_length_t length, f_string_dynamics_t *strings); #endif // _di_fl_string_dynamics_size_increase_ /** @@ -1171,7 +1171,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_dynamic_rip_ - extern f_return_status fl_string_dynamic_rip(const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1198,7 +1198,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_string_dynamic_rip_nulless_ - extern f_return_status fl_string_dynamic_rip_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1222,7 +1222,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_string_dynamic_seek_line_to_ - extern f_return_status fl_string_dynamic_seek_line_to(const f_string_static buffer, f_string_range *range, const int8_t seek_to_this); + extern f_return_status fl_string_dynamic_seek_line_to(const f_string_static_t buffer, f_string_range_t *range, const int8_t seek_to_this); #endif // _di_fl_string_dynamic_seek_line_to_ /** @@ -1253,7 +1253,7 @@ extern "C" { * @see f_utf_char_to_character() */ #ifndef _di_fl_string_dynamic_seek_line_to_utf_character_ - extern f_return_status fl_string_dynamic_seek_line_to_utf_character(const f_string_static buffer, f_string_range *range, const f_utf_character seek_to_this); + extern f_return_status fl_string_dynamic_seek_line_to_utf_character(const f_string_static_t buffer, f_string_range_t *range, const f_utf_character_t seek_to_this); #endif // _di_fl_string_dynamic_seek_line_to_utf_character_ /** @@ -1284,7 +1284,7 @@ extern "C" { * @see f_utf_is_graph() */ #ifndef _di_fl_string_dynamic_seek_line_until_graph_ - extern f_return_status fl_string_dynamic_seek_line_until_graph(const f_string_static buffer, f_string_range *range, const int8_t placeholder); + extern f_return_status fl_string_dynamic_seek_line_until_graph(const f_string_static_t buffer, f_string_range_t *range, const int8_t placeholder); #endif // _di_fl_string_dynamic_seek_line_until_graph_ /** @@ -1316,7 +1316,7 @@ extern "C" { * @see f_utf_is_graph() */ #ifndef _di_fl_string_dynamic_seek_line_until_non_graph_ - extern f_return_status fl_string_dynamic_seek_line_until_non_graph(const f_string_static buffer, f_string_range *range, const int8_t placeholder); + extern f_return_status fl_string_dynamic_seek_line_until_non_graph(const f_string_static_t buffer, f_string_range_t *range, const int8_t placeholder); #endif // _di_fl_string_dynamic_seek_line_until_non_graph_ /** @@ -1342,7 +1342,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_string_dynamic_seek_to_ - extern f_return_status fl_string_dynamic_seek_to(const f_string_static buffer, f_string_range *range, const int8_t seek_to_this); + extern f_return_status fl_string_dynamic_seek_to(const f_string_static_t buffer, f_string_range_t *range, const int8_t seek_to_this); #endif // _di_fl_string_dynamic_seek_to_ /** @@ -1373,7 +1373,7 @@ extern "C" { * @see f_utf_char_to_character() */ #ifndef _di_fl_string_dynamic_seek_to_utf_character_ - extern f_return_status fl_string_dynamic_seek_to_utf_character(const f_string_static buffer, f_string_range *range, const f_utf_character seek_to_this); + extern f_return_status fl_string_dynamic_seek_to_utf_character(const f_string_static_t buffer, f_string_range_t *range, const f_utf_character_t seek_to_this); #endif // _di_fl_string_dynamic_seek_to_utf_character_ /** @@ -1394,7 +1394,7 @@ extern "C" { * 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_return_status fl_string_dynamic_terminate(f_string_dynamic *destination); + extern f_return_status fl_string_dynamic_terminate(f_string_dynamic_t *destination); #endif // _di_fl_string_dynamic_terminate_ /** @@ -1417,7 +1417,7 @@ extern "C" { * 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_return_status fl_string_dynamic_terminate_after(f_string_dynamic *destination); + extern f_return_status fl_string_dynamic_terminate_after(f_string_dynamic_t *destination); #endif // _di_fl_string_dynamic_terminate_after_ /** @@ -1440,14 +1440,14 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_lengths_size_decrease_ - extern f_return_status fl_string_length_size_decrease(const f_array_length length, f_string_lengths *lengths); + extern f_return_status fl_string_length_size_decrease(const f_array_length_t length, f_string_lengths_t *lengths); #endif // _di_fl_string_lengths_size_decrease_ /** * Resize the array of string lengths 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_size). + * 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 length @@ -1463,7 +1463,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_lengths_size_increase_ - extern f_return_status fl_string_lengths_size_increase(const f_array_length length, f_string_lengths *lengths); + extern f_return_status fl_string_lengths_size_increase(const f_array_length_t length, f_string_lengths_t *lengths); #endif // _di_fl_string_lengths_size_increase_ /** @@ -1491,7 +1491,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_mash_ - extern f_return_status fl_string_mash(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1521,7 +1521,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_mash_nulless_ - extern f_return_status fl_string_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1549,7 +1549,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_mish_ - extern f_return_status fl_string_mish(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1579,7 +1579,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_mish_nulless_ - extern f_return_status fl_string_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1603,7 +1603,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_prepend_ - extern f_return_status fl_string_prepend(const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status fl_string_prepend(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); #endif // _di_fl_string_prepend_ /** @@ -1629,7 +1629,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_prepend_assure_ - extern f_return_status fl_string_prepend_assure(const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1656,7 +1656,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_prepend_assure_nulless_ - extern f_return_status fl_string_prepend_assure_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1683,7 +1683,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_string_prepend_nulless_ - extern f_return_status fl_string_prepend_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1711,7 +1711,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #ifndef _di_fl_string_rip_ - extern f_return_status fl_string_rip(const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status fl_string_rip(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination); #endif // _di_fl_string_rip_ /** @@ -1741,7 +1741,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #ifndef _di_fl_string_rip_nulless_ - extern f_return_status fl_string_rip_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1763,7 +1763,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_string_seek_line_to_ - extern f_return_status fl_string_seek_line_to(const f_string string, const int8_t seek_to, f_string_range *range); + extern f_return_status fl_string_seek_line_to(const f_string_t string, const int8_t seek_to, f_string_range_t *range); #endif // _di_fl_string_seek_line_to_ /** @@ -1791,7 +1791,7 @@ extern "C" { * @see f_utf_char_to_character() */ #ifndef _di_fl_string_seek_line_to_utf_character_ - extern f_return_status fl_string_seek_line_to_utf_character(const f_string string, const f_utf_character seek_to, f_string_range *range); + extern f_return_status fl_string_seek_line_to_utf_character(const f_string_t string, const f_utf_character_t seek_to, f_string_range_t *range); #endif // _di_fl_string_seek_line_to_utf_character_ /** @@ -1820,7 +1820,7 @@ extern "C" { * @see f_utf_is_graph() */ #ifndef _di_fl_string_seek_line_until_graph_ - extern f_return_status fl_string_seek_line_until_graph(const f_string string, const int8_t placeholder, f_string_range *range); + extern f_return_status fl_string_seek_line_until_graph(const f_string_t string, const int8_t placeholder, f_string_range_t *range); #endif // _di_fl_string_seek_line_until_graph_ /** @@ -1850,7 +1850,7 @@ extern "C" { * @see f_utf_is_whitespace() */ #ifndef _di_fl_string_seek_line_until_non_graph_ - extern f_return_status fl_string_seek_line_until_non_graph(const f_string string, const int8_t placeholder, f_string_range *range); + extern f_return_status fl_string_seek_line_until_non_graph(const f_string_t string, const int8_t placeholder, f_string_range_t *range); #endif // _di_fl_string_seek_line_until_non_graph_ /** @@ -1873,7 +1873,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_string_seek_to_ - extern f_return_status fl_string_seek_to(const f_string string, const int8_t seek_to, f_string_range *range); + extern f_return_status fl_string_seek_to(const f_string_t string, const int8_t seek_to, f_string_range_t *range); #endif // _di_fl_string_seek_to_ /** @@ -1901,7 +1901,7 @@ extern "C" { * @see f_utf_char_to_character() */ #ifndef _di_fl_string_seek_to_utf_character_ - extern f_return_status fl_string_seek_to_utf_character(const f_string string, const f_utf_character seek_to, f_string_range *range); + extern f_return_status fl_string_seek_to_utf_character(const f_string_t string, const f_utf_character_t seek_to, f_string_range_t *range); #endif // _di_fl_string_seek_to_utf_character_ #ifdef __cplusplus diff --git a/level_1/fl_utf/c/private-utf.c b/level_1/fl_utf/c/private-utf.c index 11cbf78..15f953a 100644 --- a/level_1/fl_utf/c/private-utf.c +++ b/level_1/fl_utf/c/private-utf.c @@ -6,16 +6,16 @@ extern "C" { #endif #if !defined(_di_fl_utf_string_append_) || !defined(_di_fl_utf_string_dynamic_append_) || !defined(_di_fl_utf_string_append_mash_) || !defined(_di_fl_utf_string_dynamic_mash_) - f_return_status private_fl_utf_string_append(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status private_fl_utf_string_append(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) { - if (destination->used + length > f_utf_string_max_size) return F_status_set_error(F_string_too_large); + if (destination->used + length > f_utf_string_t_size_max) return F_status_set_error(F_string_too_large); - f_status status = F_none; + f_status_t status = F_none; - const f_utf_string_length total = destination->used + length; + const f_utf_string_length_t total = destination->used + length; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -27,25 +27,25 @@ extern "C" { #endif // !defined(_di_fl_utf_string_append_) || !defined(_di_fl_utf_string_dynamic_append_) || !defined(_di_fl_utf_string_append_mash_) || !defined(_di_fl_utf_string_dynamic_mash_) #if !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_) - f_return_status private_fl_utf_string_append_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status private_fl_utf_string_append_nulless(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) { - if (destination->used + length > f_utf_string_max_size) return F_status_set_error(F_string_too_large); + if (destination->used + length > f_utf_string_t_size_max) return F_status_set_error(F_string_too_large); - f_status status = F_none; + f_status_t status = F_none; - f_utf_string_length first = 0; + f_utf_string_length_t first = 0; - for (f_utf_string_length i = 0; i <= length; i++) { + for (f_utf_string_length_t i = 0; i <= length; i++) { if (i == length) { if (i > first) { - f_utf_string_length size = i - first; + f_utf_string_length_t size = i - first; - if (destination->used + size > f_utf_string_max_size) return F_status_set_error(F_string_too_large); + if (destination->used + size > f_utf_string_t_size_max) return F_status_set_error(F_string_too_large); - f_utf_string_length total = destination->used + size; + f_utf_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -56,17 +56,17 @@ extern "C" { break; } - if (source[i] == f_utf_character_eos) { + if (source[i] == f_utf_character_t_eos) { if (i > 0) { if (i > first) { - f_utf_string_length size = i - first; + f_utf_string_length_t size = i - first; - if (destination->used + size > f_utf_string_max_size) return F_status_set_error(F_string_too_large); + if (destination->used + size > f_utf_string_t_size_max) return F_status_set_error(F_string_too_large); - f_utf_string_length total = destination->used + size; + f_utf_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -75,7 +75,7 @@ extern "C" { } } - while (i + 1 < length && source[i + 1] == f_utf_character_eos) { + while (i + 1 < length && source[i + 1] == f_utf_character_t_eos) { i++; } // while @@ -89,9 +89,9 @@ 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_return_status private_fl_utf_string_compare(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length offset1, const f_utf_string_length offset2, const f_utf_string_length stop1, const f_utf_string_length stop2) { - f_utf_string_length i1 = offset1; - f_utf_string_length i2 = offset2; + f_return_status 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_utf_string_length_t i1 = offset1; + f_utf_string_length_t i2 = offset2; for (; i1 < stop1 && i2 < stop2; i1++, i2++) { // skip past NULL in string1. @@ -119,11 +119,11 @@ extern "C" { #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_utf_string_compare_trim_) || !defined(_di_fl_utf_string_dynamic_compare_trim_) || !defined(_di_fl_utf_string_dynamic_partial_compare_trim_) - f_return_status private_fl_utf_string_compare_trim(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length offset1, const f_utf_string_length offset2, const f_utf_string_length stop1, const f_utf_string_length stop2) { - f_utf_string_length i1 = offset1; - f_utf_string_length i2 = offset2; + f_return_status 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_utf_string_length_t i1 = offset1; + f_utf_string_length_t i2 = offset2; - f_status status = F_none; + f_status_t status = F_none; // skip past leading whitespace in string1. for (; i1 < stop1; i1++) { @@ -159,16 +159,16 @@ extern "C" { if (status == F_false) break; } // for - f_utf_string_length last1 = i1; - f_utf_string_length last2 = i2; + f_utf_string_length_t last1 = i1; + f_utf_string_length_t last2 = i2; { // size1 and size2 are to represent to total number of characters after trim. - f_utf_string_length size1 = 0; - f_utf_string_length size2 = 0; + f_utf_string_length_t size1 = 0; + f_utf_string_length_t size2 = 0; // determine where the last non-whitespace is in string1. - for (f_utf_string_length j = i1; j < stop1; j++) { + for (f_utf_string_length_t j = i1; j < stop1; j++) { // skip past NULL in string1. while (j < stop1 && string1[j] == 0) j++; if (j == stop1) break; @@ -188,7 +188,7 @@ extern "C" { } // for // determine where the last non-whitespace is in string2. - for (f_utf_string_length j = i2; j < stop2; j++) { + for (f_utf_string_length_t j = i2; j < stop2; j++) { // skip past NULL in string2. while (j < stop2 && string2[j] == 0) j++; if (j == stop2) break; @@ -236,18 +236,18 @@ extern "C" { #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_utf_string_prepend_) || !defined(_di_fl_utf_string_dynamic_prepend_) - f_return_status private_fl_utf_string_prepend(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status private_fl_utf_string_prepend(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) { - if (destination->used + length > f_utf_string_max_size) { + if (destination->used + length > f_utf_string_t_size_max) { return F_status_set_error(F_string_too_large); } - f_status status = F_none; + f_status_t status = F_none; - const f_utf_string_length total = destination->used + length; + const f_utf_string_length_t total = destination->used + length; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -265,30 +265,30 @@ extern "C" { #endif // !defined(_di_fl_utf_string_prepend_) || !defined(_di_fl_utf_string_dynamic_prepend_) #if !defined(_di_fl_utf_string_prepend_nulless_) || !defined(_di_fl_utf_string_dynamic_prepend_nulless_) - f_return_status private_fl_utf_string_prepend_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status private_fl_utf_string_prepend_nulless(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) { - if (destination->used + length > f_utf_string_max_size) { + if (destination->used + length > f_utf_string_t_size_max) { return F_status_set_error(F_string_too_large); } - f_status status = F_none; + f_status_t status = F_none; - f_utf_string_length first = 0; - f_utf_string_length offset = 0; + f_utf_string_length_t first = 0; + f_utf_string_length_t offset = 0; - for (f_utf_string_length i = 0; i <= length; i++) { + for (f_utf_string_length_t i = 0; i <= length; i++) { if (i == length) { if (i > first) { - const f_utf_string_length size = i - first; + const f_utf_string_length_t size = i - first; - if (destination->used + size > f_utf_string_max_size) { + if (destination->used + size > f_utf_string_t_size_max) { return F_status_set_error(F_string_too_large); } - const f_utf_string_length total = destination->used + size; + const f_utf_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -302,19 +302,19 @@ extern "C" { break; } - if (source[i] == f_utf_character_eos) { + if (source[i] == f_utf_character_t_eos) { if (i > 0) { if (i > first) { - const f_utf_string_length size = i - first; + const f_utf_string_length_t size = i - first; - if (destination->used + size > f_utf_string_max_size) { + if (destination->used + size > f_utf_string_t_size_max) { return F_status_set_error(F_string_too_large); } - const f_utf_string_length total = destination->used + size; + const f_utf_string_length_t total = destination->used + size; if (total > destination->size) { - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -327,7 +327,7 @@ extern "C" { } } - while (i + 1 < length && source[i + 1] == f_utf_character_eos) { + while (i + 1 < length && source[i + 1] == f_utf_character_t_eos) { i++; } // while @@ -341,9 +341,9 @@ 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_return_status private_fl_utf_string_rip_find_range(const f_utf_string source, f_utf_string_length *start, f_utf_string_length *stop) { + f_return_status 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_status status = F_none; + f_status_t status = F_none; // skip past leading whitespace. for (; *start <= *stop; (*start)++) { diff --git a/level_1/fl_utf/c/private-utf.h b/level_1/fl_utf/c/private-utf.h index 64dc400..20c602a 100644 --- a/level_1/fl_utf/c/private-utf.h +++ b/level_1/fl_utf/c/private-utf.h @@ -43,7 +43,7 @@ extern "C" { * @see fl_utf_string_dynamic_mash() */ #if !defined(_di_fl_utf_string_append_) || !defined(_di_fl_utf_string_dynamic_append_) || !defined(_di_fl_utf_string_append_mash_) || !defined(_di_fl_utf_string_dynamic_mash_) - extern f_return_status private_fl_utf_string_append(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_utf_string_append(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fl_utf_string_append_) || !defined(_di_fl_utf_string_dynamic_append_) || !defined(_di_fl_utf_string_append_mash_) || !defined(_di_fl_utf_string_dynamic_mash_) /** @@ -72,7 +72,7 @@ extern "C" { * @see fl_utf_string_dynamic_mash_nulless() */ #if !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_) - extern f_return_status private_fl_utf_string_append_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_utf_string_append_nulless(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; #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_) /** @@ -103,7 +103,7 @@ extern "C" { * @see fl_utf_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_return_status private_fl_utf_string_compare(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length offset1, const f_utf_string_length offset2, const f_utf_string_length stop1, const f_utf_string_length stop2) f_gcc_attribute_visibility_internal; + extern f_return_status 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_) /** @@ -134,7 +134,7 @@ extern "C" { * @see fl_utf_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_return_status private_fl_utf_string_compare_trim(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length offset1, const f_utf_string_length offset2, const f_utf_string_length stop1, const f_utf_string_length stop2) f_gcc_attribute_visibility_internal; + extern f_return_status 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_) /** @@ -160,7 +160,7 @@ extern "C" { * @see fl_utf_string_dynamic_prepend() */ #if !defined(_di_fl_utf_string_prepend_) || !defined(_di_fl_utf_string_dynamic_prepend_) || !defined(_di_fl_utf_string_append_mish_) || !defined(_di_fl_utf_string_dynamic_mish_) - extern f_return_status private_fl_utf_string_prepend(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_utf_string_prepend(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fl_utf_string_prepend_) || !defined(_di_fl_utf_string_dynamic_prepend_) || !defined(_di_fl_utf_string_append_mish_) || !defined(_di_fl_utf_string_dynamic_mish_) /** @@ -186,7 +186,7 @@ extern "C" { * @see fl_utf_string_dynamic_prepend_nulless() */ #if !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_) - extern f_return_status private_fl_utf_string_prepend_nulless(const f_utf_string source, f_utf_string_length length, f_utf_string_dynamic *destination) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_utf_string_prepend_nulless(const f_utf_string_t source, f_utf_string_length_t length, f_utf_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; #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_) /** @@ -214,7 +214,7 @@ extern "C" { * @see fl_utf_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_return_status private_fl_utf_string_rip_find_range(const f_utf_string source, f_utf_string_length *start, f_utf_string_length *stop) f_gcc_attribute_visibility_internal; + extern f_return_status 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_) #ifdef __cplusplus diff --git a/level_1/fl_utf/c/utf.c b/level_1/fl_utf/c/utf.c index bd9dc34..c27d762 100644 --- a/level_1/fl_utf/c/utf.c +++ b/level_1/fl_utf/c/utf.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fl_utf_string_append_ - f_return_status fl_utf_string_append(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_append(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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -18,7 +18,7 @@ extern "C" { #endif // _di_fl_utf_string_append_ #ifndef _di_fl_utf_string_append_assure_ - f_return_status fl_utf_string_append_assure(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_append_assure(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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -29,16 +29,16 @@ extern "C" { return private_fl_utf_string_append(source, length, destination); } - f_utf_string_length i = 1; - f_utf_string_length j = 1; + f_utf_string_length_t i = 1; + f_utf_string_length_t j = 1; while (i <= length && j <= destination->used) { - if (source[length - i] == f_utf_character_eos) { + if (source[length - i] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[destination->used - j] == f_utf_character_eos) { + if (destination->string[destination->used - j] == f_utf_character_t_eos) { j++; continue; } @@ -56,7 +56,7 @@ extern "C" { #endif // _di_fl_utf_string_append_assure_ #ifndef _di_fl_utf_string_append_assure_nulless_ - f_return_status fl_utf_string_append_assure_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_append_assure_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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -67,16 +67,16 @@ extern "C" { return private_fl_utf_string_append_nulless(source, length, destination); } - f_utf_string_length i = 1; - f_utf_string_length j = 1; + f_utf_string_length_t i = 1; + f_utf_string_length_t j = 1; while (i <= length && j <= destination->used) { - if (source[length - i] == f_utf_character_eos) { + if (source[length - i] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[destination->used - j] == f_utf_character_eos) { + if (destination->string[destination->used - j] == f_utf_character_t_eos) { j++; continue; } @@ -94,7 +94,7 @@ extern "C" { #endif // _di_fl_utf_string_append_assure_nulless_ #ifndef _di_fl_utf_string_append_nulless_ - f_return_status fl_utf_string_append_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_append_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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -106,19 +106,19 @@ extern "C" { #endif // _di_fl_utf_string_append_nulless_ #ifndef _di_fl_utf_string_compare_ - f_return_status fl_utf_string_compare(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length length1, const f_utf_string_length length2) { + f_return_status 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); } #endif // _di_fl_utf_string_compare_ #ifndef _di_fl_utf_string_compare_trim_ - f_return_status fl_utf_string_compare_trim(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length length1, const f_utf_string_length length2) { + f_return_status 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); } #endif // _di_fl_utf_string_compare_trim_ #ifndef _di_fl_utf_string_dynamic_append_ - f_return_status fl_utf_string_dynamic_append(const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_append(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -130,7 +130,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_append_ #ifndef _di_fl_utf_string_dynamic_append_assure_ - f_return_status fl_utf_string_dynamic_append_assure(const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_append_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -141,16 +141,16 @@ extern "C" { return private_fl_utf_string_append(source.string, source.used, destination); } - f_utf_string_length i = 1; - f_utf_string_length j = 1; + f_utf_string_length_t i = 1; + f_utf_string_length_t j = 1; while (i <= source.used && j <= destination->used) { - if (source.string[source.used - i] == f_utf_character_eos) { + if (source.string[source.used - i] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[destination->used - j] == f_utf_character_eos) { + if (destination->string[destination->used - j] == f_utf_character_t_eos) { j++; continue; } @@ -168,7 +168,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_append_assure_ #ifndef _di_fl_utf_string_dynamic_append_assure_nulless_ - f_return_status fl_utf_string_dynamic_append_assure_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_append_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -179,16 +179,16 @@ extern "C" { return private_fl_utf_string_append_nulless(source.string, source.used, destination); } - f_utf_string_length i = 1; - f_utf_string_length j = 1; + f_utf_string_length_t i = 1; + f_utf_string_length_t j = 1; while (i <= source.used && j <= destination->used) { - if (source.string[source.used - i] == f_utf_character_eos) { + if (source.string[source.used - i] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[destination->used - j] == f_utf_character_eos) { + if (destination->string[destination->used - j] == f_utf_character_t_eos) { j++; continue; } @@ -206,7 +206,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_append_assure_nulless_ #ifndef _di_fl_utf_string_dynamic_append_nulless_ - f_return_status fl_utf_string_dynamic_append_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_append_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -218,19 +218,19 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_append_nulless_ #ifndef _di_fl_utf_string_dynamic_compare_ - f_return_status fl_utf_string_dynamic_compare(const f_utf_string_static string1, const f_utf_string_static string2) { + f_return_status 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); } #endif // _di_fl_utf_string_dynamic_compare_ #ifndef _di_f_utf_string_dynamic_compare_trim_ - f_return_status f_utf_string_dynamic_compare_trim(const f_utf_string_static string1, const f_utf_string_static string2) { + f_return_status 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); } #endif // _di_f_utf_string_dynamic_compare_trim_ #ifndef _di_fl_utf_string_dynamic_mash_ - f_return_status fl_utf_string_dynamic_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status 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) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -238,7 +238,7 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (glue_length > 0 && destination->used > 0) { - const f_status status = private_fl_utf_string_append(glue, glue_length, destination); + const f_status_t status = private_fl_utf_string_append(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -247,7 +247,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_mash_ #ifndef _di_fl_utf_string_dynamic_mash_nulless_ - f_return_status fl_utf_string_dynamic_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_mash_nulless(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) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -255,7 +255,7 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (glue_length > 0 && destination->used > 0) { - const f_status status = private_fl_utf_string_append_nulless(glue, glue_length, destination); + const f_status_t status = private_fl_utf_string_append_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -264,7 +264,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_mash_nulless_ #ifndef _di_fl_utf_string_dynamic_mish_ - f_return_status fl_utf_string_dynamic_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_mish(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) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -272,7 +272,7 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (glue_length > 0 && destination->used > 0) { - const f_status status = private_fl_utf_string_prepend(glue, glue_length, destination); + const f_status_t status = private_fl_utf_string_prepend(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -281,7 +281,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_mish_ #ifndef _di_fl_utf_string_dynamic_mish_nulless_ - f_return_status fl_utf_string_dynamic_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_mish_nulless(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) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -289,7 +289,7 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (glue_length > 0 && destination->used > 0) { - const f_status status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination); + const f_status_t status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -298,7 +298,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_mish_nulless_ #ifndef _di_fl_utf_string_dynamic_partial_append_ - f_return_status fl_utf_string_dynamic_partial_append(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_partial_append(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.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -312,7 +312,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_append_ #ifndef _di_fl_utf_string_dynamic_partial_append_assure_ - f_return_status fl_utf_string_dynamic_partial_append_assure(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_partial_append_assure(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.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -321,22 +321,22 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (range.start > range.stop) return F_data_not_stop; - const f_utf_string_length length = (range.stop - range.start) + 1; + const f_utf_string_length_t length = (range.stop - range.start) + 1; if (destination->used < length) { return private_fl_utf_string_append(source.string + range.start, length, destination); } - f_utf_string_length i = 1; - f_utf_string_length j = 1; + f_utf_string_length_t i = 1; + f_utf_string_length_t j = 1; while (i <= length && j <= destination->used) { - if (source.string[range.stop - i] == f_utf_character_eos) { + if (source.string[range.stop - i] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[destination->used - j] == f_utf_character_eos) { + if (destination->string[destination->used - j] == f_utf_character_t_eos) { j++; continue; } @@ -352,7 +352,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_append_assure_ #ifndef _di_fl_utf_string_dynamic_partial_append_assure_nulless_ - f_return_status fl_utf_string_dynamic_partial_append_assure_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_partial_append_assure_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.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -361,22 +361,22 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (range.start > range.stop) return F_data_not_stop; - const f_utf_string_length length = (range.stop - range.start) + 1; + const f_utf_string_length_t length = (range.stop - range.start) + 1; if (destination->used < length) { return private_fl_utf_string_append_nulless(source.string + range.start, length, destination); } - f_utf_string_length i = 1; - f_utf_string_length j = 1; + f_utf_string_length_t i = 1; + f_utf_string_length_t j = 1; while (i <= length && j <= destination->used) { - if (source.string[range.stop - i] == f_utf_character_eos) { + if (source.string[range.stop - i] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[destination->used - j] == f_utf_character_eos) { + if (destination->string[destination->used - j] == f_utf_character_t_eos) { j++; continue; } @@ -392,7 +392,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_append_assure_nulless_ #ifndef _di_fl_utf_string_dynamic_partial_append_nulless_ - f_return_status fl_utf_string_dynamic_partial_append_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_partial_append_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.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -406,7 +406,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_append_nulless_ #ifndef _di_fl_utf_string_dynamic_partial_compare_ - f_return_status fl_utf_string_dynamic_partial_compare(const f_utf_string_static string1, const f_utf_string_static string2, const f_utf_string_range range1, const f_utf_string_range range2) { + f_return_status 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_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); @@ -417,7 +417,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_compare_ #ifndef _di_fl_utf_string_dynamic_partial_compare_trim_ - f_return_status fl_utf_string_dynamic_partial_comparetrim(const f_utf_string_static string1, const f_utf_string_static string2, const f_utf_string_range range1, const f_utf_string_range range2) { + f_return_status 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_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); @@ -428,7 +428,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_compare_trim_ #ifndef _di_fl_utf_string_dynamic_partial_mash_ - f_return_status fl_utf_string_dynamic_partial_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status 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) { #ifndef _di_level_1_parameter_checking_ if (source.used <= range.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -438,7 +438,7 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (glue_length > 0 && destination->used > 0) { - f_status status = private_fl_utf_string_append(glue, glue_length, destination); + f_status_t status = private_fl_utf_string_append(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -447,7 +447,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_mash_ #ifndef _di_fl_utf_string_dynamic_partial_mash_nulless_ - f_return_status fl_utf_string_dynamic_partial_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_partial_mash_nulless(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) { #ifndef _di_level_1_parameter_checking_ if (source.used <= range.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -457,7 +457,7 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (glue_length > 0 && destination->used > 0) { - f_status status = private_fl_utf_string_append_nulless(glue, glue_length, destination); + f_status_t status = private_fl_utf_string_append_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -466,7 +466,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_mash_nulless_ #ifndef _di_fl_utf_string_dynamic_partial_mish_ - f_return_status fl_utf_string_dynamic_partial_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_partial_mish(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) { #ifndef _di_level_1_parameter_checking_ if (source.used <= range.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -476,7 +476,7 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (glue_length > 0 && destination->used > 0) { - f_status status = private_fl_utf_string_prepend(glue, glue_length, destination); + f_status_t status = private_fl_utf_string_prepend(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -485,7 +485,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_mish_ #ifndef _di_fl_utf_string_dynamic_partial_mish_nulless_ - f_return_status fl_utf_string_dynamic_partial_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_partial_mish_nulless(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) { #ifndef _di_level_1_parameter_checking_ if (source.used <= range.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -495,7 +495,7 @@ extern "C" { if (range.start > range.stop) return F_data_not_stop; if (glue_length > 0 && destination->used > 0) { - f_status status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination); + f_status_t status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -504,7 +504,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_mish_nulless_ #ifndef _di_fl_utf_string_dynamic_partial_prepend_ - f_return_status fl_utf_string_dynamic_partial_prepend(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_partial_prepend(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.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -518,7 +518,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_prepend_ #ifndef _di_fl_utf_string_dynamic_partial_prepend_assure_ - f_return_status fl_utf_string_dynamic_partial_prepend_assure(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_partial_prepend_assure(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.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -527,22 +527,22 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (range.start > range.stop) return F_data_not_stop; - const f_utf_string_length length = (range.stop - range.start) + 1; + const f_utf_string_length_t length = (range.stop - range.start) + 1; if (destination->used < length) { return private_fl_utf_string_prepend(source.string + range.start, length, destination); } - f_utf_string_length i = 0; - f_utf_string_length j = 0; + f_utf_string_length_t i = 0; + f_utf_string_length_t j = 0; while (i < length && j < destination->used) { - if (source.string[i + range.start] == f_utf_character_eos) { + if (source.string[i + range.start] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[j] == f_utf_character_eos) { + if (destination->string[j] == f_utf_character_t_eos) { j++; continue; } @@ -560,7 +560,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_prepend_assure_ #ifndef _di_fl_utf_string_dynamic_partial_prepend_assure_nulless_ - f_return_status fl_utf_string_dynamic_partial_prepend_assure_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_partial_prepend_assure_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.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -569,22 +569,22 @@ extern "C" { if (source.used == 0) return F_data_not_eos; if (range.start > range.stop) return F_data_not_stop; - const f_utf_string_length length = (range.stop - range.start) + 1; + const f_utf_string_length_t length = (range.stop - range.start) + 1; if (destination->used < length) { return private_fl_utf_string_prepend_nulless(source.string + range.start, length, destination); } - f_utf_string_length i = 0; - f_utf_string_length j = 0; + f_utf_string_length_t i = 0; + f_utf_string_length_t j = 0; while (i < length && j < destination->used) { - if (source.string[i + range.start] == f_utf_character_eos) { + if (source.string[i + range.start] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[j] == f_utf_character_eos) { + if (destination->string[j] == f_utf_character_t_eos) { j++; continue; } @@ -602,7 +602,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_prepend_assure_nulless_ #ifndef _di_fl_utf_string_dynamic_partial_prepend_nulless_ - f_return_status fl_utf_string_dynamic_partial_prepend_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_partial_prepend_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.stop) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); @@ -616,7 +616,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_partial_prepend_nulless_ #ifndef _di_fl_utf_string_dynamic_prepend_ - f_return_status fl_utf_string_dynamic_prepend(const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_prepend(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -628,7 +628,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_prepend_ #ifndef _di_fl_utf_string_dynamic_prepend_assure_ - f_return_status fl_utf_string_dynamic_prepend_assure(const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_prepend_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -639,16 +639,16 @@ extern "C" { return private_fl_utf_string_prepend(source.string, source.used, destination); } - f_utf_string_length i = 0; - f_utf_string_length j = 0; + f_utf_string_length_t i = 0; + f_utf_string_length_t j = 0; while (i < source.used && j < destination->used) { - if (source.string[i] == f_utf_character_eos) { + if (source.string[i] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[j] == f_utf_character_eos) { + if (destination->string[j] == f_utf_character_t_eos) { j++; continue; } @@ -666,7 +666,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_prepend_assure_ #ifndef _di_fl_utf_string_dynamic_prepend_assure_nulless_ - f_return_status fl_utf_string_dynamic_prepend_assure_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_prepend_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -677,16 +677,16 @@ extern "C" { return private_fl_utf_string_prepend_nulless(source.string, source.used, destination); } - f_utf_string_length i = 0; - f_utf_string_length j = 0; + f_utf_string_length_t i = 0; + f_utf_string_length_t j = 0; while (i < source.used && j < destination->used) { - if (source.string[i] == f_utf_character_eos) { + if (source.string[i] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[j] == f_utf_character_eos) { + if (destination->string[j] == f_utf_character_t_eos) { j++; continue; } @@ -704,7 +704,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_prepend_assure_nulless_ #ifndef _di_fl_utf_string_dynamic_prepend_nulless_ - f_return_status fl_utf_string_dynamic_prepend_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_prepend_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -716,7 +716,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_prepend_nulless_ #ifndef _di_fl_utf_string_dynamic_rip_ - f_return_status fl_utf_string_dynamic_rip(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status 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_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); @@ -731,7 +731,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_rip_ #ifndef _di_fl_utf_string_dynamic_rip_nulless_ - f_return_status fl_utf_string_dynamic_rip_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { + f_return_status 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_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); @@ -746,7 +746,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_rip_nulless_ #ifndef _di_fl_utf_string_dynamic_seek_line_to_ - f_return_status fl_utf_string_dynamic_seek_line_to(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character seek_to_this) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -756,16 +756,16 @@ extern "C" { if (buffer.used == 0) return F_data_not_eos; if (range->start > range->stop) return F_data_not_stop; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); } while (buffer.string[range->start] != seek_to_this) { - if (buffer.string[range->start] == f_utf_character_eol) return F_none_eol; + if (buffer.string[range->start] == f_utf_character_t_eol) return F_none_eol; range->start++; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) return F_status_set_error(F_utf); + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) return F_status_set_error(F_utf); if (range->start >= buffer.used) return F_none_eos; if (range->start > range->stop) return F_none_stop; @@ -776,7 +776,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_seek_line_to_ #ifndef _di_fl_utf_string_dynamic_seek_line_to_char_ - f_return_status fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_static buffer, f_utf_string_range *range, const int8_t seek_to_this) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -786,18 +786,18 @@ extern "C" { if (buffer.used == 0) return F_data_not_eos; if (range->start > range->stop) return F_data_not_stop; - f_utf_character seek_to_character = seek_to_this << 24; + f_utf_character_t seek_to_character = seek_to_this << 24; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); } while (buffer.string[range->start] != seek_to_character) { - if (buffer.string[range->start] == f_utf_character_eol) return F_none_eol; + if (buffer.string[range->start] == f_utf_character_t_eol) return F_none_eol; range->start++; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); } @@ -810,7 +810,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_seek_line_to_character_ #ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_ - f_return_status fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character placeholder) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -820,19 +820,19 @@ extern "C" { if (buffer.used == 0) return F_data_not_eos; if (range->start > range->stop) return F_data_not_stop; - f_status status = F_none; + f_status_t status = F_none; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); } while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_graph(buffer.string[range->start])) == F_false) { if (F_status_is_error(status)) return status; - if (buffer.string[range->start] == f_utf_character_eol) return F_none_eol; + if (buffer.string[range->start] == f_utf_character_t_eol) return F_none_eol; range->start++; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); } @@ -847,7 +847,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_seek_line_until_graph_ #ifndef _di_fl_utf_string_dynamic_seek_line_until_non_graph_ - f_return_status fl_utf_string_dynamic_seek_line_until_non_graph(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character placeholder) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -857,19 +857,19 @@ extern "C" { if (buffer.used == 0) return F_data_not_eos; if (range->start > range->stop) return F_data_not_stop; - f_status status = F_none; + f_status_t status = F_none; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); } while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_whitespace(buffer.string[range->start])) == F_false) { if (F_status_is_error(status)) return status; - if (buffer.string[range->start] == f_utf_character_eol) return F_none_eol; + if (buffer.string[range->start] == f_utf_character_t_eol) return F_none_eol; range->start++; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); } @@ -884,7 +884,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_seek_line_until_non_graph_ #ifndef _di_fl_utf_string_dynamic_seek_to_ - f_return_status fl_utf_string_dynamic_seek_to(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character seek_to_this) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -894,14 +894,14 @@ extern "C" { if (buffer.used == 0) return F_data_not_eos; if (range->start > range->stop) return F_data_not_stop; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); } while (buffer.string[range->start] != seek_to_this) { range->start++; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); } @@ -914,7 +914,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_seek_to_ #ifndef _di_fl_utf_string_dynamic_seek_to_char_ - f_return_status fl_utf_string_dynamic_seek_to_char(const f_utf_string_static buffer, f_utf_string_range *range, const int8_t seek_to_this) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); if (buffer.used <= range->start) return F_status_set_error(F_parameter); @@ -924,16 +924,16 @@ extern "C" { if (buffer.used == 0) return F_data_not_eos; if (range->start > range->stop) return F_data_not_stop; - f_utf_character seek_to_character = seek_to_this << 24; + f_utf_character_t seek_to_character = seek_to_this << 24; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); } while (buffer.string[range->start] != seek_to_character) { range->start++; - if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); } @@ -946,30 +946,30 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_seek_to_char_ #ifndef _di_fl_utf_string_dynamic_terminate_ - f_return_status fl_utf_string_dynamic_terminate(f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_terminate(f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) 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 > 0 && destination->string[destination->used - 1] == f_utf_character_eos) { + if (destination->used > 0 && destination->string[destination->used - 1] == f_utf_character_t_eos) { return F_none; } - if (destination->used == f_utf_string_length_size) { + if (destination->used == f_utf_string_length_t_size) { return F_status_set_error(F_string_too_large); } - const f_utf_string_length total = destination->used + 1; + const f_utf_string_length_t total = destination->used + 1; if (total > destination->size) { - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } - destination->string[destination->used] = f_utf_character_eos; + destination->string[destination->used] = f_utf_character_t_eos; destination->used = total; return F_none; @@ -977,7 +977,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_terminate_ #ifndef _di_fl_utf_string_dynamic_terminate_after_ - f_return_status fl_utf_string_dynamic_terminate_after(f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_dynamic_terminate_after(f_utf_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); if (destination->used > destination->size) return F_status_set_error(F_parameter); @@ -990,16 +990,16 @@ extern "C" { } // for } - if (destination->used == f_utf_string_length_size) { + if (destination->used == f_utf_string_length_t_size) { return F_status_set_error(F_string_too_large); } - const f_utf_string_length total = destination->used + 1; + const f_utf_string_length_t total = destination->used + 1; if (total > destination->size) { - f_status status = F_none; + f_status_t status = F_none; - f_macro_string_dynamic_resize(status, (*destination), total); + f_macro_string_dynamic_t_resize(status, (*destination), total); if (F_status_is_error(status)) return status; } @@ -1011,7 +1011,7 @@ extern "C" { #endif // _di_fl_utf_string_dynamic_terminate_after_ #ifndef _di_fl_utf_string_mash_ - f_return_status fl_utf_string_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_mash(const f_utf_string_t glue, const f_utf_string_length_t glue_length, 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1019,7 +1019,7 @@ extern "C" { if (length == 0) return F_data_not_eos; if (glue_length > 0 && destination->used > 0) { - f_status status = private_fl_utf_string_append(glue, glue_length, destination); + f_status_t status = private_fl_utf_string_append(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -1028,7 +1028,7 @@ extern "C" { #endif // _di_fl_utf_string_mash_ #ifndef _di_fl_utf_string_mash_nulless_ - f_return_status fl_utf_string_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_mash_nulless(const f_utf_string_t glue, const f_utf_string_length_t glue_length, 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1036,7 +1036,7 @@ extern "C" { if (length == 0) return F_data_not_eos; if (glue_length > 0 && destination->used > 0) { - f_status status = private_fl_utf_string_append_nulless(glue, glue_length, destination); + f_status_t status = private_fl_utf_string_append_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -1045,7 +1045,7 @@ extern "C" { #endif // _di_fl_utf_string_mash_nulless_ #ifndef _di_fl_utf_string_mish_ - f_return_status fl_utf_string_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_mish(const f_utf_string_t glue, const f_utf_string_length_t glue_length, 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1053,7 +1053,7 @@ extern "C" { if (length == 0) return F_data_not_eos; if (glue_length > 0 && destination->used > 0) { - f_status status = private_fl_utf_string_prepend(glue, glue_length, destination); + f_status_t status = private_fl_utf_string_prepend(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -1062,7 +1062,7 @@ extern "C" { #endif // _di_fl_utf_string_mish_ #ifndef _di_fl_utf_string_mish_nulless_ - f_return_status fl_utf_string_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_mish_nulless(const f_utf_string_t glue, const f_utf_string_length_t glue_length, 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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1070,7 +1070,7 @@ extern "C" { if (length == 0) return F_data_not_eos; if (glue_length > 0 && destination->used > 0) { - f_status status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination); + f_status_t status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination); if (F_status_is_error(status)) return status; } @@ -1079,7 +1079,7 @@ extern "C" { #endif // _di_fl_utf_string_mish_nulless_ #ifndef _di_fl_utf_string_prepend_ - f_return_status fl_utf_string_prepend(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_prepend(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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1091,7 +1091,7 @@ extern "C" { #endif // _di_fl_utf_string_prepend_ #ifndef _di_fl_utf_string_prepend_assure_ - f_return_status fl_utf_string_prepend_assure(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_prepend_assure(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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1102,16 +1102,16 @@ extern "C" { return private_fl_utf_string_prepend(source, length, destination); } - f_utf_string_length i = 0; - f_utf_string_length j = 0; + f_utf_string_length_t i = 0; + f_utf_string_length_t j = 0; while (i < length && j < destination->used) { - if (source[i] == f_utf_character_eos) { + if (source[i] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[j] == f_utf_character_eos) { + if (destination->string[j] == f_utf_character_t_eos) { j++; continue; } @@ -1129,7 +1129,7 @@ extern "C" { #endif // _di_fl_utf_string_prepend_assure_ #ifndef _di_fl_utf_string_prepend_assure_nulless_ - f_return_status fl_utf_string_prepend_assure_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_prepend_assure_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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1140,16 +1140,16 @@ extern "C" { return private_fl_utf_string_prepend_nulless(source, length, destination); } - f_utf_string_length i = 0; - f_utf_string_length j = 0; + f_utf_string_length_t i = 0; + f_utf_string_length_t j = 0; while (i < length && j < destination->used) { - if (source[i] == f_utf_character_eos) { + if (source[i] == f_utf_character_t_eos) { i++; continue; } - if (destination->string[j] == f_utf_character_eos) { + if (destination->string[j] == f_utf_character_t_eos) { j++; continue; } @@ -1167,7 +1167,7 @@ extern "C" { #endif // _di_fl_utf_string_prepend_assure_nulless_ #ifndef _di_fl_utf_string_prepend_nulless_ - f_return_status fl_utf_string_prepend_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status fl_utf_string_prepend_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 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -1179,17 +1179,17 @@ extern "C" { #endif // _di_fl_utf_string_prepend_nulless_ #ifndef _di_fl_utf_string_rip_ - f_return_status fl_utf_string_rip(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status 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_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (length == 0) return F_data_not_eos; - f_utf_string_length begin = 0; - f_utf_string_length end = length - 1; + f_utf_string_length_t begin = 0; + f_utf_string_length_t end = length - 1; - f_status status = private_fl_utf_string_rip_find_range(source, &begin, &end); + f_status_t status = private_fl_utf_string_rip_find_range(source, &begin, &end); if (F_status_is_error(status)) return status; if (status == F_data_not) return status; @@ -1199,17 +1199,17 @@ extern "C" { #endif // _di_fl_utf_string_rip_ #ifndef _di_fl_utf_string_rip_nulless_ - f_return_status fl_utf_string_rip_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { + f_return_status 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_level_1_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (length == 0) return F_data_not_eos; - f_utf_string_length begin = 0; - f_utf_string_length end = length - 1; + f_utf_string_length_t begin = 0; + f_utf_string_length_t end = length - 1; - f_status status = private_fl_utf_string_rip_find_range(source, &begin, &end); + f_status_t status = private_fl_utf_string_rip_find_range(source, &begin, &end); if (F_status_is_error(status)) return status; if (status == F_data_not) return status; @@ -1219,23 +1219,23 @@ extern "C" { #endif // _di_fl_utf_string_rip_nulless_ #ifndef _di_fl_utf_string_seek_line_to_ - f_return_status fl_utf_string_seek_line_to(const f_utf_string string, f_utf_string_range *range, const f_utf_character seek_to_this) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (range->start > range->stop) return F_data_not_stop; - if (f_macro_utf_character_width_is(string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); } while (string[range->start] != seek_to_this) { - if (string[range->start] == f_utf_character_eol) return F_none_eol; + if (string[range->start] == f_utf_character_t_eol) return F_none_eol; range->start++; - if (f_macro_utf_character_width_is(string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); } @@ -1247,21 +1247,21 @@ extern "C" { #endif // _di_fl_utf_string_seek_line_to_ #ifndef _di_fl_utf_string_seek_line_to_char_ - f_return_status fl_utf_string_seek_line_to_char(const f_utf_string string, f_utf_string_range *range, const int8_t seek_to_this) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (range->start > range->stop) return F_data_not_stop; - f_utf_character seek_to_character = seek_to_this << 24; + f_utf_character_t seek_to_character = seek_to_this << 24; for (; range->start <= range->stop; range->start++) { - if (f_macro_utf_character_width_is(string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); } - if (string[range->start] == f_utf_character_eol) return F_none_eol; + if (string[range->start] == f_utf_character_t_eol) return F_none_eol; if (string[range->start] == seek_to_character) return F_none; } // for @@ -1270,26 +1270,26 @@ extern "C" { #endif // _di_fl_utf_string_seek_line_to_char_ #ifndef _di_fl_utf_string_seek_line_until_graph_ - f_return_status fl_utf_string_seek_line_until_graph(const f_utf_string string, f_utf_string_range *range, const f_utf_character placeholder) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (range->start > range->stop) return F_data_not_stop; - f_status status = F_none; + f_status_t status = F_none; - if (f_macro_utf_character_width_is(string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); } while (string[range->start] == placeholder || (status = f_utf_character_is_graph(string[range->start])) == F_false) { if (F_status_is_error(status)) return status; - if (string[range->start] == f_utf_character_eol) return F_none_eol; + if (string[range->start] == f_utf_character_t_eol) return F_none_eol; range->start++; - if (f_macro_utf_character_width_is(string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); } @@ -1303,24 +1303,24 @@ extern "C" { #endif // _di_fl_utf_string_seek_line_until_graph_ #ifndef _di_fl_utf_string_seek_line_until_non_graph_ - f_return_status fl_utf_string_seek_line_until_non_graph(const f_utf_string string, f_utf_string_range *range, const f_utf_character placeholder) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (range->start > range->stop) return F_data_not_stop; - f_status status = F_none; + f_status_t status = F_none; - if (f_macro_utf_character_width_is(string[range->start]) == 1) return F_status_set_error(F_utf); + if (f_macro_utf_character_t_width_is(string[range->start]) == 1) return F_status_set_error(F_utf); while (string[range->start] == placeholder || (status = f_utf_character_is_graph(string[range->start])) == F_true) { if (F_status_is_error(status)) return status; - if (string[range->start] == f_utf_character_eol) return F_none_eol; + if (string[range->start] == f_utf_character_t_eol) return F_none_eol; range->start++; - if (f_macro_utf_character_width_is(string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); } @@ -1334,21 +1334,21 @@ extern "C" { #endif // _di_fl_utf_string_seek_line_until_non_graph_ #ifndef _di_fl_utf_string_seek_to_ - f_return_status fl_utf_string_seek_to(const f_utf_string string, f_utf_string_range *range, const f_utf_character seek_to_this) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (range->start > range->stop) return F_data_not_stop; - if (f_macro_utf_character_width_is(string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); } while (string[range->start] != seek_to_this) { range->start++; - if (f_macro_utf_character_width_is(string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); } @@ -1360,16 +1360,16 @@ extern "C" { #endif // _di_fl_utf_string_seek_to_ #ifndef _di_fl_utf_string_seek_to_char_ - f_return_status fl_utf_string_seek_to_char(const f_utf_string string, f_utf_string_range *range, const int8_t seek_to_this) { + f_return_status 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_level_1_parameter_checking_ if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (range->start > range->stop) return F_data_not_stop; - const f_utf_character seek_to_character = seek_to_this << 24; + const f_utf_character_t seek_to_character = seek_to_this << 24; - if (f_macro_utf_character_width_is(string[0]) == 1) { + if (f_macro_utf_character_t_width_is(string[0]) == 1) { return F_status_set_error(F_utf); } @@ -1378,7 +1378,7 @@ extern "C" { range->start++; - if (f_macro_utf_character_width_is(string[range->start]) == 1) { + if (f_macro_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); } } // while diff --git a/level_1/fl_utf/c/utf.h b/level_1/fl_utf/c/utf.h index c22472f..a7f201d 100644 --- a/level_1/fl_utf/c/utf.h +++ b/level_1/fl_utf/c/utf.h @@ -7,11 +7,11 @@ * * Provides UTF-8 character manipulation and processing capabilities. * - * UTF-8 is handled within these functions via padded string characters (f_utf_string). - * Unlike f_string, these f_utf_string base functions force padding of ASCII or UTF-8 characters. - * With f_utf_string, a 1-byte wide ASCII character is stored as 4 bytes and a 4-byte wide UTF-8 character is stored as 4 bytes. + * UTF-8 is handled within these functions via padded string characters (f_utf_string_t). + * Unlike f_string_t, these f_utf_string_t base functions force padding of ASCII or UTF-8 characters. + * With f_utf_string_t, a 1-byte wide ASCII character is stored as 4 bytes and a 4-byte wide UTF-8 character is stored as 4 bytes. * - * This simplifies traversing the strings at the cost of size vs f_string. + * This simplifies traversing the strings at the cost of size vs f_string_t. * * Because of the set width, it is generally safe to ignore invalid UTF-8 sequences. * Invalid UTF-8 will be generally ignored here, where reasonably possible. @@ -53,7 +53,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_append_ - extern f_return_status fl_utf_string_append(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_append(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_append_ /** @@ -78,7 +78,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_append_assure_ - extern f_return_status fl_utf_string_append_assure(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_append_assure(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_append_assure_ /** @@ -103,7 +103,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_append_assure_nulless_ - extern f_return_status fl_utf_string_append_assure_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_append_assure_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_append_assure_nulless_ /** @@ -127,7 +127,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_append_nulless_ - extern f_return_status fl_utf_string_append_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_append_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_append_nulless_ /** @@ -151,7 +151,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_utf_string_compare_ - extern f_return_status fl_utf_string_compare(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length length1, const f_utf_string_length length2); + extern f_return_status 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_ /** @@ -180,7 +180,7 @@ extern "C" { * @see f_utf_character_is_whitespace() */ #ifndef _di_fl_utf_string_compare_trim_ - extern f_return_status fl_utf_string_compare_trim(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length length1, const f_utf_string_length length2); + extern f_return_status 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_ /** @@ -200,7 +200,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_append_ - extern f_return_status fl_utf_string_dynamic_append(const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_append(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_dynamic_append_ /** @@ -220,7 +220,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_append_assure_ - extern f_return_status fl_utf_string_dynamic_append_assure(const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_append_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_dynamic_append_assure_ /** @@ -242,7 +242,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_append_assure_nulless_ - extern f_return_status fl_utf_string_dynamic_append_assure_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_append_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_dynamic_append_assure_nulless_ /** @@ -264,7 +264,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_append_nulless_ - extern f_return_status fl_utf_string_dynamic_append_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_append_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_dynamic_append_nulless_ /** @@ -285,7 +285,7 @@ extern "C" { * 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_return_status fl_utf_string_dynamic_compare(const f_utf_string_static string1, const f_utf_string_static string2); + extern f_return_status 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_ /** @@ -311,7 +311,7 @@ extern "C" { * @see f_utf_character_is_whitespace() */ #ifndef _di_f_utf_string_dynamic_compare_trim_ - extern f_return_status f_utf_string_dynamic_compare_trim(const f_utf_string_static string1, const f_utf_string_static string2); + extern f_return_status 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_ /** @@ -337,7 +337,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_mash_ - extern f_return_status fl_utf_string_dynamic_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status 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); #endif // _di_fl_utf_string_dynamic_mash_ /** @@ -365,7 +365,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_mash_nulless_ - extern f_return_status fl_utf_string_dynamic_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_mash_nulless(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); #endif // _di_fl_utf_string_dynamic_mash_nulless_ /** @@ -391,7 +391,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_mish_ - extern f_return_status fl_utf_string_dynamic_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_mish(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); #endif // _di_fl_utf_string_dynamic_mish_ /** @@ -419,7 +419,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_mish_nulless_ - extern f_return_status fl_utf_string_dynamic_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_mish_nulless(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); #endif // _di_fl_utf_string_dynamic_mish_nulless_ /** @@ -442,7 +442,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_append_ - extern f_return_status fl_utf_string_dynamic_partial_append(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_partial_append(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_partial_append_ /** @@ -467,7 +467,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_append_assure_ - extern f_return_status fl_utf_string_dynamic_partial_append_assure(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_partial_append_assure(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_partial_append_assure_ /** @@ -494,7 +494,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_append_assure_nulless_ - extern f_return_status fl_utf_string_dynamic_partial_append_assure_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_partial_append_assure_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_partial_append_assure_nulless_ /** @@ -519,7 +519,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_append_nulless_ - extern f_return_status fl_utf_string_dynamic_partial_append_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_partial_append_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_partial_append_nulless_ /** @@ -543,7 +543,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_utf_string_dynamic_partial_compare_ - extern f_return_status fl_utf_string_dynamic_partial_compare(const f_utf_string_static string1, const f_utf_string_static string2, const f_utf_string_range range1, const f_utf_string_range range2); + extern f_return_status 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_ /** @@ -572,7 +572,7 @@ extern "C" { * @see f_utf_character_is_whitespace() */ #ifndef _di_fl_utf_string_dynamic_partial_compare_trim_ - extern f_return_status fl_utf_string_dynamic_partial_compare_trim(const f_utf_string_static string1, const f_utf_string_static string2, const f_utf_string_range range1, const f_utf_string_range range2); + extern f_return_status 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_ /** @@ -601,7 +601,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_mash_ - extern f_return_status fl_utf_string_dynamic_partial_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status 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); #endif // _di_fl_utf_string_dynamic_partial_mash_ /** @@ -632,7 +632,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_mash_nulless_ - extern f_return_status fl_utf_string_dynamic_partial_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_partial_mash_nulless(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); #endif // _di_fl_utf_string_dynamic_partial_mash_nulless_ /** @@ -661,7 +661,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_mish_ - extern f_return_status fl_utf_string_dynamic_partial_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_partial_mish(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); #endif // _di_fl_utf_string_dynamic_partial_mish_ /** @@ -692,7 +692,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_mish_nulless_ - extern f_return_status fl_utf_string_dynamic_partial_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_partial_mish_nulless(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); #endif // _di_fl_utf_string_dynamic_partial_mish_nulless_ /** @@ -717,7 +717,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_prepend_ - extern f_return_status fl_utf_string_dynamic_partial_prepend(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_partial_prepend(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_partial_prepend_ /** @@ -744,7 +744,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_prepend_assure_ - extern f_return_status fl_utf_string_dynamic_partial_prepend_assure(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_partial_prepend_assure(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_partial_prepend_assure_ /** @@ -771,7 +771,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_prepend_assure_nulless_ - extern f_return_status fl_utf_string_dynamic_partial_prepend_assure_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_partial_prepend_assure_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_partial_prepend_assure_nulless_ /** @@ -796,7 +796,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_partial_prepend_nulless_ - extern f_return_status fl_utf_string_dynamic_partial_prepend_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_partial_prepend_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_partial_prepend_nulless_ /** @@ -819,7 +819,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_prepend_ - extern f_return_status fl_utf_string_dynamic_prepend(const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_prepend(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_dynamic_prepend_ /** @@ -844,7 +844,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_prepend_assure_ - extern f_return_status fl_utf_string_dynamic_prepend_assure(const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_prepend_assure(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_dynamic_prepend_assure_ /** @@ -869,7 +869,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_prepend_assure_nulless_ - extern f_return_status fl_utf_string_dynamic_prepend_assure_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_prepend_assure_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_dynamic_prepend_assure_nulless_ /** @@ -892,7 +892,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_prepend_nulless_ - extern f_return_status fl_utf_string_dynamic_prepend_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_prepend_nulless(const f_utf_string_static_t source, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_dynamic_prepend_nulless_ /** @@ -918,7 +918,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_dynamic_rip_ - extern f_return_status fl_utf_string_dynamic_rip(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status 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_ /** @@ -945,7 +945,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_utf_string_dynamic_rip_nulless_ - extern f_return_status fl_utf_string_dynamic_rip_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination); + extern f_return_status 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_ /** @@ -970,7 +970,7 @@ extern "C" { * 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_return_status fl_utf_string_dynamic_seek_line_to(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character seek_to_this); + extern f_return_status 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_ /** @@ -994,7 +994,7 @@ extern "C" { * 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_return_status fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_static buffer, f_utf_string_range *range, const int8_t seek_to_this); + extern f_return_status 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_ /** @@ -1021,7 +1021,7 @@ extern "C" { * @see f_utf_character_is_graph() */ #ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_ - extern f_return_status fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character placeholder); + extern f_return_status 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_ /** @@ -1049,7 +1049,7 @@ extern "C" { * @see f_utf_character_is_graph() */ #ifndef _di_fl_utf_string_dynamic_seek_line_until_non_graph_ - extern f_return_status fl_utf_string_dynamic_seek_line_until_non_graph(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character placeholder); + extern f_return_status 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_ /** @@ -1073,7 +1073,7 @@ extern "C" { * 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_return_status fl_utf_string_dynamic_seek_to(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character seek_to_this); + extern f_return_status 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_ /** @@ -1097,7 +1097,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_utf_string_dynamic_seek_to_char_ - extern f_return_status fl_utf_string_dynamic_seek_to_char(const f_utf_string_static buffer, f_utf_string_range *range, const int8_t seek_to_this); + extern f_return_status 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_ /** @@ -1124,7 +1124,7 @@ extern "C" { * 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_return_status fl_utf_string_dynamic_seek_to_utf_character(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character seek_to_this); + extern f_return_status 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_ /** @@ -1145,7 +1145,7 @@ extern "C" { * F_string_too_large (with error bit) if string is too large to fit into the buffer. */ #ifndef _di_fl_utf_string_dynamic_terminate_ - extern f_return_status fl_utf_string_dynamic_terminate(f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_terminate(f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_dynamic_terminate_ /** @@ -1168,7 +1168,7 @@ extern "C" { * F_string_too_large (with error bit) if string is too large to fit into the buffer. */ #ifndef _di_fl_utf_string_dynamic_terminate_after_ - extern f_return_status fl_utf_string_dynamic_terminate_after(f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_dynamic_terminate_after(f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_dynamic_terminate_after_ /** @@ -1196,7 +1196,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_mash_ - extern f_return_status fl_utf_string_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_mash(const f_utf_string_t glue, const f_utf_string_length_t glue_length, const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_mash_ /** @@ -1226,7 +1226,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_mash_nulless_ - extern f_return_status fl_utf_string_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_mash_nulless(const f_utf_string_t glue, const f_utf_string_length_t glue_length, const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_mash_nulless_ /** @@ -1254,7 +1254,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_mish_ - extern f_return_status fl_utf_string_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_mish(const f_utf_string_t glue, const f_utf_string_length_t glue_length, const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_mish_ /** @@ -1284,7 +1284,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_mish_nulless_ - extern f_return_status fl_utf_string_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_mish_nulless(const f_utf_string_t glue, const f_utf_string_length_t glue_length, const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_mish_nulless_ /** @@ -1308,7 +1308,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_prepend_ - extern f_return_status fl_utf_string_prepend(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_prepend(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_prepend_ /** @@ -1334,7 +1334,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_prepend_assure_ - extern f_return_status fl_utf_string_prepend_assure(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_prepend_assure(const f_utf_string_t source, const f_utf_string_length_t length, f_utf_string_dynamic_t *destination); #endif // _di_fl_utf_string_prepend_assure_ /** @@ -1361,7 +1361,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_prepend_assure_nulless_ - extern f_return_status fl_utf_string_prepend_assure_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_prepend_assure_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_prepend_assure_nulless_ /** @@ -1388,7 +1388,7 @@ extern "C" { * F_string_too_large (with error bit) if the combined string is too large. */ #ifndef _di_fl_utf_string_prepend_nulless_ - extern f_return_status fl_utf_string_prepend_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status fl_utf_string_prepend_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_prepend_nulless_ /** @@ -1416,7 +1416,7 @@ extern "C" { * @see f_utf_character_is_whitespace() */ #ifndef _di_fl_utf_string_rip_ - extern f_return_status fl_utf_string_rip(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1446,7 +1446,7 @@ extern "C" { * @see f_utf_character_is_whitespace() */ #ifndef _di_fl_utf_string_rip_nulless_ - extern f_return_status fl_utf_string_rip_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination); + extern f_return_status 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_ /** @@ -1468,7 +1468,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_utf_string_seek_line_to_ - extern f_return_status fl_utf_string_seek_line_to(const f_utf_string string, f_utf_string_range *range, const f_utf_character seek_to_this); + extern f_return_status 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_ /** @@ -1491,7 +1491,7 @@ extern "C" { * 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_return_status fl_utf_string_seek_line_to_char(const f_utf_string string, f_utf_string_range *range, const int8_t seek_to_this); + extern f_return_status 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_ /** @@ -1521,7 +1521,7 @@ extern "C" { * @see f_utf_character_is_graph() */ #ifndef _di_fl_utf_string_seek_line_until_graph_ - extern f_return_status fl_utf_string_seek_line_until_graph(const f_utf_string string, f_utf_string_range *range, const f_utf_character placeholder); + extern f_return_status 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_ /** @@ -1552,7 +1552,7 @@ extern "C" { * @see f_utf_character_is_graph() */ #ifndef _di_fl_utf_string_seek_line_until_non_graph_ - extern f_return_status fl_utf_string_seek_line_until_non_graph(const f_utf_string string, f_utf_string_range *range, const f_utf_character placeholder); + extern f_return_status 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_ /** @@ -1574,7 +1574,7 @@ extern "C" { * 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_return_status fl_utf_string_seek_to(const f_utf_string string, f_utf_string_range *range, const f_utf_character seek_to_this); + extern f_return_status 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_ /** @@ -1597,7 +1597,7 @@ extern "C" { * 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_return_status fl_utf_string_seek_to_char(const f_utf_string string, f_utf_string_range *range, const int8_t seek_to_this); + extern f_return_status fl_utf_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_1/fl_utf_file/c/private-utf_file.c b/level_1/fl_utf_file/c/private-utf_file.c index 81a4c57..e086836 100644 --- a/level_1/fl_utf_file/c/private-utf_file.c +++ b/level_1/fl_utf_file/c/private-utf_file.c @@ -6,9 +6,9 @@ extern "C" { #endif #if !defined(fl_utf_file_read) || !defined(fl_utf_file_read_until) || !defined(fl_utf_file_read_range) - void private_fl_utf_file_process_read_buffer(const char *buffer_read, const ssize_t size_read, f_utf_string_dynamic *buffer, char buffer_char[], uint8_t *width, int8_t *width_last) { - f_utf_character character = 0; - f_string_length i = 0; + void private_fl_utf_file_process_read_buffer(const char *buffer_read, const ssize_t size_read, f_utf_string_dynamic_t *buffer, char buffer_char[], uint8_t *width, int8_t *width_last) { + f_utf_character_t character = 0; + f_string_length_t i = 0; uint8_t increment_by = 0; for (; i < size_read; i += increment_by) { @@ -48,16 +48,16 @@ extern "C" { } if (*width_last == *width) { - buffer->string[buffer->used] = f_macro_utf_character_from_char_1((buffer_char[0])); + buffer->string[buffer->used] = f_macro_utf_character_t_from_char_1((buffer_char[0])); if (*width > 1) { - buffer->string[buffer->used] |= f_macro_utf_character_from_char_2((buffer_char[1])); + buffer->string[buffer->used] |= f_macro_utf_character_t_from_char_2((buffer_char[1])); if (*width > 2) { - buffer->string[buffer->used] |= f_macro_utf_character_from_char_3((buffer_char[2])); + buffer->string[buffer->used] |= f_macro_utf_character_t_from_char_3((buffer_char[2])); if (*width > 3) { - buffer->string[buffer->used] |= f_macro_utf_character_from_char_4((buffer_char[3])); + buffer->string[buffer->used] |= f_macro_utf_character_t_from_char_4((buffer_char[3])); } } } @@ -70,20 +70,20 @@ extern "C" { #endif // !defined(fl_utf_file_read) || !defined(fl_utf_file_read_until) || !defined(fl_utf_file_read_range) #if !defined(fl_utf_file_write) || !defined(fl_utf_file_write_until) || !defined(fl_utf_file_write_range) - f_return_status private_fl_utf_file_write_until(const f_file file, const f_utf_string string, const f_utf_string_length total, f_utf_string_length *written) { + f_return_status private_fl_utf_file_write_until(const f_file_t file, const f_utf_string_t string, const f_utf_string_length_t total, f_utf_string_length_t *written) { *written = 0; - f_status status = F_none; - f_utf_string_length write_size = file.size_write > 4 ? file.size_write : 4; - f_utf_string_length write_max = total; - f_utf_string_length i = 0; + f_status_t status = F_none; + f_utf_string_length_t write_size = file.size_write > 4 ? file.size_write : 4; + f_utf_string_length_t write_max = total; + f_utf_string_length_t i = 0; if (write_size > write_max) { write_size = write_max; } - f_string_length last = 0; - f_string_length used = 0; + f_string_length_t last = 0; + f_string_length_t used = 0; ssize_t size_write = 0; uint8_t buffer_write[write_size]; @@ -98,19 +98,19 @@ extern "C" { for (i = 0, used = 0; used < write_size && *written + i < write_max; i++, used += width) { if (width_written < width) { if (width_written < 2) { - buffer_write[used] = f_macro_utf_character_to_char_2(string[*written + i]); + buffer_write[used] = f_macro_utf_character_t_to_char_2(string[*written + i]); width_written++; used++; } if (width > 2 && width_written < 3) { - buffer_write[used + 1] = f_macro_utf_character_to_char_3(string[*written + i]); + buffer_write[used + 1] = f_macro_utf_character_t_to_char_3(string[*written + i]); width_written++; used++; } if (width == 4 && width_written < 4) { - buffer_write[used + 2] = f_macro_utf_character_to_char_4(string[*written + i]); + buffer_write[used + 2] = f_macro_utf_character_t_to_char_4(string[*written + i]); width_written++; used++; } @@ -118,14 +118,14 @@ extern "C" { width = 0; } else { - width = f_macro_utf_character_width(string[*written + i]); + width = f_macro_utf_character_t_width(string[*written + i]); width_written = width; if (*written + width > write_max) { return F_incomplete_utf_stop; } - buffer_write[used] = f_macro_utf_character_to_char_1(string[*written + i]); + buffer_write[used] = f_macro_utf_character_t_to_char_1(string[*written + i]); if (width > 1) { if (used == write_size) { @@ -134,7 +134,7 @@ extern "C" { break; } - buffer_write[used + 1] = f_macro_utf_character_to_char_2(string[*written + i]); + buffer_write[used + 1] = f_macro_utf_character_t_to_char_2(string[*written + i]); if (width > 2) { if (used + 2 > write_size) { @@ -143,7 +143,7 @@ extern "C" { break; } - buffer_write[used + 2] = f_macro_utf_character_to_char_3(string[*written + i]); + buffer_write[used + 2] = f_macro_utf_character_t_to_char_3(string[*written + i]); if (width == 4) { if (used + 3 > write_size) { @@ -152,7 +152,7 @@ extern "C" { break; } - buffer_write[used + 3] = f_macro_utf_character_to_char_4(string[*written + i]); + buffer_write[used + 3] = f_macro_utf_character_t_to_char_4(string[*written + i]); } } } diff --git a/level_1/fl_utf_file/c/private-utf_file.h b/level_1/fl_utf_file/c/private-utf_file.h index 40ed82a..93e46fa 100644 --- a/level_1/fl_utf_file/c/private-utf_file.h +++ b/level_1/fl_utf_file/c/private-utf_file.h @@ -39,7 +39,7 @@ extern "C" { * @see fl_utf_file_read_until() */ #if !defined(fl_utf_file_read) || !defined(fl_utf_file_read_until) || !defined(fl_utf_file_read_range) - void private_fl_utf_file_process_read_buffer(const char *buffer_read, const ssize_t size_read, f_utf_string_dynamic *buffer, char buffer_char[], uint8_t *width, int8_t *width_last) f_gcc_attribute_visibility_internal; + void private_fl_utf_file_process_read_buffer(const char *buffer_read, const ssize_t size_read, f_utf_string_dynamic_t *buffer, char buffer_char[], uint8_t *width, int8_t *width_last) f_gcc_attribute_visibility_internal; #endif // !defined(fl_utf_file_read) || !defined(fl_utf_file_read_until) || !defined(fl_utf_file_read_range) /** @@ -77,7 +77,7 @@ extern "C" { * @see fl_utf_file_write_until() */ #if !defined(fl_utf_file_write) || !defined(fl_utf_file_write_until) || !defined(fl_utf_file_write_range) - extern f_return_status private_fl_utf_file_write_until(const f_file file, const f_utf_string string, const f_utf_string_length total, f_utf_string_length *written) f_gcc_attribute_visibility_internal; + extern f_return_status private_fl_utf_file_write_until(const f_file_t file, const f_utf_string_t string, const f_utf_string_length_t total, f_utf_string_length_t *written) f_gcc_attribute_visibility_internal; #endif // !defined(fl_utf_file_write) || !defined(fl_utf_file_write_until) || !defined(fl_utf_file_write_range) #ifdef __cplusplus diff --git a/level_1/fl_utf_file/c/utf_file.c b/level_1/fl_utf_file/c/utf_file.c index df31aa1..823c512 100644 --- a/level_1/fl_utf_file/c/utf_file.c +++ b/level_1/fl_utf_file/c/utf_file.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fl_utf_file_read_ - f_return_status fl_utf_file_read(const f_file file, f_utf_string_dynamic *buffer) { + f_return_status fl_utf_file_read(const f_file_t file, f_utf_string_dynamic_t *buffer) { #ifndef _di_level_1_parameter_checking_ if (file.size_read == 0) return F_status_set_error(F_parameter); if (buffer->used > buffer->size) return F_status_set_error(F_parameter); @@ -15,7 +15,7 @@ extern "C" { if (file.id < 0) return F_status_set_error(F_file); if (file.id == 0) return F_status_set_error(F_file_closed); - f_status status = F_none; + f_status_t status = F_none; ssize_t size_read = 0; uint8_t width = 0; @@ -28,11 +28,11 @@ extern "C" { while ((size_read = read(file.id, buffer_read, file.size_read)) > 0) { if (buffer->used + size_read > buffer->size) { - if (buffer->size + size_read > f_utf_string_length_size) { + if (buffer->size + size_read > f_utf_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); + f_macro_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); if (F_status_is_error(status)) return status; } @@ -66,7 +66,7 @@ extern "C" { #endif // _di_fl_utf_file_read_ #ifndef _di_fl_utf_file_read_block_ - f_return_status fl_utf_file_read_block(const f_file file, f_utf_string_dynamic *buffer) { + f_return_status fl_utf_file_read_block(const f_file_t file, f_utf_string_dynamic_t *buffer) { #ifndef _di_level_1_parameter_checking_ if (file.size_read == 0) return F_status_set_error(F_parameter); if (buffer->used > buffer->size) return F_status_set_error(F_parameter); @@ -75,7 +75,7 @@ extern "C" { if (file.id < 0) return F_status_set_error(F_file); if (file.id == 0) return F_status_set_error(F_file_closed); - f_status status = F_none; + f_status_t status = F_none; ssize_t size_read = 0; uint8_t width = 0; @@ -88,11 +88,11 @@ extern "C" { if ((size_read = read(file.id, buffer_read, file.size_read)) > 0) { if (buffer->used + size_read > buffer->size) { - if (buffer->size + size_read > f_string_length_size) { + if (buffer->size + size_read > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); + f_macro_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); if (F_status_is_error(status)) return status; } @@ -126,7 +126,7 @@ extern "C" { #endif // _di_fl_utf_file_read_block_ #ifndef _di_fl_utf_file_read_until_ - f_return_status fl_utf_file_read_until(const f_file file, f_utf_string_dynamic *buffer, const f_utf_string_length total) { + f_return_status fl_utf_file_read_until(const f_file_t file, f_utf_string_dynamic_t *buffer, const f_utf_string_length_t total) { #ifndef _di_level_1_parameter_checking_ if (file.size_read == 0) return F_status_set_error(F_parameter); if (buffer->used > buffer->size) return F_status_set_error(F_parameter); @@ -135,14 +135,14 @@ extern "C" { if (file.id < 0) return F_status_set_error(F_file); if (file.id == 0) return F_status_set_error(F_file_closed); - f_status status = F_none; + f_status_t status = F_none; ssize_t size_read = 0; uint8_t width = 0; int8_t width_last = -1; - f_utf_string_length buffer_size = file.size_read; - f_utf_string_length buffer_count = 0; + f_utf_string_length_t buffer_size = file.size_read; + f_utf_string_length_t buffer_count = 0; if (total < buffer_size) { buffer_size = total; @@ -155,11 +155,11 @@ extern "C" { while (buffer_count < total && (size_read = read(file.id, buffer_read, buffer_size)) > 0) { if (buffer->used + size_read > buffer->size) { - if (buffer->size + size_read > f_string_length_size) { + if (buffer->size + size_read > f_string_length_t_size) { return F_status_set_error(F_string_too_large); } - f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); + f_macro_string_dynamic_t_resize(status, (*buffer), buffer->size + size_read); if (F_status_is_error(status)) return status; } @@ -193,7 +193,7 @@ extern "C" { #endif // _di_fl_utf_file_read_until_ #ifndef _di_fl_utf_file_write_ - f_return_status fl_utf_file_write(const f_file file, const f_utf_string_static buffer, f_utf_string_length *written) { + f_return_status fl_utf_file_write(const f_file_t file, const f_utf_string_static_t buffer, f_utf_string_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (file.size_write == 0) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); @@ -207,7 +207,7 @@ extern "C" { return F_data_not; } - const f_status status = private_fl_utf_file_write_until(file, buffer.string, buffer.used, written); + const f_status_t status = private_fl_utf_file_write_until(file, buffer.string, buffer.used, written); if (F_status_is_error(status)) return F_status_set_error(status); if (status == F_none && *written == buffer.used) return F_none_eos; @@ -217,7 +217,7 @@ extern "C" { #endif // _di_fl_utf_file_write_ #ifndef _di_fl_utf_file_write_block_ - f_return_status fl_utf_file_write_block(const f_file file, const f_utf_string_static buffer, f_utf_string_length *written) { + f_return_status fl_utf_file_write_block(const f_file_t file, const f_utf_string_static_t buffer, f_utf_string_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (file.size_write == 0) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); @@ -231,13 +231,13 @@ extern "C" { return F_data_not; } - f_utf_string_length write_max = file.size_write; + f_utf_string_length_t write_max = file.size_write; if (write_max > buffer.used) { write_max = buffer.used; } - const f_status status = private_fl_utf_file_write_until(file, buffer.string, write_max, written); + const f_status_t status = private_fl_utf_file_write_until(file, buffer.string, write_max, written); if (F_status_is_error(status)) return F_status_set_error(status); if (status == F_none && *written == buffer.used) return F_none_eos; @@ -247,7 +247,7 @@ extern "C" { #endif // _di_fl_utf_file_write_block_ #ifndef _di_fl_utf_file_write_until_ - f_return_status fl_utf_file_write_until(const f_file file, const f_utf_string_static buffer, const f_utf_string_length total, f_utf_string_length *written) { + f_return_status fl_utf_file_write_until(const f_file_t file, const f_utf_string_static_t buffer, const f_utf_string_length_t total, f_utf_string_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (file.size_write == 0) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); @@ -261,13 +261,13 @@ extern "C" { return F_data_not; } - f_utf_string_length write_max = file.size_write; + f_utf_string_length_t write_max = file.size_write; if (write_max > buffer.used) { write_max = buffer.used; } - const f_status status = private_fl_utf_file_write_until(file, buffer.string, write_max, written); + const f_status_t status = private_fl_utf_file_write_until(file, buffer.string, write_max, written); if (F_status_is_error(status)) return F_status_set_error(status); if (status == F_none && *written == buffer.used) return F_none_eos; @@ -277,7 +277,7 @@ extern "C" { #endif // _di_fl_utf_file_write_until_ #ifndef _di_fl_utf_file_write_range_ - f_return_status fl_utf_file_write_range(const f_file file, const f_utf_string_static buffer, const f_utf_string_range range, f_utf_string_length *written) { + f_return_status fl_utf_file_write_range(const f_file_t file, const f_utf_string_static_t buffer, const f_utf_string_range_t range, f_utf_string_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (file.size_write == 0) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); @@ -293,14 +293,14 @@ extern "C" { return F_data_not; } - const f_utf_string_length total = (range.stop - range.start) + 1; - f_utf_string_length write_max = total; + const f_utf_string_length_t total = (range.stop - range.start) + 1; + f_utf_string_length_t write_max = total; if (write_max > buffer.used) { write_max = buffer.used; } - const f_status status = private_fl_utf_file_write_until(file, buffer.string + range.start, write_max, written); + const f_status_t status = private_fl_utf_file_write_until(file, buffer.string + range.start, write_max, written); if (F_status_is_error(status)) return F_status_set_error(status); if (status == F_none) { diff --git a/level_1/fl_utf_file/c/utf_file.h b/level_1/fl_utf_file/c/utf_file.h index 3c6d6b0..912e01c 100644 --- a/level_1/fl_utf_file/c/utf_file.h +++ b/level_1/fl_utf_file/c/utf_file.h @@ -55,7 +55,7 @@ extern "C" { * @see read() */ #ifndef _di_fl_utf_file_read_ - extern f_return_status fl_utf_file_read(const f_file file, f_utf_string_dynamic *buffer); + extern f_return_status fl_utf_file_read(const f_file_t file, f_utf_string_dynamic_t *buffer); #endif // _di_fl_utf_file_read_ /** @@ -88,7 +88,7 @@ extern "C" { * @see read() */ #ifndef _di_fl_utf_file_read_block_ - extern f_return_status fl_utf_file_read_block(const f_file file, f_utf_string_dynamic *buffer); + extern f_return_status fl_utf_file_read_block(const f_file_t file, f_utf_string_dynamic_t *buffer); #endif // _di_fl_utf_file_read_block_ /** @@ -122,7 +122,7 @@ extern "C" { * @see read */ #ifndef _di_fl_utf_file_read_until_ - extern f_return_status fl_utf_file_read_until(const f_file file, f_utf_string_dynamic *buffer, const f_utf_string_length total); + extern f_return_status fl_utf_file_read_until(const f_file_t file, f_utf_string_dynamic_t *buffer, const f_utf_string_length_t total); #endif // _di_fl_utf_file_read_until_ /** @@ -154,7 +154,7 @@ extern "C" { * @see write() */ #ifndef _di_fl_utf_file_write_ - extern f_return_status fl_utf_file_write(const f_file file, const f_utf_string_static buffer, f_utf_string_length *written); + extern f_return_status fl_utf_file_write(const f_file_t file, const f_utf_string_static_t buffer, f_utf_string_length_t *written); #endif // _di_fl_utf_file_write_ /** @@ -188,7 +188,7 @@ extern "C" { * @see write() */ #ifndef _di_fl_utf_file_write_block_ - extern f_return_status fl_utf_file_write_block(const f_file file, const f_utf_string_static buffer, f_utf_string_length *written); + extern f_return_status fl_utf_file_write_block(const f_file_t file, const f_utf_string_static_t buffer, f_utf_string_length_t *written); #endif // _di_fl_utf_file_write_block_ /** @@ -222,7 +222,7 @@ extern "C" { * @see write() */ #ifndef _di_fl_utf_file_write_until_ - extern f_return_status fl_utf_file_write_until(const f_file file, const f_utf_string_static buffer, const f_utf_string_length total, f_utf_string_length *written); + extern f_return_status fl_utf_file_write_until(const f_file_t file, const f_utf_string_static_t buffer, const f_utf_string_length_t total, f_utf_string_length_t *written); #endif // _di_fl_utf_file_write_until_ /** @@ -256,7 +256,7 @@ extern "C" { * @see write() */ #ifndef _di_fl_utf_file_write_range_ - extern f_return_status fl_utf_file_write_range(const f_file file, const f_utf_string_static buffer, const f_utf_string_range range, f_utf_string_length *written); + extern f_return_status fl_utf_file_write_range(const f_file_t file, const f_utf_string_static_t buffer, const f_utf_string_range_t range, f_utf_string_length_t *written); #endif // _di_fl_utf_file_write_range_ #ifdef __cplusplus diff --git a/level_1/fl_utf_file/data/build/dependencies b/level_1/fl_utf_file/data/build/dependencies index e4e94f3..9bfaf1a 100644 --- a/level_1/fl_utf_file/data/build/dependencies +++ b/level_1/fl_utf_file/data/build/dependencies @@ -1,8 +1,8 @@ # fss-0000 f_type -f_status +f_status_t f_memory -f_string +f_string_t f_utf -f_file +f_file_t diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index 6951439..b46debd 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fll_execute_arguments_add_ - f_return_status fll_execute_arguments_add(const f_string source, const f_string_length length, f_string_dynamics *arguments) { + f_return_status fll_execute_arguments_add(const f_string_t source, const f_string_length_t length, f_string_dynamics_t *arguments) { #ifndef _di_level_2_parameter_checking_ if (arguments == 0) return F_status_set_error(F_parameter); if (arguments->used > arguments->size) return F_status_set_error(F_parameter); @@ -14,7 +14,7 @@ extern "C" { if (length == 0) return F_data_not; - f_status status = F_none; + f_status_t status = F_none; status = private_fll_execute_arguments_add(source, length, arguments); @@ -25,7 +25,7 @@ extern "C" { #endif // _di_fll_execute_arguments_add_ #ifndef _di_fll_execute_arguments_add_parameter_ - f_return_status fll_execute_arguments_add_parameter(const f_string prefix, const f_string_length prefix_length, const f_string name, const f_string_length name_length, const f_string value, const f_string_length value_length, f_string_dynamics *arguments) { + f_return_status 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) { #ifndef _di_level_2_parameter_checking_ if (arguments == 0) return F_status_set_error(F_parameter); if (arguments->used > arguments->size) return F_status_set_error(F_parameter); @@ -34,7 +34,7 @@ extern "C" { if (name_length == 0) return F_data_not; if (value_length == 0) return F_data_not; - f_status status = F_none; + f_status_t status = F_none; status = private_fll_execute_arguments_add_parameter(prefix, prefix_length, name, name_length, value, value_length, arguments); @@ -45,7 +45,7 @@ extern "C" { #endif // _di_fll_execute_arguments_add_parameter_ #ifndef _di_fll_execute_arguments_add_parameter_set_ - f_return_status fll_execute_arguments_add_parameter_set(const f_string prefix[], const f_string_length prefix_length[], const f_string name[], const f_string_length name_length[], const f_string value[], const f_string_length value_length[], const f_array_length size, f_string_dynamics *arguments) { + f_return_status 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) { #ifndef _di_level_2_parameter_checking_ if (arguments == 0) return F_status_set_error(F_parameter); if (arguments->used > arguments->size) return F_status_set_error(F_parameter); @@ -53,9 +53,9 @@ extern "C" { if (size == 0) return F_data_not; - f_status status = F_none; + f_status_t status = F_none; - for (f_array_length i = 0; i < size; i++) { + for (f_array_length_t i = 0; i < size; i++) { if (name_length[i] == 0) continue; if (value_length[i] == 0) continue; @@ -69,7 +69,7 @@ extern "C" { #endif // _di_fll_execute_arguments_add_parameter_set_ #ifndef _di_fll_execute_arguments_add_set_ - f_return_status fll_execute_arguments_add_set(const f_string source[], const f_string_length length[], const f_array_length size, f_string_dynamics *arguments) { + f_return_status 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) { #ifndef _di_level_2_parameter_checking_ if (arguments == 0) return F_status_set_error(F_parameter); if (arguments->used > arguments->size) return F_status_set_error(F_parameter); @@ -77,9 +77,9 @@ extern "C" { if (size == 0) return F_data_not; - f_status status = F_none; + f_status_t status = F_none; - for (f_array_length i = 0; i < size; i++) { + for (f_array_length_t i = 0; i < size; i++) { if (length[i] == 0) continue; status = private_fll_execute_arguments_add(source[i], length[i], arguments); @@ -92,7 +92,7 @@ extern "C" { #endif // _di_fll_execute_arguments_add_set_ #ifndef _di_fll_execute_arguments_dynamic_add_ - f_return_status fll_execute_arguments_dynamic_add(const f_string_static source, f_string_dynamics *arguments) { + f_return_status fll_execute_arguments_dynamic_add(const f_string_static_t source, f_string_dynamics_t *arguments) { #ifndef _di_level_2_parameter_checking_ if (source.used > source.size) return F_status_set_error(F_parameter); if (arguments == 0) return F_status_set_error(F_parameter); @@ -101,7 +101,7 @@ extern "C" { if (source.used == 0) return F_data_not; - f_status status = F_none; + f_status_t status = F_none; status = private_fll_execute_arguments_add(source.string, source.used, arguments); @@ -112,7 +112,7 @@ extern "C" { #endif // _di_fll_execute_arguments_dynamic_add_ #ifndef _di_fll_execute_arguments_dynamic_add_parameter_ - f_return_status fll_execute_arguments_dynamic_add_parameter(const f_string_static prefix, const f_string_static name, const f_string_static value, f_string_dynamics *arguments) { + f_return_status fll_execute_arguments_dynamic_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments) { #ifndef _di_level_2_parameter_checking_ if (prefix.used > prefix.size) return F_status_set_error(F_parameter); if (name.used > name.size) return F_status_set_error(F_parameter); @@ -124,7 +124,7 @@ extern "C" { if (name.used == 0) return F_data_not; if (value.used == 0) return F_data_not; - f_status status = F_none; + f_status_t status = F_none; status = private_fll_execute_arguments_add_parameter(prefix.string, prefix.used, name.string, name.used, value.string, value.used, arguments); @@ -135,7 +135,7 @@ extern "C" { #endif // _di_fll_execute_arguments_dynamic_add_parameter_ #ifndef _di_fll_execute_arguments_dynamic_add_parameter_set_ - f_return_status fll_execute_arguments_dynamic_add_parameter_set(const f_string_static prefix[], const f_string_static name[], const f_string_static value[], const f_array_length size, f_string_dynamics *arguments) { + f_return_status fll_execute_arguments_dynamic_add_parameter_set(const f_string_static_t prefix[], const f_string_static_t name[], const f_string_static_t value[], const f_array_length_t size, f_string_dynamics_t *arguments) { #ifndef _di_level_2_parameter_checking_ if (arguments == 0) return F_status_set_error(F_parameter); if (arguments->used > arguments->size) return F_status_set_error(F_parameter); @@ -143,9 +143,9 @@ extern "C" { if (size == 0) return F_data_not; - f_status status = F_none; + f_status_t status = F_none; - for (f_array_length i = 0; i < size; i++) { + for (f_array_length_t i = 0; i < size; i++) { if (prefix[i].used > prefix[i].size) continue; if (name[i].used == 0) continue; if (name[i].used > name[i].size) continue; @@ -162,7 +162,7 @@ extern "C" { #endif // _di_fll_execute_arguments_dynamic_add_parameter_set_ #ifndef _di_fll_execute_arguments_dynamic_add_set_ - f_return_status fll_execute_arguments_dynamic_add_set(const f_string_static source[], const f_array_length size, f_string_dynamics *arguments) { + f_return_status fll_execute_arguments_dynamic_add_set(const f_string_static_t source[], const f_array_length_t size, f_string_dynamics_t *arguments) { #ifndef _di_level_2_parameter_checking_ if (arguments == 0) return F_status_set_error(F_parameter); if (arguments->used > arguments->size) return F_status_set_error(F_parameter); @@ -170,9 +170,9 @@ extern "C" { if (size == 0) return F_data_not; - f_status status = F_none; + f_status_t status = F_none; - for (f_array_length i = 0; i < size; i++) { + for (f_array_length_t i = 0; i < size; i++) { if (source[i].used == 0) continue; if (source[i].used > source[i].size) continue; @@ -186,23 +186,23 @@ extern "C" { #endif // _di_fll_execute_arguments_dynamic_add_set_ #ifndef _di_fll_execute_path_ - f_return_status fll_execute_path(const f_string program_path, const f_string_statics arguments, int *result) { + f_return_status fll_execute_path(const f_string_t program_path, const f_string_statics_t arguments, int *result) { #ifndef _di_level_2_parameter_checking_ if (result == 0) return F_status_set_error(F_parameter); if (arguments.used > arguments.size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ // create a string array that is compatible with execv() calls. - f_string fixed_arguments[arguments.used + 2]; + f_string_t fixed_arguments[arguments.used + 2]; - f_string last_slash = f_string_initialize; - f_string program_name = f_string_initialize; + f_string_t last_slash = f_string_t_initialize; + f_string_t program_name = f_string_t_initialize; - f_string_length name_size = 0; + f_string_length_t name_size = 0; - f_status status = F_none; + f_status_t status = F_none; - memset(&fixed_arguments, 0, sizeof(f_string) * (arguments.used + 2)); + memset(&fixed_arguments, 0, sizeof(f_string_t) * (arguments.used + 2)); last_slash = strrchr(program_path, '/'); @@ -210,7 +210,7 @@ extern "C" { name_size = strnlen(program_path, f_path_max); if (name_size > 1) { - f_macro_string_new(status, program_name, name_size + 1); + f_macro_string_t_new(status, program_name, name_size + 1); if (F_status_is_error(status)) return status; @@ -225,7 +225,7 @@ extern "C" { name_size = strnlen(last_slash, f_path_max); if (name_size > 1) { - f_macro_string_new(status, program_name, name_size + 1); + f_macro_string_t_new(status, program_name, name_size + 1); if (F_status_is_error(status)) return status; @@ -244,14 +244,14 @@ extern "C" { fixed_arguments[0] = program_name; } - for (f_string_length i = 0; i < arguments.used; i++) { - f_macro_string_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); + for (f_string_length_t i = 0; i < arguments.used; i++) { + f_macro_string_t_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); if (F_status_is_error(status)) { - if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); + if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size); - for (f_string_length j = 0; j < i; j++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[j].used + 1); + for (f_string_length_t j = 0; j < i; j++) { + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[j].used + 1); } // for return status; @@ -266,19 +266,19 @@ extern "C" { status = f_file_exists(program_path); if (F_status_is_error(status)) { - if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); + if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size); - for (f_string_length i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + for (f_string_length_t i = 0; i < arguments.used; i++) { + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for return status; } else if (status == F_false) { - if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); + if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size); - for (f_string_length i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + for (f_string_length_t i = 0; i < arguments.used; i++) { + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for return F_status_set_error(F_file_found_not); @@ -289,10 +289,10 @@ extern "C" { process_id = fork(); if (process_id < 0) { - if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); + if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size); - for (f_string_length i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + for (f_string_length_t i = 0; i < arguments.used; i++) { + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for return F_status_set_error(F_fork); @@ -309,10 +309,10 @@ extern "C" { // have the parent wait for the child process to finish waitpid(process_id, result, 0); - if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); + if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size); - for (f_string_length i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + for (f_string_length_t i = 0; i < arguments.used; i++) { + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for if (result != 0 && *result != 0) return F_status_set_error(F_failure); @@ -322,7 +322,7 @@ extern "C" { #endif // _di_fll_execute_path_ #ifndef _di_fll_execute_path_environment_ - f_return_status fll_execute_path_environment(const f_string program_path, const f_string_statics arguments, const f_string_statics names, const f_string_statics values, int *result) { + f_return_status fll_execute_path_environment(const f_string_t program_path, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, int *result) { #ifndef _di_level_2_parameter_checking_ if (result == 0) return F_status_set_error(F_parameter); if (arguments.used > arguments.size) return F_status_set_error(F_parameter); @@ -332,16 +332,16 @@ extern "C" { #endif // _di_level_2_parameter_checking_ // create a string array that is compatible with execv() calls. - f_string fixed_arguments[arguments.used + 2]; + f_string_t fixed_arguments[arguments.used + 2]; - f_string last_slash = f_string_initialize; - f_string program_name = f_string_initialize; + f_string_t last_slash = f_string_t_initialize; + f_string_t program_name = f_string_t_initialize; - f_string_length name_size = 0; + f_string_length_t name_size = 0; - f_status status = F_none; + f_status_t status = F_none; - memset(&fixed_arguments, 0, sizeof(f_string) * (arguments.used + 2)); + memset(&fixed_arguments, 0, sizeof(f_string_t) * (arguments.used + 2)); last_slash = strrchr(program_path, '/'); @@ -349,7 +349,7 @@ extern "C" { name_size = strnlen(program_path, f_path_max); if (name_size > 1) { - f_macro_string_new(status, program_name, name_size + 1); + f_macro_string_t_new(status, program_name, name_size + 1); if (F_status_is_error(status)) return status; @@ -364,7 +364,7 @@ extern "C" { name_size = strnlen(last_slash, f_path_max); if (name_size > 1) { - f_macro_string_new(status, program_name, name_size + 1); + f_macro_string_t_new(status, program_name, name_size + 1); if (F_status_is_error(status)) return status; @@ -383,14 +383,14 @@ extern "C" { fixed_arguments[0] = program_name; } - for (f_string_length i = 0; i < arguments.used; i++) { - f_macro_string_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); + for (f_string_length_t i = 0; i < arguments.used; i++) { + f_macro_string_t_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); if (F_status_is_error(status)) { - if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); + if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size); - for (f_string_length j = 0; j < i; j++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[j].used + 1); + for (f_string_length_t j = 0; j < i; j++) { + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[j].used + 1); } // for return status; @@ -406,19 +406,19 @@ extern "C" { status = f_file_exists(program_path); if (F_status_is_error(status)) { - if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); + if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size); - for (f_string_length i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + for (f_string_length_t i = 0; i < arguments.used; i++) { + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for return status; } else if (status == F_false) { - if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); + if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size); - for (f_string_length i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + for (f_string_length_t i = 0; i < arguments.used; i++) { + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for return F_status_set_error(F_file_found_not); @@ -429,10 +429,10 @@ extern "C" { process_id = fork(); if (process_id < 0) { - if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); + if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size); - for (f_string_length i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + for (f_string_length_t i = 0; i < arguments.used; i++) { + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for return F_status_set_error(F_fork); @@ -442,7 +442,7 @@ extern "C" { if (process_id == 0) { clearenv(); - for (f_array_length i = 0; i < names.used; i++) { + for (f_array_length_t i = 0; i < names.used; i++) { f_environment_set_dynamic(names.array[i], values.array[i], F_true); } // for @@ -455,10 +455,10 @@ extern "C" { // have the parent wait for the child process to finish waitpid(process_id, result, 0); - if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); + if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size); - for (f_string_length i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + for (f_string_length_t i = 0; i < arguments.used; i++) { + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for if (result != 0 && *result != 0) return F_status_set_error(F_failure); @@ -468,27 +468,27 @@ extern "C" { #endif // _di_fll_execute_path_environment_ #ifndef _di_fll_execute_program_ - f_return_status fll_execute_program(const f_string program_name, const f_string_statics arguments, int *result) { + f_return_status fll_execute_program(const f_string_t program_name, const f_string_statics_t arguments, int *result) { #ifndef _di_level_2_parameter_checking_ if (result == 0) return F_status_set_error(F_parameter); if (arguments.used > arguments.size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ // create a string array that is compatible with execv() calls. - f_string fixed_arguments[arguments.used + 2]; + f_string_t fixed_arguments[arguments.used + 2]; - memset(&fixed_arguments, 0, sizeof(f_string) * (arguments.used + 2)); + memset(&fixed_arguments, 0, sizeof(f_string_t) * (arguments.used + 2)); fixed_arguments[0] = program_name; - f_status status = F_none; - f_array_length i = 0; + f_status_t status = F_none; + f_array_length_t i = 0; for (; i < arguments.used; i++) { - f_macro_string_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); if (F_status_is_error(status)) { - for (f_array_length j = 0; j < i; j++) { - f_macro_string_delete_simple(fixed_arguments[j + 1], arguments.array[j].used + 1); + for (f_array_length_t j = 0; j < i; j++) { + f_macro_string_t_delete_simple(fixed_arguments[j + 1], arguments.array[j].used + 1); } // for return status; @@ -507,7 +507,7 @@ extern "C" { if (process_id < 0) { for (i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for return F_status_set_error(F_fork); @@ -518,7 +518,7 @@ extern "C" { execvp(program_name, fixed_arguments); for (i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for // according to manpages, calling _exit() is safer and should be called here instead of exit() @@ -526,7 +526,7 @@ extern "C" { } for (i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for // have the parent wait for the child process to finish @@ -539,7 +539,7 @@ extern "C" { #endif // _di_fll_execute_program_ #ifndef _di_fll_execute_program_environment_ - f_return_status fll_execute_program_environment(const f_string program_name, const f_string_statics arguments, const f_string_statics names, const f_string_statics values, int *result) { + f_return_status fll_execute_program_environment(const f_string_t program_name, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, int *result) { #ifndef _di_level_2_parameter_checking_ if (result == 0) return F_status_set_error(F_parameter); if (arguments.used > arguments.size) return F_status_set_error(F_parameter); @@ -549,20 +549,20 @@ extern "C" { #endif // _di_level_2_parameter_checking_ // create a string array that is compatible with execv() calls. - f_string fixed_arguments[arguments.used + 2]; + f_string_t fixed_arguments[arguments.used + 2]; - memset(&fixed_arguments, 0, sizeof(f_string) * (arguments.used + 2)); + memset(&fixed_arguments, 0, sizeof(f_string_t) * (arguments.used + 2)); fixed_arguments[0] = program_name; - f_status status = F_none; - f_array_length i = 0; + f_status_t status = F_none; + f_array_length_t i = 0; for (; i < arguments.used; i++) { - f_macro_string_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); if (F_status_is_error(status)) { - for (f_array_length j = 0; j < i; j++) { - f_macro_string_delete_simple(fixed_arguments[j + 1], arguments.array[j].used + 1); + for (f_array_length_t j = 0; j < i; j++) { + f_macro_string_t_delete_simple(fixed_arguments[j + 1], arguments.array[j].used + 1); } // for return status; @@ -575,8 +575,8 @@ extern "C" { // insert the required array terminated fixed_arguments[arguments.used + 2] = 0; - f_string_dynamic path = f_string_dynamic_initialize; - f_string_dynamics paths = f_string_dynamics_initialize; + f_string_dynamic_t path = f_string_dynamic_t_initialize; + f_string_dynamics_t paths = f_string_dynamics_t_initialize; status = f_environment_get("PATH", &path); @@ -592,26 +592,26 @@ extern "C" { if (F_status_is_error(status)) { for (i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - f_macro_string_dynamic_delete_simple(path); - f_macro_string_dynamics_delete_simple(paths); + f_macro_string_dynamic_t_delete_simple(path); + f_macro_string_dynamics_t_delete_simple(paths); return status; } - f_macro_string_dynamic_delete(status, path); + f_macro_string_dynamic_t_delete(status, path); if (F_status_is_error(status)) { for (i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - f_macro_string_dynamics_delete_simple(paths); + f_macro_string_dynamics_t_delete_simple(paths); return status; } - const f_string_length program_name_length = strnlen(program_name, f_path_max); - f_string_dynamic *found = 0; + const f_string_length_t program_name_length = strnlen(program_name, f_path_max); + f_string_dynamic_t *found = 0; for (i = 0; i < paths.used; i++) { status = fl_string_append(program_name, program_name_length, &paths.array[i]); @@ -646,20 +646,20 @@ extern "C" { if (F_status_is_error(status)) { for (i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - f_macro_string_dynamics_delete_simple(paths); + f_macro_string_dynamics_t_delete_simple(paths); return status; } } // for if (found == 0) { for (i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - f_macro_string_dynamics_delete_simple(paths); + f_macro_string_dynamics_t_delete_simple(paths); return F_status_set_error(F_file_found_not); } @@ -667,10 +667,10 @@ extern "C" { memcpy(&program_path, found->string, found->used); - f_macro_string_dynamics_delete(status, paths); + f_macro_string_dynamics_t_delete(status, paths); if (F_status_is_error(status)) { for (i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for return status; @@ -682,7 +682,7 @@ extern "C" { if (process_id < 0) { for (i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for return F_status_set_error(F_fork); @@ -699,7 +699,7 @@ extern "C" { execvp(program_path, fixed_arguments); for (i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for // according to manpages, calling _exit() is safer and should be called here instead of exit() @@ -707,7 +707,7 @@ extern "C" { } for (i = 0; i < arguments.used; i++) { - f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); + f_macro_string_t_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for // have the parent wait for the child process to finish diff --git a/level_2/fll_execute/c/execute.h b/level_2/fll_execute/c/execute.h index 16e22a3..f84ca30 100644 --- a/level_2/fll_execute/c/execute.h +++ b/level_2/fll_execute/c/execute.h @@ -57,7 +57,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_execute_arguments_add_ - extern f_return_status fll_execute_arguments_add(const f_string source, const f_string_length length, f_string_dynamics *arguments); + extern f_return_status fll_execute_arguments_add(const f_string_t source, const f_string_length_t length, f_string_dynamics_t *arguments); #endif // _di_fll_execute_arguments_add_ /** * Add parameters as arguments to the execution arguments array. @@ -95,7 +95,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_execute_arguments_add_parameter_ - extern f_return_status fll_execute_arguments_add_parameter(const f_string prefix, const f_string_length prefix_length, const f_string name, const f_string_length name_length, const f_string value, const f_string_length value_length, f_string_dynamics *arguments); + extern f_return_status 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); #endif // _di_fll_execute_arguments_add_parameter_ /** @@ -136,7 +136,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_execute_arguments_add_parameter_set_ - extern f_return_status fll_execute_arguments_add_parameter_set(const f_string prefix[], const f_string_length prefix_length[], const f_string name[], const f_string_length name_length[], const f_string value[], const f_string_length value_length[], const f_array_length size, f_string_dynamics *arguments); + extern f_return_status 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); #endif // _di_fll_execute_arguments_add_parameter_set_ /** @@ -163,7 +163,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_execute_arguments_add_set_ - extern f_return_status fll_execute_arguments_add_set(const f_string source[], const f_string_length length[], const f_array_length size, f_string_dynamics *arguments); + extern f_return_status 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); #endif // _di_fll_execute_arguments_add_set_ /** @@ -186,7 +186,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_execute_arguments_dynamic_add_ - extern f_return_status fll_execute_arguments_dynamic_add(const f_string_static source, f_string_dynamics *arguments); + extern f_return_status fll_execute_arguments_dynamic_add(const f_string_static_t source, f_string_dynamics_t *arguments); #endif // _di_fll_execute_arguments_dynamic_add_ /** @@ -219,7 +219,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_execute_arguments_dynamic_add_parameter_ - extern f_return_status fll_execute_arguments_dynamic_add_parameter(const f_string_static prefix, const f_string_static name, const f_string_static value, f_string_dynamics *arguments); + extern f_return_status fll_execute_arguments_dynamic_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments); #endif // _di_fll_execute_arguments_dynamic_add_parameter_ /** @@ -254,7 +254,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_execute_arguments_dynamic_add_parameter_set_ - extern f_return_status fll_execute_arguments_dynamic_add_parameter_set(const f_string_static prefix[], const f_string_static name[], const f_string_static value[], const f_array_length size, f_string_dynamics *arguments); + extern f_return_status fll_execute_arguments_dynamic_add_parameter_set(const f_string_static_t prefix[], const f_string_static_t name[], const f_string_static_t value[], const f_array_length_t size, f_string_dynamics_t *arguments); #endif // _di_fll_execute_arguments_dynamic_add_parameter_set_ /** @@ -279,7 +279,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_execute_arguments_dynamic_add_set_ - extern f_return_status fll_execute_arguments_dynamic_add_set(const f_string_static source[], const f_array_length size, f_string_dynamics *arguments); + extern f_return_status fll_execute_arguments_dynamic_add_set(const f_string_static_t source[], const f_array_length_t size, f_string_dynamics_t *arguments); #endif // _di_fll_execute_arguments_dynamic_add_set_ /** @@ -312,7 +312,7 @@ extern "C" { * @see execv() */ #ifndef _di_fll_execute_path_ - extern f_return_status fll_execute_path(const f_string program_path, const f_string_statics arguments, int *result); + extern f_return_status fll_execute_path(const f_string_t program_path, const f_string_statics_t arguments, int *result); #endif // _di_fll_execute_path_ /** @@ -355,7 +355,7 @@ extern "C" { * @see execv() */ #ifndef _di_fll_execute_path_environment_ - f_return_status fll_execute_path_environment(const f_string program_path, const f_string_statics arguments, const f_string_statics names, const f_string_statics values, int *result); + f_return_status fll_execute_path_environment(const f_string_t program_path, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, int *result); #endif // _di_fll_execute_path_environment_ /** @@ -383,7 +383,7 @@ extern "C" { * @see execvp() */ #ifndef _di_fll_execute_program_ - extern f_return_status fll_execute_program(const f_string program_name, const f_string_statics arguments, int *result); + extern f_return_status fll_execute_program(const f_string_t program_name, const f_string_statics_t arguments, int *result); #endif // _di_fll_execute_program_ /** @@ -430,7 +430,7 @@ extern "C" { * @see execvpe() */ #ifndef _di_fll_execute_program_environment_ - extern f_return_status fll_execute_program_environment(const f_string program_name, const f_string_statics arguments, const f_string_statics names, const f_string_statics values, int *result); + extern f_return_status fll_execute_program_environment(const f_string_t program_name, const f_string_statics_t arguments, const f_string_statics_t names, const f_string_statics_t values, int *result); #endif // _di_fll_execute_program_environment_ #ifdef __cplusplus diff --git a/level_2/fll_execute/c/private-execute.c b/level_2/fll_execute/c/private-execute.c index 1df7fed..8901e5f 100644 --- a/level_2/fll_execute/c/private-execute.c +++ b/level_2/fll_execute/c/private-execute.c @@ -6,12 +6,12 @@ extern "C" { #endif #if !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) || !defined(_di_fll_execute_arguments_dynamic_add_) || !defined(_di_fll_execute_arguments_dynamic_add_set_) - f_return_status private_fll_execute_arguments_add(const f_string source, const f_string_length length, f_string_dynamics *arguments) { - f_status status = F_none; + f_return_status 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 = F_none; if (arguments->used == arguments->size) { - if (arguments->size + f_memory_default_allocation_step > f_array_length_size) { - if (arguments->size + 1 > f_array_length_size) return F_buffer_too_large; + if (arguments->size + f_memory_default_allocation_step > f_array_length_t_size) { + if (arguments->size + 1 > f_array_length_t_size) return F_buffer_too_large; f_macro_string_dynamics_resize(status, (*arguments), arguments->size + 1); } else { @@ -21,17 +21,17 @@ extern "C" { if (F_status_is_error(status)) return status; } - f_string_dynamic argument = f_string_dynamic_initialize; + f_string_dynamic_t argument = f_string_dynamic_t_initialize; status = fl_string_append(source, length, &argument); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(argument); + f_macro_string_dynamic_t_delete_simple(argument); return status; } status = fl_string_dynamic_terminate(&argument); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(argument); + f_macro_string_dynamic_t_delete_simple(argument); return status; } @@ -45,12 +45,12 @@ extern "C" { #endif // !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) || !defined(_di_fll_execute_arguments_dynamic_add_) || !defined(_di_fll_execute_arguments_dynamic_add_set_) #if !defined(_di_fll_execute_arguments_add_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_return_status private_fll_execute_arguments_add_parameter(const f_string prefix, const f_string_length prefix_length, const f_string name, const f_string_length name_length, const f_string value, const f_string_length value_length, f_string_dynamics *arguments) { - f_status status = F_none; + f_return_status 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 = F_none; if (arguments->used + 1 >= arguments->size) { - if (arguments->size + f_memory_default_allocation_step > f_array_length_size) { - if (arguments->size + 2 > f_array_length_size) return F_buffer_too_large; + if (arguments->size + f_memory_default_allocation_step > f_array_length_t_size) { + if (arguments->size + 2 > f_array_length_t_size) return F_buffer_too_large; f_macro_string_dynamics_resize(status, (*arguments), arguments->size + 2); } else { @@ -60,25 +60,25 @@ extern "C" { if (F_status_is_error(status)) return status; } - f_string_dynamic argument = f_string_dynamic_initialize; + f_string_dynamic_t argument = f_string_dynamic_t_initialize; if (prefix_length > 0) { status = fl_string_append(prefix, prefix_length, &argument); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(argument); + f_macro_string_dynamic_t_delete_simple(argument); return status; } } status = fl_string_append(name, name_length, &argument); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(argument); + f_macro_string_dynamic_t_delete_simple(argument); return status; } status = fl_string_dynamic_terminate(&argument); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(argument); + f_macro_string_dynamic_t_delete_simple(argument); return status; } @@ -87,17 +87,17 @@ extern "C" { arguments->array[arguments->used].size = argument.size; arguments->used++; - f_macro_string_dynamic_clear(argument); + f_macro_string_dynamic_t_clear(argument); status = fl_string_append(value, value_length, &argument); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(argument); + f_macro_string_dynamic_t_delete_simple(argument); return status; } status = fl_string_dynamic_terminate(&argument); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(argument); + f_macro_string_dynamic_t_delete_simple(argument); return status; } diff --git a/level_2/fll_execute/c/private-execute.h b/level_2/fll_execute/c/private-execute.h index d3e1e1e..9c94702 100644 --- a/level_2/fll_execute/c/private-execute.h +++ b/level_2/fll_execute/c/private-execute.h @@ -56,7 +56,7 @@ extern "C" { * @see fll_execute_arguments_dynamic_add_set() */ #if !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) || !defined(_di_fll_execute_arguments_dynamic_add_) || !defined(_di_fll_execute_arguments_dynamic_add_set_) - extern f_return_status private_fll_execute_arguments_add(const f_string source, const f_string_length length, f_string_dynamics *arguments) f_gcc_attribute_visibility_internal; + extern f_return_status private_fll_execute_arguments_add(const f_string_t source, const f_string_length_t length, f_string_dynamics_t *arguments) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) || !defined(_di_fll_execute_arguments_dynamic_add_) || !defined(_di_fll_execute_arguments_dynamic_add_set_) /** @@ -93,7 +93,7 @@ extern "C" { * @see fll_execute_arguments_dynamic_add_parameter_set() */ #if !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_set_) - extern f_return_status private_fll_execute_arguments_add_parameter(const f_string prefix, const f_string_length prefix_length, const f_string name, const f_string_length name_length, const f_string value, const f_string_length value_length, f_string_dynamics *arguments) f_gcc_attribute_visibility_internal; + extern f_return_status 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_gcc_attribute_visibility_internal; #endif // !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_set_) #ifdef __cplusplus diff --git a/level_2/fll_file/c/file.c b/level_2/fll_file/c/file.c index 0e71eea..d2b9ed3 100644 --- a/level_2/fll_file/c/file.c +++ b/level_2/fll_file/c/file.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fll_file_error_print_ - f_return_status fll_file_error_print(FILE *file, const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { + f_return_status fll_file_error_print(FILE *file, const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(file, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); diff --git a/level_2/fll_file/c/file.h b/level_2/fll_file/c/file.h index 54d5223..e45fe4d 100644 --- a/level_2/fll_file/c/file.h +++ b/level_2/fll_file/c/file.h @@ -46,7 +46,7 @@ extern "C" { * F_false if no error message was printed. */ #ifndef _di_fll_file_error_print_ - extern f_return_status fll_file_error_print(FILE *file, const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status); + extern f_return_status fll_file_error_print(FILE *file, const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status); #endif // _di_fll_file_error_print_ #ifdef __cplusplus diff --git a/level_2/fll_fss/c/fss.c b/level_2/fll_fss/c/fss.c index e7b118a..ceda1ce 100644 --- a/level_2/fll_fss/c/fss.c +++ b/level_2/fll_fss/c/fss.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fll_fss_identify_ - f_return_status fll_fss_identify(const f_string_static buffer, f_fss_header *header) { + f_return_status fll_fss_identify(const f_string_static_t buffer, f_fss_header_t *header) { #ifndef _di_level_2_parameter_checking_ if (header == 0) return F_status_set_error(F_parameter); if (buffer.used == 0) return F_status_set_error(F_parameter); @@ -17,7 +17,7 @@ extern "C" { #endif // _di_fll_fss_identify_ #ifndef _di_fll_fss_identify_file_ - f_return_status fll_fss_identify_file(f_file *file, f_fss_header *header) { + f_return_status fll_fss_identify_file(f_file_t *file, f_fss_header_t *header) { #ifndef _di_level_2_parameter_checking_ if (file == 0) return F_status_set_error(F_parameter); if (header == 0) return F_status_set_error(F_parameter); @@ -26,16 +26,16 @@ extern "C" { #endif // _di_level_2_parameter_checking_ { - f_string_length seeked = 0; + f_string_length_t seeked = 0; if (F_status_is_error(f_file_seek(file->id, SEEK_SET, 0, &seeked))) { return F_status_set_error(F_file_seek); } } - f_status status = F_none; - f_string_dynamic buffer = f_string_dynamic_initialize; + f_status_t status = F_none; + f_string_dynamic_t buffer = f_string_dynamic_t_initialize; - f_macro_string_dynamic_resize(status, buffer, f_fss_max_header_length + 1); + f_macro_string_dynamic_t_resize(status, buffer, f_fss_max_header_length + 1); if (F_status_is_error(status)) return status; status = f_file_read_until(*file, &buffer, f_fss_max_header_length + 1); @@ -46,7 +46,7 @@ extern "C" { #endif // _di_fll_fss_identify_file_ #ifndef _di_fll_fss_snatch_ - f_return_status fll_fss_snatch(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamic *values[], f_array_length *indexs[]) { + f_return_status 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[]) { #ifndef _di_level_2_parameter_checking_ if (size == 0) return F_status_set_error(F_parameter); if (objects.used != contents.used) return F_status_set_error(F_parameter); @@ -57,12 +57,12 @@ extern "C" { if (objects.used == 0) return F_data_not; if (contents.used == 0) return F_data_not; - f_status status = F_none; - f_string_length length_object = 0; + f_status_t status = F_none; + f_string_length_t length_object = 0; - f_array_length i = 0; - f_array_length j = 0; - f_array_length k = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; bool matched[size]; @@ -97,7 +97,7 @@ extern "C" { #endif // _di_fll_fss_snatch_ #ifndef _di_fll_fss_snatch_apart_ - f_return_status fll_fss_snatch_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamics *values[], f_array_lengths *indexs[]) { + f_return_status 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[]) { #ifndef _di_level_2_parameter_checking_ if (size == 0) return F_status_set_error(F_parameter); if (objects.used != contents.used) return F_status_set_error(F_parameter); @@ -108,14 +108,14 @@ extern "C" { if (objects.used == 0) return F_data_not; if (contents.used == 0) return F_data_not; - f_status status = F_none; - f_string_length length_object = 0; - f_string_dynamics *value = 0; - f_fss_content *content = 0; + f_status_t status = F_none; + f_string_length_t length_object = 0; + f_string_dynamics_t *value = 0; + f_fss_content_t *content = 0; - f_array_length i = 0; - f_array_length j = 0; - f_array_length k = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; for (; i < objects.used; i++) { length_object = (objects.array[i].stop - objects.array[i].start) + 1; @@ -130,7 +130,7 @@ extern "C" { content = &contents.array[i]; if (values[j]->used + contents.array[i].used > values[j]->size) { - if (values[j]->used + contents.array[i].used > f_array_length_size) { + if (values[j]->used + contents.array[i].used > f_array_length_t_size) { return F_status_set_error(F_buffer_too_large); } @@ -138,7 +138,7 @@ extern "C" { if (F_status_is_error(status)) return status; if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), (indexs[j]->used + content->used)); + f_macro_array_lengths_t_resize(status, (*indexs[j]), (indexs[j]->used + content->used)); if (F_status_is_error(status)) return status; } } @@ -162,7 +162,7 @@ extern "C" { #endif // _di_fll_fss_snatch_apart_ #ifndef _di_fll_fss_snatch_map_ - f_return_status fll_fss_snatch_map(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_maps *values[], f_array_lengths *indexs[]) { + f_return_status 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[]) { #ifndef _di_level_2_parameter_checking_ if (size == 0) return F_status_set_error(F_parameter); if (objects.used != contents.used) return F_status_set_error(F_parameter); @@ -173,17 +173,17 @@ extern "C" { if (objects.used == 0) return F_data_not; if (contents.used == 0) return F_data_not; - f_status status = F_none; - f_string_length length_name = 0; - f_string_dynamic name = f_string_dynamic_initialize; + f_status_t status = F_none; + f_string_length_t length_name = 0; + f_string_dynamic_t name = f_string_dynamic_t_initialize; - f_array_length i = 0; - f_array_length j = 0; - f_array_length k = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; bool matched = F_false; - f_string_map *map = 0; + f_string_map_t *map = 0; for (; i < objects.used; i++) { if (!contents.array[i].used) continue; @@ -198,7 +198,7 @@ extern "C" { status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -209,14 +209,14 @@ extern "C" { status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } if (status == F_equal_to) { matched = F_true; - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); break; } } // for @@ -227,32 +227,32 @@ extern "C" { } if (values[j]->used == values[j]->size) { - if (values[j]->used + f_fss_default_allocation_step > f_array_length_size) { - if (values[j]->used == f_array_length_size) { - f_macro_string_dynamic_delete_simple(name); + if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { + if (values[j]->used == f_array_length_t_size) { + f_macro_string_dynamic_t_delete_simple(name); return F_status_set_error(F_buffer_too_large); } - f_macro_string_maps_resize(status, (*values[j]), values[j]->used + 1); + f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + 1); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + 1); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + 1); if (F_status_is_error(status)) return status; } } else { - f_macro_string_maps_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); + f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; } } @@ -263,7 +263,7 @@ extern "C" { if (contents.array[i].used > 1) { status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[1], &map->value); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } } @@ -279,17 +279,17 @@ extern "C" { indexs[j]->used++; } - f_macro_string_dynamic_clear(name); + f_macro_string_dynamic_t_clear(name); } // for } // for - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return F_none; } #endif // _di_fll_fss_snatch_map_ #ifndef _di_fll_fss_snatch_map_apart_ - f_return_status fll_fss_snatch_map_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_map_multis *values[], f_array_lengths *indexs[]) { + f_return_status 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[]) { #ifndef _di_level_2_parameter_checking_ if (size == 0) return F_status_set_error(F_parameter); if (objects.used != contents.used) return F_status_set_error(F_parameter); @@ -300,14 +300,14 @@ extern "C" { if (objects.used == 0) return F_data_not; if (contents.used == 0) return F_data_not; - f_status status = F_none; - f_string_length length_object = 0; + f_status_t status = F_none; + f_string_length_t length_object = 0; - f_array_length i = 0; - f_array_length j = 0; - f_array_length k = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; - f_string_map_multi *map_multi = 0; + f_string_map_multi_t *map_multi = 0; for (; i < objects.used; i++) { if (!contents.array[i].used) continue; @@ -321,25 +321,25 @@ extern "C" { if (status == F_equal_to_not) continue; if (values[j]->used == values[j]->size) { - if (values[j]->used + f_fss_default_allocation_step > f_array_length_size) { - if (values[j]->used == f_array_length_size) { + if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { + if (values[j]->used == f_array_length_t_size) { return F_status_set_error(F_buffer_too_large); } - f_macro_string_map_multis_resize(status, (*values[j]), values[j]->used + 1); + f_macro_string_map_multis_t_resize(status, (*values[j]), values[j]->used + 1); if (F_status_is_error(status)) return status; if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + 1); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + 1); if (F_status_is_error(status)) return status; } } else { - f_macro_string_map_multis_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); + f_macro_string_map_multis_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; } } @@ -359,7 +359,7 @@ extern "C" { if (contents.array[i].used > 1) { if (map_multi->value.used + contents.array[i].used - 1 > map_multi->value.size) { - if (map_multi->value.used + contents.array[i].used - 1 > f_array_length_size) return F_status_set_error(F_buffer_too_large); + if (map_multi->value.used + contents.array[i].used - 1 > f_array_length_t_size) return F_status_set_error(F_buffer_too_large); f_macro_string_dynamics_resize(status, map_multi->value, map_multi->value.used + contents.array[i].used - 1); if (F_status_is_error(status)) return status; @@ -380,7 +380,7 @@ extern "C" { #endif // _di_fll_fss_snatch_map_apart_ #ifndef _di_fll_fss_snatch_map_mash_ - f_return_status fll_fss_snatch_map_mash(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_maps *values[], f_array_lengths *indexs[]) { + f_return_status 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[]) { #ifndef _di_level_2_parameter_checking_ if (size == 0) return F_status_set_error(F_parameter); if (objects.used != contents.used) return F_status_set_error(F_parameter); @@ -391,14 +391,14 @@ extern "C" { if (objects.used == 0) return F_data_not; if (contents.used == 0) return F_data_not; - f_status status = F_none; - f_string_length length_object = 0; + f_status_t status = F_none; + f_string_length_t length_object = 0; - f_array_length i = 0; - f_array_length j = 0; - f_array_length k = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; - f_string_map *map = 0; + f_string_map_t *map = 0; for (; i < objects.used; i++) { if (!contents.array[i].used) continue; @@ -412,25 +412,25 @@ extern "C" { if (status == F_equal_to_not) continue; if (values[j]->used == values[j]->size) { - if (values[j]->used + f_fss_default_allocation_step > f_array_length_size) { - if (values[j]->used == f_array_length_size) { + if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { + if (values[j]->used == f_array_length_t_size) { return F_status_set_error(F_buffer_too_large); } - f_macro_string_maps_resize(status, (*values[j]), values[j]->used + 1); + f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + 1); if (F_status_is_error(status)) return status; if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + 1); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + 1); if (F_status_is_error(status)) return status; } } else { - f_macro_string_maps_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); + f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; } } @@ -462,7 +462,7 @@ extern "C" { #endif // _di_fll_fss_snatch_map_mash_ #ifndef _di_fll_fss_snatch_map_mash_apart_ - f_return_status fll_fss_snatch_map_mash_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_map_multis *values[], f_array_lengths *indexs[]) { + f_return_status 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[]) { #ifndef _di_level_2_parameter_checking_ if (size == 0) return F_status_set_error(F_parameter); if (objects.used != contents.used) return F_status_set_error(F_parameter); @@ -473,17 +473,17 @@ extern "C" { if (objects.used == 0) return F_data_not; if (contents.used == 0) return F_data_not; - f_status status = F_none; - f_string_length length_name = 0; - f_string_dynamic name = f_string_dynamic_initialize; + f_status_t status = F_none; + f_string_length_t length_name = 0; + f_string_dynamic_t name = f_string_dynamic_t_initialize; - f_array_length i = 0; - f_array_length j = 0; - f_array_length k = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; bool matched = F_false; - f_string_map_multi *map_multi = 0; + f_string_map_multi_t *map_multi = 0; for (; i < objects.used; i++) { if (!contents.array[i].used) continue; @@ -498,7 +498,7 @@ extern "C" { status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -509,7 +509,7 @@ extern "C" { status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -528,25 +528,25 @@ extern "C" { } else { if (values[j]->used == values[j]->size) { - if (values[j]->used + f_fss_default_allocation_step > f_array_length_size) { - if (values[j]->used == f_array_length_size) { + if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { + if (values[j]->used == f_array_length_t_size) { return F_status_set_error(F_buffer_too_large); } - f_macro_string_map_multis_resize(status, (*values[j]), values[j]->used + 1); + f_macro_string_map_multis_t_resize(status, (*values[j]), values[j]->used + 1); if (F_status_is_error(status)) return status; if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + 1); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + 1); if (F_status_is_error(status)) return status; } } else { - f_macro_string_map_multis_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); + f_macro_string_map_multis_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; } } @@ -564,13 +564,13 @@ extern "C" { indexs[j]->used++; } - f_macro_string_dynamic_clear(name); + f_macro_string_dynamic_t_clear(name); if (contents.array[i].used == 1) continue; } if (map_multi->value.used == map_multi->value.size) { - if (map_multi->value.used == f_array_length_size) { + if (map_multi->value.used == f_array_length_t_size) { return F_status_set_error(F_buffer_too_large); } @@ -587,13 +587,13 @@ extern "C" { } // for } // for - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return F_none; } #endif // _di_fll_fss_snatch_map_mash_apart_ #ifndef _di_fll_fss_snatch_map_together_ - f_return_status fll_fss_snatch_map_together(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_maps *values[], f_array_lengths *indexs[]) { + f_return_status 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[]) { #ifndef _di_level_2_parameter_checking_ if (size == 0) return F_status_set_error(F_parameter); if (objects.used != contents.used) return F_status_set_error(F_parameter); @@ -604,17 +604,17 @@ extern "C" { if (objects.used == 0) return F_data_not; if (contents.used == 0) return F_data_not; - f_status status = F_none; - f_string_length length_name = 0; - f_string_dynamic name = f_string_dynamic_initialize; + f_status_t status = F_none; + f_string_length_t length_name = 0; + f_string_dynamic_t name = f_string_dynamic_t_initialize; - f_array_length i = 0; - f_array_length j = 0; - f_array_length k = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; bool matched = F_false; - f_string_map *map = 0; + f_string_map_t *map = 0; for (; i < objects.used; i++) { if (!contents.array[i].used) continue; @@ -629,7 +629,7 @@ extern "C" { status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -640,14 +640,14 @@ extern "C" { status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } if (status == F_equal_to) { matched = F_true; - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); break; } } // for @@ -659,32 +659,32 @@ extern "C" { } else { if (values[j]->used == values[j]->size) { - if (values[j]->used + f_fss_default_allocation_step > f_array_length_size) { - if (values[j]->used == f_array_length_size) { - f_macro_string_dynamic_delete_simple(name); + if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { + if (values[j]->used == f_array_length_t_size) { + f_macro_string_dynamic_t_delete_simple(name); return F_status_set_error(F_buffer_too_large); } - f_macro_string_maps_resize(status, (*values[j]), values[j]->used + 1); + f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + 1); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + 1); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + 1); if (F_status_is_error(status)) return status; } } else { - f_macro_string_maps_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); + f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; } } @@ -703,26 +703,26 @@ extern "C" { indexs[j]->used++; } - f_macro_string_dynamic_clear(name); + f_macro_string_dynamic_t_clear(name); } if (contents.array[i].used > 1) { status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[1], &map->value); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } } } // for } // for - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return F_none; } #endif // _di_fll_fss_snatch_map_together_ #ifndef _di_fll_fss_snatch_mash_ - f_return_status fll_fss_snatch_mash(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[], f_array_length *indexs[]) { + f_return_status 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[]) { #ifndef _di_level_2_parameter_checking_ if (size == 0) return F_status_set_error(F_parameter); if (objects.used != contents.used) return F_status_set_error(F_parameter); @@ -733,12 +733,12 @@ extern "C" { if (objects.used == 0) return F_data_not; if (contents.used == 0) return F_data_not; - f_status status = F_none; - f_string_length length_object = 0; + f_status_t status = F_none; + f_string_length_t length_object = 0; - f_array_length i = 0; - f_array_length j = 0; - f_array_length k = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; bool matched[size]; @@ -773,7 +773,7 @@ extern "C" { #endif // _di_fll_fss_snatch_mash_ #ifndef _di_fll_fss_snatch_mash_apart_ - f_return_status fll_fss_snatch_mash_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamics *values[], f_array_lengths *indexs[]) { + f_return_status 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[]) { #ifndef _di_level_2_parameter_checking_ if (size == 0) return F_status_set_error(F_parameter); if (objects.used != contents.used) return F_status_set_error(F_parameter); @@ -784,12 +784,12 @@ extern "C" { if (objects.used == 0) return F_data_not; if (contents.used == 0) return F_data_not; - f_status status = F_none; - f_string_length length_object = 0; + f_status_t status = F_none; + f_string_length_t length_object = 0; - f_array_length i = 0; - f_array_length j = 0; - f_array_length k = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; for (; i < objects.used; i++) { length_object = (objects.array[i].stop - objects.array[i].start) + 1; @@ -801,8 +801,8 @@ extern "C" { if (status == F_equal_to_not) continue; if (values[j]->used == values[j]->size) { - if (values[j]->used + f_fss_default_allocation_step > f_array_length_size) { - if (values[j]->used == f_array_length_size) { + if (values[j]->used + f_fss_default_allocation_step > f_array_length_t_size) { + if (values[j]->used == f_array_length_t_size) { return F_status_set_error(F_buffer_too_large); } @@ -810,7 +810,7 @@ extern "C" { if (F_status_is_error(status)) return status; if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + 1); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + 1); if (F_status_is_error(status)) return status; } } @@ -819,7 +819,7 @@ extern "C" { if (F_status_is_error(status)) return status; if (indexs) { - f_macro_array_lengths_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); + f_macro_array_lengths_t_resize(status, (*indexs[j]), indexs[j]->used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; } } @@ -844,7 +844,7 @@ extern "C" { #endif // _di_fll_fss_snatch_mash_apart_ #ifndef _di_fll_fss_snatch_together_ - f_return_status fll_fss_snatch_together(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[], f_array_length *indexs[]) { + f_return_status 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[]) { #ifndef _di_level_2_parameter_checking_ if (size == 0) return F_status_set_error(F_parameter); if (objects.used != contents.used) return F_status_set_error(F_parameter); @@ -855,12 +855,12 @@ extern "C" { if (objects.used == 0) return F_data_not; if (contents.used == 0) return F_data_not; - f_status status = F_none; - f_string_length length_object = 0; + f_status_t status = F_none; + f_string_length_t length_object = 0; - f_array_length i = 0; - f_array_length j = 0; - f_array_length k = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; for (; i < objects.used; i++) { length_object = (objects.array[i].stop - objects.array[i].start) + 1; diff --git a/level_2/fll_fss/c/fss.h b/level_2/fll_fss/c/fss.h index ea3cd87..44a9915 100644 --- a/level_2/fll_fss/c/fss.h +++ b/level_2/fll_fss/c/fss.h @@ -48,7 +48,7 @@ extern "C" { * Errors from (with error bit): fl_conversion_string_to_hexidecimal_unsigned(). */ #ifndef _di_fll_fss_identify_ - extern f_return_status fll_fss_identify(const f_string_static buffer, f_fss_header *header); + extern f_return_status fll_fss_identify(const f_string_static_t buffer, f_fss_header_t *header); #endif // _di_fll_fss_identify_ /** @@ -74,7 +74,7 @@ extern "C" { * @see f_file_read_until() */ #ifndef _di_fll_fss_identify_file_ - extern f_return_status fll_fss_identify_file(f_file *file, f_fss_header *header); + extern f_return_status fll_fss_identify_file(f_file_t *file, f_fss_header_t *header); #endif // _di_fll_fss_identify_file_ /** @@ -118,7 +118,7 @@ extern "C" { * @see fl_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_ - extern f_return_status fll_fss_snatch(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamic *values[], f_array_length *indexs[]); + extern f_return_status 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[]); #endif // _di_fll_fss_snatch_ /** @@ -164,7 +164,7 @@ extern "C" { * @see fl_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_apart_ - extern f_return_status fll_fss_snatch_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_dynamics *values[], f_array_lengths *indexs[]); + extern f_return_status 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[]); #endif // _di_fll_fss_snatch_apart_ /** @@ -212,7 +212,7 @@ extern "C" { * @see fl_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_map_ - extern f_return_status fll_fss_snatch_map(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_maps *values[], f_array_lengths *indexs[]); + extern f_return_status 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[]); #endif // _di_fll_fss_snatch_map_ /** @@ -262,7 +262,7 @@ extern "C" { * @see fl_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_map_apart_ - extern f_return_status fll_fss_snatch_map_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, f_string_map_multis *values[], f_array_lengths *indexs[]); + extern f_return_status 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[]); #endif // _di_fll_fss_snatch_map_apart_ /** @@ -312,7 +312,7 @@ extern "C" { * Errors from (with error bit): fl_string_dynamic_partial_mash_nulless(). */ #ifndef _di_fll_fss_snatch_map_mash_ - extern f_return_status fll_fss_snatch_map_mash(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_maps *values[], f_array_lengths *indexs[]); + extern f_return_status 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[]); #endif // _di_fll_fss_snatch_map_mash_ /** @@ -366,7 +366,7 @@ extern "C" { * @see fl_string_dynamic_partial_mash_nulless() */ #ifndef _di_fll_fss_snatch_map_mash_apart_ - extern f_return_status fll_fss_snatch_map_mash_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_map_multis *values[], f_array_lengths *indexs[]); + extern f_return_status 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[]); #endif // _di_fll_fss_snatch_map_mash_apart_ /** @@ -419,7 +419,7 @@ extern "C" { * @see fl_string_dynamic_partial_mash_nulless() */ #ifndef _di_fll_fss_snatch_map_together_ - extern f_return_status fll_fss_snatch_map_together(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_maps *values[], f_array_lengths *indexs[]); + extern f_return_status 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[]); #endif // _di_fll_fss_snatch_map_together_ /** @@ -466,7 +466,7 @@ extern "C" { * Errors from (with error bit): fl_string_dynamic_partial_mash_nulless(). */ #ifndef _di_fll_fss_snatch_mash_ - extern f_return_status fll_fss_snatch_mash(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[], f_array_length *indexs[]); + extern f_return_status 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[]); #endif // _di_fll_fss_snatch_mash_ /** @@ -517,7 +517,7 @@ extern "C" { * @see fl_string_dynamic_partial_mash_nulless() */ #ifndef _di_fll_fss_snatch_mash_apart_ - extern f_return_status fll_fss_snatch_mash_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamics *values[], f_array_lengths *indexs[]); + extern f_return_status 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[]); #endif // _di_fll_fss_snatch_mash_apart_ /** @@ -561,7 +561,7 @@ extern "C" { * @see fl_string_dynamic_partial_append_nulless() */ #ifndef _di_fll_fss_snatch_together_ - extern f_return_status fll_fss_snatch_together(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], const f_string_length size, const f_string glue, const f_string_length glue_length, f_string_dynamic *values[], f_array_length *indexs[]); + extern f_return_status 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[]); #endif // _di_fll_fss_snatch_together_ #ifdef __cplusplus diff --git a/level_2/fll_fss/c/fss_basic.c b/level_2/fll_fss/c/fss_basic.c index 96fa82f..41842e2 100644 --- a/level_2/fll_fss/c/fss_basic.c +++ b/level_2/fll_fss/c/fss_basic.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fll_fss_basic_read_ - f_return_status fll_fss_basic_read(f_string_dynamic *buffer, f_string_range *range, f_fss_objects *objects, f_fss_contents *contents, f_fss_quoteds *quoted_objects) { + f_return_status fll_fss_basic_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quoteds_t *quoted_objects) { #ifndef _di_level_2_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (range == 0) return F_status_set_error(F_parameter); @@ -13,24 +13,24 @@ extern "C" { if (contents == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = F_none; - f_status status2 = F_none; - f_string_length initial_used = objects->used; + f_status_t status = F_none; + f_status_t status2 = F_none; + f_string_length_t initial_used = objects->used; bool found_data = F_false; - f_fss_quoted *quoted_object = 0; + f_fss_quoted_t *quoted_object = 0; do { if (objects->used == objects->size) { - f_macro_fss_objects_resize(status2, (*objects), objects->used + f_fss_default_allocation_step); + f_macro_fss_objects_t_resize(status2, (*objects), objects->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; - f_macro_fss_contents_resize(status2, (*contents), contents->used + f_fss_default_allocation_step); + f_macro_fss_contents_t_resize(status2, (*contents), contents->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; if (quoted_objects) { - f_macro_fss_quoteds_resize(status2, (*quoted_objects), quoted_objects->used + f_fss_default_allocation_step); + f_macro_fss_quoteds_t_resize(status2, (*quoted_objects), quoted_objects->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } } @@ -55,7 +55,7 @@ extern "C" { } if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } @@ -92,7 +92,7 @@ extern "C" { found_data = F_true; if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } @@ -148,22 +148,22 @@ extern "C" { if (quoted_objects) { quoted_objects->used++; } - } while (range->start < f_string_length_size); + } while (range->start < f_string_length_t_size); return F_status_is_error(F_number_overflow); } #endif // _di_fll_fss_basic_read_ #ifndef _di_fll_fss_basic_write_ - f_return_status fll_fss_basic_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *destination) { + f_return_status fll_fss_basic_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *destination) { #ifndef _di_level_2_parameter_checking_ if (destination == 0) return F_status_set_error(F_parameter); if (contents.used > contents.size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = 0; - f_array_length current = 0; - f_string_range range = f_macro_string_range_initialize(object.used); + f_status_t status = 0; + f_array_length_t current = 0; + f_string_range_t range = f_macro_string_range_initialize(object.used); status = fl_fss_basic_object_write(object, 0, &range, destination); diff --git a/level_2/fll_fss/c/fss_basic.h b/level_2/fll_fss/c/fss_basic.h index 0a2e33d..349b507 100644 --- a/level_2/fll_fss/c/fss_basic.h +++ b/level_2/fll_fss/c/fss_basic.h @@ -58,7 +58,7 @@ extern "C" { * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. */ #ifndef _di_fll_fss_basic_read_ - extern f_return_status fll_fss_basic_read(f_string_dynamic *buffer, f_string_range *range, f_fss_objects *objects, f_fss_contents *contents, f_fss_quoteds *quoted_objects); + extern f_return_status fll_fss_basic_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quoteds_t *quoted_objects); #endif // _di_fll_fss_basic_read_ /** @@ -83,7 +83,7 @@ extern "C" { * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. */ #ifndef _di_fll_fss_basic_write_ - extern f_return_status fll_fss_basic_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer); + extern f_return_status fll_fss_basic_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer); #endif // _di_fll_fss_basic_write_ #ifdef __cplusplus diff --git a/level_2/fll_fss/c/fss_basic_list.c b/level_2/fll_fss/c/fss_basic_list.c index 9835ba9..6c19c7d 100644 --- a/level_2/fll_fss/c/fss_basic_list.c +++ b/level_2/fll_fss/c/fss_basic_list.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fll_fss_basic_list_read_ - f_return_status fll_fss_basic_list_read(f_string_dynamic *buffer, f_string_range *range, f_fss_objects *objects, f_fss_contents *contents) { + f_return_status fll_fss_basic_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents) { #ifndef _di_level_2_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (range == 0) return F_status_set_error(F_parameter); @@ -13,20 +13,20 @@ extern "C" { if (contents == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = F_none; - f_status status2 = F_none; - f_string_length initial_used = objects->used; + f_status_t status = F_none; + f_status_t status2 = F_none; + f_string_length_t initial_used = objects->used; bool found_data = F_false; do { if (objects->used == objects->size) { - f_macro_fss_objects_resize(status2, (*objects), objects->used + f_fss_default_allocation_step); + f_macro_fss_objects_t_resize(status2, (*objects), objects->used + f_fss_default_allocation_step); if (F_status_is_error(status)) { return status; } - f_macro_fss_contents_resize(status2, (*contents), contents->used + f_fss_default_allocation_step); + f_macro_fss_contents_t_resize(status2, (*contents), contents->used + f_fss_default_allocation_step); if (F_status_is_error(status)) { return status; @@ -45,7 +45,7 @@ extern "C" { objects->used++; if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } @@ -84,7 +84,7 @@ extern "C" { found_data = F_true; if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } @@ -127,22 +127,22 @@ extern "C" { objects->used++; contents->used++; - } while (range->start < f_string_length_size); + } while (range->start < f_string_length_t_size); return F_status_is_error(F_number_overflow); } #endif // _di_fll_fss_basic_list_read_ #ifndef _di_fll_fss_basic_list_write_ - f_return_status fll_fss_basic_list_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer) { + f_return_status fll_fss_basic_list_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer) { #ifndef _di_level_2_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (contents.used > contents.size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = 0; - f_array_length current = 0; - f_string_range range = f_string_range_initialize; + f_status_t status = 0; + f_array_length_t current = 0; + f_string_range_t range = f_string_range_initialize; range.start = 0; range.stop = object.used - 1; diff --git a/level_2/fll_fss/c/fss_basic_list.h b/level_2/fll_fss/c/fss_basic_list.h index 5db758c..23bf659 100644 --- a/level_2/fll_fss/c/fss_basic_list.h +++ b/level_2/fll_fss/c/fss_basic_list.h @@ -54,7 +54,7 @@ extern "C" { * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. */ #ifndef _di_fll_fss_basic_list_read_ - extern f_return_status fll_fss_basic_list_read(f_string_dynamic *buffer, f_string_range *range, f_fss_objects *objects, f_fss_contents *contents); + extern f_return_status fll_fss_basic_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents); #endif // _di_fll_fss_basic_list_read_ /** @@ -79,7 +79,7 @@ extern "C" { * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. */ #ifndef _di_fll_fss_basic_list_write_ - extern f_return_status fll_fss_basic_list_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer); + extern f_return_status fll_fss_basic_list_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer); #endif // _di_fll_fss_basic_list_write_ #ifdef __cplusplus diff --git a/level_2/fll_fss/c/fss_extended.c b/level_2/fll_fss/c/fss_extended.c index 3bd1aa0..7362b69 100644 --- a/level_2/fll_fss/c/fss_extended.c +++ b/level_2/fll_fss/c/fss_extended.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fll_fss_extended_read_ - f_return_status fll_fss_extended_read(f_string_dynamic *buffer, f_string_range *range, f_fss_objects *objects, f_fss_contents *contents, f_fss_quoteds *quoted_objects, f_fss_quotedss *quoted_contents) { + f_return_status fll_fss_extended_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quoteds_t *quoted_objects, f_fss_quotedss_t *quoted_contents) { #ifndef _di_level_2_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (range == 0) return F_status_set_error(F_parameter); @@ -13,30 +13,30 @@ extern "C" { if (contents == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = F_none; - f_status status2 = F_none; - f_string_length initial_used = objects->used; + f_status_t status = F_none; + f_status_t status2 = F_none; + f_string_length_t initial_used = objects->used; bool found_data = F_false; - f_fss_quoted *quoted_object = 0; - f_fss_quoteds *quoted_content = 0; + f_fss_quoted_t *quoted_object = 0; + f_fss_quoteds_t *quoted_content = 0; do { if (objects->used == objects->size) { - f_macro_fss_objects_resize(status2, (*objects), objects->used + f_fss_default_allocation_step); + f_macro_fss_objects_t_resize(status2, (*objects), objects->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; - f_macro_fss_contents_resize(status2, (*contents), contents->used + f_fss_default_allocation_step); + f_macro_fss_contents_t_resize(status2, (*contents), contents->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; if (quoted_objects) { - f_macro_fss_quoteds_resize(status2, (*quoted_objects), quoted_objects->used + f_fss_default_allocation_step); + f_macro_fss_quoteds_t_resize(status2, (*quoted_objects), quoted_objects->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } if (quoted_contents) { - f_macro_fss_quotedss_resize(status2, (*quoted_contents), quoted_contents->used + f_fss_default_allocation_step); + f_macro_fss_quotedss_t_resize(status2, (*quoted_contents), quoted_contents->used + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } } @@ -61,7 +61,7 @@ extern "C" { } if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } @@ -109,7 +109,7 @@ extern "C" { found_data = F_true; if (contents->array[contents->used].used == contents->array[contents->used].size) { - f_macro_fss_content_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); + f_macro_fss_content_t_resize(status2, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } @@ -184,22 +184,22 @@ extern "C" { if (quoted_contents) { quoted_contents->used++; } - } while (range->start < f_string_length_size); + } while (range->start < f_string_length_t_size); return F_status_is_error(F_number_overflow); } #endif // _di_fll_fss_extended_read_ #ifndef _di_fll_fss_extended_write_ - f_return_status fll_fss_extended_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer) { + f_return_status fll_fss_extended_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer) { #ifndef _di_level_2_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (contents.used > contents.size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = 0; - f_array_length current = 0; - f_string_range range = f_macro_string_range_initialize(object.used); + f_status_t status = 0; + f_array_length_t current = 0; + f_string_range_t range = f_macro_string_range_initialize(object.used); status = fl_fss_extended_object_write(object, 0, &range, buffer); diff --git a/level_2/fll_fss/c/fss_extended.h b/level_2/fll_fss/c/fss_extended.h index b36bb02..df507ff 100644 --- a/level_2/fll_fss/c/fss_extended.h +++ b/level_2/fll_fss/c/fss_extended.h @@ -59,7 +59,7 @@ extern "C" { * F_number_overflow (with error bit) if the maximimum buffer size is reached. */ #ifndef _di_fll_fss_extended_read_ - extern f_return_status fll_fss_extended_read(f_string_dynamic *buffer, f_string_range *range, f_fss_objects *objects, f_fss_contents *contents, f_fss_quoteds *quoted_objects, f_fss_quotedss *quoted_contents); + extern f_return_status fll_fss_extended_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quoteds_t *quoted_objects, f_fss_quotedss_t *quoted_contents); #endif // _di_fll_fss_extended_read_ /** @@ -84,7 +84,7 @@ extern "C" { * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. */ #ifndef _di_fll_fss_extended_write_ - extern f_return_status fll_fss_extended_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer); + extern f_return_status fll_fss_extended_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer); #endif // _di_fll_fss_extended_write_ #ifdef __cplusplus diff --git a/level_2/fll_fss/c/fss_extended_list.c b/level_2/fll_fss/c/fss_extended_list.c index e5cf709..e5c9fdd 100644 --- a/level_2/fll_fss/c/fss_extended_list.c +++ b/level_2/fll_fss/c/fss_extended_list.c @@ -5,20 +5,20 @@ extern "C" { #endif #ifndef _di_fll_fss_extended_list_read_ - f_return_status fll_fss_extended_list_read(f_string_dynamic *buffer, f_string_range *range, f_fss_nest *nest) { + f_return_status fll_fss_extended_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_nest_t *nest) { #ifndef _di_level_3_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (range == 0) return F_status_set_error(F_parameter); if (nest == 0) return F_status_set_error(F_parameter); #endif // _di_level_3_parameter_checking_ - f_status status = F_none; - f_status status2 = F_none; - f_string_length initial_used = 0; + f_status_t status = F_none; + f_status_t status2 = F_none; + f_string_length_t initial_used = 0; bool found_data = F_false; if (nest->used == 0) { - f_macro_fss_nest_resize(status2, (*nest), f_fss_default_allocation_step); + f_macro_fss_nest_t_resize(status2, (*nest), f_fss_default_allocation_step); if (F_status_is_error(status2)) return status2; } else { @@ -28,7 +28,7 @@ extern "C" { do { do { if (nest->depth[0].used == nest->depth[0].size) { - f_macro_fss_items_resize(status2, nest->depth[0], nest->depth[0].used + f_fss_default_allocation_step); + f_macro_fss_items_t_resize(status2, nest->depth[0], nest->depth[0].used + f_fss_default_allocation_step); if (F_status_is_error(status)) return status; } @@ -101,7 +101,7 @@ extern "C" { return F_none_stop; } - } while (range->start < f_string_length_size); + } while (range->start < f_string_length_t_size); return F_status_is_error(F_number_overflow); } @@ -109,15 +109,15 @@ extern "C" { /* #ifndef _di_fll_fss_extended_list_write_ - f_return_status fll_fss_extended_list_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer) { + f_return_status fll_fss_extended_list_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer) { #ifndef _di_level_3_parameter_checking_ if (buffer == 0) return F_status_set_error(F_parameter); if (contents.used > contents.size) return F_status_set_error(F_parameter); #endif // _di_level_3_parameter_checking_ - f_status status = 0; - f_array_length current = 0; - f_string_range range = f_string_range_initialize; + f_status_t status = 0; + f_array_length_t current = 0; + f_string_range_t range = f_string_range_initialize; range.start = 0; range.stop = object.used - 1; diff --git a/level_2/fll_fss/c/fss_extended_list.h b/level_2/fll_fss/c/fss_extended_list.h index d8eac5c..7ce6167 100644 --- a/level_2/fll_fss/c/fss_extended_list.h +++ b/level_2/fll_fss/c/fss_extended_list.h @@ -58,7 +58,7 @@ extern "C" { * FL_fss_found_object_content_not on success and object was found but no content was found (start location is at end of object). */ #ifndef _di_fll_fss_extended_list_read_ - extern f_return_status fll_fss_extended_list_read(f_string_dynamic *buffer, f_string_range *range, f_fss_nest *nest); + extern f_return_status fll_fss_extended_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_nest_t *nest); #endif // _di_fll_fss_extended_list_read_ /** @@ -83,7 +83,7 @@ extern "C" { * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. */ #ifndef _di_fll_fss_extended_list_write_ - //extern f_return_status fll_fss_extended_list_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer); + //extern f_return_status fll_fss_extended_list_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer); #endif // _di_fll_fss_extended_list_write_ #ifdef __cplusplus diff --git a/level_2/fll_fss/c/fss_status.c b/level_2/fll_fss/c/fss_status.c index 1339fb7..e1ae5e4 100644 --- a/level_2/fll_fss/c/fss_status.c +++ b/level_2/fll_fss/c/fss_status.c @@ -5,13 +5,13 @@ extern "C" { #endif #ifndef _di_fll_fss_status_from_string_ - f_return_status fll_fss_status_from_string(const f_string string, f_status *code) { + f_return_status fll_fss_status_from_string(const f_string_t string, f_status_t *code) { #ifndef _di_level_1_parameter_checking_ if (code == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; - const f_string_length length = strlen(string); + f_status_t status = F_none; + const f_string_length_t length = strlen(string); if (length == 0) { return F_data_not; @@ -109,12 +109,12 @@ extern "C" { #endif // _di_fll_fss_status_from_string_ #ifndef _di_fll_fss_status_to_string_ - f_return_status fll_fss_status_to_string(const f_status code, f_string *string) { + f_return_status fll_fss_status_to_string(const f_status_t code, f_string_t *string) { #ifndef _di_level_2_parameter_checking_ if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - const f_status unmasked_code = F_status_set_fine(code); + const f_status_t unmasked_code = F_status_set_fine(code); switch (unmasked_code) { #ifndef _di_fll_fss_status_error_ @@ -182,7 +182,7 @@ extern "C" { #endif // _di_fll_status_to_string_ #ifndef _di_fll_fss_status_is_error_ - f_return_status fll_fss_status_is_error(const f_status code) { + f_return_status fll_fss_status_is_error(const f_status_t code) { if (fll_fss_status_is_fine(code) == F_true) { return F_false; } @@ -195,7 +195,7 @@ extern "C" { #endif // _di_fll_fss_status_is_error_ #ifndef _di_fll_fss_status_is_warning_ - f_return_status fll_fss_status_is_warning(const f_status code) { + f_return_status fll_fss_status_is_warning(const f_status_t code) { switch (code) { #ifndef _di_fll_fss_status_basic_ case F_data_not: @@ -223,7 +223,7 @@ extern "C" { #endif // _di_fll_fss_status_is_warning_ #ifndef _di_fll_fss_status_is_fine_ - f_return_status fll_fss_status_is_fine(const f_status code) { + f_return_status fll_fss_status_is_fine(const f_status_t code) { switch (code) { #ifndef _di_fll_fss_status_booleans_ case F_false: diff --git a/level_2/fll_fss/c/fss_status.h b/level_2/fll_fss/c/fss_status.h index a9cc9fa..1fac9ba 100644 --- a/level_2/fll_fss/c/fss_status.h +++ b/level_2/fll_fss/c/fss_status.h @@ -103,7 +103,7 @@ extern "C" { * @see fll_status_from_string */ #ifndef _di_fll_fss_status_from_string_ - extern f_return_status fll_fss_status_from_string(const f_string string, f_status *code); + extern f_return_status fll_fss_status_from_string(const f_string_t string, f_status_t *code); #endif // _di_fll_fss_status_to_string_ /** @@ -123,7 +123,7 @@ extern "C" { * @see fl_status_to_string() */ #ifndef _di_fll_fss_status_to_string_ - extern f_return_status fll_fss_status_to_string(const f_status code, f_string *string); + extern f_return_status fll_fss_status_to_string(const f_status_t code, f_string_t *string); #endif // _di_fll_status_to_string_ /** @@ -137,7 +137,7 @@ extern "C" { * F_false otherwise. */ #ifndef _di_fll_fss_status_is_error_ - extern f_return_status fll_fss_status_is_error(const f_status code); + extern f_return_status fll_fss_status_is_error(const f_status_t code); #endif // _di_fll_fss_status_is_error_ /** @@ -151,7 +151,7 @@ extern "C" { * F_false otherwise. */ #ifndef _di_fll_fss_status_is_warning_ - extern f_return_status fll_fss_status_is_warning(const f_status code); + extern f_return_status fll_fss_status_is_warning(const f_status_t code); #endif // _di_fll_fss_status_is_warning_ /** @@ -165,7 +165,7 @@ extern "C" { * F_false otherwise. */ #ifndef _di_fll_fss_status_is_fine_ - extern f_return_status fll_fss_status_is_fine(const f_status code); + extern f_return_status fll_fss_status_is_fine(const f_status_t code); #endif // _di_fll_fss_status_is_fine_ #ifdef __cplusplus diff --git a/level_2/fll_fss/c/private-fss.c b/level_2/fll_fss/c/private-fss.c index c1ce317..d9d40f5 100644 --- a/level_2/fll_fss/c/private-fss.c +++ b/level_2/fll_fss/c/private-fss.c @@ -6,8 +6,8 @@ extern "C" { #endif #if !defined(_di_fll_fss_identify_) || !defined(_di_fll_fss_identify_file_) - f_return_status private_fll_fss_identify(const f_string_static buffer, f_fss_header *header) { - register f_string_length i = 0; + f_return_status private_fll_fss_identify(const f_string_static_t buffer, f_fss_header_t *header) { + register f_string_length_t i = 0; if (buffer.used < 10) { // "# fss-0000" is always at least 10 characters. @@ -46,13 +46,13 @@ extern "C" { if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { i++; - f_string_range range = f_string_range_initialize; + f_string_range_t range = f_string_range_initialize; range.start = i - 4; range.stop = i; // 1: A possibly valid header type was found, now convert it into its proper format and save the header type. - const f_status status = fl_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, range); + const f_status_t status = fl_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, range); if (F_status_is_error(status)) return status; if (status == F_none) { @@ -105,12 +105,12 @@ extern "C" { // @todo this needs to be changed to support sub-headers (maybe something like FL_fss_accepted_additional). i++; - f_string_range range = f_string_range_initialize; + f_string_range_t range = f_string_range_initialize; range.start = i - 4; range.stop = i; - const f_status status = fl_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, range); + const f_status_t status = fl_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, range); if (F_status_is_error(status)) return status; header->length = i + 1; diff --git a/level_2/fll_fss/c/private-fss.h b/level_2/fll_fss/c/private-fss.h index ff09249..11ed7a5 100644 --- a/level_2/fll_fss/c/private-fss.h +++ b/level_2/fll_fss/c/private-fss.h @@ -37,7 +37,7 @@ extern "C" { * @see fll_fss_identify_file() */ #if !defined(_di_fll_fss_identify_) || !defined(_di_fll_fss_identify_file_) - extern f_return_status private_fll_fss_identify(const f_string_static buffer, f_fss_header *header) f_gcc_attribute_visibility_internal; + extern f_return_status private_fll_fss_identify(const f_string_static_t buffer, f_fss_header_t *header) f_gcc_attribute_visibility_internal; #endif // !defined(_di_fll_fss_identify_) || !defined(_di_fll_fss_identify_file_) #ifdef __cplusplus diff --git a/level_2/fll_path/c/path.c b/level_2/fll_path/c/path.c index 1e3fd97..040b462 100644 --- a/level_2/fll_path/c/path.c +++ b/level_2/fll_path/c/path.c @@ -5,19 +5,19 @@ extern "C" { #endif #ifndef _di_fll_path_canonical_ - f_return_status fll_path_canonical(const f_string path, f_string_dynamic *canonical) { + f_return_status fll_path_canonical(const f_string_t path, f_string_dynamic_t *canonical) { #ifndef _di_level_2_parameter_checking_ if (canonical == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = F_none; - f_string_length at = 0; + f_status_t status = F_none; + f_string_length_t at = 0; uint8_t previous_1 = '/'; uint8_t previous_2 = 0; - f_string_length size_chunk = 0; - f_string_length position = 0; + f_string_length_t size_chunk = 0; + f_string_length_t position = 0; canonical->used = 0; diff --git a/level_2/fll_path/c/path.h b/level_2/fll_path/c/path.h index 9672772..8075515 100644 --- a/level_2/fll_path/c/path.h +++ b/level_2/fll_path/c/path.h @@ -33,7 +33,7 @@ extern "C" { * This does not check if the path exists or not. * This processes the relative parts: './', '../', and extra '/'. * This does not process symbolic links. - * This has a max size of f_string_length_size. + * This has a max size of f_string_length_t_size. * * @param path * The source path to determine what the canonical path is. @@ -47,7 +47,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fll_path_canonical_ - extern f_return_status fll_path_canonical(const f_string path, f_string_dynamic *canonical); + extern f_return_status fll_path_canonical(const f_string_t path, f_string_dynamic_t *canonical); #endif // _di_fll_path_canonical_ #ifdef __cplusplus diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index 0dbcffa..5aa6f4f 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -5,8 +5,8 @@ extern "C" { #endif #ifndef _di_fll_program_print_help_header_ - f_return_status fll_program_print_help_header(const fl_color_context context, const f_string name, const f_string version) { - f_status status = F_none; + f_return_status fll_program_print_help_header(const fl_color_context_t context, const f_string_t name, const f_string_t version) { + f_status_t status = F_none; printf("%c", f_string_eol[0]); status = fl_color_print(f_type_output, context.title, context.reset, " %s", name); @@ -25,8 +25,8 @@ extern "C" { #endif // _di_fll_program_print_help_header_ #ifndef _di_fll_program_print_help_option_ - f_return_status fll_program_print_help_option(const fl_color_context context, const f_string option_short, const f_string option_long, const f_string symbol_short, const f_string symbol_long, const f_string description) { - f_status status = F_none; + f_return_status fll_program_print_help_option(const fl_color_context_t context, const f_string_t option_short, const f_string_t option_long, const f_string_t symbol_short, const f_string_t symbol_long, const f_string_t description) { + f_status_t status = F_none; printf("%c", f_string_eol[0]); printf(" %s", symbol_short); @@ -44,8 +44,8 @@ extern "C" { #endif // _di_fll_program_print_help_option_ #ifndef _di_fll_program_print_help_option_long_ - f_return_status fll_program_print_help_option_long(const fl_color_context context, const f_string option_long, const f_string symbol_long, const f_string description) { - f_status status = F_none; + f_return_status fll_program_print_help_option_long(const fl_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description) { + f_status_t status = F_none; printf("%c", f_string_eol[0]); printf(" %s", symbol_long); @@ -59,7 +59,7 @@ extern "C" { #endif // _di_fll_program_print_help_option_long_ #ifndef _di_fll_program_print_help_option_other_ - f_return_status fll_program_print_help_option_other(const fl_color_context context, const f_string option_other, const f_string description) { + f_return_status fll_program_print_help_option_other(const fl_color_context_t context, const f_string_t option_other, const f_string_t description) { printf("%c ", f_string_eol[0]); fl_color_print(f_type_output, context.standout, context.reset, option_other); @@ -70,8 +70,8 @@ extern "C" { #endif // _di_fll_program_print_help_option_other_ #ifndef _di_fll_program_print_help_usage_ - f_return_status fll_program_print_help_usage(const fl_color_context context, const f_string name, const f_string parameters) { - f_status status = F_none; + f_return_status fll_program_print_help_usage(const fl_color_context_t context, const f_string_t name, const f_string_t parameters) { + f_status_t status = F_none; printf("%c%c", f_string_eol[0], f_string_eol[0]); status = fl_color_print(f_type_output, context.important, context.reset, " Usage:"); @@ -104,7 +104,7 @@ extern "C" { #endif // _di_fll_program_print_help_usage_ #ifndef _di_fll_program_print_version_ - f_return_status fll_program_print_version(const f_string version) { + f_return_status fll_program_print_version(const f_string_t version) { printf("%s%c", version, f_string_eol[0]); return F_none; @@ -112,8 +112,8 @@ extern "C" { #endif // _di_fll_program_print_version_ #ifndef _di_fll_program_parameter_process_ - f_return_status fll_program_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context) { - f_status status = F_none; + f_return_status fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, fl_color_context_t *context) { + f_status_t status = F_none; status = f_console_parameter_process(arguments, parameters, remaining); @@ -152,9 +152,9 @@ extern "C" { return F_status_set_error(status); } - f_console_parameter_id decision = choices.id[2]; + f_console_parameter_id_t decision = choices.id[2]; - f_string function; + f_string_t function; if (right) { function = "f_console_parameter_prioritize_right"; @@ -191,13 +191,13 @@ extern "C" { // load colors unless told not to. if (decision != choices.id[0]) { - f_status allocation_status = F_none; + f_status_t allocation_status = F_none; - fl_macro_color_context_new(allocation_status, (*context)); + fl_macro_color_context_t_new(allocation_status, (*context)); if (F_status_is_error(allocation_status)) { fl_color_print(f_type_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling "); - fl_color_print(f_type_error, context->notable, context->reset, "fl_macro_color_context_new"); + fl_color_print(f_type_error, context->notable, context->reset, "fl_macro_color_context_t_new"); fl_color_print_line(f_type_error, context->error, context->reset, "()."); return allocation_status; @@ -214,13 +214,13 @@ extern "C" { #endif // _di_fll_program_parameter_process_ #ifndef _di_fll_program_parameter_process_quietly_ - f_return_status fll_program_parameter_process_quietly(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context) { - f_status status = F_none; + f_return_status fll_program_parameter_process_quietly(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, fl_color_context_t *context) { + f_status_t status = F_none; status = f_console_parameter_process(arguments, parameters, remaining); if (F_status_is_error(status)) return status; - f_console_parameter_id decision = choices.id[2]; + f_console_parameter_id_t decision = choices.id[2]; if (right) { status = f_console_parameter_prioritize_right(parameters, choices, &decision); @@ -233,9 +233,9 @@ extern "C" { // load colors unless told not to. if (decision != choices.id[0]) { - f_status allocation_status = F_none; + f_status_t allocation_status = F_none; - fl_macro_color_context_new(allocation_status, (*context)); + fl_macro_color_context_t_new(allocation_status, (*context)); if (F_status_is_error(allocation_status)) return allocation_status; @@ -247,22 +247,22 @@ extern "C" { #endif // _di_fll_program_parameter_process_quietly_ #ifndef _di_fll_program_parameter_additional_append_ - f_return_status fll_program_parameter_additional_append(const f_string *argv, const f_string_lengths additional, f_string_dynamics *destination) { + f_return_status fll_program_parameter_additional_append(const f_string_t *argv, const f_string_lengths_t additional, f_string_dynamics_t *destination) { #ifndef _di_level_2_parameter_checking_ if (argv == 0) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; - f_string_length length = 0; - const f_string_length start = destination->used; + f_string_length_t length = 0; + const f_string_length_t start = destination->used; - for (f_string_length i = 0; i < additional.used; i++) { + for (f_string_length_t i = 0; i < additional.used; i++) { length = strnlen(argv[additional.array[i]], f_console_length_size); if (length > 0) { - f_string_dynamic ripped = f_string_dynamic_initialize; + f_string_dynamic_t ripped = f_string_dynamic_t_initialize; status = fl_string_append(argv[additional.array[i]], length, &ripped); if (F_status_is_error(status)) return status; @@ -289,19 +289,19 @@ extern "C" { #endif // _di_fll_program_parameter_additional_append_ #ifndef _di_fll_program_parameter_additional_mash_ - f_return_status fll_program_parameter_additional_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination) { + f_return_status fll_program_parameter_additional_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_t *argv, const f_string_lengths_t additional, f_string_dynamic_t *destination) { #ifndef _di_level_2_parameter_checking_ if (argv == 0) return F_status_set_error(F_parameter); if (glue_length < 1) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; - f_string_length length = 0; - const f_string_length start = destination->used; + f_string_length_t length = 0; + const f_string_length_t start = destination->used; - for (f_string_length i = 0; i < additional.used; i++) { + for (f_string_length_t i = 0; i < additional.used; i++) { length = strnlen(argv[additional.array[i]], f_console_length_size); if (length > 0) { @@ -319,21 +319,21 @@ extern "C" { #endif // _di_fll_program_parameter_additional_mash_ #ifndef _di_fll_program_parameter_additional_rip_ - f_return_status fll_program_parameter_additional_rip(const f_string *argv, const f_string_lengths additional, f_string_dynamics *destination) { + f_return_status fll_program_parameter_additional_rip(const f_string_t *argv, const f_string_lengths_t additional, f_string_dynamics_t *destination) { #ifndef _di_level_2_parameter_checking_ if (argv == 0) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = F_none; - f_string_length length = 0; - const f_string_length start = destination->used; + f_status_t status = F_none; + f_string_length_t length = 0; + const f_string_length_t start = destination->used; - for (f_string_length i = 0; i < additional.used; i++) { + for (f_string_length_t i = 0; i < additional.used; i++) { length = strnlen(argv[additional.array[i]], f_console_length_size); if (length > 0) { - f_string_dynamic ripped = f_string_dynamic_initialize; + f_string_dynamic_t ripped = f_string_dynamic_t_initialize; status = fl_string_rip(argv[additional.array[i]], length, &ripped); if (F_status_is_error(status)) return status; @@ -362,27 +362,27 @@ extern "C" { #endif // _di_fll_program_parameter_additional_rip_ #ifndef _di_fll_program_parameter_additional_rip_mash_ - f_return_status fll_program_parameter_additional_rip_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination) { + f_return_status fll_program_parameter_additional_rip_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_t *argv, const f_string_lengths_t additional, f_string_dynamic_t *destination) { #ifndef _di_level_2_parameter_checking_ if (argv == 0) return F_status_set_error(F_parameter); if (glue_length < 1) return F_status_set_error(F_parameter); if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = F_none; + f_status_t status = F_none; - f_string_length length = 0; - const f_string_length start = destination->used; - f_string_dynamic ripped = f_string_dynamic_initialize; + f_string_length_t length = 0; + const f_string_length_t start = destination->used; + f_string_dynamic_t ripped = f_string_dynamic_t_initialize; - for (f_string_length i = 0; i < additional.used; i++) { + for (f_string_length_t i = 0; i < additional.used; i++) { length = strnlen(argv[additional.array[i]], f_console_length_size); if (length > 0) { status = fl_string_rip(argv[additional.array[i]], length, &ripped); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(ripped); + f_macro_string_dynamic_t_delete_simple(ripped); return status; } @@ -390,7 +390,7 @@ extern "C" { status = fl_string_dynamic_mash(glue, glue_length, ripped, destination); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(ripped); + f_macro_string_dynamic_t_delete_simple(ripped); return F_status_set_error(F_string_too_large); } } @@ -398,7 +398,7 @@ extern "C" { } // for if (ripped.size) { - f_macro_string_dynamic_delete(status, ripped); + f_macro_string_dynamic_t_delete(status, 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 311bd18..440a729 100644 --- a/level_2/fll_program/c/program.h +++ b/level_2/fll_program/c/program.h @@ -47,7 +47,7 @@ extern "C" { * @param fl_color_print() */ #ifndef _di_fll_program_print_help_header_ - extern f_return_status fll_program_print_help_header(const fl_color_context context, const f_string name, const f_string version); + extern f_return_status fll_program_print_help_header(const fl_color_context_t context, const f_string_t name, const f_string_t version); #endif // _di_fll_program_print_help_header_ /** @@ -74,7 +74,7 @@ extern "C" { * @param fl_color_print() */ #ifndef _di_fll_program_print_help_option_ - extern f_return_status fll_program_print_help_option(const fl_color_context context, const f_string option_short, const f_string option_long, const f_string symbol_short, const f_string symbol_long, const f_string description); + extern f_return_status fll_program_print_help_option(const fl_color_context_t context, const f_string_t option_short, const f_string_t option_long, const f_string_t symbol_short, const f_string_t symbol_long, const f_string_t description); #endif // _di_fll_program_print_help_option_ /** @@ -97,7 +97,7 @@ extern "C" { * @param fl_color_print() */ #ifndef _di_fll_program_print_help_option_long_ - extern f_return_status fll_program_print_help_option_long(const fl_color_context context, const f_string option_long, const f_string symbol_long, const f_string description); + extern f_return_status fll_program_print_help_option_long(const fl_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description); #endif // _di_fll_program_print_help_option_long_ /** @@ -118,7 +118,7 @@ extern "C" { * @param fl_color_print() */ #ifndef _di_fll_program_print_help_option_other_ - extern f_return_status fll_program_print_help_option_other(const fl_color_context context, const f_string option_other, const f_string description); + extern f_return_status fll_program_print_help_option_other(const fl_color_context_t context, const f_string_t option_other, const f_string_t description); #endif // _di_fll_program_print_help_option_other_ /** @@ -140,7 +140,7 @@ extern "C" { * @param fl_color_print() */ #ifndef _di_fll_program_print_help_usage_ - extern f_return_status fll_program_print_help_usage(const fl_color_context context, const f_string name, const f_string parameters); + extern f_return_status fll_program_print_help_usage(const fl_color_context_t context, const f_string_t name, const f_string_t parameters); #endif // _di_fll_program_print_help_usage_ /** @@ -153,7 +153,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fll_program_print_version_ - extern f_return_status fll_program_print_version(const f_string version); + extern f_return_status fll_program_print_version(const f_string_t version); #endif // _di_fll_program_print_version_ /** @@ -190,7 +190,7 @@ extern "C" { * @see fl_color_load_context() */ #ifndef _di_fll_program_parameter_process_ - extern f_return_status fll_program_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context); + extern f_return_status fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, fl_color_context_t *context); #endif // _di_fll_program_parameter_process_ /** * Perform basic parameter loading, including initialization of color context but does not print errors. @@ -226,7 +226,7 @@ extern "C" { * @see fl_color_load_context() */ #ifndef _di_fll_program_parameter_process_quietly_ - extern f_return_status fll_program_parameter_process_quietly(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context); + extern f_return_status fll_program_parameter_process_quietly(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, fl_color_context_t *context); #endif // _di_fll_program_parameter_process_quietly_ /** @@ -256,7 +256,7 @@ extern "C" { * @see fl_string_append() */ #ifndef _di_fll_program_parameter_additional_append_ - extern f_return_status fll_program_parameter_additional_append(const f_string *argv, const f_string_lengths additional, f_string_dynamics *destination); + extern f_return_status fll_program_parameter_additional_append(const f_string_t *argv, const f_string_lengths_t additional, f_string_dynamics_t *destination); #endif // _di_fll_program_parameter_additional_append_ /** @@ -286,7 +286,7 @@ extern "C" { * @see fl_string_mash() */ #ifndef _di_fll_program_parameter_additional_mash_ - extern f_return_status fll_program_parameter_additional_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination); + extern f_return_status fll_program_parameter_additional_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_t *argv, const f_string_lengths_t additional, f_string_dynamic_t *destination); #endif // _di_fll_program_parameter_additional_mash_ /** @@ -313,7 +313,7 @@ extern "C" { * @see fl_string_rip() */ #ifndef _di_fll_program_parameter_additional_rip_ - extern f_return_status fll_program_parameter_additional_rip(const f_string *argv, const f_string_lengths additional, f_string_dynamics *destination); + extern f_return_status fll_program_parameter_additional_rip(const f_string_t *argv, const f_string_lengths_t additional, f_string_dynamics_t *destination); #endif // _di_fll_program_parameter_additional_rip_ /** @@ -347,7 +347,7 @@ extern "C" { * @see fl_string_rip() */ #ifndef _di_fll_program_parameter_additional_rip_mash_ - extern f_return_status fll_program_parameter_additional_rip_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination); + extern f_return_status fll_program_parameter_additional_rip_mash(const f_string_t glue, const f_string_length_t glue_length, const f_string_t *argv, const f_string_lengths_t additional, f_string_dynamic_t *destination); #endif // _di_fll_program_parameter_additional_rip_mash_ #ifdef __cplusplus diff --git a/level_2/fll_status/c/status.c b/level_2/fll_status/c/status.c index f0e58df..414be02 100644 --- a/level_2/fll_status/c/status.c +++ b/level_2/fll_status/c/status.c @@ -5,13 +5,13 @@ extern "C" { #endif #ifndef _di_fll_status_from_string_ - f_return_status fll_status_from_string(const f_string string, f_status *code) { + f_return_status fll_status_from_string(const f_string_t string, f_status_t *code) { #ifndef _di_level_1_parameter_checking_ if (code == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = F_none; - const f_string_length length = strlen(string); + f_status_t status = F_none; + const f_string_length_t length = strlen(string); if (length == 0) { return F_data_not; diff --git a/level_2/fll_status/c/status.h b/level_2/fll_status/c/status.h index f379574..b58104e 100644 --- a/level_2/fll_status/c/status.h +++ b/level_2/fll_status/c/status.h @@ -45,7 +45,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_status_from_string_ - extern f_return_status fll_status_from_string(const f_string string, f_status *code); + extern f_return_status fll_status_from_string(const f_string_t string, f_status_t *code); #endif // _di_fll_status_to_string_ #ifdef __cplusplus diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index 993b831..0cab62c 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_byte_dump_print_help_ - f_return_status byte_dump_print_help(const fl_color_context context) { + f_return_status byte_dump_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, byte_dump_name_long, byte_dump_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -69,16 +69,16 @@ extern "C" { #endif // _di_byte_dump_print_help_ #ifndef _di_byte_dump_main_ - f_return_status byte_dump_main(const f_console_arguments arguments, byte_dump_data *data) { - f_status status = F_none; + f_return_status byte_dump_main(const f_console_arguments_t arguments, byte_dump_data_t *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, byte_dump_total_parameters }; - f_console_parameter_ids choices = f_console_parameter_ids_initialize; + f_console_parameters_t parameters = { data->parameters, byte_dump_total_parameters }; + f_console_parameter_ids_t choices = f_console_parameter_ids_t_initialize; // Identify priority of color parameters. { - f_console_parameter_id ids[3] = { byte_dump_parameter_no_color, byte_dump_parameter_light, byte_dump_parameter_dark }; + f_console_parameter_id_t ids[3] = { byte_dump_parameter_no_color, byte_dump_parameter_light, byte_dump_parameter_dark }; choices.id = ids; choices.used = 3; @@ -95,8 +95,8 @@ extern "C" { // Identify priority of mode parameters. { - f_console_parameter_id ids[5] = { byte_dump_parameter_hexidecimal, byte_dump_parameter_duodecimal, byte_dump_parameter_octal, byte_dump_parameter_binary, byte_dump_parameter_decimal }; - f_console_parameter_id choice = byte_dump_parameter_hexidecimal; + f_console_parameter_id_t ids[5] = { byte_dump_parameter_hexidecimal, byte_dump_parameter_duodecimal, byte_dump_parameter_octal, byte_dump_parameter_binary, byte_dump_parameter_decimal }; + f_console_parameter_id_t choice = byte_dump_parameter_hexidecimal; choices.id = ids; choices.used = 5; @@ -127,8 +127,8 @@ extern "C" { // Identify priority of presentation parameters. { - f_console_parameter_id ids[3] = { byte_dump_parameter_normal, byte_dump_parameter_simple, byte_dump_parameter_classic }; - f_console_parameter_id choice = byte_dump_parameter_normal; + f_console_parameter_id_t ids[3] = { byte_dump_parameter_normal, byte_dump_parameter_simple, byte_dump_parameter_classic }; + f_console_parameter_id_t choice = byte_dump_parameter_normal; choices.id = ids; choices.used = 3; @@ -170,10 +170,10 @@ extern "C" { return F_status_set_error(status); } else if (data->parameters[byte_dump_parameter_width].result == f_console_result_additional) { - const f_string_length index = data->parameters[byte_dump_parameter_width].additional.array[data->parameters[byte_dump_parameter_width].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[byte_dump_parameter_width].additional.array[data->parameters[byte_dump_parameter_width].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); - f_number_unsigned number = 0; + f_number_unsigned_t number = 0; status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range); if (F_status_is_error(status) || number < 1 || number >= 0xfb) { @@ -201,19 +201,19 @@ extern "C" { return F_status_set_error(status); } else if (data->parameters[byte_dump_parameter_first].result == f_console_result_additional) { - const f_string_length index = data->parameters[byte_dump_parameter_first].additional.array[data->parameters[byte_dump_parameter_first].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[byte_dump_parameter_first].additional.array[data->parameters[byte_dump_parameter_first].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); - f_number_unsigned number = 0; + f_number_unsigned_t number = 0; status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range); - if (F_status_is_error(status) || number > f_type_number_size_unsigned) { + if (F_status_is_error(status) || number > f_number_t_size_unsigned) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_first); fl_color_print(f_type_error, data->context.error, data->context.reset, "' value can only be a number (inclusively) between "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "0"); fl_color_print(f_type_error, data->context.error, data->context.reset, " and "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%llu", f_type_number_size_unsigned); + fl_color_print(f_type_error, data->context.notable, data->context.reset, "%llu", f_number_t_size_unsigned); fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); byte_dump_delete_data(data); @@ -232,19 +232,19 @@ extern "C" { return F_status_set_error(status); } else if (data->parameters[byte_dump_parameter_last].result == f_console_result_additional) { - const f_string_length index = data->parameters[byte_dump_parameter_last].additional.array[data->parameters[byte_dump_parameter_last].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[byte_dump_parameter_last].additional.array[data->parameters[byte_dump_parameter_last].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); - f_number_unsigned number = 0; + f_number_unsigned_t number = 0; status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range); - if (F_status_is_error(status) || number < 0 || number > f_type_number_size_unsigned) { + if (F_status_is_error(status) || number < 0 || number > f_number_t_size_unsigned) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); fl_color_print(f_type_error, data->context.error, data->context.reset, "' value can only be a number (inclusively) between "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "0"); fl_color_print(f_type_error, data->context.error, data->context.reset, " and "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%llu", f_type_number_size_unsigned); + fl_color_print(f_type_error, data->context.notable, data->context.reset, "%llu", f_number_t_size_unsigned); fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); byte_dump_delete_data(data); @@ -271,7 +271,7 @@ extern "C" { } if (data->process_pipe) { - f_file file = f_file_initialize; + f_file_t file = f_file_t_initialize; file.id = f_type_descriptor_input; @@ -307,9 +307,9 @@ extern "C" { if (data->remaining.used > 0) { // pre-process remaining arguments to ensure that they all files exist before processing. { - f_status missing_files = F_none; + f_status_t missing_files = F_none; - for (f_array_length counter = 0; counter < data->remaining.used; counter++) { + for (f_array_length_t counter = 0; counter < data->remaining.used; counter++) { status = f_file_exists(arguments.argv[data->remaining.array[counter]]); if (status == F_false || F_status_is_error(status)) { if (missing_files == F_none) { @@ -328,8 +328,8 @@ extern "C" { } } - for (f_array_length counter = 0; counter < data->remaining.used; counter++) { - f_file file = f_file_initialize; + for (f_array_length_t counter = 0; counter < data->remaining.used; counter++) { + f_file_t file = f_file_t_initialize; status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file); if (F_status_is_error(status)) { @@ -386,15 +386,15 @@ extern "C" { #endif // _di_byte_dump_main_ #ifndef _di_byte_dump_delete_data_ - f_return_status byte_dump_delete_data(byte_dump_data *data) { + f_return_status byte_dump_delete_data(byte_dump_data_t *data) { - for (f_string_length i = 0; i < byte_dump_total_parameters; i++) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + for (f_string_length_t i = 0; i < byte_dump_total_parameters; i++) { + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); } // for - f_macro_string_lengths_delete_simple(data->remaining); - fl_macro_color_context_delete_simple(data->context); + f_macro_string_lengths_t_delete_simple(data->remaining); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/byte_dump/c/byte_dump.h b/level_3/byte_dump/c/byte_dump.h index b294b66..37a4b5e 100644 --- a/level_3/byte_dump/c/byte_dump.h +++ b/level_3/byte_dump/c/byte_dump.h @@ -173,36 +173,36 @@ extern "C" { byte_dump_parameter_classic, }; - #define byte_dump_console_parameter_initialize \ + #define byte_dump_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(byte_dump_short_binary, byte_dump_long_binary, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(byte_dump_short_decimal, byte_dump_long_decimal, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(byte_dump_short_duodecimal, byte_dump_long_duodecimal, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(byte_dump_short_hexidecimal, byte_dump_long_hexidecimal, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(byte_dump_short_octal, byte_dump_long_octal, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(byte_dump_short_first, byte_dump_long_first, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(byte_dump_short_last, byte_dump_long_last, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(byte_dump_short_width, byte_dump_long_width, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(byte_dump_short_text, byte_dump_long_text, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(byte_dump_short_placeholder, byte_dump_long_placeholder, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(0, byte_dump_long_normal, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(0, byte_dump_long_simple, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(0, byte_dump_long_classic, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(byte_dump_short_binary, byte_dump_long_binary, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(byte_dump_short_decimal, byte_dump_long_decimal, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(byte_dump_short_duodecimal, byte_dump_long_duodecimal, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(byte_dump_short_hexidecimal, byte_dump_long_hexidecimal, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(byte_dump_short_octal, byte_dump_long_octal, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(byte_dump_short_first, byte_dump_long_first, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(byte_dump_short_last, byte_dump_long_last, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(byte_dump_short_width, byte_dump_long_width, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(byte_dump_short_text, byte_dump_long_text, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(byte_dump_short_placeholder, byte_dump_long_placeholder, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(0, byte_dump_long_normal, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(0, byte_dump_long_simple, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(0, byte_dump_long_classic, 0, 0, f_console_type_normal), \ } #define byte_dump_total_parameters 18 #endif // _di_byte_dump_defines_ -#ifndef _di_byte_dump_data_ +#ifndef _di_byte_dump_data_t_ typedef struct { - f_console_parameter parameters[byte_dump_total_parameters]; + f_console_parameter_t parameters[byte_dump_total_parameters]; - f_string_lengths remaining; + f_string_lengths_t remaining; bool process_pipe; uint64_t first; @@ -211,22 +211,22 @@ extern "C" { uint8_t mode; uint8_t presentation; - fl_color_context context; - } byte_dump_data; + fl_color_context_t context; + } byte_dump_data_t; - #define byte_dump_data_initialize \ + #define byte_dump_data_t_initialize \ { \ - byte_dump_console_parameter_initialize, \ - f_string_lengths_initialize, \ + byte_dump_console_parameter_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ 0, \ 0, \ 8, \ byte_dump_mode_hexidecimal, \ byte_dump_presentation_normal, \ - fl_color_context_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_byte_dump_data_ +#endif // _di_byte_dump_data_t_ /** * Print help to standard output. @@ -238,7 +238,7 @@ extern "C" { * F_none on success. */ #ifndef _di_byte_dump_print_help_ - extern f_return_status byte_dump_print_help(const fl_color_context context); + extern f_return_status byte_dump_print_help(const fl_color_context_t context); #endif // _di_byte_dump_print_help_ /** @@ -258,7 +258,7 @@ extern "C" { * @see byte_dump_delete_data() */ #ifndef _di_byte_dump_main_ - extern f_return_status byte_dump_main(const f_console_arguments arguments, byte_dump_data *data); + extern f_return_status byte_dump_main(const f_console_arguments_t arguments, byte_dump_data_t *data); #endif // _di_byte_dump_main_ /** @@ -277,7 +277,7 @@ extern "C" { * @see byte_dump_main() */ #ifndef _di_byte_dump_delete_data_ - extern f_return_status byte_dump_delete_data(byte_dump_data *data); + extern f_return_status byte_dump_delete_data(byte_dump_data_t *data); #endif // _di_byte_dump_delete_data_ #ifdef __cplusplus diff --git a/level_3/byte_dump/c/main.c b/level_3/byte_dump/c/main.c index 0ddbd73..cd6de32 100644 --- a/level_3/byte_dump/c/main.c +++ b/level_3/byte_dump/c/main.c @@ -1,14 +1,14 @@ #include "byte_dump.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - byte_dump_data data = byte_dump_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + byte_dump_data_t data = byte_dump_data_t_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = byte_dump_main(arguments, &data); + f_status_t status = byte_dump_main(arguments, &data); if (F_status_is_error(status)) { return 1; diff --git a/level_3/byte_dump/c/private-byte_dump.c b/level_3/byte_dump/c/private-byte_dump.c index 2b68223..04dea4b 100644 --- a/level_3/byte_dump/c/private-byte_dump.c +++ b/level_3/byte_dump/c/private-byte_dump.c @@ -6,8 +6,8 @@ extern "C" { #endif #ifndef _di_byte_dump_file_ - f_return_status byte_dump_file(const byte_dump_data data, const f_string file_name, f_file file) { - f_status status = F_none; + f_return_status byte_dump_file(const byte_dump_data_t data, const f_string_t file_name, f_file_t file) { + f_status_t status = F_none; uint64_t position = 0; uint8_t size = 0; @@ -18,16 +18,16 @@ extern "C" { int8_t width_current = 0; int8_t width_count = 0; - byte_dump_cell cell = byte_dump_cell_initialize; - byte_dump_previous previous = byte_dump_previous_initialize; + byte_dump_cell_t cell = byte_dump_cell_t_initialize; + byte_dump_previous_t previous = byte_dump_previous_t_initialize; bool character_reset = 0; bool found_invalid_utf = F_false; // Store the current character data until it can be printed. - f_utf_string_dynamic characters = f_utf_string_dynamic_initialize; - f_utf_character character_array[data.width]; - f_utf_string_length character_current = 0; + f_utf_string_dynamic_t characters = f_utf_string_dynamic_t_initialize; + f_utf_character_t character_array[data.width]; + f_utf_string_length_t character_current = 0; // The row starts based on the first byte starting point and how many columns of bytes are displayed per row. if (data.first > 0) { @@ -35,7 +35,7 @@ extern "C" { offset = data.first % data.width; } - memset(&character_array, 0, sizeof(f_utf_character) * data.width); + memset(&character_array, 0, sizeof(f_utf_character_t) * data.width); characters.string = character_array; characters.used = 0; characters.size = data.width; @@ -65,7 +65,7 @@ extern "C" { // When width_count == 0, then this is that start of a new character sequence. if (width_count == 0) { - characters.string[character_current] = f_macro_utf_character_from_char_1(byte); + characters.string[character_current] = f_macro_utf_character_t_from_char_1(byte); width_count = 1; // The first character in a UTF-8 sequence cannot have a width of 1. @@ -83,13 +83,13 @@ extern "C" { width_current = f_macro_utf_byte_width_is(byte); if (width_count == 1) { - characters.string[character_current] |= f_macro_utf_character_from_char_2(byte); + characters.string[character_current] |= f_macro_utf_character_t_from_char_2(byte); } else if (width_count == 2) { - characters.string[character_current] |= f_macro_utf_character_from_char_3(byte); + characters.string[character_current] |= f_macro_utf_character_t_from_char_3(byte); } else if (width_count == 3) { - characters.string[character_current] |= f_macro_utf_character_from_char_4(byte); + characters.string[character_current] |= f_macro_utf_character_t_from_char_4(byte); } width_count++; @@ -228,24 +228,24 @@ extern "C" { #endif // _di_byte_dump_file_ #ifndef _di_byte_dump_print_character_fragment_ - bool byte_dump_print_character_fragment(const byte_dump_data data, const f_utf_string_static characters, const uint8_t invalid[], const int8_t width_utf, const int8_t byte_current, byte_dump_previous *previous, byte_dump_cell *cell, uint8_t *offset) { + bool byte_dump_print_character_fragment(const byte_dump_data_t data, const f_utf_string_static_t characters, const uint8_t invalid[], const int8_t width_utf, const int8_t byte_current, byte_dump_previous_t *previous, byte_dump_cell_t *cell, uint8_t *offset) { uint8_t byte = 0; bool reset = F_false; - f_utf_string_length character_current = characters.used - 1; + f_utf_string_length_t character_current = characters.used - 1; if (byte_current == 1) { - byte = f_macro_utf_character_to_char_1(characters.string[character_current]); + byte = f_macro_utf_character_t_to_char_1(characters.string[character_current]); } else if (byte_current == 2) { - byte = f_macro_utf_character_to_char_2(characters.string[character_current]); + byte = f_macro_utf_character_t_to_char_2(characters.string[character_current]); } else if (byte_current == 3) { - byte = f_macro_utf_character_to_char_3(characters.string[character_current]); + byte = f_macro_utf_character_t_to_char_3(characters.string[character_current]); } else if (byte_current == 4) { - byte = f_macro_utf_character_to_char_4(characters.string[character_current]); + byte = f_macro_utf_character_t_to_char_4(characters.string[character_current]); } if (cell->column == 0) { @@ -428,7 +428,7 @@ extern "C" { #endif // _di_byte_dump_print_character_fragment_ #ifndef _di_byte_dump_print_text_ - void byte_dump_print_text(const byte_dump_data data, const f_utf_string_static characters, const uint8_t invalid[], byte_dump_previous *previous, uint8_t *offset) { + void byte_dump_print_text(const byte_dump_data_t data, const f_utf_string_static_t characters, const uint8_t invalid[], byte_dump_previous_t *previous, uint8_t *offset) { uint8_t j = 0; uint8_t output = 0; uint8_t width_utf = 0; @@ -446,7 +446,7 @@ extern "C" { } // while } else { - f_string placeholder = " "; + f_string_t placeholder = " "; if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { placeholder = byte_dump_character_placeholder; @@ -499,7 +499,7 @@ extern "C" { } for (uint8_t i = 0; i < characters.used && j < data.width; i++, j++) { - output = f_macro_utf_character_to_char_1(characters.string[i]); + output = f_macro_utf_character_t_to_char_1(characters.string[i]); width_utf = f_macro_utf_byte_width_is(output); if (invalid[i]) { @@ -687,15 +687,15 @@ extern "C" { printf("%c", (uint8_t) output); if (width_utf > 1) { - output = f_macro_utf_character_to_char_2(characters.string[i]); + output = f_macro_utf_character_t_to_char_2(characters.string[i]); printf("%c", (uint8_t) output); if (width_utf > 2) { - output = f_macro_utf_character_to_char_3(characters.string[i]); + output = f_macro_utf_character_t_to_char_3(characters.string[i]); printf("%c", (uint8_t) output); if (width_utf > 3) { - output = f_macro_utf_character_to_char_4(characters.string[i]); + output = f_macro_utf_character_t_to_char_4(characters.string[i]); printf("%c", (uint8_t) output); } } @@ -824,7 +824,7 @@ extern "C" { #endif // _di_byte_dump_file_ #ifndef _di_byte_dump_print_file_error_ - void byte_dump_print_file_error(const fl_color_context context, const f_string function, const f_string file_name, const f_status status) { + void byte_dump_print_file_error(const fl_color_context_t context, const f_string_t function, const f_string_t file_name, const f_status_t status) { if (status == F_false) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to find file '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); diff --git a/level_3/byte_dump/c/private-byte_dump.h b/level_3/byte_dump/c/private-byte_dump.h index fe2f676..ab7468c 100644 --- a/level_3/byte_dump/c/private-byte_dump.h +++ b/level_3/byte_dump/c/private-byte_dump.h @@ -18,18 +18,18 @@ extern "C" { * column: The column position associated with the character cell. * row: The row position associated with the character cell. */ -#ifndef _di_byte_dump_cell_ +#ifndef _di_byte_dump_cell_t_ typedef struct { uint8_t column; uint64_t row; - } byte_dump_cell; + } byte_dump_cell_t; - #define byte_dump_cell_initialize \ + #define byte_dump_cell_t_initialize \ { \ 0, \ 0, \ } -#endif // _di_byte_dump_cell_ +#endif // _di_byte_dump_cell_t_ /** * A data structure for character data that overflowed from a previous line. @@ -42,13 +42,13 @@ extern "C" { * invalid: The specific invalid value provided representing the overflowed bytes. * This is used to print the placeholders. */ -#ifndef _di_byte_dump_previous_ +#ifndef _di_byte_dump_previous_t_ typedef struct { uint8_t bytes; uint8_t invalid; - } byte_dump_previous; + } byte_dump_previous_t; - #define byte_dump_previous_initialize \ + #define byte_dump_previous_t_initialize \ { \ 0, \ 0, \ @@ -70,7 +70,7 @@ extern "C" { * F_failure (with error bit) on failure, usually when read() fails. */ #ifndef _di_byte_dump_file_ - extern f_return_status byte_dump_file(const byte_dump_data data, const f_string file_name, f_file file) f_gcc_attribute_visibility_internal; + extern f_return_status byte_dump_file(const byte_dump_data_t data, const f_string_t file_name, f_file_t file) f_gcc_attribute_visibility_internal; #endif // _di_byte_dump_file_ /** @@ -111,7 +111,7 @@ extern "C" { * @see byte_dump_print_text() */ #ifndef _di_byte_dump_print_character_fragment_ - extern bool byte_dump_print_character_fragment(const byte_dump_data data, const f_utf_string_static characters, const uint8_t invalid[], const int8_t width_utf, const int8_t byte_current, byte_dump_previous *previous, byte_dump_cell *cell, uint8_t *offset) f_gcc_attribute_visibility_internal; + extern bool byte_dump_print_character_fragment(const byte_dump_data_t data, const f_utf_string_static_t characters, const uint8_t invalid[], const int8_t width_utf, const int8_t byte_current, byte_dump_previous_t *previous, byte_dump_cell_t *cell, uint8_t *offset) f_gcc_attribute_visibility_internal; #endif // _di_byte_dump_print_character_fragment_ /** @@ -133,7 +133,7 @@ extern "C" { * Will be reduced to 0 once used. */ #ifndef _di_byte_dump_print_text_ - extern void byte_dump_print_text(const byte_dump_data data, const f_utf_string_static characters, const uint8_t invalid[], byte_dump_previous *previous, uint8_t *offset) f_gcc_attribute_visibility_internal; + extern void byte_dump_print_text(const byte_dump_data_t data, const f_utf_string_static_t characters, const uint8_t invalid[], byte_dump_previous_t *previous, uint8_t *offset) f_gcc_attribute_visibility_internal; #endif // _di_byte_dump_print_text_ /** @@ -155,7 +155,7 @@ extern "C" { * F_false if error has not been printed. */ #ifndef _di_byte_dump_print_file_error_ - extern void byte_dump_print_file_error(const fl_color_context context, const f_string function, const f_string file_name, const f_status status) f_gcc_attribute_visibility_internal; + extern void byte_dump_print_file_error(const fl_color_context_t context, const f_string_t function, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_byte_dump_print_file_error_ #ifdef __cplusplus diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index 209cc88..c33cb61 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -11,7 +11,7 @@ extern "C" { #endif #ifndef _di_fake_print_help_ - f_return_status fake_print_help(const fl_color_context context) { + f_return_status fake_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, fake_name_long, fake_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -76,22 +76,22 @@ extern "C" { #endif // _di_fake_print_help_ #ifndef _di_fake_main_ - f_return_status fake_main(const f_console_arguments arguments, fake_data *data) { - f_status status = F_none; + f_return_status fake_main(const f_console_arguments_t arguments, fake_data_t *data) { + f_status_t status = F_none; uint8_t operations[fake_operations_total]; - f_string operations_name[fake_operations_total]; + f_string_t operations_name[fake_operations_total]; memset(&operations, 0, sizeof(uint8_t) * fake_operations_total); - memset(&operations_name, 0, sizeof(f_string) * fake_operations_total); + memset(&operations_name, 0, sizeof(f_string_t) * fake_operations_total); { - f_console_parameters parameters = { data->parameters, fake_total_parameters }; + f_console_parameters_t parameters = { data->parameters, fake_total_parameters }; // Load all parameters and identify priority of color parameters. { - f_console_parameter_id ids[3] = { fake_parameter_no_color, fake_parameter_light, fake_parameter_dark }; - f_console_parameter_ids choices = f_console_parameter_ids_initialize; + f_console_parameter_id_t ids[3] = { fake_parameter_no_color, fake_parameter_light, fake_parameter_dark }; + f_console_parameter_ids_t choices = f_console_parameter_ids_t_initialize; choices.id = ids; choices.used = 3; @@ -107,9 +107,9 @@ extern "C" { // Identify priority of verbosity related parameters. { - f_console_parameter_id ids[3] = { fake_parameter_quiet, fake_parameter_verbose, fake_parameter_debug }; - f_console_parameter_ids choices = f_console_parameter_ids_initialize; - f_console_parameter_id choice = 0; + f_console_parameter_id_t ids[3] = { fake_parameter_quiet, fake_parameter_verbose, fake_parameter_debug }; + f_console_parameter_ids_t choices = f_console_parameter_ids_t_initialize; + f_console_parameter_id_t choice = 0; choices.id = ids; choices.used = 3; @@ -348,70 +348,70 @@ extern "C" { #endif // _di_fake_main_ #ifndef _di_fake_delete_data_ - f_return_status fake_delete_data(fake_data *data) { + f_return_status fake_delete_data(fake_data_t *data) { - for (f_string_length i = 0; i < fake_total_parameters; i++) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + for (f_string_length_t i = 0; i < fake_total_parameters; i++) { + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); } // for - f_macro_string_lengths_delete_simple(data->remaining); - - f_macro_string_dynamics_delete_simple(data->define); - f_macro_string_dynamics_delete_simple(data->mode); - f_macro_string_dynamic_delete_simple(data->process); - f_macro_string_dynamic_delete_simple(data->settings); - - f_macro_string_dynamic_delete_simple(data->path_build); - f_macro_string_dynamic_delete_simple(data->path_build_documents); - f_macro_string_dynamic_delete_simple(data->path_build_includes); - f_macro_string_dynamic_delete_simple(data->path_build_libraries); - f_macro_string_dynamic_delete_simple(data->path_build_libraries_script); - f_macro_string_dynamic_delete_simple(data->path_build_libraries_shared); - f_macro_string_dynamic_delete_simple(data->path_build_libraries_static); - f_macro_string_dynamic_delete_simple(data->path_build_objects); - f_macro_string_dynamic_delete_simple(data->path_build_programs); - f_macro_string_dynamic_delete_simple(data->path_build_programs_script); - f_macro_string_dynamic_delete_simple(data->path_build_programs_shared); - f_macro_string_dynamic_delete_simple(data->path_build_programs_static); - f_macro_string_dynamic_delete_simple(data->path_build_settings); - f_macro_string_dynamic_delete_simple(data->path_build_stage); - f_macro_string_dynamic_delete_simple(data->path_work); - - f_macro_string_dynamic_delete_simple(data->path_data); - f_macro_string_dynamic_delete_simple(data->path_data_build); - - f_macro_string_dynamic_delete_simple(data->path_data_settings); - - f_macro_string_dynamic_delete_simple(data->path_documents); - - f_macro_string_dynamic_delete_simple(data->path_licenses); - - f_macro_string_dynamic_delete_simple(data->path_sources); - f_macro_string_dynamic_delete_simple(data->path_sources_bash); - f_macro_string_dynamic_delete_simple(data->path_sources_c); - f_macro_string_dynamic_delete_simple(data->path_sources_cpp); - f_macro_string_dynamic_delete_simple(data->path_sources_script); - - f_macro_string_dynamic_delete_simple(data->path_work); - f_macro_string_dynamic_delete_simple(data->path_work_includes); - f_macro_string_dynamic_delete_simple(data->path_work_libraries); - f_macro_string_dynamic_delete_simple(data->path_work_libraries_script); - f_macro_string_dynamic_delete_simple(data->path_work_libraries_shared); - f_macro_string_dynamic_delete_simple(data->path_work_libraries_static); - f_macro_string_dynamic_delete_simple(data->path_work_programs); - f_macro_string_dynamic_delete_simple(data->path_work_programs_script); - f_macro_string_dynamic_delete_simple(data->path_work_programs_shared); - f_macro_string_dynamic_delete_simple(data->path_work_programs_static); - - f_macro_string_dynamic_delete_simple(data->file_data_build_defines); - f_macro_string_dynamic_delete_simple(data->file_data_build_dependencies); - f_macro_string_dynamic_delete_simple(data->file_data_build_fakefile); - f_macro_string_dynamic_delete_simple(data->file_data_build_settings); - - f_macro_string_dynamic_delete_simple(data->file_documents_readme); - - fl_macro_color_context_delete_simple(data->context); + f_macro_string_lengths_t_delete_simple(data->remaining); + + f_macro_string_dynamics_t_delete_simple(data->define); + f_macro_string_dynamics_t_delete_simple(data->mode); + f_macro_string_dynamic_t_delete_simple(data->process); + f_macro_string_dynamic_t_delete_simple(data->settings); + + f_macro_string_dynamic_t_delete_simple(data->path_build); + f_macro_string_dynamic_t_delete_simple(data->path_build_documents); + f_macro_string_dynamic_t_delete_simple(data->path_build_includes); + f_macro_string_dynamic_t_delete_simple(data->path_build_libraries); + f_macro_string_dynamic_t_delete_simple(data->path_build_libraries_script); + f_macro_string_dynamic_t_delete_simple(data->path_build_libraries_shared); + f_macro_string_dynamic_t_delete_simple(data->path_build_libraries_static); + f_macro_string_dynamic_t_delete_simple(data->path_build_objects); + f_macro_string_dynamic_t_delete_simple(data->path_build_programs); + f_macro_string_dynamic_t_delete_simple(data->path_build_programs_script); + f_macro_string_dynamic_t_delete_simple(data->path_build_programs_shared); + f_macro_string_dynamic_t_delete_simple(data->path_build_programs_static); + f_macro_string_dynamic_t_delete_simple(data->path_build_settings); + f_macro_string_dynamic_t_delete_simple(data->path_build_stage); + f_macro_string_dynamic_t_delete_simple(data->path_work); + + f_macro_string_dynamic_t_delete_simple(data->path_data); + f_macro_string_dynamic_t_delete_simple(data->path_data_build); + + f_macro_string_dynamic_t_delete_simple(data->path_data_settings); + + f_macro_string_dynamic_t_delete_simple(data->path_documents); + + f_macro_string_dynamic_t_delete_simple(data->path_licenses); + + f_macro_string_dynamic_t_delete_simple(data->path_sources); + f_macro_string_dynamic_t_delete_simple(data->path_sources_bash); + f_macro_string_dynamic_t_delete_simple(data->path_sources_c); + f_macro_string_dynamic_t_delete_simple(data->path_sources_cpp); + f_macro_string_dynamic_t_delete_simple(data->path_sources_script); + + f_macro_string_dynamic_t_delete_simple(data->path_work); + f_macro_string_dynamic_t_delete_simple(data->path_work_includes); + f_macro_string_dynamic_t_delete_simple(data->path_work_libraries); + f_macro_string_dynamic_t_delete_simple(data->path_work_libraries_script); + f_macro_string_dynamic_t_delete_simple(data->path_work_libraries_shared); + f_macro_string_dynamic_t_delete_simple(data->path_work_libraries_static); + f_macro_string_dynamic_t_delete_simple(data->path_work_programs); + f_macro_string_dynamic_t_delete_simple(data->path_work_programs_script); + f_macro_string_dynamic_t_delete_simple(data->path_work_programs_shared); + f_macro_string_dynamic_t_delete_simple(data->path_work_programs_static); + + f_macro_string_dynamic_t_delete_simple(data->file_data_build_defines); + f_macro_string_dynamic_t_delete_simple(data->file_data_build_dependencies); + f_macro_string_dynamic_t_delete_simple(data->file_data_build_fakefile); + f_macro_string_dynamic_t_delete_simple(data->file_data_build_settings); + + f_macro_string_dynamic_t_delete_simple(data->file_documents_readme); + + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fake/c/fake.h b/level_3/fake/c/fake.h index 0d57122..a370e22 100644 --- a/level_3/fake/c/fake.h +++ b/level_3/fake/c/fake.h @@ -335,159 +335,159 @@ extern "C" { fake_parameter_operation_skeleton, }; - #define fake_console_parameter_initialize \ + #define fake_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_quiet, f_console_standard_long_quiet, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_verbose, f_console_standard_long_verbose, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(fake_short_define, fake_long_define, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(fake_short_mode, fake_long_mode, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(fake_short_process, fake_long_process, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(fake_short_settings, fake_long_settings, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(fake_short_path_build, fake_long_path_build, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(fake_short_path_data, fake_long_path_data, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(fake_short_path_sources, fake_long_path_sources, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(fake_short_path_work, fake_long_path_work, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(0, fake_long_documents_disabled, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(0, fake_long_documents_enabled, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(0, fake_long_shared_disabled, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(0, fake_long_shared_enabled, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(0, fake_long_static_disabled, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(0, fake_long_static_enabled, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(0, 0, fake_other_operation_build, 0, f_console_type_other), \ - f_console_parameter_initialize(0, 0, fake_other_operation_clean, 0, f_console_type_other), \ - f_console_parameter_initialize(0, 0, fake_other_operation_make, 0, f_console_type_other), \ - f_console_parameter_initialize(0, 0, fake_other_operation_skeleton, 0, f_console_type_other), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_quiet, f_console_standard_long_quiet, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_verbose, f_console_standard_long_verbose, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(fake_short_define, fake_long_define, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(fake_short_mode, fake_long_mode, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(fake_short_process, fake_long_process, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(fake_short_settings, fake_long_settings, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(fake_short_path_build, fake_long_path_build, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(fake_short_path_data, fake_long_path_data, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(fake_short_path_sources, fake_long_path_sources, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(fake_short_path_work, fake_long_path_work, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(0, fake_long_documents_disabled, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(0, fake_long_documents_enabled, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(0, fake_long_shared_disabled, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(0, fake_long_shared_enabled, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(0, fake_long_static_disabled, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(0, fake_long_static_enabled, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(0, 0, fake_other_operation_build, 0, f_console_type_other), \ + f_console_parameter_t_initialize(0, 0, fake_other_operation_clean, 0, f_console_type_other), \ + f_console_parameter_t_initialize(0, 0, fake_other_operation_make, 0, f_console_type_other), \ + f_console_parameter_t_initialize(0, 0, fake_other_operation_skeleton, 0, f_console_type_other), \ } #define fake_total_parameters 26 #endif // _di_fake_defines_ -#ifndef _di_fake_data_ +#ifndef _di_fake_data_t_ typedef struct { - f_console_parameter parameters[fake_total_parameters]; + f_console_parameter_t parameters[fake_total_parameters]; - f_string_lengths remaining; + f_string_lengths_t remaining; bool process_pipe; mode_t umask; uint8_t operation; uint8_t verbosity; - f_string_dynamics define; - f_string_dynamics mode; - f_string_dynamic process; - f_string_dynamic settings; - - f_string_dynamic path_build; - f_string_dynamic path_build_documents; - f_string_dynamic path_build_includes; - f_string_dynamic path_build_libraries; - f_string_dynamic path_build_libraries_script; - f_string_dynamic path_build_libraries_shared; - f_string_dynamic path_build_libraries_static; - f_string_dynamic path_build_objects; - f_string_dynamic path_build_programs; - f_string_dynamic path_build_programs_script; - f_string_dynamic path_build_programs_shared; - f_string_dynamic path_build_programs_static; - f_string_dynamic path_build_settings; - f_string_dynamic path_build_stage; - - f_string_dynamic path_data; - f_string_dynamic path_data_build; - f_string_dynamic path_data_settings; - - f_string_dynamic path_documents; - - f_string_dynamic path_licenses; - - f_string_dynamic path_sources; - f_string_dynamic path_sources_bash; - f_string_dynamic path_sources_c; - f_string_dynamic path_sources_cpp; - f_string_dynamic path_sources_script; - - f_string_dynamic path_work; - f_string_dynamic path_work_includes; - f_string_dynamic path_work_libraries; - f_string_dynamic path_work_libraries_script; - f_string_dynamic path_work_libraries_shared; - f_string_dynamic path_work_libraries_static; - f_string_dynamic path_work_programs; - f_string_dynamic path_work_programs_script; - f_string_dynamic path_work_programs_shared; - f_string_dynamic path_work_programs_static; - - f_string_dynamic file_data_build_defines; - f_string_dynamic file_data_build_dependencies; - f_string_dynamic file_data_build_fakefile; - f_string_dynamic file_data_build_settings; - - f_string_dynamic file_documents_readme; - - fl_color_context context; - } fake_data; - - #define fake_data_initialize \ + f_string_dynamics_t define; + f_string_dynamics_t mode; + f_string_dynamic_t process; + f_string_dynamic_t settings; + + f_string_dynamic_t path_build; + f_string_dynamic_t path_build_documents; + f_string_dynamic_t path_build_includes; + f_string_dynamic_t path_build_libraries; + f_string_dynamic_t path_build_libraries_script; + f_string_dynamic_t path_build_libraries_shared; + f_string_dynamic_t path_build_libraries_static; + f_string_dynamic_t path_build_objects; + f_string_dynamic_t path_build_programs; + f_string_dynamic_t path_build_programs_script; + f_string_dynamic_t path_build_programs_shared; + f_string_dynamic_t path_build_programs_static; + f_string_dynamic_t path_build_settings; + f_string_dynamic_t path_build_stage; + + f_string_dynamic_t path_data; + f_string_dynamic_t path_data_build; + f_string_dynamic_t path_data_settings; + + f_string_dynamic_t path_documents; + + f_string_dynamic_t path_licenses; + + f_string_dynamic_t path_sources; + f_string_dynamic_t path_sources_bash; + f_string_dynamic_t path_sources_c; + f_string_dynamic_t path_sources_cpp; + f_string_dynamic_t path_sources_script; + + f_string_dynamic_t path_work; + f_string_dynamic_t path_work_includes; + f_string_dynamic_t path_work_libraries; + f_string_dynamic_t path_work_libraries_script; + f_string_dynamic_t path_work_libraries_shared; + f_string_dynamic_t path_work_libraries_static; + f_string_dynamic_t path_work_programs; + f_string_dynamic_t path_work_programs_script; + f_string_dynamic_t path_work_programs_shared; + f_string_dynamic_t path_work_programs_static; + + f_string_dynamic_t file_data_build_defines; + f_string_dynamic_t file_data_build_dependencies; + f_string_dynamic_t file_data_build_fakefile; + f_string_dynamic_t file_data_build_settings; + + f_string_dynamic_t file_documents_readme; + + fl_color_context_t context; + } fake_data_t; + + #define fake_data_t_initialize \ { \ - fake_console_parameter_initialize, \ - f_string_lengths_initialize, \ + fake_console_parameter_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ 0, \ 0, \ fake_verbosity_normal, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - fl_color_context_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_fake_data_ +#endif // _di_fake_data_t_ /** * Print help to standard output. @@ -499,7 +499,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fake_print_help_ - extern f_return_status fake_print_help(const fl_color_context context); + extern f_return_status fake_print_help(const fl_color_context_t context); #endif // _di_fake_print_help_ /** @@ -520,7 +520,7 @@ extern "C" { * @see fake_delete_data() */ #ifndef _di_fake_main_ - extern f_return_status fake_main(const f_console_arguments arguments, fake_data *data); + extern f_return_status fake_main(const f_console_arguments_t arguments, fake_data_t *data); #endif // _di_fake_main_ /** @@ -539,7 +539,7 @@ extern "C" { * @see fake_main() */ #ifndef _di_fake_delete_data_ - extern f_return_status fake_delete_data(fake_data *data); + extern f_return_status fake_delete_data(fake_data_t *data); #endif // _di_fake_delete_data_ #ifdef __cplusplus diff --git a/level_3/fake/c/main.c b/level_3/fake/c/main.c index c462376..d7f51a9 100644 --- a/level_3/fake/c/main.c +++ b/level_3/fake/c/main.c @@ -1,8 +1,8 @@ #include "fake.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - fake_data data = fake_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + fake_data_t data = fake_data_t_initialize; // @fixme: bad design in POSIX where there is no get umask without setting it. data.umask = umask(0); @@ -10,7 +10,7 @@ int main(const unsigned long argc, const f_string *argv) { // restore umask. umask(data.umask); - f_status status = fake_main(arguments, &data); + f_status_t status = fake_main(arguments, &data); if (F_status_is_error(status)) { return 1; diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index 626ecf5..d8bd9e3 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -9,10 +9,10 @@ extern "C" { #endif #ifndef _di_fake_build_arguments_standard_add_ - void fake_build_arguments_standard_add(const fake_data data, const fake_build_data data_build, const bool is_shared, const bool is_library, f_string_dynamics *arguments, f_status *status) { + void fake_build_arguments_standard_add(const fake_data_t data, const fake_build_data_t data_build, const bool is_shared, const bool is_library, f_string_dynamics_t *arguments, f_status_t *status) { if (F_status_is_error(*status)) return; - f_string_length build_libraries_length = fake_build_parameter_library_link_path_length + data.path_build_libraries_shared.used; + f_string_length_t build_libraries_length = fake_build_parameter_library_link_path_length + data.path_build_libraries_shared.used; char build_libraries[build_libraries_length + 1]; @@ -25,19 +25,19 @@ extern "C" { memcpy(build_libraries + fake_build_parameter_library_link_path_length, data.path_build_libraries_static.string, data.path_build_libraries_static.used); } - f_string_length build_includes_length = fake_build_parameter_library_include_length + data.path_build_includes.used; + f_string_length_t build_includes_length = fake_build_parameter_library_include_length + data.path_build_includes.used; char build_includes[build_includes_length + 1]; memcpy(build_includes, fake_build_parameter_library_include, fake_build_parameter_library_include_length); memcpy(build_includes + fake_build_parameter_library_include_length, data.path_build_includes.string, data.path_build_includes.used); - const f_string values[] = { + const f_string_t values[] = { build_libraries, build_includes, }; - const f_string_length lengths[] = { + const f_string_length_t lengths[] = { build_libraries_length, build_includes_length, }; @@ -48,7 +48,7 @@ extern "C" { } // for if (data.path_work.used > 0) { - f_string_length length = 0; + f_string_length_t length = 0; if (F_status_is_fine(*status)) { length = fake_build_parameter_library_include_length + data.path_work_includes.used; @@ -91,38 +91,38 @@ extern "C" { } if (F_status_is_fine(*status)) { - for (f_array_length i = 0; i < data_build.setting.build_libraries.used; i++) { + for (f_array_length_t i = 0; i < data_build.setting.build_libraries.used; i++) { *status = fll_execute_arguments_add(data_build.setting.build_libraries.array[i].string, data_build.setting.build_libraries.array[i].used, arguments); if (F_status_is_error(*status)) break; } // for } - for (f_array_length i = 0; i < data_build.setting.flags_all.used && F_status_is_fine(*status); i++) { + for (f_array_length_t i = 0; i < data_build.setting.flags_all.used && F_status_is_fine(*status); i++) { *status = fll_execute_arguments_add(data_build.setting.flags_all.array[i].string, data_build.setting.flags_all.array[i].used, arguments); if (F_status_is_error(*status)) break; } // for - for (f_array_length i = 0; i < data_build.setting.flags_shared.used && F_status_is_fine(*status); i++) { + for (f_array_length_t i = 0; i < data_build.setting.flags_shared.used && F_status_is_fine(*status); i++) { *status = fll_execute_arguments_add(data_build.setting.flags_shared.array[i].string, data_build.setting.flags_shared.array[i].used, arguments); if (F_status_is_error(*status)) break; } // for if (is_library) { - for (f_array_length j = 0; j < data_build.setting.flags_library.used && F_status_is_fine(*status); j++) { + for (f_array_length_t j = 0; j < data_build.setting.flags_library.used && F_status_is_fine(*status); j++) { *status = fll_execute_arguments_add(data_build.setting.flags_library.array[j].string, data_build.setting.flags_library.array[j].used, arguments); if (F_status_is_error(*status)) break; } // for } else { - for (f_array_length i = 0; i < data_build.setting.flags_program.used && F_status_is_fine(*status); i++) { + for (f_array_length_t i = 0; i < data_build.setting.flags_program.used && F_status_is_fine(*status); i++) { *status = fll_execute_arguments_add(data_build.setting.flags_program.array[i].string, data_build.setting.flags_program.array[i].used, arguments); if (F_status_is_error(*status)) break; } // for } if (data.define.used) { - f_string_length length = 0; - f_array_length i = 0; + f_string_length_t length = 0; + f_array_length_t i = 0; for (; i < data.define.used && F_status_is_fine(*status); i++) { length = fake_build_parameter_define_prefix_length + data.define.array[i].used; @@ -139,8 +139,8 @@ extern "C" { } // for } else { - f_string_length length = 0; - f_array_length i = 0; + f_string_length_t length = 0; + f_array_length_t i = 0; for (; i < data_build.setting.defines_all.used && F_status_is_fine(*status); i++) { length = fake_build_parameter_define_prefix_length + data_build.setting.defines_all.array[i].used; @@ -191,29 +191,29 @@ extern "C" { #endif // _di_fake_build_arguments_standard_add_ #ifndef _di_fake_build_copy_ - void fake_build_copy(const fake_data data, const f_mode mode, const f_string label, const f_string_static source, const f_string_static destination, const f_string_statics files, const f_string_static file_stage, f_status *status) { + void fake_build_copy(const fake_data_t data, const f_mode_t mode, const f_string_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, f_status_t *status) { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return; - f_directory_statuss failures = f_directory_statuss_initialize; - f_string_dynamic path_source = f_string_dynamic_initialize; - f_string_dynamic destination_file = f_string_dynamic_initialize; + f_directory_statuss_t failures = f_directory_statuss_t_initialize; + f_string_dynamic_t path_source = f_string_dynamic_t_initialize; + f_string_dynamic_t destination_file = f_string_dynamic_t_initialize; if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Copying %s.", label); } - f_macro_string_dynamic_new(*status, path_source, source.used); + f_macro_string_dynamic_t_new(*status, path_source, source.used); if (F_status_is_error(*status)) { - fake_print_error(data, F_status_set_fine(*status), "f_macro_string_dynamic_new", F_true); + fake_print_error(data, F_status_set_fine(*status), "f_macro_string_dynamic_t_new", F_true); - f_macro_string_dynamic_delete_simple(path_source); + f_macro_string_dynamic_t_delete_simple(path_source); return; } memcpy(path_source.string, source.string, source.used); - for (f_array_length i = 0; i < files.used; i++) { + for (f_array_length_t i = 0; i < files.used; i++) { if (files.array[i].used == 0) continue; path_source.used = source.used; @@ -235,7 +235,7 @@ extern "C" { if (F_status_is_error(*status)) { if (data.verbosity == fake_verbosity_verbose) { - for (f_string_length j = 0; j < failures.used; j++) { + for (f_string_length_t j = 0; j < failures.used; j++) { fake_print_error_build_operation_file(data, F_status_set_fine(*status), "fl_directory_copy_content", "copy contents of", "to", path_source.string, destination.string, F_true); } // for @@ -286,9 +286,9 @@ extern "C" { *status = F_none; } // for - f_macro_directory_statuss_delete_simple(failures); - f_macro_string_dynamic_delete_simple(path_source); - f_macro_string_dynamic_delete_simple(destination_file); + f_macro_directory_statuss_t_delete_simple(failures); + f_macro_string_dynamic_t_delete_simple(path_source); + f_macro_string_dynamic_t_delete_simple(destination_file); if (F_status_is_fine(*status)) { fake_build_touch(data, file_stage, status); @@ -297,11 +297,11 @@ extern "C" { #endif // _di_fake_build_copy_ #ifndef _di_fake_build_skeleton_ - void fake_build_skeleton(const fake_data data, const fake_build_data data_build, const mode_t mode, const f_string_static file_stage, f_status *status) { + void fake_build_skeleton(const fake_data_t data, const fake_build_data_t data_build, const mode_t mode, const f_string_static_t file_stage, f_status_t *status) { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return; - f_string_static path_headers = f_string_static_initialize; - f_string_length directory_headers_length = data.path_build_includes.used + data_build.setting.path_headers.used; + f_string_static_t path_headers = f_string_static_t_initialize; + f_string_length_t directory_headers_length = data.path_build_includes.used + data_build.setting.path_headers.used; char directory_headers[directory_headers_length + 1]; @@ -323,7 +323,7 @@ extern "C" { path_headers.size = directory_headers_length + 1; } - const f_string_static *directorys[] = { + const f_string_static_t *directorys[] = { &data.path_build, &data.path_build_documents, &data.path_build_includes, @@ -371,11 +371,11 @@ extern "C" { #endif // _di_fake_build_skeleton_ #ifndef _di_fake_build_execute_process_script_ - void fake_build_execute_process_script(const fake_data data, const fake_build_data data_build, const f_string_static process_script, const f_string_static file_stage, f_status *status) { + void fake_build_execute_process_script(const fake_data_t data, const fake_build_data_t data_build, const f_string_static_t process_script, const f_string_static_t file_stage, f_status_t *status) { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return; if (process_script.used == 0) return; - f_string_dynamics arguments = f_string_dynamics_initialize; + f_string_dynamics_t arguments = f_string_dynamics_t_initialize; *status = fll_execute_arguments_add(fake_other_operation_build, fake_other_operation_build_length, &arguments); @@ -416,15 +416,15 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return; } { - f_string_dynamic defines = f_string_dynamic_initialize; + f_string_dynamic_t defines = f_string_dynamic_t_initialize; if (data.define.used) { - for (f_array_length i = 0; i < data.define.used; i++) { + for (f_array_length_t i = 0; i < data.define.used; i++) { *status = fl_string_dynamic_mash(" ", 1, data.define.array[i], &defines); if (F_status_is_error(*status)) { @@ -435,8 +435,8 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_mash", F_true); - f_macro_string_dynamic_delete_simple(defines); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamic_t_delete_simple(defines); + f_macro_string_dynamics_t_delete_simple(arguments); return; } @@ -444,13 +444,13 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true); - f_macro_string_dynamic_delete_simple(defines); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamic_t_delete_simple(defines); + f_macro_string_dynamics_t_delete_simple(arguments); return; } } - const f_string parameters_prefix[] = { + const f_string_t parameters_prefix[] = { f_console_symbol_short_enable, f_console_symbol_short_enable, f_console_symbol_short_enable, @@ -460,7 +460,7 @@ extern "C" { f_console_symbol_short_enable, }; - const f_string_length parameters_prefix_length[] = { + const f_string_length_t parameters_prefix_length[] = { f_console_symbol_short_enable_length, f_console_symbol_short_enable_length, f_console_symbol_short_enable_length, @@ -470,7 +470,7 @@ extern "C" { f_console_symbol_short_enable_length, }; - const f_string parameters_name[] = { + const f_string_t parameters_name[] = { fake_short_define, fake_short_process, fake_short_settings, @@ -480,7 +480,7 @@ extern "C" { fake_short_path_work, }; - const f_string_length parameters_name_length[] = { + const f_string_length_t parameters_name_length[] = { fake_short_define_length, fake_short_process_length, fake_short_settings_length, @@ -490,7 +490,7 @@ extern "C" { fake_short_path_work_length, }; - const f_string parameters_value[] = { + const f_string_t parameters_value[] = { defines.string, data.process.string, data.settings.string, @@ -500,7 +500,7 @@ extern "C" { data.path_work.string, }; - const f_string_length parameters_value_length[] = { + const f_string_length_t parameters_value_length[] = { defines.used, data.process.used, data.settings.used, @@ -512,18 +512,18 @@ extern "C" { *status = fll_execute_arguments_add_parameter_set(parameters_prefix, parameters_prefix_length, parameters_name, parameters_name_length, parameters_value, parameters_value_length, 7, &arguments); - f_macro_string_dynamic_delete_simple(defines); + f_macro_string_dynamic_t_delete_simple(defines); if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add_parameter_set", F_true); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return; } } - f_string_dynamic path = f_string_dynamic_initialize; - f_string function = 0; + f_string_dynamic_t path = f_string_dynamic_t_initialize; + f_string_t function = 0; { function = "fl_string_dynamic_append_nulless"; @@ -544,8 +544,8 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), function, F_true); - f_macro_string_dynamic_delete_simple(path); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamic_t_delete_simple(path); + f_macro_string_dynamics_t_delete_simple(arguments); return; } } @@ -555,7 +555,7 @@ extern "C" { *status = fll_execute_path_environment(path.string, arguments, data_build.environment.names, data_build.environment.values, &result); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); } if (F_status_is_error(*status)) { @@ -575,23 +575,23 @@ extern "C" { fake_build_touch(data, file_stage, status); } - f_macro_string_dynamic_delete_simple(path); + f_macro_string_dynamic_t_delete_simple(path); } #endif // _di_fake_build_execute_process_script_ #ifndef _di_fake_build_get_file_name_without_extension_ - f_return_status fake_build_get_file_name_without_extension(const fake_data data, const f_string_static path, f_string_dynamic *name) { + f_return_status fake_build_get_file_name_without_extension(const fake_data_t data, const f_string_static_t path, f_string_dynamic_t *name) { name->used = 0; if (path.used == 0) return F_none; - f_status status = f_file_name_base(path.string, path.used, name); + f_status_t status = f_file_name_base(path.string, path.used, name); if (F_status_is_error(status)) { fake_print_error(data, F_status_set_fine(status), "f_file_name_base", F_true); return status; } - f_string_length i = name->used; + f_string_length_t i = name->used; for (; i > 0; i--) { if (name->string[i] == f_path_extension_separator[0]) { @@ -611,7 +611,7 @@ extern "C" { #endif // _di_fake_build_get_file_name_without_extension_ #ifndef _di_fake_build_libraries_script_ - void fake_build_libraries_script(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) { + void fake_build_libraries_script(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return; // @todo needs to perform some sort of regex replace on the library scripts. @@ -621,7 +621,7 @@ extern "C" { #endif // _di_fake_build_libraries_script_ #ifndef _di_fake_build_library_shared_ - void fake_build_library_shared(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) { + void fake_build_library_shared(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return; if (!data_build.setting.build_sources_library.used) return; @@ -630,18 +630,18 @@ extern "C" { fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling shared library."); } - f_string_dynamics arguments = f_string_dynamics_initialize; + f_string_dynamics_t arguments = f_string_dynamics_t_initialize; { - const f_string_static *path_sources = &data.path_sources_c; + const f_string_static_t *path_sources = &data.path_sources_c; if (data_build.setting.build_language == fake_build_language_type_cpp) { path_sources = &data.path_sources_cpp; } - f_string_length source_length = 0; + f_string_length_t source_length = 0; - for (f_array_length i = 0; i < data_build.setting.build_sources_library.used; i++) { + for (f_array_length_t i = 0; i < data_build.setting.build_sources_library.used; i++) { source_length = path_sources->used + data_build.setting.build_sources_library.array[i].used; char source[source_length + 1]; @@ -657,15 +657,15 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return; } } - f_string_length parameter_file_name_length = fake_build_parameter_library_name_prefix_length; - f_string_length parameter_file_name_major_length = fake_build_parameter_library_name_prefix_length; - f_string_length parameter_file_name_minor_length = fake_build_parameter_library_name_prefix_length; - f_string_length parameter_file_name_micro_length = fake_build_parameter_library_name_prefix_length; + f_string_length_t parameter_file_name_length = fake_build_parameter_library_name_prefix_length; + f_string_length_t parameter_file_name_major_length = fake_build_parameter_library_name_prefix_length; + f_string_length_t parameter_file_name_minor_length = fake_build_parameter_library_name_prefix_length; + f_string_length_t parameter_file_name_micro_length = fake_build_parameter_library_name_prefix_length; parameter_file_name_micro_length += data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_shared_length; parameter_file_name_length = parameter_file_name_micro_length; @@ -735,7 +735,7 @@ extern "C" { parameter_file_name_micro[parameter_file_name_micro_length] = 0; { - f_string_length parameter_file_path_length = data.path_build_libraries_shared.used + parameter_file_name_micro_length; + f_string_length_t parameter_file_path_length = data.path_build_libraries_shared.used + parameter_file_name_micro_length; char parameter_file_path[parameter_file_path_length + 1]; @@ -744,7 +744,7 @@ extern "C" { parameter_file_path[parameter_file_path_length] = 0; - f_string_length parameter_linker_length = fake_build_parameter_library_shared_prefix_length; + f_string_length_t parameter_linker_length = fake_build_parameter_library_shared_prefix_length; if (data_build.setting.version_target == fake_build_version_type_major) { parameter_linker_length += parameter_file_name_major_length; @@ -772,14 +772,14 @@ extern "C" { parameter_linker[parameter_linker_length] = 0; - const f_string values[] = { + const f_string_t values[] = { fake_build_parameter_library_shared, parameter_linker, fake_build_parameter_library_output, parameter_file_path, }; - const f_string_length lengths[] = { + const f_string_length_t lengths[] = { fake_build_parameter_library_shared_length, parameter_linker_length, fake_build_parameter_library_output_length, @@ -796,19 +796,19 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return; } } fake_execute(data, data_build.environment, data_build.setting.build_compiler, arguments, status); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); if (F_status_is_error(*status)) return; if (data_build.setting.version_target != fake_build_version_type_micro) { - f_string_length parameter_file_path_length = data.path_build_libraries_shared.used; + f_string_length_t parameter_file_path_length = data.path_build_libraries_shared.used; if (data_build.setting.version_target == fake_build_version_type_major) { parameter_file_path_length += parameter_file_name_major_length; @@ -847,7 +847,7 @@ extern "C" { } if (F_status_is_fine(*status)) { - f_string_length parameter_file_path_length = data.path_build_libraries_shared.used + parameter_file_name_length; + f_string_length_t parameter_file_path_length = data.path_build_libraries_shared.used + parameter_file_name_length; char parameter_file_path[parameter_file_path_length + 1]; @@ -908,7 +908,7 @@ extern "C" { #endif // _di_fake_build_library_shared_ #ifndef _di_fake_build_library_static_ - void fake_build_library_static(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) { + void fake_build_library_static(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return; if (!data_build.setting.build_sources_library.used) return; @@ -917,14 +917,14 @@ extern "C" { fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling static library."); } - f_string_dynamic file_name = f_string_dynamic_initialize; - f_string_dynamic source_path = f_string_dynamic_initialize; - f_string_dynamics arguments = f_string_dynamics_initialize; + f_string_dynamic_t file_name = f_string_dynamic_t_initialize; + f_string_dynamic_t source_path = f_string_dynamic_t_initialize; + f_string_dynamics_t arguments = f_string_dynamics_t_initialize; *status = fll_execute_arguments_add(fake_build_parameter_object_link_arguments, fake_build_parameter_object_link_arguments_length, &arguments); if (F_status_is_fine(*status)) { - f_string_length destination_length = data.path_build_libraries_static.used + fake_build_parameter_library_name_prefix_length; + f_string_length_t destination_length = data.path_build_libraries_static.used + fake_build_parameter_library_name_prefix_length; destination_length += data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_static_length; char destination[destination_length + 1]; @@ -949,18 +949,18 @@ extern "C" { } if (F_status_is_fine(*status)) { - f_string_length source_length = 0; + f_string_length_t source_length = 0; - for (f_array_length i = 0; i < data_build.setting.build_sources_library.used; i++) { + for (f_array_length_t i = 0; i < data_build.setting.build_sources_library.used; i++) { source_path.used = 0; *status = fake_build_get_file_name_without_extension(data, data_build.setting.build_sources_library.array[i], &file_name); if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true); - f_macro_string_dynamic_delete_simple(file_name); - f_macro_string_dynamic_delete_simple(source_path); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamic_t_delete_simple(file_name); + f_macro_string_dynamic_t_delete_simple(source_path); + f_macro_string_dynamics_t_delete_simple(arguments); return; } @@ -1017,18 +1017,18 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); - f_macro_string_dynamic_delete_simple(file_name); - f_macro_string_dynamic_delete_simple(source_path); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamic_t_delete_simple(file_name); + f_macro_string_dynamic_t_delete_simple(source_path); + f_macro_string_dynamics_t_delete_simple(arguments); return; } } fake_execute(data, data_build.environment, data_build.setting.build_linker, arguments, status); - f_macro_string_dynamic_delete_simple(file_name); - f_macro_string_dynamic_delete_simple(source_path); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamic_t_delete_simple(file_name); + f_macro_string_dynamic_t_delete_simple(source_path); + f_macro_string_dynamics_t_delete_simple(arguments); if (F_status_is_fine(*status)) { fake_build_touch(data, file_stage, status); @@ -1037,19 +1037,19 @@ extern "C" { #endif // _di_fake_build_library_static_ #ifndef _di_fake_build_load_environment_ - void fake_build_load_environment(const fake_data data, const fake_build_data data_build, fake_environment *environment, f_status *status) { + void fake_build_load_environment(const fake_data_t data, const fake_build_data_t data_build, fake_environment_t *environment, f_status_t *status) { if (F_status_is_error(*status)) return; - f_string_dynamics names = f_string_dynamics_initialize; + f_string_dynamics_t names = f_string_dynamics_t_initialize; { // add the guaranteed environment variables. - const f_string variables_name[] = { + const f_string_t variables_name[] = { f_path_environment, f_path_present_working }; - const f_string_length variables_length[] = { + const f_string_length_t variables_length[] = { f_path_environment_length, f_path_present_working_length }; @@ -1058,11 +1058,11 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "f_macro_string_dynamics_new", F_true); - f_macro_string_dynamics_delete_simple(names); + f_macro_string_dynamics_t_delete_simple(names); return; } - f_string_dynamic part = f_string_dynamic_initialize; + f_string_dynamic_t part = f_string_dynamic_t_initialize; for (uint8_t i = 0; i < 2; i++) { *status = fl_string_append(variables_name[i], variables_length[i], &part); @@ -1073,12 +1073,12 @@ extern "C" { names.array[names.used].size = part.size; names.used++; - f_macro_string_dynamic_clear(part); + f_macro_string_dynamic_t_clear(part); } // for if (F_status_is_not_error(*status)) { if (names.used + data_build.setting.environment.used > names.size) { - if (names.used + data_build.setting.environment.used > f_array_length_size) { + if (names.used + data_build.setting.environment.used > f_array_length_t_size) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The values for the setting '"); @@ -1088,8 +1088,8 @@ extern "C" { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' is too large."); } - f_macro_string_dynamic_delete_simple(part); - f_macro_string_dynamics_delete_simple(names); + f_macro_string_dynamic_t_delete_simple(part); + f_macro_string_dynamics_t_delete_simple(names); *status = F_status_set_error(F_buffer_too_large); return; } @@ -1098,13 +1098,13 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "f_macro_string_dynamics_resize", F_true); - f_macro_string_dynamic_delete_simple(part); - f_macro_string_dynamics_delete_simple(names); + f_macro_string_dynamic_t_delete_simple(part); + f_macro_string_dynamics_t_delete_simple(names); return; } } - for (f_string_length i = 0; i < data_build.setting.environment.used; i++) { + for (f_string_length_t i = 0; i < data_build.setting.environment.used; i++) { *status = fl_string_dynamic_append_nulless(data_build.setting.environment.array[i], &part); if (F_status_is_error(*status)) break; @@ -1113,25 +1113,25 @@ extern "C" { names.array[names.used].size = part.size; names.used++; - f_macro_string_dynamic_clear(part); + f_macro_string_dynamic_t_clear(part); } // for } - f_macro_string_dynamic_delete_simple(part); + f_macro_string_dynamic_t_delete_simple(part); if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true); - f_macro_string_dynamics_delete_simple(names); + f_macro_string_dynamics_t_delete_simple(names); return; } } - f_string function = f_string_initialize; - f_string_dynamic variable_name = f_string_dynamic_initialize; - f_string_dynamic variable_value = f_string_dynamic_initialize; + f_string_t function = f_string_t_initialize; + f_string_dynamic_t variable_name = f_string_dynamic_t_initialize; + f_string_dynamic_t variable_value = f_string_dynamic_t_initialize; - for (f_string_length i = 0; i < names.used; i++) { + for (f_string_length_t i = 0; i < names.used; i++) { *status = f_environment_get_dynamic(names.array[i], &variable_value); if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_memory_reallocation) { @@ -1141,8 +1141,8 @@ extern "C" { } if (F_status_is_not_error(*status) && environment->names.used + 1 > environment->names.size) { - if (environment->names.size + f_memory_default_allocation_step > f_array_length_size) { - if (environment->names.size + 1 > f_array_length_size) { + if (environment->names.size + f_memory_default_allocation_step > f_array_length_t_size) { + if (environment->names.size + 1 > f_array_length_t_size) { *status = F_status_set_error(F_buffer_too_large); } else { @@ -1182,13 +1182,13 @@ extern "C" { environment->values.array[environment->values.used].size = variable_value.size; environment->values.used++; - f_macro_string_dynamic_clear(variable_name); - f_macro_string_dynamic_clear(variable_value); + f_macro_string_dynamic_t_clear(variable_name); + f_macro_string_dynamic_t_clear(variable_value); } // for - f_macro_string_dynamics_delete_simple(names); - f_macro_string_dynamic_delete_simple(variable_name); - f_macro_string_dynamic_delete_simple(variable_value); + f_macro_string_dynamics_t_delete_simple(names); + f_macro_string_dynamic_t_delete_simple(variable_name); + f_macro_string_dynamic_t_delete_simple(variable_value); if (F_status_is_error(*status)) { fake_print_error(data, *status, function, F_true); @@ -1197,19 +1197,19 @@ extern "C" { #endif // _di_fake_build_load_environment_ #ifndef _di_fake_build_load_setting_ - void fake_build_load_setting(const fake_data data, fake_build_setting *setting, f_status *status) { + void fake_build_load_setting(const fake_data_t data, fake_build_setting_t *setting, f_status_t *status) { if (F_status_is_error(*status)) return; { - f_string_dynamic buffer = f_string_dynamic_initialize; + f_string_dynamic_t buffer = f_string_dynamic_t_initialize; - f_fss_objects objects = f_fss_objects_initialize; - f_fss_contents contents = f_fss_contents_initialize; + f_fss_objects_t objects = f_fss_objects_t_initialize; + f_fss_contents_t contents = f_fss_contents_t_initialize; *status = fake_file_buffer(data, data.file_data_build_settings.string, &buffer); if (F_status_is_error(*status)) return; - f_string_range range = f_macro_string_range_initialize(buffer.used); + f_string_range_t range = f_macro_string_range_initialize(buffer.used); *status = fll_fss_extended_read(&buffer, &range, &objects, &contents, 0, 0); if (F_status_is_error(*status)) { @@ -1218,20 +1218,20 @@ extern "C" { fake_build_load_setting_process(data, data.file_data_build_settings.string, buffer, objects, contents, setting, status); - f_macro_string_dynamic_delete_simple(buffer); - f_macro_fss_objects_delete_simple(objects); - f_macro_fss_contents_delete_simple(contents); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_fss_objects_t_delete_simple(objects); + f_macro_fss_contents_t_delete_simple(contents); } // error when required settings are not specified. if (F_status_is_not_error(*status)) { bool failed = F_false; - f_string_static *settings[] = { + f_string_static_t *settings[] = { &setting->project_name, }; - f_string names[] = { + f_string_t names[] = { fake_build_setting_name_project_name, }; @@ -1259,12 +1259,12 @@ extern "C" { #endif // _di_fake_build_load_setting_ #ifndef _di_fake_build_load_setting_process_ - void fake_build_load_setting_process(const fake_data data, const f_string path_file, const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, fake_build_setting *setting, f_status *status) { + void fake_build_load_setting_process(const fake_data_t data, const f_string_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t *setting, f_status_t *status) { if (F_status_is_error(*status) && buffer.used) return; bool error_printed = F_false; - const f_string settings_name[] = { + const f_string_t settings_name[] = { fake_build_setting_name_build_compiler, fake_build_setting_name_build_language, fake_build_setting_name_build_libraries, @@ -1308,7 +1308,7 @@ extern "C" { fake_build_setting_name_version_target, }; - const f_string_length settings_length[] = { + const f_string_length_t settings_length[] = { fake_build_setting_name_build_compiler_length, fake_build_setting_name_build_language_length, fake_build_setting_name_build_libraries_length, @@ -1352,32 +1352,32 @@ extern "C" { fake_build_setting_name_version_target_length, }; - f_string_dynamics build_compiler = f_string_dynamics_initialize; - f_string_dynamics build_language = f_string_dynamics_initialize; - f_string_dynamics build_linker = f_string_dynamics_initialize; - f_string_dynamics build_script = f_string_dynamics_initialize; - f_string_dynamics build_shared = f_string_dynamics_initialize; - f_string_dynamics build_static = f_string_dynamics_initialize; - f_string_dynamics path_headers = f_string_dynamics_initialize; - f_string_dynamics path_language = f_string_dynamics_initialize; - f_string_dynamics path_library_script = f_string_dynamics_initialize; - f_string_dynamics path_library_shared = f_string_dynamics_initialize; - f_string_dynamics path_library_static = f_string_dynamics_initialize; - f_string_dynamics path_program_script = f_string_dynamics_initialize; - f_string_dynamics path_program_shared = f_string_dynamics_initialize; - f_string_dynamics path_program_static = f_string_dynamics_initialize; - f_string_dynamics process_post = f_string_dynamics_initialize; - f_string_dynamics process_pre = f_string_dynamics_initialize; - f_string_dynamics project_name = f_string_dynamics_initialize; - f_string_dynamics search_exclusive = f_string_dynamics_initialize; - f_string_dynamics search_shared = f_string_dynamics_initialize; - f_string_dynamics search_static = f_string_dynamics_initialize; - f_string_dynamics version_major = f_string_dynamics_initialize; - f_string_dynamics version_micro = f_string_dynamics_initialize; - f_string_dynamics version_minor = f_string_dynamics_initialize; - f_string_dynamics version_target = f_string_dynamics_initialize; - - f_string_dynamics *settings_value[] = { + f_string_dynamics_t build_compiler = f_string_dynamics_t_initialize; + f_string_dynamics_t build_language = f_string_dynamics_t_initialize; + f_string_dynamics_t build_linker = f_string_dynamics_t_initialize; + f_string_dynamics_t build_script = f_string_dynamics_t_initialize; + f_string_dynamics_t build_shared = f_string_dynamics_t_initialize; + f_string_dynamics_t build_static = f_string_dynamics_t_initialize; + f_string_dynamics_t path_headers = f_string_dynamics_t_initialize; + f_string_dynamics_t path_language = f_string_dynamics_t_initialize; + f_string_dynamics_t path_library_script = f_string_dynamics_t_initialize; + f_string_dynamics_t path_library_shared = f_string_dynamics_t_initialize; + f_string_dynamics_t path_library_static = f_string_dynamics_t_initialize; + f_string_dynamics_t path_program_script = f_string_dynamics_t_initialize; + f_string_dynamics_t path_program_shared = f_string_dynamics_t_initialize; + f_string_dynamics_t path_program_static = f_string_dynamics_t_initialize; + f_string_dynamics_t process_post = f_string_dynamics_t_initialize; + f_string_dynamics_t process_pre = f_string_dynamics_t_initialize; + f_string_dynamics_t project_name = f_string_dynamics_t_initialize; + f_string_dynamics_t search_exclusive = f_string_dynamics_t_initialize; + f_string_dynamics_t search_shared = f_string_dynamics_t_initialize; + f_string_dynamics_t search_static = f_string_dynamics_t_initialize; + f_string_dynamics_t version_major = f_string_dynamics_t_initialize; + f_string_dynamics_t version_micro = f_string_dynamics_t_initialize; + f_string_dynamics_t version_minor = f_string_dynamics_t_initialize; + f_string_dynamics_t version_target = f_string_dynamics_t_initialize; + + f_string_dynamics_t *settings_value[] = { &build_compiler, &build_language, &setting->build_libraries, @@ -1421,20 +1421,20 @@ extern "C" { &version_target, }; - f_string function = "fll_fss_snatch_apart"; + f_string_t function = "fll_fss_snatch_apart"; *status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, settings_length, fake_build_setting_total, settings_value, 0); if (*status == F_none) { - f_string_dynamic settings_mode_name_dynamic[fake_build_setting_total]; - f_string settings_mode_names[fake_build_setting_total]; - f_string_length setting_mode_lengths[fake_build_setting_total]; + f_string_dynamic_t settings_mode_name_dynamic[fake_build_setting_total]; + f_string_t settings_mode_names[fake_build_setting_total]; + f_string_length_t setting_mode_lengths[fake_build_setting_total]; - const f_string_dynamics *modes = &setting->modes_default; + const f_string_dynamics_t *modes = &setting->modes_default; bool found = F_false; - f_array_length i = 0; - f_array_length j = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; // if any mode is specified, the entire defaults is replaced. if (data.mode.used > 0) { @@ -1466,16 +1466,16 @@ extern "C" { break; } - memset(&settings_mode_name_dynamic, 0, sizeof(f_string_dynamic) * fake_build_setting_total); - memset(&settings_mode_names, 0, sizeof(f_string) * fake_build_setting_total); - memset(&setting_mode_lengths, 0, sizeof(f_string_length) * fake_build_setting_total); + memset(&settings_mode_name_dynamic, 0, sizeof(f_string_dynamic_t) * fake_build_setting_total); + memset(&settings_mode_names, 0, sizeof(f_string_t) * fake_build_setting_total); + memset(&setting_mode_lengths, 0, sizeof(f_string_length_t) * fake_build_setting_total); for (j = 0; j < fake_build_setting_total; j++) { setting_mode_lengths[j] = settings_length[j] + 1 + modes->array[i].used; - f_macro_string_dynamic_new(*status, settings_mode_name_dynamic[j], setting_mode_lengths[j]); + f_macro_string_dynamic_t_new(*status, settings_mode_name_dynamic[j], setting_mode_lengths[j]); if (F_status_is_error(*status)) { - function = "f_macro_string_dynamic_new"; + function = "f_macro_string_dynamic_t_new"; break; } @@ -1495,7 +1495,7 @@ extern "C" { } for (j = 0; j < fake_build_setting_total; j++) { - f_macro_string_dynamic_delete_simple(settings_mode_name_dynamic[j]); + f_macro_string_dynamic_t_delete_simple(settings_mode_name_dynamic[j]); } // for if (F_status_is_error(*status)) break; @@ -1517,7 +1517,7 @@ extern "C" { } } else { - const f_string settings_single_name[] = { + const f_string_t settings_single_name[] = { fake_build_setting_name_build_compiler, fake_build_setting_name_build_language, fake_build_setting_name_build_linker, @@ -1544,7 +1544,7 @@ extern "C" { fake_build_setting_name_version_target, }; - const f_string_statics *settings_single_source[] = { + const f_string_statics_t *settings_single_source[] = { &build_compiler, &build_language, &build_linker, @@ -1594,7 +1594,7 @@ extern "C" { &setting->search_static, }; - f_string_dynamic *settings_single_destination[] = { + f_string_dynamic_t *settings_single_destination[] = { &setting->build_compiler, 0, &setting->build_linker, @@ -1680,7 +1680,7 @@ extern "C" { 5, }; - for (f_array_length i = 0; i < 24; i++) { + for (f_array_length_t i = 0; i < 24; i++) { if (settings_single_source[i]->used == 0) continue; if (settings_single_source[i]->used > 1) { @@ -1811,51 +1811,51 @@ extern "C" { } // for } - f_macro_string_dynamics_delete_simple(build_compiler); - f_macro_string_dynamics_delete_simple(build_language); - f_macro_string_dynamics_delete_simple(build_linker); - f_macro_string_dynamics_delete_simple(build_script); - f_macro_string_dynamics_delete_simple(build_shared); - f_macro_string_dynamics_delete_simple(build_static); - f_macro_string_dynamics_delete_simple(path_headers); - f_macro_string_dynamics_delete_simple(path_language); - f_macro_string_dynamics_delete_simple(path_library_script); - f_macro_string_dynamics_delete_simple(path_library_shared); - f_macro_string_dynamics_delete_simple(path_library_static); - f_macro_string_dynamics_delete_simple(path_program_script); - f_macro_string_dynamics_delete_simple(path_program_shared); - f_macro_string_dynamics_delete_simple(path_program_static); - f_macro_string_dynamics_delete_simple(process_post); - f_macro_string_dynamics_delete_simple(process_pre); - f_macro_string_dynamics_delete_simple(project_name); - f_macro_string_dynamics_delete_simple(search_exclusive); - f_macro_string_dynamics_delete_simple(search_shared); - f_macro_string_dynamics_delete_simple(search_static); - f_macro_string_dynamics_delete_simple(version_major); - f_macro_string_dynamics_delete_simple(version_micro); - f_macro_string_dynamics_delete_simple(version_minor); - f_macro_string_dynamics_delete_simple(version_target); + f_macro_string_dynamics_t_delete_simple(build_compiler); + f_macro_string_dynamics_t_delete_simple(build_language); + f_macro_string_dynamics_t_delete_simple(build_linker); + f_macro_string_dynamics_t_delete_simple(build_script); + f_macro_string_dynamics_t_delete_simple(build_shared); + f_macro_string_dynamics_t_delete_simple(build_static); + f_macro_string_dynamics_t_delete_simple(path_headers); + f_macro_string_dynamics_t_delete_simple(path_language); + f_macro_string_dynamics_t_delete_simple(path_library_script); + f_macro_string_dynamics_t_delete_simple(path_library_shared); + f_macro_string_dynamics_t_delete_simple(path_library_static); + f_macro_string_dynamics_t_delete_simple(path_program_script); + f_macro_string_dynamics_t_delete_simple(path_program_shared); + f_macro_string_dynamics_t_delete_simple(path_program_static); + f_macro_string_dynamics_t_delete_simple(process_post); + f_macro_string_dynamics_t_delete_simple(process_pre); + f_macro_string_dynamics_t_delete_simple(project_name); + f_macro_string_dynamics_t_delete_simple(search_exclusive); + f_macro_string_dynamics_t_delete_simple(search_shared); + f_macro_string_dynamics_t_delete_simple(search_static); + f_macro_string_dynamics_t_delete_simple(version_major); + f_macro_string_dynamics_t_delete_simple(version_micro); + f_macro_string_dynamics_t_delete_simple(version_minor); + f_macro_string_dynamics_t_delete_simple(version_target); } #endif // _di_fake_build_load_setting_process_ #ifndef _di_fake_build_load_setting_defaults_ - void fake_build_load_setting_defaults(const fake_data data, fake_build_setting *setting, f_status *status) { + void fake_build_load_setting_defaults(const fake_data_t data, fake_build_setting_t *setting, f_status_t *status) { if (F_status_is_error(*status)) return; { - f_string sources[] = { + f_string_t sources[] = { fake_build_setting_default_version, fake_build_setting_default_version, fake_build_setting_default_version, }; - f_string_length lengths[] = { + f_string_length_t lengths[] = { fake_build_setting_default_version_length, fake_build_setting_default_version_length, fake_build_setting_default_version_length, }; - f_string_dynamic *destinations[] = { + f_string_dynamic_t *destinations[] = { &setting->version_major, &setting->version_minor, &setting->version_micro, @@ -1986,10 +1986,10 @@ extern "C" { #endif // _di_fake_build_load_setting_defaults_ #ifndef _di_fake_build_load_stage_ - void fake_build_load_stage(const fake_data data, fake_build_stage *stage, f_status *status) { + void fake_build_load_stage(const fake_data_t data, fake_build_stage_t *stage, f_status_t *status) { if (F_status_is_error(*status)) return; - const f_string names[] = { + const f_string_t names[] = { fake_build_stage_libraries_script, fake_build_stage_libraries_shared, fake_build_stage_libraries_static, @@ -2005,7 +2005,7 @@ extern "C" { fake_build_stage_sources_settings, }; - const f_string_length lengths[] = { + const f_string_length_t lengths[] = { fake_build_stage_libraries_script_length, fake_build_stage_libraries_shared_length, fake_build_stage_libraries_static_length, @@ -2021,7 +2021,7 @@ extern "C" { fake_build_stage_sources_settings_length, }; - f_string_dynamic *values[] = { + f_string_dynamic_t *values[] = { &stage->file_libraries_script, &stage->file_libraries_shared, &stage->file_libraries_static, @@ -2076,7 +2076,7 @@ extern "C" { #endif // _di_fake_build_load_stage_ #ifndef _di_fake_build_objects_static_ - void fake_build_objects_static(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) { + void fake_build_objects_static(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return; if (!data_build.setting.build_sources_library.used) return; @@ -2085,19 +2085,19 @@ extern "C" { fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling static objects."); } - f_string_dynamic file_name = f_string_dynamic_initialize; - f_string_dynamic destination_path = f_string_dynamic_initialize; - f_string_dynamics arguments = f_string_dynamics_initialize; - f_string_length source_length = 0; - f_string_length destination_length = 0; + f_string_dynamic_t file_name = f_string_dynamic_t_initialize; + f_string_dynamic_t destination_path = f_string_dynamic_t_initialize; + f_string_dynamics_t arguments = f_string_dynamics_t_initialize; + f_string_length_t source_length = 0; + f_string_length_t destination_length = 0; - const f_string_static *path_sources = &data.path_sources_c; + const f_string_static_t *path_sources = &data.path_sources_c; if (data_build.setting.build_language == fake_build_language_type_cpp) { path_sources = &data.path_sources_cpp; } - for (f_array_length i = 0; i < data_build.setting.build_sources_library.used; i++) { + for (f_array_length_t i = 0; i < data_build.setting.build_sources_library.used; i++) { file_name.used = 0; destination_path.used = 0; @@ -2113,9 +2113,9 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true); - f_macro_string_dynamic_delete_simple(file_name); - f_macro_string_dynamic_delete_simple(destination_path); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamic_t_delete_simple(file_name); + f_macro_string_dynamic_t_delete_simple(destination_path); + f_macro_string_dynamics_t_delete_simple(arguments); return; } @@ -2204,7 +2204,7 @@ extern "C" { destination[destination_length] = 0; - const f_string values[] = { + const f_string_t values[] = { source, fake_build_parameter_object_compile, fake_build_parameter_object_static, @@ -2212,7 +2212,7 @@ extern "C" { destination, }; - const f_string_length lengths[] = { + const f_string_length_t lengths[] = { source_length, fake_build_parameter_object_compile_length, fake_build_parameter_object_static_length, @@ -2235,12 +2235,12 @@ extern "C" { fake_execute(data, data_build.environment, data_build.setting.build_compiler, arguments, status); if (F_status_is_error(*status)) break; - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); } // for - f_macro_string_dynamic_delete_simple(file_name); - f_macro_string_dynamic_delete_simple(destination_path); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamic_t_delete_simple(file_name); + f_macro_string_dynamic_t_delete_simple(destination_path); + f_macro_string_dynamics_t_delete_simple(arguments); if (F_status_is_fine(*status)) { fake_build_touch(data, file_stage, status); @@ -2249,19 +2249,19 @@ extern "C" { #endif // _di_fake_build_objects_static_ #ifndef _di_fake_build_operate_ - f_return_status fake_build_operate(const fake_data data) { + f_return_status fake_build_operate(const fake_data_t data) { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Building project."); } - f_status status = F_none; - f_mode mode = f_mode_initialize; + f_status_t status = F_none; + f_mode_t mode = f_mode_t_initialize; - fake_build_data data_build = fake_build_data_initialize; - fake_build_stage stage = fake_build_stage_initialize; + fake_build_data_t data_build = fake_build_data_t_initialize; + fake_build_stage_t stage = fake_build_stage_t_initialize; - f_macro_mode_set_default_umask(mode, data.umask); + f_macro_mode_t_set_default_umask(mode, data.umask); fake_build_load_setting(data, &data_build.setting, &status); @@ -2286,14 +2286,14 @@ extern "C" { } else { if (data_build.setting.build_sources_headers.used) { - const f_string_static *path_sources = &data.path_sources_c; + const f_string_static_t *path_sources = &data.path_sources_c; if (data_build.setting.build_language == fake_build_language_type_cpp) { path_sources = &data.path_sources_cpp; } - f_string_static path_headers = f_string_static_initialize; - f_string_length directory_headers_length = data.path_build_includes.used + data_build.setting.path_headers.used; + f_string_static_t path_headers = f_string_static_t_initialize; + f_string_length_t directory_headers_length = data.path_build_includes.used + data_build.setting.path_headers.used; char directory_headers[directory_headers_length + 1]; @@ -2342,14 +2342,14 @@ extern "C" { fake_build_execute_process_script(data, data_build, data_build.setting.process_post, stage.file_process_post, &status); fake_macro_build_data_delete_simple(data_build); - fake_macro_build_stage_delete_simple(stage); + fake_macro_build_stage_t_delete_simple(stage); return status; } #endif // _di_fake_build_operate_ #ifndef _di_fake_build_programs_script_ - void fake_build_programs_script(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) { + void fake_build_programs_script(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return; // @todo needs to perform some sort of regex replace on the program scripts. @@ -2359,7 +2359,7 @@ extern "C" { #endif // _di_fake_build_programs_script_ #ifndef _di_fake_build_program_shared_ - void fake_build_program_shared(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) { + void fake_build_program_shared(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return; if (!data_build.setting.build_sources_program.used) return; @@ -2368,18 +2368,18 @@ extern "C" { fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling shared program."); } - f_string_dynamics arguments = f_string_dynamics_initialize; + f_string_dynamics_t arguments = f_string_dynamics_t_initialize; { - const f_string_static *path_sources = &data.path_sources_c; + const f_string_static_t *path_sources = &data.path_sources_c; if (data_build.setting.build_language == fake_build_language_type_cpp) { path_sources = &data.path_sources_cpp; } - f_string_length source_length = 0; + f_string_length_t source_length = 0; - for (f_array_length i = 0; i < data_build.setting.build_sources_program.used; i++) { + for (f_array_length_t i = 0; i < data_build.setting.build_sources_program.used; i++) { source_length = path_sources->used + data_build.setting.build_sources_program.array[i].used; char source[source_length + 1]; @@ -2394,7 +2394,7 @@ extern "C" { } if (F_status_is_fine(*status)) { - f_string_length parameter_file_name_path_length = data.path_build_programs_shared.used + data_build.setting.project_name.used; + f_string_length_t parameter_file_name_path_length = data.path_build_programs_shared.used + data_build.setting.project_name.used; char parameter_file_name_path[parameter_file_name_path_length + 1]; @@ -2402,12 +2402,12 @@ extern "C" { memcpy(parameter_file_name_path + data.path_build_programs_shared.used, data_build.setting.project_name.string, data_build.setting.project_name.used); parameter_file_name_path[parameter_file_name_path_length] = 0; - const f_string values[] = { + const f_string_t values[] = { fake_build_parameter_library_output, parameter_file_name_path, }; - const f_string_length lengths[] = { + const f_string_length_t lengths[] = { fake_build_parameter_library_output_length, parameter_file_name_path_length, }; @@ -2420,7 +2420,7 @@ extern "C" { // if project-specific library sources exist, then the -lproject_name needs to be added to the arguments. if (F_status_is_fine(*status) && data_build.setting.build_sources_library.used > 0) { - f_string_length link_project_library_length = fake_build_parameter_library_link_file_length + data_build.setting.project_name.used; + f_string_length_t link_project_library_length = fake_build_parameter_library_link_file_length + data_build.setting.project_name.used; char link_project_library[link_project_library_length + 1]; @@ -2436,13 +2436,13 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return; } fake_execute(data, data_build.environment, data_build.setting.build_compiler, arguments, status); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); if (F_status_is_fine(*status)) { fake_build_touch(data, file_stage, status); @@ -2451,7 +2451,7 @@ extern "C" { #endif // _di_fake_build_program_shared_ #ifndef _di_fake_build_program_static_ - void fake_build_program_static(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) { + void fake_build_program_static(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true) return; if (!data_build.setting.build_sources_program.used) return; @@ -2460,18 +2460,18 @@ extern "C" { fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling static program."); } - f_string_dynamics arguments = f_string_dynamics_initialize; + f_string_dynamics_t arguments = f_string_dynamics_t_initialize; { - const f_string_static *path_sources = &data.path_sources_c; + const f_string_static_t *path_sources = &data.path_sources_c; if (data_build.setting.build_language == fake_build_language_type_cpp) { path_sources = &data.path_sources_cpp; } - f_string_length source_length = 0; + f_string_length_t source_length = 0; - for (f_array_length i = 0; i < data_build.setting.build_sources_program.used; i++) { + for (f_array_length_t i = 0; i < data_build.setting.build_sources_program.used; i++) { if (!data_build.setting.build_sources_program.array[i].used) continue; source_length = path_sources->used + data_build.setting.build_sources_program.array[i].used; @@ -2488,7 +2488,7 @@ extern "C" { } if (F_status_is_fine(*status)) { - f_string_length source_library_length = data.path_build_libraries_static.used + fake_build_parameter_library_name_prefix_length + data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_static_length; + f_string_length_t source_library_length = data.path_build_libraries_static.used + fake_build_parameter_library_name_prefix_length + data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_static_length; char source_library[source_library_length + 1]; @@ -2508,7 +2508,7 @@ extern "C" { source_library[source_library_length] = 0; - f_string_length parameter_file_name_path_length = data.path_build_programs_static.used + data_build.setting.project_name.used; + f_string_length_t parameter_file_name_path_length = data.path_build_programs_static.used + data_build.setting.project_name.used; char parameter_file_name_path[parameter_file_name_path_length + 1]; @@ -2516,14 +2516,14 @@ extern "C" { memcpy(parameter_file_name_path + data.path_build_programs_static.used, data_build.setting.project_name.string, data_build.setting.project_name.used); parameter_file_name_path[parameter_file_name_path_length] = 0; - const f_string values[] = { + const f_string_t values[] = { source_library, fake_build_parameter_library_static, fake_build_parameter_library_output, parameter_file_name_path, }; - const f_string_length lengths[] = { + const f_string_length_t lengths[] = { source_library_length, fake_build_parameter_library_static_length, fake_build_parameter_library_output_length, @@ -2541,13 +2541,13 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return; } fake_execute(data, data_build.environment, data_build.setting.build_compiler, arguments, status); - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); if (F_status_is_fine(*status)) { fake_build_touch(data, file_stage, status); @@ -2556,12 +2556,12 @@ extern "C" { #endif // _di_fake_build_program_static_ #ifndef _di_fake_build_touch_ - void fake_build_touch(const fake_data data, const f_string_dynamic file, f_status *status) { + void fake_build_touch(const fake_data_t data, const f_string_dynamic_t file, f_status_t *status) { if (F_status_is_error(*status)) return; - f_mode mode = f_mode_initialize; + f_mode_t mode = f_mode_t_initialize; - f_macro_mode_set_default_umask(mode, data.umask); + f_macro_mode_t_set_default_umask(mode, data.umask); *status = f_file_touch(file.string, mode.regular, F_false); diff --git a/level_3/fake/c/private-build.h b/level_3/fake/c/private-build.h index 6f0a8ae..d4e8e53 100644 --- a/level_3/fake/c/private-build.h +++ b/level_3/fake/c/private-build.h @@ -12,7 +12,7 @@ extern "C" { #endif -#ifndef _di_fake_build_setting_ +#ifndef _di_fake_build_setting_t_ typedef struct { uint8_t build_language; @@ -26,43 +26,43 @@ extern "C" { bool search_shared; bool search_static; - f_string_dynamic build_compiler; - f_string_dynamic build_linker; - f_string_dynamic path_headers; - f_string_dynamic path_language; - f_string_dynamic path_library_script; - f_string_dynamic path_library_shared; - f_string_dynamic path_library_static; - f_string_dynamic path_program_script; - f_string_dynamic path_program_shared; - f_string_dynamic path_program_static; - f_string_dynamic process_post; - f_string_dynamic process_pre; - f_string_dynamic project_name; - f_string_dynamic version_major; - f_string_dynamic version_micro; - f_string_dynamic version_minor; - - f_string_dynamics build_libraries; - f_string_dynamics build_sources_headers; - f_string_dynamics build_sources_library; - f_string_dynamics build_sources_program; - f_string_dynamics build_sources_setting; - f_string_dynamics build_sources_script; - f_string_dynamics defines_all; - f_string_dynamics defines_shared; - f_string_dynamics defines_static; - f_string_dynamics environment; - f_string_dynamics flags_all; - f_string_dynamics flags_library; - f_string_dynamics flags_program; - f_string_dynamics flags_shared; - f_string_dynamics flags_static; - f_string_dynamics modes; - f_string_dynamics modes_default; - } fake_build_setting; - - #define fake_build_setting_initialize { \ + f_string_dynamic_t build_compiler; + f_string_dynamic_t build_linker; + f_string_dynamic_t path_headers; + f_string_dynamic_t path_language; + f_string_dynamic_t path_library_script; + f_string_dynamic_t path_library_shared; + f_string_dynamic_t path_library_static; + f_string_dynamic_t path_program_script; + f_string_dynamic_t path_program_shared; + f_string_dynamic_t path_program_static; + f_string_dynamic_t process_post; + f_string_dynamic_t process_pre; + f_string_dynamic_t project_name; + f_string_dynamic_t version_major; + f_string_dynamic_t version_micro; + f_string_dynamic_t version_minor; + + f_string_dynamics_t build_libraries; + f_string_dynamics_t build_sources_headers; + f_string_dynamics_t build_sources_library; + f_string_dynamics_t build_sources_program; + f_string_dynamics_t build_sources_setting; + f_string_dynamics_t build_sources_script; + f_string_dynamics_t defines_all; + f_string_dynamics_t defines_shared; + f_string_dynamics_t defines_static; + f_string_dynamics_t environment; + f_string_dynamics_t flags_all; + f_string_dynamics_t flags_library; + f_string_dynamics_t flags_program; + f_string_dynamics_t flags_shared; + f_string_dynamics_t flags_static; + f_string_dynamics_t modes; + f_string_dynamics_t modes_default; + } fake_build_setting_t; + + #define fake_build_setting_t_initialize { \ 0, \ 0, \ F_true, \ @@ -71,75 +71,75 @@ extern "C" { F_true, \ F_true, \ F_true, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ } - #define fake_macro_build_setting_delete_simple(setting) \ - f_macro_string_dynamic_delete_simple(setting.build_compiler) \ - f_macro_string_dynamic_delete_simple(setting.build_linker) \ - f_macro_string_dynamic_delete_simple(setting.path_headers) \ - f_macro_string_dynamic_delete_simple(setting.path_language) \ - f_macro_string_dynamic_delete_simple(setting.path_library_script) \ - f_macro_string_dynamic_delete_simple(setting.path_library_shared) \ - f_macro_string_dynamic_delete_simple(setting.path_library_static) \ - f_macro_string_dynamic_delete_simple(setting.path_program_script) \ - f_macro_string_dynamic_delete_simple(setting.path_program_shared) \ - f_macro_string_dynamic_delete_simple(setting.path_program_static) \ - f_macro_string_dynamic_delete_simple(setting.process_post) \ - f_macro_string_dynamic_delete_simple(setting.process_pre) \ - f_macro_string_dynamic_delete_simple(setting.project_name) \ - f_macro_string_dynamic_delete_simple(setting.version_major) \ - f_macro_string_dynamic_delete_simple(setting.version_micro) \ - f_macro_string_dynamic_delete_simple(setting.version_minor) \ - f_macro_string_dynamics_delete_simple(setting.build_libraries) \ - f_macro_string_dynamics_delete_simple(setting.build_sources_headers) \ - f_macro_string_dynamics_delete_simple(setting.build_sources_library) \ - f_macro_string_dynamics_delete_simple(setting.build_sources_program) \ - f_macro_string_dynamics_delete_simple(setting.build_sources_setting) \ - f_macro_string_dynamics_delete_simple(setting.build_sources_script) \ - f_macro_string_dynamics_delete_simple(setting.defines_all) \ - f_macro_string_dynamics_delete_simple(setting.defines_shared) \ - f_macro_string_dynamics_delete_simple(setting.defines_static) \ - f_macro_string_dynamics_delete_simple(setting.environment) \ - f_macro_string_dynamics_delete_simple(setting.flags_all) \ - f_macro_string_dynamics_delete_simple(setting.flags_library) \ - f_macro_string_dynamics_delete_simple(setting.flags_program) \ - f_macro_string_dynamics_delete_simple(setting.flags_shared) \ - f_macro_string_dynamics_delete_simple(setting.flags_static) \ - f_macro_string_dynamics_delete_simple(setting.modes) \ - f_macro_string_dynamics_delete_simple(setting.modes_default) + #define fake_macro_build_setting_t_delete_simple(setting) \ + f_macro_string_dynamic_t_delete_simple(setting.build_compiler) \ + f_macro_string_dynamic_t_delete_simple(setting.build_linker) \ + f_macro_string_dynamic_t_delete_simple(setting.path_headers) \ + f_macro_string_dynamic_t_delete_simple(setting.path_language) \ + f_macro_string_dynamic_t_delete_simple(setting.path_library_script) \ + f_macro_string_dynamic_t_delete_simple(setting.path_library_shared) \ + f_macro_string_dynamic_t_delete_simple(setting.path_library_static) \ + f_macro_string_dynamic_t_delete_simple(setting.path_program_script) \ + f_macro_string_dynamic_t_delete_simple(setting.path_program_shared) \ + f_macro_string_dynamic_t_delete_simple(setting.path_program_static) \ + f_macro_string_dynamic_t_delete_simple(setting.process_post) \ + f_macro_string_dynamic_t_delete_simple(setting.process_pre) \ + f_macro_string_dynamic_t_delete_simple(setting.project_name) \ + f_macro_string_dynamic_t_delete_simple(setting.version_major) \ + f_macro_string_dynamic_t_delete_simple(setting.version_micro) \ + f_macro_string_dynamic_t_delete_simple(setting.version_minor) \ + f_macro_string_dynamics_t_delete_simple(setting.build_libraries) \ + f_macro_string_dynamics_t_delete_simple(setting.build_sources_headers) \ + f_macro_string_dynamics_t_delete_simple(setting.build_sources_library) \ + f_macro_string_dynamics_t_delete_simple(setting.build_sources_program) \ + f_macro_string_dynamics_t_delete_simple(setting.build_sources_setting) \ + f_macro_string_dynamics_t_delete_simple(setting.build_sources_script) \ + f_macro_string_dynamics_t_delete_simple(setting.defines_all) \ + f_macro_string_dynamics_t_delete_simple(setting.defines_shared) \ + f_macro_string_dynamics_t_delete_simple(setting.defines_static) \ + f_macro_string_dynamics_t_delete_simple(setting.environment) \ + f_macro_string_dynamics_t_delete_simple(setting.flags_all) \ + f_macro_string_dynamics_t_delete_simple(setting.flags_library) \ + f_macro_string_dynamics_t_delete_simple(setting.flags_program) \ + f_macro_string_dynamics_t_delete_simple(setting.flags_shared) \ + f_macro_string_dynamics_t_delete_simple(setting.flags_static) \ + f_macro_string_dynamics_t_delete_simple(setting.modes) \ + f_macro_string_dynamics_t_delete_simple(setting.modes_default) #define fake_build_setting_name_build_compiler "build_compiler" #define fake_build_setting_name_build_language "build_language" @@ -230,57 +230,57 @@ extern "C" { #define fake_build_setting_default_version "0" #define fake_build_setting_default_version_length 1 -#endif // _di_fake_build_setting_ +#endif // _di_fake_build_setting_t_ -#ifndef _di_fake_build_stage_ +#ifndef _di_fake_build_stage_t_ typedef struct { - f_string_dynamic file_libraries_script; - f_string_dynamic file_libraries_shared; - f_string_dynamic file_libraries_static; - f_string_dynamic file_objects_static; - f_string_dynamic file_process_post; - f_string_dynamic file_process_pre; - f_string_dynamic file_programs_script; - f_string_dynamic file_programs_shared; - f_string_dynamic file_programs_static; - f_string_dynamic file_skeleton; - f_string_dynamic file_sources_headers; - f_string_dynamic file_sources_script; - f_string_dynamic file_sources_settings; - } fake_build_stage; - - #define fake_build_stage_initialize { \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ + f_string_dynamic_t file_libraries_script; + f_string_dynamic_t file_libraries_shared; + f_string_dynamic_t file_libraries_static; + f_string_dynamic_t file_objects_static; + f_string_dynamic_t file_process_post; + f_string_dynamic_t file_process_pre; + f_string_dynamic_t file_programs_script; + f_string_dynamic_t file_programs_shared; + f_string_dynamic_t file_programs_static; + f_string_dynamic_t file_skeleton; + f_string_dynamic_t file_sources_headers; + f_string_dynamic_t file_sources_script; + f_string_dynamic_t file_sources_settings; + } fake_build_stage_t; + + #define fake_build_stage_t_initialize { \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ } #define fake_build_stage_total 13 - #define fake_macro_build_stage_delete_simple(stage) \ - f_macro_string_dynamic_delete_simple(stage.file_libraries_script) \ - f_macro_string_dynamic_delete_simple(stage.file_libraries_shared) \ - f_macro_string_dynamic_delete_simple(stage.file_libraries_static) \ - f_macro_string_dynamic_delete_simple(stage.file_objects_static) \ - f_macro_string_dynamic_delete_simple(stage.file_process_post) \ - f_macro_string_dynamic_delete_simple(stage.file_process_pre) \ - f_macro_string_dynamic_delete_simple(stage.file_programs_script) \ - f_macro_string_dynamic_delete_simple(stage.file_programs_shared) \ - f_macro_string_dynamic_delete_simple(stage.file_programs_static) \ - f_macro_string_dynamic_delete_simple(stage.file_skeleton) \ - f_macro_string_dynamic_delete_simple(stage.file_sources_headers) \ - f_macro_string_dynamic_delete_simple(stage.file_sources_script) \ - f_macro_string_dynamic_delete_simple(stage.file_sources_settings) + #define fake_macro_build_stage_t_delete_simple(stage) \ + f_macro_string_dynamic_t_delete_simple(stage.file_libraries_script) \ + f_macro_string_dynamic_t_delete_simple(stage.file_libraries_shared) \ + f_macro_string_dynamic_t_delete_simple(stage.file_libraries_static) \ + f_macro_string_dynamic_t_delete_simple(stage.file_objects_static) \ + f_macro_string_dynamic_t_delete_simple(stage.file_process_post) \ + f_macro_string_dynamic_t_delete_simple(stage.file_process_pre) \ + f_macro_string_dynamic_t_delete_simple(stage.file_programs_script) \ + f_macro_string_dynamic_t_delete_simple(stage.file_programs_shared) \ + f_macro_string_dynamic_t_delete_simple(stage.file_programs_static) \ + f_macro_string_dynamic_t_delete_simple(stage.file_skeleton) \ + f_macro_string_dynamic_t_delete_simple(stage.file_sources_headers) \ + f_macro_string_dynamic_t_delete_simple(stage.file_sources_script) \ + f_macro_string_dynamic_t_delete_simple(stage.file_sources_settings) #define fake_build_stage_libraries_script "libraries_script.built" #define fake_build_stage_libraries_shared "libraries_shared.built" @@ -309,23 +309,23 @@ extern "C" { #define fake_build_stage_sources_headers_length 21 #define fake_build_stage_sources_script_length 20 #define fake_build_stage_sources_settings_length 22 -#endif // _di_fake_build_stage_ +#endif // _di_fake_build_stage_t_ -#ifndef _di_fake_build_data_ +#ifndef _di_fake_build_data_t_ typedef struct { - fake_build_setting setting; - fake_environment environment; - } fake_build_data; + fake_build_setting_t setting; + fake_environment_t environment; + } fake_build_data_t; - #define fake_build_data_initialize { \ - fake_build_setting_initialize, \ - fake_environment_initialize, \ + #define fake_build_data_t_initialize { \ + fake_build_setting_t_initialize, \ + fake_environment_t_initialize, \ } #define fake_macro_build_data_delete_simple(build) \ - fake_macro_build_setting_delete_simple(build.setting) \ - fake_macro_environment_delete_simple(build.environment) -#endif // _di_fake_build_data_ + fake_macro_build_setting_t_delete_simple(build.setting) \ + fake_macro_environment_t_delete_simple(build.environment) +#endif // _di_fake_build_data_t_ #ifndef _di_fake_build_parameter_ @@ -397,7 +397,7 @@ extern "C" { * @see fll_execute_arguments_add() */ #ifndef _di_fake_build_arguments_standard_add_ - extern void fake_build_arguments_standard_add(const fake_data data, const fake_build_data data_build, const bool is_shared, const bool is_library, f_string_dynamics *arguments, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_arguments_standard_add(const fake_data_t data, const fake_build_data_t data_build, const bool is_shared, const bool is_library, f_string_dynamics_t *arguments, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_arguments_standard_add_ /** @@ -426,7 +426,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_copy_ - extern void fake_build_copy(const fake_data data, const f_mode mode, const f_string label, const f_string_static source, const f_string_static destination, const f_string_statics files, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_copy(const fake_data_t data, const f_mode_t mode, const f_string_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_copy_ /** @@ -449,7 +449,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_skeleton_ - extern void fake_build_skeleton(const fake_data data, const fake_build_data data_build, const mode_t mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_skeleton(const fake_data_t data, const fake_build_data_t data_build, const mode_t mode, const f_string_static_t file_stage, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_skeleton_ /** @@ -473,7 +473,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_execute_process_script_ - extern void fake_build_execute_process_script(const fake_data data, const fake_build_data data_build, const f_string_static process_script, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_execute_process_script(const fake_data_t data, const fake_build_data_t data_build, const f_string_static_t process_script, const f_string_static_t file_stage, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_execute_process_script_ /** @@ -492,7 +492,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_get_file_name_without_extension_ - extern f_return_status fake_build_get_file_name_without_extension(const fake_data data, const f_string_static path, f_string_dynamic *name); + extern f_return_status fake_build_get_file_name_without_extension(const fake_data_t data, const f_string_static_t path, f_string_dynamic_t *name); #endif // _di_fake_build_get_file_name_without_extension_ /** @@ -515,7 +515,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_libraries_script_ - extern void fake_build_libraries_script(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_libraries_script(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_libraries_script_ /** @@ -538,7 +538,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_library_shared_ - extern void fake_build_library_shared(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_library_shared(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_library_shared_ /** @@ -561,7 +561,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_library_static_ - extern void fake_build_library_static(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_library_static(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_library_static_ /** @@ -581,7 +581,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_load_setting_ - extern void fake_build_load_setting(const fake_data data, fake_build_setting *setting, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_load_setting(const fake_data_t data, fake_build_setting_t *setting, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_load_setting_ /** @@ -605,7 +605,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_load_setting_defaults_ - extern void fake_build_load_setting_defaults(const fake_data data, fake_build_setting *setting, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_load_setting_defaults(const fake_data_t data, fake_build_setting_t *setting, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_load_setting_defaults_ /** @@ -633,7 +633,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_load_setting_process_ - extern void fake_build_load_setting_process(const fake_data data, const f_string path_file, const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, fake_build_setting *setting, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_load_setting_process(const fake_data_t data, const f_string_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t *setting, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_load_setting_process_ /** @@ -654,7 +654,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_load_environment_ - extern void fake_build_load_environment(const fake_data data, const fake_build_data data_build, fake_environment *environment, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_load_environment(const fake_data_t data, const fake_build_data_t data_build, fake_environment_t *environment, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_load_environment_ /** @@ -673,7 +673,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_load_stage_ - extern void fake_build_load_stage(const fake_data data, fake_build_stage *stage, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_load_stage(const fake_data_t data, fake_build_stage_t *stage, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_load_stage_ /** @@ -696,7 +696,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_objects_static_ - extern void fake_build_objects_static(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_objects_static(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_objects_static_ /** @@ -711,7 +711,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_operate_ - extern f_return_status fake_build_operate(const fake_data data) f_gcc_attribute_visibility_internal; + extern f_return_status fake_build_operate(const fake_data_t data) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_operate_ /** @@ -734,7 +734,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_programs_script_ - extern void fake_build_programs_script(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_programs_script(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_programs_script_ /** @@ -757,7 +757,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_program_shared_ - extern void fake_build_program_shared(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_program_shared(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_program_shared_ /** @@ -780,7 +780,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_program_static_ - extern void fake_build_program_static(const fake_data data, const fake_build_data data_build, const f_mode mode, const f_string_static file_stage, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_program_static(const fake_data_t data, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_program_static_ /** @@ -796,7 +796,7 @@ extern "C" { * @see f_file_touch() */ #ifndef _di_fake_build_touch_ - extern void fake_build_touch(const fake_data data, const f_string_dynamic file, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_build_touch(const fake_data_t data, const f_string_dynamic_t file, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_build_touch_ #ifdef __cplusplus diff --git a/level_3/fake/c/private-clean.c b/level_3/fake/c/private-clean.c index f212c14..24e1d4d 100644 --- a/level_3/fake/c/private-clean.c +++ b/level_3/fake/c/private-clean.c @@ -10,8 +10,8 @@ extern "C" { #endif #ifndef _di_fake_clean_operate_ - f_return_status fake_clean_operate(const fake_data data) { - f_status status = F_none; + f_return_status fake_clean_operate(const fake_data_t data) { + f_status_t status = F_none; if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); diff --git a/level_3/fake/c/private-clean.h b/level_3/fake/c/private-clean.h index 7121f09..3e333e8 100644 --- a/level_3/fake/c/private-clean.h +++ b/level_3/fake/c/private-clean.h @@ -24,7 +24,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_clean_operate_ - extern f_return_status fake_clean_operate(const fake_data data) f_gcc_attribute_visibility_internal; + extern f_return_status fake_clean_operate(const fake_data_t data) f_gcc_attribute_visibility_internal; #endif // _di_fake_clean_operate_ /** diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index 50a93bd..5e50501 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -9,13 +9,13 @@ extern "C" { #endif #ifndef _di_fake_execute_ - void fake_execute(const fake_data data, const fake_environment environment, const f_string_static program, const f_string_statics arguments, f_status *status) { + void fake_execute(const fake_data_t data, const fake_environment_t environment, const f_string_static_t program, const f_string_statics_t arguments, f_status_t *status) { if (F_status_is_error(*status)) return; if (data.verbosity == fake_verbosity_verbose) { printf("%s", program.string); - for (f_array_length i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; i++) { if (arguments.array[i].used == 0) continue; printf(" %s", arguments.array[i].string); @@ -53,16 +53,16 @@ extern "C" { #endif // _di_fake_execute_ #ifndef _di_fake_file_buffer_ - f_return_status fake_file_buffer(const fake_data data, const f_string path_file, f_string_dynamic *buffer) { - f_file file = f_file_initialize; - f_string name_function = "f_file_exists"; - f_status status = F_none; + f_return_status fake_file_buffer(const fake_data_t data, const f_string_t path_file, f_string_dynamic_t *buffer) { + f_file_t file = f_file_t_initialize; + f_string_t name_function = "f_file_exists"; + f_status_t status = F_none; status = f_file_exists(data.file_data_build_settings.string); if (status == F_true) { { - f_string_length size_file = 0; + f_string_length_t size_file = 0; name_function = "f_file_size"; status = f_file_size(path_file, F_true, &size_file); @@ -72,11 +72,11 @@ extern "C" { size_file = fake_common_initial_buffer_max; } - f_macro_string_dynamic_new((status), (*buffer), size_file); + f_macro_string_dynamic_t_new((status), (*buffer), size_file); if (F_status_is_error(status)) { fake_print_error_file(data, F_status_set_fine(status), name_function, path_file, "allocate buffer size for", F_true, F_true); - f_macro_string_dynamic_delete_simple((*buffer)); + f_macro_string_dynamic_t_delete_simple((*buffer)); return status; } } @@ -101,7 +101,7 @@ extern "C" { if (F_status_is_error(status)) { fake_print_error_file(data, F_status_set_fine(status), name_function, path_file, "read", F_true, F_true); - f_macro_string_dynamic_delete_simple((*buffer)); + f_macro_string_dynamic_t_delete_simple((*buffer)); } return status; @@ -109,12 +109,12 @@ extern "C" { #endif // _di_fake_file_buffer_ #ifndef _di_fake_path_generate_ - f_return_status fake_path_generate(fake_data *data) { - f_status status = F_none; + f_return_status fake_path_generate(fake_data_t *data) { + f_status_t status = F_none; uint8_t i = 0; { - const f_string_dynamic *parameters_source[] = { + const f_string_dynamic_t *parameters_source[] = { &data->path_build, &data->path_data, &data->path_sources, @@ -126,7 +126,7 @@ extern "C" { 4, }; - f_string_dynamic *parameters_value_0[] = { + f_string_dynamic_t *parameters_value_0[] = { &data->path_build_documents, &data->path_build_includes, &data->path_build_libraries, @@ -136,19 +136,19 @@ extern "C" { &data->path_build_stage, }; - f_string_dynamic *parameters_value_1[] = { + f_string_dynamic_t *parameters_value_1[] = { &data->path_data_build, &data->path_data_settings, }; - f_string_dynamic *parameters_value_2[] = { + f_string_dynamic_t *parameters_value_2[] = { &data->path_sources_bash, &data->path_sources_c, &data->path_sources_cpp, &data->path_sources_script, }; - f_string_dynamic **parameters_value[] = { + f_string_dynamic_t **parameters_value[] = { parameters_value_0, parameters_value_1, parameters_value_2, @@ -165,7 +165,7 @@ extern "C" { } { - const f_string parameters_source[] = { + const f_string_t parameters_source[] = { fake_path_part_documents, fake_path_part_includes, fake_path_part_libraries, @@ -183,7 +183,7 @@ extern "C" { fake_path_part_script, }; - const f_string_length parameters_length[] = { + const f_string_length_t parameters_length[] = { fake_path_part_documents_length, fake_path_part_includes_length, fake_path_part_libraries_length, @@ -201,7 +201,7 @@ extern "C" { fake_path_part_script_length, }; - f_string_dynamic *parameters_value[] = { + f_string_dynamic_t *parameters_value[] = { &data->path_build_documents, &data->path_build_includes, &data->path_build_libraries, @@ -230,7 +230,7 @@ extern "C" { } { - const f_string_dynamic *parameters_source[] = { + const f_string_dynamic_t *parameters_source[] = { &data->path_build_libraries, &data->path_build_programs, &data->path_data_build, @@ -244,30 +244,30 @@ extern "C" { 1, }; - f_string_dynamic *parameters_value_0[] = { + f_string_dynamic_t *parameters_value_0[] = { &data->path_build_libraries_script, &data->path_build_libraries_shared, &data->path_build_libraries_static, }; - f_string_dynamic *parameters_value_1[] = { + f_string_dynamic_t *parameters_value_1[] = { &data->path_build_programs_script, &data->path_build_programs_shared, &data->path_build_programs_static, }; - f_string_dynamic *parameters_value_2[] = { + f_string_dynamic_t *parameters_value_2[] = { &data->file_data_build_defines, &data->file_data_build_dependencies, &data->file_data_build_fakefile, &data->file_data_build_settings, }; - f_string_dynamic *parameters_value_3[] = { + f_string_dynamic_t *parameters_value_3[] = { &data->file_documents_readme, }; - f_string_dynamic **parameters_value[] = { + f_string_dynamic_t **parameters_value[] = { parameters_value_0, parameters_value_1, parameters_value_2, @@ -285,7 +285,7 @@ extern "C" { } { - const f_string parameters_source[] = { + const f_string_t parameters_source[] = { fake_path_part_script, fake_path_part_shared, fake_path_part_static, @@ -299,7 +299,7 @@ extern "C" { fake_file_readme, }; - const f_string_length parameters_length[] = { + const f_string_length_t parameters_length[] = { fake_path_part_script_length, fake_path_part_shared_length, fake_path_part_static_length, @@ -313,7 +313,7 @@ extern "C" { fake_file_readme_length, }; - f_string_dynamic *parameters_value[] = { + f_string_dynamic_t *parameters_value[] = { &data->path_build_libraries_script, &data->path_build_libraries_shared, &data->path_build_libraries_static, @@ -339,7 +339,7 @@ extern "C" { if (data->path_work.used > 0) { { - f_string_dynamic *parameters_value[] = { + f_string_dynamic_t *parameters_value[] = { &data->path_work_includes, &data->path_work_libraries, &data->path_work_programs, @@ -356,19 +356,19 @@ extern "C" { } { - const f_string parameters_source[] = { + const f_string_t parameters_source[] = { fake_path_part_includes, fake_path_part_libraries, fake_path_part_programs, }; - const f_string_length parameters_length[] = { + const f_string_length_t parameters_length[] = { fake_path_part_includes_length, fake_path_part_libraries_length, fake_path_part_programs_length, }; - f_string_dynamic *parameters_value[] = { + f_string_dynamic_t *parameters_value[] = { &data->path_work_includes, &data->path_work_libraries, &data->path_work_programs, @@ -385,7 +385,7 @@ extern "C" { } { - const f_string_dynamic *parameters_source[] = { + const f_string_dynamic_t *parameters_source[] = { &data->path_work_libraries, &data->path_work_programs, }; @@ -395,19 +395,19 @@ extern "C" { 3, }; - f_string_dynamic *parameters_value_0[] = { + f_string_dynamic_t *parameters_value_0[] = { &data->path_work_libraries_script, &data->path_work_libraries_shared, &data->path_work_libraries_static, }; - f_string_dynamic *parameters_value_1[] = { + f_string_dynamic_t *parameters_value_1[] = { &data->path_work_programs_script, &data->path_work_programs_shared, &data->path_work_programs_static, }; - f_string_dynamic **parameters_value[] = { + f_string_dynamic_t **parameters_value[] = { parameters_value_0, parameters_value_1, }; @@ -423,7 +423,7 @@ extern "C" { } { - const f_string parameters_source[] = { + const f_string_t parameters_source[] = { fake_path_part_script, fake_path_part_shared, fake_path_part_static, @@ -432,7 +432,7 @@ extern "C" { fake_path_part_static, }; - const f_string_length parameters_length[] = { + const f_string_length_t parameters_length[] = { fake_path_part_script_length, fake_path_part_shared_length, fake_path_part_static_length, @@ -441,7 +441,7 @@ extern "C" { fake_path_part_static_length, }; - f_string_dynamic *parameters_value[] = { + f_string_dynamic_t *parameters_value[] = { &data->path_work_libraries_script, &data->path_work_libraries_shared, &data->path_work_libraries_static, @@ -462,7 +462,7 @@ extern "C" { } { - f_string_dynamic *parameters_value[] = { + f_string_dynamic_t *parameters_value[] = { &data->path_build_documents, &data->path_build_includes, &data->path_build_libraries, @@ -515,8 +515,8 @@ extern "C" { #endif // _di_fake_path_generate_ #ifndef _di_fake_path_generate_string_dynamic_ - f_return_status fake_path_generate_string_dynamic(fake_data *data, const f_string_dynamic source, f_string_dynamic *destination[], const uint8_t length) { - f_status status = F_none; + f_return_status fake_path_generate_string_dynamic(fake_data_t *data, const f_string_dynamic_t source, f_string_dynamic_t *destination[], const uint8_t length) { + f_status_t status = F_none; for (uint8_t i = 0; i < length; i++) { status = fl_string_dynamic_append_nulless(source, destination[i]); @@ -528,8 +528,8 @@ extern "C" { #endif // _di_fake_path_generate_string_dynamic_ #ifndef _di_fake_process_console_parameters_ - f_return_status fake_process_console_parameters(const f_console_arguments arguments, fake_data *data) { - f_status status = F_none; + f_return_status fake_process_console_parameters(const f_console_arguments_t arguments, fake_data_t *data) { + f_status_t status = F_none; // @todo move as many of the inline error printing code into more general functions where possible to provide more accurate error reporting. @@ -541,7 +541,7 @@ extern "C" { fake_parameter_operation_skeleton, }; - const f_string parameters_name[] = { + const f_string_t parameters_name[] = { fake_other_operation_build, fake_other_operation_clean, fake_other_operation_make, @@ -568,22 +568,22 @@ extern "C" { fake_parameter_settings, }; - const f_string parameters_name[] = { + const f_string_t parameters_name[] = { fake_long_process, fake_long_settings, }; - const f_string parameter_defaults[] = { + const f_string_t parameter_defaults[] = { fake_default_process, fake_default_settings, }; - const f_string_length parameter_default_lengths[] = { + const f_string_length_t parameter_default_lengths[] = { fake_default_process_length, fake_default_settings_length, }; - f_string_dynamic *parameters_value[] = { + f_string_dynamic_t *parameters_value[] = { &data->process, &data->settings, }; @@ -604,13 +604,13 @@ extern "C" { return F_status_set_error(F_parameter); } - f_string_length location = data->parameters[parameters_id[i]].additional.array[0]; - f_string_length length = strnlen(arguments.argv[location], f_console_length_size); + f_string_length_t location = data->parameters[parameters_id[i]].additional.array[0]; + f_string_length_t length = strnlen(arguments.argv[location], f_console_length_size); if (length > 0) { if (parameters_validate_word[i]) { - f_string_length j = 0; - f_string_length width_max = 0; + f_string_length_t j = 0; + f_string_length_t width_max = 0; for (j = 0; j < length; j++) { width_max = length - j; @@ -675,10 +675,10 @@ extern "C" { } } else if (parameter_default_lengths[i] > 0) { - f_macro_string_dynamic_resize(status, (*parameters_value[i]), parameter_default_lengths[i]); + f_macro_string_dynamic_t_resize(status, (*parameters_value[i]), parameter_default_lengths[i]); if (F_status_is_error(status)) { - fake_print_error(*data, F_status_set_fine(status), "f_macro_string_dynamic_resize", F_true); + fake_print_error(*data, F_status_set_fine(status), "f_macro_string_dynamic_t_resize", F_true); return status; } @@ -701,28 +701,28 @@ extern "C" { fake_parameter_path_work, }; - const f_string parameters_name[] = { + const f_string_t parameters_name[] = { fake_long_path_build, fake_long_path_data, fake_long_path_sources, fake_long_path_work, }; - const f_string parameter_defaults[] = { + const f_string_t parameter_defaults[] = { fake_default_path_build, fake_default_path_data, fake_default_path_sources, fake_default_path_work, }; - const f_string_length parameter_default_lengths[] = { + const f_string_length_t parameter_default_lengths[] = { fake_default_path_build_length, fake_default_path_data_length, fake_default_path_sources_length, fake_default_path_work_length, }; - f_string_dynamic *parameters_value[] = { + f_string_dynamic_t *parameters_value[] = { &data->path_build, &data->path_data, &data->path_sources, @@ -754,10 +754,10 @@ extern "C" { } } else if (parameter_default_lengths[i] > 0) { - f_macro_string_dynamic_new(status, (*parameters_value[i]), parameter_default_lengths[i]); + f_macro_string_dynamic_t_new(status, (*parameters_value[i]), parameter_default_lengths[i]); if (F_status_is_error(status)) { - if (fake_print_error(*data, F_status_set_fine(status), "f_macro_string_dynamic_new", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { + if (fake_print_error(*data, F_status_set_fine(status), "f_macro_string_dynamic_t_new", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to load default for the parameter '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]); @@ -787,9 +787,9 @@ extern "C" { return status; } - f_array_length i = 0; - f_string_length j = 0; - f_string_length width_max = 0; + f_array_length_t i = 0; + f_string_length_t j = 0; + f_string_length_t width_max = 0; for (; i < data->define.used; i++) { for (j = 0; j < data->define.array[i].used; j++) { @@ -842,9 +842,9 @@ extern "C" { return status; } - f_array_length i = 0; - f_string_length j = 0; - f_string_length width_max = 0; + f_array_length_t i = 0; + f_string_length_t j = 0; + f_string_length_t width_max = 0; for (; i < data->mode.used; i++) { for (j = 0; j < data->mode.array[i].used; j++) { @@ -884,29 +884,29 @@ extern "C" { #endif // _di_fake_process_console_parameters_ #ifndef _di_fake_validate_directories_ - f_return_status fake_validate_parameter_directories(const f_console_arguments arguments, const fake_data data) { - const f_string parameters_name[] = { + f_return_status fake_validate_parameter_directories(const f_console_arguments_t arguments, const fake_data_t data) { + const f_string_t parameters_name[] = { fake_long_path_build, fake_long_path_data, fake_long_path_sources, fake_long_path_work, }; - const f_string parameter_defaults[] = { + const f_string_t parameter_defaults[] = { fake_default_path_build, fake_default_path_data, fake_default_path_sources, fake_default_path_work, }; - const f_string_length parameter_default_lengths[] = { + const f_string_length_t parameter_default_lengths[] = { fake_default_path_build_length, fake_default_path_data_length, fake_default_path_sources_length, fake_default_path_work_length, }; - const f_string_dynamic *parameters_value[] = { + const f_string_dynamic_t *parameters_value[] = { &data.path_build, &data.path_data, &data.path_sources, @@ -921,7 +921,7 @@ extern "C" { }; struct stat directory_stat; - f_status status = F_none; + f_status_t status = F_none; for (uint8_t i = 0; i < 4; i++) { if (parameters_value[i]->used > 0) { diff --git a/level_3/fake/c/private-fake.h b/level_3/fake/c/private-fake.h index 0dcae98..267cf6a 100644 --- a/level_3/fake/c/private-fake.h +++ b/level_3/fake/c/private-fake.h @@ -22,21 +22,21 @@ extern "C" { #define fake_common_setting_bool_no_length 2 #endif // _di_fake_common_ -#ifndef _di_fake_environment_ +#ifndef _di_fake_environment_t_ typedef struct { - f_string_dynamics names; - f_string_dynamics values; - } fake_environment; + f_string_dynamics_t names; + f_string_dynamics_t values; + } fake_environment_t; - #define fake_environment_initialize { \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ + #define fake_environment_t_initialize { \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ } - #define fake_macro_environment_delete_simple(environment) \ - f_macro_string_dynamics_delete_simple(environment.names) \ - f_macro_string_dynamics_delete_simple(environment.values) -#endif // _di_fake_environment_ + #define fake_macro_environment_t_delete_simple(environment) \ + f_macro_string_dynamics_t_delete_simple(environment.names) \ + f_macro_string_dynamics_t_delete_simple(environment.values) +#endif // _di_fake_environment_t_ /** * Execute the given command and arguments. @@ -55,7 +55,7 @@ extern "C" { * The return status. */ #ifndef _di_fake_execute_ - extern void fake_execute(const fake_data data, const fake_environment environment, const f_string_static program, const f_string_statics arguments, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_execute(const fake_data_t data, const fake_environment_t environment, const f_string_static_t program, const f_string_statics_t arguments, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_execute_ /** @@ -74,7 +74,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_file_buffer_ - extern f_return_status fake_file_buffer(const fake_data data, const f_string path_file, f_string_dynamic *buffer) f_gcc_attribute_visibility_internal; + extern f_return_status fake_file_buffer(const fake_data_t data, const f_string_t path_file, f_string_dynamic_t *buffer) f_gcc_attribute_visibility_internal; #endif // _di_fake_file_buffer_ /** @@ -89,7 +89,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_path_generate_ - extern f_return_status fake_path_generate(fake_data *data) f_gcc_attribute_visibility_internal; + extern f_return_status fake_path_generate(fake_data_t *data) f_gcc_attribute_visibility_internal; #endif // _di_fake_path_generate_ /** @@ -110,7 +110,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_path_generate_string_dynamic_ - extern f_return_status fake_path_generate_string_dynamic(fake_data *data, const f_string_dynamic source, f_string_dynamic *destination[], const uint8_t size) f_gcc_attribute_visibility_internal; + extern f_return_status fake_path_generate_string_dynamic(fake_data_t *data, const f_string_dynamic_t source, f_string_dynamic_t *destination[], const uint8_t size) f_gcc_attribute_visibility_internal; #endif // _di_fake_path_generate_string_dynamic_ /** @@ -127,7 +127,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_process_console_parameters_ - extern f_return_status fake_process_console_parameters(const f_console_arguments arguments, fake_data *data) f_gcc_attribute_visibility_internal; + extern f_return_status fake_process_console_parameters(const f_console_arguments_t arguments, fake_data_t *data) f_gcc_attribute_visibility_internal; #endif // _di_validate_console_parameters_ /** @@ -146,7 +146,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_validate_parameter_directories_ - extern f_return_status fake_validate_parameter_directories(const f_console_arguments arguments, const fake_data data) f_gcc_attribute_visibility_internal; + extern f_return_status fake_validate_parameter_directories(const f_console_arguments_t arguments, const fake_data_t data) f_gcc_attribute_visibility_internal; #endif // _di_fake_validate_parameter_directories_ #ifdef __cplusplus diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index 04ff9b8..01941ec 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -11,18 +11,18 @@ extern "C" { #endif #ifndef _di_fake_make_assure_inside_project_ - f_return_status fake_make_assure_inside_project(const fake_data data, const f_string_static path, fake_make_data *data_make) { + f_return_status fake_make_assure_inside_project(const fake_data_t data, const f_string_static_t path, fake_make_data_t *data_make) { data_make->path_cache.used = 0; - f_status status = fll_path_canonical(path.string, &data_make->path_cache); + f_status_t status = fll_path_canonical(path.string, &data_make->path_cache); if (F_status_is_error(status)) return status; if (data_make->path_cache.used < data_make->path.stack.array[0].used) { return F_status_set_error(F_false); } - const f_string_range range = f_macro_string_range_initialize(data_make->path.stack.array[0].used); + const f_string_range_t range = f_macro_string_range_initialize(data_make->path.stack.array[0].used); if (range.start <= range.stop) { status = fl_string_dynamic_partial_compare(data_make->path.stack.array[0], data_make->path_cache, range, range); @@ -44,12 +44,12 @@ extern "C" { #endif // _di_fake_make_assure_inside_project_ #ifndef _di_fake_make_get_id_group_ - f_return_status fake_make_get_id_group(const fake_data data, const fake_make_print print, const f_string_static buffer, gid_t *id) { - const f_string_range range = f_macro_string_range_initialize(buffer.used); + f_return_status fake_make_get_id_group(const fake_data_t data, const fake_make_print_t print, const f_string_static_t buffer, gid_t *id) { + const f_string_range_t range = f_macro_string_range_initialize(buffer.used); - f_number_unsigned number = 0; + f_number_unsigned_t number = 0; - f_status status = fl_conversion_string_to_number_unsigned(buffer.string, &number, range); + f_status_t status = fl_conversion_string_to_number_unsigned(buffer.string, &number, range); if (F_status_is_error(status)) { status = F_status_set_fine(status); @@ -93,13 +93,13 @@ extern "C" { #endif // _di_fake_make_get_id_group_ #ifndef _di_fake_make_get_id_mode_ - f_return_status fake_make_get_id_mode(const fake_data data, const fake_make_print print, const f_string_static buffer, f_file_mode *mode, uint8_t *replace) { + f_return_status fake_make_get_id_mode(const fake_data_t data, const fake_make_print_t print, const f_string_static_t buffer, f_file_mode *mode, uint8_t *replace) { if (!buffer.used) { fake_print_message(data, F_parameter, "fake_make_get_id_mode", F_true, print); return F_status_set_error(F_parameter); } - f_status status = f_file_mode_from_string(buffer.string, data.umask, mode, replace); + f_status_t status = f_file_mode_from_string(buffer.string, data.umask, mode, replace); if (F_status_is_error(status)) { if (data.verbosity != fake_verbosity_quiet) { @@ -122,12 +122,12 @@ extern "C" { #endif // _di_fake_make_get_id_mode_ #ifndef _di_fake_make_get_id_owner_ - f_return_status fake_make_get_id_owner(const fake_data data, const fake_make_print print, const f_string_static buffer, uid_t *id) { - const f_string_range range = f_macro_string_range_initialize(buffer.used); + f_return_status fake_make_get_id_owner(const fake_data_t data, const fake_make_print_t print, const f_string_static_t buffer, uid_t *id) { + const f_string_range_t range = f_macro_string_range_initialize(buffer.used); - f_number_unsigned number = 0; + f_number_unsigned_t number = 0; - f_status status = fl_conversion_string_to_number_unsigned(buffer.string, &number, range); + f_status_t status = fl_conversion_string_to_number_unsigned(buffer.string, &number, range); if (F_status_is_error(status)) { status = F_status_set_fine(status); @@ -171,7 +171,7 @@ extern "C" { #endif // _di_fake_make_get_id_owner_ #ifndef _di_fake_make_load_fakefile_ - void fake_make_load_fakefile(const fake_data data, fake_make_data *data_make, f_status *status) { + void fake_make_load_fakefile(const fake_data_t data, fake_make_data_t *data_make, f_status_t *status) { if (F_status_is_error(*status)) return; *status = fake_file_buffer(data, data.file_data_build_fakefile.string, &data_make->buffer); @@ -188,18 +188,18 @@ extern "C" { return; } - f_fss_objects list_objects = f_fss_objects_initialize; - f_fss_contents list_contents = f_fss_contents_initialize; + f_fss_objects_t list_objects = f_fss_objects_t_initialize; + f_fss_contents_t list_contents = f_fss_contents_t_initialize; { - f_string_range range = f_macro_string_range_initialize(data_make->buffer.used); + f_string_range_t range = f_macro_string_range_initialize(data_make->buffer.used); *status = fll_fss_basic_list_read(&data_make->buffer, &range, &list_objects, &list_contents); if (F_status_is_error(*status)) { fake_print_error_fss(data, *status, "fll_fss_basic_list_read", data.file_data_build_fakefile.string, range, F_true); - f_macro_fss_objects_delete_simple(list_objects); - f_macro_fss_contents_delete_simple(list_contents); + f_macro_fss_objects_t_delete_simple(list_objects); + f_macro_fss_contents_t_delete_simple(list_contents); return; } } @@ -208,28 +208,28 @@ extern "C" { bool missing_main = F_true; bool missing_settings = F_true; - f_fss_set settings = f_fss_set_initialize; + f_fss_set_t settings = f_fss_set_t_initialize; - const f_string_static name_settings = f_macro_string_static_initialize(fake_make_section_settings, fake_make_section_settings_length); - const f_string_static name_main = f_macro_string_static_initialize(fake_make_section_main, fake_make_section_main_length); + const f_string_static_t name_settings = f_macro_string_static_t_initialize(fake_make_section_settings, fake_make_section_settings_length); + const f_string_static_t name_main = f_macro_string_static_t_initialize(fake_make_section_main, fake_make_section_main_length); - const f_string_range name_settings_range = f_macro_string_range_initialize(fake_make_section_settings_length); - const f_string_range name_main_range = f_macro_string_range_initialize(fake_make_section_main_length); + const f_string_range_t name_settings_range = f_macro_string_range_initialize(fake_make_section_settings_length); + const f_string_range_t name_main_range = f_macro_string_range_initialize(fake_make_section_main_length); - f_macro_fss_nameds_new((*status), data_make->fakefile, list_objects.used); + f_macro_fss_nameds_t_new((*status), data_make->fakefile, list_objects.used); if (F_status_is_error(*status)) { - fake_print_error(data, F_status_set_fine(*status), "f_macro_fss_nameds_new", F_true); + fake_print_error(data, F_status_set_fine(*status), "f_macro_fss_nameds_t_new", F_true); - f_macro_fss_set_delete_simple(settings); - f_macro_fss_objects_delete_simple(list_objects); - f_macro_fss_contents_delete_simple(list_contents); + f_macro_fss_set_t_delete_simple(settings); + f_macro_fss_objects_t_delete_simple(list_objects); + f_macro_fss_contents_t_delete_simple(list_contents); return; } { - f_string_range content_range = f_string_range_initialize; + f_string_range_t content_range = f_string_range_initialize; - for (f_array_length i = 0; i < list_objects.used; i++) { + for (f_array_length_t i = 0; i < list_objects.used; i++) { if (fl_string_dynamic_partial_compare(name_settings, data_make->buffer, name_settings_range, list_objects.array[i]) == F_equal_to) { if (!missing_settings) { fake_print_warning_settings_object_multiple(data, data.file_data_build_fakefile.string, "list", name_settings.string); @@ -242,9 +242,9 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error_fss(data, *status, "fll_fss_extended_read", data.file_data_build_fakefile.string, content_range, F_true); - f_macro_fss_set_delete_simple(settings); - f_macro_fss_objects_delete_simple(list_objects); - f_macro_fss_contents_delete_simple(list_contents); + f_macro_fss_set_t_delete_simple(settings); + f_macro_fss_objects_t_delete_simple(list_objects); + f_macro_fss_contents_t_delete_simple(list_contents); return; } @@ -269,9 +269,9 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error_fss(data, *status, "fll_fss_extended_read", data.file_data_build_fakefile.string, content_range, F_true); - f_macro_fss_set_delete_simple(settings); - f_macro_fss_objects_delete_simple(list_objects); - f_macro_fss_contents_delete_simple(list_contents); + f_macro_fss_set_t_delete_simple(settings); + f_macro_fss_objects_t_delete_simple(list_objects); + f_macro_fss_contents_t_delete_simple(list_contents); return; } @@ -279,8 +279,8 @@ extern "C" { } // for } - f_macro_fss_objects_delete_simple(list_objects); - f_macro_fss_contents_delete_simple(list_contents); + f_macro_fss_objects_t_delete_simple(list_objects); + f_macro_fss_contents_t_delete_simple(list_contents); if (missing_main) { if (data.verbosity != fake_verbosity_quiet) { @@ -294,15 +294,15 @@ extern "C" { *status = F_status_set_error(F_failure); - f_macro_fss_set_delete_simple(settings); + f_macro_fss_set_t_delete_simple(settings); return; } // always have the parameter variable "return" map at index 0 and pre-initialized. { - f_string function_name = "f_macro_string_map_multis_new"; + f_string_t function_name = "f_macro_string_map_multis_t_new"; - f_macro_string_map_multis_new(*status, data_make->setting_make.parameter, f_memory_default_allocation_step); + f_macro_string_map_multis_t_new(*status, data_make->setting_make.parameter, f_memory_default_allocation_step); if (F_status_is_fine(*status)) { data_make->setting_make.parameter.used = 1; @@ -329,13 +329,13 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, *status, function_name, F_true); - f_macro_fss_set_delete_simple(settings); + f_macro_fss_set_t_delete_simple(settings); return; } } - f_string_range *range_compiler = 0; - f_string_range *range_linker = 0; + f_string_range_t *range_compiler = 0; + f_string_range_t *range_linker = 0; data_make->setting_make.parameter.array[0].value.used = 1; data_make->setting_make.load_build = F_true; @@ -345,7 +345,7 @@ extern "C" { bool unmatched_fail = F_true; bool unmatched_load = F_true; - for (f_array_length i = 0; i < settings.objects.used; i++) { + for (f_array_length_t i = 0; i < settings.objects.used; i++) { if (fl_string_dynamic_partial_compare_string(fake_make_setting_compiler, data_make->buffer, fake_make_setting_compiler_length, settings.objects.array[i]) == F_equal_to) { if (range_compiler) { fake_print_warning_settings_content_multiple(data, data.file_data_build_fakefile.string, fake_make_setting_compiler); @@ -364,10 +364,10 @@ extern "C" { } } else if (fl_string_dynamic_partial_compare_string(fake_make_setting_environment, data_make->buffer, fake_make_setting_environment_length, settings.objects.array[i]) == F_equal_to) { - f_string_dynamic name_define = f_string_dynamic_initialize; + f_string_dynamic_t name_define = f_string_dynamic_t_initialize; - f_array_length j = 0; - f_array_length k = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; for (; j < settings.contents.array[i].used; j++) { @@ -375,8 +375,8 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, *status, "fl_string_dynamic_partial_append_nulless", F_true); - f_macro_string_dynamic_delete_simple(name_define); - f_macro_fss_set_delete_simple(settings); + f_macro_string_dynamic_t_delete_simple(name_define); + f_macro_fss_set_t_delete_simple(settings); return; } @@ -384,8 +384,8 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, *status, "fl_string_dynamic_terminate_after", F_true); - f_macro_string_dynamic_delete_simple(name_define); - f_macro_fss_set_delete_simple(settings); + f_macro_string_dynamic_t_delete_simple(name_define); + f_macro_fss_set_t_delete_simple(settings); return; } @@ -403,8 +403,8 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, *status, "fl_string_lengths_size_increase", F_true); - f_macro_string_dynamic_delete_simple(name_define); - f_macro_fss_set_delete_simple(settings); + f_macro_string_dynamic_t_delete_simple(name_define); + f_macro_fss_set_t_delete_simple(settings); return; } } @@ -416,8 +416,8 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, *status, "fl_string_dynamic_append", F_true); - f_macro_string_dynamic_delete_simple(name_define); - f_macro_fss_set_delete_simple(settings); + f_macro_string_dynamic_t_delete_simple(name_define); + f_macro_fss_set_t_delete_simple(settings); return; } @@ -443,7 +443,7 @@ extern "C" { } // for *status = F_none; - f_macro_string_dynamic_delete_simple(name_define); + f_macro_string_dynamic_t_delete_simple(name_define); } else if (fl_string_dynamic_partial_compare_string(fake_make_setting_fail, data_make->buffer, fake_make_setting_fail_length, settings.objects.array[i]) == F_equal_to) { if (unmatched_fail) { @@ -523,12 +523,12 @@ extern "C" { if (settings.contents.array[i].used) { if (fl_string_dynamic_partial_compare_string(fake_make_setting_return, data_make->buffer, fake_make_setting_return_length, settings.contents.array[i].array[0]) == F_equal_to) { if (settings.contents.array[i].used > 1) { - f_string function_name = 0; + f_string_t function_name = 0; // each define replaces the previous define. data_make->setting_make.parameter.array[0].value.array[0].used = 0; - for (f_array_length j = 1; j < settings.contents.array[i].used; j++) { + 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]); @@ -545,7 +545,7 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, *status, function_name, F_true); - f_macro_fss_set_delete_simple(settings); + f_macro_fss_set_t_delete_simple(settings); return; } } // for @@ -565,7 +565,7 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, *status, "fake_build_load_setting", F_true); - f_macro_fss_set_delete_simple(settings); + f_macro_fss_set_t_delete_simple(settings); return; } } @@ -584,26 +584,26 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, *status, "fl_string_dynamic_partial_append", F_true); - f_macro_fss_set_delete_simple(settings); + f_macro_fss_set_t_delete_simple(settings); return; } - f_string_map_multis define = f_string_map_multis_initialize; + f_string_map_multis_t define = f_string_map_multis_t_initialize; fake_build_load_setting_process(data, data.file_data_build_fakefile.string, data_make->buffer, settings.objects, settings.contents, &data_make->setting_build, status); if (F_status_is_not_error(*status) && settings.objects.used) { - const f_string settings_name[] = { + const f_string_t settings_name[] = { fake_make_setting_define, fake_make_setting_parameter, }; - const f_string_length settings_length[] = { + const f_string_length_t settings_length[] = { fake_make_setting_define_length, fake_make_setting_parameter_length, }; - f_string_map_multis *settings_value[] = { + f_string_map_multis_t *settings_value[] = { &define, &data_make->setting_make.parameter, }; @@ -612,23 +612,23 @@ extern "C" { if (F_status_is_error(*status)) { fake_print_error(data, F_status_set_fine(*status), "fll_fss_snatch_map_apart", F_true); - f_macro_string_map_multis_delete_simple(define); - f_macro_fss_set_delete_simple(settings); + f_macro_string_map_multis_t_delete_simple(define); + f_macro_fss_set_t_delete_simple(settings); return; } } if (define.used) { - f_status status_validate = F_none; - f_string_dynamic combined = f_string_dynamic_initialize; + f_status_t status_validate = F_none; + f_string_dynamic_t combined = f_string_dynamic_t_initialize; - for (f_array_length i = 0; i < define.used; i++) { + for (f_array_length_t i = 0; i < define.used; i++) { status_validate = fake_make_operate_validate_define_name(define.array[i].name); if (status_validate) { combined.used = 0; - for (f_array_length j = 0; j < define.array[i].value.used; j++) { + for (f_array_length_t j = 0; j < define.array[i].value.used; j++) { *status = fl_string_dynamic_mash(" ", 1, define.array[i].value.array[j], &combined); if (F_status_is_error(*status)) { fake_print_error(data, *status, "fl_string_dynamic_mash_nulless", F_true); @@ -666,27 +666,27 @@ extern "C" { } } // for - f_macro_string_dynamic_delete_simple(combined); + f_macro_string_dynamic_t_delete_simple(combined); } - f_macro_string_map_multis_delete_simple(define); - f_macro_fss_set_delete_simple(settings); + f_macro_string_map_multis_t_delete_simple(define); + f_macro_fss_set_t_delete_simple(settings); } } #endif // _di_fake_make_load_fakefile_ #ifndef _di_fake_make_operate_ - f_return_status fake_make_operate(const fake_data data) { + f_return_status fake_make_operate(const fake_data_t data) { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Making project."); } - f_status status = F_none; - f_mode mode = f_mode_initialize; + f_status_t status = F_none; + f_mode_t mode = f_mode_t_initialize; - f_string_lengths section_stack = f_string_lengths_initialize; - fake_make_data data_make = fake_make_data_initialize; + f_string_lengths_t section_stack = f_string_lengths_t_initialize; + fake_make_data_t data_make = fake_make_data_t_initialize; f_macro_string_dynamics_new(status, data_make.path.stack, f_memory_default_allocation_step); if (F_status_is_error(status)) { @@ -698,7 +698,7 @@ extern "C" { if (F_status_is_error(status)) { fake_print_error(data, F_status_set_fine(status), "f_path_current", F_true); - fake_macro_make_data_delete_simple(data_make); + fake_macro_make_data_t_delete_simple(data_make); return status; } @@ -706,13 +706,13 @@ extern "C" { if (F_status_is_error(status)) { fake_print_error(data, F_status_set_fine(status), "f_directory_open", F_true); - fake_macro_make_data_delete_simple(data_make); + fake_macro_make_data_t_delete_simple(data_make); return status; } data_make.path.stack.used = 1; - f_macro_mode_set_default_umask(mode, data.umask); + f_macro_mode_t_set_default_umask(mode, data.umask); fake_make_load_fakefile(data, &data_make, &status); @@ -737,7 +737,7 @@ extern "C" { } { - f_status status_path = f_path_change_at(data_make.path.top); + f_status_t status_path = f_path_change_at(data_make.path.top); if (F_status_is_error(status_path) && data.verbosity == fake_verbosity_verbose) { fprintf(f_type_warning, "%c", f_string_eol[0]); @@ -751,15 +751,15 @@ extern "C" { f_file_close(&data_make.path.top); - f_macro_string_lengths_delete_simple(section_stack); - fake_macro_make_data_delete_simple(data_make); + f_macro_string_lengths_t_delete_simple(section_stack); + fake_macro_make_data_t_delete_simple(data_make); return status; } #endif // _di_fake_make_operate_ #ifndef _di_fake_make_operate_expand_ - void fake_make_operate_expand(const fake_data data, const f_string_range section_name, const f_array_length operation, const f_string_static operation_name, const f_fss_content content, const f_fss_quoteds quoteds, fake_make_data *data_make, f_string_dynamics *arguments, f_status *status) { + void fake_make_operate_expand(const fake_data_t data, const f_string_range_t section_name, const f_array_length_t operation, const f_string_static_t operation_name, const f_fss_content_t content, const f_fss_quoteds_t quoteds, fake_make_data_t *data_make, f_string_dynamics_t *arguments, f_status_t *status) { if (F_status_is_error(*status)) return; if (content.used == 0) return; @@ -778,31 +778,31 @@ extern "C" { } } - const f_string_static vocabulary_define = f_macro_string_static_initialize(iki_vocabulary_0002_define, iki_vocabulary_0002_define_length); - const f_string_static vocabulary_parameter = f_macro_string_static_initialize(iki_vocabulary_0002_parameter, iki_vocabulary_0002_parameter_length); + const f_string_static_t vocabulary_define = f_macro_string_static_t_initialize(iki_vocabulary_0002_define, iki_vocabulary_0002_define_length); + const f_string_static_t vocabulary_parameter = f_macro_string_static_t_initialize(iki_vocabulary_0002_parameter, iki_vocabulary_0002_parameter_length); - const f_string_range range_define = f_macro_string_range_initialize(iki_vocabulary_0002_define_length); - const f_string_range range_parameter = f_macro_string_range_initialize(iki_vocabulary_0002_parameter_length); + const f_string_range_t range_define = f_macro_string_range_initialize(iki_vocabulary_0002_define_length); + const f_string_range_t range_parameter = f_macro_string_range_initialize(iki_vocabulary_0002_parameter_length); - f_iki_variable iki_variable = f_iki_variable_initialize; - f_iki_vocabulary iki_vocabulary = f_iki_vocabulary_initialize; - f_iki_content iki_content = f_iki_content_initialize; + f_iki_variable_t iki_variable = f_iki_variable_t_initialize; + f_iki_vocabulary_t iki_vocabulary = f_iki_vocabulary_t_initialize; + f_iki_content_t iki_content = f_iki_content_t_initialize; - f_string_range range = f_string_range_initialize; - f_string_map_multis *parameter = &data_make->setting_make.parameter; + f_string_range_t range = f_string_range_initialize; + f_string_map_multis_t *parameter = &data_make->setting_make.parameter; bool unmatched = F_true; bool parameter_is = F_false; bool define_is = F_false; - f_array_length i = 0; - f_array_length j = 0; - f_array_length k = 0; - f_array_length l = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_array_length_t k = 0; + f_array_length_t l = 0; - f_array_length used_arguments = 0; + f_array_length_t used_arguments = 0; - f_string_length previous = 0; + f_string_length_t previous = 0; for (; i < content.used; i++) { @@ -1012,31 +1012,31 @@ extern "C" { arguments->used++; } - f_macro_iki_variable_delete_simple(iki_variable); - f_macro_iki_vocabulary_delete_simple(iki_vocabulary); - f_macro_iki_content_delete_simple(iki_content); + f_macro_iki_variable_t_delete_simple(iki_variable); + f_macro_iki_vocabulary_t_delete_simple(iki_vocabulary); + f_macro_iki_content_t_delete_simple(iki_content); } // for - f_macro_iki_variable_delete_simple(iki_variable); - f_macro_iki_vocabulary_delete_simple(iki_vocabulary); - f_macro_iki_content_delete_simple(iki_content); + f_macro_iki_variable_t_delete_simple(iki_variable); + f_macro_iki_vocabulary_t_delete_simple(iki_vocabulary); + f_macro_iki_content_t_delete_simple(iki_content); } #endif // _di_fake_make_operate_expand_ #ifndef _di_fake_make_operate_expand_build_ - f_return_status fake_make_operate_expand_build(const fake_data data, const f_fss_quoted quoted, const f_string_range range_name, fake_make_data *data_make, f_string_dynamics *arguments) { - f_status status = F_none; - f_string_dynamic value = f_string_dynamic_initialize; + f_return_status fake_make_operate_expand_build(const fake_data_t data, const f_fss_quoted_t quoted, const f_string_range_t range_name, fake_make_data_t *data_make, f_string_dynamics_t *arguments) { + f_status_t status = F_none; + f_string_dynamic_t value = f_string_dynamic_t_initialize; bool unmatched = F_true; { - const f_string uint8_name[] = { + const f_string_t uint8_name[] = { fake_build_setting_name_build_language, fake_build_setting_name_version_target, }; - const f_string_length uint8_length[] = { + const f_string_length_t uint8_length[] = { fake_build_setting_name_build_language_length, fake_build_setting_name_version_target_length, }; @@ -1059,7 +1059,7 @@ extern "C" { } if (unmatched) { - const f_string bool_name[] = { + const f_string_t bool_name[] = { fake_build_setting_name_build_script, fake_build_setting_name_build_shared, fake_build_setting_name_build_static, @@ -1068,7 +1068,7 @@ extern "C" { fake_build_setting_name_search_static, }; - const f_string_length bool_length[] = { + const f_string_length_t bool_length[] = { fake_build_setting_name_build_script_length, fake_build_setting_name_build_shared_length, fake_build_setting_name_build_static_length, @@ -1105,7 +1105,7 @@ extern "C" { } if (unmatched) { - const f_string dynamic_name[] = { + const f_string_t dynamic_name[] = { fake_build_setting_name_build_compiler, fake_build_setting_name_build_linker, fake_build_setting_name_path_headers, @@ -1124,7 +1124,7 @@ extern "C" { fake_build_setting_name_version_minor, }; - const f_string_length dynamic_length[] = { + const f_string_length_t dynamic_length[] = { fake_build_setting_name_build_compiler_length, fake_build_setting_name_build_linker_length, fake_build_setting_name_path_headers_length, @@ -1143,7 +1143,7 @@ extern "C" { fake_build_setting_name_version_minor_length, }; - const f_string_dynamic dynamic_value[] = { + const f_string_dynamic_t dynamic_value[] = { data_make->setting_build.build_compiler, data_make->setting_build.build_linker, data_make->setting_build.path_headers, @@ -1175,7 +1175,7 @@ extern "C" { } if (unmatched) { - const f_string dynamics_name[] = { + const f_string_t dynamics_name[] = { fake_build_setting_name_build_libraries, fake_build_setting_name_build_sources_headers, fake_build_setting_name_build_sources_library, @@ -1195,7 +1195,7 @@ extern "C" { fake_build_setting_name_modes_default, }; - const f_string_length dynamics_length[] = { + const f_string_length_t dynamics_length[] = { fake_build_setting_name_build_libraries_length, fake_build_setting_name_build_sources_headers_length, fake_build_setting_name_build_sources_library_length, @@ -1215,7 +1215,7 @@ extern "C" { fake_build_setting_name_modes_default_length, }; - const f_string_dynamics dynamics_value[] = { + const f_string_dynamics_t dynamics_value[] = { data_make->setting_build.build_libraries, data_make->setting_build.build_sources_headers, data_make->setting_build.build_sources_library, @@ -1241,7 +1241,7 @@ extern "C" { if (status == F_equal_to) { unmatched = F_false; - for (f_array_length j = 0; j < dynamics_value[i].used; j++) { + for (f_array_length_t j = 0; j < dynamics_value[i].used; j++) { status = fl_string_dynamic_mash(" ", 1, dynamics_value[i].array[j], &value); if (F_status_is_error(status)) { break; @@ -1254,12 +1254,12 @@ extern "C" { } if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(value); + f_macro_string_dynamic_t_delete_simple(value); return status; } if (unmatched) { - f_macro_string_dynamic_delete_simple(value); + f_macro_string_dynamic_t_delete_simple(value); return F_false; } @@ -1282,7 +1282,7 @@ extern "C" { } } - f_macro_string_dynamic_delete_simple(value); + f_macro_string_dynamic_t_delete_simple(value); if (F_status_is_fine(status)) { return F_true; @@ -1293,29 +1293,29 @@ extern "C" { #endif // _di_fake_make_operate_expand_build_ #ifndef _di_fake_make_operate_expand_environment_ - f_return_status fake_make_operate_expand_environment(const fake_data data, const f_fss_quoted quoted, const f_string_range range_name, fake_make_data *data_make, f_string_dynamics *arguments) { - f_status status = F_none; - f_string_dynamic value = f_string_dynamic_initialize; + f_return_status fake_make_operate_expand_environment(const fake_data_t data, const f_fss_quoted_t quoted, const f_string_range_t range_name, fake_make_data_t *data_make, f_string_dynamics_t *arguments) { + f_status_t status = F_none; + f_string_dynamic_t value = f_string_dynamic_t_initialize; bool unmatched = F_false; { - f_string_dynamic name = f_string_dynamic_initialize; + f_string_dynamic_t name = f_string_dynamic_t_initialize; status = fl_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); - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); } if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(value); + f_macro_string_dynamic_t_delete_simple(value); return status; } else if (status == F_exist_not) { - f_macro_string_dynamic_delete_simple(value); + f_macro_string_dynamic_t_delete_simple(value); return F_false; } @@ -1338,7 +1338,7 @@ extern "C" { } } - f_macro_string_dynamic_delete_simple(value); + f_macro_string_dynamic_t_delete_simple(value); if (F_status_is_fine(status)) { return F_true; @@ -1349,7 +1349,7 @@ extern "C" { #endif // _di_fake_make_operate_expand_environment_ #ifndef _di_fake_make_operate_section_ - void fake_make_operate_section(const fake_data data, const f_array_length id_section, fake_make_data *data_make, f_string_lengths *section_stack, f_status *status) { + void fake_make_operate_section(const fake_data_t data, const f_array_length_t id_section, fake_make_data_t *data_make, f_string_lengths_t *section_stack, f_status_t *status) { if (F_status_is_error(*status)) return; if (id_section > data_make->fakefile.used) { @@ -1373,7 +1373,7 @@ extern "C" { section_stack->array[section_stack->used] = id_section; section_stack->used++; - const f_fss_named *section = &data_make->fakefile.array[id_section]; + const f_fss_named_t *section = &data_make->fakefile.array[id_section]; if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); @@ -1392,38 +1392,38 @@ extern "C" { return; } - const f_string_static operations_name[] = { - f_macro_string_static_initialize(fake_make_operation_archive, fake_make_operation_archive_length), - f_macro_string_static_initialize(fake_make_operation_break, fake_make_operation_break_length), - f_macro_string_static_initialize(fake_make_operation_build, fake_make_operation_build_length), - f_macro_string_static_initialize(fake_make_operation_clean, fake_make_operation_clean_length), - f_macro_string_static_initialize(fake_make_operation_compile, fake_make_operation_compile_length), - f_macro_string_static_initialize(fake_make_operation_define, fake_make_operation_define_length), - f_macro_string_static_initialize(fake_make_operation_delete, fake_make_operation_delete_length), - f_macro_string_static_initialize(fake_make_operation_deletes, fake_make_operation_deletes_length), - f_macro_string_static_initialize(fake_make_operation_else, fake_make_operation_else_length), - f_macro_string_static_initialize(fake_make_operation_exit, fake_make_operation_exit_length), - f_macro_string_static_initialize(fake_make_operation_fail, fake_make_operation_fail_length), - f_macro_string_static_initialize(fake_make_operation_group, fake_make_operation_group_length), - f_macro_string_static_initialize(fake_make_operation_groups, fake_make_operation_groups_length), - f_macro_string_static_initialize(fake_make_operation_if, fake_make_operation_if_length), - f_macro_string_static_initialize(fake_make_operation_link, fake_make_operation_link_length), - f_macro_string_static_initialize(fake_make_operation_mode, fake_make_operation_mode_length), - f_macro_string_static_initialize(fake_make_operation_modes, fake_make_operation_modes_length), - f_macro_string_static_initialize(fake_make_operation_operate, fake_make_operation_operate_length), - f_macro_string_static_initialize(fake_make_operation_owner, fake_make_operation_owner_length), - f_macro_string_static_initialize(fake_make_operation_owners, fake_make_operation_owners_length), - f_macro_string_static_initialize(fake_make_operation_pop, fake_make_operation_pop_length), - f_macro_string_static_initialize(fake_make_operation_print, fake_make_operation_print_length), - f_macro_string_static_initialize(fake_make_operation_run, fake_make_operation_run_length), - f_macro_string_static_initialize(fake_make_operation_shell, fake_make_operation_shell_length), - f_macro_string_static_initialize(fake_make_operation_skeleton, fake_make_operation_skeleton_length), - f_macro_string_static_initialize(fake_make_operation_to, fake_make_operation_to_length), - f_macro_string_static_initialize(fake_make_operation_top, fake_make_operation_top_length), - f_macro_string_static_initialize(fake_make_operation_touch, fake_make_operation_touch_length), + const f_string_static_t operations_name[] = { + f_macro_string_static_t_initialize(fake_make_operation_archive, fake_make_operation_archive_length), + f_macro_string_static_t_initialize(fake_make_operation_break, fake_make_operation_break_length), + f_macro_string_static_t_initialize(fake_make_operation_build, fake_make_operation_build_length), + f_macro_string_static_t_initialize(fake_make_operation_clean, fake_make_operation_clean_length), + f_macro_string_static_t_initialize(fake_make_operation_compile, fake_make_operation_compile_length), + f_macro_string_static_t_initialize(fake_make_operation_define, fake_make_operation_define_length), + f_macro_string_static_t_initialize(fake_make_operation_delete, fake_make_operation_delete_length), + f_macro_string_static_t_initialize(fake_make_operation_deletes, fake_make_operation_deletes_length), + f_macro_string_static_t_initialize(fake_make_operation_else, fake_make_operation_else_length), + f_macro_string_static_t_initialize(fake_make_operation_exit, fake_make_operation_exit_length), + f_macro_string_static_t_initialize(fake_make_operation_fail, fake_make_operation_fail_length), + f_macro_string_static_t_initialize(fake_make_operation_group, fake_make_operation_group_length), + f_macro_string_static_t_initialize(fake_make_operation_groups, fake_make_operation_groups_length), + f_macro_string_static_t_initialize(fake_make_operation_if, fake_make_operation_if_length), + f_macro_string_static_t_initialize(fake_make_operation_link, fake_make_operation_link_length), + f_macro_string_static_t_initialize(fake_make_operation_mode, fake_make_operation_mode_length), + f_macro_string_static_t_initialize(fake_make_operation_modes, fake_make_operation_modes_length), + f_macro_string_static_t_initialize(fake_make_operation_operate, fake_make_operation_operate_length), + f_macro_string_static_t_initialize(fake_make_operation_owner, fake_make_operation_owner_length), + f_macro_string_static_t_initialize(fake_make_operation_owners, fake_make_operation_owners_length), + f_macro_string_static_t_initialize(fake_make_operation_pop, fake_make_operation_pop_length), + f_macro_string_static_t_initialize(fake_make_operation_print, fake_make_operation_print_length), + f_macro_string_static_t_initialize(fake_make_operation_run, fake_make_operation_run_length), + f_macro_string_static_t_initialize(fake_make_operation_shell, fake_make_operation_shell_length), + f_macro_string_static_t_initialize(fake_make_operation_skeleton, fake_make_operation_skeleton_length), + f_macro_string_static_t_initialize(fake_make_operation_to, fake_make_operation_to_length), + f_macro_string_static_t_initialize(fake_make_operation_top, fake_make_operation_top_length), + f_macro_string_static_t_initialize(fake_make_operation_touch, fake_make_operation_touch_length), }; - const f_string_range operations_range[] = { + const f_string_range_t operations_range[] = { f_macro_string_range_initialize(fake_make_operation_archive_length), f_macro_string_range_initialize(fake_make_operation_break_length), f_macro_string_range_initialize(fake_make_operation_build_length), @@ -1491,15 +1491,15 @@ extern "C" { bool success = F_true; - const f_string_static *operation_name = 0; + const f_string_static_t *operation_name = 0; - f_string_dynamics arguments[section->objects.used]; + f_string_dynamics_t arguments[section->objects.used]; - f_array_length i = 0; - f_array_length j = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; memset(operations, 0, sizeof(uint8_t) * section->objects.used); - memset(arguments, 0, sizeof(f_string_dynamics) * section->objects.used); + memset(arguments, 0, sizeof(f_string_dynamics_t) * section->objects.used); for (i = 0; i < section->objects.used; i++, *status = F_none) { operation = 0; @@ -1689,7 +1689,7 @@ extern "C" { } for (i = 0; i < section->objects.used; i++) { - f_macro_string_dynamics_delete_simple(arguments[i]); + f_macro_string_dynamics_t_delete_simple(arguments[i]); } // for section_stack->used--; @@ -1697,7 +1697,7 @@ extern "C" { #endif // _di_fake_make_operate_section_ #ifndef _di_fake_make_operate_process_ - void fake_make_operate_process(const fake_data data, const f_string_range section_name, const uint8_t operation, const f_string_static operation_name, const f_string_dynamics arguments, const bool success, uint8_t *operation_if, fake_make_data *data_make, f_string_lengths *section_stack, f_status *status) { + void fake_make_operate_process(const fake_data_t data, const f_string_range_t section_name, const uint8_t operation, const f_string_static_t operation_name, const f_string_dynamics_t arguments, const bool success, uint8_t *operation_if, fake_make_data_t *data_make, f_string_lengths_t *section_stack, f_status_t *status) { if (operation == fake_make_operation_type_archive) { if (!arguments.used) { @@ -1785,7 +1785,7 @@ extern "C" { const int recursion_max = operation == fake_make_operation_type_delete ? 0 : f_directory_descriptors_max; struct stat file_stat; - for (f_array_length i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; i++) { memset(&file_stat, 0, sizeof(struct stat)); *status = f_file_stat(arguments.array[i].string, F_false, &file_stat); @@ -1932,7 +1932,7 @@ extern "C" { *status = fake_make_get_id_group(data, data_make->print, arguments.array[0], &id); if (F_status_is_error(*status)) return; - for (f_array_length i = 1; i < arguments.used; i++) { + for (f_array_length_t i = 1; i < arguments.used; i++) { *status = f_file_role_change(arguments.array[i].string, -1, id, F_false); if (F_status_is_error(*status)) { @@ -1956,7 +1956,7 @@ extern "C" { *status = fake_make_get_id_group(data, data_make->print, arguments.array[0], &id); if (F_status_is_error(*status)) return; - for (f_array_length i = 1; i < arguments.used; i++) { + for (f_array_length_t i = 1; i < arguments.used; i++) { // @todo: recursive. *status = f_file_role_change(arguments.array[i].string, -1, id, F_false); @@ -2017,7 +2017,7 @@ extern "C" { mode_t mode_file = 0; - for (f_array_length i = 2; i < arguments.used; i++, mode_file = 0) { + for (f_array_length_t i = 2; i < arguments.used; i++, mode_file = 0) { *status = f_file_mode_read(arguments.array[i].string, &mode_file); if (F_status_is_error(*status)) { @@ -2114,7 +2114,7 @@ extern "C" { mode_t mode = 0; mode_t mode_file = 0; - for (f_array_length i = 1; i < arguments.used; i++) { + for (f_array_length_t i = 1; i < arguments.used; i++) { mode = 0; *status = f_file_mode_read(arguments.array[i].string, &mode_file); @@ -2157,7 +2157,7 @@ extern "C" { mode_t mode = 0; mode_t mode_file = 0; - for (f_array_length i = 1; i < arguments.used; i++) { + for (f_array_length_t i = 1; i < arguments.used; i++) { // @todo recursive. mode = 0; @@ -2192,7 +2192,7 @@ extern "C" { return; } - f_array_length id_section = 0; + f_array_length_t id_section = 0; for (; id_section < data_make->fakefile.used; id_section++) { if (fl_string_dynamic_partial_compare_string(arguments.array[0].string, data_make->buffer, arguments.array[0].used, data_make->fakefile.array[id_section].name) == F_equal_to) { @@ -2227,7 +2227,7 @@ extern "C" { *status = fake_make_get_id_owner(data, data_make->print, arguments.array[0], &id); if (F_status_is_error(*status)) return; - for (f_array_length i = 1; i < arguments.used; i++) { + for (f_array_length_t i = 1; i < arguments.used; i++) { *status = f_file_role_change(arguments.array[i].string, id, -1, F_false); if (F_status_is_error(*status)) { fake_print_message_file(data, F_status_set_fine(*status), "f_file_role_change", arguments.array[i].string, "change owner of", F_true, F_true, data_make->print); @@ -2252,7 +2252,7 @@ extern "C" { *status = fake_make_get_id_owner(data, data_make->print, arguments.array[0], &id); if (F_status_is_error(*status)) return; - for (f_array_length i = 1; i < arguments.used; i++) { + for (f_array_length_t i = 1; i < arguments.used; i++) { // @todo recursive. *status = f_file_role_change(arguments.array[i].string, id, -1, F_false); if (F_status_is_error(*status)) { @@ -2268,7 +2268,7 @@ extern "C" { } if (operation == fake_make_operation_type_pop) { - f_macro_string_dynamic_delete_simple(data_make->path.stack.array[data_make->path.stack.used - 1]); + f_macro_string_dynamic_t_delete_simple(data_make->path.stack.array[data_make->path.stack.used - 1]); data_make->path.stack.used--; @@ -2294,7 +2294,7 @@ extern "C" { } if (operation == fake_make_operation_type_print) { - for (f_array_length i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; i++) { f_print_string_dynamic(f_type_output, arguments.array[i]); if (i + 1 < arguments.used) { @@ -2401,8 +2401,8 @@ extern "C" { } // clear stack, except for the project root. - for (f_array_length i = 1; i < data_make->path.stack.used; i++) { - f_macro_string_dynamic_delete_simple(data_make->path.stack.array[i]); + for (f_array_length_t i = 1; i < data_make->path.stack.used; i++) { + f_macro_string_dynamic_t_delete_simple(data_make->path.stack.array[i]); } // for data_make->path.stack.used = 1; @@ -2414,11 +2414,11 @@ extern "C" { return; } - f_mode mode = f_mode_initialize; + f_mode_t mode = f_mode_t_initialize; - f_macro_mode_set_default_umask(mode, data.umask); + f_macro_mode_t_set_default_umask(mode, data.umask); - for (f_array_length i = 1; i < arguments.used; i++) { + for (f_array_length_t i = 1; i < arguments.used; i++) { if (fl_string_dynamic_compare_string(fake_make_operation_argument_file, arguments.array[0], fake_make_operation_argument_file_length) == F_equal_to) { *status = f_file_touch(arguments.array[i].string, mode.regular, F_false); @@ -2462,11 +2462,11 @@ extern "C" { #endif // _di_fake_make_operate_process_ #ifndef _di_fake_make_operate_process_execute_ - f_return_status fake_make_operate_process_execute(const fake_data data, const f_string_static program, const f_string_statics arguments, const bool as_shell, fake_make_data *data_make) { - f_status status = F_none; + f_return_status fake_make_operate_process_execute(const fake_data_t data, const f_string_static_t program, const f_string_statics_t arguments, const bool as_shell, fake_make_data_t *data_make) { + f_status_t status = F_none; // reset the environment. - for (f_array_length i = 0; i < data_make->environment.names.used; i++) { + for (f_array_length_t i = 0; i < data_make->environment.names.used; i++) { data_make->environment.names.array[i].used = 0; data_make->environment.values.array[i].used = 0; } // for @@ -2475,7 +2475,7 @@ extern "C" { data_make->environment.values.used = 0; // load all environment variables found. - for (f_array_length i = 0; i < data_make->setting_build.environment.used; i++) { + for (f_array_length_t i = 0; i < data_make->setting_build.environment.used; i++) { // pre-allocate name and value if necessary. if (data_make->environment.names.used + 1 > data_make->environment.names.size) { @@ -2512,7 +2512,7 @@ extern "C" { if (data.verbosity == fake_verbosity_verbose) { printf("%s", program.string); - for (f_array_length i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; i++) { if (arguments.array[i].used == 0) continue; printf(" %s", arguments.array[i].string); @@ -2554,8 +2554,8 @@ extern "C" { #endif // _di_fake_make_operate_process_execute_ #ifndef _di_fake_make_operate_process_return_ - void fake_make_operate_process_return(const fake_data data, const int return_code, fake_make_data *data_make, f_status *status) { - f_status status2 = F_none; + void fake_make_operate_process_return(const fake_data_t data, const int return_code, fake_make_data_t *data_make, f_status_t *status) { + f_status_t status2 = F_none; data_make->setting_make.parameter.array[0].value.array[0].used = 0; @@ -2571,7 +2571,7 @@ extern "C" { } else { if (return_code) { - f_string_dynamic number = f_string_dynamic_initialize; + f_string_dynamic_t number = f_string_dynamic_t_initialize; status2 = f_conversion_number_signed_to_string(return_code, 10, &number); if (F_status_is_error(status2)) { @@ -2579,13 +2579,13 @@ extern "C" { fake_print_message(data, F_status_set_fine(*status), "f_conversion_number_signed_to_string", F_true, data_make->print); - f_macro_string_dynamic_delete_simple(number); + f_macro_string_dynamic_t_delete_simple(number); return; } status2 = fl_string_dynamic_append(number, &data_make->setting_make.parameter.array[0].value.array[0]); - f_macro_string_dynamic_delete_simple(number); + f_macro_string_dynamic_t_delete_simple(number); } else { status2 = fl_string_append("0", 1, &data_make->setting_make.parameter.array[0].value.array[0]); @@ -2624,11 +2624,11 @@ extern "C" { #endif // _di_fake_make_operate_process_return_ #ifndef _di_fake_make_operate_process_run_ - f_return_status fake_make_operate_process_run(const fake_data data, const f_string_statics arguments, const bool as_shell, fake_make_data *data_make) { - const f_string_static *program = &arguments.array[0]; + f_return_status fake_make_operate_process_run(const fake_data_t data, const f_string_statics_t arguments, const bool as_shell, fake_make_data_t *data_make) { + const f_string_static_t *program = &arguments.array[0]; - f_status status = F_none; - f_string_dynamics args = f_string_dynamics_initialize; + f_status_t status = F_none; + f_string_dynamics_t args = f_string_dynamics_t_initialize; if (arguments.used > 1) { f_macro_string_dynamics_new(status, args, arguments.used - 1); @@ -2637,13 +2637,13 @@ extern "C" { return status; } - for (f_array_length i = 0; i < args.size; i++) { + for (f_array_length_t i = 0; i < args.size; i++) { status = fl_string_dynamic_append(arguments.array[i + 1], &args.array[i]); if (F_status_is_error(status)) { fake_print_message(data, F_status_set_fine(status), "fl_string_dynamic_append", F_true, data_make->print); - f_macro_string_dynamics_delete_simple(args); + f_macro_string_dynamics_t_delete_simple(args); return status; } @@ -2651,7 +2651,7 @@ extern "C" { if (F_status_is_error(status)) { fake_print_message(data, F_status_set_fine(status), "fl_string_dynamic_terminate", F_true, data_make->print); - f_macro_string_dynamics_delete_simple(args); + f_macro_string_dynamics_t_delete_simple(args); return status; } @@ -2661,13 +2661,13 @@ extern "C" { status = fake_make_operate_process_execute(data, *program, args, as_shell, data_make); - f_macro_string_dynamics_delete_simple(args); + f_macro_string_dynamics_t_delete_simple(args); return status; } #endif // _di_fake_make_operate_process_run_ #ifndef _di_fake_make_operate_validate_ - void fake_make_operate_validate(const fake_data data, const f_string_range section_name, const f_array_length operation, const f_string_static operation_name, const f_string_dynamics arguments, uint8_t *operation_if, fake_make_data *data_make, f_string_lengths *section_stack, f_status *status) { + void fake_make_operate_validate(const fake_data_t data, const f_string_range_t section_name, const f_array_length_t operation, const f_string_static_t operation_name, const f_string_dynamics_t arguments, uint8_t *operation_if, fake_make_data_t *data_make, f_string_lengths_t *section_stack, f_status_t *status) { if (F_status_is_error(*status)) return; if (operation == fake_make_operation_type_archive || operation == fake_make_operation_type_run || operation == fake_make_operation_type_shell) { @@ -2735,7 +2735,7 @@ extern "C" { } else if (arguments.used) { if (arguments.array[0].used) { - f_status status_file = f_file_is(arguments.array[0].string, f_file_type_regular); + f_status_t status_file = f_file_is(arguments.array[0].string, f_file_type_regular); if (status_file == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { @@ -2824,7 +2824,7 @@ extern "C" { if (operation == fake_make_operation_type_delete || operation == fake_make_operation_type_deletes) { if (arguments.used) { - for (f_array_length i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; i++) { *status = fake_make_assure_inside_project(data, arguments.array[i], data_make); if (F_status_is_error(*status)) { @@ -3001,9 +3001,9 @@ extern "C" { if (operation == fake_make_operation_type_group || operation == fake_make_operation_type_groups || operation == fake_make_operation_type_mode || operation == fake_make_operation_type_modes || operation == fake_make_operation_type_owner || operation == fake_make_operation_type_owners) { if (arguments.used > 1) { - f_status status_file = F_none; + f_status_t status_file = F_none; - for (f_array_length i = 1; i < arguments.used; i++) { + for (f_array_length_t i = 1; i < arguments.used; i++) { status_file = f_file_is(arguments.array[i].string, f_file_type_regular); if (status_file == F_file_found_not) { @@ -3054,7 +3054,7 @@ extern "C" { } if (arguments.used > 0) { - const f_string if_type_strings[] = { + const f_string_t if_type_strings[] = { fake_make_operation_argument_if_defined, fake_make_operation_argument_if_equal, fake_make_operation_argument_if_equal_not, @@ -3071,7 +3071,7 @@ extern "C" { fake_make_operation_argument_if_success, }; - const f_string_length if_type_lengths[] = { + const f_string_length_t if_type_lengths[] = { fake_make_operation_argument_if_defined_length, fake_make_operation_argument_if_equal_length, fake_make_operation_argument_if_equal_not_length, @@ -3122,7 +3122,7 @@ extern "C" { 1, }; - f_string_length i = 0; + f_string_length_t i = 0; for (; i < 14; i++) { if (fl_string_dynamic_compare_string(if_type_strings[i], arguments.array[0], if_type_lengths[i]) == F_equal_to) { @@ -3263,7 +3263,7 @@ extern "C" { } if (i < arguments.used) { - for (f_status status_file = F_none; i < arguments.used; i++) { + for (f_status_t status_file = F_none; i < arguments.used; i++) { status_file = fake_make_assure_inside_project(data, arguments.array[i], data_make); if (F_status_is_error(status_file)) { @@ -3327,9 +3327,9 @@ extern "C" { } if (*operation_if == fake_make_operation_if_type_if_greater || *operation_if == fake_make_operation_if_type_if_greater_equal || *operation_if == fake_make_operation_if_type_if_less || *operation_if == fake_make_operation_if_type_if_less_equal) { - f_status status_number = F_none; - f_string_range range = f_string_range_initialize; - f_number_unsigned number = 0; + f_status_t status_number = F_none; + f_string_range_t range = f_string_range_initialize; + f_number_unsigned_t number = 0; bool is_negative = F_false; // @fixme there needs to handle converting numbers with decimals (like 1.01), perhaps operate on them as strings or provide a special processor. @@ -3363,10 +3363,10 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - if (number > f_type_number_size_unsigned) { + if (number > f_number_t_size_unsigned) { fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The number '", data_make->print.prefix); fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%c%s", arguments.array[i].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' may only be between the ranges -%llu to %llu.", f_type_number_size_unsigned, f_type_number_size_unsigned); + fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' may only be between the ranges -%llu to %llu.", f_number_t_size_unsigned, f_number_t_size_unsigned); } else { fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Invalid or unsupported number provided '", data_make->print.prefix); @@ -3445,7 +3445,7 @@ extern "C" { *status = F_status_set_error(F_failure); } else if (arguments.used == 1) { - f_array_length id_section = 0; + f_array_length_t id_section = 0; for (; id_section < data_make->fakefile.used; id_section++) { if (fl_string_dynamic_partial_compare_string(arguments.array[0].string, data_make->buffer, arguments.array[0].used, data_make->fakefile.array[id_section].name) == F_equal_to) { @@ -3460,7 +3460,7 @@ extern "C" { fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' was found."); } else { - for (f_array_length i = 0; i < section_stack->used; i++) { + for (f_array_length_t i = 0; i < section_stack->used; i++) { if (section_stack->array[i] == id_section) { printf("%c", f_string_eol[0]); fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The section operation '", data_make->print.prefix); @@ -3499,7 +3499,7 @@ extern "C" { } else if (arguments.used) { if (arguments.array[0].used) { - f_status status_file = f_file_is(arguments.array[0].string, f_file_type_directory); + f_status_t status_file = f_file_is(arguments.array[0].string, f_file_type_directory); if (status_file == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { @@ -3564,7 +3564,7 @@ extern "C" { } } - for (f_array_length i = 1; i < arguments.used; i++) { + for (f_array_length_t i = 1; i < arguments.used; i++) { *status = fake_make_assure_inside_project(data, arguments.array[i], data_make); if (F_status_is_error(*status)) { // @todo warning @@ -3593,14 +3593,14 @@ extern "C" { #endif // _di_fake_make_operate_validate_ #ifndef _di_fake_make_operate_validate_define_name_ - f_return_status fake_make_operate_validate_define_name(const f_string_static name) { + f_return_status fake_make_operate_validate_define_name(const f_string_static_t name) { if (!name.used) return F_none; if (!(isalpha(name.string[0]) || name.string[0] == '_')) { return F_false; } - for (f_string_length i = 0; i < name.used; i++) { + for (f_string_length_t i = 0; i < name.used; i++) { if (!(isalnum(name.string[i]) || name.string[i] == '_')) { return F_false; } @@ -3611,7 +3611,7 @@ extern "C" { #endif // _di_fake_make_operate_validate_define_name_ #ifndef _di_fake_make_path_relative_ - f_return_status fake_make_path_relative(const fake_data data, const f_string_static path, fake_make_data *data_make) { + f_return_status fake_make_path_relative(const fake_data_t data, const f_string_static_t path, fake_make_data_t *data_make) { data_make->path_cache.used = 0; if (!path.used || path.used == data_make->path.stack.array[0].used) { @@ -3622,12 +3622,12 @@ extern "C" { return F_status_set_error(F_failure); } - f_string_range range = f_string_range_initialize; + f_string_range_t range = f_string_range_initialize; range.start = data_make->path.stack.array[0].used + 1; range.stop = range.start + (path.used - range.start) - 1; - f_status status = fl_string_dynamic_partial_append(path, range, &data_make->path_cache); + f_status_t status = fl_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); diff --git a/level_3/fake/c/private-make.h b/level_3/fake/c/private-make.h index 19f4367..b1a6c04 100644 --- a/level_3/fake/c/private-make.h +++ b/level_3/fake/c/private-make.h @@ -22,23 +22,23 @@ extern "C" { #define fake_make_section_stack_max 8192 // maximum stack call depth. #endif // _di_fake_make_section_ -#ifndef _di_fake_make_setting_ +#ifndef _di_fake_make_setting_t_ typedef struct { bool load_build; uint8_t fail; - f_string_map_multis parameter; - } fake_make_setting; + f_string_map_multis_t parameter; + } fake_make_setting_t; - #define fake_make_setting_initialize { \ + #define fake_make_setting_t_initialize { \ 0, \ 0, \ - f_string_map_multis_initialize, \ + f_string_map_multis_t_initialize, \ } - #define fake_macro_make_setting_delete_simple(setting) \ - f_macro_string_map_multis_delete_simple(setting.parameter) + #define fake_macro_make_setting_t_delete_simple(setting) \ + f_macro_string_map_multis_t_delete_simple(setting.parameter) #define fake_make_setting_compiler "compiler" #define fake_make_setting_define "define" @@ -57,7 +57,7 @@ extern "C" { #define fake_make_setting_load_build_length 10 #define fake_make_setting_parameter_length 9 #define fake_make_setting_return_length 6 -#endif // _di_fake_make_setting_ +#endif // _di_fake_make_setting_t_ #ifndef _di_fake_make_operation_ #define fake_make_operation_archive "archive" @@ -251,7 +251,7 @@ extern "C" { #endif // _di_fake_make_operation_ // @todo each one of these should be made available to be passed to the program as "$parameter_define[X]" for multi-value (define) or "$parameter_no_color" for single-value (no_color). -#ifndef _di_fake_make_parameter_ +#ifndef _di_fake_make_parameter_t_ #define fake_make_parameter_variable_build "build" #define fake_make_parameter_variable_dark "dark" #define fake_make_parameter_variable_data "data" @@ -283,136 +283,136 @@ extern "C" { #define fake_make_file_parameter_variable_work_length 4 typedef struct { - f_string_dynamics build; - f_string_dynamics dark; - f_string_dynamics data; - f_string_dynamics define; - f_string_dynamics light; - f_string_dynamics mode; - f_string_dynamics no_color; - f_string_dynamics process; - f_string_dynamics quiet; - f_string_dynamics settings; - f_string_dynamics sources; - f_string_dynamics verbose; - f_string_dynamics work; - } fake_make_parameter; - - #define fake_make_parameter_initialize { \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ - f_string_dynamics_initialize, \ + f_string_dynamics_t build; + f_string_dynamics_t dark; + f_string_dynamics_t data; + f_string_dynamics_t define; + f_string_dynamics_t light; + f_string_dynamics_t mode; + f_string_dynamics_t no_color; + f_string_dynamics_t process; + f_string_dynamics_t quiet; + f_string_dynamics_t settings; + f_string_dynamics_t sources; + f_string_dynamics_t verbose; + f_string_dynamics_t work; + } fake_make_parameter_t; + + #define fake_make_parameter_t_initialize { \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_dynamics_t_initialize, \ } #define fake_macro_make_parameter_delete_simple(parameter) \ - f_macro_string_dynamics_delete_simple(parameter.build) \ - f_macro_string_dynamics_delete_simple(parameter.dark) \ - f_macro_string_dynamics_delete_simple(parameter.data) \ - f_macro_string_dynamics_delete_simple(parameter.define) \ - f_macro_string_dynamics_delete_simple(parameter.light) \ - f_macro_string_dynamics_delete_simple(parameter.mode) \ - f_macro_string_dynamics_delete_simple(parameter.no_color) \ - f_macro_string_dynamics_delete_simple(parameter.process) \ - f_macro_string_dynamics_delete_simple(parameter.quiet) \ - f_macro_string_dynamics_delete_simple(parameter.settings) \ - f_macro_string_dynamics_delete_simple(parameter.sources) \ - f_macro_string_dynamics_delete_simple(parameter.verbose) \ - f_macro_string_dynamics_delete_simple(parameter.work) -#endif // _di_fake_make_parameter_ - -#ifndef _di_fake_make_path_ + f_macro_string_dynamics_t_delete_simple(parameter.build) \ + f_macro_string_dynamics_t_delete_simple(parameter.dark) \ + f_macro_string_dynamics_t_delete_simple(parameter.data) \ + f_macro_string_dynamics_t_delete_simple(parameter.define) \ + f_macro_string_dynamics_t_delete_simple(parameter.light) \ + f_macro_string_dynamics_t_delete_simple(parameter.mode) \ + f_macro_string_dynamics_t_delete_simple(parameter.no_color) \ + f_macro_string_dynamics_t_delete_simple(parameter.process) \ + f_macro_string_dynamics_t_delete_simple(parameter.quiet) \ + f_macro_string_dynamics_t_delete_simple(parameter.settings) \ + f_macro_string_dynamics_t_delete_simple(parameter.sources) \ + f_macro_string_dynamics_t_delete_simple(parameter.verbose) \ + f_macro_string_dynamics_t_delete_simple(parameter.work) +#endif // _di_fake_make_parameter_t_ + +#ifndef _di_fake_make_path_t_ typedef struct { int top; int current; - f_string_dynamics stack; - } fake_make_path; + f_string_dynamics_t stack; + } fake_make_path_t; - #define fake_make_path_initialize { \ + #define fake_make_path_t_initialize { \ 0, \ 0, \ - f_string_dynamics_initialize, \ + f_string_dynamics_t_initialize, \ } #define fake_macro_make_path_delete_simple(path) \ - f_macro_string_dynamics_delete_simple(path.stack) -#endif // _di_fake_make_path_ + f_macro_string_dynamics_t_delete_simple(path.stack) +#endif // _di_fake_make_path_t_ -#ifndef _di_fake_make_print_ +#ifndef _di_fake_make_print_t_ typedef struct { const char *prefix; - f_string_static context; + f_string_static_t context; FILE *to; - } fake_make_print; + } fake_make_print_t; - #define fake_make_print_initialize { \ + #define fake_make_print_t_initialize { \ 0, \ - f_string_static_initialize, \ + f_string_static_t_initialize, \ 0, \ } - #define fake_macro_make_print_initialize(prefix, context, to) { prefix, context, to } + #define fake_macro_make_print_t_initialize(prefix, context, to) { prefix, context, to } #define fake_make_print_error "ERROR" #define fake_make_print_warning "WARNING" #define fake_make_print_error_length 5 #define fake_make_print_warning_length 7 -#endif // _di_fake_make_print_ +#endif // _di_fake_make_print_t_ -#ifndef _di_fake_make_data_ +#ifndef _di_fake_make_data_t_ typedef struct { - fake_build_setting setting_build; - fake_make_setting setting_make; + fake_build_setting_t setting_build; + fake_make_setting_t setting_make; - fake_environment environment; + fake_environment_t environment; - fake_make_parameter parameter; - fake_make_path path; - fake_make_print print; + fake_make_parameter_t parameter; + fake_make_path_t path; + fake_make_print_t print; - f_fss_nameds fakefile; + f_fss_nameds_t fakefile; - f_string_dynamic buffer; - f_string_dynamic path_cache; + f_string_dynamic_t buffer; + f_string_dynamic_t path_cache; - f_array_length main; - } fake_make_data; + f_array_length_t main; + } fake_make_data_t; - #define fake_make_data_initialize { \ - fake_build_setting_initialize, \ - fake_make_setting_initialize, \ - fake_environment_initialize, \ - fake_make_parameter_initialize, \ - fake_make_path_initialize, \ - fake_make_print_initialize, \ - f_fss_nameds_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ + #define fake_make_data_t_initialize { \ + fake_build_setting_t_initialize, \ + fake_make_setting_t_initialize, \ + fake_environment_t_initialize, \ + fake_make_parameter_t_initialize, \ + fake_make_path_t_initialize, \ + fake_make_print_t_initialize, \ + f_fss_nameds_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ 0, \ } - #define fake_macro_make_data_delete_simple(data) \ - fake_macro_build_setting_delete_simple(data.setting_build) \ - fake_macro_make_setting_delete_simple(data.setting_make) \ - fake_macro_environment_delete_simple(data.environment) \ + #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) \ + fake_macro_environment_t_delete_simple(data.environment) \ fake_macro_make_parameter_delete_simple(data.parameter) \ fake_macro_make_path_delete_simple(data.path) \ - f_macro_fss_nameds_delete_simple(data.fakefile) \ - f_macro_string_dynamic_delete_simple(data.buffer) \ - f_macro_string_dynamic_delete_simple(data.path_cache) -#endif // _di_fake_make_data_ + f_macro_fss_nameds_t_delete_simple(data.fakefile) \ + f_macro_string_dynamic_t_delete_simple(data.buffer) \ + f_macro_string_dynamic_t_delete_simple(data.path_cache) +#endif // _di_fake_make_data_t_ /** * Assure that a path is within the project root path. @@ -432,7 +432,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_assure_inside_project_ - extern f_return_status fake_make_assure_inside_project(const fake_data data, const f_string_static path, fake_make_data *data_make) f_gcc_attribute_visibility_internal; + extern f_return_status fake_make_assure_inside_project(const fake_data_t data, const f_string_static_t path, fake_make_data_t *data_make) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_assure_inside_project_ /** @@ -454,7 +454,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_get_id_group_ - f_return_status fake_make_get_id_group(const fake_data data, const fake_make_print print, const f_string_static buffer, gid_t *id) f_gcc_attribute_visibility_internal; + f_return_status fake_make_get_id_group(const fake_data_t data, const fake_make_print_t print, const f_string_static_t buffer, gid_t *id) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_get_id_group_ /** @@ -480,7 +480,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_get_id_mode_ - f_return_status fake_make_get_id_mode(const fake_data data, const fake_make_print print, const f_string_static buffer, f_file_mode *mode, uint8_t *replace) f_gcc_attribute_visibility_internal; + f_return_status fake_make_get_id_mode(const fake_data_t data, const fake_make_print_t print, const f_string_static_t buffer, f_file_mode *mode, uint8_t *replace) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_get_id_mode_ /** @@ -502,7 +502,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_get_id_owner_ - f_return_status fake_make_get_id_owner(const fake_data data, const fake_make_print print, const f_string_static buffer, uid_t *id) f_gcc_attribute_visibility_internal; + f_return_status fake_make_get_id_owner(const fake_data_t data, const fake_make_print_t print, const f_string_static_t buffer, uid_t *id) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_get_id_owner_ /** @@ -524,7 +524,7 @@ extern "C" { * @see fake_build_load_setting() */ #ifndef _di_fake_make_load_fakefile_ - extern void fake_make_load_fakefile(const fake_data data, fake_make_data *data_make, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_make_load_fakefile(const fake_data_t data, fake_make_data_t *data_make, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_load_fakefile_ /** @@ -542,7 +542,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_ - extern f_return_status fake_make_operate(const fake_data data) f_gcc_attribute_visibility_internal; + extern f_return_status fake_make_operate(const fake_data_t data) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_operate_ /** @@ -570,7 +570,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_expand_ - extern void fake_make_operate_expand(const fake_data data, const f_string_range section_name, const f_array_length operation, const f_string_static operation_name, const f_fss_content content, const f_fss_quoteds quoteds, fake_make_data *data_make, f_string_dynamics *arguments, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_make_operate_expand(const fake_data_t data, const f_string_range_t section_name, const f_array_length_t operation, const f_string_static_t operation_name, const f_fss_content_t content, const f_fss_quoteds_t quoteds, fake_make_data_t *data_make, f_string_dynamics_t *arguments, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_operate_expand_ /** @@ -594,7 +594,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_expand_environment_ - extern f_return_status fake_make_operate_expand_environment(const fake_data data, const f_fss_quoted quoted, const f_string_range range_name, fake_make_data *data_make, f_string_dynamics *arguments) f_gcc_attribute_visibility_internal; + extern f_return_status fake_make_operate_expand_environment(const fake_data_t data, const f_fss_quoted_t quoted, const f_string_range_t range_name, fake_make_data_t *data_make, f_string_dynamics_t *arguments) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_operate_expand_environment_ /** @@ -618,7 +618,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_expand_build_ - extern f_return_status fake_make_operate_expand_build(const fake_data data, const f_fss_quoted quoted, const f_string_range range_name, fake_make_data *data_make, f_string_dynamics *arguments) f_gcc_attribute_visibility_internal; + extern f_return_status fake_make_operate_expand_build(const fake_data_t data, const f_fss_quoted_t quoted, const f_string_range_t range_name, fake_make_data_t *data_make, f_string_dynamics_t *arguments) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_operate_expand_build_ /** @@ -639,7 +639,7 @@ extern "C" { * F_recurse (with error bit set) is returned if unable to recurse to another operation section (usually max stack depth reached). */ #ifndef _di_fake_make_operate_section_ - void fake_make_operate_section(const fake_data data, const f_array_length id_section, fake_make_data *data_make, f_string_lengths *section_stack, f_status *status) f_gcc_attribute_visibility_internal; + void fake_make_operate_section(const fake_data_t data, const f_array_length_t id_section, fake_make_data_t *data_make, f_string_lengths_t *section_stack, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_operate_section_ /** @@ -669,7 +669,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_process_ - extern void fake_make_operate_process(const fake_data data, const f_string_range section_name, const uint8_t operation, const f_string_static operation_name, const f_string_dynamics arguments, const bool success, uint8_t *operation_if, fake_make_data *data_make, f_string_lengths *section_stack, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_make_operate_process(const fake_data_t data, const f_string_range_t section_name, const uint8_t operation, const f_string_static_t operation_name, const f_string_dynamics_t arguments, const bool success, uint8_t *operation_if, fake_make_data_t *data_make, f_string_lengths_t *section_stack, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_operate_process_ /** @@ -691,7 +691,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_process_execute_ - extern f_return_status fake_make_operate_process_execute(const fake_data data, const f_string_static program, const f_string_statics arguments, const bool as_shell, fake_make_data *data_make) f_gcc_attribute_visibility_internal; + extern f_return_status fake_make_operate_process_execute(const fake_data_t data, const f_string_static_t program, const f_string_statics_t arguments, const bool as_shell, fake_make_data_t *data_make) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_operate_process_execute_ /** @@ -707,7 +707,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_process_return_ - extern void fake_make_operate_process_return(const fake_data data, const int return_code, fake_make_data *data_make, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_make_operate_process_return(const fake_data_t data, const int return_code, fake_make_data_t *data_make, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_operate_process_return_ /** @@ -727,7 +727,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_process_run_ - extern f_return_status fake_make_operate_process_run(const fake_data data, const f_string_statics arguments, const bool as_shell, fake_make_data *data_make) f_gcc_attribute_visibility_internal; + extern f_return_status fake_make_operate_process_run(const fake_data_t data, const f_string_statics_t arguments, const bool as_shell, fake_make_data_t *data_make) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_operate_process_run_ /** @@ -758,7 +758,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_validate_ - extern void fake_make_operate_validate(const fake_data data, const f_string_range section_name, const f_array_length operation, const f_string_static operation_name, const f_string_dynamics arguments, uint8_t *operation_if, fake_make_data *data_make, f_string_lengths *section_stack, f_status *status) f_gcc_attribute_visibility_internal; + extern void fake_make_operate_validate(const fake_data_t data, const f_string_range_t section_name, const f_array_length_t operation, const f_string_static_t operation_name, const f_string_dynamics_t arguments, uint8_t *operation_if, fake_make_data_t *data_make, f_string_lengths_t *section_stack, f_status_t *status) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_operate_validate_ /** @@ -777,7 +777,7 @@ extern "C" { * F_none if there is no string to validate (used = 0). */ #ifndef _di_fake_make_operate_validate_define_name_ - extern f_return_status fake_make_operate_validate_define_name(const f_string_static name) f_gcc_attribute_visibility_internal; + extern f_return_status fake_make_operate_validate_define_name(const f_string_static_t name) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_operate_validate_define_name_ /** @@ -795,7 +795,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_path_relative_ - extern f_return_status fake_make_path_relative(const fake_data data, const f_string_static path, fake_make_data *data_make) f_gcc_attribute_visibility_internal; + extern f_return_status fake_make_path_relative(const fake_data_t data, const f_string_static_t path, fake_make_data_t *data_make) f_gcc_attribute_visibility_internal; #endif // _di_fake_make_path_relative_ #ifdef __cplusplus diff --git a/level_3/fake/c/private-print.c b/level_3/fake/c/private-print.c index 86a535e..0baf69f 100644 --- a/level_3/fake/c/private-print.c +++ b/level_3/fake/c/private-print.c @@ -10,15 +10,15 @@ extern "C" { #endif #ifndef _di_fake_print_error_ - f_return_status fake_print_error(const fake_data data, const f_status status, const f_string function, const bool fallback) { - const fake_make_print print = fake_macro_make_print_initialize(fake_make_print_error, data.context.error, f_type_error); + f_return_status fake_print_error(const fake_data_t data, const f_status_t status, const f_string_t function, const bool fallback) { + const fake_make_print_t print = fake_macro_make_print_t_initialize(fake_make_print_error, data.context.error, f_type_error); return fake_print_message(data, status, function, fallback, print); } #endif // _di_fake_print_error_ #ifndef _di_fake_print_error_build_operation_file_ - bool fake_print_error_build_operation_file(const fake_data data, const f_status status, const f_string function, const f_string operation, const f_string how, const f_string source, const f_string destination, const bool fallback) { + bool fake_print_error_build_operation_file(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t operation, const f_string_t how, const f_string_t source, const f_string_t destination, const bool fallback) { if (status == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet) { @@ -239,15 +239,15 @@ extern "C" { #endif // _di_fake_print_error_build_operation_file_ #ifndef _di_fake_print_error_file_ - bool fake_print_error_file(const fake_data data, const f_status status, const f_string function, const f_string name, const f_string operation, const bool is_file, const bool fallback) { - const fake_make_print print = fake_macro_make_print_initialize(fake_make_print_error, data.context.error, f_type_error); + bool fake_print_error_file(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback) { + const fake_make_print_t print = fake_macro_make_print_t_initialize(fake_make_print_error, data.context.error, f_type_error); return fake_print_message_file(data, status, function, name, operation, is_file, fallback, print); } #endif // _di_fake_print_error_file_ #ifndef _di_fake_print_error_fss - bool fake_print_error_fss(const fake_data data, const f_status status, const f_string function, const f_string path_file, const f_string_range range, const bool fallback) { + bool fake_print_error_fss(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path_file, const f_string_range_t range, const bool fallback) { if (status == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet) { @@ -289,7 +289,7 @@ extern "C" { #endif // _di_fake_print_error_fss #ifndef _di_fake_print_error_parameter_missing_value_ - void fake_print_error_parameter_missing_value(const fake_data data, const f_string parameter) { + void fake_print_error_parameter_missing_value(const fake_data_t data, const f_string_t parameter) { if (data.verbosity == fake_verbosity_quiet) return; fprintf(f_type_error, "%c", f_string_eol[0]); @@ -302,7 +302,7 @@ extern "C" { #endif // _di_fake_print_error_parameter_missing_value_ #ifndef _di_fake_print_error_parameter_too_many_ - void fake_print_error_parameter_too_many(const fake_data data, const f_string parameter) { + void fake_print_error_parameter_too_many(const fake_data_t data, const f_string_t parameter) { if (data.verbosity == fake_verbosity_quiet) return; fprintf(f_type_error, "%c", f_string_eol[0]); @@ -315,7 +315,7 @@ extern "C" { #endif // _di_fake_print_error_parameter_too_many_ #ifndef _di_fake_print_message_ - f_return_status fake_print_message(const fake_data data, const f_status status, const f_string function, const bool fallback, const fake_make_print print) { + f_return_status fake_print_message(const fake_data_t data, const f_status_t status, const f_string_t function, const bool fallback, const fake_make_print_t print) { if (status == F_parameter) { if (data.verbosity != fake_verbosity_quiet) { @@ -374,8 +374,8 @@ extern "C" { #endif // _di_fake_print_message_ #ifndef _di_fake_print_message_file_ - bool fake_print_message_file(const fake_data data, const f_status status, const f_string function, const f_string name, const f_string operation, const bool is_file, const bool fallback, const fake_make_print print) { - const f_string file_or_directory = is_file ? "file" : "directory"; + bool fake_print_message_file(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback, const fake_make_print_t print) { + const f_string_t file_or_directory = is_file ? "file" : "directory"; if (status == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet) { @@ -550,10 +550,10 @@ extern "C" { #endif // _di_fake_print_message_file_ #ifndef _di_fake_print_message_section_operation_failed_ - void fake_print_message_section_operation_failed(const fake_data data, const f_string_static buffer, const f_string_range section_name, const f_string_range operation_name, const fake_make_print print) { + void fake_print_message_section_operation_failed(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const fake_make_print_t print) { if (data.verbosity == fake_verbosity_quiet || !print.to) return; - f_string_length line = 1; + f_string_length_t line = 1; f_fss_count_lines(buffer, operation_name.start, &line); @@ -577,7 +577,7 @@ extern "C" { #endif // _di_fake_print_message_section_operation_failed_ #ifndef _di_fake_print_message_section_operation_path_outside_ - void fake_print_message_section_operation_path_outside(const fake_data data, const f_status status, const f_string function, const f_string path, const fake_make_print print) { + void fake_print_message_section_operation_path_outside(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, const fake_make_print_t print) { if (data.verbosity == fake_verbosity_quiet || !print.to) return; if (F_status_set_fine(status) == F_false) { @@ -593,7 +593,7 @@ extern "C" { #endif // _di_fake_print_message_section_operation_path_outside_ #ifndef _di_fake_print_message_section_operation_path_stack_max_ - void fake_print_message_section_operation_path_stack_max(const fake_data data, const f_status status, const f_string function, const f_string path, const fake_make_print print) { + void fake_print_message_section_operation_path_stack_max(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, const fake_make_print_t print) { if (data.verbosity == fake_verbosity_quiet || !print.to) return; if (status == F_buffer_too_large) { @@ -617,10 +617,10 @@ extern "C" { #endif // _di_fake_print_message_section_operation_path_stack_max_ #ifndef _di_fake_print_message_section_operation_stack_max_ - void fake_print_message_section_operation_stack_max(const fake_data data, const f_string_static buffer, const f_string_range section_name, const f_string_range operation_name, const f_array_length stack_max, const fake_make_print print) { + void fake_print_message_section_operation_stack_max(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max, const fake_make_print_t print) { if (data.verbosity == fake_verbosity_quiet || !print.to) return; - f_string_length line = 1; + f_string_length_t line = 1; f_fss_count_lines(buffer, operation_name.start, &line); @@ -646,10 +646,10 @@ extern "C" { #endif // _di_fake_print_message_section_operation_stack_max_ #ifndef _di_fake_print_message_section_operation_unknown_ - void fake_print_message_section_operation_unknown(const fake_data data, const f_string_static buffer, const f_string_range section_name, const f_string_range operation_name, const fake_make_print print) { + void fake_print_message_section_operation_unknown(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const fake_make_print_t print) { if (data.verbosity == fake_verbosity_quiet || !print.to) return; - f_string_length line = 1; + f_string_length_t line = 1; f_fss_count_lines(buffer, operation_name.start, &line); @@ -673,7 +673,7 @@ extern "C" { #endif // _di_fake_print_message_section_operation_unknown_ #ifndef _di_fake_print_warning_settings_content_empty_ - void fake_print_warning_settings_content_empty(const fake_data data, const f_string path_file, const f_string_dynamic buffer, const f_string_range range_object, const f_string settings_name) { + void fake_print_warning_settings_content_empty(const fake_data_t data, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_t settings_name) { if (data.verbosity == fake_verbosity_quiet) return; fprintf(f_type_error, "%c", f_string_eol[0]); @@ -693,7 +693,7 @@ extern "C" { #endif // _di_fake_print_warning_settings_content_empty_ #ifndef _di_fake_print_warning_settings_content_invalid_ - void fake_print_warning_settings_content_invalid(const fake_data data, const f_string path_file, const f_string_dynamic buffer, const f_string_range range_object, const f_string_range range_content, const f_string settings_name) { + void fake_print_warning_settings_content_invalid(const fake_data_t data, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_t settings_name) { if (data.verbosity == fake_verbosity_quiet) return; fprintf(f_type_error, "%c", f_string_eol[0]); @@ -719,7 +719,7 @@ extern "C" { #endif // _di_fake_print_warning_settings_content_invalid_ #ifndef _di_fake_print_warning_settings_content_multiple_ - void fake_print_warning_settings_content_multiple(const fake_data data, const f_string path_file, const f_string name_object) { + void fake_print_warning_settings_content_multiple(const fake_data_t data, const f_string_t path_file, const f_string_t name_object) { if (data.verbosity != fake_verbosity_verbose) return; fprintf(f_type_error, "%c", f_string_eol[0]); @@ -734,7 +734,7 @@ extern "C" { #endif // _di_fake_print_warning_settings_content_multiple_ #ifndef _di_fake_print_warning_settings_object_multiple_ - void fake_print_warning_settings_object_multiple(const fake_data data, const f_string path_file, const f_string label, const f_string name_object) { + void fake_print_warning_settings_object_multiple(const fake_data_t data, const f_string_t path_file, const f_string_t label, const f_string_t name_object) { if (data.verbosity != fake_verbosity_verbose) return; fprintf(f_type_error, "%c", f_string_eol[0]); diff --git a/level_3/fake/c/private-print.h b/level_3/fake/c/private-print.h index 1f260d9..95c3759 100644 --- a/level_3/fake/c/private-print.h +++ b/level_3/fake/c/private-print.h @@ -30,7 +30,7 @@ extern "C" { * F_unknown is returned if the status code has no print message. */ #ifndef _di_fake_print_error_ - extern f_return_status fake_print_error(const fake_data data, const f_status status, const f_string function, const bool fallback) f_gcc_attribute_visibility_internal; + extern f_return_status fake_print_error(const fake_data_t data, const f_status_t status, const f_string_t function, const bool fallback) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_error_ /** @@ -62,7 +62,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_fake_print_error_operation_file_ - extern bool fake_print_error_build_operation_file(const fake_data data, const f_status status, const f_string function, const f_string operation, const f_string source, const f_string destination, const f_string how, const bool fallback) f_gcc_attribute_visibility_internal; + extern bool fake_print_error_build_operation_file(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t operation, const f_string_t source, const f_string_t destination, const f_string_t how, const bool fallback) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_error_operation_file_ /** @@ -90,7 +90,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_fake_print_error_file_ - extern bool fake_print_error_file(const fake_data data, const f_status status, const f_string function, const f_string name, const f_string operation, const bool is_file, const bool fallback) f_gcc_attribute_visibility_internal; + extern bool fake_print_error_file(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_error_file_ /** @@ -114,7 +114,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_fake_print_error_fss_ - extern bool fake_print_error_fss(const fake_data data, const f_status status, const f_string function, const f_string path_file, const f_string_range range, const bool fallback) f_gcc_attribute_visibility_internal; + extern bool fake_print_error_fss(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path_file, const f_string_range_t range, const bool fallback) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_error_fss_ /** @@ -126,7 +126,7 @@ extern "C" { * The parameter name. */ #ifndef _di_fake_print_error_parameter_missing_value_ - extern void fake_print_error_parameter_missing_value(const fake_data data, const f_string parameter) f_gcc_attribute_visibility_internal; + extern void fake_print_error_parameter_missing_value(const fake_data_t data, const f_string_t parameter) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_error_parameter_missing_value_ /** @@ -138,7 +138,7 @@ extern "C" { * The parameter name. */ #ifndef _di_fake_print_error_parameter_too_many_ - extern void fake_print_error_parameter_too_many(const fake_data data, const f_string parameter) f_gcc_attribute_visibility_internal; + extern void fake_print_error_parameter_too_many(const fake_data_t data, const f_string_t parameter) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_error_parameter_too_many_ /** @@ -161,7 +161,7 @@ extern "C" { * F_unknown is returned if the status code has no print message. */ #ifndef _di_fake_print_message_ - extern f_return_status fake_print_message(const fake_data data, const f_status status, const f_string function, const bool fallback, const fake_make_print print) f_gcc_attribute_visibility_internal; + extern f_return_status fake_print_message(const fake_data_t data, const f_status_t status, const f_string_t function, const bool fallback, const fake_make_print_t print) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_message_ /** @@ -191,7 +191,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_fake_print_message_file_ - extern bool fake_print_message_file(const fake_data data, const f_status status, const f_string function, const f_string name, const f_string operation, const bool is_file, const bool fallback, const fake_make_print print) f_gcc_attribute_visibility_internal; + extern bool fake_print_message_file(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback, const fake_make_print_t print) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_message_file_ /** @@ -209,7 +209,7 @@ extern "C" { * Designates how the section error/warning should be printed. */ #ifndef _di_fake_print_message_section_operation_failed_ - extern void fake_print_message_section_operation_failed(const fake_data data, const f_string_static buffer, const f_string_range section_name, const f_string_range operation_name, const fake_make_print print) f_gcc_attribute_visibility_internal; + extern void fake_print_message_section_operation_failed(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const fake_make_print_t print) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_message_section_operation_failed_ /** @@ -227,7 +227,7 @@ extern "C" { * Designates how the section error/warning should be printed. */ #ifndef _di_fake_print_message_section_operation_path_outside_ - extern void fake_print_message_section_operation_path_outside(const fake_data data, const f_status status, const f_string function, const f_string path, const fake_make_print print) f_gcc_attribute_visibility_internal; + extern void fake_print_message_section_operation_path_outside(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, const fake_make_print_t print) f_gcc_attribute_visibility_internal; #endif // _fake_print_message_section_operation_path_outside_ /** @@ -246,7 +246,7 @@ extern "C" { * Designates how the section error/warning should be printed. */ #ifndef _di_fake_print_message_section_operation_path_stack_max_ - extern void fake_print_message_section_operation_path_stack_max(const fake_data data, const f_status status, const f_string function, const f_string path, const fake_make_print print) f_gcc_attribute_visibility_internal; + extern void fake_print_message_section_operation_path_stack_max(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, const fake_make_print_t print) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_message_section_operation_path_stack_max_ /** @@ -266,7 +266,7 @@ extern "C" { * Designates how the section error/warning should be printed. */ #ifndef _di_fake_print_message_section_operation_stack_max_ - extern void fake_print_message_section_operation_stack_max(const fake_data data, const f_string_static buffer, const f_string_range section_name, const f_string_range operation_name, const f_array_length stack_max, const fake_make_print print) f_gcc_attribute_visibility_internal; + extern void fake_print_message_section_operation_stack_max(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max, const fake_make_print_t print) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_message_section_operation_stack_max_ /** @@ -284,7 +284,7 @@ extern "C" { * Designates how the section error/warning should be printed. */ #ifndef _di_fake_print_message_section_operation_unknown_ - extern void fake_print_message_section_operation_unknown(const fake_data data, const f_string_static buffer, const f_string_range section_name, const f_string_range operation_name, const fake_make_print print) f_gcc_attribute_visibility_internal; + extern void fake_print_message_section_operation_unknown(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const fake_make_print_t print) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_message_section_operation_unknown_ /** @@ -302,7 +302,7 @@ extern "C" { * The name of the setting that has an invalid value. */ #ifndef _di_fake_print_warning_settings_content_empty_ - extern void fake_print_warning_settings_content_empty(const fake_data data, const f_string path_file, const f_string_dynamic buffer, const f_string_range range_object, const f_string settings_name) f_gcc_attribute_visibility_internal; + extern void fake_print_warning_settings_content_empty(const fake_data_t data, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_t settings_name) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_warning_settings_content_empty_ /** @@ -324,7 +324,7 @@ extern "C" { * Designates how the section error/warning should be printed. */ #ifndef _di_fake_print_warning_settings_content_invalid_ - extern void fake_print_warning_settings_content_invalid(const fake_data data, const f_string path_file, const f_string_dynamic buffer, const f_string_range range_object, const f_string_range range_content, const f_string settings_name) f_gcc_attribute_visibility_internal; + extern void fake_print_warning_settings_content_invalid(const fake_data_t data, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_t settings_name) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_warning_settings_content_invalid_ /** @@ -340,7 +340,7 @@ extern "C" { * The name of the object. */ #ifndef _di_fake_print_warning_settings_content_multiple_ - extern void fake_print_warning_settings_content_multiple(const fake_data data, const f_string path_file, const f_string name_object) f_gcc_attribute_visibility_internal; + extern void fake_print_warning_settings_content_multiple(const fake_data_t data, const f_string_t path_file, const f_string_t name_object) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_warning_settings_content_multiple_ /** @@ -358,7 +358,7 @@ extern "C" { * The name of the object. */ #ifndef _di_fake_print_warning_settings_object_multiple_ - extern void fake_print_warning_settings_object_multiple(const fake_data data, const f_string path_file, const f_string label, const f_string name_object) f_gcc_attribute_visibility_internal; + extern void fake_print_warning_settings_object_multiple(const fake_data_t data, const f_string_t path_file, const f_string_t label, const f_string_t name_object) f_gcc_attribute_visibility_internal; #endif // _di_fake_print_warning_settings_object_multiple_ #ifdef __cplusplus diff --git a/level_3/fake/c/private-skeleton.c b/level_3/fake/c/private-skeleton.c index e95d3ac..254c2fa 100644 --- a/level_3/fake/c/private-skeleton.c +++ b/level_3/fake/c/private-skeleton.c @@ -10,8 +10,8 @@ extern "C" { #endif #ifndef _di_fake_skeleton_operate_ - f_return_status fake_skeleton_operate(const fake_data data) { - f_status status = F_none; + f_return_status fake_skeleton_operate(const fake_data_t data) { + f_status_t status = F_none; if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); @@ -19,7 +19,7 @@ extern "C" { } { - const f_string_dynamic *parameters_value[] = { + const f_string_dynamic_t *parameters_value[] = { &data.path_build, &data.path_data, &data.path_data_build, @@ -52,9 +52,9 @@ extern "C" { } // for } - f_string_dynamic file_data_build_process_post = f_string_dynamic_initialize; - f_string_dynamic file_data_build_process_pre = f_string_dynamic_initialize; - f_string_dynamic content = f_string_dynamic_initialize; + f_string_dynamic_t file_data_build_process_post = f_string_dynamic_t_initialize; + f_string_dynamic_t file_data_build_process_pre = f_string_dynamic_t_initialize; + f_string_dynamic_t content = f_string_dynamic_t_initialize; if (F_status_is_not_error(status)) { content.string = fake_make_skeleton_content_defines; @@ -109,8 +109,8 @@ extern "C" { } if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(file_data_build_process_post); - f_macro_string_dynamic_delete_simple(file_data_build_process_pre); + f_macro_string_dynamic_t_delete_simple(file_data_build_process_post); + f_macro_string_dynamic_t_delete_simple(file_data_build_process_pre); return status; } @@ -119,8 +119,8 @@ extern "C" { #endif // _di_fake_skeleton_operate_ #ifndef _di_fake_skeleton_operate_directory_create_ - f_return_status fake_skeleton_operate_directory_create(const fake_data data, const f_string_dynamic path) { - f_status status = F_none; + f_return_status fake_skeleton_operate_directory_create(const fake_data_t data, const f_string_dynamic_t path) { + f_status_t status = F_none; if (path.used == 0) return F_none; @@ -174,8 +174,8 @@ extern "C" { #endif // _di_fake_skeleton_operate_directory_create_ #ifndef _di_fake_skeleton_operate_file_create_ - f_return_status fake_skeleton_operate_file_create(const fake_data data, const f_string_dynamic path, const bool executable, const f_string_static content) { - f_status status = F_none; + f_return_status fake_skeleton_operate_file_create(const fake_data_t data, const f_string_dynamic_t path, const bool executable, const f_string_static_t content) { + f_status_t status = F_none; if (path.used == 0) return F_none; @@ -236,7 +236,7 @@ extern "C" { } if (content.used) { - f_file file = f_file_initialize; + f_file_t file = f_file_t_initialize; file.flag = f_file_flag_append_wo; file.size_write = content.used; diff --git a/level_3/fake/c/private-skeleton.h b/level_3/fake/c/private-skeleton.h index b0982a9..fd18e3a 100644 --- a/level_3/fake/c/private-skeleton.h +++ b/level_3/fake/c/private-skeleton.h @@ -36,7 +36,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_skeleton_operate_ - extern f_return_status fake_skeleton_operate(const fake_data data) f_gcc_attribute_visibility_internal; + extern f_return_status fake_skeleton_operate(const fake_data_t data) f_gcc_attribute_visibility_internal; #endif // _di_fake_skeleton_operate_ /** @@ -54,7 +54,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_skeleton_operate_directory_create_ - extern f_return_status fake_skeleton_operate_directory_create(const fake_data data, const f_string_dynamic path) f_gcc_attribute_visibility_internal; + extern f_return_status fake_skeleton_operate_directory_create(const fake_data_t data, const f_string_dynamic_t path) f_gcc_attribute_visibility_internal; #endif // _di_fake_skeleton_operate_directory_create_ /** @@ -77,7 +77,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_skeleton_operate_file_create_ - extern f_return_status fake_skeleton_operate_file_create(const fake_data data, const f_string_dynamic path, const bool executable, const f_string_static content) f_gcc_attribute_visibility_internal; + extern f_return_status fake_skeleton_operate_file_create(const fake_data_t data, const f_string_dynamic_t path, const bool executable, const f_string_static_t content) f_gcc_attribute_visibility_internal; #endif // _di_fake_skeleton_operate_file_create_ #ifdef __cplusplus diff --git a/level_3/fake/data/build/dependencies b/level_3/fake/data/build/dependencies index 48fe7ef..c7095bb 100644 --- a/level_3/fake/data/build/dependencies +++ b/level_3/fake/data/build/dependencies @@ -1,18 +1,18 @@ # fss-0000 f_type -f_status +f_status_t f_memory -f_string +f_string_t f_utf f_account -f_color +f_color_t f_console f_conversion f_directory f_environment f_fss -f_file +f_file_t f_iki f_path f_print diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index c845fc4..b620a6e 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -12,7 +12,7 @@ extern "C" { #endif #ifndef _di_firewall_print_help_ - f_return_status firewall_print_help(const fl_color_context context) { + f_return_status firewall_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, firewall_name_long, firewall_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -55,13 +55,13 @@ extern "C" { #endif // _di_firewall_print_help_ #ifndef _di_firewall_main_ - f_return_status firewall_main(const f_console_arguments arguments, firewall_data *data) { - f_status status = F_none; + f_return_status firewall_main(const f_console_arguments_t arguments, firewall_data_t *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, firewall_total_parameters }; - f_console_parameter_id ids[3] = { firewall_parameter_no_color, firewall_parameter_light, firewall_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, firewall_total_parameters }; + f_console_parameter_id_t ids[3] = { firewall_parameter_no_color, firewall_parameter_light, firewall_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); @@ -138,9 +138,9 @@ extern "C" { } if (found_command) { - firewall_local_data local = firewall_local_data_initialize; - firewall_reserved_chains reserved = firewall_reserved_chains_initialize; - f_string_range input = f_string_range_initialize; + firewall_local_data_t local = firewall_local_data_t_initialize; + firewall_reserved_chains_t reserved = firewall_reserved_chains_t_initialize; + f_string_range_t input = f_string_range_initialize; if (command == firewall_parameter_command_show) { // Warning: these are hardcoded print commands (I am not certain how I am going to implement external 'show' rules as the default-firewall setting file is the wrong place to put this) @@ -148,7 +148,7 @@ extern "C" { bool show_mangle = F_true; bool show_ports = F_true; - f_string_dynamics parameters = f_string_dynamics_initialize; + f_string_dynamics_t parameters = f_string_dynamics_t_initialize; int results = 0; if (data->remaining.used > 0) { @@ -156,7 +156,7 @@ extern "C" { show_mangle = F_false; show_ports = F_false; - f_string_length counter = 0; + f_string_length_t counter = 0; for (; counter < data->remaining.used; counter++) { if (strncmp("nat", arguments.argv[data->remaining.array[counter]], 4) != 0) { @@ -195,12 +195,12 @@ extern "C" { parameters.used = 6; - parameters.array[0].string = (f_string) "-x"; - parameters.array[1].string = (f_string) "-v"; - parameters.array[2].string = (f_string) "-t"; - parameters.array[3].string = (f_string) "nat"; - parameters.array[4].string = (f_string) "--numeric"; - parameters.array[5].string = (f_string) "--list"; + parameters.array[0].string = (f_string_t) "-x"; + parameters.array[1].string = (f_string_t) "-v"; + parameters.array[2].string = (f_string_t) "-t"; + parameters.array[3].string = (f_string_t) "nat"; + parameters.array[4].string = (f_string_t) "--numeric"; + parameters.array[5].string = (f_string_t) "--list"; parameters.array[0].used = 2; parameters.array[1].used = 2; @@ -209,7 +209,7 @@ extern "C" { parameters.array[4].used = 9; parameters.array[5].used = 6; - status = fll_execute_program((f_string) firewall_tool_iptables, parameters, &results); + status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, &results); fprintf(f_type_output, "\n"); fflush(f_type_output); @@ -223,12 +223,12 @@ extern "C" { parameters.used = 6; - parameters.array[0].string = (f_string) "-x"; - parameters.array[1].string = (f_string) "-v"; - parameters.array[2].string = (f_string) "-t"; - parameters.array[3].string = (f_string) "mangle"; - parameters.array[4].string = (f_string) "--numeric"; - parameters.array[5].string = (f_string) "--list"; + parameters.array[0].string = (f_string_t) "-x"; + parameters.array[1].string = (f_string_t) "-v"; + parameters.array[2].string = (f_string_t) "-t"; + parameters.array[3].string = (f_string_t) "mangle"; + parameters.array[4].string = (f_string_t) "--numeric"; + parameters.array[5].string = (f_string_t) "--list"; parameters.array[0].used = 2; parameters.array[1].used = 2; @@ -237,7 +237,7 @@ extern "C" { parameters.array[4].used = 9; parameters.array[5].used = 6; - status = fll_execute_program((f_string) firewall_tool_iptables, parameters, &results); + status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, &results); fprintf(f_type_output, "\n"); fflush(f_type_output); @@ -251,17 +251,17 @@ extern "C" { parameters.used = 4; - parameters.array[0].string = (f_string) "-x"; - parameters.array[1].string = (f_string) "-v"; - parameters.array[2].string = (f_string) "--numeric"; - parameters.array[3].string = (f_string) "--list"; + parameters.array[0].string = (f_string_t) "-x"; + parameters.array[1].string = (f_string_t) "-v"; + parameters.array[2].string = (f_string_t) "--numeric"; + parameters.array[3].string = (f_string_t) "--list"; parameters.array[0].used = 2; parameters.array[1].used = 2; parameters.array[2].used = 9; parameters.array[3].used = 6; - status = fll_execute_program((f_string) firewall_tool_iptables, parameters, &results); + status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, &results); fprintf(f_type_output, "\n"); fflush(f_type_output); @@ -277,7 +277,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_tool_iptables); fprintf(f_type_error, " "); - f_string_length i = 0; + f_string_length_t i = 0; fl_color_print_code(f_type_error, data->context.error); @@ -308,14 +308,14 @@ extern "C" { parameters.array[5].used = 0; parameters.array[6].used = 0; - f_macro_string_dynamics_delete_simple( parameters); + f_macro_string_dynamics_t_delete_simple( parameters); firewall_delete_local_data(&local); firewall_delete_data(data); return status; } // load all network devices - status = f_directory_list((f_string) network_devices, 0, alphasort, &data->devices); + status = f_directory_list((f_string_t) network_devices, 0, alphasort, &data->devices); if (F_status_is_error(status)) { status = F_status_set_fine(status); @@ -337,11 +337,11 @@ extern "C" { // remove "lo" (loopback) from the device listing { - f_string_length i = 0; + f_string_length_t i = 0; for (; i < data->devices.used; i++) { - if (fl_string_compare((f_string) firewall_device_loop, data->devices.array[i].string, firewall_device_loop_length + 1, data->devices.array[i].used) == F_equal_to) { - f_string_dynamic swap_string = data->devices.array[i]; + if (fl_string_compare((f_string_t) firewall_device_loop, data->devices.array[i].string, firewall_device_loop_length + 1, data->devices.array[i].used) == F_equal_to) { + f_string_dynamic_t swap_string = data->devices.array[i]; data->devices.used--; @@ -364,17 +364,17 @@ extern "C" { } { - f_array_length i = 0; - f_string_length length = 0; + f_array_length_t i = 0; + f_string_length_t length = 0; for (; i < local.chain_objects.used; i++) { length = local.chain_objects.array[i].stop - local.chain_objects.array[i].start + 1; - if (!reserved.has_stop && fl_string_compare((f_string) firewall_group_stop, local.buffer.string + local.chain_objects.array[i].start, firewall_group_stop_length, length) == F_equal_to) { + if (!reserved.has_stop && fl_string_compare((f_string_t) firewall_group_stop, local.buffer.string + local.chain_objects.array[i].start, firewall_group_stop_length, length) == F_equal_to) { reserved.stop_at = i; reserved.has_stop = F_true; } - else if (!reserved.has_lock && fl_string_compare((f_string) firewall_group_lock, local.buffer.string + local.chain_objects.array[i].start, firewall_group_lock_length, length) == F_equal_to) { + else if (!reserved.has_lock && fl_string_compare((f_string_t) firewall_group_lock, local.buffer.string + local.chain_objects.array[i].start, firewall_group_lock_length, length) == F_equal_to) { reserved.lock_at = i; reserved.has_lock = F_true; } @@ -492,7 +492,7 @@ extern "C" { return status; } - f_array_length i = 0; + f_array_length_t i = 0; local.is_global = F_true; local.is_stop = F_false; @@ -522,9 +522,9 @@ extern "C" { local.device = i; { - f_string_dynamic file_path = f_string_dynamic_initialize; + f_string_dynamic_t file_path = f_string_dynamic_t_initialize; - f_macro_string_dynamic_resize(status, file_path, network_path_length + data->devices.array[i].used + firewall_file_suffix_length + 1); + f_macro_string_dynamic_t_resize(status, file_path, network_path_length + data->devices.array[i].used + firewall_file_suffix_length + 1); if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); @@ -542,7 +542,7 @@ extern "C" { status = firewall_buffer_rules(file_path.string, F_true, &local, data); - f_macro_string_dynamic_delete_simple(file_path); + f_macro_string_dynamic_t_delete_simple(file_path); } if (F_status_is_error(status)) { @@ -567,7 +567,7 @@ extern "C" { return status; } - f_array_length j = 0; + f_array_length_t j = 0; local.is_global = F_false; local.is_stop = F_false; @@ -603,7 +603,7 @@ extern "C" { status = firewall_create_custom_chains(&reserved, &local, data); if (F_status_is_error(status)) { - f_status status2 = F_none; + f_status_t status2 = F_none; firewall_macro_delete_fss_buffers(status2, local.buffer, local.chain_objects, local.chain_contents) firewall_delete_data(data); @@ -650,20 +650,20 @@ extern "C" { #endif // _di_firewall_main_ #ifndef _di_firewall_delete_data_ - f_return_status firewall_delete_data(firewall_data *data) { - f_string_length i = 0; + f_return_status firewall_delete_data(firewall_data_t *data) { + f_string_length_t i = 0; while (i < firewall_total_parameters) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); i++; } // while - f_macro_string_dynamics_delete_simple(data->chains); - f_macro_string_lengths_delete_simple(data->remaining); - f_macro_string_dynamics_delete_simple(data->devices); + f_macro_string_dynamics_t_delete_simple(data->chains); + f_macro_string_lengths_t_delete_simple(data->remaining); + f_macro_string_dynamics_t_delete_simple(data->devices); - fl_macro_color_context_delete_simple(data->context); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index 9043839..fb34535 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -240,63 +240,63 @@ extern "C" { }; #ifdef _en_firewall_debug_ - #define f_console_parameter_initialize_firewall \ + #define firewall_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(0, 0, firewall_command_start, F_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_stop, F_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_restart, F_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_lock, F_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_show, F_false, f_console_type_other), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(0, 0, firewall_command_start, F_false, f_console_type_other), \ + f_console_parameter_t_initialize(0, 0, firewall_command_stop, F_false, f_console_type_other), \ + f_console_parameter_t_initialize(0, 0, firewall_command_restart, F_false, f_console_type_other), \ + f_console_parameter_t_initialize(0, 0, firewall_command_lock, F_false, f_console_type_other), \ + f_console_parameter_t_initialize(0, 0, firewall_command_show, F_false, f_console_type_other), \ } #define firewall_total_parameters 11 #else - #define f_console_parameter_initialize_firewall \ + #define firewall_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(0, 0, firewall_command_start, F_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_stop, F_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_restart, F_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_lock, F_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_show, F_false, f_console_type_other), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(0, 0, firewall_command_start, F_false, f_console_type_other), \ + f_console_parameter_t_initialize(0, 0, firewall_command_stop, F_false, f_console_type_other), \ + f_console_parameter_t_initialize(0, 0, firewall_command_restart, F_false, f_console_type_other), \ + f_console_parameter_t_initialize(0, 0, firewall_command_lock, F_false, f_console_type_other), \ + f_console_parameter_t_initialize(0, 0, firewall_command_show, F_false, f_console_type_other), \ } #define firewall_total_parameters 10 #endif // _en_firewall_debug_ #endif // _di_firewall_defines_ -#ifndef _di_firewall_data_ +#ifndef _di_firewall_data_t_ typedef struct { - f_console_parameter parameters[firewall_total_parameters]; + f_console_parameter_t parameters[firewall_total_parameters]; - f_string_dynamics chains; - f_string_lengths remaining; + f_string_dynamics_t chains; + f_string_lengths_t remaining; bool process_pipe; - f_string_dynamics devices; + f_string_dynamics_t devices; - fl_color_context context; - } firewall_data; + fl_color_context_t context; + } firewall_data_t; - #define firewall_data_initialize \ + #define firewall_data_t_initialize \ { \ - f_console_parameter_initialize_firewall, \ - f_string_dynamics_initialize, \ - f_string_lengths_initialize, \ + firewall_console_parameter_t_initialize, \ + f_string_dynamics_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ - f_string_dynamics_initialize, \ - fl_color_context_initialize, \ + f_string_dynamics_t_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_firewall_data_ +#endif // _di_firewall_data_t_ /** * Print help to standard output. @@ -308,7 +308,7 @@ extern "C" { * F_none on success. */ #ifndef _di_firewall_print_help_ - extern f_return_status firewall_print_help(const fl_color_context context); + extern f_return_status firewall_print_help(const fl_color_context_t context); #endif // _di_firewall_print_help_ /** @@ -329,7 +329,7 @@ extern "C" { * @see firewall_delete_data() */ #ifndef _di_firewall_main_ - extern f_return_status firewall_main(const f_console_arguments arguments, firewall_data *data); + extern f_return_status firewall_main(const f_console_arguments_t arguments, firewall_data_t *data); #endif // _di_firewall_main_ /** @@ -348,7 +348,7 @@ extern "C" { * @see firewall_main() */ #ifndef _di_firewall_delete_data_ - extern f_return_status firewall_delete_data(firewall_data *data); + extern f_return_status firewall_delete_data(firewall_data_t *data); #endif // _di_firewall_delete_data_ #ifdef __cplusplus diff --git a/level_3/firewall/c/main.c b/level_3/firewall/c/main.c index ac92cb6..ff0f484 100644 --- a/level_3/firewall/c/main.c +++ b/level_3/firewall/c/main.c @@ -1,14 +1,14 @@ #include "firewall.h" -int main(const int argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - firewall_data data = firewall_data_initialize; +int main(const int argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + firewall_data_t data = firewall_data_t_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = firewall_main(arguments, &data); + f_status_t status = firewall_main(arguments, &data); if (F_status_is_error(status)) { return 1; diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 7a78495..a5059f3 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -5,18 +5,18 @@ extern "C" { #endif -f_return_status firewall_perform_commands(const firewall_local_data local, const firewall_data data) { - f_status status = F_none; +f_return_status firewall_perform_commands(const firewall_local_data_t local, const firewall_data_t data) { + f_status_t status = F_none; - f_string_length i = 0; - f_string_dynamics arguments = f_string_dynamics_initialize; - f_string_dynamic argument = f_string_dynamic_initialize; + f_string_length_t i = 0; + f_string_dynamics_t arguments = f_string_dynamics_t_initialize; + f_string_dynamic_t argument = f_string_dynamic_t_initialize; int results = 0; - f_string_length length = 0; + f_string_length_t length = 0; bool invalid = F_false; bool is_ip_list = F_false; - f_string_dynamic ip_list = f_string_dynamic_initialize; + f_string_dynamic_t ip_list = f_string_dynamic_t_initialize; // iptables command arguments bool device_all = F_false; @@ -25,26 +25,26 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const uint8_t tool = firewall_program_ip46tables; uint8_t chain = firewall_chain_none_id; - f_array_length repeat = 2; - f_array_length r = 0; + f_array_length_t repeat = 2; + f_array_length_t r = 0; - f_string current_tool = firewall_tool_iptables; - f_string_length current_tool_length = firewall_tool_iptables_length; + f_string_t current_tool = firewall_tool_iptables; + f_string_length_t current_tool_length = firewall_tool_iptables_length; - f_string_length direction = firewall_direction_none_id; - f_string_dynamic device = f_string_dynamic_initialize; - f_string_length action = firewall_action_append_id; - f_string_dynamic protocol = f_string_dynamic_initialize; + f_string_length_t direction = firewall_direction_none_id; + f_string_dynamic_t device = f_string_dynamic_t_initialize; + f_string_length_t action = firewall_action_append_id; + f_string_dynamic_t protocol = f_string_dynamic_t_initialize; if (local.is_global) { device_all = F_true; } else { if (data.devices.array[local.device].used > 0) { - f_macro_string_dynamic_new(status, device, data.devices.array[local.device].used); + f_macro_string_dynamic_t_new(status, device, data.devices.array[local.device].used); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(device); + f_macro_string_dynamic_t_delete_simple(device); return status; } @@ -66,10 +66,10 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const is_ip_list = F_false; ip_list_direction = F_false; - f_macro_string_dynamic_delete_simple(ip_list); + f_macro_string_dynamic_t_delete_simple(ip_list); // process chain rule - if (length >= firewall_chain_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_chain, length, firewall_chain_length) == F_equal_to) { + 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) { if (chain == firewall_chain_custom_id) { // custom chains can only apply to themselves, so silently ignore chain commands specified within a custom chain. fprintf(f_type_warning, "WARNING: At line %i, the chain option is meaningle ss inside of a custom chain.", i); @@ -81,22 +81,22 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { invalid = F_true; } - else if (length >= firewall_chain_input_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_input, length, firewall_chain_input_length) == F_equal_to) { + else if (length >= firewall_chain_input_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_chain_input, length, firewall_chain_input_length) == F_equal_to) { chain = firewall_chain_input_id; } - else if (length >= firewall_chain_output_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_output, length, firewall_chain_output_length) == F_equal_to) { + else if (length >= firewall_chain_output_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_chain_output, length, firewall_chain_output_length) == F_equal_to) { chain = firewall_chain_output_id; } - else if (length >= firewall_chain_forward_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_forward, length, firewall_chain_forward_length) == F_equal_to) { + else if (length >= firewall_chain_forward_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_chain_forward, length, firewall_chain_forward_length) == F_equal_to) { chain = firewall_chain_forward_id; } - else if (length >= firewall_chain_postrouting_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_postrouting, length, firewall_chain_postrouting_length) == F_equal_to) { + else if (length >= firewall_chain_postrouting_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_chain_postrouting, length, firewall_chain_postrouting_length) == F_equal_to) { chain = firewall_chain_postrouting_id; } - else if (length >= firewall_chain_prerouting_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_prerouting, length, firewall_chain_prerouting_length) == F_equal_to) { + else if (length >= firewall_chain_prerouting_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_chain_prerouting, length, firewall_chain_prerouting_length) == F_equal_to) { chain = firewall_chain_prerouting_id; } - else if (length >= firewall_chain_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_none, length, firewall_chain_none_length) == F_equal_to) { + else if (length >= firewall_chain_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_chain_none, length, firewall_chain_none_length) == F_equal_to) { chain = firewall_chain_none_id; } else { @@ -106,19 +106,19 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (!invalid) continue; } // process direction rule - else if (length >= firewall_direction_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_direction, length, firewall_direction_length) == F_equal_to) { + else if (length >= firewall_direction_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_direction, length, firewall_direction_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { invalid = F_true; } - else if (length >= firewall_direction_input_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_direction_input, length, firewall_direction_input_length) == F_equal_to) { + else if (length >= firewall_direction_input_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_direction_input, length, firewall_direction_input_length) == F_equal_to) { direction = firewall_direction_input_id; } - else if (length >= firewall_direction_output_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_direction_output, length, firewall_direction_output_length) == F_equal_to) { + else if (length >= firewall_direction_output_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_direction_output, length, firewall_direction_output_length) == F_equal_to) { direction = firewall_direction_output_id; } - else if (length >= firewall_direction_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_direction_none, length, firewall_direction_none_length) == F_equal_to) { + else if (length >= firewall_direction_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_direction_none, length, firewall_direction_none_length) == F_equal_to) { direction = firewall_direction_none_id; } else { @@ -129,21 +129,21 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (!invalid) continue; } // process device rule. - else if (length >= firewall_device_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_device, length, firewall_device_length) == F_equal_to) { + else if (length >= firewall_device_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_device, length, firewall_device_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { 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) firewall_device_all, length, firewall_device_all_length) == F_equal_to) { - f_macro_string_dynamic_delete_simple(device); + else if (length >= firewall_device_all_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_device_all, length, firewall_device_all_length) == F_equal_to) { + f_macro_string_dynamic_t_delete_simple(device); device_all = F_true; continue; } - else if (length >= firewall_device_this_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_device_this, length, firewall_device_this_length) == F_equal_to) { + else if (length >= firewall_device_this_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_device_this, length, firewall_device_this_length) == F_equal_to) { if (data.devices.array[local.device].used > 0) { if (data.devices.array[local.device].used > device.size) { - f_macro_string_dynamic_resize(status, device, data.devices.array[local.device].used); + f_macro_string_dynamic_t_resize(status, device, data.devices.array[local.device].used); if (F_status_is_error(status)) break; } @@ -153,7 +153,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const device.used = data.devices.array[local.device].used; } else { - f_macro_string_dynamic_delete_simple(device); + f_macro_string_dynamic_t_delete_simple(device); } device_all = F_false; @@ -163,7 +163,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (!invalid) { if (length > 0) { if (length > device.size) { - f_macro_string_dynamic_resize(status, device, length); + f_macro_string_dynamic_t_resize(status, device, length); if (F_status_is_error(status)) break; } @@ -172,7 +172,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const device.used = length; } else { - f_macro_string_dynamic_delete_simple(device); + f_macro_string_dynamic_t_delete_simple(device); } device_all = F_false; @@ -180,22 +180,22 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const } } // process action rule. - else if (length >= firewall_action_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_action, length, firewall_action_length) == F_equal_to) { + else if (length >= firewall_action_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_action, length, firewall_action_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { invalid = F_true; } - else if (length >= firewall_action_append_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_append, length, firewall_action_append_length) == F_equal_to) { + else if (length >= firewall_action_append_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_action_append, length, firewall_action_append_length) == F_equal_to) { action = firewall_action_append_id; } - else if (length >= firewall_action_insert_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_insert, length, firewall_action_insert_length) == F_equal_to) { + else if (length >= firewall_action_insert_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_action_insert, length, firewall_action_insert_length) == F_equal_to) { action = firewall_action_insert_id; } - else if (length >= firewall_action_policy_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_policy, length, firewall_action_policy_length) == F_equal_to) { + else if (length >= firewall_action_policy_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_action_policy, length, firewall_action_policy_length) == F_equal_to) { action = firewall_action_policy_id; } - else if (length >= firewall_action_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_none, length, firewall_action_none_length) == F_equal_to) { + else if (length >= firewall_action_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_action_none, length, firewall_action_none_length) == F_equal_to) { action = firewall_action_none_id; } else { @@ -205,33 +205,33 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (!invalid) continue; } // process ip_list rule. - else if (length >= firewall_ip_list_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_ip_list, length, firewall_ip_list_length) == F_equal_to) { + else if (length >= firewall_ip_list_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_ip_list, length, firewall_ip_list_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); is_ip_list = F_true; - if (length >= firewall_ip_list_source_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_ip_list_source, length, firewall_ip_list_source_length) == F_equal_to) { + if (length >= firewall_ip_list_source_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_ip_list_source, length, firewall_ip_list_source_length) == F_equal_to) { ip_list_direction = F_false; } - else if (length >= firewall_ip_list_destination_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_ip_list_destination, length, firewall_ip_list_destination_length) == F_equal_to) { + else if (length >= firewall_ip_list_destination_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_ip_list_destination, length, firewall_ip_list_destination_length) == F_equal_to) { ip_list_direction = F_true; } else { invalid = F_true; } } - else if (length >= firewall_protocol_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_protocol, length, firewall_protocol_length) == F_equal_to) { + else if (length >= firewall_protocol_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_protocol, length, firewall_protocol_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { invalid = F_true; } else { - if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_protocol_none, length, firewall_protocol_none_length) == F_equal_to) { + if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_protocol_none, length, firewall_protocol_none_length) == F_equal_to) { use_protocol = F_false; } else if (length > 0) { - f_macro_string_dynamic_delete_simple(protocol); - f_macro_string_dynamic_new(status, protocol, length); + f_macro_string_dynamic_t_delete_simple(protocol); + f_macro_string_dynamic_t_new(status, protocol, length); if (F_status_is_error(status)) break; @@ -247,26 +247,26 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const } } // process tool rule. - else if (length >= firewall_tool_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_tool, length, firewall_tool_length) == F_equal_to) { + else if (length >= firewall_tool_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_tool, length, firewall_tool_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { invalid = F_true; } else { - if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_tool_iptables, length, firewall_tool_iptables_length) == F_equal_to) { + if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_tool_iptables, length, firewall_tool_iptables_length) == F_equal_to) { tool = firewall_program_iptables; current_tool = firewall_tool_iptables; current_tool_length = firewall_tool_iptables_length; repeat = 1; } - else if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_tool_ip6tables, length, firewall_tool_ip6tables_length) == F_equal_to) { + else if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_tool_ip6tables, length, firewall_tool_ip6tables_length) == F_equal_to) { tool = firewall_program_ip6tables; current_tool = firewall_tool_ip6tables; current_tool_length = firewall_tool_ip6tables_length; repeat = 1; } - else if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_tool_ip46tables, length, firewall_tool_ip46tables_length) == F_equal_to) { + else if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_tool_ip46tables, length, firewall_tool_ip46tables_length) == F_equal_to) { tool = firewall_program_ip46tables; current_tool = firewall_tool_iptables; current_tool_length = firewall_tool_iptables_length; @@ -280,7 +280,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const } } // process rule rule, if the remaining rule does not match as firewall_rule, then it is an invalid rule. - else if (length < firewall_rule_length || fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_rule, length, firewall_rule_length) == F_equal_to_not) { + else if (length < firewall_rule_length || fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_rule, length, firewall_rule_length) == F_equal_to_not) { if (length > 0) { fl_color_print_code(f_type_warning, data.context.warning); fprintf(f_type_warning, "WARNING: At line %i, the object '", i); @@ -318,7 +318,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const for (r = repeat; r > 0; r--) { // first add the program name - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); f_macro_string_dynamics_new(status, arguments, firewall_default_allocation_step); if (F_status_is_error(status)) break; @@ -334,14 +334,14 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const } } - f_macro_string_dynamic_delete_simple(argument); + f_macro_string_dynamic_t_delete_simple(argument); if (F_status_is_error(status)) break; // process the action when a non-none chain is specified. if (chain != firewall_chain_none_id && action != firewall_action_none_id) { if (action == firewall_action_append_id) { - f_macro_string_dynamic_new(status, argument, firewall_action_append_command_length); + f_macro_string_dynamic_t_new(status, argument, firewall_action_append_command_length); if (F_status_is_error(status)) break; @@ -349,7 +349,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const argument.used = firewall_action_append_command_length; } else if (action == firewall_action_insert_id) { - f_macro_string_dynamic_new(status, argument, firewall_action_insert_command_length); + f_macro_string_dynamic_t_new(status, argument, firewall_action_insert_command_length); if (F_status_is_error(status)) break; @@ -357,7 +357,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const argument.used = firewall_action_insert_command_length; } else if (action == firewall_action_policy_id) { - f_macro_string_dynamic_new(status, argument, firewall_action_policy_command_length); + f_macro_string_dynamic_t_new(status, argument, firewall_action_policy_command_length); if (F_status_is_error(status)) break; @@ -368,14 +368,14 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (argument.used > 0) { firewall_macro_append_argument_to_arguments(status, arguments, argument) if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(argument); + f_macro_string_dynamic_t_delete_simple(argument); break; } // process the chain, which is required by the action. if (chain == firewall_chain_custom_id) { if (data.chains.array[local.chain_ids.array[local.chain]].used > 0) { - f_macro_string_dynamic_new(status, argument, data.chains.array[local.chain_ids.array[local.chain]].used); + f_macro_string_dynamic_t_new(status, argument, data.chains.array[local.chain_ids.array[local.chain]].used); if (F_status_is_error(status)) break; @@ -384,7 +384,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const } } else if (chain == firewall_chain_forward_id) { - f_macro_string_dynamic_new(status, argument, firewall_chain_forward_length); + f_macro_string_dynamic_t_new(status, argument, firewall_chain_forward_length); if (F_status_is_error(status)) break; @@ -392,7 +392,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const argument.used = firewall_chain_forward_length; } else if (chain == firewall_chain_postrouting_id) { - f_macro_string_dynamic_new(status, argument, firewall_chain_postrouting_length); + f_macro_string_dynamic_t_new(status, argument, firewall_chain_postrouting_length); if (F_status_is_error(status)) break; @@ -400,7 +400,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const argument.used += firewall_chain_postrouting_length; } else if (chain == firewall_chain_prerouting_id) { - f_macro_string_dynamic_new(status, argument, firewall_chain_prerouting_length); + f_macro_string_dynamic_t_new(status, argument, firewall_chain_prerouting_length); if (F_status_is_error(status)) break; @@ -408,7 +408,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const argument.used = firewall_chain_prerouting_length; } else if (chain == firewall_chain_input_id) { - f_macro_string_dynamic_new(status, argument, firewall_chain_input_length); + f_macro_string_dynamic_t_new(status, argument, firewall_chain_input_length); if (F_status_is_error(status)) break; @@ -416,7 +416,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const argument.used = firewall_chain_input_length; } else if (chain == firewall_chain_output_id) { - f_macro_string_dynamic_new(status, argument, firewall_chain_output_length); + f_macro_string_dynamic_t_new(status, argument, firewall_chain_output_length); if (F_status_is_error(status)) break; @@ -435,16 +435,16 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const // add the device if and only if a non-none direction is specified. if (device.used > 0 && (direction == firewall_direction_input_id || direction == firewall_direction_output_id)) { - if (length < firewall_device_all_length || fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_device_all, length, firewall_device_all_length) == F_equal_to_not) { + if (length < firewall_device_all_length || fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_device_all, length, firewall_device_all_length) == F_equal_to_not) { if (direction == firewall_direction_input_id) { - f_macro_string_dynamic_new(status, argument, firewall_device_input_command_length); + f_macro_string_dynamic_t_new(status, argument, firewall_device_input_command_length); if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_device_input_command, firewall_device_input_command_length); argument.used = firewall_device_input_command_length; } else if (direction == firewall_direction_output_id) { - f_macro_string_dynamic_new(status, argument, firewall_device_output_command_length); + f_macro_string_dynamic_t_new(status, argument, firewall_device_output_command_length); if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_device_output_command, firewall_device_output_command_length); @@ -461,7 +461,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const // add the device. if (device.used > 0) { - f_macro_string_dynamic_new(status, argument, device.used); + f_macro_string_dynamic_t_new(status, argument, device.used); if (F_status_is_error(status)) break; @@ -476,7 +476,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const } if (use_protocol) { - f_macro_string_dynamic_new(status, argument, firewall_protocol_command_length); + f_macro_string_dynamic_t_new(status, argument, firewall_protocol_command_length); if (F_status_is_error(status)) break; @@ -489,7 +489,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const } if (protocol.used > 0) { - f_macro_string_dynamic_new(status, argument, protocol.used); + f_macro_string_dynamic_t_new(status, argument, protocol.used); if (F_status_is_error(status)) break; @@ -505,7 +505,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const // last up is the "rule" if ((!is_ip_list && local.rule_contents.array[i].used > 0) || (is_ip_list && local.rule_contents.array[i].used > 1)) { - f_string_length subcounter = 0; + f_string_length_t subcounter = 0; if (is_ip_list) { // skip past the chain @@ -514,7 +514,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const length = firewall_macro_structure_size(local.rule_contents.array[i], subcounter); if (length > 0) { - f_macro_string_dynamic_new(status, ip_list, length); + f_macro_string_dynamic_t_new(status, ip_list, length); if (F_status_is_error(status)) { // prevent the loop below from being processed. @@ -533,7 +533,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const length = firewall_macro_structure_size(local.rule_contents.array[i], subcounter); if (length > 0) { - f_macro_string_dynamic_new(status, argument, length); + f_macro_string_dynamic_t_new(status, argument, length); if (F_status_is_error(status)) break; @@ -563,14 +563,14 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const // now execute the generated commands. if (arguments.used > 1) { if (is_ip_list) { - f_file file = f_file_initialize; - f_string_dynamic file_path = f_string_dynamic_initialize; - f_string_dynamic local_buffer = f_string_dynamic_initialize; + f_file_t file = f_file_t_initialize; + f_string_dynamic_t file_path = f_string_dynamic_t_initialize; + f_string_dynamic_t local_buffer = f_string_dynamic_t_initialize; - f_fss_objects basic_objects = f_fss_objects_initialize; - f_fss_contents basic_contents = f_fss_objects_initialize; + f_fss_objects_t basic_objects = f_fss_objects_t_initialize; + f_fss_contents_t basic_contents = f_fss_objects_t_initialize; - f_macro_string_dynamic_new(status, file_path, network_path_length + ip_list.used + firewall_default_allocation_step); + f_macro_string_dynamic_t_new(status, file_path, network_path_length + ip_list.used + firewall_default_allocation_step); if (status == F_none) { firewall_macro_concat_string(file_path.string, network_path, network_path_length); @@ -645,7 +645,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const } else { { - f_string_range input = f_string_range_initialize; + f_string_range_t input = f_string_range_initialize; input.stop = local_buffer.used - 1; @@ -671,12 +671,12 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const status = F_status_set_error(status); } else { - f_string_length buffer_counter = 0; - f_string_length ip_length = 0; - f_string_dynamic ip_list_action = f_string_dynamic_initialize; + f_string_length_t buffer_counter = 0; + f_string_length_t ip_length = 0; + f_string_dynamic_t ip_list_action = f_string_dynamic_t_initialize; if (ip_list_direction) { - f_macro_string_dynamic_resize(status, ip_list_action, firewall_ip_list_destination_action_length); + f_macro_string_dynamic_t_resize(status, ip_list_action, firewall_ip_list_destination_action_length); if (F_status_is_error(status)) break; @@ -684,7 +684,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const ip_list_action.used = firewall_ip_list_destination_action_length; } else { - f_macro_string_dynamic_resize(status, ip_list_action, firewall_ip_list_source_action_length); + f_macro_string_dynamic_t_resize(status, ip_list_action, firewall_ip_list_source_action_length); if (F_status_is_error(status)) break; @@ -700,14 +700,14 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); - f_macro_string_dynamic_delete_simple(ip_list_action); + f_macro_string_dynamic_t_delete_simple(ip_list_action); } else { - f_string_dynamic ip_argument = f_string_dynamic_initialize; + f_string_dynamic_t ip_argument = f_string_dynamic_t_initialize; firewall_macro_append_argument_to_arguments(status, arguments, ip_list_action) if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(ip_argument); + f_macro_string_dynamic_t_delete_simple(ip_argument); break; } @@ -715,7 +715,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const for (; buffer_counter < basic_objects.used; buffer_counter++) { ip_length = firewall_macro_structure_size(basic_objects, buffer_counter); - f_macro_string_dynamic_new(status, ip_argument, ip_length); + f_macro_string_dynamic_t_new(status, ip_argument, ip_length); if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); @@ -734,7 +734,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const fl_color_print_code(f_type_debug, data.context.warning); fprintf(f_type_debug, "%s ", current_tool); - for (f_string_length i = 0; i < arguments.used; i++) { + for (f_string_length_t i = 0; i < arguments.used; i++) { fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -743,7 +743,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const } #endif // _en_firewall_debug_ - status = fll_execute_program((f_string) current_tool, arguments, &results); + status = fll_execute_program((f_string_t) current_tool, arguments, &results); if (status == F_failure) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", current_tool); @@ -752,7 +752,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const fl_color_print_code(f_type_error, data.context.error); fprintf(f_type_error, "%s ", current_tool); - for (f_string_length i = 0; i < arguments.used; i++) { + for (f_string_length_t i = 0; i < arguments.used; i++) { fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -760,7 +760,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const fprintf(f_type_error, "\n"); // remove ip_argument from arguments string. - f_macro_string_dynamic_delete_simple(arguments.array[arguments.used]); + f_macro_string_dynamic_t_delete_simple(arguments.array[arguments.used]); arguments.used--; break; @@ -769,31 +769,31 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); // remove ip_argument from arguments string. - f_macro_string_dynamic_delete_simple(arguments.array[arguments.used]); + f_macro_string_dynamic_t_delete_simple(arguments.array[arguments.used]); arguments.used--; break; } // remove ip_argument from arguments string. - f_macro_string_dynamic_delete_simple(arguments.array[arguments.used]); + f_macro_string_dynamic_t_delete_simple(arguments.array[arguments.used]); arguments.used--; } // for - f_macro_string_dynamic_delete_simple(ip_argument); + f_macro_string_dynamic_t_delete_simple(ip_argument); // remove ip_list_action from arguments string. - f_macro_string_dynamic_delete_simple(arguments.array[arguments.used]); + f_macro_string_dynamic_t_delete_simple(arguments.array[arguments.used]); arguments.used--; } } } } - f_macro_string_dynamic_delete_simple(local_buffer); - f_macro_string_dynamic_delete_simple(file_path); - f_macro_fss_objects_delete_simple(basic_objects); - f_macro_fss_contents_delete_simple(basic_contents); + f_macro_string_dynamic_t_delete_simple(local_buffer); + f_macro_string_dynamic_t_delete_simple(file_path); + f_macro_fss_objects_t_delete_simple(basic_objects); + f_macro_fss_contents_t_delete_simple(basic_contents); if (status == F_failure || status == F_parameter) break; } @@ -804,7 +804,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const fl_color_print_code(f_type_debug, data.context.warning); fprintf(f_type_debug, "%s ", current_tool); - for (f_string_length i = 0; i < arguments.used; i++) { + for (f_string_length_t i = 0; i < arguments.used; i++) { fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -821,7 +821,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const fl_color_print_code(f_type_error, data.context.error); fprintf(f_type_error, "%s ", current_tool); - for (f_string_length i = 0; i < arguments.used; i++) { + for (f_string_length_t i = 0; i < arguments.used; i++) { fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -839,34 +839,34 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const } // for } // for - f_macro_string_dynamic_delete_simple(ip_list); - f_macro_string_dynamic_delete_simple(argument); - f_macro_string_dynamics_delete_simple(arguments); - f_macro_string_dynamic_delete_simple(device); - f_macro_string_dynamic_delete_simple(protocol); + f_macro_string_dynamic_t_delete_simple(ip_list); + f_macro_string_dynamic_t_delete_simple(argument); + f_macro_string_dynamics_t_delete_simple(arguments); + f_macro_string_dynamic_t_delete_simple(device); + f_macro_string_dynamic_t_delete_simple(protocol); return status; } -f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved, firewall_local_data *local, firewall_data *data) { - f_status status = F_none; +f_return_status firewall_create_custom_chains(firewall_reserved_chains_t *reserved, firewall_local_data_t *local, firewall_data_t *data) { + f_status_t status = F_none; uint8_t tool = firewall_program_iptables; bool new_chain = F_false; bool create_chain = F_false; int results = 0; - f_array_length i = 0; - f_array_length j = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; - f_string_length length = 0; - f_string_range range = f_string_range_initialize; - f_string_dynamics arguments = f_string_dynamics_initialize; + f_string_length_t length = 0; + f_string_range_t range = f_string_range_initialize; + f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - f_string_dynamic fixed_string = f_string_dynamic_initialize; + f_string_dynamic_t fixed_string = f_string_dynamic_t_initialize; - f_macro_array_lengths_delete_simple(local->chain_ids); - f_macro_array_lengths_new(status, local->chain_ids, local->chain_objects.used); + f_macro_array_lengths_t_delete_simple(local->chain_ids); + f_macro_array_lengths_t_new(status, local->chain_ids, local->chain_objects.used); if (F_status_is_error(status)) { return status; @@ -878,10 +878,10 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved return status; } - f_macro_string_dynamic_new(status, arguments.array[0], firewall_chain_create_command_length); + f_macro_string_dynamic_t_new(status, arguments.array[0], firewall_chain_create_command_length); if (F_status_is_error(status)) { - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } @@ -890,11 +890,11 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved arguments.array[0].used = firewall_chain_create_command_length; - f_macro_string_dynamic_new(status, arguments.array[1], firewall_default_allocation_step); + f_macro_string_dynamic_t_new(status, arguments.array[1], firewall_default_allocation_step); if (F_status_is_error(status)) { arguments.used = 1; - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } @@ -951,7 +951,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved new_chain = F_false; } - f_macro_string_dynamic_clear(fixed_string); + f_macro_string_dynamic_t_clear(fixed_string); if (new_chain) { while (j < data->chains.used) { @@ -974,7 +974,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved f_macro_string_dynamics_resize(status, data->chains, data->chains.used + firewall_default_allocation_step); if (F_status_is_error(status)) { - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } @@ -985,19 +985,19 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved arguments.array[1].used = 0; if (length > arguments.array[1].size) { - f_macro_string_dynamic_resize(status, arguments.array[1], length); + f_macro_string_dynamic_t_resize(status, arguments.array[1], length); if (F_status_is_error(status)) { - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } } - f_macro_string_dynamic_new(status, data->chains.array[data->chains.used], length); + f_macro_string_dynamic_t_new(status, data->chains.array[data->chains.used], length); if (F_status_is_error(status)) { - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } @@ -1044,7 +1044,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved fl_color_print_code(f_type_debug, data->context.warning); fprintf(f_type_debug, "%s ", firewall_tool_iptables); - for (f_string_length i = 0; i < arguments.used; i++) { + for (f_string_length_t i = 0; i < arguments.used; i++) { fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -1054,7 +1054,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved #endif // _en_firewall_debug_ tool = firewall_program_iptables; - status = fll_execute_program((f_string) firewall_tool_iptables, arguments, &results); + status = fll_execute_program((f_string_t) firewall_tool_iptables, arguments, &results); if (F_status_is_not_error(status)) { // print command when debugging. @@ -1063,7 +1063,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved fl_color_print_code(f_type_debug, data->context.warning); fprintf(f_type_debug, "%s ", firewall_tool_ip6tables); - for (f_string_length i = 0; i < arguments.used; i++) { + for (f_string_length_t i = 0; i < arguments.used; i++) { fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -1073,7 +1073,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved #endif // _en_firewall_debug_ tool = firewall_program_ip6tables; - status = fll_execute_program((f_string) firewall_tool_ip6tables, arguments, &results); + status = fll_execute_program((f_string_t) firewall_tool_ip6tables, arguments, &results); } if (F_status_is_error(status)) { @@ -1097,7 +1097,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved fprintf(f_type_error, "%s ", firewall_tool_ip6tables); } - for (f_string_length i = 0; i < arguments.used; i++) { + for (f_string_length_t i = 0; i < arguments.used; i++) { fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -1111,7 +1111,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status); } - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } } @@ -1122,21 +1122,21 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved i++; } // while - f_macro_string_dynamics_delete_simple(arguments); + f_macro_string_dynamics_t_delete_simple(arguments); return status; } -f_return_status firewall_delete_chains(const firewall_data data) { - const f_string tools[2] = { firewall_tool_iptables, firewall_tool_ip6tables }; - f_status status = F_none; +f_return_status firewall_delete_chains(const firewall_data_t data) { + const f_string_t tools[2] = { firewall_tool_iptables, firewall_tool_ip6tables }; + f_status_t status = F_none; - for (f_string_length i = 0; i < 2; i++) { - f_string_dynamics arguments = f_string_dynamics_initialize; - f_string_dynamic argument[1] = f_string_dynamic_initialize; + for (f_string_length_t i = 0; i < 2; i++) { + f_string_dynamics_t arguments = f_string_dynamics_t_initialize; + f_string_dynamic_t argument[1] = f_string_dynamic_t_initialize; int results = 0; - argument[0].string = (f_string) "-F"; + argument[0].string = (f_string_t) "-F"; argument[0].size = 2; argument[0].used = 2; @@ -1150,7 +1150,7 @@ f_return_status firewall_delete_chains(const firewall_data data) { fl_color_print_code(f_type_debug, data.context.warning); fprintf(f_type_debug, "%s ", tools[i]); - for (f_string_length i = 0; i < arguments.used; i++) { + for (f_string_length_t i = 0; i < arguments.used; i++) { fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -1171,7 +1171,7 @@ f_return_status firewall_delete_chains(const firewall_data data) { fl_color_print_code(f_type_error, data.context.error); fprintf(f_type_error, "%s ", tools[i]); - for (f_string_length i = 0; i < arguments.used; i++) { + for (f_string_length_t i = 0; i < arguments.used; i++) { fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -1189,12 +1189,12 @@ f_return_status firewall_delete_chains(const firewall_data data) { } } // for - for (f_string_length i = 0; i < 2; i++) { - f_string_dynamics arguments = f_string_dynamics_initialize; - f_string_dynamic argument[1] = f_string_dynamic_initialize; + for (f_string_length_t i = 0; i < 2; i++) { + f_string_dynamics_t arguments = f_string_dynamics_t_initialize; + f_string_dynamic_t argument[1] = f_string_dynamic_t_initialize; int results = 0; - argument[0].string = (f_string) firewall_chain_delete_command; + argument[0].string = (f_string_t) firewall_chain_delete_command; argument[0].size = firewall_chain_delete_command_length; argument[0].used = firewall_chain_delete_command_length; @@ -1208,7 +1208,7 @@ f_return_status firewall_delete_chains(const firewall_data data) { fl_color_print_code(f_type_debug, data.context.warning); fprintf(f_type_debug, "%s ", tools[i]); - for (f_string_length j = 0; j < arguments.used; j++) { + for (f_string_length_t j = 0; j < arguments.used; j++) { fprintf(f_type_debug, "%.*s ", arguments.array[j].used, arguments.array[j].string); } // for @@ -1229,7 +1229,7 @@ f_return_status firewall_delete_chains(const firewall_data data) { fl_color_print_code(f_type_error, data.context.error); fprintf(f_type_error, "%s ", tools[i]); - for (f_string_length j = 0; j < arguments.used; j++) { + for (f_string_length_t j = 0; j < arguments.used; j++) { fprintf(f_type_error, "%.*s ", arguments.array[j].used, arguments.array[j].string); } // for @@ -1250,25 +1250,25 @@ f_return_status firewall_delete_chains(const firewall_data data) { return status; } -f_return_status firewall_default_lock(const firewall_data data) { - const f_string chains[3] = { firewall_chain_input, firewall_chain_output, firewall_chain_forward }; - const f_string tools[2] = { firewall_tool_iptables, firewall_tool_ip6tables }; +f_return_status firewall_default_lock(const firewall_data_t data) { + const f_string_t chains[3] = { firewall_chain_input, firewall_chain_output, firewall_chain_forward }; + const f_string_t tools[2] = { firewall_tool_iptables, firewall_tool_ip6tables }; - const f_string_length lengths[3] = { firewall_chain_input_length, firewall_chain_output_length, firewall_chain_forward_length }; + const f_string_length_t lengths[3] = { firewall_chain_input_length, firewall_chain_output_length, firewall_chain_forward_length }; - f_status status = F_none; + f_status_t status = F_none; - for (f_string_length i = 0; i < 3; i++) { - f_string_dynamics arguments = f_string_dynamics_initialize; - f_string_dynamic argument[3]; + for (f_string_length_t i = 0; i < 3; i++) { + f_string_dynamics_t arguments = f_string_dynamics_t_initialize; + f_string_dynamic_t argument[3]; arguments.array = argument; arguments.used = 3; arguments.size = arguments.used; - arguments.array[0].string = (f_string) firewall_action_policy_command; - arguments.array[1].string = (f_string) chains[i]; - arguments.array[2].string = (f_string) "DROP"; + arguments.array[0].string = (f_string_t) firewall_action_policy_command; + arguments.array[1].string = (f_string_t) chains[i]; + arguments.array[2].string = (f_string_t) "DROP"; arguments.array[0].used = firewall_action_append_command_length; arguments.array[1].used = lengths[i]; @@ -1278,7 +1278,7 @@ f_return_status firewall_default_lock(const firewall_data data) { arguments.array[1].size = arguments.array[1].used; arguments.array[2].size = arguments.array[2].used; - for (f_string_length j = 0; j < 2; j++) { + for (f_string_length_t j = 0; j < 2; j++) { int results = 0; // print command when debugging. @@ -1287,7 +1287,7 @@ f_return_status firewall_default_lock(const firewall_data data) { fl_color_print_code(f_type_debug, data.context.warning); fprintf(f_type_debug, "%s ", tools[j]); - for (f_string_length k = 0; k < arguments.used; k++) { + for (f_string_length_t k = 0; k < arguments.used; k++) { fprintf(f_type_debug, "%.*s ", arguments.array[k].used, arguments.array[k].string); } // for @@ -1308,7 +1308,7 @@ f_return_status firewall_default_lock(const firewall_data data) { fl_color_print_code(f_type_error, data.context.error); fprintf(f_type_error, "%s ", tools[j]); - for (f_string_length k = 0; k < arguments.used; k++) { + for (f_string_length_t k = 0; k < arguments.used; k++) { fprintf(f_type_error, "%.*s ", arguments.array[k].used, arguments.array[k].string); } // for @@ -1330,9 +1330,9 @@ f_return_status firewall_default_lock(const firewall_data data) { return status; } -f_return_status firewall_buffer_rules(const f_string filename, const bool optional, firewall_local_data *local, firewall_data *data) { - f_file file = f_file_initialize; - f_status status = F_none; +f_return_status firewall_buffer_rules(const f_string_t filename, const bool optional, firewall_local_data_t *local, firewall_data_t *data) { + f_file_t file = f_file_t_initialize; + f_status_t status = F_none; status = f_file_open(filename, 0, &file); @@ -1399,7 +1399,7 @@ f_return_status firewall_buffer_rules(const f_string filename, const bool option return status; } else { - f_string_range input = f_string_range_initialize; + f_string_range_t input = f_string_range_initialize; input.stop = local->buffer.used - 1; @@ -1428,8 +1428,8 @@ f_return_status firewall_buffer_rules(const f_string filename, const bool option return status; } -f_return_status firewall_process_rules(f_string_range *range, firewall_local_data *local, firewall_data *data) { - f_status status = F_none; +f_return_status firewall_process_rules(f_string_range_t *range, firewall_local_data_t *local, firewall_data_t *data) { + f_status_t status = F_none; status = fll_fss_extended_read(&local->buffer, range, &local->rule_objects, &local->rule_contents, 0, 0); @@ -1449,19 +1449,19 @@ f_return_status firewall_process_rules(f_string_range *range, firewall_local_dat fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status); } - f_macro_fss_objects_delete_simple(local->rule_objects); - f_macro_fss_contents_delete_simple(local->rule_contents); + f_macro_fss_objects_t_delete_simple(local->rule_objects); + f_macro_fss_contents_t_delete_simple(local->rule_contents); return status; } } - f_macro_fss_objects_delete_simple(local->rule_objects); - f_macro_fss_contents_delete_simple(local->rule_contents); + f_macro_fss_objects_t_delete_simple(local->rule_objects); + f_macro_fss_contents_t_delete_simple(local->rule_contents); return status; } -f_return_status firewall_delete_local_data(firewall_local_data *local) { - f_status status = F_none; +f_return_status firewall_delete_local_data(firewall_local_data_t *local) { + f_status_t status = F_none; local->is_global = F_true; local->is_main = F_false; @@ -1471,12 +1471,12 @@ f_return_status firewall_delete_local_data(firewall_local_data *local) { local->device = 0; local->chain = 0; - f_macro_string_dynamic_delete_simple(local->buffer); - f_macro_array_lengths_delete_simple(local->chain_ids); - f_macro_fss_objects_delete_simple(local->chain_objects); - f_macro_fss_contents_delete_simple(local->chain_contents); - f_macro_fss_objects_delete_simple(local->rule_objects); - f_macro_fss_contents_delete_simple(local->rule_contents); + f_macro_string_dynamic_t_delete_simple(local->buffer); + f_macro_array_lengths_t_delete_simple(local->chain_ids); + f_macro_fss_objects_t_delete_simple(local->chain_objects); + f_macro_fss_contents_t_delete_simple(local->chain_contents); + f_macro_fss_objects_t_delete_simple(local->rule_objects); + f_macro_fss_contents_t_delete_simple(local->rule_contents); return F_none; } diff --git a/level_3/firewall/c/private-firewall.h b/level_3/firewall/c/private-firewall.h index 6bac95d..ef2ccde 100644 --- a/level_3/firewall/c/private-firewall.h +++ b/level_3/firewall/c/private-firewall.h @@ -18,31 +18,31 @@ typedef struct { bool is_stop; bool is_lock; - f_array_length device; - - f_string_dynamic buffer; - f_array_length chain; - f_array_lengths chain_ids; - f_fss_objects chain_objects; - f_fss_contents chain_contents; - f_fss_objects rule_objects; - f_fss_contents rule_contents; -} firewall_local_data; - -#define firewall_local_data_initialize \ + f_array_length_t device; + + f_string_dynamic_t buffer; + f_array_length_t chain; + f_array_lengths_t chain_ids; + f_fss_objects_t chain_objects; + f_fss_contents_t chain_contents; + f_fss_objects_t rule_objects; + f_fss_contents_t rule_contents; +} firewall_local_data_t; + +#define firewall_local_data_t_initialize \ { \ F_true, \ F_false, \ F_false, \ F_false, \ 0, \ - f_string_dynamic_initialize, \ + f_string_dynamic_t_initialize, \ 0, \ - f_array_lengths_initialize, \ - f_fss_objects_initialize, \ - f_fss_contents_initialize, \ - f_fss_objects_initialize, \ - f_fss_contents_initialize, \ + f_array_lengths_t_initialize, \ + f_fss_objects_t_initialize, \ + f_fss_contents_t_initialize, \ + f_fss_objects_t_initialize, \ + f_fss_contents_t_initialize, \ } typedef struct { @@ -50,12 +50,12 @@ typedef struct { bool has_stop; bool has_lock; - f_array_length main_at; - f_array_length stop_at; - f_array_length lock_at; -} firewall_reserved_chains; + f_array_length_t main_at; + f_array_length_t stop_at; + f_array_length_t lock_at; +} firewall_reserved_chains_t; -#define firewall_reserved_chains_initialize \ +#define firewall_reserved_chains_t_initialize \ { \ F_false, \ F_false, \ @@ -66,9 +66,9 @@ typedef struct { } #define firewall_macro_delete_fss_buffers(status, buffer, objects, contents) \ - f_macro_string_dynamic_delete(status, buffer); \ - f_macro_fss_objects_delete(status, objects); \ - f_macro_fss_contents_delete(status, contents); + f_macro_string_dynamic_t_delete(status, buffer); \ + f_macro_fss_objects_t_delete(status, objects); \ + f_macro_fss_contents_t_delete(status, contents); #define firewall_macro_concat_string(destination, source, length) \ memcpy((void *)(destination), source, length); @@ -98,7 +98,7 @@ typedef struct { arguments.array[arguments.used].used = argument.used; \ arguments.used++; \ \ - f_macro_string_dynamic_clear(argument); + f_macro_string_dynamic_t_clear(argument); /** * Perform commands. @@ -113,7 +113,7 @@ typedef struct { * * Status codes (with error bit) are returned on any problem. */ -f_return_status firewall_perform_commands(const firewall_local_data local, const firewall_data data) f_gcc_attribute_visibility_internal; +f_return_status firewall_perform_commands(const firewall_local_data_t local, const firewall_data_t data) f_gcc_attribute_visibility_internal; /** * Create custom chains. @@ -130,7 +130,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const * * Status codes (with error bit) are returned on any problem. */ -f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved, firewall_local_data *local, firewall_data *data) f_gcc_attribute_visibility_internal; +f_return_status firewall_create_custom_chains(firewall_reserved_chains_t *reserved, firewall_local_data_t *local, firewall_data_t *data) f_gcc_attribute_visibility_internal; /** * Deallocate chains. @@ -143,7 +143,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved * * Status codes (with error bit) are returned on any problem. */ -f_return_status firewall_delete_chains(const firewall_data data) f_gcc_attribute_visibility_internal; +f_return_status firewall_delete_chains(const firewall_data_t data) f_gcc_attribute_visibility_internal; /** * Lock the firewall. @@ -156,7 +156,7 @@ f_return_status firewall_delete_chains(const firewall_data data) f_gcc_attribute * * Status codes (with error bit) are returned on any problem. */ -f_return_status firewall_default_lock(const firewall_data data) f_gcc_attribute_visibility_internal; +f_return_status firewall_default_lock(const firewall_data_t data) f_gcc_attribute_visibility_internal; /** * Buffer firewall rules. @@ -176,7 +176,7 @@ f_return_status firewall_default_lock(const firewall_data data) f_gcc_attribute_ * * Status codes (with error bit) are returned on any problem. */ -f_return_status firewall_buffer_rules(const f_string filename, const bool optional, firewall_local_data *local, firewall_data *data) f_gcc_attribute_visibility_internal; +f_return_status firewall_buffer_rules(const f_string_t filename, const bool optional, firewall_local_data_t *local, firewall_data_t *data) f_gcc_attribute_visibility_internal; /** * Process buffered rules. @@ -193,7 +193,7 @@ f_return_status firewall_buffer_rules(const f_string filename, const bool option * * Status codes (with error bit) are returned on any problem. */ -f_return_status firewall_process_rules(f_string_range *range, firewall_local_data *local, firewall_data *data) f_gcc_attribute_visibility_internal; +f_return_status firewall_process_rules(f_string_range_t *range, firewall_local_data_t *local, firewall_data_t *data) f_gcc_attribute_visibility_internal; /** * Delete allocated data. @@ -206,7 +206,7 @@ f_return_status firewall_process_rules(f_string_range *range, firewall_local_dat * * Status codes (with error bit) are returned on any problem. */ -f_return_status firewall_delete_local_data(firewall_local_data *local) f_gcc_attribute_visibility_internal; +f_return_status firewall_delete_local_data(firewall_local_data_t *local) f_gcc_attribute_visibility_internal; #ifdef __cplusplus } // extern "C" diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.c b/level_3/fss_basic_list_read/c/fss_basic_list_read.c index 9487b38..923b894 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 @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_basic_list_read_print_help_ - f_return_status fss_basic_list_read_print_help(const fl_color_context context) { + f_return_status fss_basic_list_read_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, fss_basic_list_read_name_long, fss_basic_list_read_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -122,13 +122,13 @@ extern "C" { #endif // _di_fss_basic_list_read_print_help_ #ifndef _di_fss_basic_list_read_main_ - f_return_status fss_basic_list_read_main(const f_console_arguments arguments, fss_basic_list_read_data *data) { - f_status status = F_none; + f_return_status fss_basic_list_read_main(const f_console_arguments_t arguments, fss_basic_list_read_data_t *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, fss_basic_list_read_total_parameters }; - f_console_parameter_id ids[3] = { fss_basic_list_read_parameter_no_color, fss_basic_list_read_parameter_light, fss_basic_list_read_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, fss_basic_list_read_total_parameters }; + f_console_parameter_id_t ids[3] = { fss_basic_list_read_parameter_no_color, fss_basic_list_read_parameter_light, fss_basic_list_read_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); @@ -229,21 +229,21 @@ extern "C" { } } - fss_basic_list_read_depths depths = fss_basic_list_read_depths_initialize; + fss_basic_list_read_depths_t depths = fss_basic_list_read_depths_t_initialize; - f_string_length counter = 0; - f_string_length original_size = data->quantity.total; + f_string_length_t counter = 0; + f_string_length_t original_size = data->quantity.total; status = fss_basic_list_read_main_preprocess_depth(arguments, *data, &depths); if (F_status_is_error(status)) { - macro_fss_basic_list_read_depths_delete_simple(depths); + macro_fss_basic_list_read_depths_t_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; } // This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file. if (depths.array[0].depth > 0) { - macro_fss_basic_list_read_depths_delete_simple(depths); + macro_fss_basic_list_read_depths_t_delete_simple(depths); if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { fprintf(f_type_output, "0%c", f_string_eol[0]); @@ -261,13 +261,13 @@ extern "C" { fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number."); - macro_fss_basic_list_read_depths_delete_simple(depths); + macro_fss_basic_list_read_depths_t_delete_simple(depths); fss_basic_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->process_pipe) { - f_file file = f_file_initialize; + f_file_t file = f_file_t_initialize; file.id = f_type_descriptor_input; @@ -275,27 +275,27 @@ extern "C" { if (F_status_is_error(status)) { fss_basic_list_read_print_file_error(data->context, "f_file_read", "-", F_status_set_fine(status)); - macro_fss_basic_list_read_depths_delete_simple(depths); + macro_fss_basic_list_read_depths_t_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; } status = fss_basic_list_read_main_process_file(arguments, data, "-", depths); if (F_status_is_error(status)) { - macro_fss_basic_list_read_depths_delete_simple(depths); + macro_fss_basic_list_read_depths_t_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; } // Clear buffers before continuing. - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); } if (data->remaining.used > 0) { for (; counter < data->remaining.used; counter++) { - f_file file = f_file_initialize; + f_file_t file = f_file_t_initialize; status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file); @@ -304,7 +304,7 @@ extern "C" { if (F_status_is_error(status)) { fss_basic_list_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); - macro_fss_basic_list_read_depths_delete_simple(depths); + macro_fss_basic_list_read_depths_t_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; } @@ -316,7 +316,7 @@ extern "C" { f_file_close(&file.id); - macro_fss_basic_list_read_depths_delete_simple(depths); + macro_fss_basic_list_read_depths_t_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; } @@ -334,26 +334,26 @@ extern "C" { if (F_status_is_error(status)) { fss_basic_list_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); - macro_fss_basic_list_read_depths_delete_simple(depths); + macro_fss_basic_list_read_depths_t_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; } status = fss_basic_list_read_main_process_file(arguments, data, arguments.argv[data->remaining.array[counter]], depths); if (F_status_is_error(status)) { - macro_fss_basic_list_read_depths_delete_simple(depths); + macro_fss_basic_list_read_depths_t_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; } // Clear buffers before repeating the loop. - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); } // for } - macro_fss_basic_list_read_depths_delete_simple(depths); + macro_fss_basic_list_read_depths_t_delete_simple(depths); } else { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify one or more files."); @@ -366,22 +366,22 @@ extern "C" { #endif // _di_fss_basic_list_read_main_ #ifndef _di_fss_basic_list_read_delete_data_ - f_return_status fss_basic_list_read_delete_data(fss_basic_list_read_data *data) { - f_status status = F_none; - f_string_length i = 0; + f_return_status fss_basic_list_read_delete_data(fss_basic_list_read_data_t *data) { + f_status_t status = F_none; + f_string_length_t i = 0; while (i < fss_basic_list_read_total_parameters) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); i++; } // while - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); - f_macro_string_lengths_delete_simple(data->remaining); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); + f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_delete_simple(data->context); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.h b/level_3/fss_basic_list_read/c/fss_basic_list_read.h index 94cd9f4..6d3e9df 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.h @@ -7,7 +7,7 @@ * * This is the FSS Basic List Read program * This program utilizes the Featureless Linux Library. - * This program processes files or other input in fss format and stores the results in the fss_basic_list_read_data. + * This program processes files or other input in fss format and stores the results in the fss_basic_list_read_data_t. * * This processes in accordance to the FSS-0002 Basic List specification. */ @@ -99,53 +99,53 @@ extern "C" { fss_basic_list_read_parameter_trim, }; - #define f_console_parameter_initialize_fss_basic_list_read \ + #define fss_basic_list_read_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_basic_list_read_short_at, fss_basic_list_read_long_at, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_line, fss_basic_list_read_long_line, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_name, fss_basic_list_read_long_name, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_object, fss_basic_list_read_long_object, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_select, fss_basic_list_read_long_select, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_total, fss_basic_list_read_long_total, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(fss_basic_list_read_short_at, fss_basic_list_read_long_at, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_list_read_short_line, fss_basic_list_read_long_line, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_list_read_short_name, fss_basic_list_read_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_list_read_short_object, fss_basic_list_read_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_list_read_short_select, fss_basic_list_read_long_select, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_list_read_short_total, fss_basic_list_read_long_total, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, 0, F_false, f_console_type_normal), \ } #define fss_basic_list_read_total_parameters 14 #endif // _di_fss_basic_list_read_defines_ -#ifndef _di_fss_basic_list_read_data_ +#ifndef _di_fss_basic_list_read_data_t_ typedef struct { - f_console_parameter parameters[fss_basic_list_read_total_parameters]; + f_console_parameter_t parameters[fss_basic_list_read_total_parameters]; - f_string_dynamic buffer; - f_fss_objects objects; - f_fss_contents contents; - f_string_quantity quantity; - f_string_lengths remaining; + f_string_dynamic_t buffer; + f_fss_objects_t objects; + f_fss_contents_t contents; + f_string_quantity_t quantity; + f_string_lengths_t remaining; bool process_pipe; - fl_color_context context; - } fss_basic_list_read_data; + fl_color_context_t context; + } fss_basic_list_read_data_t; - #define fss_basic_list_read_data_initialize \ + #define fss_basic_list_read_data_t_initialize \ { \ - f_console_parameter_initialize_fss_basic_list_read, \ - f_string_dynamic_initialize, \ - f_fss_objects_initialize, \ - f_fss_contents_initialize, \ - f_string_quantity_initialize, \ - f_string_lengths_initialize, \ + fss_basic_list_read_console_parameter_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_fss_objects_t_initialize, \ + f_fss_contents_t_initialize, \ + f_string_quantity_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_fss_basic_list_read_data_ +#endif // _di_fss_basic_list_read_data_t_ /** * Print help to standard output. @@ -157,7 +157,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_list_read_print_help_ - extern f_return_status fss_basic_list_read_print_help(const fl_color_context context); + extern f_return_status fss_basic_list_read_print_help(const fl_color_context_t context); #endif // _di_fss_basic_list_read_print_help_ /** @@ -178,7 +178,7 @@ extern "C" { * @see fss_basic_list_read_delete_data() */ #ifndef _di_fss_basic_list_read_main_ - extern f_return_status fss_basic_list_read_main(const f_console_arguments arguments, fss_basic_list_read_data *data); + extern f_return_status fss_basic_list_read_main(const f_console_arguments_t arguments, fss_basic_list_read_data_t *data); #endif // _di_fss_basic_list_read_main_ /** @@ -197,7 +197,7 @@ extern "C" { * @see fss_basic_list_read_main() */ #ifndef _di_fss_basic_list_read_delete_data_ - extern f_return_status fss_basic_list_read_delete_data(fss_basic_list_read_data *data); + extern f_return_status fss_basic_list_read_delete_data(fss_basic_list_read_data_t *data); #endif // _di_fss_basic_list_read_delete_data_ #ifdef __cplusplus diff --git a/level_3/fss_basic_list_read/c/main.c b/level_3/fss_basic_list_read/c/main.c index c361b5d..1097eba 100644 --- a/level_3/fss_basic_list_read/c/main.c +++ b/level_3/fss_basic_list_read/c/main.c @@ -1,14 +1,14 @@ #include "fss_basic_list_read.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - fss_basic_list_read_data data = fss_basic_list_read_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + fss_basic_list_read_data_t data = fss_basic_list_read_data_t_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = fss_basic_list_read_main(arguments, &data); + f_status_t status = fss_basic_list_read_main(arguments, &data); if (F_status_is_error(status)) { return 1; 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 395811b..51fd6a8 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 @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_basic_list_read_print_file_error_ - void fss_basic_list_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { + void fss_basic_list_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); @@ -19,7 +19,7 @@ extern "C" { #endif // _di_fss_basic_list_read_print_file_error_ #ifndef _di_fss_basic_list_read_print_number_argument_error_ - void fss_basic_list_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) { + void fss_basic_list_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { if (status == F_parameter) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); @@ -83,17 +83,17 @@ extern "C" { #endif // _di_fss_basic_list_read_print_number_argument_error_ #ifndef _di_fss_basic_list_read_main_preprocess_depth_ - f_return_status fss_basic_list_read_main_preprocess_depth(const f_console_arguments arguments, const fss_basic_list_read_data data, fss_basic_list_read_depths *depths) { - f_status status = F_none; + f_return_status fss_basic_list_read_main_preprocess_depth(const f_console_arguments_t arguments, const fss_basic_list_read_data_t data, fss_basic_list_read_depths_t *depths) { + f_status_t status = F_none; { - f_array_length depth_size = 1; + f_array_length_t depth_size = 1; if (data.parameters[fss_basic_list_read_parameter_depth].result == f_console_result_additional) { depth_size = data.parameters[fss_basic_list_read_parameter_depth].additional.used; } - macro_fss_basic_list_read_depths_new(status, (*depths), depth_size); + macro_fss_basic_list_read_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); return status; @@ -102,17 +102,17 @@ extern "C" { depths->used = depth_size; } - f_array_length position_depth = 0; - f_array_length position_at = 0; - f_array_length position_name = 0; + f_array_length_t position_depth = 0; + f_array_length_t position_at = 0; + f_array_length_t position_name = 0; - for (f_array_length i = 0; i < depths->used; i++) { + for (f_array_length_t i = 0; i < depths->used; i++) { depths->array[i].depth = 0; depths->array[i].index_at = 0; depths->array[i].index_name = 0; depths->array[i].value_at = 0; - f_macro_string_dynamic_clear(depths->array[i].value_name); + f_macro_string_dynamic_t_clear(depths->array[i].value_name); if (data.parameters[fss_basic_list_read_parameter_depth].additional.used == 0) { position_depth = 0; @@ -120,7 +120,7 @@ extern "C" { else { position_depth = data.parameters[fss_basic_list_read_parameter_depth].additional.array[i]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[position_depth])); + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[position_depth])); status = fl_conversion_string_to_number_unsigned(arguments.argv[position_depth], &depths->array[i].depth, range); if (F_status_is_error(status)) { @@ -141,7 +141,7 @@ extern "C" { depths->array[i].index_at = data.parameters[fss_basic_list_read_parameter_at].additional.array[position_at]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[depths->array[i].index_at])); + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[depths->array[i].index_at])); status = fl_conversion_string_to_number_unsigned(arguments.argv[depths->array[i].index_at], &depths->array[i].value_at, range); if (F_status_is_error(status)) { @@ -171,19 +171,19 @@ extern "C" { } if (F_status_is_error(status)) { - f_status status_code = F_status_set_fine(status); + f_status_t status_code = F_status_set_fine(status); // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status_code == f_string_length_size) { + else if (status_code == f_string_length_t_size) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '"); fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached."); } else { - f_string function = "fl_string_append"; + f_string_t function = "fl_string_append"; if (data.parameters[fss_basic_list_read_parameter_trim].result == f_console_result_found) { function = "fl_string_rip"; @@ -210,8 +210,8 @@ extern "C" { } } // for - for (f_array_length i = 0; i < depths->used; i++) { - for (f_array_length j = i + 1; j < depths->used; j++) { + for (f_array_length_t i = 0; i < depths->used; i++) { + for (f_array_length_t j = i + 1; j < depths->used; j++) { if (depths->array[i].depth == depths->array[j].depth) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '"); fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); @@ -240,11 +240,11 @@ extern "C" { #endif // _di_fss_basic_list_read_main_preprocess_depth_ #ifndef _di_fss_basic_list_read_main_process_file_ - f_return_status fss_basic_list_read_main_process_file(const f_console_arguments arguments, fss_basic_list_read_data *data, const f_string filename, const fss_basic_list_read_depths depths) { - f_status status = F_none; + f_return_status fss_basic_list_read_main_process_file(const f_console_arguments_t arguments, fss_basic_list_read_data_t *data, const f_string_t filename, const fss_basic_list_read_depths_t depths) { + f_status_t status = F_none; { - f_string_range input = f_string_range_initialize; + f_string_range_t input = f_string_range_initialize; input.start = 0; input.stop = data->buffer.used - 1; @@ -288,19 +288,19 @@ extern "C" { } else if (status == F_data_not_stop || status == F_data_not_eos) { // Clear buffers, then attempt the next file. - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); return F_status_set_warning(status); } } - f_string_length select = 0; + f_string_length_t select = 0; if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_additional) { - const f_string_length index = data->parameters[fss_basic_list_read_parameter_select].additional.array[data->parameters[fss_basic_list_read_parameter_select].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[fss_basic_list_read_parameter_select].additional.array[data->parameters[fss_basic_list_read_parameter_select].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &select, range); if (F_status_is_error(status)) { @@ -314,11 +314,11 @@ extern "C" { } } - f_string_length line = 0; + f_string_length_t line = 0; if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) { - const f_string_length index = data->parameters[fss_basic_list_read_parameter_line].additional.array[data->parameters[fss_basic_list_read_parameter_line].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[fss_basic_list_read_parameter_line].additional.array[data->parameters[fss_basic_list_read_parameter_line].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &line, range); if (F_status_is_error(status)) { @@ -332,10 +332,10 @@ extern "C" { if (depths.array[0].index_name > 0) { memset(names, 0, sizeof(bool) * data->objects.used); - f_string_length name_length = 0; + f_string_length_t name_length = 0; if (data->parameters[fss_basic_list_read_parameter_trim].result == f_console_result_found) { - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { @@ -346,7 +346,7 @@ extern "C" { } // for } else { - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { @@ -378,9 +378,9 @@ extern "C" { } } else if (depths.array[0].index_name > 0) { - f_string_length total = 0; + f_string_length_t total = 0; - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { if (names[i] == 0) continue; total++; @@ -395,15 +395,15 @@ extern "C" { return F_none; } - f_return_status (*print_object)(FILE *, const f_string_static, const f_string_range) = &f_print_string_dynamic_partial; + f_return_status (*print_object)(FILE *, const f_string_static_t, const f_string_range_t) = &f_print_string_dynamic_partial; if (data->parameters[fss_basic_list_read_parameter_trim].result == f_console_result_found) { print_object = &fl_print_trim_string_dynamic_partial; } if (depths.array[0].index_at > 0) { - f_array_length at = 0; - f_array_length i = 0; + f_array_length_t at = 0; + f_array_length_t i = 0; for (; i < data->objects.used; i++) { if (names[i]) { @@ -420,7 +420,7 @@ extern "C" { return F_none; } - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { if (names[i] == 0) continue; print_object(f_type_output, data->buffer, data->objects.array[i]); @@ -439,8 +439,8 @@ extern "C" { return F_none; } - f_array_length at = 0; - f_array_length i = 0; + f_array_length_t at = 0; + f_array_length_t i = 0; for (; i < data->objects.used; i++) { if (names[i]) { @@ -450,9 +450,9 @@ extern "C" { fprintf(f_type_output, "0%c", f_string_eol[0]); } else { - f_string_length total = 1; + f_string_length_t total = 1; - for (f_string_length j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) { + for (f_string_length_t j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) { if (data->buffer.string[j] == 0) continue; if (data->buffer.string[j] == f_string_eol[0]) { @@ -473,7 +473,7 @@ extern "C" { } } else { - f_string_length i = data->contents.array[i].array[0].start; + f_string_length_t i = data->contents.array[i].array[0].start; if (line == 0) { for (; i <= data->contents.array[i].array[0].stop; i++) { @@ -487,7 +487,7 @@ extern "C" { } // for } else { - f_string_length line_current = 0; + f_string_length_t line_current = 0; for (; i <= data->contents.array[i].array[0].stop; i++) { if (data->buffer.string[i] == 0) continue; @@ -536,9 +536,9 @@ extern "C" { } if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { - f_string_length total = 0; + f_string_length_t total = 0; - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { if (!names[i]) continue; if (data->contents.array[i].used == 0) { @@ -549,7 +549,7 @@ extern "C" { continue; } - for (f_string_length j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) { + for (f_string_length_t j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) { if (data->buffer.string[j] == 0) continue; if (data->buffer.string[j] == f_string_eol[0]) { @@ -563,9 +563,9 @@ extern "C" { } if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) { - f_string_length line_current = 0; - f_string_length i = 0; - f_string_length j = 0; + f_string_length_t line_current = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; for (; i < data->contents.used; i++) { if (!names[i]) { @@ -621,7 +621,7 @@ extern "C" { return F_none; } - for (f_string_length i = 0; i < data->contents.used; i++) { + for (f_string_length_t i = 0; i < data->contents.used; i++) { if (!names[i]) { continue; } 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 cbd072b..59872ab 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 @@ -23,39 +23,39 @@ extern "C" { * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. */ -#ifndef _di_fss_basic_list_read_depth_ +#ifndef _di_fss_basic_list_read_depth_t_ typedef struct { - f_string_length depth; + f_string_length_t depth; - f_array_length index_at; - f_array_length index_name; + f_array_length_t index_at; + f_array_length_t index_name; - f_number_unsigned value_at; - f_string_dynamic value_name; - } fss_basic_list_read_depth; + f_number_unsigned_t value_at; + f_string_dynamic_t value_name; + } fss_basic_list_read_depth_t; - #define fss_basic_list_read_depth_initialize \ + #define fss_basic_list_read_depth_t_initialize \ { \ 0, \ 0, \ 0, \ 0, \ - f_string_dynamic_initialize, \ + f_string_dynamic_t_initialize, \ } - #define macro_fss_basic_list_read_depth_clear(structure) \ + #define macro_fss_basic_list_read_depth_t_clear(structure) \ structure.depth = 0; \ structure.index_at = 0; \ structure.index_name = 0; \ structure.value_at = 0; \ - f_macro_string_dynamic_clear(structure.value_name) + f_macro_string_dynamic_t_clear(structure.value_name) - #define macro_fss_basic_list_read_depth_delete(status, structure) f_macro_string_dynamic_delete(status, structure.value_name) - #define macro_fss_basic_list_read_depth_destroy(status, structure) f_macro_string_dynamic_destroy(status, structure.value_name) + #define macro_fss_basic_list_read_depth_t_delete(status, structure) f_macro_string_dynamic_t_delete(status, structure.value_name) + #define macro_fss_basic_list_read_depth_t_destroy(status, structure) f_macro_string_dynamic_t_destroy(status, structure.value_name) - #define macro_fss_basic_list_read_depth_delete_simple(structure) f_macro_string_dynamic_delete_simple(structure.value_name) - #define macro_fss_basic_list_read_depth_destroy_simple(structure) f_macro_string_dynamic_destroy_simple(structure.value_name) -#endif // _di_fss_basic_list_read_depth_ + #define macro_fss_basic_list_read_depth_t_delete_simple(structure) f_macro_string_dynamic_t_delete_simple(structure.value_name) + #define macro_fss_basic_list_read_depth_t_destroy_simple(structure) f_macro_string_dynamic_t_destroy_simple(structure.value_name) +#endif // _di_fss_basic_list_read_depth_t_ /** * An array of depth parameters. @@ -64,98 +64,98 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_fss_basic_list_read_depths_ +#ifndef _di_fss_basic_list_read_depths_t_ typedef struct { - fss_basic_list_read_depth *array; + fss_basic_list_read_depth_t *array; - f_array_length size; - f_array_length used; - } fss_basic_list_read_depths; + f_array_length_t size; + f_array_length_t used; + } fss_basic_list_read_depths_t; - #define fss_basic_list_read_depths_initialize { 0, 0, 0 } + #define fss_basic_list_read_depths_t_initialize { 0, 0, 0 } - #define macro_fss_basic_list_read_depths_clear(depths) f_macro_memory_structure_clear(depths) + #define macro_fss_basic_list_read_depths_t_clear(depths) f_macro_memory_structure_t_clear(depths) - #define macro_fss_basic_list_read_depths_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_basic_list_read_depth, length) + #define macro_fss_basic_list_read_depths_t_new(status, depths, length) f_macro_memory_structure_t_new(status, depths, fss_basic_list_read_depth_t, length) - #define macro_fss_basic_list_read_depths_delete(status, depths) \ + #define macro_fss_basic_list_read_depths_t_delete(status, depths) \ status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_basic_list_read_depth_delete(status, depths.array[depths.used]); \ + macro_fss_basic_list_read_depth_t_delete(status, depths.array[depths.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) f_macro_memory_structure_delete(depths, fss_basic_list_read_depth) + if (status == F_none) f_macro_memory_structure_t_delete(depths, fss_basic_list_read_depth_t) - #define macro_fss_basic_list_read_depths_destroy(status, depths) \ + #define macro_fss_basic_list_read_depths_t_destroy(status, depths) \ status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_basic_list_read_depth_destroy(status, depths.array[depths.used]); \ + macro_fss_basic_list_read_depth_t_destroy(status, depths.array[depths.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) f_macro_memory_structure_destroy(depths, fss_basic_list_read_depth) + if (status == F_none) f_macro_memory_structure_t_destroy(depths, fss_basic_list_read_depth_t) - #define macro_fss_basic_list_read_depths_delete_simple(depths) \ + #define macro_fss_basic_list_read_depths_t_delete_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_basic_list_read_depth_delete_simple(depths.array[depths.used]); \ + macro_fss_basic_list_read_depth_t_delete_simple(depths.array[depths.used]); \ } \ - if (depths.used == 0) f_macro_memory_structure_delete_simple(depths, fss_basic_list_read_depth) + if (depths.used == 0) f_macro_memory_structure_t_delete_simple(depths, fss_basic_list_read_depth_t) - #define macro_fss_basic_list_read_depths_destroy_simple(depths) \ + #define macro_fss_basic_list_read_depths_t_destroy_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_basic_list_read_depth_destroy_simple(depths.array[depths.used]); \ + macro_fss_basic_list_read_depth_t_destroy_simple(depths.array[depths.used]); \ } \ - if (depths.used == 0) f_macro_memory_structure_destroy_simple(depths, fss_basic_list_read_depth) + if (depths.used == 0) f_macro_memory_structure_t_destroy_simple(depths, fss_basic_list_read_depth_t) - #define macro_fss_basic_list_read_depths_resize(status, depths, new_length) \ + #define macro_fss_basic_list_read_depths_t_resize(status, depths, new_length) \ status = F_none; \ if (new_length < depths.size) { \ - f_array_length i = depths.size - new_length; \ + f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - macro_fss_basic_list_read_depth_delete(status, depths.array[i]); \ + macro_fss_basic_list_read_depth_t_delete(status, depths.array[i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_list_read_depth), depths.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_list_read_depth_t), depths.size, new_length); \ if (status == F_none) { \ if (new_length > depths.size) { \ - f_array_length i = depths.size; \ + f_array_length_t i = depths.size; \ for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_basic_list_read_depth)); \ + memset(&depths.array[i], 0, sizeof(fss_basic_list_read_depth_t)); \ } \ } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } - #define macro_fss_basic_list_read_depths_adjust(status, depths, new_length) \ + #define macro_fss_basic_list_read_depths_t_adjust(status, depths, new_length) \ status = F_none; \ if (new_length < depths.size) { \ - f_array_length i = depths.size - new_length; \ + f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - macro_fss_basic_list_read_depth_delete(status, depths.array[i]); \ + macro_fss_basic_list_read_depth_t_delete(status, depths.array[i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_list_read_depth), depths.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_list_read_depth_t), depths.size, new_length); \ if (status == F_none) { \ if (new_length > depths.size) { \ - f_array_length i = depths.size; \ + f_array_length_t i = depths.size; \ for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_basic_list_read_depth)); \ + memset(&depths.array[i], 0, sizeof(fss_basic_list_read_depth_t)); \ } \ } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } -#endif // _di_fss_basic_list_read_depths_ +#endif // _di_fss_basic_list_read_depths_t_ /** * Print file error messages. @@ -170,7 +170,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_basic_list_read_print_file_error_ - extern void fss_basic_list_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) f_gcc_attribute_visibility_internal; + extern void fss_basic_list_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_list_read_print_file_error_ /** @@ -188,7 +188,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_basic_list_read_print_number_argument_error_ - extern void fss_basic_list_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) f_gcc_attribute_visibility_internal; + extern void fss_basic_list_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_list_read_print_number_argument_error_ /** @@ -207,7 +207,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_list_read_main_preprocess_depth_ - extern f_return_status fss_basic_list_read_main_preprocess_depth(const f_console_arguments arguments, const fss_basic_list_read_data data, fss_basic_list_read_depths *depths) f_gcc_attribute_visibility_internal; + extern f_return_status fss_basic_list_read_main_preprocess_depth(const f_console_arguments_t arguments, const fss_basic_list_read_data_t data, fss_basic_list_read_depths_t *depths) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_list_read_main_preprocess_depth_ /** @@ -230,7 +230,7 @@ extern "C" { * @see fss_basic_list_read_main_preprocess_depth() */ #ifndef _di_fss_basic_list_read_main_process_file_ - extern f_return_status fss_basic_list_read_main_process_file(const f_console_arguments arguments, fss_basic_list_read_data *data, const f_string file_name, const fss_basic_list_read_depths depths) f_gcc_attribute_visibility_internal; + extern f_return_status fss_basic_list_read_main_process_file(const f_console_arguments_t arguments, fss_basic_list_read_data_t *data, const f_string_t file_name, const fss_basic_list_read_depths_t depths) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_list_read_main_process_file_ #ifdef __cplusplus 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 e6281dd..455d2b3 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 @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fss_basic_list_write_print_help_ - f_return_status fss_basic_list_write_print_help(const fl_color_context context) { + f_return_status fss_basic_list_write_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, fss_basic_list_write_name_long, fss_basic_list_write_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -28,13 +28,13 @@ extern "C" { #endif // _di_fss_basic_list_write_print_help_ #ifndef _di_fss_basic_list_write_main_ - f_return_status fss_basic_list_write_main(const f_console_arguments arguments, fss_basic_list_write_data *data) { - f_status status = F_none; + f_return_status fss_basic_list_write_main(const f_console_arguments_t arguments, fss_basic_list_write_data_t *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, fss_basic_list_write_total_parameters }; - f_console_parameter_id ids[3] = { fss_basic_list_write_parameter_no_color, fss_basic_list_write_parameter_light, fss_basic_list_write_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, fss_basic_list_write_total_parameters }; + f_console_parameter_id_t ids[3] = { fss_basic_list_write_parameter_no_color, fss_basic_list_write_parameter_light, fss_basic_list_write_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); if (F_status_is_error(status)) { @@ -52,15 +52,15 @@ extern "C" { fll_program_print_version(fss_basic_list_write_version); } else { - f_array_length counter = 0; + f_array_length_t counter = 0; bool object = (data->parameters[fss_basic_list_write_parameter_object].result == f_console_result_found); - f_string_dynamic buffer = f_string_dynamic_initialize; - f_string_range range = f_string_range_initialize; + f_string_dynamic_t buffer = f_string_dynamic_t_initialize; + f_string_range_t range = f_string_range_initialize; if (data->process_pipe) { - f_file file = f_file_initialize; - f_string_dynamic input = f_string_dynamic_initialize; + f_file_t file = f_file_t_initialize; + f_string_dynamic_t input = f_string_dynamic_t_initialize; file.id = f_type_descriptor_input; @@ -85,8 +85,8 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } - f_macro_string_dynamic_delete_simple(buffer); - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(input); fss_basic_list_write_delete_data(data); return F_status_set_error(status); } @@ -99,8 +99,8 @@ extern "C" { status = fl_fss_basic_list_object_write(input, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos || status == F_data_not_eol) { - f_macro_string_dynamic_delete_simple(buffer); - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(input); fss_basic_list_write_delete_data(data); return F_status_set_error(status); } @@ -114,8 +114,8 @@ extern "C" { status = fl_fss_basic_list_content_write(input, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos || status == F_data_not_eol) { - f_macro_string_dynamic_delete_simple(buffer); - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(input); fss_basic_list_write_delete_data(data); return F_status_set_error(status); } @@ -126,10 +126,10 @@ extern "C" { } } - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(input); } else if (data->parameters[fss_basic_list_write_parameter_string].result == f_console_result_additional) { - f_string_dynamic input = f_string_dynamic_initialize; + f_string_dynamic_t input = f_string_dynamic_t_initialize; input.string = arguments.argv[data->parameters[fss_basic_list_write_parameter_string].additional.array[0]]; input.used = strlen(input.string); @@ -142,7 +142,7 @@ extern "C" { status = fl_fss_basic_list_object_write(input, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos || status == F_data_not_eol) { - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_basic_list_write_delete_data(data); return F_status_set_error(status); } @@ -156,7 +156,7 @@ extern "C" { status = fl_fss_basic_list_content_write(input, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos || status == F_data_not_eol) { - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_basic_list_write_delete_data(data); return F_status_set_error(status); } @@ -171,7 +171,7 @@ extern "C" { } if (data->parameters[fss_basic_list_write_parameter_file].result == f_console_result_additional) { - f_file output = f_file_initialize; + f_file_t output = f_file_t_initialize; output.flag = f_file_flag_append_wo; @@ -198,7 +198,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_basic_list_write_delete_data(data); return F_status_set_error(status); } @@ -219,7 +219,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()", status); } - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_basic_list_write_delete_data(data); return F_status_set_error(status); } @@ -228,7 +228,7 @@ extern "C" { f_print_string_dynamic(f_type_output, buffer); } - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); } fss_basic_list_write_delete_data(data); @@ -237,17 +237,17 @@ extern "C" { #endif // _di_fss_basic_list_write_main_ #ifndef _di_fss_basic_list_write_delete_data_ - f_return_status fss_basic_list_write_delete_data(fss_basic_list_write_data *data) { - f_string_length i = 0; + f_return_status fss_basic_list_write_delete_data(fss_basic_list_write_data_t *data) { + f_string_length_t i = 0; while (i < fss_basic_list_write_total_parameters) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); i++; } // while - f_macro_string_lengths_delete_simple(data->remaining); - fl_macro_color_context_delete_simple(data->context); + f_macro_string_lengths_t_delete_simple(data->remaining); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.h b/level_3/fss_basic_list_write/c/fss_basic_list_write.h index 93a2003..6d034a8 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.h +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.h @@ -76,40 +76,40 @@ extern "C" { fss_basic_list_write_parameter_string, }; - #define f_console_parameter_initialize_fss_basic_list_write \ + #define fss_basic_list_write_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_basic_list_write_short_file, fss_basic_list_write_long_file, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_write_short_object, fss_basic_list_write_long_object, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_write_short_partial, fss_basic_list_write_long_partial, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_write_short_string, fss_basic_list_write_long_string, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(fss_basic_list_write_short_file, fss_basic_list_write_long_file, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_list_write_short_object, fss_basic_list_write_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_list_write_short_partial, fss_basic_list_write_long_partial, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_list_write_short_string, fss_basic_list_write_long_string, 0, F_true, f_console_type_normal), \ } #define fss_basic_list_write_total_parameters 9 #endif // _di_fss_basic_list_write_defines_ -#ifndef _di_fss_basic_list_write_data_ +#ifndef _di_fss_basic_list_write_data_t_ typedef struct { - f_console_parameter parameters[fss_basic_list_write_total_parameters]; + f_console_parameter_t parameters[fss_basic_list_write_total_parameters]; - f_string_lengths remaining; + f_string_lengths_t remaining; bool process_pipe; - fl_color_context context; - } fss_basic_list_write_data; + fl_color_context_t context; + } fss_basic_list_write_data_t; - #define fss_basic_list_write_data_initialize \ + #define fss_basic_list_write_data_t_initialize \ { \ - f_console_parameter_initialize_fss_basic_list_write, \ - f_string_lengths_initialize, \ + fss_basic_list_write_console_parameter_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_fss_basic_list_write_data_ +#endif // _di_fss_basic_list_write_data_t_ /** * Print help to standard output. @@ -121,7 +121,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_list_write_print_help_ - extern f_return_status fss_basic_list_write_print_help(const fl_color_context context); + extern f_return_status fss_basic_list_write_print_help(const fl_color_context_t context); #endif // _di_fss_basic_list_write_print_help_ /** @@ -142,7 +142,7 @@ extern "C" { * @see fss_basic_list_write_delete_data() */ #ifndef _di_fss_basic_list_write_main_ - extern f_return_status fss_basic_list_write_main(const f_console_arguments arguments, fss_basic_list_write_data *data); + extern f_return_status fss_basic_list_write_main(const f_console_arguments_t arguments, fss_basic_list_write_data_t *data); #endif // _di_fss_basic_list_write_main_ /** @@ -161,7 +161,7 @@ extern "C" { * @see fss_basic_list_write_main() */ #ifndef _di_fss_basic_list_write_delete_data_ - extern f_return_status fss_basic_list_write_delete_data(fss_basic_list_write_data *data); + extern f_return_status fss_basic_list_write_delete_data(fss_basic_list_write_data_t *data); #endif // _di_fss_basic_list_write_delete_data_ #ifdef __cplusplus diff --git a/level_3/fss_basic_list_write/c/main.c b/level_3/fss_basic_list_write/c/main.c index 6c85b7e..6cb043d 100644 --- a/level_3/fss_basic_list_write/c/main.c +++ b/level_3/fss_basic_list_write/c/main.c @@ -1,14 +1,14 @@ #include "fss_basic_list_write.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - fss_basic_list_write_data data = fss_basic_list_write_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + fss_basic_list_write_data_t data = fss_basic_list_write_data_t_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = fss_basic_list_write_main(arguments, &data); + f_status_t status = fss_basic_list_write_main(arguments, &data); if (F_status_is_error(status)) { return 1; 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 5710c51..efa2e10 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_basic_read_print_help_ - f_return_status fss_basic_read_print_help(const fl_color_context context) { + f_return_status fss_basic_read_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, fss_basic_read_name_long, fss_basic_read_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -122,13 +122,13 @@ extern "C" { #endif // _di_fss_basic_read_print_help_ #ifndef _di_fss_basic_read_main_ - f_return_status fss_basic_read_main(const f_console_arguments arguments, fss_basic_read_data *data) { - f_status status = F_none; + f_return_status fss_basic_read_main(const f_console_arguments_t arguments, fss_basic_read_data_t *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, fss_basic_read_total_parameters }; - f_console_parameter_id ids[3] = { fss_basic_read_parameter_no_color, fss_basic_read_parameter_light, fss_basic_read_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, fss_basic_read_total_parameters }; + f_console_parameter_id_t ids[3] = { fss_basic_read_parameter_no_color, fss_basic_read_parameter_light, fss_basic_read_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); @@ -229,21 +229,21 @@ extern "C" { } } - fss_basic_read_depths depths = fss_basic_read_depths_initialize; + fss_basic_read_depths_t depths = fss_basic_read_depths_t_initialize; - f_string_length counter = 0; - f_string_length original_size = data->quantity.total; + f_string_length_t counter = 0; + f_string_length_t original_size = data->quantity.total; status = fss_basic_read_main_preprocess_depth(arguments, *data, &depths); if (F_status_is_error(status)) { - macro_fss_basic_read_depths_delete_simple(depths); + macro_fss_basic_read_depths_t_delete_simple(depths); fss_basic_read_delete_data(data); return status; } // This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file. if (depths.array[0].depth > 0) { - macro_fss_basic_read_depths_delete_simple(depths); + macro_fss_basic_read_depths_t_delete_simple(depths); if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { fprintf(f_type_output, "0%c", f_string_eol[0]); @@ -261,13 +261,13 @@ extern "C" { fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number."); - macro_fss_basic_read_depths_delete_simple(depths); + macro_fss_basic_read_depths_t_delete_simple(depths); fss_basic_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->process_pipe) { - f_file file = f_file_initialize; + f_file_t file = f_file_t_initialize; file.id = f_type_descriptor_input; @@ -276,27 +276,27 @@ extern "C" { if (F_status_is_error(status)) { fss_basic_read_print_file_error(data->context, "f_file_read", "-", F_status_set_fine(status)); - macro_fss_basic_read_depths_delete_simple(depths); + macro_fss_basic_read_depths_t_delete_simple(depths); fss_basic_read_delete_data(data); return status; } status = fss_basic_read_main_process_file(arguments, data, "-", depths); if (F_status_is_error(status)) { - macro_fss_basic_read_depths_delete_simple(depths); + macro_fss_basic_read_depths_t_delete_simple(depths); fss_basic_read_delete_data(data); return status; } // Clear buffers before continuing. - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); } if (data->remaining.used > 0) { for (; counter < data->remaining.used; counter++) { - f_file file = f_file_initialize; + f_file_t file = f_file_t_initialize; status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file); @@ -305,7 +305,7 @@ extern "C" { if (F_status_is_error(status)) { fss_basic_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); - macro_fss_basic_read_depths_delete_simple(depths); + macro_fss_basic_read_depths_t_delete_simple(depths); fss_basic_read_delete_data(data); return status; } @@ -318,7 +318,7 @@ extern "C" { f_file_close(&file.id); - macro_fss_basic_read_depths_delete_simple(depths); + macro_fss_basic_read_depths_t_delete_simple(depths); fss_basic_read_delete_data(data); return status; } @@ -337,26 +337,26 @@ extern "C" { if (F_status_is_error(status)) { fss_basic_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); - macro_fss_basic_read_depths_delete_simple(depths); + macro_fss_basic_read_depths_t_delete_simple(depths); fss_basic_read_delete_data(data); return status; } status = fss_basic_read_main_process_file(arguments, data, arguments.argv[data->remaining.array[counter]], depths); if (F_status_is_error(status)) { - macro_fss_basic_read_depths_delete_simple(depths); + macro_fss_basic_read_depths_t_delete_simple(depths); fss_basic_read_delete_data(data); return status; } // Clear buffers before repeating the loop. - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); } // for } - macro_fss_basic_read_depths_delete_simple(depths); + macro_fss_basic_read_depths_t_delete_simple(depths); } else { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify one or more files."); @@ -369,22 +369,22 @@ extern "C" { #endif // _di_fss_basic_read_main_ #ifndef _di_fss_basic_read_delete_data_ - f_return_status fss_basic_read_delete_data(fss_basic_read_data *data) { - f_status status = F_none; - f_string_length i = 0; + f_return_status fss_basic_read_delete_data(fss_basic_read_data_t *data) { + f_status_t status = F_none; + f_string_length_t i = 0; while (i < fss_basic_read_total_parameters) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); i++; } // while - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); - f_macro_string_lengths_delete_simple(data->remaining); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); + f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_delete_simple(data->context); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_basic_read/c/fss_basic_read.h b/level_3/fss_basic_read/c/fss_basic_read.h index 01a52ff..b5a731c 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -7,7 +7,7 @@ * * This is the FSS Basic Read program * This program utilizes the Featureless Linux Library. - * This program processes files or other input in fss format and stores the results in the fss_basic_read_data. + * This program processes files or other input in fss format and stores the results in the fss_basic_read_data_t. * * This processes in accordance to the FSS-0000 Basic specification. */ @@ -99,53 +99,53 @@ extern "C" { fss_basic_read_parameter_trim, }; - #define f_console_parameter_initialize_fss_basic_read \ + #define fss_basic_read_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_basic_read_short_at, fss_basic_read_long_at, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_depth, fss_basic_read_long_depth, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_empty, fss_basic_read_long_empty, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_line, fss_basic_read_long_line, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_name, fss_basic_read_long_name, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_object, fss_basic_read_long_object, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_select, fss_basic_read_long_select, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_total, fss_basic_read_long_total, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_trim, fss_basic_read_long_trim, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(fss_basic_read_short_at, fss_basic_read_long_at, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_read_short_depth, fss_basic_read_long_depth, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_read_short_empty, fss_basic_read_long_empty, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_read_short_line, fss_basic_read_long_line, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_read_short_name, fss_basic_read_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_read_short_object, fss_basic_read_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_read_short_select, fss_basic_read_long_select, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_read_short_total, fss_basic_read_long_total, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_read_short_trim, fss_basic_read_long_trim, 0, F_false, f_console_type_normal), \ } #define fss_basic_read_total_parameters 14 #endif // _di_fss_basic_read_defines_ -#ifndef _di_fss_basic_read_data_ +#ifndef _di_fss_basic_read_data_t_ typedef struct { - f_console_parameter parameters[fss_basic_read_total_parameters]; + f_console_parameter_t parameters[fss_basic_read_total_parameters]; - f_string_dynamic buffer; - f_fss_objects objects; - f_fss_contents contents; - f_string_quantity quantity; - f_string_lengths remaining; + f_string_dynamic_t buffer; + f_fss_objects_t objects; + f_fss_contents_t contents; + f_string_quantity_t quantity; + f_string_lengths_t remaining; bool process_pipe; - fl_color_context context; - } fss_basic_read_data; + fl_color_context_t context; + } fss_basic_read_data_t; - #define fss_basic_read_data_initialize \ + #define fss_basic_read_data_t_initialize \ { \ - f_console_parameter_initialize_fss_basic_read, \ - f_string_dynamic_initialize, \ - f_fss_objects_initialize, \ - f_fss_contents_initialize, \ - f_string_quantity_initialize, \ - f_string_lengths_initialize, \ + fss_basic_read_console_parameter_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_fss_objects_t_initialize, \ + f_fss_contents_t_initialize, \ + f_string_quantity_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_fss_basic_read_data_ +#endif // _di_fss_basic_read_data_t_ /** * Print help to standard output. @@ -157,7 +157,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_read_print_help_ - extern f_return_status fss_basic_read_print_help(const fl_color_context context); + extern f_return_status fss_basic_read_print_help(const fl_color_context_t context); #endif // _di_fss_basic_read_print_help_ /** @@ -178,7 +178,7 @@ extern "C" { * @see fss_basic_read_delete_data() */ #ifndef _di_fss_basic_read_main_ - extern f_return_status fss_basic_read_main(const f_console_arguments arguments, fss_basic_read_data *data); + extern f_return_status fss_basic_read_main(const f_console_arguments_t arguments, fss_basic_read_data_t *data); #endif // _di_fss_basic_read_main_ /** @@ -197,7 +197,7 @@ extern "C" { * @see fss_basic_read_main() */ #ifndef _di_fss_basic_read_delete_data_ - extern f_return_status fss_basic_read_delete_data(fss_basic_read_data *data); + extern f_return_status fss_basic_read_delete_data(fss_basic_read_data_t *data); #endif // _di_fss_basic_read_delete_data_ #ifdef __cplusplus diff --git a/level_3/fss_basic_read/c/main.c b/level_3/fss_basic_read/c/main.c index 5447fa3..4fe0c7a 100644 --- a/level_3/fss_basic_read/c/main.c +++ b/level_3/fss_basic_read/c/main.c @@ -1,14 +1,14 @@ #include "fss_basic_read.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - fss_basic_read_data data = fss_basic_read_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + fss_basic_read_data_t data = fss_basic_read_data_t_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = fss_basic_read_main(arguments, &data); + f_status_t status = fss_basic_read_main(arguments, &data); if (F_status_is_error(status)) { return 1; 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 ac9bd6d..53e1cf0 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 @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_basic_read_print_file_error_ - void fss_basic_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { + void fss_basic_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); @@ -19,7 +19,7 @@ extern "C" { #endif // _di_fss_basic_read_print_file_error_ #ifndef _di_fss_basic_read_print_number_argument_error_ - void fss_basic_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) { + void fss_basic_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { if (status == F_parameter) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); @@ -83,17 +83,17 @@ extern "C" { #endif // _di_fss_basic_read_print_number_argument_error_ #ifndef _di_fss_basic_read_main_preprocess_depth_ - f_return_status fss_basic_read_main_preprocess_depth(const f_console_arguments arguments, const fss_basic_read_data data, fss_basic_read_depths *depths) { - f_status status = F_none; + f_return_status fss_basic_read_main_preprocess_depth(const f_console_arguments_t arguments, const fss_basic_read_data_t data, fss_basic_read_depths_t *depths) { + f_status_t status = F_none; { - f_array_length depth_size = 1; + f_array_length_t depth_size = 1; if (data.parameters[fss_basic_read_parameter_depth].result == f_console_result_additional) { depth_size = data.parameters[fss_basic_read_parameter_depth].additional.used; } - macro_fss_basic_read_depths_new(status, (*depths), depth_size); + macro_fss_basic_read_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); return status; @@ -102,17 +102,17 @@ extern "C" { depths->used = depth_size; } - f_array_length position_depth = 0; - f_array_length position_at = 0; - f_array_length position_name = 0; + f_array_length_t position_depth = 0; + f_array_length_t position_at = 0; + f_array_length_t position_name = 0; - for (f_array_length i = 0; i < depths->used; i++) { + for (f_array_length_t i = 0; i < depths->used; i++) { depths->array[i].depth = 0; depths->array[i].index_at = 0; depths->array[i].index_name = 0; depths->array[i].value_at = 0; - f_macro_string_dynamic_clear(depths->array[i].value_name); + f_macro_string_dynamic_t_clear(depths->array[i].value_name); if (data.parameters[fss_basic_read_parameter_depth].additional.used == 0) { position_depth = 0; @@ -120,7 +120,7 @@ extern "C" { else { position_depth = data.parameters[fss_basic_read_parameter_depth].additional.array[i]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[position_depth])); + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[position_depth])); status = fl_conversion_string_to_number_unsigned(arguments.argv[position_depth], &depths->array[i].depth, range); if (F_status_is_error(status)) { @@ -141,7 +141,7 @@ extern "C" { depths->array[i].index_at = data.parameters[fss_basic_read_parameter_at].additional.array[position_at]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[depths->array[i].index_at])); + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[depths->array[i].index_at])); status = fl_conversion_string_to_number_unsigned(arguments.argv[depths->array[i].index_at], &depths->array[i].value_at, range); if (F_status_is_error(status)) { @@ -171,19 +171,19 @@ extern "C" { } if (F_status_is_error(status)) { - f_status status_code = F_status_set_fine(status); + f_status_t status_code = F_status_set_fine(status); // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status_code == f_string_length_size) { + else if (status_code == f_string_length_t_size) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '"); fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached."); } else { - f_string function = "fl_string_append"; + f_string_t function = "fl_string_append"; if (data.parameters[fss_basic_read_parameter_trim].result == f_console_result_found) { function = "fl_string_rip"; @@ -210,8 +210,8 @@ extern "C" { } } // for - for (f_array_length i = 0; i < depths->used; i++) { - for (f_array_length j = i + 1; j < depths->used; j++) { + for (f_array_length_t i = 0; i < depths->used; i++) { + for (f_array_length_t j = i + 1; j < depths->used; j++) { if (depths->array[i].depth == depths->array[j].depth) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '"); fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); @@ -240,11 +240,11 @@ extern "C" { #endif // _di_fss_basic_read_main_preprocess_depth_ #ifndef _di_fss_basic_read_main_process_file_ - f_return_status fss_basic_read_main_process_file(const f_console_arguments arguments, fss_basic_read_data *data, const f_string filename, const fss_basic_read_depths depths) { - f_status status = F_none; + f_return_status fss_basic_read_main_process_file(const f_console_arguments_t arguments, fss_basic_read_data_t *data, const f_string_t filename, const fss_basic_read_depths_t depths) { + f_status_t status = F_none; { - f_string_range input = f_string_range_initialize; + f_string_range_t input = f_string_range_initialize; input.start = 0; input.stop = data->buffer.used - 1; @@ -288,19 +288,19 @@ extern "C" { } else if (status == F_data_not_stop || status == F_data_not_eos) { // Clear buffers, then attempt the next file. - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); return F_status_set_warning(status); } } - f_string_length select = 0; + f_string_length_t select = 0; if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_additional) { - const f_string_length index = data->parameters[fss_basic_read_parameter_select].additional.array[data->parameters[fss_basic_read_parameter_select].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[fss_basic_read_parameter_select].additional.array[data->parameters[fss_basic_read_parameter_select].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &select, range); if (F_status_is_error(status)) { @@ -314,11 +314,11 @@ extern "C" { } } - f_string_length line = 0; + f_string_length_t line = 0; if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) { - const f_string_length index = data->parameters[fss_basic_read_parameter_line].additional.array[data->parameters[fss_basic_read_parameter_line].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[fss_basic_read_parameter_line].additional.array[data->parameters[fss_basic_read_parameter_line].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &line, range); if (F_status_is_error(status)) { @@ -332,10 +332,10 @@ extern "C" { if (depths.array[0].index_name > 0) { memset(names, 0, sizeof(bool) * data->objects.used); - f_string_length name_length = 0; + f_string_length_t name_length = 0; if (data->parameters[fss_basic_read_parameter_trim].result == f_console_result_found) { - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { @@ -346,7 +346,7 @@ extern "C" { } // for } else { - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { @@ -378,9 +378,9 @@ extern "C" { } } else if (depths.array[0].index_name > 0) { - f_string_length total = 0; + f_string_length_t total = 0; - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { if (names[i] == 0) continue; total++; @@ -395,15 +395,15 @@ extern "C" { return F_none; } - f_return_status (*print_object)(FILE *, const f_string_static, const f_string_range) = &f_print_string_dynamic_partial; + f_return_status (*print_object)(FILE *, const f_string_static_t, const f_string_range_t) = &f_print_string_dynamic_partial; if (data->parameters[fss_basic_read_parameter_trim].result == f_console_result_found) { print_object = &fl_print_trim_string_dynamic_partial; } if (depths.array[0].index_at > 0) { - f_array_length at = 0; - f_array_length i = 0; + f_array_length_t at = 0; + f_array_length_t i = 0; for (; i < data->objects.used; i++) { if (names[i]) { @@ -420,7 +420,7 @@ extern "C" { return F_none; } - for (f_array_length i = 0; i < data->objects.used; i++) { + for (f_array_length_t i = 0; i < data->objects.used; i++) { if (names[i] == 0) continue; print_object(f_type_output, data->buffer, data->objects.array[i]); @@ -445,8 +445,8 @@ extern "C" { } } - f_array_length at = 0; - f_array_length i = 0; + f_array_length_t at = 0; + f_array_length_t i = 0; for (; i < data->objects.used; i++) { if (names[i]) { @@ -489,9 +489,9 @@ extern "C" { } if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { - f_string_length total = 0; + f_string_length_t total = 0; - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { if (!names[i]) { continue; } @@ -508,9 +508,9 @@ extern "C" { } if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) { - f_string_length line_current = 0; + f_string_length_t line_current = 0; - for (f_string_length i = 0; i < data->contents.used; i++) { + for (f_string_length_t i = 0; i < data->contents.used; i++) { if (!names[i]) { continue; } @@ -541,7 +541,7 @@ extern "C" { return F_none; } - for (f_string_length i = 0; i < data->contents.used; i++) { + for (f_string_length_t i = 0; i < data->contents.used; i++) { if (!names[i]) { continue; } 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 4c1bf4b..b19ea9e 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 @@ -23,39 +23,39 @@ extern "C" { * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. */ -#ifndef _di_fss_basic_read_depth_ +#ifndef _di_fss_basic_read_depth_t_ typedef struct { - f_string_length depth; + f_string_length_t depth; - f_array_length index_at; - f_array_length index_name; + f_array_length_t index_at; + f_array_length_t index_name; - f_number_unsigned value_at; - f_string_dynamic value_name; - } fss_basic_read_depth; + f_number_unsigned_t value_at; + f_string_dynamic_t value_name; + } fss_basic_read_depth_t; - #define fss_basic_read_depth_initialize \ + #define fss_basic_read_depth_t_initialize \ { \ 0, \ 0, \ 0, \ 0, \ - f_string_dynamic_initialize, \ + f_string_dynamic_t_initialize, \ } - #define macro_fss_basic_read_depth_clear(structure) \ + #define macro_fss_basic_read_depth_t_clear(structure) \ structure.depth = 0; \ structure.index_at = 0; \ structure.index_name = 0; \ structure.value_at = 0; \ - f_macro_string_dynamic_clear(structure.value_name) + f_macro_string_dynamic_t_clear(structure.value_name) - #define macro_fss_basic_read_depth_delete(status, structure) f_macro_string_dynamic_delete(status, structure.value_name) - #define macro_fss_basic_read_depth_destroy(status, structure) f_macro_string_dynamic_destroy(status, structure.value_name) + #define macro_fss_basic_read_depth_t_delete(status, structure) f_macro_string_dynamic_t_delete(status, structure.value_name) + #define macro_fss_basic_read_depth_t_destroy(status, structure) f_macro_string_dynamic_t_destroy(status, structure.value_name) - #define macro_fss_basic_read_depth_delete_simple(structure) f_macro_string_dynamic_delete_simple(structure.value_name) - #define macro_fss_basic_read_depth_destroy_simple(structure) f_macro_string_dynamic_destroy_simple(structure.value_name) -#endif // _di_fss_basic_read_depth_ + #define macro_fss_basic_read_depth_t_delete_simple(structure) f_macro_string_dynamic_t_delete_simple(structure.value_name) + #define macro_fss_basic_read_depth_t_destroy_simple(structure) f_macro_string_dynamic_t_destroy_simple(structure.value_name) +#endif // _di_fss_basic_read_depth_t_ /** * An array of depth parameters. @@ -64,98 +64,98 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_fss_basic_read_depths_ +#ifndef _di_fss_basic_read_depths_t_ typedef struct { - fss_basic_read_depth *array; + fss_basic_read_depth_t *array; - f_array_length size; - f_array_length used; - } fss_basic_read_depths; + f_array_length_t size; + f_array_length_t used; + } fss_basic_read_depths_t; - #define fss_basic_read_depths_initialize { 0, 0, 0 } + #define fss_basic_read_depths_t_initialize { 0, 0, 0 } - #define macro_fss_basic_read_depths_clear(depths) f_macro_memory_structure_clear(depths) + #define macro_fss_basic_read_depths_t_clear(depths) f_macro_memory_structure_t_clear(depths) - #define macro_fss_basic_read_depths_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_basic_read_depth, length) + #define macro_fss_basic_read_depths_t_new(status, depths, length) f_macro_memory_structure_t_new(status, depths, fss_basic_read_depth_t, length) - #define macro_fss_basic_read_depths_delete(status, depths) \ + #define macro_fss_basic_read_depths_t_delete(status, depths) \ status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_basic_read_depth_delete(status, depths.array[depths.used]); \ + macro_fss_basic_read_depth_t_delete(status, depths.array[depths.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) f_macro_memory_structure_delete(depths, fss_basic_read_depth) + if (status == F_none) f_macro_memory_structure_t_delete(depths, fss_basic_read_depth_t) - #define macro_fss_basic_read_depths_destroy(status, depths) \ + #define macro_fss_basic_read_depths_t_destroy(status, depths) \ status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_basic_read_depth_destroy(status, depths.array[depths.used]); \ + macro_fss_basic_read_depth_t_destroy(status, depths.array[depths.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) f_macro_memory_structure_destroy(depths, fss_basic_read_depth) + if (status == F_none) f_macro_memory_structure_t_destroy(depths, fss_basic_read_depth_t) - #define macro_fss_basic_read_depths_delete_simple(depths) \ + #define macro_fss_basic_read_depths_t_delete_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_basic_read_depth_delete_simple(depths.array[depths.used]); \ + macro_fss_basic_read_depth_t_delete_simple(depths.array[depths.used]); \ } \ - if (depths.used == 0) f_macro_memory_structure_delete_simple(depths, fss_basic_read_depth) + if (depths.used == 0) f_macro_memory_structure_t_delete_simple(depths, fss_basic_read_depth_t) - #define macro_fss_basic_read_depths_destroy_simple(depths) \ + #define macro_fss_basic_read_depths_t_destroy_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_basic_read_depth_destroy_simple(depths.array[depths.used]); \ + macro_fss_basic_read_depth_t_destroy_simple(depths.array[depths.used]); \ } \ - if (depths.used == 0) f_macro_memory_structure_destroy_simple(depths, fss_basic_read_depth) + if (depths.used == 0) f_macro_memory_structure_t_destroy_simple(depths, fss_basic_read_depth_t) - #define macro_fss_basic_read_depths_resize(status, depths, new_length) \ + #define macro_fss_basic_read_depths_t_resize(status, depths, new_length) \ status = F_none; \ if (new_length < depths.size) { \ - f_array_length i = depths.size - new_length; \ + f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - macro_fss_basic_read_depth_delete(status, depths.array[i]); \ + macro_fss_basic_read_depth_t_delete(status, depths.array[i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_read_depth), depths.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_read_depth_t), depths.size, new_length); \ if (status == F_none) { \ if (new_length > depths.size) { \ - f_array_length i = depths.size; \ + f_array_length_t i = depths.size; \ for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_basic_read_depth)); \ + memset(&depths.array[i], 0, sizeof(fss_basic_read_depth_t)); \ } \ } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } - #define macro_fss_basic_read_depths_adjust(status, depths, new_length) \ + #define macro_fss_basic_read_depths_t_adjust(status, depths, new_length) \ status = F_none; \ if (new_length < depths.size) { \ - f_array_length i = depths.size - new_length; \ + f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - macro_fss_basic_read_depth_delete(status, depths.array[i]); \ + macro_fss_basic_read_depth_t_delete(status, depths.array[i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_read_depth), depths.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_read_depth_t), depths.size, new_length); \ if (status == F_none) { \ if (new_length > depths.size) { \ - f_array_length i = depths.size; \ + f_array_length_t i = depths.size; \ for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_basic_read_depth)); \ + memset(&depths.array[i], 0, sizeof(fss_basic_read_depth_t)); \ } \ } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } -#endif // _di_fss_basic_read_depths_ +#endif // _di_fss_basic_read_depths_t_ /** * Print file error messages. @@ -170,7 +170,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_basic_read_print_file_error_ - extern void fss_basic_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) f_gcc_attribute_visibility_internal; + extern void fss_basic_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_read_print_file_error_ /** @@ -188,7 +188,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_basic_read_print_number_argument_error_ - extern void fss_basic_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) f_gcc_attribute_visibility_internal; + extern void fss_basic_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_read_print_number_argument_error_ /** @@ -208,7 +208,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fss_basic_read_main_preprocess_depth_ - extern f_return_status fss_basic_read_main_preprocess_depth(const f_console_arguments arguments, const fss_basic_read_data data, fss_basic_read_depths *depths) f_gcc_attribute_visibility_internal; + extern f_return_status fss_basic_read_main_preprocess_depth(const f_console_arguments_t arguments, const fss_basic_read_data_t data, fss_basic_read_depths_t *depths) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_read_main_preprocess_depth_ /** @@ -226,7 +226,7 @@ extern "C" { * @see fss_basic_read_main_preprocess_depth() */ #ifndef _di_fss_basic_read_main_process_file_ - extern f_return_status fss_basic_read_main_process_file(const f_console_arguments arguments, fss_basic_read_data *data, const f_string file_name, const fss_basic_read_depths depths) f_gcc_attribute_visibility_internal; + extern f_return_status fss_basic_read_main_process_file(const f_console_arguments_t arguments, fss_basic_read_data_t *data, const f_string_t file_name, const fss_basic_read_depths_t depths) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_read_main_process_file_ #ifdef __cplusplus 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 db92448..5236978 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fss_basic_write_print_help_ - f_return_status fss_basic_write_print_help(const fl_color_context context) { + f_return_status fss_basic_write_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, fss_basic_write_name_long, fss_basic_write_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -28,13 +28,13 @@ extern "C" { #endif // _di_fss_basic_write_print_help_ #ifndef _di_fss_basic_write_main_ - f_return_status fss_basic_write_main(const f_console_arguments arguments, fss_basic_write_data *data) { - f_status status = F_none; + f_return_status fss_basic_write_main(const f_console_arguments_t arguments, fss_basic_write_data *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, fss_basic_write_total_parameters }; - f_console_parameter_id ids[3] = { fss_basic_write_parameter_no_color, fss_basic_write_parameter_light, fss_basic_write_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, fss_basic_write_total_parameters }; + f_console_parameter_id_t ids[3] = { fss_basic_write_parameter_no_color, fss_basic_write_parameter_light, fss_basic_write_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); if (F_status_is_error(status)) { @@ -52,15 +52,15 @@ extern "C" { fll_program_print_version(fss_basic_write_version); } else { - f_array_length counter = 0; + f_array_length_t counter = 0; bool object = (data->parameters[fss_basic_write_parameter_object].result == f_console_result_found); - f_string_dynamic buffer = f_string_dynamic_initialize; - f_string_range range = f_string_range_initialize; + f_string_dynamic_t buffer = f_string_dynamic_t_initialize; + f_string_range_t range = f_string_range_initialize; if (data->process_pipe) { - f_file file = f_file_initialize; - f_string_dynamic input = f_string_dynamic_initialize; + f_file_t file = f_file_t_initialize; + f_string_dynamic_t input = f_string_dynamic_t_initialize; file.id = f_type_descriptor_input; @@ -85,7 +85,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(input); fss_basic_write_delete_data(data); return F_status_set_error(status); } @@ -98,8 +98,8 @@ extern "C" { status = fl_fss_basic_object_write(input, 0, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { - f_macro_string_dynamic_delete_simple(buffer); - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(input); fss_basic_write_delete_data(data); return F_status_set_error(status); } @@ -108,8 +108,8 @@ extern "C" { status = fl_fss_basic_content_write(input, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { - f_macro_string_dynamic_delete_simple(buffer); - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(input); fss_basic_write_delete_data(data); return F_status_set_error(status); } @@ -120,10 +120,10 @@ extern "C" { } } - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(input); } else if (data->parameters[fss_basic_write_parameter_string].result == f_console_result_additional) { - f_string_dynamic input = f_string_dynamic_initialize; + f_string_dynamic_t input = f_string_dynamic_t_initialize; input.string = arguments.argv[data->parameters[fss_basic_write_parameter_string].additional.array[0]]; input.used = strnlen(input.string, f_console_length_size); @@ -136,7 +136,7 @@ extern "C" { status = fl_fss_basic_object_write(input, 0, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_basic_write_delete_data(data); return F_status_set_error(status); } @@ -145,7 +145,7 @@ extern "C" { status = fl_fss_basic_content_write(input, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_basic_write_delete_data(data); return F_status_set_error(status); } @@ -160,7 +160,7 @@ extern "C" { } if (data->parameters[fss_basic_write_parameter_file].result == f_console_result_additional) { - f_file output = f_file_initialize; + f_file_t output = f_file_t_initialize; output.flag = f_file_flag_append_wo; @@ -187,7 +187,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_basic_write_delete_data(data); return status; } @@ -208,7 +208,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()", status); } - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_basic_write_delete_data(data); return F_status_set_error(status); } @@ -217,7 +217,7 @@ extern "C" { f_print_string_dynamic(f_type_output, buffer); } - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); } fss_basic_write_delete_data(data); @@ -227,15 +227,15 @@ extern "C" { #ifndef _di_fss_basic_write_delete_data_ f_return_status fss_basic_write_delete_data(fss_basic_write_data *data) { - f_status status = F_none; + f_status_t status = F_none; - for (f_string_length i = 0; i < fss_basic_write_total_parameters; i++) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + for (f_string_length_t i = 0; i < fss_basic_write_total_parameters; i++) { + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); } // for - f_macro_string_lengths_delete_simple(data->remaining); - fl_macro_color_context_delete_simple(data->context); + f_macro_string_lengths_t_delete_simple(data->remaining); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_basic_write/c/fss_basic_write.h b/level_3/fss_basic_write/c/fss_basic_write.h index b9f342a..d4d48c7 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.h +++ b/level_3/fss_basic_write/c/fss_basic_write.h @@ -75,17 +75,17 @@ extern "C" { fss_basic_write_parameter_string, }; - #define f_console_parameter_initialize_fss_basic_write \ + #define fss_basic_write_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_basic_write_short_file, fss_basic_write_long_file, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_write_short_object, fss_basic_write_long_object, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_write_short_partial, fss_basic_write_long_partial, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_write_short_string, fss_basic_write_long_string, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(fss_basic_write_short_file, fss_basic_write_long_file, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_write_short_object, fss_basic_write_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_write_short_partial, fss_basic_write_long_partial, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_basic_write_short_string, fss_basic_write_long_string, 0, F_true, f_console_type_normal), \ } #define fss_basic_write_total_parameters 9 @@ -93,20 +93,20 @@ extern "C" { #ifndef _di_fss_basic_write_data_ typedef struct { - f_console_parameter parameters[fss_basic_write_total_parameters]; + f_console_parameter_t parameters[fss_basic_write_total_parameters]; - f_string_lengths remaining; + f_string_lengths_t remaining; bool process_pipe; - fl_color_context context; + fl_color_context_t context; } fss_basic_write_data; #define fss_basic_write_data_initialize \ { \ - f_console_parameter_initialize_fss_basic_write, \ - f_string_lengths_initialize, \ + fss_basic_write_console_parameter_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_initialize, \ + fl_color_context_t_initialize, \ } #endif // _di_fss_basic_write_data_ @@ -120,7 +120,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_write_print_help_ - extern f_return_status fss_basic_write_print_help(const fl_color_context context); + extern f_return_status fss_basic_write_print_help(const fl_color_context_t context); #endif // _di_fss_basic_write_print_help_ /** @@ -140,7 +140,7 @@ extern "C" { * @see fss_basic_write_delete_data() */ #ifndef _di_fss_basic_write_main_ - extern f_return_status fss_basic_write_main(const f_console_arguments arguments, fss_basic_write_data *data); + extern f_return_status fss_basic_write_main(const f_console_arguments_t arguments, fss_basic_write_data *data); #endif // _di_fss_basic_write_main_ /** diff --git a/level_3/fss_basic_write/c/main.c b/level_3/fss_basic_write/c/main.c index 4c8ad53..2ecc391 100644 --- a/level_3/fss_basic_write/c/main.c +++ b/level_3/fss_basic_write/c/main.c @@ -1,10 +1,10 @@ #include "fss_basic_write.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; fss_basic_write_data data = fss_basic_write_data_initialize; - f_status status = fss_basic_write_main(arguments, &data); + f_status_t status = fss_basic_write_main(arguments, &data); if (F_status_is_error(status)) { return 1; diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.c b/level_3/fss_extended_list_read/c/fss_extended_list_read.c index b232893..f4028f3 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 @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_extended_list_read_print_help_ - f_return_status fss_extended_list_read_print_help(const fl_color_context context) { + f_return_status fss_extended_list_read_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, fss_extended_list_read_name_long, fss_extended_list_read_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -122,13 +122,13 @@ extern "C" { #endif // _di_fss_extended_list_read_print_help_ #ifndef _di_fss_extended_list_read_main_ - f_return_status fss_extended_list_read_main(const f_console_arguments arguments, fss_extended_list_read_data *data) { - f_status status = F_none; + f_return_status fss_extended_list_read_main(const f_console_arguments_t arguments, fss_extended_list_read_data_t *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, fss_extended_list_read_total_parameters }; - f_console_parameter_id ids[3] = { fss_extended_list_read_parameter_no_color, fss_extended_list_read_parameter_light, fss_extended_list_read_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, fss_extended_list_read_total_parameters }; + f_console_parameter_id_t ids[3] = { fss_extended_list_read_parameter_no_color, fss_extended_list_read_parameter_light, fss_extended_list_read_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); @@ -229,14 +229,14 @@ extern "C" { } } - fss_extended_list_read_depths depths = fss_extended_list_read_depths_initialize; + fss_extended_list_read_depths_t depths = fss_extended_list_read_depths_t_initialize; - f_string_length counter = 0; - f_string_length original_size = data->quantity.total; + f_string_length_t counter = 0; + f_string_length_t original_size = data->quantity.total; status = fss_extended_list_read_main_preprocess_depth(arguments, *data, &depths); if (F_status_is_error(status)) { - macro_fss_extended_list_read_depths_delete_simple(depths); + macro_fss_extended_list_read_depths_t_delete_simple(depths); fss_extended_list_read_delete_data(data); return status; } @@ -246,13 +246,13 @@ extern "C" { fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number."); - macro_fss_extended_list_read_depths_delete_simple(depths); + macro_fss_extended_list_read_depths_t_delete_simple(depths); fss_extended_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->process_pipe) { - f_file file = f_file_initialize; + f_file_t file = f_file_t_initialize; file.id = f_type_descriptor_input; @@ -260,26 +260,26 @@ extern "C" { if (F_status_is_error(status)) { fss_extended_list_read_print_file_error(data->context, "f_file_read", "-", F_status_set_fine(status)); - macro_fss_extended_list_read_depths_delete_simple(depths); + macro_fss_extended_list_read_depths_t_delete_simple(depths); fss_extended_list_read_delete_data(data); return status; } status = fss_extended_list_read_main_process_file(arguments, data, "-", depths); if (F_status_is_error(status)) { - macro_fss_extended_list_read_depths_delete_simple(depths); + macro_fss_extended_list_read_depths_t_delete_simple(depths); fss_extended_list_read_delete_data(data); return status; } // Clear buffers before continuing. - f_macro_fss_nest_delete_simple(data->nest); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_nest_t_delete_simple(data->nest); + f_macro_string_dynamic_t_delete_simple(data->buffer); } if (data->remaining.used > 0) { for (; counter < data->remaining.used; counter++) { - f_file file = f_file_initialize; + f_file_t file = f_file_t_initialize; status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file); @@ -288,7 +288,7 @@ extern "C" { if (F_status_is_error(status)) { fss_extended_list_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); - macro_fss_extended_list_read_depths_delete_simple(depths); + macro_fss_extended_list_read_depths_t_delete_simple(depths); fss_extended_list_read_delete_data(data); return status; } @@ -300,7 +300,7 @@ extern "C" { f_file_close(&file.id); - macro_fss_extended_list_read_depths_delete_simple(depths); + macro_fss_extended_list_read_depths_t_delete_simple(depths); fss_extended_list_read_delete_data(data); return status; } @@ -319,7 +319,7 @@ extern "C" { if (F_status_is_error(status)) { fss_extended_list_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); - macro_fss_extended_list_read_depths_delete_simple(depths); + macro_fss_extended_list_read_depths_t_delete_simple(depths); fss_extended_list_read_delete_data(data); return status; } @@ -327,18 +327,18 @@ extern "C" { status = fss_extended_list_read_main_process_file(arguments, data, arguments.argv[data->remaining.array[counter]], depths); if (F_status_is_error(status)) { - macro_fss_extended_list_read_depths_delete_simple(depths); + macro_fss_extended_list_read_depths_t_delete_simple(depths); fss_extended_list_read_delete_data(data); return status; } // Clear buffers before repeating the loop. - f_macro_fss_nest_delete_simple(data->nest); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_nest_t_delete_simple(data->nest); + f_macro_string_dynamic_t_delete_simple(data->buffer); } // for } - macro_fss_extended_list_read_depths_delete_simple(depths); + macro_fss_extended_list_read_depths_t_delete_simple(depths); } else { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify one or more files."); @@ -351,22 +351,22 @@ extern "C" { #endif // _di_fss_extended_list_read_main_ #ifndef _di_fss_extended_list_read_delete_data_ - f_return_status fss_extended_list_read_delete_data(fss_extended_list_read_data *data) { - f_status status = F_none; - f_string_length i = 0; + f_return_status fss_extended_list_read_delete_data(fss_extended_list_read_data_t *data) { + f_status_t status = F_none; + f_string_length_t i = 0; while (i < fss_extended_list_read_total_parameters) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); i++; } // while - f_macro_fss_nest_delete_simple(data->nest); + f_macro_fss_nest_t_delete_simple(data->nest); - f_macro_string_dynamic_delete_simple(data->buffer); - f_macro_string_lengths_delete_simple(data->remaining); + f_macro_string_dynamic_t_delete_simple(data->buffer); + f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_delete_simple(data->context); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.h b/level_3/fss_extended_list_read/c/fss_extended_list_read.h index ced955e..177dcb2 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.h @@ -7,7 +7,7 @@ * * This is the FSS Basic List Read program * This program utilizes the Featureless Linux Library. - * This program processes files or other input in fss format and stores the results in the fss_extended_list_read_data. + * This program processes files or other input in fss format and stores the results in the fss_extended_list_read_data_t. * * This processes in accordance to the FSS-0003 Extended List specification. */ @@ -99,51 +99,51 @@ extern "C" { fss_extended_list_read_parameter_trim, }; - #define f_console_parameter_initialize_fss_extended_list_read \ + #define fss_extended_list_read_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_extended_list_read_short_at, fss_extended_list_read_long_at, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_line, fss_extended_list_read_long_line, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_name, fss_extended_list_read_long_name, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_object, fss_extended_list_read_long_object, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_select, fss_extended_list_read_long_select, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_total, fss_extended_list_read_long_total, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(fss_extended_list_read_short_at, fss_extended_list_read_long_at, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_list_read_short_line, fss_extended_list_read_long_line, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_list_read_short_name, fss_extended_list_read_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_list_read_short_object, fss_extended_list_read_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_list_read_short_select, fss_extended_list_read_long_select, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_list_read_short_total, fss_extended_list_read_long_total, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, 0, F_false, f_console_type_normal), \ } #define fss_extended_list_read_total_parameters 14 #endif // _di_fss_extended_list_read_defines_ -#ifndef _di_fss_extended_list_read_data_ +#ifndef _di_fss_extended_list_read_data_t_ typedef struct { - f_console_parameter parameters[fss_extended_list_read_total_parameters]; + f_console_parameter_t parameters[fss_extended_list_read_total_parameters]; - f_string_dynamic buffer; - f_fss_nest nest; - f_string_quantity quantity; - f_string_lengths remaining; + f_string_dynamic_t buffer; + f_fss_nest_t nest; + f_string_quantity_t quantity; + f_string_lengths_t remaining; bool process_pipe; - fl_color_context context; - } fss_extended_list_read_data; + fl_color_context_t context; + } fss_extended_list_read_data_t; - #define fss_extended_list_read_data_initialize \ + #define fss_extended_list_read_data_t_initialize \ { \ - f_console_parameter_initialize_fss_extended_list_read, \ - f_string_dynamic_initialize, \ - f_fss_nest_initialize, \ - f_string_quantity_initialize, \ - f_string_lengths_initialize, \ + fss_extended_list_read_console_parameter_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_fss_nest_t_initialize, \ + f_string_quantity_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_fss_extended_list_read_data_ +#endif // _di_fss_extended_list_read_data_t_ /** * Print help to standard output. @@ -155,7 +155,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_list_read_print_help_ - extern f_return_status fss_extended_list_read_print_help(const fl_color_context context); + extern f_return_status fss_extended_list_read_print_help(const fl_color_context_t context); #endif // _di_fss_extended_list_read_print_help_ /** @@ -176,7 +176,7 @@ extern "C" { * @see fss_extended_list_read_delete_data() */ #ifndef _di_fss_extended_list_read_main_ - extern f_return_status fss_extended_list_read_main(const f_console_arguments arguments, fss_extended_list_read_data *data); + extern f_return_status fss_extended_list_read_main(const f_console_arguments_t arguments, fss_extended_list_read_data_t *data); #endif // _di_fss_extended_list_read_main_ /** @@ -195,7 +195,7 @@ extern "C" { * @see fss_extended_list_read_main() */ #ifndef _di_fss_extended_list_read_delete_data_ - extern f_return_status fss_extended_list_read_delete_data(fss_extended_list_read_data *data); + extern f_return_status fss_extended_list_read_delete_data(fss_extended_list_read_data_t *data); #endif // _di_fss_extended_list_read_delete_data_ #ifdef __cplusplus diff --git a/level_3/fss_extended_list_read/c/main.c b/level_3/fss_extended_list_read/c/main.c index 78ee769..07994ba 100644 --- a/level_3/fss_extended_list_read/c/main.c +++ b/level_3/fss_extended_list_read/c/main.c @@ -1,14 +1,14 @@ #include "fss_extended_list_read.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - fss_extended_list_read_data data = fss_extended_list_read_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + fss_extended_list_read_data_t data = fss_extended_list_read_data_t_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = fss_extended_list_read_main(arguments, &data); + f_status_t status = fss_extended_list_read_main(arguments, &data); if (F_status_is_error(status)) { return 1; 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 cd2cc4c..3d7858c 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 @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_extended_list_read_print_file_error_ - void fss_extended_list_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { + void fss_extended_list_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); @@ -19,7 +19,7 @@ extern "C" { #endif // _di_fss_extended_list_read_print_file_error_ #ifndef _di_fss_extended_list_read_print_number_argument_error_ - void fss_extended_list_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) { + void fss_extended_list_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { if (status == F_parameter) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); @@ -83,17 +83,17 @@ extern "C" { #endif // _di_fss_extended_list_read_print_number_argument_error_ #ifndef _di_fss_extended_list_read_main_preprocess_depth_ - f_return_status fss_extended_list_read_main_preprocess_depth(const f_console_arguments arguments, const fss_extended_list_read_data data, fss_extended_list_read_depths *depths) { - f_status status = F_none; + f_return_status fss_extended_list_read_main_preprocess_depth(const f_console_arguments_t arguments, const fss_extended_list_read_data_t data, fss_extended_list_read_depths_t *depths) { + f_status_t status = F_none; { - f_array_length depth_size = 1; + f_array_length_t depth_size = 1; if (data.parameters[fss_extended_list_read_parameter_depth].result == f_console_result_additional) { depth_size = data.parameters[fss_extended_list_read_parameter_depth].additional.used; } - macro_fss_extended_list_read_depths_new(status, (*depths), depth_size); + macro_fss_extended_list_read_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); return status; @@ -102,17 +102,17 @@ extern "C" { depths->used = depth_size; } - f_array_length position_depth = 0; - f_array_length position_at = 0; - f_array_length position_name = 0; + f_array_length_t position_depth = 0; + f_array_length_t position_at = 0; + f_array_length_t position_name = 0; - for (f_array_length i = 0; i < depths->used; i++) { + for (f_array_length_t i = 0; i < depths->used; i++) { depths->array[i].depth = 0; depths->array[i].index_at = 0; depths->array[i].index_name = 0; depths->array[i].value_at = 0; - f_macro_string_dynamic_clear(depths->array[i].value_name); + f_macro_string_dynamic_t_clear(depths->array[i].value_name); if (data.parameters[fss_extended_list_read_parameter_depth].additional.used == 0) { position_depth = 0; @@ -120,7 +120,7 @@ extern "C" { else { position_depth = data.parameters[fss_extended_list_read_parameter_depth].additional.array[i]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[position_depth])); + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[position_depth])); status = fl_conversion_string_to_number_unsigned(arguments.argv[position_depth], &depths->array[i].depth, range); if (F_status_is_error(status)) { @@ -141,7 +141,7 @@ extern "C" { depths->array[i].index_at = data.parameters[fss_extended_list_read_parameter_at].additional.array[position_at]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[depths->array[i].index_at])); + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[depths->array[i].index_at])); status = fl_conversion_string_to_number_unsigned(arguments.argv[depths->array[i].index_at], &depths->array[i].value_at, range); if (F_status_is_error(status)) { @@ -171,19 +171,19 @@ extern "C" { } if (F_status_is_error(status)) { - f_status status_code = F_status_set_fine(status); + f_status_t status_code = F_status_set_fine(status); // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status_code == f_string_length_size) { + else if (status_code == f_string_length_t_size) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '"); fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached."); } else { - f_string function = "fl_string_append"; + f_string_t function = "fl_string_append"; if (data.parameters[fss_extended_list_read_parameter_trim].result == f_console_result_found) { function = "fl_string_rip"; @@ -210,8 +210,8 @@ extern "C" { } } // for - for (f_array_length i = 0; i < depths->used; i++) { - for (f_array_length j = i + 1; j < depths->used; j++) { + for (f_array_length_t i = 0; i < depths->used; i++) { + for (f_array_length_t j = i + 1; j < depths->used; j++) { if (depths->array[i].depth == depths->array[j].depth) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '"); fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); @@ -240,11 +240,11 @@ extern "C" { #endif // _di_fss_extended_list_read_main_preprocess_depth_ #ifndef _di_fss_extended_list_read_main_process_file_ - f_return_status fss_extended_list_read_main_process_file(const f_console_arguments arguments, fss_extended_list_read_data *data, const f_string filename, const fss_extended_list_read_depths depths) { - f_status status = F_none; + f_return_status fss_extended_list_read_main_process_file(const f_console_arguments_t arguments, fss_extended_list_read_data_t *data, const f_string_t filename, const fss_extended_list_read_depths_t depths) { + f_status_t status = F_none; { - f_string_range input = f_string_range_initialize; + f_string_range_t input = f_string_range_initialize; input.start = 0; input.stop = data->buffer.used - 1; @@ -288,8 +288,8 @@ extern "C" { } else if (status == F_data_not_stop || status == F_data_not_eos) { // Clear buffers, then attempt the next file. - f_macro_fss_nest_delete_simple(data->nest); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_nest_t_delete_simple(data->nest); + f_macro_string_dynamic_t_delete_simple(data->buffer); return F_status_set_warning(status); } @@ -306,11 +306,11 @@ extern "C" { } { - f_string_length select = 0; + f_string_length_t select = 0; if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_additional) { - const f_string_length index = data->parameters[fss_extended_list_read_parameter_select].additional.array[data->parameters[fss_extended_list_read_parameter_select].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[fss_extended_list_read_parameter_select].additional.array[data->parameters[fss_extended_list_read_parameter_select].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &select, range); if (F_status_is_error(status)) { @@ -325,13 +325,13 @@ extern "C" { } } - f_string_length line = 0; + f_string_length_t line = 0; if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) { - const f_string_length index = data->parameters[fss_extended_list_read_parameter_line].additional.array[data->parameters[fss_extended_list_read_parameter_line].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[fss_extended_list_read_parameter_line].additional.array[data->parameters[fss_extended_list_read_parameter_line].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); - f_number_unsigned number = 0; + f_number_unsigned_t number = 0; status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range); if (F_status_is_error(status)) { @@ -351,27 +351,27 @@ extern "C" { #endif // _di_fss_extended_list_read_main_process_file_ #ifndef _di_fss_extended_list_read_main_process_for_depth_ - f_return_status fss_extended_list_read_main_process_for_depth(const f_console_arguments arguments, fss_extended_list_read_data *data, const f_string filename, const fss_extended_list_read_depth depth_setting, const f_string_length line) { - f_status status = F_none; + f_return_status fss_extended_list_read_main_process_for_depth(const f_console_arguments_t arguments, fss_extended_list_read_data_t *data, const f_string_t filename, const fss_extended_list_read_depth_t depth_setting, const f_string_length_t line) { + f_status_t status = F_none; - f_fss_items *items = &data->nest.depth[depth_setting.depth]; + f_fss_items_t *items = &data->nest.depth[depth_setting.depth]; bool names[items->used]; if (depth_setting.index_name > 0) { memset(names, 0, sizeof(bool) * items->used); - f_string_range value_range = f_string_range_initialize; + f_string_range_t value_range = f_string_range_initialize; value_range.stop = depth_setting.value_name.used - 1; if (data->parameters[fss_extended_list_read_parameter_trim].result == f_console_result_found) { - for (f_string_length i = 0; i < items->used; i++) { + for (f_string_length_t i = 0; i < items->used; i++) { if (fl_string_dynamic_partial_compare_trim(data->buffer, depth_setting.value_name, items->array[i].object, value_range) == F_equal_to) { names[i] = 1; } } // for } else { - for (f_string_length i = 0; i < items->used; i++) { + for (f_string_length_t i = 0; i < items->used; i++) { if (fl_string_dynamic_partial_compare(data->buffer, depth_setting.value_name, items->array[i].object, value_range) == F_equal_to) { names[i] = 1; } @@ -402,9 +402,9 @@ extern "C" { return F_none; } else if (depth_setting.index_name > 0) { - f_string_length total = 0; + f_string_length_t total = 0; - for (f_string_length i = 0; i < items->used; i++) { + for (f_string_length_t i = 0; i < items->used; i++) { if (names[i] == 0) continue; total++; @@ -420,7 +420,7 @@ extern "C" { return F_none; } - f_return_status (*print_object)(FILE *, const f_string_static, const f_string_range) = &f_print_string_dynamic_partial; + f_return_status (*print_object)(FILE *, const f_string_static_t, const f_string_range_t) = &f_print_string_dynamic_partial; if (data->parameters[fss_extended_list_read_parameter_trim].result == f_console_result_found) { print_object = &fl_print_trim_string_dynamic_partial; @@ -435,7 +435,7 @@ extern "C" { return F_none; } - for (f_array_length i = 0; i < items->used; i++) { + for (f_array_length_t i = 0; i < items->used; i++) { if (names[i]) { print_object(f_type_output, data->buffer, items->array[i].object); fprintf(f_type_output, "%c", f_string_eol[0]); @@ -454,8 +454,8 @@ extern "C" { return F_none; } - f_array_length at = 0; - f_array_length i = 0; + f_array_length_t at = 0; + f_array_length_t i = 0; for (; i < items->used; i++) { if (names[i]) { @@ -465,9 +465,9 @@ extern "C" { fprintf(f_type_output, "0%c", f_string_eol[0]); } else { - f_string_length total = 1; + f_string_length_t total = 1; - for (f_string_length j = items->array[i].content.array[0].start; j <= items->array[i].content.array[0].stop; j++) { + for (f_string_length_t j = items->array[i].content.array[0].start; j <= items->array[i].content.array[0].stop; j++) { if (data->buffer.string[j] == 0) continue; if (data->buffer.string[j] == f_string_eol[0]) { @@ -488,7 +488,7 @@ extern "C" { } } else { - f_string_length i = items->array[i].content.array[0].start; + f_string_length_t i = items->array[i].content.array[0].start; if (line == 0) { for (; i <= items->array[i].content.array[0].stop; i++) { @@ -502,7 +502,7 @@ extern "C" { } // for } else { - f_string_length line_current = 0; + f_string_length_t line_current = 0; for (; i <= items->array[i].content.array[0].stop; i++) { if (data->buffer.string[i] == 0) continue; @@ -551,9 +551,9 @@ extern "C" { } if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) { - f_string_length total = 0; + f_string_length_t total = 0; - for (f_string_length i = 0; i < items->used; i++) { + for (f_string_length_t i = 0; i < items->used; i++) { if (!names[i]) continue; if (items->array[i].content.used == 0) { @@ -564,7 +564,7 @@ extern "C" { continue; } - for (f_string_length j = items->array[i].content.array[0].start; j <= items->array[i].content.array[0].stop; j++) { + for (f_string_length_t j = items->array[i].content.array[0].start; j <= items->array[i].content.array[0].stop; j++) { if (data->buffer.string[j] == 0) continue; if (data->buffer.string[j] == f_string_eol[0]) { @@ -578,9 +578,9 @@ extern "C" { } if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) { - f_string_length line_current = 0; - f_string_length i = 0; - f_string_length j = 0; + f_string_length_t line_current = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; for (; i < items->used; i++) { if (!names[i]) { @@ -636,7 +636,7 @@ extern "C" { return F_none; } - for (f_string_length i = 0; i < items->used; i++) { + for (f_string_length_t i = 0; i < items->used; i++) { if (!names[i]) { continue; } 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 9a81b37..3809e1c 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 @@ -23,39 +23,39 @@ extern "C" { * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. */ -#ifndef _di_fss_extended_list_read_depth_ +#ifndef _di_fss_extended_list_read_depth_t_ typedef struct { - f_string_length depth; + f_string_length_t depth; - f_array_length index_at; - f_array_length index_name; + f_array_length_t index_at; + f_array_length_t index_name; - f_number_unsigned value_at; - f_string_dynamic value_name; - } fss_extended_list_read_depth; + f_number_unsigned_t value_at; + f_string_dynamic_t value_name; + } fss_extended_list_read_depth_t; - #define fss_extended_list_read_depth_initialize \ + #define fss_extended_list_read_depth_t_initialize \ { \ 0, \ 0, \ 0, \ 0, \ - f_string_dynamic_initialize, \ + f_string_dynamic_t_initialize, \ } - #define macro_fss_extended_list_read_depth_clear(structure) \ + #define macro_fss_extended_list_read_depth_t_clear(structure) \ structure.depth = 0; \ structure.index_at = 0; \ structure.index_name = 0; \ structure.value_at = 0; \ - f_macro_string_dynamic_clear(structure.value_name) + f_macro_string_dynamic_t_clear(structure.value_name) - #define macro_fss_extended_list_read_depth_delete(status, structure) f_macro_string_dynamic_delete(status, structure.value_name) - #define macro_fss_extended_list_read_depth_destroy(status, structure) f_macro_string_dynamic_destroy(status, structure.value_name) + #define macro_fss_extended_list_read_depth_t_delete(status, structure) f_macro_string_dynamic_t_delete(status, structure.value_name) + #define macro_fss_extended_list_read_depth_t_destroy(status, structure) f_macro_string_dynamic_t_destroy(status, structure.value_name) - #define macro_fss_extended_list_read_depth_delete_simple(structure) f_macro_string_dynamic_delete_simple(structure.value_name) - #define macro_fss_extended_list_read_depth_destroy_simple(structure) f_macro_string_dynamic_destroy_simple(structure.value_name) -#endif // _di_fss_extended_list_read_depth_ + #define macro_fss_extended_list_read_depth_t_delete_simple(structure) f_macro_string_dynamic_t_delete_simple(structure.value_name) + #define macro_fss_extended_list_read_depth_t_destroy_simple(structure) f_macro_string_dynamic_t_destroy_simple(structure.value_name) +#endif // _di_fss_extended_list_read_depth_t_ /** * An array of depth parameters. @@ -64,98 +64,98 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_fss_extended_list_read_depths_ +#ifndef _di_fss_extended_list_read_depths_t_ typedef struct { - fss_extended_list_read_depth *array; + fss_extended_list_read_depth_t *array; - f_array_length size; - f_array_length used; - } fss_extended_list_read_depths; + f_array_length_t size; + f_array_length_t used; + } fss_extended_list_read_depths_t; - #define fss_extended_list_read_depths_initialize { 0, 0, 0 } + #define fss_extended_list_read_depths_t_initialize { 0, 0, 0 } - #define macro_fss_extended_list_read_depths_clear(depths) f_macro_memory_structure_clear(depths) + #define macro_fss_extended_list_read_depths_t_clear(depths) f_macro_memory_structure_t_clear(depths) - #define macro_fss_extended_list_read_depths_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_extended_list_read_depth, length) + #define macro_fss_extended_list_read_depths_t_new(status, depths, length) f_macro_memory_structure_t_new(status, depths, fss_extended_list_read_depth_t, length) - #define macro_fss_extended_list_read_depths_delete(status, depths) \ + #define macro_fss_extended_list_read_depths_t_delete(status, depths) \ status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_extended_list_read_depth_delete(status, depths.array[depths.used]); \ + macro_fss_extended_list_read_depth_t_delete(status, depths.array[depths.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) f_macro_memory_structure_delete(depths, fss_extended_list_read_depth) + if (status == F_none) f_macro_memory_structure_t_delete(depths, fss_extended_list_read_depth_t) - #define macro_fss_extended_list_read_depths_destroy(status, depths) \ + #define macro_fss_extended_list_read_depths_t_destroy(status, depths) \ status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_extended_list_read_depth_destroy(status, depths.array[depths.used]); \ + macro_fss_extended_list_read_depth_t_destroy(status, depths.array[depths.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) f_macro_memory_structure_destroy(depths, fss_extended_list_read_depth) + if (status == F_none) f_macro_memory_structure_t_destroy(depths, fss_extended_list_read_depth_t) - #define macro_fss_extended_list_read_depths_delete_simple(depths) \ + #define macro_fss_extended_list_read_depths_t_delete_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_extended_list_read_depth_delete_simple(depths.array[depths.used]); \ + macro_fss_extended_list_read_depth_t_delete_simple(depths.array[depths.used]); \ } \ - if (depths.used == 0) f_macro_memory_structure_delete_simple(depths, fss_extended_list_read_depth) + if (depths.used == 0) f_macro_memory_structure_t_delete_simple(depths, fss_extended_list_read_depth_t) - #define macro_fss_extended_list_read_depths_destroy_simple(depths) \ + #define macro_fss_extended_list_read_depths_t_destroy_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_extended_list_read_depth_destroy_simple(depths.array[depths.used]); \ + macro_fss_extended_list_read_depth_t_destroy_simple(depths.array[depths.used]); \ } \ - if (depths.used == 0) f_macro_memory_structure_destroy_simple(depths, fss_extended_list_read_depth) + if (depths.used == 0) f_macro_memory_structure_t_destroy_simple(depths, fss_extended_list_read_depth_t) - #define macro_fss_extended_list_read_depths_resize(status, depths, new_length) \ + #define macro_fss_extended_list_read_t_depths_resize(status, depths, new_length) \ status = F_none; \ if (new_length < depths.size) { \ - f_array_length i = depths.size - new_length; \ + f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - macro_fss_extended_list_read_depth_delete(status, depths.array[i]); \ + macro_fss_extended_list_read_depth_t_delete(status, depths.array[i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_list_read_depth), depths.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_list_read_depth_t), depths.size, new_length); \ if (status == F_none) { \ if (new_length > depths.size) { \ - f_array_length i = depths.size; \ + f_array_length_t i = depths.size; \ for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_extended_list_read_depth)); \ + memset(&depths.array[i], 0, sizeof(fss_extended_list_read_depth_t)); \ } \ } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } - #define macro_fss_extended_list_read_depths_adjust(status, depths, new_length) \ + #define macro_fss_extended_list_read_depths_t_adjust(status, depths, new_length) \ status = F_none; \ if (new_length < depths.size) { \ - f_array_length i = depths.size - new_length; \ + f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - macro_fss_extended_list_read_depth_delete(status, depths.array[i]); \ + macro_fss_extended_list_read_depth_t_delete(status, depths.array[i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_list_read_depth), depths.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_list_read_depth_t), depths.size, new_length); \ if (status == F_none) { \ if (new_length > depths.size) { \ - f_array_length i = depths.size; \ + f_array_length_t i = depths.size; \ for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_extended_list_read_depth)); \ + memset(&depths.array[i], 0, sizeof(fss_extended_list_read_depth_t)); \ } \ } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } -#endif // _di_fss_extended_list_read_depths_ +#endif // _di_fss_extended_list_read_depths_t_ /** * Print file error messages. @@ -170,7 +170,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_extended_list_read_print_file_error_ - extern void fss_extended_list_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) f_gcc_attribute_visibility_internal; + extern void fss_extended_list_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_list_read_print_file_error_ /** @@ -188,7 +188,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_extended_list_read_print_number_argument_error_ - extern void fss_extended_list_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) f_gcc_attribute_visibility_internal; + extern void fss_extended_list_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_list_read_print_number_argument_error_ /** @@ -208,7 +208,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fss_extended_list_read_main_preprocess_depth_ - extern f_return_status fss_extended_list_read_main_preprocess_depth(const f_console_arguments arguments, const fss_extended_list_read_data data, fss_extended_list_read_depths *depths) f_gcc_attribute_visibility_internal; + extern f_return_status fss_extended_list_read_main_preprocess_depth(const f_console_arguments_t arguments, const fss_extended_list_read_data_t data, fss_extended_list_read_depths_t *depths) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_list_read_main_preprocess_depth_ /** @@ -227,7 +227,7 @@ extern "C" { * @see fss_extended_list_read_main_process_for_depth() */ #ifndef _di_fss_extended_list_read_main_process_file_ - extern f_return_status fss_extended_list_read_main_process_file(const f_console_arguments arguments, fss_extended_list_read_data *data, const f_string file_name, const fss_extended_list_read_depths depths) f_gcc_attribute_visibility_internal; + extern f_return_status fss_extended_list_read_main_process_file(const f_console_arguments_t arguments, fss_extended_list_read_data_t *data, const f_string_t file_name, const fss_extended_list_read_depths_t depths) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_list_read_main_process_file_ /** @@ -250,7 +250,7 @@ extern "C" { * @see fss_extended_list_read_main_process_file() */ #ifndef _di_fss_extended_list_read_main_process_for_depth_ - extern f_return_status fss_extended_list_read_main_process_for_depth(const f_console_arguments arguments, fss_extended_list_read_data *data, const f_string filename, const fss_extended_list_read_depth depth_setting, const f_string_length line) f_gcc_attribute_visibility_internal; + extern f_return_status fss_extended_list_read_main_process_for_depth(const f_console_arguments_t arguments, fss_extended_list_read_data_t *data, const f_string_t filename, const fss_extended_list_read_depth_t depth_setting, const f_string_length_t line) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_list_read_main_process_for_depth_ #ifdef __cplusplus 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 72dff02..bcba24f 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_extended_read_print_help_ - f_return_status fss_extended_read_print_help(const fl_color_context context) { + f_return_status fss_extended_read_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, fss_extended_read_name_long, fss_extended_read_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -122,13 +122,13 @@ extern "C" { #endif // _di_fss_extended_read_print_help_ #ifndef _di_fss_extended_read_main_ - f_return_status fss_extended_read_main(const f_console_arguments arguments, fss_extended_read_data *data) { - f_status status = F_none; + f_return_status fss_extended_read_main(const f_console_arguments_t arguments, fss_extended_read_data_t *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, fss_extended_read_total_parameters }; - f_console_parameter_id ids[3] = { fss_extended_read_parameter_no_color, fss_extended_read_parameter_light, fss_extended_read_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, fss_extended_read_total_parameters }; + f_console_parameter_id_t ids[3] = { fss_extended_read_parameter_no_color, fss_extended_read_parameter_light, fss_extended_read_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); @@ -229,21 +229,21 @@ extern "C" { } } - fss_extended_read_depths depths = fss_extended_read_depths_initialize; + fss_extended_read_depths_t depths = fss_extended_read_depths_t_initialize; - f_string_length counter = 0; - f_string_length original_size = data->quantity.total; + f_string_length_t counter = 0; + f_string_length_t original_size = data->quantity.total; status = fss_extended_read_main_preprocess_depth(arguments, *data, &depths); if (F_status_is_error(status)) { - macro_fss_extended_read_depths_delete_simple(depths); + macro_fss_extended_read_depths_t_delete_simple(depths); fss_extended_read_delete_data(data); return status; } // This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file. if (depths.array[0].depth > 0) { - macro_fss_extended_read_depths_delete_simple(depths); + macro_fss_extended_read_depths_t_delete_simple(depths); if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) { fprintf(f_type_output, "0%c", f_string_eol[0]); @@ -261,13 +261,13 @@ extern "C" { fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number."); - macro_fss_extended_read_depths_delete_simple(depths); + macro_fss_extended_read_depths_t_delete_simple(depths); fss_extended_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->process_pipe) { - f_file file = f_file_initialize; + f_file_t file = f_file_t_initialize; file.id = f_type_descriptor_input; @@ -275,27 +275,27 @@ extern "C" { if (F_status_is_error(status)) { fss_extended_read_print_file_error(data->context, "f_file_read", "-", F_status_set_fine(status)); - macro_fss_extended_read_depths_delete_simple(depths); + macro_fss_extended_read_depths_t_delete_simple(depths); fss_extended_read_delete_data(data); return status; } status = fss_extended_read_main_process_file(arguments, data, "-", depths); if (F_status_is_error(status)) { - macro_fss_extended_read_depths_delete_simple(depths); + macro_fss_extended_read_depths_t_delete_simple(depths); fss_extended_read_delete_data(data); return status; } // Clear buffers before continuing. - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); } if (data->remaining.used > 0) { for (; counter < data->remaining.used; counter++) { - f_file file = f_file_initialize; + f_file_t file = f_file_t_initialize; status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file); @@ -304,7 +304,7 @@ extern "C" { if (F_status_is_error(status)) { fss_extended_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); - macro_fss_extended_read_depths_delete_simple(depths); + macro_fss_extended_read_depths_t_delete_simple(depths); fss_extended_read_delete_data(data); return status; } @@ -317,7 +317,7 @@ extern "C" { f_file_close(&file.id); - macro_fss_extended_read_depths_delete_simple(depths); + macro_fss_extended_read_depths_t_delete_simple(depths); fss_extended_read_delete_data(data); return status; } @@ -336,26 +336,26 @@ extern "C" { if (F_status_is_error(status)) { fss_extended_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); - macro_fss_extended_read_depths_delete_simple(depths); + macro_fss_extended_read_depths_t_delete_simple(depths); fss_extended_read_delete_data(data); return status; } status = fss_extended_read_main_process_file(arguments, data, arguments.argv[data->remaining.array[counter]], depths); if (F_status_is_error(status)) { - macro_fss_extended_read_depths_delete_simple(depths); + macro_fss_extended_read_depths_t_delete_simple(depths); fss_extended_read_delete_data(data); return status; } // Clear buffers before repeating the loop. - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); } // for } - macro_fss_extended_read_depths_delete_simple(depths); + macro_fss_extended_read_depths_t_delete_simple(depths); } else { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify one or more files."); @@ -368,22 +368,22 @@ extern "C" { #endif // _di_fss_extended_read_main_ #ifndef _di_fss_extended_read_delete_data_ - f_return_status fss_extended_read_delete_data(fss_extended_read_data *data) { - f_status status = F_none; - f_string_length i = 0; + f_return_status fss_extended_read_delete_data(fss_extended_read_data_t *data) { + f_status_t status = F_none; + f_string_length_t i = 0; while (i < fss_extended_read_total_parameters) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); i++; } // while - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); - f_macro_string_lengths_delete_simple(data->remaining); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); + f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_delete_simple(data->context); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_extended_read/c/fss_extended_read.h b/level_3/fss_extended_read/c/fss_extended_read.h index 15a99d3..104e0d5 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -7,7 +7,7 @@ * * This is the FSS Basic Read program * This program utilizes the Featureless Linux Library. - * This program processes files or other input in fss format and stores the results in the fss_extended_read_data. + * This program processes files or other input in fss format and stores the results in the fss_extended_read_data_t. * * This processes in accordance to the FSS-0001 Extended specification. */ @@ -99,53 +99,53 @@ extern "C" { fss_extended_read_parameter_trim, }; - #define f_console_parameter_initialize_fss_extended_read \ + #define fss_extended_read_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_extended_read_short_at, fss_extended_read_long_at, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_depth, fss_extended_read_long_depth, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_empty, fss_extended_read_long_empty, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_line, fss_extended_read_long_line, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_name, fss_extended_read_long_name, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_object, fss_extended_read_long_object, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_select, fss_extended_read_long_select, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_total, fss_extended_read_long_total, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_trim, fss_extended_read_long_trim, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(fss_extended_read_short_at, fss_extended_read_long_at, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_read_short_depth, fss_extended_read_long_depth, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_read_short_empty, fss_extended_read_long_empty, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_read_short_line, fss_extended_read_long_line, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_read_short_name, fss_extended_read_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_read_short_object, fss_extended_read_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_read_short_select, fss_extended_read_long_select, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_read_short_total, fss_extended_read_long_total, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_read_short_trim, fss_extended_read_long_trim, 0, F_false, f_console_type_normal), \ } #define fss_extended_read_total_parameters 14 #endif // _di_fss_extended_read_defines_ -#ifndef _di_fss_extended_read_data_ +#ifndef _di_fss_extended_read_data_t_ typedef struct { - f_console_parameter parameters[fss_extended_read_total_parameters]; + f_console_parameter_t parameters[fss_extended_read_total_parameters]; - f_string_dynamic buffer; - f_fss_objects objects; - f_fss_contents contents; - f_string_quantity quantity; - f_string_lengths remaining; + f_string_dynamic_t buffer; + f_fss_objects_t objects; + f_fss_contents_t contents; + f_string_quantity_t quantity; + f_string_lengths_t remaining; bool process_pipe; - fl_color_context context; - } fss_extended_read_data; + fl_color_context_t context; + } fss_extended_read_data_t; #define fss_extended_read_data_initialize \ { \ - f_console_parameter_initialize_fss_extended_read, \ - f_string_dynamic_initialize, \ - f_fss_objects_initialize, \ - f_fss_contents_initialize, \ - f_string_quantity_initialize, \ - f_string_lengths_initialize, \ + fss_extended_read_console_parameter_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_fss_objects_t_initialize, \ + f_fss_contents_t_initialize, \ + f_string_quantity_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_fss_extended_read_data_ +#endif // _di_fss_extended_read_data_t_ /** * Print help to standard output. @@ -157,7 +157,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_read_print_help_ - extern f_return_status fss_extended_read_print_help(const fl_color_context context); + extern f_return_status fss_extended_read_print_help(const fl_color_context_t context); #endif // _di_fss_extended_read_print_help_ /** @@ -178,7 +178,7 @@ extern "C" { * @see fss_extended_read_delete_data() */ #ifndef _di_fss_extended_read_main_ - extern f_return_status fss_extended_read_main(const f_console_arguments arguments, fss_extended_read_data *data); + extern f_return_status fss_extended_read_main(const f_console_arguments_t arguments, fss_extended_read_data_t *data); #endif // _di_fss_extended_read_main_ /** @@ -197,7 +197,7 @@ extern "C" { * @see fss_extended_read_main() */ #ifndef _di_fss_extended_read_delete_data_ - extern f_return_status fss_extended_read_delete_data(fss_extended_read_data *data); + extern f_return_status fss_extended_read_delete_data(fss_extended_read_data_t *data); #endif // _di_fss_extended_read_delete_data_ #ifdef __cplusplus diff --git a/level_3/fss_extended_read/c/main.c b/level_3/fss_extended_read/c/main.c index ca6d7f4..4846123 100644 --- a/level_3/fss_extended_read/c/main.c +++ b/level_3/fss_extended_read/c/main.c @@ -1,14 +1,14 @@ #include "fss_extended_read.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - fss_extended_read_data data = fss_extended_read_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + fss_extended_read_data_t data = fss_extended_read_data_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = fss_extended_read_main(arguments, &data); + f_status_t status = fss_extended_read_main(arguments, &data); if (F_status_is_error(status)) { return 1; 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 9fc94ec..cdc4e3d 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 @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_extended_read_print_file_error_ - void fss_extended_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { + void fss_extended_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); @@ -19,7 +19,7 @@ extern "C" { #endif // _di_fss_extended_read_print_file_error_ #ifndef _di_fss_extended_read_print_number_argument_error_ - void fss_extended_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) { + void fss_extended_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { if (status == F_parameter) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); @@ -83,17 +83,17 @@ extern "C" { #endif // _di_fss_extended_read_print_number_argument_error_ #ifndef _di_fss_extended_read_main_preprocess_depth_ - f_return_status fss_extended_read_main_preprocess_depth(const f_console_arguments arguments, const fss_extended_read_data data, fss_extended_read_depths *depths) { - f_status status = F_none; + f_return_status fss_extended_read_main_preprocess_depth(const f_console_arguments_t arguments, const fss_extended_read_data_t data, fss_extended_read_depths_t *depths) { + f_status_t status = F_none; { - f_array_length depth_size = 1; + f_array_length_t depth_size = 1; if (data.parameters[fss_extended_read_parameter_depth].result == f_console_result_additional) { depth_size = data.parameters[fss_extended_read_parameter_depth].additional.used; } - macro_fss_extended_read_depths_new(status, (*depths), depth_size); + macro_fss_extended_read_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); return status; @@ -102,17 +102,17 @@ extern "C" { depths->used = depth_size; } - f_array_length position_depth = 0; - f_array_length position_at = 0; - f_array_length position_name = 0; + f_array_length_t position_depth = 0; + f_array_length_t position_at = 0; + f_array_length_t position_name = 0; - for (f_array_length i = 0; i < depths->used; i++) { + for (f_array_length_t i = 0; i < depths->used; i++) { depths->array[i].depth = 0; depths->array[i].index_at = 0; depths->array[i].index_name = 0; depths->array[i].value_at = 0; - f_macro_string_dynamic_clear(depths->array[i].value_name); + f_macro_string_dynamic_t_clear(depths->array[i].value_name); if (data.parameters[fss_extended_read_parameter_depth].additional.used == 0) { position_depth = 0; @@ -120,7 +120,7 @@ extern "C" { else { position_depth = data.parameters[fss_extended_read_parameter_depth].additional.array[i]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[position_depth])); + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[position_depth])); status = fl_conversion_string_to_number_unsigned(arguments.argv[position_depth], &depths->array[i].depth, range); if (F_status_is_error(status)) { @@ -141,7 +141,7 @@ extern "C" { depths->array[i].index_at = data.parameters[fss_extended_read_parameter_at].additional.array[position_at]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[depths->array[i].index_at])); + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[depths->array[i].index_at])); status = fl_conversion_string_to_number_unsigned(arguments.argv[depths->array[i].index_at], &depths->array[i].value_at, range); if (F_status_is_error(status)) { @@ -171,19 +171,19 @@ extern "C" { } if (F_status_is_error(status)) { - f_status status_code = F_status_set_fine(status); + f_status_t status_code = F_status_set_fine(status); // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status_code == f_string_length_size) { + else if (status_code == f_string_length_t_size) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '"); fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached."); } else { - f_string function = "fl_string_append"; + f_string_t function = "fl_string_append"; if (data.parameters[fss_extended_read_parameter_trim].result == f_console_result_found) { function = "fl_string_rip"; @@ -210,8 +210,8 @@ extern "C" { } } // for - for (f_array_length i = 0; i < depths->used; i++) { - for (f_array_length j = i + 1; j < depths->used; j++) { + for (f_array_length_t i = 0; i < depths->used; i++) { + for (f_array_length_t j = i + 1; j < depths->used; j++) { if (depths->array[i].depth == depths->array[j].depth) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '"); fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); @@ -240,11 +240,11 @@ extern "C" { #endif // _di_fss_extended_read_main_preprocess_depth_ #ifndef _di_fss_extended_read_main_process_file_ - f_return_status fss_extended_read_main_process_file(const f_console_arguments arguments, fss_extended_read_data *data, const f_string filename, const fss_extended_read_depths depths) { - f_status status = F_none; + f_return_status fss_extended_read_main_process_file(const f_console_arguments_t arguments, fss_extended_read_data_t *data, const f_string_t filename, const fss_extended_read_depths_t depths) { + f_status_t status = F_none; { - f_string_range input = f_string_range_initialize; + f_string_range_t input = f_string_range_initialize; input.start = 0; input.stop = data->buffer.used - 1; @@ -288,19 +288,19 @@ extern "C" { } else if (status == F_data_not_stop || status == F_data_not_eos) { // Clear buffers, then attempt the next file. - f_macro_fss_contents_delete_simple(data->contents); - f_macro_fss_objects_delete_simple(data->objects); - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_fss_contents_t_delete_simple(data->contents); + f_macro_fss_objects_t_delete_simple(data->objects); + f_macro_string_dynamic_t_delete_simple(data->buffer); return F_status_set_warning(status); } } - f_string_length select = 0; + f_string_length_t select = 0; if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) { - const f_string_length index = data->parameters[fss_extended_read_parameter_select].additional.array[data->parameters[fss_extended_read_parameter_select].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[fss_extended_read_parameter_select].additional.array[data->parameters[fss_extended_read_parameter_select].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &select, range); if (F_status_is_error(status)) { @@ -309,11 +309,11 @@ extern "C" { } } - f_string_length line = 0; + f_string_length_t line = 0; if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) { - const f_string_length index = data->parameters[fss_extended_read_parameter_line].additional.array[data->parameters[fss_extended_read_parameter_line].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[fss_extended_read_parameter_line].additional.array[data->parameters[fss_extended_read_parameter_line].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &line, range); if (F_status_is_error(status)) { @@ -327,10 +327,10 @@ extern "C" { if (depths.array[0].index_name > 0) { memset(names, 0, sizeof(bool) * data->objects.used); - f_string_length name_length = 0; + f_string_length_t name_length = 0; if (data->parameters[fss_extended_read_parameter_trim].result == f_console_result_found) { - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { @@ -341,7 +341,7 @@ extern "C" { } // for } else { - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { @@ -373,9 +373,9 @@ extern "C" { } } else if (depths.array[0].index_name > 0) { - f_string_length total = 0; + f_string_length_t total = 0; - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { if (names[i] == 0) continue; total++; @@ -390,15 +390,15 @@ extern "C" { return F_none; } - f_return_status (*print_object)(FILE *, const f_string_static, const f_string_range) = &f_print_string_dynamic_partial; + f_return_status (*print_object)(FILE *, const f_string_static_t, const f_string_range_t) = &f_print_string_dynamic_partial; if (data->parameters[fss_extended_read_parameter_trim].result == f_console_result_found) { print_object = &fl_print_trim_string_dynamic_partial; } if (depths.array[0].index_at > 0) { - f_array_length at = 0; - f_array_length i = 0; + f_array_length_t at = 0; + f_array_length_t i = 0; for (; i < data->objects.used; i++) { if (names[i]) { @@ -415,7 +415,7 @@ extern "C" { return F_none; } - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { if (names[i] == 0) continue; print_object(f_type_output, data->buffer, data->objects.array[i]); @@ -434,8 +434,8 @@ extern "C" { return F_none; } - f_array_length at = 0; - f_array_length i = 0; + f_array_length_t at = 0; + f_array_length_t i = 0; for (; i < data->objects.used; i++) { if (names[i]) { @@ -454,7 +454,7 @@ extern "C" { if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) { if (line == 0) { if (data->contents.array[i].used > 0) { - f_string_length j = 0; + f_string_length_t j = 0; if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) { if (select < data->contents.array[i].used) { @@ -490,7 +490,7 @@ extern "C" { } if (data->contents.array[i].used > 0) { - f_string_length j = 0; + f_string_length_t j = 0; if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) { if (select < data->contents.array[i].used) { @@ -532,9 +532,9 @@ extern "C" { } if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) { - f_string_length total = 0; + f_string_length_t total = 0; - for (f_string_length i = 0; i < data->objects.used; i++) { + for (f_string_length_t i = 0; i < data->objects.used; i++) { if (!names[i]) { continue; } @@ -551,9 +551,9 @@ extern "C" { } if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) { - f_string_length line_current = 0; - f_string_length i = 0; - f_string_length j = 0; + f_string_length_t line_current = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; for (; i < data->contents.used; i++) { if (!names[i]) { @@ -601,8 +601,8 @@ extern "C" { return F_none; } - f_string_length i = 0; - f_string_length j = 0; + f_string_length_t i = 0; + f_string_length_t j = 0; for (; i < data->contents.used; i++) { if (!names[i]) { 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 4e954c6..e3e721b 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 @@ -23,39 +23,39 @@ extern "C" { * value_at: the value of the "--at" parameter, already processed and ready to use, only when index_at > 0. * value_name: the value of the "--name" parameter, already processed and ready to use, only when index_name > 0. */ -#ifndef _di_fss_extended_read_depth_ +#ifndef _di_fss_extended_read_depth_t_ typedef struct { - f_string_length depth; + f_string_length_t depth; - f_array_length index_at; - f_array_length index_name; + f_array_length_t index_at; + f_array_length_t index_name; - f_number_unsigned value_at; - f_string_dynamic value_name; - } fss_extended_read_depth; + f_number_unsigned_t value_at; + f_string_dynamic_t value_name; + } fss_extended_read_depth_t; - #define fss_extended_read_depth_initialize \ + #define fss_extended_read_depth_t_initialize \ { \ 0, \ 0, \ 0, \ 0, \ - f_string_dynamic_initialize, \ + f_string_dynamic_t_initialize, \ } - #define macro_fss_extended_read_depth_clear(structure) \ + #define macro_fss_extended_read_depth_t_clear(structure) \ structure.depth = 0; \ structure.index_at = 0; \ structure.index_name = 0; \ structure.value_at = 0; \ - f_macro_string_dynamic_clear(structure.value_name) + f_macro_string_dynamic_t_clear(structure.value_name) - #define macro_fss_extended_read_depth_delete(status, structure) f_macro_string_dynamic_delete(status, structure.value_name) - #define macro_fss_extended_read_depth_destroy(status, structure) f_macro_string_dynamic_destroy(status, structure.value_name) + #define macro_fss_extended_read_depth_t_delete(status, structure) f_macro_string_dynamic_t_delete(status, structure.value_name) + #define macro_fss_extended_read_depth_t_destroy(status, structure) f_macro_string_dynamic_t_destroy(status, structure.value_name) - #define macro_fss_extended_read_depth_delete_simple(structure) f_macro_string_dynamic_delete_simple(structure.value_name) - #define macro_fss_extended_read_depth_destroy_simple(structure) f_macro_string_dynamic_destroy_simple(structure.value_name) -#endif // _di_fss_extended_read_depth_ + #define macro_fss_extended_read_depth_t_delete_simple(structure) f_macro_string_dynamic_t_delete_simple(structure.value_name) + #define macro_fss_extended_read_depth_t_destroy_simple(structure) f_macro_string_dynamic_t_destroy_simple(structure.value_name) +#endif // _di_fss_extended_read_depth_t_ /** * An array of depth parameters. @@ -64,98 +64,98 @@ extern "C" { * size: total amount of allocated space. * used: total number of allocated spaces used. */ -#ifndef _di_fss_extended_read_depths_ +#ifndef _di_fss_extended_read_depths_t_ typedef struct { - fss_extended_read_depth *array; + fss_extended_read_depth_t *array; - f_array_length size; - f_array_length used; - } fss_extended_read_depths; + f_array_length_t size; + f_array_length_t used; + } fss_extended_read_depths_t; - #define fss_extended_read_depths_initialize { 0, 0, 0 } + #define fss_extended_read_depths_t_initialize { 0, 0, 0 } - #define macro_fss_extended_read_depths_clear(depths) f_macro_memory_structure_clear(depths) + #define macro_fss_extended_read_depths_t_clear(depths) f_macro_memory_structure_t_clear(depths) - #define macro_fss_extended_read_depths_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_extended_read_depth, length) + #define macro_fss_extended_read_depths_t_new(status, depths, length) f_macro_memory_structure_t_new(status, depths, fss_extended_read_depth_t, length) - #define macro_fss_extended_read_depths_delete(status, depths) \ + #define macro_fss_extended_read_depths_t_delete(status, depths) \ status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_extended_read_depth_delete(status, depths.array[depths.used]); \ + macro_fss_extended_read_depth_t_delete(status, depths.array[depths.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) f_macro_memory_structure_delete(depths, fss_extended_read_depth) + if (status == F_none) f_macro_memory_structure_t_delete(depths, fss_extended_read_depth_t) - #define macro_fss_extended_read_depths_destroy(status, depths) \ + #define macro_fss_extended_read_depths_t_destroy(status, depths) \ status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_extended_read_depth_destroy(status, depths.array[depths.used]); \ + macro_fss_extended_read_depth_t_destroy(status, depths.array[depths.used]); \ if (status != F_none) break; \ } \ - if (status == F_none) f_macro_memory_structure_destroy(depths, fss_extended_read_depth) + if (status == F_none) f_macro_memory_structure_t_destroy(depths, fss_extended_read_depth_t) - #define macro_fss_extended_read_depths_delete_simple(depths) \ + #define macro_fss_extended_read_depths_t_delete_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_extended_read_depth_delete_simple(depths.array[depths.used]); \ + macro_fss_extended_read_depth_t_delete_simple(depths.array[depths.used]); \ } \ - if (depths.used == 0) f_macro_memory_structure_delete_simple(depths, fss_extended_read_depth) + if (depths.used == 0) f_macro_memory_structure_t_delete_simple(depths, fss_extended_read_depth_t) - #define macro_fss_extended_read_depths_destroy_simple(depths) \ + #define macro_fss_extended_read_depths_t_destroy_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ - macro_fss_extended_read_depth_destroy_simple(depths.array[depths.used]); \ + macro_fss_extended_read_depth_t_destroy_simple(depths.array[depths.used]); \ } \ - if (depths.used == 0) f_macro_memory_structure_destroy_simple(depths, fss_extended_read_depth) + if (depths.used == 0) f_macro_memory_structure_t_destroy_simple(depths, fss_extended_read_depth_t) - #define macro_fss_extended_read_depths_resize(status, depths, new_length) \ + #define macro_fss_extended_read_depths_t_resize(status, depths, new_length) \ status = F_none; \ if (new_length < depths.size) { \ - f_array_length i = depths.size - new_length; \ + f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - macro_fss_extended_read_depth_delete(status, depths.array[i]); \ + macro_fss_extended_read_depth_t_delete(status, depths.array[i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_read_depth), depths.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_read_depth_t), depths.size, new_length); \ if (status == F_none) { \ if (new_length > depths.size) { \ - f_array_length i = depths.size; \ + f_array_length_t i = depths.size; \ for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_extended_read_depth)); \ + memset(&depths.array[i], 0, sizeof(fss_extended_read_depth_t)); \ } \ } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } - #define macro_fss_extended_read_depths_adjust(status, depths, new_length) \ + #define macro_fss_extended_read_depths_t_adjust(status, depths, new_length) \ status = F_none; \ if (new_length < depths.size) { \ - f_array_length i = depths.size - new_length; \ + f_array_length_t i = depths.size - new_length; \ for (; i < depths.size; i++) { \ - macro_fss_extended_read_depth_delete(status, depths.array[i]); \ + macro_fss_extended_read_depth_t_delete(status, depths.array[i]); \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_read_depth), depths.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_read_depth_t), depths.size, new_length); \ if (status == F_none) { \ if (new_length > depths.size) { \ - f_array_length i = depths.size; \ + f_array_length_t i = depths.size; \ for (; i < new_length; i++) { \ - memset(&depths.array[i], 0, sizeof(fss_extended_read_depth)); \ + memset(&depths.array[i], 0, sizeof(fss_extended_read_depth_t)); \ } \ } \ depths.size = new_length; \ if (depths.used > depths.size) depths.used = new_length; \ } -#endif // _di_fss_extended_read_depths_ +#endif // _di_fss_extended_read_depths_t_ /** * Print file error messages. @@ -170,7 +170,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_extended_read_print_file_error_ - extern void fss_extended_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) f_gcc_attribute_visibility_internal; + extern void fss_extended_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_read_print_file_error_ /** @@ -188,7 +188,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_extended_read_print_number_argument_error_ - extern void fss_extended_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) f_gcc_attribute_visibility_internal; + extern void fss_extended_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_read_print_number_argument_error_ /** @@ -208,7 +208,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fss_extended_read_main_preprocess_depth_ - extern f_return_status fss_extended_read_main_preprocess_depth(const f_console_arguments arguments, const fss_extended_read_data data, fss_extended_read_depths *depths) f_gcc_attribute_visibility_internal; + extern f_return_status fss_extended_read_main_preprocess_depth(const f_console_arguments_t arguments, const fss_extended_read_data_t data, fss_extended_read_depths_t *depths) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_read_main_preprocess_depth_ /** @@ -226,7 +226,7 @@ extern "C" { * @see fss_extended_read_main_preprocess_depth() */ #ifndef _di_fss_extended_read_main_process_file_ - extern f_return_status fss_extended_read_main_process_file(const f_console_arguments arguments, fss_extended_read_data *data, const f_string file_name, const fss_extended_read_depths depths) f_gcc_attribute_visibility_internal; + extern f_return_status fss_extended_read_main_process_file(const f_console_arguments_t arguments, fss_extended_read_data_t *data, const f_string_t file_name, const fss_extended_read_depths_t depths) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_read_main_process_file_ #ifdef __cplusplus 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 32ea94a..76049b9 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fss_extended_write_print_help_ - f_return_status fss_extended_write_print_help(const fl_color_context context) { + f_return_status fss_extended_write_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, fss_extended_write_name_long, fss_extended_write_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -28,13 +28,13 @@ extern "C" { #endif // _di_fss_extended_write_print_help_ #ifndef _di_fss_extended_write_main_ - f_return_status fss_extended_write_main(const f_console_arguments arguments, fss_extended_write_data *data) { - f_status status = F_none; + f_return_status fss_extended_write_main(const f_console_arguments_t arguments, fss_extended_write_data_t *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, fss_extended_write_total_parameters }; - f_console_parameter_id ids[3] = { fss_extended_write_parameter_no_color, fss_extended_write_parameter_light, fss_extended_write_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, fss_extended_write_total_parameters }; + f_console_parameter_id_t ids[3] = { fss_extended_write_parameter_no_color, fss_extended_write_parameter_light, fss_extended_write_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); if (F_status_is_error(status)) { @@ -52,15 +52,15 @@ extern "C" { fll_program_print_version(fss_extended_write_version); } else { - f_array_length counter = 0; + f_array_length_t counter = 0; bool object = (data->parameters[fss_extended_write_parameter_object].result == f_console_result_found); - f_string_dynamic buffer = f_string_dynamic_initialize; - f_string_range range = f_string_range_initialize; + f_string_dynamic_t buffer = f_string_dynamic_t_initialize; + f_string_range_t range = f_string_range_initialize; if (data->process_pipe) { - f_file file = f_file_initialize; - f_string_dynamic input = f_string_dynamic_initialize; + f_file_t file = f_file_t_initialize; + f_string_dynamic_t input = f_string_dynamic_t_initialize; file.id = f_type_descriptor_input; @@ -85,7 +85,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(input); fss_extended_write_delete_data(data); return F_status_set_error(status); } @@ -98,8 +98,8 @@ extern "C" { status = fl_fss_extended_object_write(input, 0, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { - f_macro_string_dynamic_delete_simple(buffer); - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(input); fss_extended_write_delete_data(data); return F_status_set_error(status); } @@ -112,8 +112,8 @@ extern "C" { status = fl_fss_extended_content_write(input, 0, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { - f_macro_string_dynamic_delete_simple(buffer); - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(input); fss_extended_write_delete_data(data); return F_status_set_error(status); } @@ -125,11 +125,11 @@ extern "C" { if (data->parameters[fss_extended_write_parameter_partial].result == f_console_result_none) { if (buffer.used == buffer.size) { - f_macro_string_dynamic_resize(status, buffer, buffer.used + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, buffer, buffer.used + f_fss_default_allocation_step_string); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(buffer); - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(input); fss_extended_write_delete_data(data); return status; } @@ -141,11 +141,11 @@ extern "C" { } } - f_macro_string_dynamic_delete_simple(input); + f_macro_string_dynamic_t_delete_simple(input); } else if (data->parameters[fss_extended_write_parameter_string].result == f_console_result_additional) { - const f_console_parameter *parameter = &data->parameters[fss_extended_write_parameter_string]; - f_string_dynamic input = f_string_dynamic_initialize; + const f_console_parameter_t *parameter = &data->parameters[fss_extended_write_parameter_string]; + f_string_dynamic_t input = f_string_dynamic_t_initialize; if (object) { input.string = arguments.argv[parameter->additional.array[0]]; @@ -157,7 +157,7 @@ extern "C" { status = fl_fss_extended_object_write(input, 0, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_extended_write_delete_data(data); return F_status_set_error(status); } @@ -168,7 +168,7 @@ extern "C" { } } else { - for (f_string_length i = 0; i < parameter->additional.used; i++) { + for (f_string_length_t i = 0; i < parameter->additional.used; i++) { input.string = arguments.argv[parameter->additional.array[i]]; input.used = strnlen(input.string, f_console_length_size); @@ -179,7 +179,7 @@ extern "C" { status = fl_fss_extended_content_write(input, 0, &range, &buffer); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_extended_write_delete_data(data); return F_status_set_error(status); } @@ -193,10 +193,10 @@ extern "C" { if (data->parameters[fss_extended_write_parameter_partial].result == f_console_result_none) { if (buffer.used == buffer.size) { - f_macro_string_dynamic_resize(status, buffer, buffer.used + f_fss_default_allocation_step_string); + f_macro_string_dynamic_t_resize(status, buffer, buffer.used + f_fss_default_allocation_step_string); if (F_status_is_error(status)) { - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_extended_write_delete_data(data); return status; } @@ -211,7 +211,7 @@ extern "C" { } if (data->parameters[fss_extended_write_parameter_file].result == f_console_result_additional) { - f_file output = f_file_initialize; + f_file_t output = f_file_t_initialize; output.flag = f_file_flag_append_wo; @@ -238,7 +238,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_extended_write_delete_data(data); return status; } @@ -259,7 +259,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()", status); } - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); fss_extended_write_delete_data(data); return F_status_set_error(status); } @@ -268,7 +268,7 @@ extern "C" { f_print_string_dynamic(f_type_output, buffer); } - f_macro_string_dynamic_delete_simple(buffer); + f_macro_string_dynamic_t_delete_simple(buffer); } fss_extended_write_delete_data(data); @@ -277,16 +277,16 @@ extern "C" { #endif // _di_fss_extended_write_main_ #ifndef _di_fss_extended_write_delete_data_ - f_return_status fss_extended_write_delete_data(fss_extended_write_data *data) { - f_status status = F_none; + f_return_status fss_extended_write_delete_data(fss_extended_write_data_t *data) { + f_status_t status = F_none; - for (f_string_length i = 0; i < fss_extended_write_total_parameters; i++) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + for (f_string_length_t i = 0; i < fss_extended_write_total_parameters; i++) { + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); } // for - f_macro_string_lengths_delete_simple(data->remaining); - fl_macro_color_context_delete_simple(data->context); + f_macro_string_lengths_t_delete_simple(data->remaining); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_extended_write/c/fss_extended_write.h b/level_3/fss_extended_write/c/fss_extended_write.h index 374e2a4..76a71ff 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.h +++ b/level_3/fss_extended_write/c/fss_extended_write.h @@ -75,40 +75,40 @@ extern "C" { fss_extended_write_parameter_string, }; - #define f_console_parameter_initialize_fss_extended_write \ + #define fss_extended_write_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_extended_write_short_file, fss_extended_write_long_file, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_write_short_object, fss_extended_write_long_object, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_write_short_partial, fss_extended_write_long_partial, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_write_short_string, fss_extended_write_long_string, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(fss_extended_write_short_file, fss_extended_write_long_file, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_write_short_object, fss_extended_write_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_write_short_partial, fss_extended_write_long_partial, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_extended_write_short_string, fss_extended_write_long_string, 0, F_true, f_console_type_normal), \ } #define fss_extended_write_total_parameters 9 #endif // _di_fss_extended_write_defines_ -#ifndef _di_fss_extended_write_data_ +#ifndef _di_fss_extended_write_data_t_ typedef struct { - f_console_parameter parameters[fss_extended_write_total_parameters]; + f_console_parameter_t parameters[fss_extended_write_total_parameters]; - f_string_lengths remaining; + f_string_lengths_t remaining; bool process_pipe; - fl_color_context context; - } fss_extended_write_data; + fl_color_context_t context; + } fss_extended_write_data_t; - #define fss_extended_write_data_initialize \ + #define fss_extended_write_data_t_initialize \ { \ - f_console_parameter_initialize_fss_extended_write, \ - f_string_lengths_initialize, \ + fss_extended_write_console_parameter_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_fss_extended_write_data_ +#endif // _di_fss_extended_write_data_t_ /** * Print help to standard output. @@ -120,7 +120,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_write_print_help_ - extern f_return_status fss_extended_write_print_help(const fl_color_context context); + extern f_return_status fss_extended_write_print_help(const fl_color_context_t context); #endif // _di_fss_extended_write_print_help_ /** @@ -141,7 +141,7 @@ extern "C" { * @see fss_extended_write_delete_data() */ #ifndef _di_fss_extended_write_main_ - extern f_return_status fss_extended_write_main(const f_console_arguments arguments, fss_extended_write_data *data); + extern f_return_status fss_extended_write_main(const f_console_arguments_t arguments, fss_extended_write_data_t *data); #endif // _di_fss_extended_write_main_ /** @@ -160,7 +160,7 @@ extern "C" { * @see fss_extended_write_main() */ #ifndef _di_fss_extended_write_delete_data_ - extern f_return_status fss_extended_write_delete_data(fss_extended_write_data *data); + extern f_return_status fss_extended_write_delete_data(fss_extended_write_data_t *data); #endif // _di_fss_extended_write_delete_data_ #ifdef __cplusplus diff --git a/level_3/fss_extended_write/c/main.c b/level_3/fss_extended_write/c/main.c index 6e49c65..24246a0 100644 --- a/level_3/fss_extended_write/c/main.c +++ b/level_3/fss_extended_write/c/main.c @@ -1,14 +1,14 @@ #include "fss_extended_write.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - fss_extended_write_data data = fss_extended_write_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + fss_extended_write_data_t data = fss_extended_write_data_t_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = fss_extended_write_main(arguments, &data); + f_status_t status = fss_extended_write_main(arguments, &data); if (F_status_is_error(status)) { return 1; diff --git a/level_3/fss_status_code/c/fss_status_code.c b/level_3/fss_status_code/c/fss_status_code.c index e898ac0..d27ca51 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_status_code_print_help_ - f_return_status fss_status_code_print_help(const fl_color_context context) { + f_return_status fss_status_code_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, fss_status_code_name_long, fss_status_code_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -29,13 +29,13 @@ extern "C" { #endif // _di_fss_status_code_print_help_ #ifndef _di_fss_status_code_main_ - f_return_status fss_status_code_main(const f_console_arguments arguments, fss_status_code_data *data) { - f_status status = F_none; + f_return_status fss_status_code_main(const f_console_arguments_t arguments, fss_status_code_data_t *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, fss_status_code_total_parameters }; - f_console_parameter_id ids[3] = { fss_status_code_parameter_no_color, fss_status_code_parameter_light, fss_status_code_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, fss_status_code_total_parameters }; + f_console_parameter_id_t ids[3] = { fss_status_code_parameter_no_color, fss_status_code_parameter_light, fss_status_code_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); @@ -98,7 +98,7 @@ extern "C" { return F_status_set_error(F_parameter); } - f_status status2 = F_none; + f_status_t status2 = F_none; if (data->parameters[fss_status_code_parameter_is_error].result == f_console_result_found || data->parameters[fss_status_code_parameter_is_warning].result == f_console_result_found || data->parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) { if (data->process_pipe) { @@ -106,7 +106,7 @@ extern "C" { } if (data->remaining.used > 0) { - for (f_array_length i = 0; i < data->remaining.used; i++) { + for (f_array_length_t i = 0; i < data->remaining.used; i++) { status2 = fss_status_code_process_check(*data, arguments.argv[data->remaining.array[i]]); if (F_status_is_error(status2) && status == F_none) { @@ -121,7 +121,7 @@ extern "C" { } if (data->remaining.used > 0) { - for (f_array_length i = 0; i < data->remaining.used; i++) { + for (f_array_length_t i = 0; i < data->remaining.used; i++) { status2 = fss_status_code_process_number(*data, arguments.argv[data->remaining.array[i]]); if (F_status_is_error(status2) && status == F_none) { @@ -136,7 +136,7 @@ extern "C" { } if (data->remaining.used > 0) { - for (f_array_length i = 0; i < data->remaining.used; i++) { + for (f_array_length_t i = 0; i < data->remaining.used; i++) { status2 = fss_status_code_process_normal(*data, arguments.argv[data->remaining.array[i]]); if (F_status_is_error(status2) && status == F_none) { @@ -152,17 +152,17 @@ extern "C" { #endif // _di_fss_status_code_main_ #ifndef _di_fss_status_code_delete_data_ - f_return_status fss_status_code_delete_data(fss_status_code_data *data) { - f_string_length i = 0; + f_return_status fss_status_code_delete_data(fss_status_code_data_t *data) { + f_string_length_t i = 0; while (i < fss_status_code_total_parameters) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); i++; } // while - f_macro_string_lengths_delete_simple(data->remaining); - fl_macro_color_context_delete_simple(data->context); + f_macro_string_lengths_t_delete_simple(data->remaining); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_status_code/c/fss_status_code.h b/level_3/fss_status_code/c/fss_status_code.h index c31c0e2..c5059e2 100644 --- a/level_3/fss_status_code/c/fss_status_code.h +++ b/level_3/fss_status_code/c/fss_status_code.h @@ -77,40 +77,40 @@ extern "C" { fss_status_code_parameter_number, }; - #define f_console_parameter_initialize_fss_status_code \ + #define fss_status_code_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_status_code_short_is_fine, fss_status_code_long_is_fine, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_status_code_short_is_warning, fss_status_code_long_is_warning, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_status_code_short_is_error, fss_status_code_long_is_error, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_status_code_short_number, fss_status_code_long_number, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(fss_status_code_short_is_fine, fss_status_code_long_is_fine, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_status_code_short_is_warning, fss_status_code_long_is_warning, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_status_code_short_is_error, fss_status_code_long_is_error, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(fss_status_code_short_number, fss_status_code_long_number, 0, F_false, f_console_type_normal), \ } #define fss_status_code_total_parameters 9 #endif // _di_fss_status_code_defines_ -#ifndef _di_fss_status_code_data_ +#ifndef _di_fss_status_code_data_t_ typedef struct { - f_console_parameter parameters[fss_status_code_total_parameters]; + f_console_parameter_t parameters[fss_status_code_total_parameters]; - f_string_lengths remaining; + f_string_lengths_t remaining; bool process_pipe; - fl_color_context context; - } fss_status_code_data; + fl_color_context_t context; + } fss_status_code_data_t; - #define fss_status_code_data_initialize \ + #define fss_status_code_data_t_initialize \ { \ - f_console_parameter_initialize_fss_status_code, \ - f_string_lengths_initialize, \ + fss_status_code_console_parameter_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_fss_status_code_data_ +#endif // _di_fss_status_code_data_t_ /** * Print help to standard output. @@ -122,7 +122,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_status_code_print_help_ - extern f_return_status fss_status_code_print_help(const fl_color_context context); + extern f_return_status fss_status_code_print_help(const fl_color_context_t context); #endif // _di_fss_status_code_print_help_ /** @@ -143,7 +143,7 @@ extern "C" { * @see fss_status_code_delete_data() */ #ifndef _di_fss_status_code_main_ - extern f_return_status fss_status_code_main(const f_console_arguments arguments, fss_status_code_data *data); + extern f_return_status fss_status_code_main(const f_console_arguments_t arguments, fss_status_code_data_t *data); #endif // _di_fss_status_code_main_ /** @@ -162,7 +162,7 @@ extern "C" { * @see fss_status_code_main() */ #ifndef _di_fss_status_code_delete_data_ - extern f_return_status fss_status_code_delete_data(fss_status_code_data *data); + extern f_return_status fss_status_code_delete_data(fss_status_code_data_t *data); #endif // _di_fss_status_code_delete_data_ #ifdef __cplusplus diff --git a/level_3/fss_status_code/c/main.c b/level_3/fss_status_code/c/main.c index 3feebbc..1ebd618 100644 --- a/level_3/fss_status_code/c/main.c +++ b/level_3/fss_status_code/c/main.c @@ -1,14 +1,14 @@ #include "fss_status_code.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - fss_status_code_data data = fss_status_code_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + fss_status_code_data_t data = fss_status_code_data_t_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = fss_status_code_main(arguments, &data); + f_status_t status = fss_status_code_main(arguments, &data); if (F_status_is_error(status) || status == F_false) { return 1; diff --git a/level_3/fss_status_code/c/private-fss_status_code.c b/level_3/fss_status_code/c/private-fss_status_code.c index 5ecee86..3471e87 100644 --- a/level_3/fss_status_code/c/private-fss_status_code.c +++ b/level_3/fss_status_code/c/private-fss_status_code.c @@ -6,9 +6,9 @@ extern "C" { #endif #ifndef _di_fss_status_code_process_check_ - f_return_status fss_status_code_process_check(const fss_status_code_data data, const f_string value) { - f_number_unsigned number = 0; - f_status status = fss_status_code_convert_number(data, value, &number); + f_return_status fss_status_code_process_check(const fss_status_code_data_t data, const f_string_t value) { + f_number_unsigned_t number = 0; + f_status_t status = fss_status_code_convert_number(data, value, &number); if (F_status_is_error(status)) { return status; @@ -44,13 +44,13 @@ extern "C" { #endif // _di_fss_status_code_process_check_ #ifndef _di_fss_status_code_process_number_ - f_return_status fss_status_code_process_number(const fss_status_code_data data, const f_string value) { - f_status status = F_none; + f_return_status fss_status_code_process_number(const fss_status_code_data_t data, const f_string_t value) { + f_status_t status = F_none; { - const f_string_range range = f_macro_string_range_initialize(strlen(value)); + const f_string_range_t range = f_macro_string_range_initialize(strlen(value)); - f_number_unsigned number = 0; + f_number_unsigned_t number = 0; status = fl_conversion_string_to_number_unsigned(value, &number, range); @@ -67,7 +67,7 @@ extern "C" { } } - f_status code = F_none; + f_status_t code = F_none; status = fll_fss_status_from_string(value, &code); @@ -101,16 +101,16 @@ extern "C" { #endif // _di_fss_status_code_process_number_ #ifndef _di_fss_status_code_process_normal_ - f_return_status fss_status_code_process_normal(const fss_status_code_data data, const f_string value) { - f_number_unsigned number = 0; - f_status status = fss_status_code_convert_number(data, value, &number); + f_return_status fss_status_code_process_normal(const fss_status_code_data_t data, const f_string_t value) { + f_number_unsigned_t number = 0; + f_status_t status = fss_status_code_convert_number(data, value, &number); if (F_status_is_error(status)) { return status; } - const f_status code = (f_status) number; - f_string string = 0; + const f_status_t code = (f_status_t) number; + f_string_t string = 0; status = fll_fss_status_to_string(code, &string); @@ -132,10 +132,10 @@ extern "C" { #endif // _di_fss_status_code_process_normal_ #ifndef _di_fss_status_code_convert_number_ - f_return_status fss_status_code_convert_number(const fss_status_code_data data, const f_string value, f_number_unsigned *number) { - const f_string_range range = f_macro_string_range_initialize(strlen(value)); + f_return_status fss_status_code_convert_number(const fss_status_code_data_t data, const f_string_t value, f_number_unsigned_t *number) { + const f_string_range_t range = f_macro_string_range_initialize(strlen(value)); - f_status status = fl_conversion_string_to_number_unsigned(value, number, range); + f_status_t status = fl_conversion_string_to_number_unsigned(value, number, range); if (*number > F_status_size_max_with_signal) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range"); diff --git a/level_3/fss_status_code/c/private-fss_status_code.h b/level_3/fss_status_code/c/private-fss_status_code.h index 388468a..67fb467 100644 --- a/level_3/fss_status_code/c/private-fss_status_code.h +++ b/level_3/fss_status_code/c/private-fss_status_code.h @@ -34,7 +34,7 @@ extern "C" { * @see fss_status_code_convert_number() */ #ifndef _di_fss_status_code_process_check_ - extern f_return_status fss_status_code_process_check(const fss_status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; + extern f_return_status fss_status_code_process_check(const fss_status_code_data_t data, const f_string_t value) f_gcc_attribute_visibility_internal; #endif // _di_fss_status_code_process_check_ /** @@ -56,7 +56,7 @@ extern "C" { * @see fll_fss_status_from_string() */ #ifndef _di_fss_status_code_process_number_ - extern f_return_status fss_status_code_process_number(const fss_status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; + extern f_return_status fss_status_code_process_number(const fss_status_code_data_t data, const f_string_t value) f_gcc_attribute_visibility_internal; #endif // _di_fss_status_code_process_number_ /** @@ -83,7 +83,7 @@ extern "C" { * @see fss_status_code_convert_number() */ #ifndef _di_fss_status_code_process_normal_ - extern f_return_status fss_status_code_process_normal(const fss_status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; + extern f_return_status fss_status_code_process_normal(const fss_status_code_data_t data, const f_string_t value) f_gcc_attribute_visibility_internal; #endif // _di_fss_status_code_process_normal_ /** @@ -111,7 +111,7 @@ extern "C" { * @see fl_console_parameter_to_number_unsigned() */ #ifndef _di_fss_status_code_convert_number_ - extern f_return_status fss_status_code_convert_number(const fss_status_code_data data, const f_string value, f_number_unsigned *number) f_gcc_attribute_visibility_internal; + extern f_return_status fss_status_code_convert_number(const fss_status_code_data_t data, const f_string_t value, f_number_unsigned_t *number) f_gcc_attribute_visibility_internal; #endif // _di_fss_status_code_convert_number_ #ifdef __cplusplus diff --git a/level_3/iki_read/c/iki_read.c b/level_3/iki_read/c/iki_read.c index 48459b3..e8e652c 100644 --- a/level_3/iki_read/c/iki_read.c +++ b/level_3/iki_read/c/iki_read.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_iki_read_print_help_ - f_return_status iki_read_print_help(const fl_color_context context) { + f_return_status iki_read_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, iki_read_name_long, iki_read_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -85,13 +85,13 @@ extern "C" { #endif // _di_iki_read_print_help_ #ifndef _di_iki_read_main_ - f_return_status iki_read_main(const f_console_arguments arguments, iki_read_data *data) { - f_status status = F_none; + f_return_status iki_read_main(const f_console_arguments_t arguments, iki_read_data_t *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, iki_read_total_parameters }; - f_console_parameter_id ids[3] = { iki_read_parameter_no_color, iki_read_parameter_light, iki_read_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, iki_read_total_parameters }; + f_console_parameter_id_t ids[3] = { iki_read_parameter_no_color, iki_read_parameter_light, iki_read_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); if (F_status_is_error(status)) { @@ -155,10 +155,10 @@ extern "C" { status = F_status_set_error(F_parameter); } else if (data->parameters[iki_read_parameter_at].result == f_console_result_additional) { - const f_string_length index = data->parameters[iki_read_parameter_at].additional.array[data->parameters[iki_read_parameter_at].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[iki_read_parameter_at].additional.array[data->parameters[iki_read_parameter_at].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); - f_number_unsigned number = 0; + f_number_unsigned_t number = 0; status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range); if (F_status_is_error(status)) { @@ -194,10 +194,10 @@ extern "C" { status = F_status_set_error(F_parameter); } else if (data->parameters[iki_read_parameter_line].result == f_console_result_additional) { - const f_string_length index = data->parameters[iki_read_parameter_line].additional.array[data->parameters[iki_read_parameter_line].additional.used - 1]; - const f_string_range range = f_macro_string_range_initialize(strlen(arguments.argv[index])); + const f_string_length_t index = data->parameters[iki_read_parameter_line].additional.array[data->parameters[iki_read_parameter_line].additional.used - 1]; + const f_string_range_t range = f_macro_string_range_initialize(strlen(arguments.argv[index])); - f_number_unsigned number = 0; + f_number_unsigned_t number = 0; status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range); if (F_status_is_error(status)) { @@ -323,7 +323,7 @@ extern "C" { } if (data->process_pipe) { - f_file file = f_file_initialize; + f_file_t file = f_file_t_initialize; file.id = f_type_descriptor_input; @@ -337,16 +337,16 @@ extern "C" { } // Clear buffers before continuing. - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } if (F_status_is_fine(status) && data->remaining.used > 0) { - f_string_length i = 0; - f_string_length total = 0; - f_file file = f_file_initialize; + f_string_length_t i = 0; + f_string_length_t total = 0; + f_file_t file = f_file_t_initialize; for (; i < data->remaining.used; i++) { - f_macro_file_reset(file); + f_macro_file_t_reset(file); total = 0; status = f_file_open(arguments.argv[data->remaining.array[i]], 0, &file); @@ -382,7 +382,7 @@ extern "C" { if (F_status_is_error(status)) break; // Clear buffers before repeating the loop. - f_macro_string_dynamic_delete_simple(data->buffer); + f_macro_string_dynamic_t_delete_simple(data->buffer); } // for } } @@ -409,19 +409,19 @@ extern "C" { #endif // _di_iki_read_main_ #ifndef _di_iki_read_delete_data_ - f_return_status iki_read_delete_data(iki_read_data *data) { - f_status status = F_none; - f_string_length i = 0; + f_return_status iki_read_delete_data(iki_read_data_t *data) { + f_status_t status = F_none; + f_string_length_t i = 0; while (i < iki_read_total_parameters) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); i++; } // while - f_macro_string_lengths_delete_simple(data->remaining); - f_macro_string_dynamic_delete_simple(data->buffer); - fl_macro_color_context_delete_simple(data->context); + f_macro_string_lengths_t_delete_simple(data->remaining); + f_macro_string_dynamic_t_delete_simple(data->buffer); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/iki_read/c/iki_read.h b/level_3/iki_read/c/iki_read.h index 3b97178..a223897 100644 --- a/level_3/iki_read/c/iki_read.h +++ b/level_3/iki_read/c/iki_read.h @@ -7,7 +7,7 @@ * * This is the FSS Basic Read program * This program utilizes the Featureless Linux Library. - * This program processes files or other input in fss format and stores the results in the iki_read_data. + * This program processes files or other input in fss format and stores the results in the iki_read_data_t. * * This processes in accordance to the FSS-0000 Basic specification. */ @@ -112,154 +112,154 @@ extern "C" { iki_read_parameter_total, }; - #define f_console_parameter_initialize_iki_read \ + #define iki_read_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_quiet, f_console_standard_long_quiet, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_verbose, f_console_standard_long_verbose, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, 0, f_console_type_inverse), \ - f_console_parameter_initialize(iki_read_short_at, iki_read_long_at, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(iki_read_short_line, iki_read_long_line, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(iki_read_short_literal, iki_read_long_literal, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(iki_read_short_name, iki_read_long_name, 0, 1, f_console_type_normal), \ - f_console_parameter_initialize(iki_read_short_object, iki_read_long_object, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(iki_read_short_whole, iki_read_long_whole, 0, 0, f_console_type_normal), \ - f_console_parameter_initialize(iki_read_short_substitute, iki_read_long_substitute, 0, 3, f_console_type_normal), \ - f_console_parameter_initialize(iki_read_short_total, iki_read_long_total, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_quiet, f_console_standard_long_quiet, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_verbose, f_console_standard_long_verbose, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, 0, f_console_type_inverse), \ + f_console_parameter_t_initialize(iki_read_short_at, iki_read_long_at, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(iki_read_short_line, iki_read_long_line, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(iki_read_short_literal, iki_read_long_literal, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(iki_read_short_name, iki_read_long_name, 0, 1, f_console_type_normal), \ + f_console_parameter_t_initialize(iki_read_short_object, iki_read_long_object, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(iki_read_short_whole, iki_read_long_whole, 0, 0, f_console_type_normal), \ + f_console_parameter_t_initialize(iki_read_short_substitute, iki_read_long_substitute, 0, 3, f_console_type_normal), \ + f_console_parameter_t_initialize(iki_read_short_total, iki_read_long_total, 0, 0, f_console_type_normal), \ } #define iki_read_total_parameters 15 #endif // _di_iki_read_defines_ -#ifndef _di_iki_read_substitution_ +#ifndef _di_iki_read_substitution_t_ #define iki_read_substitution_vocabulary "vocabulary" #define iki_read_substitution_replace "replace" #define iki_read_substitution_with "with" typedef struct { - f_string_static replace; - f_string_static with; - } iki_read_substitution; + f_string_static_t replace; + f_string_static_t with; + } iki_read_substitution_t; - #define iki_read_substitution_initialize \ + #define iki_read_substitution_t_initialize \ { \ - f_string_static_initialize, \ - f_string_static_initialize, \ + f_string_static_t_initialize, \ + f_string_static_t_initialize, \ } - #define macro_iki_read_substitution_initialize(replace, with) \ + #define macro_iki_read_substitution_t_initialize(replace, with) \ { \ - f_macro_string_static_initialize(replace), \ - f_macro_string_static_initialize(with), \ + f_macro_string_static_t_initialize(replace), \ + f_macro_string_static_t_initialize(with), \ } -#endif // _di_iki_read_substitution_ +#endif // _di_iki_read_substitution_t_ -#ifndef _di_iki_read_substitutions_ +#ifndef _di_iki_read_substitutions_t_ typedef struct { - iki_read_substitution *array; + iki_read_substitution_t *array; - f_array_length size; - f_array_length used; - } iki_read_substitutions; + f_array_length_t size; + f_array_length_t used; + } iki_read_substitutions_t; - #define iki_read_substitutions_initialize {0, 0, 0} + #define iki_read_substitutions_t_initialize {0, 0, 0} - #define macro_iki_read_substitutions_clear(replacements) f_macro_memory_structure_clear(replacements) + #define macro_iki_read_substitutions_t_clear(replacements) f_macro_memory_structure_t_clear(replacements) - #define macro_iki_read_substitutions_new(status, replacements, length) f_macro_memory_structure_new(status, replacements, iki_read_substitution, length) + #define macro_iki_read_substitutions_t_new(status, replacements, length) f_macro_memory_structure_t_new(status, replacements, iki_read_substitution_t, length) - #define macro_iki_read_substitutions_delete_simple(replacements) \ + #define macro_iki_read_substitutions_t_delete_simple(replacements) \ replacements.used = replacements.size; \ while (replacements.used > 0) { \ replacements.used--; \ } \ - if (replacements.used == 0) f_macro_memory_structure_delete_simple(replacements, iki_read_substitution) + if (replacements.used == 0) f_macro_memory_structure_t_delete_simple(replacements, iki_read_substitution_t) - #define macro_iki_read_substitutions_destroy_simple(replacements) \ + #define macro_iki_read_substitutions_t_destroy_simple(replacements) \ replacements.used = replacements.size; \ while (replacements.used > 0) { \ replacements.used--; \ } \ - if (replacements.used == 0) f_macro_memory_structure_destroy_simple(replacements, iki_read_substitution) + if (replacements.used == 0) f_macro_memory_structure_t_destroy_simple(replacements, iki_read_substitution_t) - #define macro_iki_read_substitutions_resize(status, replacements, new_length) \ + #define macro_iki_read_substitutions_t_resize(status, replacements, new_length) \ status = F_none; \ if (new_length < replacements.size) { \ - f_array_length i = replacements.size - new_length; \ + f_array_length_t i = replacements.size - new_length; \ for (; i < replacements.size; i++) { \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_resize((void **) & replacements.array, sizeof(iki_read_substitution), replacements.size, new_length); \ + if (status == F_none) status = f_memory_resize((void **) & replacements.array, sizeof(iki_read_substitution_t), replacements.size, new_length); \ if (status == F_none) { \ if (new_length > replacements.size) { \ - f_array_length i = replacements.size; \ + f_array_length_t i = replacements.size; \ for (; i < new_length; i++) { \ - memset(&replacements.array[i], 0, sizeof(iki_read_substitution)); \ + memset(&replacements.array[i], 0, sizeof(iki_read_substitution_t)); \ } \ } \ replacements.size = new_length; \ if (replacements.used > replacements.size) replacements.used = new_length; \ } - #define macro_iki_read_substitutions_adjust(status, replacements, new_length) \ + #define macro_iki_read_substitutions_t_adjust(status, replacements, new_length) \ status = F_none; \ if (new_length < replacements.size) { \ - f_array_length i = replacements.size - new_length; \ + f_array_length_t i = replacements.size - new_length; \ for (; i < replacements.size; i++) { \ if (status != F_none) break; \ } \ } \ - if (status == F_none) status = f_memory_adjust((void **) & replacements.array, sizeof(iki_read_substitution), replacements.size, new_length); \ + if (status == F_none) status = f_memory_adjust((void **) & replacements.array, sizeof(iki_read_substitution_t), replacements.size, new_length); \ if (status == F_none) { \ if (new_length > replacements.size) { \ - f_array_length i = replacements.size; \ + f_array_length_t i = replacements.size; \ for (; i < new_length; i++) { \ - memset(&replacements.array[i], 0, sizeof(iki_read_substitution)); \ + memset(&replacements.array[i], 0, sizeof(iki_read_substitution_t)); \ } \ } \ replacements.size = new_length; \ if (replacements.used > replacements.size) replacements.used = new_length; \ } -#endif // _di_iki_read_substitutions_ +#endif // _di_iki_read_substitutions_t_ -#ifndef _di_iki_read_data_ +#ifndef _di_iki_read_data_t_ typedef struct { - f_console_parameter parameters[iki_read_total_parameters]; + f_console_parameter_t parameters[iki_read_total_parameters]; - f_string_lengths remaining; + f_string_lengths_t remaining; bool process_pipe; - f_number_unsigned at; - f_number_unsigned line; + f_number_unsigned_t at; + f_number_unsigned_t line; uint8_t mode; uint8_t verbosity; - f_string_dynamic buffer; + f_string_dynamic_t buffer; - iki_read_substitutions replacements; + iki_read_substitutions_t replacements; - fl_color_context context; - } iki_read_data; + fl_color_context_t context; + } iki_read_data_t; - #define iki_read_data_initialize \ + #define iki_read_data_t_initialize \ { \ - f_console_parameter_initialize_iki_read, \ - f_string_lengths_initialize, \ + iki_read_console_parameter_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ 0, \ 0, \ 0, \ 0, \ - f_string_dynamic_initialize, \ - iki_read_substitutions_initialize, \ - fl_color_context_initialize, \ + f_string_dynamic_t_initialize, \ + iki_read_substitutions_t_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_iki_read_data_ +#endif // _di_iki_read_data_t_ /** * Print help to standard output. @@ -271,7 +271,7 @@ extern "C" { * F_none on success. */ #ifndef _di_iki_read_print_help_ - extern f_return_status iki_read_print_help(const fl_color_context context); + extern f_return_status iki_read_print_help(const fl_color_context_t context); #endif // _di_iki_read_print_help_ /** @@ -292,7 +292,7 @@ extern "C" { * @see iki_read_delete_data() */ #ifndef _di_iki_read_main_ - extern f_return_status iki_read_main(const f_console_arguments arguments, iki_read_data *data); + extern f_return_status iki_read_main(const f_console_arguments_t arguments, iki_read_data_t *data); #endif // _di_iki_read_main_ /** @@ -311,7 +311,7 @@ extern "C" { * @see iki_read_main() */ #ifndef _di_iki_read_delete_data_ - extern f_return_status iki_read_delete_data(iki_read_data *data); + extern f_return_status iki_read_delete_data(iki_read_data_t *data); #endif // _di_iki_read_delete_data_ #ifdef __cplusplus diff --git a/level_3/iki_read/c/main.c b/level_3/iki_read/c/main.c index 0827913..35d373b 100644 --- a/level_3/iki_read/c/main.c +++ b/level_3/iki_read/c/main.c @@ -1,14 +1,14 @@ #include "iki_read.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - iki_read_data data = iki_read_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + iki_read_data_t data = iki_read_data_t_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = iki_read_main(arguments, &data); + f_status_t status = iki_read_main(arguments, &data); if (F_status_is_error(status)) { return 1; diff --git a/level_3/iki_read/c/private-iki_read.c b/level_3/iki_read/c/private-iki_read.c index 5c64dad..5286586 100644 --- a/level_3/iki_read/c/private-iki_read.c +++ b/level_3/iki_read/c/private-iki_read.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_iki_read_print_error_ - f_return_status iki_read_print_error(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const bool fallback) { + f_return_status iki_read_print_error(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const bool fallback) { if (status == F_parameter) { if (verbosity != iki_read_verbosity_quiet) { @@ -66,8 +66,8 @@ extern "C" { #endif // _di_iki_read_print_error_ #ifndef _di_iki_read_print_error_file_ - bool iki_read_print_error_file(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const f_string name, const f_string operation, const bool is_file, const bool fallback) { - const f_string file_or_directory = is_file ? "file" : "directory"; + bool iki_read_print_error_file(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback) { + const f_string_t file_or_directory = is_file ? "file" : "directory"; if (status == F_file_found_not) { if (verbosity != iki_read_verbosity_quiet) { @@ -231,7 +231,7 @@ extern "C" { #endif // _di_iki_read_print_error_file_ #ifndef _di_iki_read_print_error_number_argument_ - void iki_read_print_error_number_argument(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const f_string parameter, const f_string argument) { + void iki_read_print_error_number_argument(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t parameter, const f_string_t argument) { if (verbosity == iki_read_verbosity_quiet) return; fprintf(f_type_error, "%c", f_string_eol[0]); @@ -298,10 +298,10 @@ extern "C" { #endif // _di_iki_read_print_error_number_argument_ #ifndef _di_iki_read_process_at_ - f_return_status iki_read_process_at(const f_console_arguments arguments, const f_string file_name, iki_read_data *data, f_string_range *range) { + f_return_status iki_read_process_at(const f_console_arguments_t arguments, const f_string_t file_name, iki_read_data_t *data, f_string_range_t *range) { if (data->parameters[iki_read_parameter_line].result != f_console_result_additional) return F_false; - f_string_length line = 0; + f_string_length_t line = 0; range->start = 0; if (data->line > 0) { @@ -323,15 +323,15 @@ extern "C" { #endif // _di_iki_read_process_at_ #ifndef _di_iki_read_process_buffer_ - f_return_status iki_read_process_buffer(const f_console_arguments arguments, const f_string file_name, iki_read_data *data) { - f_status status = F_none; + f_return_status iki_read_process_buffer(const f_console_arguments_t arguments, const f_string_t file_name, iki_read_data_t *data) { + f_status_t status = F_none; - f_iki_variable variable = f_iki_variable_initialize; - f_iki_vocabulary vocabulary = f_iki_vocabulary_initialize; - f_iki_content content = f_iki_content_initialize; + f_iki_variable_t variable = f_iki_variable_t_initialize; + f_iki_vocabulary_t vocabulary = f_iki_vocabulary_t_initialize; + f_iki_content_t content = f_iki_content_t_initialize; if (data->parameters[iki_read_parameter_whole].result == f_console_result_found) { - f_string_range buffer_range = f_macro_string_range_initialize(data->buffer.used); + f_string_range_t buffer_range = f_macro_string_range_initialize(data->buffer.used); status = iki_read_process_at(arguments, file_name, data, &buffer_range); @@ -358,7 +358,7 @@ extern "C" { status = iki_read_process_buffer_total(arguments, file_name, data, &variable, &vocabulary, &content); } else { - f_string_range buffer_range = f_macro_string_range_initialize(data->buffer.used); + f_string_range_t buffer_range = f_macro_string_range_initialize(data->buffer.used); status = iki_read_process_at(arguments, file_name, data, &buffer_range); @@ -382,17 +382,17 @@ extern "C" { } } - f_macro_iki_variable_delete_simple(variable); - f_macro_iki_vocabulary_delete_simple(vocabulary); - f_macro_iki_content_delete_simple(content); + f_macro_iki_variable_t_delete_simple(variable); + f_macro_iki_vocabulary_t_delete_simple(vocabulary); + f_macro_iki_content_t_delete_simple(content); return status; } #endif // _di_iki_read_process_buffer_ #ifndef _di_iki_read_process_buffer_ranges_ - f_return_status iki_read_process_buffer_ranges(const f_console_arguments arguments, const f_string file_name, iki_read_data *data, f_string_range *buffer_range, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content, f_string_ranges *ranges) { - f_status status = F_none; + f_return_status iki_read_process_buffer_ranges(const f_console_arguments_t arguments, const f_string_t file_name, iki_read_data_t *data, f_string_range_t *buffer_range, f_iki_variable_t *variable, f_iki_vocabulary_t *vocabulary, f_iki_content_t *content, f_string_ranges_t *ranges) { + f_status_t status = F_none; bool unmatched = F_true; @@ -404,17 +404,17 @@ extern "C" { const bool content_only = data->mode == iki_read_mode_content; - iki_read_substitutions substitutionss[variable->used]; + iki_read_substitutions_t substitutionss[variable->used]; - memset(substitutionss, 0, sizeof(iki_read_substitutions) * variable->used); + memset(substitutionss, 0, sizeof(iki_read_substitutions_t) * variable->used); if (data->mode == iki_read_mode_literal || data->mode == iki_read_mode_content) { status = iki_read_substitutions_identify(arguments, file_name, data, vocabulary, substitutionss); if (F_status_is_error(status)) { iki_read_print_error(data->context, data->verbosity, F_status_set_fine(status), "iki_read_substitutions_identify", F_true); - for (f_array_length i = 0; i < variable->used; i++) { - macro_iki_read_substitutions_delete_simple(substitutionss[i]); + for (f_array_length_t i = 0; i < variable->used; i++) { + macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for return status; @@ -422,11 +422,11 @@ extern "C" { } if (data->parameters[iki_read_parameter_name].result == f_console_result_additional) { - f_string_dynamic name = f_string_dynamic_initialize; + f_string_dynamic_t name = f_string_dynamic_t_initialize; - f_array_length index = 0; - f_array_length i = 0; - f_array_length j = 0; + f_array_length_t index = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; buffer_range->start = 0; for (; i < data->parameters[iki_read_parameter_name].additional.used; i++) { @@ -437,11 +437,11 @@ extern "C" { if (F_status_is_error(status)) { iki_read_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_string_append_nulless", F_true); - for (f_array_length i = 0; i < variable->used; i++) { - macro_iki_read_substitutions_delete_simple(substitutionss[i]); + for (f_array_length_t i = 0; i < variable->used; i++) { + macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -465,14 +465,14 @@ extern "C" { } // for } // for - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); if (unmatched) status = F_data_not; else status = F_none; } else if (ranges->used) { - f_array_length i = 0; - f_string_length j = 0; + f_array_length_t i = 0; + f_string_length_t j = 0; for (; i < ranges->used; i++) { @@ -492,8 +492,8 @@ extern "C" { status = F_data_not; } - for (f_array_length i = 0; i < variable->used; i++) { - macro_iki_read_substitutions_delete_simple(substitutionss[i]); + for (f_array_length_t i = 0; i < variable->used; i++) { + macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for return status; @@ -501,9 +501,9 @@ extern "C" { #endif // _di_iki_read_process_buffer_ranges_ #ifndef _di_iki_read_process_buffer_ranges_whole_ - f_return_status iki_read_process_buffer_ranges_whole(const f_console_arguments arguments, const f_string file_name, const f_string_range buffer_range, iki_read_data *data, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content, f_string_ranges *ranges) { - f_status status = F_none; - f_string_range range = buffer_range; + f_return_status iki_read_process_buffer_ranges_whole(const f_console_arguments_t arguments, const f_string_t file_name, const f_string_range_t buffer_range, iki_read_data_t *data, f_iki_variable_t *variable, f_iki_vocabulary_t *vocabulary, f_iki_content_t *content, f_string_ranges_t *ranges) { + f_status_t status = F_none; + f_string_range_t range = buffer_range; status = fl_iki_read(&data->buffer, &range, variable, vocabulary, content); if (F_status_is_error(status)) { @@ -518,37 +518,37 @@ extern "C" { const bool content_only = data->mode == iki_read_mode_content; - iki_read_substitutions substitutionss[variable->used]; + iki_read_substitutions_t substitutionss[variable->used]; - memset(substitutionss, 0, sizeof(iki_read_substitutions) * variable->used); + memset(substitutionss, 0, sizeof(iki_read_substitutions_t) * variable->used); if (data->mode == iki_read_mode_literal || data->mode == iki_read_mode_content) { status = iki_read_substitutions_identify(arguments, file_name, data, vocabulary, substitutionss); if (F_status_is_error(status)) { iki_read_print_error(data->context, data->verbosity, F_status_set_fine(status), "iki_read_substitutions_identify", F_true); - for (f_array_length i = 0; i < variable->used; i++) { - macro_iki_read_substitutions_delete_simple(substitutionss[i]); + for (f_array_length_t i = 0; i < variable->used; i++) { + macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for return status; } } - f_string_dynamics names = f_string_dynamics_initialize; - f_string_range name_range = f_string_range_initialize; - f_string_range substitution_range = f_string_range_initialize; + f_string_dynamics_t names = f_string_dynamics_t_initialize; + f_string_range_t name_range = f_string_range_initialize; + f_string_range_t substitution_range = f_string_range_initialize; bool name_missed = F_true; substitution_range.start = 0; if (data->parameters[iki_read_parameter_name].result == f_console_result_additional) { - f_array_length i = 0; - f_array_length j = 0; - f_string_length length_argument = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; + f_string_length_t length_argument = 0; - for (f_array_length index = 0; i < data->parameters[iki_read_parameter_name].additional.used; i++) { + for (f_array_length_t index = 0; i < data->parameters[iki_read_parameter_name].additional.used; i++) { index = data->parameters[iki_read_parameter_name].additional.array[i]; length_argument = strnlen(arguments.argv[index], f_console_length_size); @@ -580,18 +580,18 @@ extern "C" { if (F_status_is_error(status)) { for (i = 0; i < variable->used; i++) { - macro_iki_read_substitutions_delete_simple(substitutionss[i]); + macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for - f_macro_string_dynamics_delete_simple(names); + f_macro_string_dynamics_t_delete_simple(names); return status; } } { - f_string_length i = buffer_range.start; - f_array_length j = 0; - f_array_length k = 0; + f_string_length_t i = buffer_range.start; + f_array_length_t j = 0; + f_array_length_t k = 0; range = buffer_range; name_range.start = 0; @@ -658,19 +658,19 @@ extern "C" { } } - for (f_array_length i = 0; i < variable->used; i++) { - macro_iki_read_substitutions_delete_simple(substitutionss[i]); + for (f_array_length_t i = 0; i < variable->used; i++) { + macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for - f_macro_string_dynamics_delete_simple(names); + f_macro_string_dynamics_t_delete_simple(names); return F_none; } #endif // _di_iki_read_process_buffer_ranges_whole_ #ifndef _di_iki_read_process_buffer_total_ - f_return_status iki_read_process_buffer_total(const f_console_arguments arguments, const f_string file_name, iki_read_data *data, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content) { - f_status status = F_none; - f_string_range range = f_macro_string_range_initialize(data->buffer.used); + f_return_status iki_read_process_buffer_total(const f_console_arguments_t arguments, const f_string_t file_name, iki_read_data_t *data, f_iki_variable_t *variable, f_iki_vocabulary_t *vocabulary, f_iki_content_t *content) { + f_status_t status = F_none; + f_string_range_t range = f_macro_string_range_initialize(data->buffer.used); status = iki_read_process_at(arguments, file_name, data, &range); @@ -691,14 +691,14 @@ extern "C" { return status; } - f_array_length total = 0; + f_array_length_t total = 0; if (data->parameters[iki_read_parameter_name].result == f_console_result_additional) { - f_string_dynamic name = f_string_dynamic_initialize; + f_string_dynamic_t name = f_string_dynamic_t_initialize; - f_array_length index = 0; - f_array_length i = 0; - f_array_length j = 0; + f_array_length_t index = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; range.start = 0; @@ -710,7 +710,7 @@ extern "C" { if (F_status_is_error(status)) { iki_read_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_string_append_nulless", F_true); - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); return status; } @@ -723,7 +723,7 @@ extern "C" { } // for } // for - f_macro_string_dynamic_delete_simple(name); + f_macro_string_dynamic_t_delete_simple(name); } else { total = variable->used; @@ -736,20 +736,20 @@ extern "C" { #endif // _di_iki_read_process_buffer_total_ #ifndef _di_iki_read_substitutions_identify_ - f_return_status iki_read_substitutions_identify(const f_console_arguments arguments, const f_string file_name, iki_read_data *data, f_iki_vocabulary *vocabulary, iki_read_substitutions *substitutionss) { + f_return_status iki_read_substitutions_identify(const f_console_arguments_t arguments, const f_string_t file_name, iki_read_data_t *data, f_iki_vocabulary_t *vocabulary, iki_read_substitutions_t *substitutionss) { if (data->parameters[iki_read_parameter_substitute].result != f_console_result_additional) return F_none; - f_status status = F_none; + f_status_t status = F_none; - f_array_length i = 0; - f_array_length j = 0; + f_array_length_t i = 0; + f_array_length_t j = 0; - f_array_length index = 0; - f_array_length index_2 = 0; + f_array_length_t index = 0; + f_array_length_t index_2 = 0; - f_string_length length = 0; + f_string_length_t length = 0; - f_console_parameter *parameter = &data->parameters[iki_read_parameter_substitute]; + f_console_parameter_t *parameter = &data->parameters[iki_read_parameter_substitute]; for (; i < parameter->additional.used; i += 3) { index = parameter->additional.array[i]; @@ -759,7 +759,7 @@ extern "C" { status = fl_string_compare(arguments.argv[index], data->buffer.string + vocabulary->array[j].start, length, (vocabulary->array[j].stop - vocabulary->array[j].start) + 1); if (status == F_equal_to) { - f_macro_memory_structure_macro_increment(status, substitutionss[j], 1, f_iki_default_allocation_step, macro_iki_read_substitutions_resize, F_buffer_too_large); + f_macro_memory_structure_macro_increment(status, substitutionss[j], 1, f_iki_default_allocation_step, macro_iki_read_substitutions_t_resize, F_buffer_too_large); if (F_status_is_error(status)) return status; index = parameter->additional.array[i + 1]; @@ -783,11 +783,11 @@ extern "C" { #endif // _di_iki_read_substitutions_identify_ #ifndef _di_iki_read_substitutions_print_ - void iki_read_substitutions_print(const iki_read_data data, const f_iki_variable variable, const f_iki_content content, const f_string_ranges ranges, const iki_read_substitutions substitutions, const f_string_length index, const bool content_only) { - f_status status = F_none; + void iki_read_substitutions_print(const iki_read_data_t data, const f_iki_variable_t variable, const f_iki_content_t content, const f_string_ranges_t ranges, const iki_read_substitutions_t substitutions, const f_string_length_t index, const bool content_only) { + f_status_t status = F_none; - f_string_length i = 0; - f_string_range range = f_string_range_initialize; + f_string_length_t i = 0; + f_string_range_t range = f_string_range_initialize; range.start = 0; diff --git a/level_3/iki_read/c/private-iki_read.h b/level_3/iki_read/c/private-iki_read.h index 0860b8b..bb2f207 100644 --- a/level_3/iki_read/c/private-iki_read.h +++ b/level_3/iki_read/c/private-iki_read.h @@ -31,7 +31,7 @@ extern "C" { * F_unknown is returned if the status code has no print message. */ #ifndef _di_iki_read_print_error_ - extern f_return_status iki_read_print_error(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const bool fallback) f_gcc_attribute_visibility_internal; + extern f_return_status iki_read_print_error(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const bool fallback) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_print_error_ /** @@ -61,7 +61,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_iki_read_print_error_file_ - extern bool iki_read_print_error_file(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const f_string name, const f_string operation, const bool is_file, const bool fallback) f_gcc_attribute_visibility_internal; + extern bool iki_read_print_error_file(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_print_error_file_ /** @@ -85,7 +85,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_iki_read_print_error_number_argument_ - extern void iki_read_print_error_number_argument(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const f_string parameter, const f_string argument) f_gcc_attribute_visibility_internal; + extern void iki_read_print_error_number_argument(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t parameter, const f_string_t argument) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_print_error_number_argument_ /** @@ -111,7 +111,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_iki_read_process_at_ - extern f_return_status iki_read_process_at(const f_console_arguments arguments, const f_string file_name, iki_read_data *data, f_string_range *range) f_gcc_attribute_visibility_internal; + extern f_return_status iki_read_process_at(const f_console_arguments_t arguments, const f_string_t file_name, iki_read_data_t *data, f_string_range_t *range) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_process_at_ /** @@ -131,7 +131,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_iki_read_process_buffer_ - extern f_return_status iki_read_process_buffer(const f_console_arguments arguments, const f_string file_name, iki_read_data *data) f_gcc_attribute_visibility_internal; + extern f_return_status iki_read_process_buffer(const f_console_arguments_t arguments, const f_string_t file_name, iki_read_data_t *data) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_process_buffer_ /** @@ -162,7 +162,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_iki_read_process_buffer_ranges_ - extern f_return_status iki_read_process_buffer_ranges(const f_console_arguments arguments, const f_string file_name, iki_read_data *data, f_string_range *buffer_range, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content, f_string_ranges *ranges) f_gcc_attribute_visibility_internal; + extern f_return_status iki_read_process_buffer_ranges(const f_console_arguments_t arguments, const f_string_t file_name, iki_read_data_t *data, f_string_range_t *buffer_range, f_iki_variable_t *variable, f_iki_vocabulary_t *vocabulary, f_iki_content_t *content, f_string_ranges_t *ranges) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_process_buffer_ranges_ /** @@ -195,7 +195,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_iki_read_process_buffer_ranges_whole_ - extern f_return_status iki_read_process_buffer_ranges_whole(const f_console_arguments arguments, const f_string file_name, const f_string_range buffer_range, iki_read_data *data, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content, f_string_ranges *ranges) f_gcc_attribute_visibility_internal; + extern f_return_status iki_read_process_buffer_ranges_whole(const f_console_arguments_t arguments, const f_string_t file_name, const f_string_range_t buffer_range, iki_read_data_t *data, f_iki_variable_t *variable, f_iki_vocabulary_t *vocabulary, f_iki_content_t *content, f_string_ranges_t *ranges) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_process_buffer_ranges_whole_ /** @@ -220,7 +220,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_iki_read_process_buffer_total_ - extern f_return_status iki_read_process_buffer_total(const f_console_arguments arguments, const f_string file_name, iki_read_data *data, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content) f_gcc_attribute_visibility_internal; + extern f_return_status iki_read_process_buffer_total(const f_console_arguments_t arguments, const f_string_t file_name, iki_read_data_t *data, f_iki_variable_t *variable, f_iki_vocabulary_t *vocabulary, f_iki_content_t *content) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_process_buffer_total_ /** @@ -243,7 +243,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_iki_read_substitutions_identify_ - extern f_return_status iki_read_substitutions_identify(const f_console_arguments arguments, const f_string file_name, iki_read_data *data, f_iki_vocabulary *vocabulary, iki_read_substitutions *substitutionss) f_gcc_attribute_visibility_internal; + extern f_return_status iki_read_substitutions_identify(const f_console_arguments_t arguments, const f_string_t file_name, iki_read_data_t *data, f_iki_vocabulary_t *vocabulary, iki_read_substitutions_t *substitutionss) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_substitutions_identify_ /** @@ -266,7 +266,7 @@ extern "C" { * Set to FALSE to print the entire variable when printing substituted text. */ #ifndef _di_iki_read_substitutions_print_ - extern void iki_read_substitutions_print(const iki_read_data data, const f_iki_variable variable, const f_iki_content content, const f_string_ranges ranges, const iki_read_substitutions substitutions, const f_string_length index, const bool content_only) f_gcc_attribute_visibility_internal; + extern void iki_read_substitutions_print(const iki_read_data_t data, const f_iki_variable_t variable, const f_iki_content_t content, const f_string_ranges_t ranges, const iki_read_substitutions_t substitutions, const f_string_length_t index, const bool content_only) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_substitutions_print_ #ifdef __cplusplus diff --git a/level_3/iki_read/data/build/dependencies b/level_3/iki_read/data/build/dependencies index 2a02015..0ded4eb 100644 --- a/level_3/iki_read/data/build/dependencies +++ b/level_3/iki_read/data/build/dependencies @@ -1,14 +1,14 @@ # fss-0000 f_type -f_status +f_status_t f_memory -f_string +f_string_t f_utf -f_color +f_color_t f_console f_conversion -f_file +f_file_t f_iki f_pipe f_print diff --git a/level_3/init/c/init.c b/level_3/init/c/init.c index 28febf6..6bcbc71 100644 --- a/level_3/init/c/init.c +++ b/level_3/init/c/init.c @@ -13,7 +13,7 @@ extern "C" { // version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors #ifndef _di_init_print_version_ - f_return_status init_print_version(const init_data data) { + f_return_status init_print_version(const init_data_t data) { printf("%s\n", init_version); return F_none; @@ -21,7 +21,7 @@ extern "C" { #endif // _di_init_print_version_ #ifndef _di_init_print_help_ - f_return_status init_print_help(const fl_color_context context) { + f_return_status init_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, init_name_long, init_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -43,8 +43,8 @@ extern "C" { #endif // _di_init_print_help_ #ifndef _di_init_main_ - f_return_status init_main(const f_console_arguments arguments, init_data *data) { - f_status status = F_none; + f_return_status init_main(const f_console_arguments_t arguments, init_data_t *data) { + f_status_t status = F_none; int8_t run_level[init_kernel_runlevel_buffer]; memset(run_level, 0, init_kernel_runlevel_buffer); @@ -53,9 +53,9 @@ extern "C" { unsigned short do_socket_port = F_false; { - f_console_parameters parameters = { data->parameters, init_total_parameters }; - f_console_parameter_id ids[3] = { init_parameter_no_color, init_parameter_light, init_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, init_total_parameters }; + f_console_parameter_id_t ids[3] = { init_parameter_no_color, init_parameter_light, init_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); diff --git a/level_3/init/c/init.h b/level_3/init/c/init.h index e6211f6..a4c3b85 100644 --- a/level_3/init/c/init.h +++ b/level_3/init/c/init.h @@ -189,92 +189,92 @@ extern "C" { }; #ifdef _en_init_debug_ - #define f_console_parameter_initialize_init \ + #define init_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, 0, F_true, f_console_type_normal), \ } #define init_total_parameters 8 #else - #define f_console_parameter_initialize_init \ + #define init_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, 0, F_true, f_console_type_normal), \ - f_console_parameter_initialize(init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_t_initialize(init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, 0, F_true, f_console_type_normal), \ } #define init_total_parameters 7 #endif // _en_init_debug_ #endif // _di_init_defines_ -#ifndef _di_init_data_ +#ifndef _di_init_data_t_ typedef struct { - f_console_parameter parameters[init_total_parameters]; + f_console_parameter_t parameters[init_total_parameters]; - f_string_lengths remaining; + f_string_lengths_t remaining; bool process_pipe; - fl_color_context context; - } init_data; + fl_color_context_t context; + } init_data_t; #define init_data_initialize \ { \ - f_console_parameter_initialize_init, \ - f_string_lengths_initialize, \ + init_console_parameter_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_initialize, \ + fl_color_context_t_initialize, \ } typedef struct { uint8_t todo_placeholder; - } init_data_thread_control; + } init_data_thread_control_t; - #define init_data_thread_control_initialize \ + #define init_data_thread_control_t_initialize \ { \ 0 \ } typedef struct { uint8_t todo_placeholder; - } init_data_thread_service; + } init_data_thread_service_t; - #define init_data_thread_service_initialize \ + #define init_data_thread_service_t_initialize \ { \ 0 \ } typedef struct { uint8_t todo_placeholder; - } init_data_thread_socket_file; + } init_data_thread_socket_file_t; - #define init_data_thread_socket_file_initialize \ + #define init_data_thread_socket_file_t_initialize \ { \ 0 \ } typedef struct { uint8_t todo_placeholder; - } init_data_thread_socket_port; + } init_data_thread_socket_port_t; - #define init_data_thread_socket_port_initialize \ + #define init_data_thread_socket_port_t_initialize \ { \ 0 \ } -#endif // _di_init_data_ +#endif // _di_init_data_t_ #ifndef _di_init_print_version_ - extern f_return_status init_print_version(const init_data data); + extern f_return_status init_print_version(const init_data_t data); #endif // _di_init_print_version_ /** @@ -287,7 +287,7 @@ extern "C" { * F_none on success. */ #ifndef _di_init_print_help_ - extern f_return_status init_print_help(const fl_color_context context); + extern f_return_status init_print_help(const fl_color_context_t context); #endif // _di_init_print_help_ /** @@ -304,7 +304,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_init_main_ - extern f_return_status init_main(const f_console_arguments arguments, init_data *data); + extern f_return_status init_main(const f_console_arguments_t arguments, init_data_t *data); #endif // _di_init_main_ /** @@ -321,7 +321,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_init_main_ - extern f_return_status init_thread_control(const init_data *data); + extern f_return_status init_thread_control(const init_data_t *data); #endif // _di_init_main_ #ifdef __cplusplus diff --git a/level_3/init/c/main.c b/level_3/init/c/main.c index 2533991..fc927cb 100644 --- a/level_3/init/c/main.c +++ b/level_3/init/c/main.c @@ -1,14 +1,14 @@ #include "init.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - init_data data = init_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + init_data_t data = init_data_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = init_main(arguments, &data); + f_status_t status = init_main(arguments, &data); if (F_status_is_error(status)) { return 1; diff --git a/level_3/init/c/private-init.c b/level_3/init/c/private-init.c index 22d5972..abde7fb 100644 --- a/level_3/init/c/private-init.c +++ b/level_3/init/c/private-init.c @@ -5,10 +5,10 @@ #include "private-init.h" /* #ifndef _di_init_rule_buffer_ - f_return_status init_rule_buffer(const init_data data, const f_string filename, f_string_dynamic *buffer, f_fss_objects *objects, f_fss_contents *contents) { - f_file file = f_file_initialize; - f_status status = F_none; - f_string_quantity quantity = f_string_quantity_initialize; + f_return_status init_rule_buffer(const init_data_t data, const f_string_t filename, f_string_dynamic_t *buffer, f_fss_objects_t *objects, f_fss_contents_t *contents) { + f_file_t file = f_file_t_initialize; + f_status_t status = F_none; + f_string_quantity_t quantity = f_string_quantity_t_initialize; status = f_file_open(filename, 0, 0, &file); @@ -38,7 +38,7 @@ return F_status_set_error(status); } - f_macro_file_reset_position(quantity, file) + f_macro_file_t_reset_position(quantity, file) fflush(stdout); status = f_file_read_until(file, buffer, quantity); @@ -66,7 +66,7 @@ return F_status_set_error(status); } else { - f_string_range input = f_string_range_initialize; + f_string_range_t input = f_string_range_initialize; input.stop = buffer->used - 1; @@ -94,8 +94,8 @@ #endif // _di_init_rule_buffer_ #ifndef _di_init_rules_process_main_ - f_return_status init_rules_process_main(const init_data data, const f_string filename, f_string_dynamic *buffer, f_fss_objects *objects, f_fss_contents *contents) { - f_status status = F_none; + f_return_status init_rules_process_main(const init_data_t data, const f_string_t filename, f_string_dynamic_t *buffer, f_fss_objects_t *objects, f_fss_contents_t *contents) { + f_status_t status = F_none; // @todo: resume replacing code below. status = fll_fss_extended_read(&buffer, input, &local->rule_objects, &local->rule_contents, 0, 0); @@ -114,14 +114,14 @@ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status); } - f_macro_fss_objects_delete_simple(local->rule_objects); - f_macro_fss_contents_delete_simple(local->rule_contents); + f_macro_fss_objects_t_delete_simple(local->rule_objects); + f_macro_fss_contents_t_delete_simple(local->rule_contents); return F_status_set_error(status); } } - f_macro_fss_objects_delete_simple(local->rule_objects); - f_macro_fss_contents_delete_simple(local->rule_contents); + f_macro_fss_objects_t_delete_simple(local->rule_objects); + f_macro_fss_contents_t_delete_simple(local->rule_contents); return status; } #endif // _init_rules_process_main_ @@ -163,7 +163,7 @@ #ifndef _di_init_delete_stack_memory_ f_return_status init_delete_stack_memory(init_stack_memory *stack_memory) { - f_status status = F_none; + f_status_t status = F_none; if (stack_memory->services > 0) { if (munmap(stack_memory->services, 0) >= 0) { @@ -189,7 +189,7 @@ #ifndef _di_init_prepare_system_ f_return_status init_prepare_system(int8_t *run_level) { - f_status status = F_none; + f_status_t status = F_none; f_stat stat; memset(&stat, 0, sizeof(f_stat)); @@ -291,7 +291,7 @@ // attempt to load kernel command line, but do not stop on failure. if (run_level > 0 && run_level[0] != 0) { f_file_p kernel_command_line_file = 0; - f_string kernel_command_line_string = f_string_initialize; + f_string_t kernel_command_line_string = f_string_t_initialize; size_t kernel_command_line_length = 0; kernel_command_line_file = fopen(init_kernel_command_line, "ro"); @@ -323,8 +323,8 @@ } if (kernel_command_line_string) { - f_status status_free = F_none; - f_macro_string_delete(status_free, kernel_command_line_string, string_length); + f_status_t status_free = F_none; + f_macro_string_t_delete(status_free, kernel_command_line_string, string_length); } } @@ -334,7 +334,7 @@ #ifndef _di_init_prepare_system_ f_return_status init_prepare_system() { - f_status status = F_none; + f_status_t status = F_none; f_stat stat; memset(&stat, 0, sizeof(f_stat)); @@ -480,13 +480,13 @@ #endif // _di_init_prepare_init_ #ifndef _di_init_process_main_rule_ - f_return_status init_process_main_rule(const init_data data, f_string_dynamic *buffer, init_data *settings) { - f_status status = F_none; - f_string_dynamic buffer = f_string_dynamic_initialize; - f_string_range range = f_string_range_initialize; - f_fss_objects objects = f_fss_objects_initialize; - f_fss_contents contents = f_fss_contents_initialize; - f_string_length position = 0; + f_return_status init_process_main_rule(const init_data_t data, f_string_dynamic_t *buffer, init_data_t *settings) { + f_status_t status = F_none; + f_string_dynamic_t buffer = f_string_dynamic_t_initialize; + f_string_range_t range = f_string_range_initialize; + f_fss_objects_t objects = f_fss_objects_t_initialize; + f_fss_contents_t contents = f_fss_contents_t_initialize; + f_string_length_t position = 0; // load the main file into memory. status = init_rule_buffer(&data, init_rule_core_file, &buffer, &objects, &contents); @@ -504,9 +504,9 @@ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, init_rule_core_file); } - f_macro_string_dynamic_delete(buffer); - f_macro_fss_objects_delete(objects); - f_macro_fss_contents_delete(contents); + f_macro_string_dynamic_t_delete(buffer); + f_macro_fss_objects_t_delete(objects); + f_macro_fss_contents_t_delete(contents); return status; } @@ -540,7 +540,7 @@ /* - f_status status = F_none; + f_status_t status = F_none; status = fll_fss_extended_read(buffer, location, objects, contents, 0, 0); @@ -559,8 +559,8 @@ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status); } - f_macro_fss_objects_delete_simple((*rule_objects)); - f_macro_fss_contents_delete_simple((*rule_contents)); + f_macro_fss_objects_t_delete_simple((*rule_objects)); + f_macro_fss_contents_t_delete_simple((*rule_contents)); return F_status_set_error(status); } } @@ -573,13 +573,13 @@ } } - f_macro_fss_objects_delete_simple((*rule_objects)); - f_macro_fss_contents_delete_simple((*rule_contents)); + f_macro_fss_objects_t_delete_simple((*rule_objects)); + f_macro_fss_contents_t_delete_simple((*rule_contents)); */ /* - f_macro_string_dynamic_delete(buffer); - f_macro_fss_objects_delete(objects); - f_macro_fss_contents_delete(contents); + f_macro_string_dynamic_t_delete(buffer); + f_macro_fss_objects_t_delete(objects); + f_macro_fss_contents_t_delete(contents); return status; } #endif // _di_init_process_main_rule_ diff --git a/level_3/init/c/private-init.h b/level_3/init/c/private-init.h index 6f88c04..26a9af2 100644 --- a/level_3/init/c/private-init.h +++ b/level_3/init/c/private-init.h @@ -33,29 +33,29 @@ extern "C" { #ifndef _di_init_rule_ // rule [directory] [filename (no-extension)] [require] [last] [asynchronous] = execute a rule located in [directory][filename].rule. typedef struct { - f_string_dynamic name; - f_string_dynamic directory; - f_string_dynamic file; + f_string_dynamic_t name; + f_string_dynamic_t directory; + f_string_dynamic_t file; bool require; bool asynchronous; } init_rule; #define init_rule_initialize \ { \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ - f_string_dynamic_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ + f_string_dynamic_t_initialize, \ F_false, \ F_false, \ } #define delete_init_rule(status, rule) \ - f_macro_string_dynamic_delete(status, rule.name); \ + f_macro_string_dynamic_t_delete(status, rule.name); \ if (status == F_none) { \ - f_macro_string_dynamic_delete(status, rule.directory); \ + f_macro_string_dynamic_t_delete(status, rule.directory); \ } \ if (status == F_none) { \ - f_macro_string_dynamic_delete(status, rule.address); \ + f_macro_string_dynamic_t_delete(status, rule.address); \ } \ if (status == F_none) { \ rule.require = 0; \ @@ -63,25 +63,25 @@ extern "C" { } #define destroy_init_rule(status, rule) \ - f_macro_string_dynamic_destroy(status, rule.name); \ + f_macro_string_dynamic_t_destroy(status, rule.name); \ if (status == F_none) { \ - f_macro_string_dynamic_destroy(status, rule.directory); \ + f_macro_string_dynamic_t_destroy(status, rule.directory); \ } \ if (status == F_none) { \ - f_macro_string_dynamic_destroy(status, rule.address); \ + f_macro_string_dynamic_t_destroy(status, rule.address); \ } \ if (status == F_none) { \ rule.require = 0; \ rule.asynchronous = 0; \ } -#endif // _di_init_data_ +#endif // _di_init_data_t_ // an array of dynamic strings #ifndef _di_init_rules_ typedef struct { init_rule *array; // the array of init_rule - f_string_length size; // total amount of allocated space - f_string_length used; // total number of allocated spaces used + f_string_length_t size; // total amount of allocated space + f_string_length_t used; // total number of allocated spaces used } init_rules; #define init_rules_initialize { 0, 0, 0 } @@ -109,7 +109,7 @@ extern "C" { #define f_init_rules_resize(status, rules, new_length) \ status = F_none; \ if (new_length < rules.size) { \ - f_string_length i = rules.size - new_length; \ + f_string_length_t i = rules.size - new_length; \ for (; i < rules.size; i++) { \ delete_init_rule(status, rules.array[i]); \ if (status != F_none) break; \ @@ -118,9 +118,9 @@ extern "C" { if (status == F_none) status = f_memory_resize((void **) & rules.array, sizeof(init_rule), rules.size, new_length); \ if (status == F_none) { \ if (new_length > rules.size) { \ - f_string_length i = rules.size; \ + f_string_length_t i = rules.size; \ for (; i < new_length; i++) { \ - memset(&rules.array[i], 0, sizeof(f_string)); \ + memset(&rules.array[i], 0, sizeof(f_string_t)); \ } \ } \ rules.size = new_length; \ @@ -130,7 +130,7 @@ extern "C" { #define f_init_rules_adjust(status, rules, new_length) \ status = F_none; \ if (new_length < rules.size) { \ - f_string_length i = rules.size - new_length; \ + f_string_length_t i = rules.size - new_length; \ for (; i < rules.size; i++) { \ destroy_init_rule(status, rules.array[i]); \ if (status != F_none) break; \ @@ -139,7 +139,7 @@ extern "C" { if (status == F_none) status = f_memory_adjust((void **) & rules.array, sizeof(init_rule), rules.size, new_length); \ if (status == F_none) { \ if (new_length > rules.size) { \ - f_string_length i = rules.size; \ + f_string_length_t i = rules.size; \ for (; i < new_length; i++) { \ memset(&rules.array[i], 0, sizeof(init_rule)); \ } \ @@ -152,24 +152,24 @@ extern "C" { #ifndef _di_init_category_ // category [name] = execute rules in the specified list called [name]. typedef struct { - f_string_dynamic name; + f_string_dynamic_t name; init_rule last; } init_category; #define init_category_initialize \ { \ - f_string_dynamic_initialize, \ + f_string_dynamic_t_initialize, \ init_rule_initialize, \ } #define delete_init_category(status, category) \ - f_macro_string_dynamic_delete(status, category.name); \ + f_macro_string_dynamic_t_delete(status, category.name); \ if (status == F_none) { \ delete_init_rule(status, category.last); \ } #define destroy_init_category(status, category) \ - f_macro_string_dynamic_destroy(status, category.name); \ + f_macro_string_dynamic_t_destroy(status, category.name); \ if (status == F_none) { \ destroy_init_rule(status, category.last); \ } @@ -180,8 +180,8 @@ extern "C" { typedef struct { init_category *array; // the array of init_category - f_string_length size; // total amount of allocated space - f_string_length used; // total number of allocated spaces used + f_string_length_t size; // total amount of allocated space + f_string_length_t used; // total number of allocated spaces used } init_categorys; #define init_categorys_initialize { 0, 0, 0 } @@ -209,7 +209,7 @@ extern "C" { #define f_init_categorys_resize(status, categorys, new_length) \ status = F_none; \ if (new_length < categorys.size) { \ - f_string_length i = categorys.size - new_length; \ + f_string_length_t i = categorys.size - new_length; \ for (; i < categorys.size; i++) { \ delete_init_category(status, categorys.array[i]); \ if (status != F_none) break; \ @@ -218,9 +218,9 @@ extern "C" { if (status == F_none) status = f_memory_resize((void **) & categorys.array, sizeof(init_category), categorys.size, new_length); \ if (status == F_none) { \ if (new_length > categorys.size) { \ - f_string_length i = categorys.size; \ + f_string_length_t i = categorys.size; \ for (; i < new_length; i++) { \ - memset(&categorys.array[i], 0, sizeof(f_string)); \ + memset(&categorys.array[i], 0, sizeof(f_string_t)); \ } \ } \ categorys.size = new_length; \ @@ -230,7 +230,7 @@ extern "C" { #define f_init_categorys_adjust(status, categorys, new_length) \ status = F_none; \ if (new_length < categorys.size) { \ - f_string_length i = categorys.size - new_length; \ + f_string_length_t i = categorys.size - new_length; \ for (; i < categorys.size; i++) { \ destroy_init_category(status, categorys.array[i]); \ if (status != F_none) break; \ @@ -239,7 +239,7 @@ extern "C" { if (status == F_none) status = f_memory_adjust((void **) & categorys.array, sizeof(init_category), categorys.size, new_length); \ if (status == F_none) { \ if (new_length > categorys.size) { \ - f_string_length i = categorys.size; \ + f_string_length_t i = categorys.size; \ for (; i < new_length; i++) { \ memset(&categorys.array[i], 0, sizeof(init_category)); \ } \ @@ -251,7 +251,7 @@ extern "C" { #ifndef _di_init_setting_ typedef struct { - f_string socket_file; + f_string_t socket_file; unsigned int socket_port; unsigned int socket_id_target; unsigned int socket_id_client; @@ -267,7 +267,7 @@ extern "C" { #define init_setting_initialize \ { \ - f_string_initialize, \ + f_string_t_initialize, \ 0, \ 0, \ 0, \ @@ -289,7 +289,7 @@ typedef struct { void *login_file; void *login_port; - init_data data; + init_data_t data; init_setting setting; } init_stack_memory; @@ -326,7 +326,7 @@ typedef struct { #define init_path_processes_mounts init_paths_processes "mounts" /* #ifndef _di_init_rule_buffer_ - f_return_status init_rule_buffer(const init_data data, const f_string filename, f_string_dynamic *buffer, f_fss_objects *objects, f_fss_contents *contents) f_gcc_attribute_visibility_internal; + f_return_status init_rule_buffer(const init_data_t data, const f_string_t filename, f_string_dynamic_t *buffer, f_fss_objects_t *objects, f_fss_contents_t *contents) f_gcc_attribute_visibility_internal; #endif // _di_init_rule_buffer_ #ifndef _di_init_handler_chif_string_dynamic_initializeld_services_ @@ -356,7 +356,7 @@ typedef struct { #endif // _di_init_prepare_init_ #ifndef _di_init_process_main_rule_ - f_return_status init_process_main_rule(const init_data data, f_string_dynamic *buffer, init_setting *setting) f_gcc_attribute_visibility_internal; + f_return_status init_process_main_rule(const init_data_t data, f_string_dynamic_t *buffer, init_setting *setting) f_gcc_attribute_visibility_internal; #endif // _di_init_process_main_rule_ */ diff --git a/level_3/status_code/c/main.c b/level_3/status_code/c/main.c index 9226322..8973b92 100644 --- a/level_3/status_code/c/main.c +++ b/level_3/status_code/c/main.c @@ -1,14 +1,14 @@ #include "status_code.h" -int main(const unsigned long argc, const f_string *argv) { - const f_console_arguments arguments = { argc, argv }; - status_code_data data = status_code_data_initialize; +int main(const unsigned long argc, const f_string_t *argv) { + const f_console_arguments_t arguments = { argc, argv }; + status_code_data_t data = status_code_data_t_initialize; if (f_pipe_input_exists()) { data.process_pipe = F_true; } - f_status status = status_code_main(arguments, &data); + f_status_t status = status_code_main(arguments, &data); if (F_status_is_error(status) || status == F_false) { return 1; diff --git a/level_3/status_code/c/private-status_code.c b/level_3/status_code/c/private-status_code.c index e70d5c3..252e150 100644 --- a/level_3/status_code/c/private-status_code.c +++ b/level_3/status_code/c/private-status_code.c @@ -6,9 +6,9 @@ extern "C" { #endif #ifndef _di_status_code_process_check_ - f_return_status status_code_process_check(const status_code_data data, const f_string value) { - f_number_unsigned number = 0; - f_status status = status_code_convert_number(data, value, &number); + f_return_status status_code_process_check(const status_code_data_t data, const f_string_t value) { + f_number_unsigned_t number = 0; + f_status_t status = status_code_convert_number(data, value, &number); if (F_status_is_error(status)) { return status; @@ -44,13 +44,13 @@ extern "C" { #endif // _di_status_code_process_check_ #ifndef _di_status_code_process_number_ - f_return_status status_code_process_number(const status_code_data data, const f_string value) { - f_status status = F_none; + f_return_status status_code_process_number(const status_code_data_t data, const f_string_t value) { + f_status_t status = F_none; { - const f_string_range range = f_macro_string_range_initialize(strlen(value)); + const f_string_range_t range = f_macro_string_range_initialize(strlen(value)); - f_number_unsigned number = 0; + f_number_unsigned_t number = 0; status = fl_conversion_string_to_number_unsigned(value, &number, range); @@ -67,7 +67,7 @@ extern "C" { } } - f_status code = F_none; + f_status_t code = F_none; status = fll_status_from_string(value, &code); @@ -95,16 +95,16 @@ extern "C" { #endif // _di_status_code_process_number_ #ifndef _di_status_code_process_normal_ - f_return_status status_code_process_normal(const status_code_data data, const f_string value) { - f_number_unsigned number = 0; - f_status status = status_code_convert_number(data, value, &number); + f_return_status status_code_process_normal(const status_code_data_t data, const f_string_t value) { + f_number_unsigned_t number = 0; + f_status_t status = status_code_convert_number(data, value, &number); if (F_status_is_error(status)) { return status; } - const f_status code = (f_status) number; - f_string string = 0; + const f_status_t code = (f_status_t) number; + f_string_t string = 0; status = fl_status_to_string(code, &string); @@ -126,10 +126,10 @@ extern "C" { #endif // _di_status_code_process_normal_ #ifndef _di_status_code_convert_number_ - f_return_status status_code_convert_number(const status_code_data data, const f_string value, f_number_unsigned *number) { - const f_string_range range = f_macro_string_range_initialize(strlen(value)); + f_return_status status_code_convert_number(const status_code_data_t data, const f_string_t value, f_number_unsigned_t *number) { + const f_string_range_t range = f_macro_string_range_initialize(strlen(value)); - f_status status = fl_conversion_string_to_number_unsigned(value, number, range); + f_status_t status = fl_conversion_string_to_number_unsigned(value, number, range); if (*number > F_status_size_max_with_signal) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range"); diff --git a/level_3/status_code/c/private-status_code.h b/level_3/status_code/c/private-status_code.h index 74ad01c..dd57ab3 100644 --- a/level_3/status_code/c/private-status_code.h +++ b/level_3/status_code/c/private-status_code.h @@ -34,7 +34,7 @@ extern "C" { * @see fss_status_code_convert_number() */ #ifndef _di_status_code_process_check_ - extern f_return_status status_code_process_check(const status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; + extern f_return_status status_code_process_check(const status_code_data_t data, const f_string_t value) f_gcc_attribute_visibility_internal; #endif // _di_status_code_process_check_ /** @@ -56,7 +56,7 @@ extern "C" { * @see fll_fss_status_from_string() */ #ifndef _di_status_code_process_number_ - extern f_return_status status_code_process_number(const status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; + extern f_return_status status_code_process_number(const status_code_data_t data, const f_string_t value) f_gcc_attribute_visibility_internal; #endif // _di_status_code_process_number_ /** @@ -83,7 +83,7 @@ extern "C" { * @see fss_status_code_convert_number() */ #ifndef _di_status_code_process_normal_ - extern f_return_status status_code_process_normal(const status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; + extern f_return_status status_code_process_normal(const status_code_data_t data, const f_string_t value) f_gcc_attribute_visibility_internal; #endif // _di_status_code_process_normal_ /** @@ -111,7 +111,7 @@ extern "C" { * @see fl_console_parameter_to_number_unsigned() */ #ifndef _di_status_code_convert_number_ - extern f_return_status status_code_convert_number(const status_code_data data, const f_string value, f_number_unsigned *number) f_gcc_attribute_visibility_internal; + extern f_return_status status_code_convert_number(const status_code_data_t data, const f_string_t value, f_number_unsigned_t *number) f_gcc_attribute_visibility_internal; #endif // _di_status_code_convert_number_ #ifdef __cplusplus diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index 0074b34..e70e1ff 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_status_code_print_help_ - f_return_status status_code_print_help(const fl_color_context context) { + f_return_status status_code_print_help(const fl_color_context_t context) { fll_program_print_help_header(context, status_code_name_long, status_code_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -29,13 +29,13 @@ extern "C" { #endif // _di_status_code_print_help_ #ifndef _di_status_code_main_ - f_return_status status_code_main(const f_console_arguments arguments, status_code_data *data) { - f_status status = F_none; + f_return_status status_code_main(const f_console_arguments_t arguments, status_code_data_t *data) { + f_status_t status = F_none; { - f_console_parameters parameters = { data->parameters, status_code_total_parameters }; - f_console_parameter_id ids[3] = { status_code_parameter_no_color, status_code_parameter_light, status_code_parameter_dark }; - f_console_parameter_ids choices = { ids, 3 }; + f_console_parameters_t parameters = { data->parameters, status_code_total_parameters }; + f_console_parameter_id_t ids[3] = { status_code_parameter_no_color, status_code_parameter_light, status_code_parameter_dark }; + f_console_parameter_ids_t choices = { ids, 3 }; status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); @@ -100,7 +100,7 @@ extern "C" { return F_status_set_error(F_parameter); } - f_status status2 = F_none; + f_status_t status2 = F_none; if (data->parameters[status_code_parameter_is_error].result == f_console_result_found || data->parameters[status_code_parameter_is_warning].result == f_console_result_found || data->parameters[status_code_parameter_is_fine].result == f_console_result_found) { if (data->process_pipe) { @@ -108,7 +108,7 @@ extern "C" { } if (data->remaining.used > 0) { - for (f_array_length i = 0; i < data->remaining.used; i++) { + for (f_array_length_t i = 0; i < data->remaining.used; i++) { status2 = status_code_process_check(*data, arguments.argv[data->remaining.array[i]]); if (F_status_is_error(status2) && status == F_none) { @@ -123,7 +123,7 @@ extern "C" { } if (data->remaining.used > 0) { - for (f_array_length i = 0; i < data->remaining.used; i++) { + for (f_array_length_t i = 0; i < data->remaining.used; i++) { status2 = status_code_process_number(*data, arguments.argv[data->remaining.array[i]]); if (F_status_is_error(status2) && status == F_none) { @@ -138,7 +138,7 @@ extern "C" { } if (data->remaining.used > 0) { - for (f_array_length i = 0; i < data->remaining.used; i++) { + for (f_array_length_t i = 0; i < data->remaining.used; i++) { status2 = status_code_process_normal(*data, arguments.argv[data->remaining.array[i]]); if (F_status_is_error(status2) && status == F_none) { @@ -154,17 +154,17 @@ extern "C" { #endif // _di_status_code_main_ #ifndef _di_status_code_delete_data_ - f_return_status status_code_delete_data(status_code_data *data) { - f_string_length i = 0; + f_return_status status_code_delete_data(status_code_data_t *data) { + f_string_length_t i = 0; while (i < status_code_total_parameters) { - f_macro_string_lengths_delete_simple(data->parameters[i].locations); - f_macro_string_lengths_delete_simple(data->parameters[i].additional); + f_macro_string_lengths_t_delete_simple(data->parameters[i].locations); + f_macro_string_lengths_t_delete_simple(data->parameters[i].additional); i++; } // while - f_macro_string_lengths_delete_simple(data->remaining); - fl_macro_color_context_delete_simple(data->context); + f_macro_string_lengths_t_delete_simple(data->remaining); + fl_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/status_code/c/status_code.h b/level_3/status_code/c/status_code.h index 3534683..0a9ab14 100644 --- a/level_3/status_code/c/status_code.h +++ b/level_3/status_code/c/status_code.h @@ -76,40 +76,40 @@ extern "C" { status_code_parameter_number, }; - #define f_console_parameter_initialize_status_code \ + #define status_code_console_parameter_t_initialize \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ - f_console_parameter_initialize(status_code_short_is_fine, status_code_long_is_fine, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(status_code_short_is_warning, status_code_long_is_warning, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(status_code_short_is_error, status_code_long_is_error, 0, F_false, f_console_type_normal), \ - f_console_parameter_initialize(status_code_short_number, status_code_long_number, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_t_initialize(status_code_short_is_fine, status_code_long_is_fine, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(status_code_short_is_warning, status_code_long_is_warning, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(status_code_short_is_error, status_code_long_is_error, 0, F_false, f_console_type_normal), \ + f_console_parameter_t_initialize(status_code_short_number, status_code_long_number, 0, F_false, f_console_type_normal), \ } #define status_code_total_parameters 9 #endif // _di_status_code_defines_ -#ifndef _di_status_code_data_ +#ifndef _di_status_code_data_t_ typedef struct { - f_console_parameter parameters[status_code_total_parameters]; + f_console_parameter_t parameters[status_code_total_parameters]; - f_string_lengths remaining; + f_string_lengths_t remaining; bool process_pipe; - fl_color_context context; - } status_code_data; + fl_color_context_t context; + } status_code_data_t; - #define status_code_data_initialize \ + #define status_code_data_t_initialize \ { \ - f_console_parameter_initialize_status_code, \ - f_string_lengths_initialize, \ + status_code_console_parameter_t_initialize, \ + f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_initialize, \ + fl_color_context_t_initialize, \ } -#endif // _di_status_code_data_ +#endif // _di_status_code_data_t_ /** * Print help to standard output. @@ -121,7 +121,7 @@ extern "C" { * F_none on success. */ #ifndef _di_status_code_print_help_ - extern f_return_status status_code_print_help(const fl_color_context context); + extern f_return_status status_code_print_help(const fl_color_context_t context); #endif // _di_status_code_print_help_ /** @@ -142,7 +142,7 @@ extern "C" { * @see status_code_delete_data() */ #ifndef _di_status_code_main_ - extern f_return_status status_code_main(const f_console_arguments arguments, status_code_data *data); + extern f_return_status status_code_main(const f_console_arguments_t arguments, status_code_data_t *data); #endif // _di_status_code_main_ /** @@ -161,7 +161,7 @@ extern "C" { * @see status_code_main() */ #ifndef _di_status_code_delete_data_ - extern f_return_status status_code_delete_data(status_code_data *data); + extern f_return_status status_code_delete_data(status_code_data_t *data); #endif // _di_status_code_delete_data_ #ifdef __cplusplus