From 5f43af0080130ac3fb1314c0541d909d5bbc178e Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 25 Jul 2019 21:31:55 -0500 Subject: [PATCH] Revert: remove custom type defines, including use of f_autochar The intent of these custom types is to allow for easily replacing what the type represents. I have decided that this extent of doing such is overkill. Revert the custom types to instead rely on the C/C++ defined types, where appropriate. After having gained more experience with utf-8 an other unicode standards, I have come to conclude that the wchar type should not be used. This project will support the char type instead of the wchar type. All uses have been replaced with char. --- level_0/f_colors/c/colors.h | 130 ++++++++++----------- level_0/f_console/c/console.c | 4 +- level_0/f_console/c/console.h | 14 +-- level_0/f_conversion/c/conversion.c | 12 +- level_0/f_conversion/c/conversion.h | 12 +- level_0/f_file/c/file.c | 24 ++-- level_0/f_file/c/file.h | 23 ++-- level_0/f_fss/c/fss.h | 10 +- level_0/f_memory/c/memory.c | 20 ++-- level_0/f_memory/c/memory.h | 30 ++--- level_0/f_pipe/c/pipe.c | 2 +- level_0/f_pipe/c/pipe.h | 2 +- level_0/f_print/c/print.c | 6 +- level_0/f_print/c/print.h | 6 +- level_0/f_strings/c/strings.h | 48 ++++---- level_0/f_types/c/types.h | 40 ++----- level_1/fl_colors/c/colors.c | 10 +- level_1/fl_colors/c/colors.h | 10 +- level_1/fl_console/c/console.c | 2 +- level_1/fl_console/c/console.h | 2 +- level_1/fl_directory/c/directory.c | 8 +- level_1/fl_directory/c/directory.h | 2 +- level_1/fl_errors/c/errors.c | 8 +- level_1/fl_errors/c/errors.h | 8 +- level_1/fl_file/c/file.c | 11 +- level_1/fl_file/c/file.h | 8 +- level_1/fl_fss/c/fss.c | 4 +- level_1/fl_fss/c/fss.h | 6 +- level_1/fl_fss/c/fss_basic.c | 6 +- level_1/fl_fss/c/fss_basic.h | 8 +- level_1/fl_fss/c/fss_basic_list.c | 4 +- level_1/fl_fss/c/fss_basic_list.h | 8 +- level_1/fl_fss/c/fss_extended.c | 10 +- level_1/fl_fss/c/fss_extended.h | 8 +- level_1/fl_serialized/c/serialized.c | 12 +- level_1/fl_serialized/c/serialized.h | 6 +- level_1/fl_socket/c/socket.h | 6 +- level_1/fl_strings/c/strings.c | 16 +-- level_1/fl_strings/c/strings.h | 14 +-- level_2/fll_colors/c/colors.c | 2 +- level_2/fll_colors/c/colors.h | 2 +- level_2/fll_execute/c/execute.c | 8 +- level_2/fll_execute/c/execute.h | 4 +- level_2/fll_fss/c/fss_basic.c | 2 +- level_2/fll_fss/c/fss_basic.h | 4 +- level_2/fll_fss/c/fss_basic_list.c | 2 +- level_2/fll_fss/c/fss_basic_list.h | 4 +- level_2/fll_fss/c/fss_errors.c | 8 +- level_2/fll_fss/c/fss_errors.h | 8 +- level_2/fll_fss/c/fss_extended.c | 2 +- level_2/fll_fss/c/fss_extended.h | 4 +- level_3/firewall/c/firewall.c | 12 +- level_3/firewall/c/firewall.h | 8 +- level_3/firewall/c/private-firewall.c | 4 +- level_3/firewall/c/private-firewall.h | 6 +- .../fss_basic_list_read/c/fss_basic_list_read.c | 10 +- .../fss_basic_list_read/c/fss_basic_list_read.h | 8 +- .../fss_basic_list_write/c/fss_basic_list_write.c | 6 +- .../fss_basic_list_write/c/fss_basic_list_write.h | 8 +- level_3/fss_basic_read/c/fss_basic_read.c | 10 +- level_3/fss_basic_read/c/fss_basic_read.h | 8 +- level_3/fss_basic_write/c/fss_basic_write.c | 6 +- level_3/fss_basic_write/c/fss_basic_write.h | 8 +- level_3/fss_extended_read/c/fss_extended_read.c | 10 +- level_3/fss_extended_read/c/fss_extended_read.h | 8 +- level_3/fss_extended_write/c/fss_extended_write.c | 6 +- level_3/fss_extended_write/c/fss_extended_write.h | 8 +- level_3/fss_return_code/c/fss_return_code.c | 6 +- level_3/fss_return_code/c/fss_return_code.h | 8 +- level_3/return_code/c/return_code.c | 6 +- level_3/return_code/c/return_code.h | 8 +- 71 files changed, 369 insertions(+), 395 deletions(-) diff --git a/level_0/f_colors/c/colors.h b/level_0/f_colors/c/colors.h index bfb2dc6..08f6bb6 100644 --- a/level_0/f_colors/c/colors.h +++ b/level_0/f_colors/c/colors.h @@ -35,11 +35,11 @@ extern "C" { // instead, they are intended to only point to existing data, so these should neither be allocated nor deallocated #ifndef _di_f_color_control_ typedef struct f_color_control { - f_const f_autochar *bold; - f_const f_autochar *underline; - f_const f_autochar *blink; - f_const f_autochar *reverse; - f_const f_autochar *conceal; + const char *bold; + const char *underline; + const char *blink; + const char *reverse; + const char *conceal; } f_color_control; #define f_color_control_names_initialize { "bold", "underline", "blink", "reverse", "conceal" } @@ -47,12 +47,12 @@ extern "C" { #ifndef _di_f_color_standard_io_ typedef struct { - f_const f_autochar *message; - f_const f_autochar *warning; - f_const f_autochar *error; - f_const f_autochar *strong_message; // an emphasized message - f_const f_autochar *strong_warning; // an emphasized warning - f_const f_autochar *strong_error; // an emphasized error + const char *message; + const char *warning; + const char *error; + const char *strong_message; // an emphasized message + const char *strong_warning; // an emphasized warning + const char *strong_error; // an emphasized error } f_color_standard_io; #define f_color_standard_io_names_initialize { "message", "warning", "error", "strong_message", "strong_warning", "strong_error" } @@ -60,15 +60,15 @@ extern "C" { #ifndef _di_f_color_help_ typedef struct { - f_const f_autochar *title; // name printed - f_const f_autochar *version; // version printed - f_const f_autochar *topic; // topic such as 'Usage' - f_const f_autochar *command; // color for a specific command, such as '-h' - f_const f_autochar *syntax; // color for syntax, such as '[' and '<' - f_const f_autochar *alert; // some form of alert such as 'Not Implemented Yet' - f_const f_autochar *comment; // not quite important text, but still should be seen - f_const f_autochar *standard; // the normal text color - f_const f_autochar *emphasize; // make sure something stands out to emphasize it + const char *title; // name printed + const char *version; // version printed + const char *topic; // topic such as 'Usage' + const char *command; // color for a specific command, such as '-h' + const char *syntax; // color for syntax, such as '[' and '<' + const char *alert; // some form of alert such as 'Not Implemented Yet' + const char *comment; // not quite important text, but still should be seen + const char *standard; // the normal text color + const char *emphasize; // make sure something stands out to emphasize it } f_color_help; #define f_color_help_names_initialize { "title", "version", "topic", "command", "syntax", "alert", "comment", "standard", "emphasize" } @@ -76,9 +76,9 @@ extern "C" { #ifndef _di_f_colors_format_ typedef struct { - f_const f_autochar *begin; - f_const f_autochar *medium; - f_const f_autochar *end; + const char *begin; + const char *medium; + const char *end; } f_colors_format; #define f_colors_format_initialize_linux { "\033[", ";", "m" } @@ -87,44 +87,44 @@ extern "C" { #ifndef _di_f_colors_ typedef struct { - f_const f_autochar *reset; - f_const f_autochar *bold; - f_const f_autochar *underline; - f_const f_autochar *blink; - f_const f_autochar *reverse; - f_const f_autochar *conceal; - f_const f_autochar *black; - f_const f_autochar *red; - f_const f_autochar *green; - f_const f_autochar *yellow; - f_const f_autochar *blue; - f_const f_autochar *purple; - f_const f_autochar *teal; - f_const f_autochar *white; - f_const f_autochar *black_bg; - f_const f_autochar *red_bg; - f_const f_autochar *green_bg; - f_const f_autochar *yellow_bg; - f_const f_autochar *blue_bg; - f_const f_autochar *purple_bg; - f_const f_autochar *teal_bg; - f_const f_autochar *white_bg; - f_const f_autochar *bright_black; - f_const f_autochar *bright_red; - f_const f_autochar *bright_green; - f_const f_autochar *bright_yellow; - f_const f_autochar *bright_blue; - f_const f_autochar *bright_purple; - f_const f_autochar *bright_teal; - f_const f_autochar *bright_white; - f_const f_autochar *bright_black_bg; - f_const f_autochar *bright_red_bg; - f_const f_autochar *bright_green_bg; - f_const f_autochar *bright_yellow_bg; - f_const f_autochar *bright_blue_bg; - f_const f_autochar *bright_purple_bg; - f_const f_autochar *bright_teal_bg; - f_const f_autochar *bright_white_bg; + const char *reset; + const char *bold; + const char *underline; + const char *blink; + const char *reverse; + const char *conceal; + const char *black; + const char *red; + const char *green; + const char *yellow; + const char *blue; + const char *purple; + const char *teal; + const char *white; + const char *black_bg; + const char *red_bg; + const char *green_bg; + const char *yellow_bg; + const char *blue_bg; + const char *purple_bg; + const char *teal_bg; + const char *white_bg; + const char *bright_black; + const char *bright_red; + const char *bright_green; + const char *bright_yellow; + const char *bright_blue; + const char *bright_purple; + const char *bright_teal; + const char *bright_white; + const char *bright_black_bg; + const char *bright_red_bg; + const char *bright_green_bg; + const char *bright_yellow_bg; + const char *bright_blue_bg; + const char *bright_purple_bg; + const char *bright_teal_bg; + const char *bright_white_bg; } f_colors; #define f_colors_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" } @@ -132,10 +132,10 @@ extern "C" { #endif // _di_f_colors_ #ifndef _di_f_default_colors_ - static f_const f_colors_format f_colors_format_linux = f_colors_format_initialize_linux; - static f_const f_colors_format f_colors_format_xterminal = f_colors_format_initialize_xterminal; - static f_const f_colors f_colors_linux = f_colors_initialize_linux; - static f_const f_colors f_colors_xterminal = f_colors_initialize_xterminal; + static const f_colors_format f_colors_format_linux = f_colors_format_initialize_linux; + static const f_colors_format f_colors_format_xterminal = f_colors_format_initialize_xterminal; + static const f_colors f_colors_linux = f_colors_initialize_linux; + static const f_colors f_colors_xterminal = f_colors_initialize_xterminal; #endif // _di_f_default_colors_ #ifdef __cplusplus diff --git a/level_0/f_console/c/console.c b/level_0/f_console/c/console.c index 8953760..1d110ac 100644 --- a/level_0/f_console/c/console.c +++ b/level_0/f_console/c/console.c @@ -11,12 +11,12 @@ extern "C" { #endif #ifndef _di_f_console_identify_ - f_return_status f_console_identify(f_const f_string input, f_console_id *result) { + f_return_status f_console_identify(const f_string input, f_console_id *result) { #ifndef _di_level_0_parameter_checking_ if (result == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ - f_const f_string_length length = strnlen(input, 4); + const f_string_length length = strnlen(input, 4); if (length == 0) { *result = f_console_none; diff --git a/level_0/f_console/c/console.h b/level_0/f_console/c/console.h index 49a8768..d81175e 100644 --- a/level_0/f_console/c/console.h +++ b/level_0/f_console/c/console.h @@ -93,13 +93,13 @@ extern "C" { #ifndef _di_f_console_parameter_ typedef struct { - f_const f_autochar *symbol_short; - f_const f_autochar *symbol_long; - f_const f_autochar *symbol_extra; - f_const f_autochar *symbol_other; + const char *symbol_short; + const char *symbol_long; + const char *symbol_extra; + const char *symbol_other; - f_const f_bool has_additional; - f_const f_u_int type; + const f_bool has_additional; + const f_u_int type; f_u_int result; f_string_lengths additional; f_string_length length; @@ -112,7 +112,7 @@ extern "C" { #ifndef _di_f_console_identify_ // This is used to help standardize a single method of handling command line option parsing. // This should allow for every single command line program to use the same form of syntax for command line options. - f_extern f_return_status f_console_identify(f_const f_string input, f_console_id *result); + extern f_return_status f_console_identify(const f_string input, f_console_id *result); #endif // _di_f_console_identify_ // perform checks against short & long options to see if the string is one of them (normal) diff --git a/level_0/f_conversion/c/conversion.c b/level_0/f_conversion/c/conversion.c index 5889548..f5c7ffc 100644 --- a/level_0/f_conversion/c/conversion.c +++ b/level_0/f_conversion/c/conversion.c @@ -11,7 +11,7 @@ extern "C" { #endif #ifndef _di_f_is_digit_ - f_return_status f_is_digit(f_const f_autochar character) { + f_return_status f_is_digit(const char character) { // at this point, it seems that it would incur more overhead to use the libc isdigit here, so just use one less call and test it here switch (character) { @@ -35,7 +35,7 @@ extern "C" { #endif // _di_f_is_digit_ #ifndef _di_f_is_hexdigit_ - f_return_status f_is_hexdigit(f_const f_autochar character) { + f_return_status f_is_hexdigit(const char character) { switch (character) { case '0': @@ -68,7 +68,7 @@ extern "C" { #endif // _di_f_is_hexdigit_ #ifndef _di_f_character_to_digit_ - f_return_status f_character_to_digit(f_const f_autochar character, f_u_long *digit) { + f_return_status f_character_to_digit(const char character, f_u_long *digit) { #ifndef _di_level_0_parameter_checking_ if (digit == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -93,7 +93,7 @@ extern "C" { #endif // _di_f_character_to_digit_ #ifndef _di_f_character_to_hexdigit_ - f_return_status f_character_to_hexdigit(f_const f_autochar character, f_u_long *digit) { + f_return_status f_character_to_hexdigit(const char character, f_u_long *digit) { #ifndef _di_level_0_parameter_checking_ if (digit == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -130,7 +130,7 @@ extern "C" { #endif // _di_f_character_to_hexdigit_ #ifndef _di_f_string_to_digit_ - f_return_status f_string_to_digit(f_const f_string string, f_u_long *digit, f_const f_string_location location) { + f_return_status f_string_to_digit(const f_string string, f_u_long *digit, const f_string_location location) { #ifndef _di_level_0_parameter_checking_ if (digit == 0) return f_error_set_error(f_invalid_parameter); if (location.start < 0) return f_error_set_error(f_invalid_parameter); @@ -165,7 +165,7 @@ extern "C" { #endif // _di_f_string_to_digit_ #ifndef _di_f_string_to_hexdigit_ - f_return_status f_string_to_hexdigit(f_const f_string string, f_u_long *digit, f_const f_string_location location) { + f_return_status f_string_to_hexdigit(const f_string string, f_u_long *digit, const f_string_location location) { #ifndef _di_level_0_parameter_checking_ if (digit == 0) return f_error_set_error(f_invalid_parameter); if (location.start < 0) return f_error_set_error(f_invalid_parameter); diff --git a/level_0/f_conversion/c/conversion.h b/level_0/f_conversion/c/conversion.h index d6d1f7a..161a045 100644 --- a/level_0/f_conversion/c/conversion.h +++ b/level_0/f_conversion/c/conversion.h @@ -33,36 +33,36 @@ extern "C" { #ifndef _di_f_is_digit_ // convert a single character into the digit that it represents - f_extern f_return_status f_is_digit(f_const f_autochar character); + extern f_return_status f_is_digit(const char character); #endif // _di_f_is_digit_ #ifndef _di_f_is_hexdigit_ // convert a single character into the hexidecimal digit that it represents - f_extern f_return_status f_is_hexdigit(f_const f_autochar character); + extern f_return_status f_is_hexdigit(const char character); #endif // _di_f_is_hexdigit_ #ifndef _di_f_character_to_digit_ // convert a single character into the digit that it represents - f_extern f_return_status f_character_to_digit(f_const f_autochar character, f_u_long *digit); + extern f_return_status f_character_to_digit(const char character, f_u_long *digit); #endif // _di_f_character_to_digit_ #ifndef _di_f_character_to_hexdigit_ // convert a single character into the hexidecimal digit that it represents - f_extern f_return_status f_character_to_hexdigit(f_const f_autochar character, f_u_long *digit); + extern f_return_status f_character_to_hexdigit(const char character, f_u_long *digit); #endif // _di_f_character_to_hexdigit_ #ifndef _di_f_string_to_digit_ // works like atoi, except there is a start/stop range // convert a series of positive numbers into a string, stopping at one of the following: EOS, max_length, or a non-digit // will not process signed statuses (+/-) - f_extern f_return_status f_string_to_digit(f_const f_string string, f_u_long *digit, f_const f_string_location location); + extern f_return_status f_string_to_digit(const f_string string, f_u_long *digit, const f_string_location location); #endif // _di_f_string_to_digit_ #ifndef _di_f_string_to_hexdigit_ // works like atoi, except there is a start/stop range and that this is for hexidecimal digits // convert a series of positive numbers into a string, stopping at one of the following: EOS, max_length, or a non-hexdigit // will not process signed statuses (+/-) - f_extern f_return_status f_string_to_hexdigit(f_const f_string string, f_u_long *digit, f_const f_string_location location); + extern f_return_status f_string_to_hexdigit(const f_string string, f_u_long *digit, const f_string_location location); #endif // _di_f_string_to_hexdigit_ #ifdef __cplusplus diff --git a/level_0/f_file/c/file.c b/level_0/f_file/c/file.c index bace897..0a53153 100644 --- a/level_0/f_file/c/file.c +++ b/level_0/f_file/c/file.c @@ -15,7 +15,7 @@ extern "C" { #endif #ifndef _di_f_file_open_ - f_return_status f_file_open(f_file *file_information, f_const f_string filename) { + f_return_status f_file_open(f_file *file_information, const f_string filename) { #ifndef _di_level_0_parameter_checking_ if (file_information == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -72,7 +72,7 @@ extern "C" { #endif // _di_f_file_flush_ #ifndef _di_f_file_read_ - f_return_status f_file_read(f_file *file_information, f_dynamic_string *buffer, f_const f_file_position location) { + f_return_status f_file_read(f_file *file_information, f_dynamic_string *buffer, const f_file_position location) { #ifndef _di_level_0_parameter_checking_ if (file_information == 0) return f_error_set_error(f_invalid_parameter); if (buffer->used >= buffer->size) return f_error_set_error(f_invalid_parameter); @@ -162,14 +162,14 @@ extern "C" { #endif // _di_f_file_read_fifo_ #ifndef _di_f_file_stat_ - f_return_status f_file_stat(f_const f_string file, f_stat *stat) { - if (stat != 0) { + f_return_status f_file_stat(const f_string file, struct stat *file_stat) { + if (file_stat != 0) { return f_none; } - f_int result = 0; + f_s_int result = 0; - result = stat(file, stat); + result = stat(file, file_stat); if (result < 0) { if (errno == ENAMETOOLONG || errno == EFAULT) { return f_error_set_error(f_invalid_parameter); @@ -186,7 +186,7 @@ extern "C" { else if (errno == ENOENT) { return f_file_not_found; } - else if (errno == EACCESS) { + else if (errno == EACCES) { return f_error_set_error(f_access_denied); } else if (errno == ELOOP) { @@ -201,18 +201,18 @@ extern "C" { #endif // _di_f_file_stat_ #ifndef _di_f_file_stat_by_id_ - f_return_status f_file_stat_by_id(f_const f_s_int file_id, f_stat *stat) { + f_return_status f_file_stat_by_id(const f_s_int file_id, struct stat *file_stat) { #ifndef _di_level_0_parameter_checking_ if (file_id <= 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ - if (stat != 0) { + if (file_stat != 0) { return f_none; } - f_int result = 0; + f_s_int result = 0; - result = stat(file, stat); + result = fstat(file_id, file_stat); if (result < 0) { if (errno == ENAMETOOLONG || errno == EFAULT) { return f_error_set_error(f_invalid_parameter); @@ -229,7 +229,7 @@ extern "C" { else if (errno == ENOENT) { return f_file_not_found; } - else if (errno == EACCESS) { + else if (errno == EACCES) { return f_error_set_error(f_access_denied); } else if (errno == ELOOP) { diff --git a/level_0/f_file/c/file.h b/level_0/f_file/c/file.h index 745421d..1d0985f 100644 --- a/level_0/f_file/c/file.h +++ b/level_0/f_file/c/file.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -30,7 +31,7 @@ extern "C" { #ifndef _di_f_file_types_ typedef f_s_int f_file_id; typedef f_string f_file_mode; - typedef f_mode_t f_file_mask; + typedef mode_t f_file_mask; #define f_file_default_read_size 4096 // default to 4k read sizes #define f_file_max_path_length 1024 @@ -54,12 +55,12 @@ extern "C" { #ifndef _di_f_file_ typedef struct { f_file_id id; // file descriptor - f_file_p file; // the file data type + FILE * file; // the file data type f_file_mode mode; // how the file is to be accessed (or is being accessed) - f_size_t byte_size; // how many bytes to use on each read/write (for normal string handling this should be sizeof(f_string) + size_t byte_size; // how many bytes to use on each read/write (for normal string handling this should be sizeof(f_string) } f_file; - #define f_file_initialize { 0, 0, (f_file_mode) f_file_read_only, sizeof(f_autochar) } + #define f_file_initialize { 0, 0, (f_file_mode) f_file_read_only, sizeof(char) } #endif // _di_f_file_ #ifndef _di_f_file_position_ @@ -198,35 +199,35 @@ extern "C" { #ifndef _di_f_file_open_ // open a particular file and save its stream // filename = name of the file - f_extern f_return_status f_file_open(f_file *file_information, f_const f_string filename); + extern f_return_status f_file_open(f_file *file_information, const f_string filename); #endif // _di_f_file_open_ #ifndef _di_f_file_close_ // close file - f_extern f_return_status f_file_close(f_file *file_information); + extern f_return_status f_file_close(f_file *file_information); #endif // _di_f_file_close_ #ifndef _di_f_file_flush_ // flush file - f_extern f_return_status f_file_flush(f_file *file_information); + extern f_return_status f_file_flush(f_file *file_information); #endif // _di_f_file_flush_ #ifndef _di_f_file_read_ // read a given amount of data from the buffer, will auto-seek to where - f_extern f_return_status f_file_read(f_file *file_information, f_dynamic_string *buffer, f_const f_file_position location); + extern f_return_status f_file_read(f_file *file_information, f_dynamic_string *buffer, const f_file_position location); #endif // _di_f_file_read_ #ifndef _di_f_file_read_fifo_ // read a given amount of data from the buffer, will not auto seek - f_extern f_return_status f_file_read_fifo(f_file *file_information, f_dynamic_string *buffer); + extern f_return_status f_file_read_fifo(f_file *file_information, f_dynamic_string *buffer); #endif // _di_f_file_read_fifo_ #ifndef _di_f_file_stat_ - f_extern f_return_status f_file_stat(f_const f_string file, f_stat *stat); + extern f_return_status f_file_stat(const f_string file, struct stat *file_stat); #endif // _di_f_file_stat_ #ifndef _di_f_file_stat_by_id_ - f_extern f_return_status f_file_stat_by_id(f_const f_s_int file_id, f_stat *stat); + extern f_return_status f_file_stat_by_id(const f_s_int file_id, struct stat *file_stat); #endif // _di_f_file_stat_by_id_ #ifdef __cplusplus diff --git a/level_0/f_fss/c/fss.h b/level_0/f_fss/c/fss.h index 20d00e7..0f0634c 100644 --- a/level_0/f_fss/c/fss.h +++ b/level_0/f_fss/c/fss.h @@ -136,15 +136,15 @@ enum { typedef f_string_location f_fss_object; #define f_fss_object_initialize f_string_location_initialize - #define f_new_fss_object(status, object, length) status = f_new_array((f_void_p *) & object, sizeof(f_fss_object), length) - #define f_delete_fss_object(status, object) status = f_delete((f_void_p *) & object) - #define f_destroy_fss_object(status, object, size) status = f_destroy((f_void_p *) & object, sizeof(f_fss_object), size) + #define f_new_fss_object(status, object, length) status = f_new_array((void **) & object, sizeof(f_fss_object), length) + #define f_delete_fss_object(status, object) status = f_delete((void **) & object) + #define f_destroy_fss_object(status, object, size) status = f_destroy((void **) & object, sizeof(f_fss_object), size) #define f_resize_fss_object(status, object, old_length, new_length) \ - status = f_resize((f_void_p *) & object, sizeof(f_fss_object), old_length, new_length) + status = f_resize((void **) & object, sizeof(f_fss_object), old_length, new_length) #define f_adjust_fss_object(status, object, old_length, new_length) \ - status = f_adjust((f_void_p *) & object, sizeof(f_fss_object), old_length, new_length) + status = f_adjust((void **) & object, sizeof(f_fss_object), old_length, new_length) #endif // _di_fss_object_ // This holds an array of fss_object diff --git a/level_0/f_memory/c/memory.c b/level_0/f_memory/c/memory.c index fddab06..2dacf27 100644 --- a/level_0/f_memory/c/memory.c +++ b/level_0/f_memory/c/memory.c @@ -14,7 +14,7 @@ extern "C" { #endif #ifndef _di_f_new_ - f_return_status f_new_array(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length) { + f_return_status f_new_array(void **pointer, const f_memory_size_t type, const f_memory_length length) { #ifndef _di_level_0_parameter_checking_ if (type <= 0) return f_error_set_error(f_invalid_parameter); if (pointer == 0) return f_error_set_error(f_invalid_parameter); @@ -36,7 +36,7 @@ extern "C" { #endif // _di_f_new_ #if ! ( defined (_di_f_delete_) || defined (_f_memory_FORCE_secure_memory_) ) - f_return_status f_delete(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length) { + f_return_status f_delete(void **pointer, const f_memory_size_t type, const f_memory_length length) { #ifndef _di_level_0_parameter_checking_ if (pointer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -54,7 +54,7 @@ extern "C" { #endif // ! ( defined (_di_f_delete_) || defined (_f_memory_FORCE_secure_memory_) ) #if ! ( defined (_di_f_destroy_) || defined (_f_memory_FORCE_fast_memory_) ) - f_return_status f_destroy(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length) { + f_return_status f_destroy(void **pointer, const f_memory_size_t type, const f_memory_length length) { #ifndef _di_level_0_parameter_checking_ if (length < 0) return f_error_set_error(f_invalid_parameter); if (type <= 0) return f_error_set_error(f_invalid_parameter); @@ -78,7 +78,7 @@ extern "C" { #endif // ! ( defined (_di_f_destroy_) || defined (_f_memory_FORCE_fast_memory_) ) #if ! ( defined (_di_f_resize_) || defined (_f_memory_FORCE_secure_memory_) ) - f_return_status f_resize(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length old_length, f_const f_memory_length new_length) { + f_return_status f_resize(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length) { #ifndef _di_level_0_parameter_checking_ if (type <= 0) return f_error_set_error(f_invalid_parameter); if (old_length < 0) return f_error_set_error(f_invalid_parameter); @@ -90,7 +90,7 @@ extern "C" { if (old_length == new_length) return f_none; if (*pointer != 0) { - f_void_p new_pointer = 0; + void *new_pointer = 0; // allocate new space if (new_length > 0) { @@ -108,7 +108,7 @@ extern "C" { if (new_pointer != *pointer) { if (new_length > old_length) { // char * is of a data type size of 1, casting it to char should result in a single-length increment - // this is done to avoid problems with (f_void_p) having arithmetic issues + // this is done to avoid problems with (void *) having arithmetic issues memset(((char *) new_pointer) + (type * old_length), 0, type * (new_length - old_length)); } @@ -132,7 +132,7 @@ extern "C" { #endif // ! ( defined (_di_f_resize_) || defined (_f_memory_FORCE_secure_memory_) ) #if ! ( defined (_di_f_adjust_) || defined (_f_memory_FORCE_fast_memory_) ) - f_return_status f_adjust(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length old_length, f_const f_memory_length new_length) { + f_return_status f_adjust(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length) { #ifndef _di_level_0_parameter_checking_ if (type <= 0) return f_error_set_error(f_invalid_parameter); if (old_length < 0) return f_error_set_error(f_invalid_parameter); @@ -144,12 +144,12 @@ extern "C" { if (old_length == new_length) return f_none; if (*pointer != 0) { - f_void_p new_pointer = 0; + void *new_pointer = 0; if (old_length > 0) { if (new_length < old_length) { // char * is of a data type size of 1, casting it to char should result in a single-length increment - // this is done to avoid problems with (f_void_p) having arithmetic issues + // this is done to avoid problems with (void *) having arithmetic issues memset(((char *)*pointer) + new_length, 0, type * (old_length - new_length)); } } @@ -170,7 +170,7 @@ extern "C" { if (new_pointer != *pointer) { if (new_length > old_length) { // char * is of a data type size of 1, casting it to bool should result in a single-length increment - // this is done to avoid problems with (f_void_p) having arithmetic issues + // this is done to avoid problems with (void *) having arithmetic issues memset(((char *)new_pointer) + (type * old_length), 0, type * (new_length - old_length)); } diff --git a/level_0/f_memory/c/memory.h b/level_0/f_memory/c/memory.h index 28dc39b..fe3146e 100644 --- a/level_0/f_memory/c/memory.h +++ b/level_0/f_memory/c/memory.h @@ -60,39 +60,39 @@ extern "C" { #endif // _di_f_memory_default_allocation_step_ #ifndef _di_f_memory_types_ - #define f_memory_size_t f_size_t - #define f_memory_length f_size_t + #define f_memory_size_t size_t + #define f_memory_length size_t #endif // _di_f_memory_types_ #ifndef _di_f_new_ // Create some dynamically allocated array of some length #define f_new(pointer,type) f_new_array(pointer, type, 1) - f_extern f_return_status f_new_array(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length); + extern f_return_status f_new_array(void **pointer, const f_memory_size_t type, const f_memory_length length); #endif // _di_f_new_ #if ! ( defined (_di_f_delete_) || defined (_f_memory_FORCE_secure_memory_) ) // deletes some dynamically allocated data // f_delete, will not change any of the data to 0 prior to deallocation // type and length are not used by this function normally but must be provided for the cases when f_delete is swapped with f_destroy (or vice-versa) - f_extern f_return_status f_delete(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length); + extern f_return_status f_delete(void **pointer, const f_memory_size_t type, const f_memory_length length); #endif // ! ( defined (_di_f_delete_) || defined (_f_memory_FORCE_secure_memory_) ) #if ! ( defined (_di_f_destroy_) || defined (_f_memory_FORCE_fast_memory_) ) // securely deletes some dynamically allocated data // f_destroy, will change all data to 0 prior to deallocation - f_extern f_return_status f_destroy(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length); + extern f_return_status f_destroy(void **pointer, const f_memory_size_t type, const f_memory_length length); #endif // ! ( defined (_di_f_destroy_) || defined (_f_memory_FORCE_fast_memory_) ) #if ! ( defined (_di_f_resize_) || defined (_f_memory_FORCE_secure_memory_) ) // resizes some dynamically allocated data // f_resize, will not change any of the data prior to deallocation - f_extern f_return_status f_resize(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length old_length, f_const f_memory_length new_length); + extern f_return_status f_resize(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length); #endif // ! ( defined (_di_f_resize_) || defined (_f_memory_FORCE_secure_memory_) ) #if ! ( defined (_di_f_adjust_) || defined (_f_memory_FORCE_fast_memory_) ) // securely resizes some dynamically allocated data // f_adjust, will change all data to 0 prior to deallocation - f_extern f_return_status f_adjust(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length old_length, f_const f_memory_length new_length); + extern f_return_status f_adjust(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length); #endif // _di_f_adjust_ @@ -126,7 +126,7 @@ extern "C" { // structure: the structure to operate on // type: the structure type #define f_delete_structure(status, structure, type) \ - status = f_delete((f_void_p *) & structure.array, sizeof(type), structure.size); \ + status = f_delete((void **) & structure.array, sizeof(type), structure.size); \ if (status == f_none) { \ structure.size = 0; \ structure.used = 0; \ @@ -138,7 +138,7 @@ extern "C" { // structure: the structure to operate on // type: the structure type #define f_destroy_structure(status, structure, type) \ - status = f_destroy((f_void_p *) & structure.array, sizeof(type), structure.size); \ + status = f_destroy((void **) & structure.array, sizeof(type), structure.size); \ if (status == f_none) { \ structure.size = 0; \ structure.used = 0; \ @@ -150,7 +150,7 @@ extern "C" { // structure: the structure to operate on // type: the structure type #define f_resize_structure(status, structure, type, new_length) \ - status = f_resize((f_void_p *) & structure.array, sizeof(type), structure.size, new_length); \ + status = f_resize((void **) & structure.array, sizeof(type), structure.size, new_length); \ if (status == f_none) { \ structure.size = new_length; \ if (structure.used > structure.size) structure.used = new_length; \ @@ -162,7 +162,7 @@ extern "C" { // structure: the structure to operate on // type: the structure type #define f_adjust_structure(status, structure, type, new_length) \ - status = f_adjust((f_void_p *) & structure.array, sizeof(type), structure.size, new_length); \ + status = f_adjust((void **) & structure.array, sizeof(type), structure.size, new_length); \ if (status == f_none) { \ structure.size = new_length; \ if (structure.used > structure.size) structure.used = new_length; \ @@ -206,7 +206,7 @@ extern "C" { f_delete_structure(status, structures.array[structures.size], type); \ if (status != f_none) break; \ } \ - if (status == f_none) status = f_delete((f_void_p *) & structures.array, sizeof(type), structures.size); \ + if (status == f_none) status = f_delete((void **) & structures.array, sizeof(type), structures.size); \ if (status == f_none) structures.used = 0; #endif // _di_f_delete_structures_ @@ -221,7 +221,7 @@ extern "C" { f_destroy_structure(status, structures.array[structures.size], type); \ if (status != f_none) break; \ } \ - if (status == f_none) status = f_destroy((f_void_p *) & structures.array, sizeof(type), structures.size); \ + if (status == f_none) status = f_destroy((void **) & structures.array, sizeof(type), structures.size); \ if (status == f_none) structures.used = 0; #endif // _di_f_destroy_structures_ @@ -238,7 +238,7 @@ extern "C" { if (status != f_none) break; \ } \ } \ - if (status == f_none) status = f_resize((f_void_p *) & structures.array, sizeof(type), structures.size, new_length); \ + if (status == f_none) status = f_resize((void **) & structures.array, sizeof(type), structures.size, new_length); \ if (status == f_none) { \ if (new_length > structures.size) { \ length_variable i = structures.size; \ @@ -264,7 +264,7 @@ extern "C" { if (status != f_none) break; \ } \ } \ - if (status == f_none) status = f_adjust((f_void_p *) & structures.array, sizeof(type), structures.size, new_length); \ + if (status == f_none) status = f_adjust((void **) & structures.array, sizeof(type), structures.size, new_length); \ if (status == f_none) { \ if (new_length > structures.size) { \ length_variable i = structures.size; \ diff --git a/level_0/f_pipe/c/pipe.c b/level_0/f_pipe/c/pipe.c index 87a412b..38f8129 100644 --- a/level_0/f_pipe/c/pipe.c +++ b/level_0/f_pipe/c/pipe.c @@ -16,7 +16,7 @@ extern "C" { #ifndef _di_f_pipe_exists_ // returns f_true if the standard input contains piped data. f_return_status f_pipe_exists() { - f_stat st_info; + struct stat st_info; if (fstat(fileno(f_pipe), &st_info) != 0) { return f_error_set_error(f_file_stat_error); diff --git a/level_0/f_pipe/c/pipe.h b/level_0/f_pipe/c/pipe.h index 74539b6..2fee9f0 100644 --- a/level_0/f_pipe/c/pipe.h +++ b/level_0/f_pipe/c/pipe.h @@ -29,7 +29,7 @@ extern "C" { #ifndef _di_f_pipe_exists_ // returns f_true if the standard input contains piped data. - f_extern f_return_status f_pipe_exists(); + extern f_return_status f_pipe_exists(); #endif // _di_f_pipe_exists_ #ifdef __cplusplus diff --git a/level_0/f_print/c/print.c b/level_0/f_print/c/print.c index 27a2356..af26b2c 100644 --- a/level_0/f_print/c/print.c +++ b/level_0/f_print/c/print.c @@ -11,7 +11,7 @@ extern "C" { #endif #ifndef _di_f_print_string_ - f_return_status f_print_string(f_file_p output, f_const f_string string, f_const f_string_length length) { + f_return_status f_print_string(FILE *output, const f_string string, const f_string_length length) { register f_string_length i = 0; for (; i < length; i++) { @@ -25,7 +25,7 @@ extern "C" { #endif // _di_f_print_string_ #ifndef _di_f_print_dynamic_string_ - f_return_status f_print_dynamic_string(f_file_p output, f_const f_dynamic_string buffer) { + f_return_status f_print_dynamic_string(FILE *output, const f_dynamic_string buffer) { #ifndef _di_level_0_parameter_checking_ if (buffer.used <= 0) return f_invalid_parameter; #endif // _di_level_0_parameter_checking_ @@ -43,7 +43,7 @@ extern "C" { #endif // _di_f_print_dynamic_string_ #ifndef _di_f_print_partial_dynamic_string_ - f_return_status f_print_partial_dynamic_string(f_file_p output, f_const f_dynamic_string buffer, f_const f_string_location location) { + f_return_status f_print_partial_dynamic_string(FILE *output, const f_dynamic_string buffer, const f_string_location location) { #ifndef _di_level_0_parameter_checking_ if (location.start < 0) return f_error_set_error(f_invalid_parameter); if (location.stop < location.start) return f_error_set_error(f_invalid_parameter); diff --git a/level_0/f_print/c/print.h b/level_0/f_print/c/print.h index bd08e36..73bdf9c 100644 --- a/level_0/f_print/c/print.h +++ b/level_0/f_print/c/print.h @@ -30,7 +30,7 @@ extern "C" { // will not stop at \0 // will not print \0 // This implementation will not proces special characters, such as %s in the same way as printf functions, I am undecided whether or not to add this capability - f_extern f_return_status f_print_string(f_file_p output, f_const f_string string, f_const f_string_length length); + extern f_return_status f_print_string(FILE *output, const f_string string, const f_string_length length); #endif // _di_f_print_string_ #ifndef _di_f_print_dynamic_string_ @@ -39,7 +39,7 @@ extern "C" { // will not print \0 // will print the entire dynamic string // This implementation will not proces special characters, such as %s in the same way as printf functions, I am undecided whether or not to add this capability - f_extern f_return_status f_print_dynamic_string(f_file_p output, f_const f_dynamic_string buffer); + extern f_return_status f_print_dynamic_string(FILE *output, const f_dynamic_string buffer); #endif // _di_f_print_dynamic_string_ @@ -49,7 +49,7 @@ extern "C" { // will not print \0 // will print the only the buffer range specified by location // This implementation will not proces special characters, such as %s in the same way as printf functions, I am undecided whether or not to add this capability - f_extern f_return_status f_print_partial_dynamic_string(f_file_p output, f_const f_dynamic_string buffer, f_const f_string_location location); + extern f_return_status f_print_partial_dynamic_string(FILE *output, const f_dynamic_string buffer, const f_string_location location); #endif // _di_f_print_partial_dynamic_string_ #ifdef __cplusplus diff --git a/level_0/f_strings/c/strings.h b/level_0/f_strings/c/strings.h index 24b04ed..f0adf36 100644 --- a/level_0/f_strings/c/strings.h +++ b/level_0/f_strings/c/strings.h @@ -25,7 +25,7 @@ extern "C" { // BUG: for whatever reason strnlen is considered not included with -Wall, even with __USE_GNU defined // therefore this gets defined here #ifdef _en_BUG_strnlen_ - f_extern size_t strnlen (f_const char *string, size_t max_length); + extern size_t strnlen (const char *string, size_t max_length); #endif // _en_BUG_strnlen_ // Define the end of string character @@ -69,20 +69,20 @@ extern "C" { // define the basic string type #ifndef _di_f_have_string_ - typedef f_autochar *f_string; + typedef char *f_string; #define f_string_max_size f_signed_long_size #define f_string_initialize f_eos - #define f_new_string(status, string, length) status = f_new_array((f_void_p *) & string, sizeof(f_string), length) - #define f_delete_string(status, string, size) status = f_delete((f_void_p *) & string, sizeof(f_string), size) - #define f_destroy_string(status, string, size) status = f_destroy((f_void_p *) & string, sizeof(f_string), size) + #define f_new_string(status, string, length) status = f_new_array((void **) & string, sizeof(f_string), length) + #define f_delete_string(status, string, size) status = f_delete((void **) & string, sizeof(f_string), size) + #define f_destroy_string(status, string, size) status = f_destroy((void **) & string, sizeof(f_string), size) #define f_resize_string(status, string, old_length, new_length) \ - status = f_resize((f_void_p *) & string, sizeof(f_string), old_length, new_length) + status = f_resize((void **) & string, sizeof(f_string), old_length, new_length) #define f_adjust_string(status, string, old_length, new_length) \ - status = f_adjust((f_void_p *) & string, sizeof(f_string), old_length, new_length) + status = f_adjust((void **) & string, sizeof(f_string), old_length, new_length) #endif // _di_f_have_string_ #ifndef _di_f_string_length_ @@ -90,15 +90,15 @@ extern "C" { #define f_string_length_printf string_format_long_integer - #define f_new_string_length(status, string, length) status = f_new_array((f_void_p *) & string, sizeof(f_string_length), length) - #define f_delete_string_length(status, string, length) status = f_delete((f_void_p *) & string, sizeof(f_string_length), length) + #define f_new_string_length(status, string, length) status = f_new_array((void **) & string, sizeof(f_string_length), length) + #define f_delete_string_length(status, string, length) status = f_delete((void **) & string, sizeof(f_string_length), length) #define f_destroy_string_length(status, string, size) status = f_destroy((f_void_P *) & string, sizeof(f_string_length), size) #define f_resize_string_length(status, length, old_length, new_length) \ - status = f_resize((f_void_p *) & length, sizeof(f_string_length), old_length, new_length) + status = f_resize((void **) & length, sizeof(f_string_length), old_length, new_length) #define f_adjust_string_length(status, length, old_length, new_length) \ - status = f_adjust((f_void_p *) & length, sizeof(f_string_length), old_length, new_length) + status = f_adjust((void **) & length, sizeof(f_string_length), old_length, new_length) #endif // _di_f_string_length_ #ifndef _di_f_string_lengths_ @@ -136,15 +136,15 @@ extern "C" { #define f_string_location_initialize { 1, 0 } - #define f_new_string_location(status, string_location, length) status = f_new_array((f_void_p *) & string_location, sizeof(f_string_location), length) - #define f_delete_string_location(status, string_location, size) status = f_delete((f_void_p *) & string_location, sizeof(f_string_location), size) - #define f_destroy_string_location(status, string_location, size) status = f_destroy((f_void_p *) & string_location, sizeof(f_string_location), size) + #define f_new_string_location(status, string_location, length) status = f_new_array((void **) & string_location, sizeof(f_string_location), length) + #define f_delete_string_location(status, string_location, size) status = f_delete((void **) & string_location, sizeof(f_string_location), size) + #define f_destroy_string_location(status, string_location, size) status = f_destroy((void **) & string_location, sizeof(f_string_location), size) #define f_resize_string_location(status, string_location, old_length, new_length) \ - status = f_resize((f_void_p *) & string_location, sizeof(f_string_location), old_length, new_length) + status = f_resize((void **) & string_location, sizeof(f_string_location), old_length, new_length) #define f_adjust_string_location(status, string_location, old_length, new_length) \ - status = f_adjust((f_void_p *) & string_location, sizeof(f_string_location), old_length, new_length) + status = f_adjust((void **) & string_location, sizeof(f_string_location), old_length, new_length) #endif // _di_f_string_location_ // an array of string locations @@ -201,28 +201,28 @@ extern "C" { } #define f_delete_dynamic_string(status, dynamic) \ - status = f_delete((f_void_p *) & dynamic.string, sizeof(f_string), dynamic.size); \ + status = f_delete((void **) & dynamic.string, sizeof(f_string), dynamic.size); \ if (status == f_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } #define f_destroy_dynamic_string(status, dynamic) \ - status = f_destroy((f_void_p *) & dynamic.string, sizeof(f_string), dynamic.size); \ + status = f_destroy((void **) & dynamic.string, sizeof(f_string), dynamic.size); \ if (status == f_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } #define f_resize_dynamic_string(status, dynamic, new_length) \ - status = f_resize((f_void_p *) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \ + status = f_resize((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \ if (status == f_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ } #define f_adjust_dynamic_string(status, dynamic, new_length) \ - status = f_adjust((f_void_p *) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \ + status = f_adjust((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \ if (status == f_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ @@ -261,7 +261,7 @@ extern "C" { f_destroy_dynamic_string(status, dynamics.array[dynamics.size]); \ if (status != f_none) break; \ } \ - if (status == f_none) status = f_delete((f_void_p *) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \ + if (status == f_none) status = f_delete((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \ if (status == f_none) dynamics.used = 0; #define f_destroy_dynamic_strings(status, dynamics) \ @@ -271,7 +271,7 @@ extern "C" { f_destroy_dynamic_string(status, dynamics.array[dynamics.size]); \ if (status != f_none) break; \ } \ - if (status == f_none) status = f_destroy((f_void_p *) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \ + if (status == f_none) status = f_destroy((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \ if (status == f_none) dynamics.used = 0; #define f_resize_dynamic_strings(status, dynamics, new_length) \ @@ -283,7 +283,7 @@ extern "C" { if (status != f_none) break; \ } \ } \ - if (status == f_none) status = f_resize((f_void_p *) & dynamics.array, sizeof(f_dynamic_string), dynamics.size, new_length); \ + if (status == f_none) status = f_resize((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size, new_length); \ if (status == f_none) { \ if (new_length > dynamics.size) { \ f_string_length i = dynamics.size; \ @@ -304,7 +304,7 @@ extern "C" { if (status != f_none) break; \ } \ } \ - if (status == f_none) status = f_adjust((f_void_p *) & dynamics.array, sizeof(f_dynamic_string), dynamics.size, new_length); \ + if (status == f_none) status = f_adjust((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size, new_length); \ if (status == f_none) { \ if (new_length > dynamics.size) { \ f_string_length i = dynamics.size; \ diff --git a/level_0/f_types/c/types.h b/level_0/f_types/c/types.h index 10f4f1e..1d1a745 100644 --- a/level_0/f_types/c/types.h +++ b/level_0/f_types/c/types.h @@ -30,8 +30,6 @@ #define _F_types_h // libc includes -#include // contains mode_t, dev_t, gid_t, uid_t, etc.. -#include #include #ifdef __cplusplus @@ -53,29 +51,7 @@ extern "C" { #define f_u_long_long unsigned long long #define f_u_double double #define f_u_long_double long double - #define f_char char // should ONLY be char - #define f_wchar wchar // should ONLY be wchar - #define f_autochar char // can be wchar or char - #define f_size_t size_t #define f_bool unsigned short - #define f_mode_t mode_t - #define f_dev_t dev_t - #define f_uid_t uid_t - #define f_gid_t gid_t - #define f_ino_t ino_t - #define f_nlink_t nlink_t - #define f_off_t off_t - #define f_fpos_t fpos_t - #define f_pid_t pid_t - #define f_sigset_t sigset_t - #define f_siginfo_t siginfo_t - #define f_file_t FILE - #define f_file_p FILE * - #define f_void_t void - #define f_void_p void * - #define f_extern extern - #define f_const f_const - #define f_stat struct stat #endif // _di_f_types_normal // The minimal types represent to the system admin or whomever else handles compilation that the data type should NOT be smaller than the specified size, but can be any size larger. @@ -83,18 +59,17 @@ extern "C" { #define f_min_s_int f_s_int #define f_min_s_short f_s_short #define f_min_s_long f_s_long - #define f_min_s_short_short f_t_s_short_short + #define f_min_s_short_short f_s_short_short #define f_min_s_long_long f_s_long_long - #define f_min_s_double f_t_s_double + #define f_min_s_double f_s_double #define f_min_s_long_double f_s_long_double #define f_min_u_int f_u_int - #define f_min_u_short f_t_u_short + #define f_min_u_short f_u_short #define f_min_u_long f_u_long - #define f_min_u_short_short f_t_u_short_short + #define f_min_u_short_short f_u_short_short #define f_min_u_long_long f_u_long_long - #define f_min_u_double f_t_u_double + #define f_min_u_double f_u_double #define f_min_u_long_double f_u_long_double - #define f_min_char f_char #endif // _di_f_types_min // The maximum types represent to the system admin or whomever else handles compilation that the data type should NOT be larger than the specified size, but can be any size smaller. @@ -113,17 +88,16 @@ extern "C" { #define f_max_u_long_long f_u_long_long #define f_max_u_double f_u_double #define f_max_u_long_double f_u_long_double - #define f_max_char f_wchar #endif // _di_f_types_max #ifndef _di_f_status_ typedef uint16_t f_status; // The c language gives warnings about return types of constants, I pretty much hate not being able to forcefully specify that these are not the be changed as that could be a security issue - // Therefore, I need to remove the f_const for c, but keep it for c++, thus I define the type f_return_status, which is only for function call declarations & prototypes + // Therefore, I need to remove the const for c, but keep it for c++, thus I define the type f_return_status, which is only for function call declarations & prototypes // DO NOT DECLARE THESE FOR THE RETURN DATA TYPES THEMSELVES, USE f_status. ONLY USE THESE FOR FUNCTION PROTOTYPES AND DECLARATIONS #ifdef __cplusplus - #define f_return_status f_const f_status + #define f_return_status const f_status #else #define f_return_status f_status #endif // __cplusplus diff --git a/level_1/fl_colors/c/colors.c b/level_1/fl_colors/c/colors.c index 863a65d..96e30f5 100644 --- a/level_1/fl_colors/c/colors.c +++ b/level_1/fl_colors/c/colors.c @@ -11,7 +11,7 @@ extern "C" { #endif #ifndef _di_fl_set_color_ - f_return_status fl_set_color(f_file_p file, f_const f_colors_format format, f_const f_autochar *color1, f_const f_autochar *color2, f_const f_autochar *color3, f_const f_autochar *color4, f_const f_autochar *color5) { + f_return_status fl_set_color(FILE *file, const f_colors_format format, const char *color1, const char *color2, const char *color3, const char *color4, const char *color5) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return f_error_set_error(f_invalid_parameter); if (color1 == 0) return f_error_set_error(f_invalid_parameter); @@ -33,7 +33,7 @@ extern "C" { #endif // _di_fl_set_color_ #ifndef _di_fl_save_color_ - f_return_status fl_save_color(f_dynamic_string *buffer, f_const f_colors_format format, f_const f_autochar *color1, f_const f_autochar *color2, f_const f_autochar *color3, f_const f_autochar *color4, f_const f_autochar *color5) { + f_return_status fl_save_color(f_dynamic_string *buffer, const f_colors_format format, const char *color1, const char *color2, const char *color3, const char *color4, const char *color5) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return f_error_set_error(f_invalid_parameter); if (color1 == 0) return f_error_set_error(f_invalid_parameter); @@ -116,7 +116,7 @@ extern "C" { #endif // _di_fl_save_color_ #ifndef _di_fl_print_color_ - f_return_status fl_print_color(f_file_p file, f_const f_dynamic_string start_color, f_const f_dynamic_string end_color, f_const f_autochar *string, ...) { + f_return_status fl_print_color(FILE *file, const f_dynamic_string start_color, const f_dynamic_string end_color, const char *string, ...) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return f_error_set_error(f_invalid_parameter); if (string == 0) return f_error_set_error(f_invalid_parameter); @@ -143,7 +143,7 @@ extern "C" { #endif // _di_fl_print_color_ #ifndef _di_fl_print_color_line_ - f_return_status fl_print_color_line(f_file_p file, f_const f_dynamic_string start_color, f_const f_dynamic_string end_color, f_const f_autochar *string, ...) { + f_return_status fl_print_color_line(FILE *file, const f_dynamic_string start_color, const f_dynamic_string end_color, const char *string, ...) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return f_error_set_error(f_invalid_parameter); if (string == 0) return f_error_set_error(f_invalid_parameter); @@ -173,7 +173,7 @@ extern "C" { #endif // _di_fl_print_color_line_ #ifndef _di_fl_print_color_code_ - f_return_status fl_print_color_code(f_file_p file, f_const f_dynamic_string color) { + f_return_status fl_print_color_code(FILE *file, const f_dynamic_string color) { if (color.used != 0) { fprintf(file, "%s", color.string); } diff --git a/level_1/fl_colors/c/colors.h b/level_1/fl_colors/c/colors.h index 4f7bc7d..02614e0 100644 --- a/level_1/fl_colors/c/colors.h +++ b/level_1/fl_colors/c/colors.h @@ -79,7 +79,7 @@ extern "C" { #ifndef _di_fl_set_color_ // this will accept some file or standard io, and push color information to that file or standard io - f_extern f_return_status fl_set_color(f_file_p file, f_const f_colors_format format, f_const f_autochar *color1, f_const f_autochar *color2, f_const f_autochar *color3, f_const f_autochar *color4, f_const f_autochar *color5); + extern f_return_status fl_set_color(FILE *file, const f_colors_format format, const char *color1, const char *color2, const char *color3, const char *color4, const char *color5); #define fl_set_color1(file, format, color1) fl_set_color(file, format, color1, 0, 0, 0, 0) #define fl_set_color2(file, format, color1, color2) fl_set_color(file, format, color1, color2, 0, 0, 0) @@ -91,7 +91,7 @@ extern "C" { #ifndef _di_fl_save_color_ // this will place all appropriate color effects into a string, handling any necessary allocations - f_extern f_return_status fl_save_color(f_dynamic_string *buffer, f_const f_colors_format format, f_const f_autochar *color1, f_const f_autochar *color2, f_const f_autochar *color3, f_const f_autochar *color4, f_const f_autochar *color5); + extern f_return_status fl_save_color(f_dynamic_string *buffer, const f_colors_format format, const char *color1, const char *color2, const char *color3, const char *color4, const char *color5); #define fl_save_color1(buffer, format, color1) fl_save_color(buffer, format, color1, 0, 0, 0, 0) #define fl_save_color2(buffer, format, color1, color2) fl_save_color(buffer, format, color1, color2, 0, 0, 0) @@ -104,18 +104,18 @@ extern "C" { // this will wrap the passed text in the passed start and end colors // this will work like fprintf with the variable arguments // if the colors strings have nothing used in them, then this will only print the string - f_extern f_return_status fl_print_color(f_file_p file, f_const f_dynamic_string start_color, f_const f_dynamic_string end_color, f_const f_autochar *string, ...); + extern f_return_status fl_print_color(FILE *file, const f_dynamic_string start_color, const f_dynamic_string end_color, const char *string, ...); #endif // _di_fl_print_color_ #ifndef _di_fl_print_color_line_ // this is identical to fl_print_color, but also prints a trailing newline - f_extern f_return_status fl_print_color_line(f_file_p file, f_const f_dynamic_string start_color, f_const f_dynamic_string end_color, f_const f_autochar *string, ...); + extern f_return_status fl_print_color_line(FILE *file, const f_dynamic_string start_color, const f_dynamic_string end_color, const char *string, ...); #endif // _di_fl_print_color_line_ #ifndef _di_fl_print_color_code_ // this will print a single color code so that all print commands following this command will print in color (or not..) // do not forget to print the color reset when done - f_extern f_return_status fl_print_color_code(f_file_p file, f_const f_dynamic_string color); + extern f_return_status fl_print_color_code(FILE *file, const f_dynamic_string color); #endif // _di_fl_print_color_code_ #ifdef __cplusplus diff --git a/level_1/fl_console/c/console.c b/level_1/fl_console/c/console.c index 96c129c..47d3932 100644 --- a/level_1/fl_console/c/console.c +++ b/level_1/fl_console/c/console.c @@ -11,7 +11,7 @@ extern "C" { #endif #ifndef _di_fl_process_parameters_ - f_return_status fl_process_parameters(f_const f_array_length argc, f_const f_string argv[], f_console_parameter parameters[], f_const f_array_length total_parameters, f_string_lengths *remaining) { + f_return_status fl_process_parameters(const f_array_length argc, const f_string argv[], f_console_parameter parameters[], const f_array_length total_parameters, f_string_lengths *remaining) { #ifndef _di_level_1_parameter_checking_ if (remaining == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ diff --git a/level_1/fl_console/c/console.h b/level_1/fl_console/c/console.h index 72027a2..df06496 100644 --- a/level_1/fl_console/c/console.h +++ b/level_1/fl_console/c/console.h @@ -24,7 +24,7 @@ extern "C" { #endif #ifndef _di_fl_process_parameters_ - f_extern f_return_status fl_process_parameters(f_const f_array_length argc, f_const f_string argv[], f_console_parameter parameters[], f_const f_array_length total_parameters, f_string_lengths *remaining); + extern f_return_status fl_process_parameters(const f_array_length argc, const f_string argv[], f_console_parameter parameters[], const f_array_length total_parameters, f_string_lengths *remaining); #endif // _di_fl_process_parameters_ #ifdef __cplusplus diff --git a/level_1/fl_directory/c/directory.c b/level_1/fl_directory/c/directory.c index 407be38..bd89e06 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -13,7 +13,7 @@ extern "C" { #ifndef _di_fl_directory_list_ // put the names of each file and/or directory inside the names parameter - f_return_status fl_directory_list(f_const f_string directory_path, f_dynamic_strings *names) { + f_return_status fl_directory_list(const f_string directory_path, f_dynamic_strings *names) { #ifndef _di_level_1_parameter_checking_ if (names == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ @@ -44,17 +44,17 @@ extern "C" { return status; } - memcpy(names->array[names->used].string, listing[counter]->d_name, sizeof(f_autochar) * size); + memcpy(names->array[names->used].string, listing[counter]->d_name, sizeof(char) * size); names->array[names->used].used = size; names->used++; } // FIXME: the second and third paramater are probably wrong - f_delete((f_void_p *) & listing[counter], sizeof(struct dirent), 0); + f_delete((void **) & listing[counter], sizeof(struct dirent), 0); } // FIXME: the second and third paramater are probably wrong - f_delete((f_void_p *) & listing, sizeof(struct dirent *), 0); + f_delete((void **) & listing, sizeof(struct dirent *), 0); if (length == 0) { // an empty directory diff --git a/level_1/fl_directory/c/directory.h b/level_1/fl_directory/c/directory.h index 40b4ef2..7547ea8 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -34,7 +34,7 @@ extern "C" { #ifndef _di_fl_directory_list_ // put the names of each file and/or directory inside the names parameter - f_extern f_return_status fl_directory_list(f_const f_string directory_path, f_dynamic_strings *names); + extern f_return_status fl_directory_list(const f_string directory_path, f_dynamic_strings *names); #endif // _di_fl_directory_list_ #ifdef __cplusplus diff --git a/level_1/fl_errors/c/errors.c b/level_1/fl_errors/c/errors.c index dec5c2b..7cc1522 100644 --- a/level_1/fl_errors/c/errors.c +++ b/level_1/fl_errors/c/errors.c @@ -14,7 +14,7 @@ extern "C" { #endif #ifndef _di_fl_errors_to_string_ - f_return_status fl_errors_to_string(f_const f_status error, f_string *string) { + f_return_status fl_errors_to_string(const f_status error, f_string *string) { #ifndef _di_level_1_parameter_checking_ if (string == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ @@ -312,7 +312,7 @@ extern "C" { #endif // _di_fl_errors_to_string_ #ifndef _di_fl_errors_is_error_ - f_return_status fl_errors_is_error(f_const f_status error) { + f_return_status fl_errors_is_error(const f_status error) { if (fl_errors_is_fine(error) == f_true) { return f_false; } else if (fl_errors_is_warning(error) == f_true) { @@ -324,7 +324,7 @@ extern "C" { #endif // _di_fl_errors_is_error_ #ifndef _di_fl_errors_is_warning_ - f_return_status fl_errors_is_warning(f_const f_status error) { + f_return_status fl_errors_is_warning(const f_status error) { switch (error) { #ifndef _di_fl_errors_basic_ case f_no_data: @@ -356,7 +356,7 @@ extern "C" { #endif // _di_fl_errors_is_warning_ #ifndef _di_fl_errors_is_fine_ - f_return_status fl_errors_is_fine(f_const f_status error) { + f_return_status fl_errors_is_fine(const f_status error) { switch (error) { #ifndef _di_fl_errors_booleans_ case f_false: diff --git a/level_1/fl_errors/c/errors.h b/level_1/fl_errors/c/errors.h index 4ff632b..22c8419 100644 --- a/level_1/fl_errors/c/errors.h +++ b/level_1/fl_errors/c/errors.h @@ -21,25 +21,25 @@ extern "C" { #ifndef _di_fl_errors_to_string_ // Convert error codes to their string equivalents. - f_extern f_return_status fl_errors_to_string(f_const f_status error, f_string *string); + extern f_return_status fl_errors_to_string(const f_status error, f_string *string); #endif // _di_fl_errors_to_string_ #ifndef _di_fl_errors_is_error_ // Returns true or false depending on whether the standard context of the error code represents an error. // Keep in mind that many of the error codes are context-specific and may be reported as an error here when it is in fact not an error. - f_extern f_return_status fl_errors_is_error(f_const f_status error); + extern f_return_status fl_errors_is_error(const f_status error); #endif // _di_fl_errors_is_error_ #ifndef _di_fl_errors_is_warning_ // Returns true or false depending on whether the standard context of the error code represents a warning. // Keep in mind that many of the error codes are context-specific and may be reported as a warning here when it is in fact not a warning. - f_extern f_return_status fl_errors_is_warning(f_const f_status error); + extern f_return_status fl_errors_is_warning(const f_status error); #endif // _di_fl_errors_is_warning_ #ifndef _di_fl_errors_is_fine_ // Returns true or false depending on whether the standard context of the error code represents an normal return status and not an error. // Keep in mind that many of the error codes are context-specific and may be reported as an "fine" here when it is in fact not fine. - f_extern f_return_status fl_errors_is_fine(f_const f_status error); + extern f_return_status fl_errors_is_fine(const f_status error); #endif // _di_fl_errors_is_fine_ #ifdef __cplusplus diff --git a/level_1/fl_file/c/file.c b/level_1/fl_file/c/file.c index ff340d4..187c4dd 100644 --- a/level_1/fl_file/c/file.c +++ b/level_1/fl_file/c/file.c @@ -11,7 +11,7 @@ extern "C" { #endif #ifndef _di_fl_file_read_ - f_return_status fl_file_read(f_file file, f_const f_file_position position, f_dynamic_string *buffer) { + f_return_status fl_file_read(f_file file, const f_file_position position, f_dynamic_string *buffer) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return f_error_set_error(f_invalid_parameter); @@ -108,11 +108,11 @@ extern "C" { #endif // _di_fl_file_read_fifo_ #ifndef _di_fl_file_write_ - f_return_status fl_file_write(f_file file, f_const f_dynamic_string buffer) { + f_return_status fl_file_write(f_file file, const f_dynamic_string buffer) { if (file.file == 0) return f_error_set_error(f_file_not_open); f_status status = f_none; - f_size_t size = 0; + size_t size = 0; size = fwrite(buffer.string, file.byte_size, buffer.used, file.file); @@ -125,7 +125,7 @@ extern "C" { #endif // _di_fl_file_write_ #ifndef _di_fl_file_write_partial_ - f_return_status fl_file_write_partial(f_file file, f_const f_dynamic_string buffer, f_const f_string_location position) { + f_return_status fl_file_write_partial(f_file file, const f_dynamic_string buffer, const f_string_location position) { #ifndef _di_level_1_parameter_checking_ if (position.start < position.stop) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ @@ -133,7 +133,7 @@ extern "C" { if (file.file == 0) return f_file_not_open; f_status status = f_none; - f_size_t size = 0; + size_t size = 0; f_string_length total = buffer.used - (position.stop - position.start + 1); @@ -150,4 +150,3 @@ extern "C" { #ifdef __cplusplus } // extern "C" #endif - diff --git a/level_1/fl_file/c/file.h b/level_1/fl_file/c/file.h index c3028f2..489b425 100644 --- a/level_1/fl_file/c/file.h +++ b/level_1/fl_file/c/file.h @@ -19,19 +19,19 @@ extern "C" { #endif #ifndef _di_fl_file_read_ - f_extern f_return_status fl_file_read(f_file file, f_const f_file_position position, f_dynamic_string *buffer); + extern f_return_status fl_file_read(f_file file, const f_file_position position, f_dynamic_string *buffer); #endif // _di_fl_file_read_ #ifndef _di_fl_file_read_fifo_ - f_extern f_return_status fl_file_read_fifo(f_file file, f_dynamic_string *buffer); + extern f_return_status fl_file_read_fifo(f_file file, f_dynamic_string *buffer); #endif // _di_fl_file_read_fifo_ #ifndef _di_fl_file_write_ - f_extern f_return_status fl_file_write(f_file file, f_const f_dynamic_string buffer); + extern f_return_status fl_file_write(f_file file, const f_dynamic_string buffer); #endif // _di_fl_file_write_ #ifndef _di_fl_file_write_partial_ - f_extern f_return_status fl_file_write_partial(f_file file, f_const f_dynamic_string buffer, f_const f_string_location position); + extern f_return_status fl_file_write_partial(f_file file, const f_dynamic_string buffer, const f_string_location position); #endif // _di_fl_file_write_partial_ #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss.c b/level_1/fl_fss/c/fss.c index a599965..4eda9ed 100644 --- a/level_1/fl_fss/c/fss.c +++ b/level_1/fl_fss/c/fss.c @@ -12,7 +12,7 @@ extern "C" { #endif #ifndef _di_fl_fss_identify_ - f_return_status fl_fss_identify(f_const f_dynamic_string buffer, f_fss_header *header) { + f_return_status fl_fss_identify(const f_dynamic_string buffer, f_fss_header *header) { #ifndef _di_level_1_parameter_checking_ if (header == 0) return f_error_set_error(f_invalid_parameter); if (buffer.used <= 0) return f_error_set_error(f_invalid_parameter); @@ -144,7 +144,7 @@ extern "C" { #endif // _di_fl_fss_identify_file_ #ifndef _di_fl_fss_shift_delimiters_ -f_return_status fl_fss_shift_delimiters(f_dynamic_string *buffer, f_const f_string_location location) { +f_return_status fl_fss_shift_delimiters(f_dynamic_string *buffer, const f_string_location location) { #ifndef _di_level_1_parameter_checking_ if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter); if (location.start < 0) return f_error_set_error(f_invalid_parameter); diff --git a/level_1/fl_fss/c/fss.h b/level_1/fl_fss/c/fss.h index e640623..a9b209f 100644 --- a/level_1/fl_fss/c/fss.h +++ b/level_1/fl_fss/c/fss.h @@ -27,18 +27,18 @@ extern "C" { #endif #ifndef _di_fl_fss_identify_ - f_extern f_return_status fl_fss_identify(f_const f_dynamic_string buffer, f_fss_header *header); + extern f_return_status fl_fss_identify(const f_dynamic_string buffer, f_fss_header *header); #endif // _di_fl_fss_identify_ #ifndef _di_fl_fss_identify_file_ - f_extern f_return_status fl_fss_identify_file(f_file *file_information, f_fss_header *header); + extern f_return_status fl_fss_identify_file(f_file *file_information, f_fss_header *header); #endif // _di_fl_fss_identify_file_ #ifndef _di_fl_fss_shift_delimiters_ // This provides a means to shift all of the delimiters to the end of the used buffer // This allows one to do a printf on the dynamic string without the delimiters arbitrarily stopping the output // No reallocations are performed, this will only shift characters - f_extern f_return_status fl_fss_shift_delimiters(f_dynamic_string *buffer, f_const f_string_location location); + extern f_return_status fl_fss_shift_delimiters(f_dynamic_string *buffer, const f_string_location location); #endif // _di_fl_fss_shift_delimiters_ #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index 56f9943..bd51c65 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -50,7 +50,7 @@ extern "C" { } // handle quote support - f_autochar quoted = f_eos; + char quoted = f_eos; // identify where the object begins if (buffer->string[input->start] == f_fss_delimit_slash) { @@ -345,7 +345,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(f_dynamic_string *buffer, f_const f_dynamic_string object, f_string_location *input) { + f_return_status fl_fss_basic_object_write(f_dynamic_string *buffer, const f_dynamic_string object, f_string_location *input) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ @@ -549,7 +549,7 @@ extern "C" { #endif // _di_fl_fss_basic_object_write_ #ifndef _di_fl_fss_basic_content_write_ - f_return_status fl_fss_basic_content_write(f_dynamic_string *buffer, f_const f_dynamic_string content, f_string_location *input) { + f_return_status fl_fss_basic_content_write(f_dynamic_string *buffer, const f_dynamic_string content, f_string_location *input) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ diff --git a/level_1/fl_fss/c/fss_basic.h b/level_1/fl_fss/c/fss_basic.h index af83dc3..d6ab94f 100644 --- a/level_1/fl_fss/c/fss_basic.h +++ b/level_1/fl_fss/c/fss_basic.h @@ -32,22 +32,22 @@ extern "C" { #ifndef _di_fl_fss_basic_object_read_ // read an fss-0000 object - f_extern f_return_status fl_fss_basic_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found); + extern f_return_status fl_fss_basic_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found); #endif // _di_fl_fss_basic_object_read_ #ifndef _di_fl_fss_basic_content_read_ // read an fss-0000 content - f_extern f_return_status fl_fss_basic_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found); + extern f_return_status fl_fss_basic_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found); #endif // _di_fl_fss_basic_content_read_ #ifndef _di_fl_fss_basic_object_write_ // write an fss-0000 object - f_extern f_return_status fl_fss_basic_object_write(f_dynamic_string *buffer, f_const f_dynamic_string object, f_string_location *input); + extern f_return_status fl_fss_basic_object_write(f_dynamic_string *buffer, const f_dynamic_string object, f_string_location *input); #endif // _di_fl_fss_basic_object_write_ #ifndef _di_fl_fss_basic_content_write_ // write an fss-0000 content - f_extern f_return_status fl_fss_basic_content_write(f_dynamic_string *buffer, f_const f_dynamic_string content, f_string_location *input); + extern f_return_status fl_fss_basic_content_write(f_dynamic_string *buffer, const f_dynamic_string content, f_string_location *input); #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 60a8ae8..21bcfa6 100644 --- a/level_1/fl_fss/c/fss_basic_list.c +++ b/level_1/fl_fss/c/fss_basic_list.c @@ -346,7 +346,7 @@ 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(f_const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) { + f_return_status fl_fss_basic_list_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ @@ -468,7 +468,7 @@ 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(f_const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) { + f_return_status fl_fss_basic_list_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ diff --git a/level_1/fl_fss/c/fss_basic_list.h b/level_1/fl_fss/c/fss_basic_list.h index c05c114..1a0adef 100644 --- a/level_1/fl_fss/c/fss_basic_list.h +++ b/level_1/fl_fss/c/fss_basic_list.h @@ -33,22 +33,22 @@ extern "C" { #ifndef _di_fl_fss_basic_list_object_read_ // read an fss-0002 object - f_extern f_return_status fl_fss_basic_list_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found); + extern f_return_status fl_fss_basic_list_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found); #endif // _di_fl_fss_basic_list_object_read_ #ifndef _di_fl_fss_basic_list_content_read_ // read an fss-0002 content - f_extern f_return_status fl_fss_basic_list_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found); + extern f_return_status fl_fss_basic_list_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found); #endif // _di_fl_fss_basic_list_content_read_ #ifndef _di_fl_fss_basic_list_object_write_ // write an fss-0002 object - f_extern f_return_status fl_fss_basic_list_object_write(f_const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer); + extern f_return_status fl_fss_basic_list_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer); #endif // _di_fl_fss_basic_list_object_write_ #ifndef _di_fl_fss_basic_list_content_write_ // write an fss-0002 content - f_extern f_return_status fl_fss_basic_list_content_write(f_const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer); + extern f_return_status fl_fss_basic_list_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer); #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 49b94ea..a3e51ec 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -50,7 +50,7 @@ extern "C" { } // handle quote support - f_autochar quoted = f_eos; + char quoted = f_eos; // identify where the object begins if (buffer->string[input->start] == f_fss_delimit_slash) { @@ -303,7 +303,7 @@ extern "C" { f_status status = f_none; f_bool has_delimit = f_false; - f_autochar quoted = f_eos; + char quoted = f_eos; f_bool continue_main_loop = f_false; @@ -603,7 +603,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(f_const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) { + f_return_status fl_fss_extended_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ @@ -823,13 +823,13 @@ extern "C" { #endif // _di_fl_fss_extended_object_write_ #ifndef _di_fl_fss_extended_content_write_ - f_return_status fl_fss_extended_content_write(f_const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) { + f_return_status fl_fss_extended_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) { #ifndef _di_level_1_parameter_checking_ if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ f_status status = f_none; - f_autochar quoted = f_eos; + char quoted = f_eos; f_string_location buffer_position = f_string_location_initialize; f_string_length start_position = 0; diff --git a/level_1/fl_fss/c/fss_extended.h b/level_1/fl_fss/c/fss_extended.h index f9c3e98..2cb7d15 100644 --- a/level_1/fl_fss/c/fss_extended.h +++ b/level_1/fl_fss/c/fss_extended.h @@ -32,22 +32,22 @@ extern "C" { #ifndef _di_fl_fss_extended_object_read_ // read an fss-0001 object - f_extern f_return_status fl_fss_extended_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found); + extern f_return_status fl_fss_extended_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found); #endif // _di_fl_fss_extended_object_read_ #ifndef _di_fl_fss_extended_content_read_ // read an fss-0001 content - f_extern f_return_status fl_fss_extended_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found); + extern f_return_status fl_fss_extended_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found); #endif // _di_fl_fss_extended_content_read_ #ifndef _di_fl_fss_extended_object_write_ // write an fss-0001 object - f_extern f_return_status fl_fss_extended_object_write(f_const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer); + extern f_return_status fl_fss_extended_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer); #endif // _di_fl_fss_extended_object_write_ #ifndef _di_fl_fss_extended_content_write_ // write an fss-0001 content - f_extern f_return_status fl_fss_extended_content_write(f_const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer); + extern f_return_status fl_fss_extended_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer); #endif // _di_fl_fss_extended_content_write_ #ifdef __cplusplus diff --git a/level_1/fl_serialized/c/serialized.c b/level_1/fl_serialized/c/serialized.c index 8b965c8..e3088a8 100644 --- a/level_1/fl_serialized/c/serialized.c +++ b/level_1/fl_serialized/c/serialized.c @@ -11,7 +11,7 @@ extern "C" { #endif #ifndef _di_fl_serialize_simple_ - f_return_status fl_serialize_simple(f_const f_dynamic_string value, f_dynamic_string *serialized) { + f_return_status fl_serialize_simple(const f_dynamic_string value, f_dynamic_string *serialized) { #ifndef _di_level_0_parameter_checking_ if (serialized == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -26,11 +26,11 @@ extern "C" { } if (serialized->used == 0) { - memcpy(serialized->string + serialized->used, value.string, sizeof(f_autochar) * value.used); + memcpy(serialized->string + serialized->used, value.string, sizeof(char) * value.used); serialized->used += value.used; } else { - memcpy(serialized->string + serialized->used, f_serialized_simple_splitter_string, sizeof(f_autochar)); - memcpy(serialized->string + serialized->used + 1, value.string, sizeof(f_autochar) * value.used); + memcpy(serialized->string + serialized->used, f_serialized_simple_splitter_string, sizeof(char)); + memcpy(serialized->string + serialized->used + 1, value.string, sizeof(char) * value.used); serialized->used += value.used + 1; } @@ -39,7 +39,7 @@ extern "C" { #endif // _di_fl_serialize_simple_ #ifndef _di_fl_unserialize_simple_ - f_return_status fl_unserialize_simple(f_const f_dynamic_string serialized, f_string_locations *locations) { + f_return_status fl_unserialize_simple(const f_dynamic_string serialized, f_string_locations *locations) { #ifndef _di_level_0_parameter_checking_ if (locations == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -78,7 +78,7 @@ extern "C" { #endif // _di_fl_unserialize_simple_ #ifndef _di_fl_unserialize_simple_get_ - f_return_status fl_unserialize_simple_get(f_const f_dynamic_string serialized, f_const f_array_length index, f_string_location *location) { + f_return_status fl_unserialize_simple_get(const f_dynamic_string serialized, const f_array_length index, f_string_location *location) { #ifndef _di_level_0_parameter_checking_ if (location == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ diff --git a/level_1/fl_serialized/c/serialized.h b/level_1/fl_serialized/c/serialized.h index 845651d..454fd90 100644 --- a/level_1/fl_serialized/c/serialized.h +++ b/level_1/fl_serialized/c/serialized.h @@ -27,17 +27,17 @@ extern "C" { #ifndef _di_fl_serialize_simple_ // this function will append a string to the serialize. - f_extern f_return_status fl_serialize_simple(f_const f_dynamic_string value, f_dynamic_string *serialized); + extern f_return_status fl_serialize_simple(const f_dynamic_string value, f_dynamic_string *serialized); #endif // _di_fl_serialize_simple_ #ifndef _di_fl_unserialize_simple_ // this function will unserialize a serialized string and store the results in an array of strings. - f_extern f_return_status fl_unserialize_simple(f_const f_dynamic_string serialized, f_string_locations *locations); + extern f_return_status fl_unserialize_simple(const f_dynamic_string serialized, f_string_locations *locations); #endif // _di_fl_unserialize_ #ifndef _di_fl_unserialize_simple_get_ // this function will pull a single serialized value from the serialized string at the given index. - f_extern f_return_status fl_unserialize_simple_get(f_const f_dynamic_string serialized, f_const f_array_length index, f_string_location *location); + extern f_return_status fl_unserialize_simple_get(const f_dynamic_string serialized, const f_array_length index, f_string_location *location); #endif // _di_fl_unserialize_simple_get_ #ifdef __cplusplus diff --git a/level_1/fl_socket/c/socket.h b/level_1/fl_socket/c/socket.h index d868424..bb2c92f 100644 --- a/level_1/fl_socket/c/socket.h +++ b/level_1/fl_socket/c/socket.h @@ -27,19 +27,19 @@ extern "C"{ #ifndef _di_fl_socket_file_bind_ // bind a socket. - f_extern f_return_status fl_socket_file_bind(const f_string socket_path, f_socket_id *socket_id, f_socket_address *socket_address); + extern f_return_status fl_socket_file_bind(const f_string socket_path, f_socket_id *socket_id, f_socket_address *socket_address); #endif // _di_fl_socket_file_bind_ #ifndef _di_fl_socket_listen_ // terminate a socket connection // suggested socket_backlog default setting = 8. - f_extern f_return_status fl_socket_listen(const f_socket_id socket_id, const f_u_int socket_backlog); + extern f_return_status fl_socket_listen(const f_socket_id socket_id, const f_u_int socket_backlog); #endif // _di_fl_socket_listen_ #ifndef _di_fl_socket_close_client_ // terminate a socket connection // suggested default close_action = f_socket_close_fast. - f_extern f_return_status fl_socket_close_client(const f_socket_id socket_id_client, const f_socket_close_id close_action); + extern f_return_status fl_socket_close_client(const f_socket_id socket_id_client, const f_socket_close_id close_action); #endif // _di_fl_socket_close_client_ #ifdef __cplusplus diff --git a/level_1/fl_strings/c/strings.c b/level_1/fl_strings/c/strings.c index 1704fac..bf76eb8 100644 --- a/level_1/fl_strings/c/strings.c +++ b/level_1/fl_strings/c/strings.c @@ -11,7 +11,7 @@ extern "C" { #endif #ifndef _di_fl_rip_string_ - f_return_status fl_rip_string(f_const f_dynamic_string buffer, f_const f_string_location position, f_dynamic_string *results) { + f_return_status fl_rip_string(const f_dynamic_string buffer, const f_string_location position, f_dynamic_string *results) { #ifndef _di_level_1_parameter_checking_ if (results == 0) return f_error_set_error(f_invalid_parameter); if (position.start < 0) return f_error_set_error(f_invalid_parameter); @@ -32,7 +32,7 @@ extern "C" { return status; } - memcpy(results->string, buffer.string + position.start, sizeof(f_autochar) * size); + memcpy(results->string, buffer.string + position.start, sizeof(char) * size); results->used = size; return f_none; @@ -43,7 +43,7 @@ extern "C" { #endif // _di_fl_rip_string_ #ifndef _di_fl_seek_line_past_non_graph_ - f_return_status fl_seek_line_past_non_graph(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar placeholder) { + f_return_status fl_seek_line_past_non_graph(const f_dynamic_string buffer, f_string_location *position, const char placeholder) { #ifndef _di_level_1_parameter_checking_ if (position == 0) return f_error_set_error(f_invalid_parameter); if (position->start < 0) return f_error_set_error(f_invalid_parameter); @@ -66,7 +66,7 @@ extern "C" { #endif // _di_fl_seek_line_past_non_graph_ #ifndef _di_fl_seek_line_until_non_graph_ - f_return_status fl_seek_line_until_non_graph(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar placeholder) { + f_return_status fl_seek_line_until_non_graph(const f_dynamic_string buffer, f_string_location *position, const char placeholder) { #ifndef _di_level_1_parameter_checking_ if (position->start < 0) return f_error_set_error(f_invalid_parameter); if (position->stop < position->start) return f_error_set_error(f_invalid_parameter); @@ -88,7 +88,7 @@ extern "C" { #endif // _di_fl_seek_line_until_non_graph_ #ifndef _di_fl_seek_to_ - f_return_status fl_seek_to(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar seek_to_this) { + f_return_status fl_seek_to(const f_dynamic_string buffer, f_string_location *position, const char seek_to_this) { #ifndef _di_level_1_parameter_checking_ if (position->start < 0) return f_error_set_error(f_invalid_parameter); if (position->stop < position->start) return f_error_set_error(f_invalid_parameter); @@ -110,7 +110,7 @@ extern "C" { #endif // _di_fl_seek_to_ #ifndef _di_fl_compare_strings_ - f_return_status fl_compare_strings(f_const f_string string1, f_const f_string string2, f_const f_string_length length1, f_const f_string_length length2) { + f_return_status fl_compare_strings(const f_string string1, const f_string string2, const f_string_length length1, const f_string_length length2) { #ifndef _di_level_1_parameter_checking_ if (length1 <= 0) return f_error_set_error(f_invalid_parameter); if (length2 <= 0) return f_error_set_error(f_invalid_parameter); @@ -144,7 +144,7 @@ extern "C" { #endif // _di_fl_compare_strings_ #ifndef _di_fl_compare_dynamic_strings_ - f_return_status fl_compare_dynamic_strings(f_const f_dynamic_string string1, f_const f_dynamic_string string2) { + f_return_status fl_compare_dynamic_strings(const f_dynamic_string string1, const f_dynamic_string string2) { #ifndef _di_level_1_parameter_checking_ if (string1.used <= 0) return f_error_set_error(f_invalid_parameter); if (string2.used <= 0) return f_error_set_error(f_invalid_parameter); @@ -178,7 +178,7 @@ extern "C" { #endif // _di_fl_compare_dynamic_strings_ #ifndef _di_fl_compare_partial_dynamic_strings_ - f_return_status fl_compare_partial_dynamic_strings(f_const f_dynamic_string string1, f_const f_dynamic_string string2, f_const f_string_location offset1, f_const f_string_location offset2) { + f_return_status fl_compare_partial_dynamic_strings(const f_dynamic_string string1, const f_dynamic_string string2, const f_string_location offset1, const f_string_location offset2) { #ifndef _di_level_1_parameter_checking_ if (string1.used <= 0) return f_error_set_error(f_invalid_parameter); if (string2.used <= 0) return f_error_set_error(f_invalid_parameter); diff --git a/level_1/fl_strings/c/strings.h b/level_1/fl_strings/c/strings.h index e299c20..31b9b5e 100644 --- a/level_1/fl_strings/c/strings.h +++ b/level_1/fl_strings/c/strings.h @@ -27,31 +27,31 @@ extern "C" { #ifndef _di_fl_rip_string_ // given a start and stop position, this will return a new string based from the supplied buffer, based on the passed positions // this will replace/overwrite existing information inside of the results variable - f_extern f_return_status fl_rip_string(f_const f_dynamic_string buffer, f_const f_string_location position, f_dynamic_string *results); + extern f_return_status fl_rip_string(const f_dynamic_string buffer, const f_string_location position, f_dynamic_string *results); #endif // _di_fl_rip_string_ #ifndef _di_fl_seek_line_past_non_graph_ // given a dynamic string and a string location, seek past all non-graph characters until a graph is reached // will ignore the given placeholder - f_extern f_return_status fl_seek_line_past_non_graph(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar placeholder); + extern f_return_status fl_seek_line_past_non_graph(const f_dynamic_string buffer, f_string_location *position, const char placeholder); #endif // _di_fl_seek_line_past_non_graph_ #ifndef _di_fl_seek_line_until_non_graph_ // given a dynamic string and a string location, seek past all graph characters until a non-graph is reached // will ignore the given placeholder - f_extern f_return_status fl_seek_line_until_non_graph(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar placeholder); + extern f_return_status fl_seek_line_until_non_graph(const f_dynamic_string buffer, f_string_location *position, const char placeholder); #endif // _di_fl_seek_line_until_non_graph_ #ifndef _di_fl_seek_to_ // given a dynamic string and a string location, seek past all characters until the given character is reached - f_extern f_return_status fl_seek_to(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar seek_to_this); + extern f_return_status fl_seek_to(const f_dynamic_string buffer, f_string_location *position, const char seek_to_this); #endif // _di_fl_seek_to_ #ifndef _di_fl_compare_strings_ // this compares two strings and works similar to that of strncmp(..) but has significant differences to strncmp(..) // given two strings, this will return either f_equal_to or f_not_equal_to // this does not stop on f_eos and f_eos will be ignored as if it were not taking up any space, therefor a 5 character string could return f_equal_to if the 5 character string contains an f_eos anywhere within it - f_extern f_return_status fl_compare_strings(f_const f_string string1, f_const f_string string2, f_const f_string_length length1, f_const f_string_length length2); + extern f_return_status fl_compare_strings(const f_string string1, const f_string string2, const f_string_length length1, const f_string_length length2); #endif // _di_fl_compare_strings_ #ifndef _di_fl_compare_dynamic_strings_ @@ -59,12 +59,12 @@ extern "C" { // given two strings, this will return either f_equal_to or f_not_equal_to // this is far safer than fl_compare_strings(..) as dynamic string contain size information within them // this does not stop on f_eos and f_eos will be ignored as if it were not taking up any space, therefor a 5 character string could return f_equal_to if the 5 character string contains an f_eos anywhere within it - f_extern f_return_status fl_compare_dynamic_strings(f_const f_dynamic_string string1, f_const f_dynamic_string string2); + extern f_return_status fl_compare_dynamic_strings(const f_dynamic_string string1, const f_dynamic_string string2); #endif // _di_fl_compare_dynamic_strings_ #ifndef _di_fl_compare_partial_dynamic_strings_ // this functions identical to fl_compare_dynamic_strings, but uses offsets for both strings - f_extern f_return_status fl_compare_partial_dynamic_strings(f_const f_dynamic_string string1, f_const f_dynamic_string string2, f_const f_string_location offset1, f_const f_string_location offset2); + extern f_return_status fl_compare_partial_dynamic_strings(const f_dynamic_string string1, const f_dynamic_string string2, const f_string_location offset1, const f_string_location offset2); #endif // _di_fl_compare_partial_dynamic_strings_ #ifdef __cplusplus diff --git a/level_2/fll_colors/c/colors.c b/level_2/fll_colors/c/colors.c index dffb9cb..0bde1fe 100644 --- a/level_2/fll_colors/c/colors.c +++ b/level_2/fll_colors/c/colors.c @@ -20,7 +20,7 @@ extern "C" { // switch to the appropriate terminal color mode { - f_autochar *environment = getenv("TERM"); + char *environment = getenv("TERM"); if (!environment || strncmp(environment, "linux", 6) == 0) { data->color_list = f_colors_linux; diff --git a/level_2/fll_colors/c/colors.h b/level_2/fll_colors/c/colors.h index fb12457..05943f2 100644 --- a/level_2/fll_colors/c/colors.h +++ b/level_2/fll_colors/c/colors.h @@ -30,7 +30,7 @@ extern "C" { // For any application that uses the standard color contexts, this function will load the appropriate colors to the structure // This will handle the difference betweem xorg terminals and linux consoles // If you wish to use non-standard colors either redefine this function or don't use it - f_extern f_return_status fll_colors_load_context(fl_color_context *data, f_bool use_light_colors); + extern f_return_status fll_colors_load_context(fl_color_context *data, f_bool use_light_colors); #endif // _di_fll_colors_load_context_ #ifdef __cplusplus diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index 954abd0..2c31850 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -14,7 +14,7 @@ extern "C" { #endif #ifndef _di_fll_execute_path_ - f_return_status fll_execute_path(f_const f_string program_path, f_const f_dynamic_strings arguments, f_s_int *results) { + f_return_status fll_execute_path(const f_string program_path, const f_dynamic_strings arguments, f_s_int *results) { #ifndef _di_level_2_parameter_checking_ if (results == 0) return f_error_set_error(f_invalid_parameter); @@ -73,7 +73,7 @@ extern "C" { return status; } - memcpy(fixed_arguments[i + 1], arguments.array[i].string, sizeof(f_autochar) * arguments.array[i].used); + memcpy(fixed_arguments[i + 1], arguments.array[i].string, sizeof(char) * arguments.array[i].used); fixed_arguments[i + 1][arguments.array[i].used] = f_eos; } @@ -125,7 +125,7 @@ extern "C" { #endif // _di_fll_execute_path_ #ifndef _di_fll_execute_program_ - f_return_status fll_execute_program(f_const f_string program_name, f_const f_dynamic_strings arguments, f_s_int *results) { + f_return_status fll_execute_program(const f_string program_name, const f_dynamic_strings arguments, f_s_int *results) { #ifndef _di_level_2_parameter_checking_ if (results == 0) return f_error_set_error(f_invalid_parameter); @@ -153,7 +153,7 @@ extern "C" { return status; } - memcpy(fixed_arguments[i + 1], arguments.array[i].string, sizeof(f_autochar) * arguments.array[i].used); + memcpy(fixed_arguments[i + 1], arguments.array[i].string, sizeof(char) * arguments.array[i].used); fixed_arguments[i + 1][arguments.array[i].used] = f_eos; } diff --git a/level_2/fll_execute/c/execute.h b/level_2/fll_execute/c/execute.h index e7b56e0..bbd9492 100644 --- a/level_2/fll_execute/c/execute.h +++ b/level_2/fll_execute/c/execute.h @@ -32,12 +32,12 @@ extern "C" { #ifndef _di_fll_execute_path_ // This will execute a program given some path + program name (such as "/bin/bash") - f_extern f_return_status fll_execute_path(f_const f_string program_path, f_const f_dynamic_strings arguments, f_s_int *results); + extern f_return_status fll_execute_path(const f_string program_path, const f_dynamic_strings arguments, f_s_int *results); #endif // _di_fll_execute_path_ #ifndef _di_fll_execute_program_ // This will find the program based on PATH environment so that static paths do not have to be used as with f_execute_path - f_extern f_return_status fll_execute_program(f_const f_string program_name, f_const f_dynamic_strings arguments, f_s_int *results); + extern f_return_status fll_execute_program(const f_string program_name, const f_dynamic_strings arguments, f_s_int *results); #endif // _di_fll_execute_program_ #ifdef __cplusplus diff --git a/level_2/fll_fss/c/fss_basic.c b/level_2/fll_fss/c/fss_basic.c index 7fdb2cb..6ff0532 100644 --- a/level_2/fll_fss/c/fss_basic.c +++ b/level_2/fll_fss/c/fss_basic.c @@ -135,7 +135,7 @@ extern "C" { #endif // _di_fll_fss_basic_read_ #ifndef _di_fll_fss_basic_write_ - f_return_status fll_fss_basic_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer) { + f_return_status fll_fss_basic_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer) { #ifndef _di_level_2_parameter_checking_ if (buffer == 0) return f_error_set_error(f_invalid_parameter); if (contents.used > contents.size) return f_error_set_error(f_invalid_parameter); diff --git a/level_2/fll_fss/c/fss_basic.h b/level_2/fll_fss/c/fss_basic.h index f4b3104..431c912 100644 --- a/level_2/fll_fss/c/fss_basic.h +++ b/level_2/fll_fss/c/fss_basic.h @@ -29,12 +29,12 @@ extern "C" { #ifndef _di_fll_fss_basic_read_ // read an fss-0000 object and then content - f_extern f_return_status fll_fss_basic_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents); + extern f_return_status fll_fss_basic_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents); #endif // _di_fll_fss_basic_read_ #ifndef _di_fll_fss_basic_write_ // write an fss-0000 object and then content - f_extern f_return_status fll_fss_basic_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer); + extern f_return_status fll_fss_basic_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *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 ee33869..5c3aff1 100644 --- a/level_2/fll_fss/c/fss_basic_list.c +++ b/level_2/fll_fss/c/fss_basic_list.c @@ -135,7 +135,7 @@ extern "C" { #endif // _di_fll_fss_basic_list_read_ #ifndef _di_fll_fss_basic_list_write_ - f_return_status fll_fss_basic_list_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer) { + f_return_status fll_fss_basic_list_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer) { #ifndef _di_level_2_parameter_checking_ if (buffer == 0) return f_error_set_error(f_invalid_parameter); if (contents.used > contents.size) return f_error_set_error(f_invalid_parameter); diff --git a/level_2/fll_fss/c/fss_basic_list.h b/level_2/fll_fss/c/fss_basic_list.h index c9fff08..7494dda 100644 --- a/level_2/fll_fss/c/fss_basic_list.h +++ b/level_2/fll_fss/c/fss_basic_list.h @@ -29,12 +29,12 @@ extern "C" { #ifndef _di_fll_fss_basic_list_read_ // read an fss-0002 object and then content - f_extern f_return_status fll_fss_basic_list_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents); + extern f_return_status fll_fss_basic_list_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents); #endif // _di_fll_fss_basic_list_read_ #ifndef _di_fll_fss_basic_list_write_ // write an fss-0000 object and then content - f_extern f_return_status fll_fss_basic_list_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer); + extern f_return_status fll_fss_basic_list_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer); #endif // _di_fll_fss_basic_list_write_ #ifdef __cplusplus diff --git a/level_2/fll_fss/c/fss_errors.c b/level_2/fll_fss/c/fss_errors.c index 1a9f5a3..50b591a 100644 --- a/level_2/fll_fss/c/fss_errors.c +++ b/level_2/fll_fss/c/fss_errors.c @@ -11,7 +11,7 @@ extern "C" { #endif #ifndef _di_fll_fss_errors_to_string_ - f_return_status fll_fss_errors_to_string(f_const f_status error, f_string *string) { + f_return_status fll_fss_errors_to_string(const f_status error, f_string *string) { #ifndef _di_level_2_parameter_checking_ if (string == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ @@ -69,7 +69,7 @@ extern "C" { #endif // _di_fll_errors_to_string_ #ifndef _di_fll_fss_errors_is_error_ - f_return_status fll_fss_errors_is_error(f_const f_status error) { + f_return_status fll_fss_errors_is_error(const f_status error) { if (fll_fss_errors_is_fine(error) == f_true) { return f_false; } else if (fll_fss_errors_is_warning(error) == f_true) { @@ -81,7 +81,7 @@ extern "C" { #endif // _di_fll_fss_errors_is_error_ #ifndef _di_fll_fss_errors_is_warning_ - f_return_status fll_fss_errors_is_warning(f_const f_status error) { + f_return_status fll_fss_errors_is_warning(const f_status error) { switch (error) { #ifndef _di_fll_fss_errors_basic_ case f_no_data: @@ -109,7 +109,7 @@ extern "C" { #endif // _di_fll_fss_errors_is_warning_ #ifndef _di_fll_fss_errors_is_fine_ - f_return_status fll_fss_errors_is_fine(f_const f_status error) { + f_return_status fll_fss_errors_is_fine(const f_status error) { switch (error) { #ifndef _di_fll_fss_errors_booleans_ case f_false: diff --git a/level_2/fll_fss/c/fss_errors.h b/level_2/fll_fss/c/fss_errors.h index 8101b30..ee30f76 100644 --- a/level_2/fll_fss/c/fss_errors.h +++ b/level_2/fll_fss/c/fss_errors.h @@ -30,26 +30,26 @@ extern "C" { #ifndef _di_fll_fss_errors_to_string_ // Convert error codes to their string equivalents. - f_extern f_return_status fll_fss_errors_to_string(f_const f_status error, f_string *string); + extern f_return_status fll_fss_errors_to_string(const f_status error, f_string *string); #endif // _di_fll_errors_to_string_ #ifndef _di_fll_fss_errors_is_error_ // Returns true or false depending on whether the standard context of the error code represents an error. // Keep in mind that many of the error codes are context-specific and may be reported as an error here when it is in fact not an error. - f_extern f_return_status fll_fss_errors_is_error(f_const f_status error); + extern f_return_status fll_fss_errors_is_error(const f_status error); #endif // _di_fll_fss_errors_is_error_ #ifndef _di_fll_fss_errors_is_warning_ // Returns true or false depending on whether the standard context of the error code represents a warning. // Keep in mind that many of the error codes are context-specific and may be reported as a warning here when it is in fact not a warning. - f_extern f_return_status fll_fss_errors_is_warning(f_const f_status error); + extern f_return_status fll_fss_errors_is_warning(const f_status error); #endif // _di_fll_fss_errors_is_warning_ #ifndef _di_fll_fss_errors_is_fine_ // Returns true or false depending on whether the standard context of the error code represents an normal return status and not an error. // Keep in mind that many of the error codes are context-specific and may be reported as "fine" here when it is in fact not fine. - f_extern f_return_status fll_fss_errors_is_fine(f_const f_status error); + extern f_return_status fll_fss_errors_is_fine(const f_status error); #endif // _di_fll_fss_errors_is_fine_ #ifdef __cplusplus diff --git a/level_2/fll_fss/c/fss_extended.c b/level_2/fll_fss/c/fss_extended.c index 1bc94ad..6515112 100644 --- a/level_2/fll_fss/c/fss_extended.c +++ b/level_2/fll_fss/c/fss_extended.c @@ -135,7 +135,7 @@ extern "C" { #endif // _di_fll_fss_extended_read_ #ifndef _di_fll_fss_extended_write_ - f_return_status fll_fss_extended_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer) { + f_return_status fll_fss_extended_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer) { #ifndef _di_level_2_parameter_checking_ if (buffer == 0) return f_error_set_error(f_invalid_parameter); if (contents.used > contents.size) return f_error_set_error(f_invalid_parameter); diff --git a/level_2/fll_fss/c/fss_extended.h b/level_2/fll_fss/c/fss_extended.h index 2d59c64..061c490 100644 --- a/level_2/fll_fss/c/fss_extended.h +++ b/level_2/fll_fss/c/fss_extended.h @@ -29,12 +29,12 @@ extern "C" { #ifndef _di_fll_fss_extended_read_ // read an fss-0001 object and then content - f_extern f_return_status fll_fss_extended_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents); + extern f_return_status fll_fss_extended_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents); #endif // _di_fll_fss_extended_read_ #ifndef _di_fll_fss_extended_write_ // write an fss-0000 object and then content - f_extern f_return_status fll_fss_extended_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer); + extern f_return_status fll_fss_extended_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer); #endif // _di_fll_fss_extended_write_ #ifdef __cplusplus diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 9d6fe9c..cfbf7d7 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.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_firewall_print_version_ - f_return_status firewall_print_version(f_const firewall_data data) { + f_return_status firewall_print_version(const firewall_data data) { printf("%s\n", firewall_version); return f_none; @@ -21,7 +21,7 @@ extern "C" { #endif // _firewall_print_version_ #ifndef _di_firewall_print_help_ - f_return_status firewall_print_help(f_const firewall_data data) { + f_return_status firewall_print_help(const firewall_data data) { printf("\n"); fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", firewall_name_long); @@ -116,7 +116,7 @@ extern "C" { #endif // _di_firewall_print_help_ #ifndef _di_firewall_main_ - f_return_status firewall_main(f_const f_s_int argc, f_const f_string argv[], firewall_data *data) { + f_return_status firewall_main(const f_s_int argc, const f_string argv[], firewall_data *data) { f_status status = f_none; f_status status2 = f_none; @@ -591,9 +591,9 @@ extern "C" { return status; } - memcpy((void *)file_path.string, network_path, sizeof(f_autochar) * network_path_length); - memcpy((void *)(file_path.string + network_path_length), data->devices.array[i].string, sizeof(f_autochar) * data->devices.array[i].used); - memcpy((void *)(file_path.string + network_path_length + data->devices.array[i].used), firewall_file_suffix, sizeof(f_autochar) * firewall_file_suffix_length); + memcpy((void *)file_path.string, network_path, sizeof(char) * network_path_length); + memcpy((void *)(file_path.string + network_path_length), data->devices.array[i].string, sizeof(char) * data->devices.array[i].used); + memcpy((void *)(file_path.string + network_path_length + data->devices.array[i].used), firewall_file_suffix, sizeof(char) * firewall_file_suffix_length); file_path.used = network_path_length + data->devices.array[i].used + firewall_file_suffix_length; file_path.string[file_path.used] = 0; diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index b13d512..212ca39 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -297,19 +297,19 @@ extern "C" { #endif // _di_firewall_data_ #ifndef _di_firewall_print_version_ - f_extern f_return_status firewall_print_version(f_const firewall_data data); + extern f_return_status firewall_print_version(const firewall_data data); #endif // _di_firewall_print_version_ #ifndef _di_firewall_print_help_ - f_extern f_return_status firewall_print_help(f_const firewall_data data); + extern f_return_status firewall_print_help(const firewall_data data); #endif // _di_firewall_print_help_ #ifndef _di_firewall_main_ - f_extern f_return_status firewall_main(f_const f_s_int argc, f_const f_string argv[], firewall_data *data); + extern f_return_status firewall_main(const f_s_int argc, const f_string argv[], firewall_data *data); #endif // _di_firewall_main_ #ifndef _di_firewall_delete_data_ - f_extern f_return_status firewall_delete_data(firewall_data *data); + extern f_return_status firewall_delete_data(firewall_data *data); #endif // _di_firewall_delete_data_ #ifdef __cplusplus diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 18bb743..d503837 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -5,7 +5,7 @@ #include "private-firewall.h" #ifndef _di_firewall_perform_commands_ - f_return_status firewall_perform_commands(f_const firewall_local_data local, f_const firewall_data data) { + f_return_status firewall_perform_commands(const firewall_local_data local, const firewall_data data) { f_status status = f_none; f_status status2 = f_none; @@ -1243,7 +1243,7 @@ #endif // _di_firewall_delete_chains_ #ifndef _di_firewall_process_rules_ - f_return_status firewall_buffer_rules(f_const f_string filename, f_const f_bool optional, firewall_local_data *local, firewall_data *data) { + f_return_status firewall_buffer_rules(const f_string filename, const f_bool optional, firewall_local_data *local, firewall_data *data) { f_file file = f_file_initialize; f_status status = f_none; diff --git a/level_3/firewall/c/private-firewall.h b/level_3/firewall/c/private-firewall.h index 5ca0411..c474385 100644 --- a/level_3/firewall/c/private-firewall.h +++ b/level_3/firewall/c/private-firewall.h @@ -76,7 +76,7 @@ extern "C" { f_delete_fss_contents(status, contents); #define firewall_macro_concat_string(destination, source, length) \ - memcpy((void *)(destination), source, sizeof(f_autochar) * length); + memcpy((void *)(destination), source, sizeof(char) * length); #define firewall_macro_rule_contents_has_incorrect_items(index, total_items) \ local.rule_contents.array[index].used <= 0 || local.rule_contents.array[index].used > total_items @@ -107,7 +107,7 @@ extern "C" { #endif // _di_firewall_macro_private_ #ifndef _di_firewall_perform_commands_ - f_return_status firewall_perform_commands(f_const firewall_local_data local, f_const firewall_data data) f_gcc_attribute_visibility_internal; + f_return_status firewall_perform_commands(const firewall_local_data local, const firewall_data data) f_gcc_attribute_visibility_internal; #endif // _di_firewall_perform_commands_ #ifndef _di_firewall_create_custom_chains_ @@ -119,7 +119,7 @@ extern "C" { #endif // _di_firewall_delete_chains_ #ifndef _di_firewall_buffer_rules_ - f_return_status firewall_buffer_rules(f_const f_string filename, f_const f_bool optional, firewall_local_data *local, firewall_data *data) f_gcc_attribute_visibility_internal; + f_return_status firewall_buffer_rules(const f_string filename, const f_bool optional, firewall_local_data *local, firewall_data *data) f_gcc_attribute_visibility_internal; #endif // _di_firewall_buffer_rules_ #ifndef _di_firewall_process_rules_ 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 1bb9ba7..5b0b1f9 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 @@ -12,7 +12,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_fss_basic_list_read_print_version_ - f_return_status fss_basic_list_read_print_version(f_const fss_basic_list_read_data data) { + f_return_status fss_basic_list_read_print_version(const fss_basic_list_read_data data) { printf("%s\n", fss_basic_list_read_version); return f_none; @@ -20,7 +20,7 @@ extern "C" { #endif // _fss_basic_list_read_print_version_ #ifndef _di_fss_basic_list_read_print_help_ - f_return_status fss_basic_list_read_print_help(f_const fss_basic_list_read_data data) { + f_return_status fss_basic_list_read_print_help(const fss_basic_list_read_data data) { printf("\n"); fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_basic_list_read_name_long); @@ -129,9 +129,9 @@ 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_process_file(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_read_data *data, f_const f_string filename, f_const f_string_length target) __attribute__((visibility ("internal"))); + f_return_status fss_basic_list_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data, const f_string filename, const f_string_length target) __attribute__((visibility ("internal"))); - f_return_status fss_basic_list_read_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_read_data *data) { + f_return_status fss_basic_list_read_main(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data) { f_status status = f_none; f_status status2 = f_none; @@ -309,7 +309,7 @@ extern "C" { return status; } - f_return_status fss_basic_list_read_main_process_file(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_read_data *data, f_const f_string filename, f_const f_string_length target) { + f_return_status fss_basic_list_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data, const f_string filename, const f_string_length target) { f_status status = f_none; f_status status2 = 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 be94024..00f701e 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 @@ -127,19 +127,19 @@ extern "C" { #endif // _di_fss_basic_list_read_data_ #ifndef _di_fss_basic_list_read_print_version_ - f_extern f_return_status fss_basic_list_read_print_version(f_const fss_basic_list_read_data data); + extern f_return_status fss_basic_list_read_print_version(const fss_basic_list_read_data data); #endif // _di_fss_basic_list_read_print_version_ #ifndef _di_fss_basic_list_read_print_help_ - f_extern f_return_status fss_basic_list_read_print_help(f_const fss_basic_list_read_data data); + extern f_return_status fss_basic_list_read_print_help(const fss_basic_list_read_data data); #endif // _di_fss_basic_list_read_print_help_ #ifndef _di_fss_basic_list_read_main_ - f_extern f_return_status fss_basic_list_read_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_read_data *data); + extern f_return_status fss_basic_list_read_main(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data); #endif // _di_fss_basic_list_read_main_ #ifndef _di_fss_basic_list_read_delete_data_ - f_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 *data); #endif // _di_fss_basic_list_read_delete_data_ #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 70fe441..29a4887 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 @@ -12,7 +12,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_fss_basic_list_write_print_version_ - f_return_status fss_basic_list_write_print_version(f_const fss_basic_list_write_data data) { + f_return_status fss_basic_list_write_print_version(const fss_basic_list_write_data data) { printf("%s\n", fss_basic_list_write_version); return f_none; @@ -20,7 +20,7 @@ extern "C" { #endif // _fss_basic_list_write_print_version_ #ifndef _di_fss_basic_list_write_print_help_ - f_return_status fss_basic_list_write_print_help(f_const fss_basic_list_write_data data) { + f_return_status fss_basic_list_write_print_help(const fss_basic_list_write_data data) { printf("\n"); fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_basic_list_write_name_long); @@ -103,7 +103,7 @@ 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(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_write_data *data) { + f_return_status fss_basic_list_write_main(const f_array_length argc, const f_string argv[], fss_basic_list_write_data *data) { f_status status = f_none; f_status status2 = 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 5c65e34..d6ac39b 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 @@ -103,19 +103,19 @@ extern "C" { #endif // _di_fss_basic_list_write_data_ #ifndef _di_fss_basic_list_write_print_version_ - f_extern f_return_status fss_basic_list_write_print_version(f_const fss_basic_list_write_data data); + extern f_return_status fss_basic_list_write_print_version(const fss_basic_list_write_data data); #endif // _di_fss_basic_list_write_print_version_ #ifndef _di_fss_basic_list_write_print_help_ - f_extern f_return_status fss_basic_list_write_print_help(f_const fss_basic_list_write_data data); + extern f_return_status fss_basic_list_write_print_help(const fss_basic_list_write_data data); #endif // _di_fss_basic_list_write_print_help_ #ifndef _di_fss_basic_list_write_main_ - f_extern f_return_status fss_basic_list_write_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_write_data *data); + extern f_return_status fss_basic_list_write_main(const f_array_length argc, const f_string argv[], fss_basic_list_write_data *data); #endif // _di_fss_basic_list_write_main_ #ifndef _di_fss_basic_list_write_delete_data_ - f_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 *data); #endif // _di_fss_basic_list_write_delete_data_ #ifdef __cplusplus 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 edbae93..df46a01 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -12,7 +12,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_fss_basic_read_print_version_ - f_return_status fss_basic_read_print_version(f_const fss_basic_read_data data) { + f_return_status fss_basic_read_print_version(const fss_basic_read_data data) { printf("%s\n", fss_basic_read_version); return f_none; @@ -20,7 +20,7 @@ extern "C" { #endif // _fss_basic_read_print_version_ #ifndef _di_fss_basic_read_print_help_ - f_return_status fss_basic_read_print_help(f_const fss_basic_read_data data) { + f_return_status fss_basic_read_print_help(const fss_basic_read_data data) { printf("\n"); fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_basic_read_name_long); @@ -115,9 +115,9 @@ extern "C" { #endif // _di_fss_basic_read_print_help_ #ifndef _di_fss_basic_read_main_ - f_return_status fss_basic_read_main_process_file(f_const f_array_length argc, f_const f_string argv[], fss_basic_read_data *data, f_const f_string filename, f_const f_string_length target) f_gcc_attribute_visibility_internal; + f_return_status fss_basic_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_read_data *data, const f_string filename, const f_string_length target) f_gcc_attribute_visibility_internal; - f_return_status fss_basic_read_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_read_data *data) { + f_return_status fss_basic_read_main(const f_array_length argc, const f_string argv[], fss_basic_read_data *data) { f_status status = f_none; f_status status2 = f_none; @@ -301,7 +301,7 @@ extern "C" { return status; } - f_return_status fss_basic_read_main_process_file(f_const f_array_length argc, f_const f_string argv[], fss_basic_read_data *data, f_const f_string filename, f_const f_string_length target) { + f_return_status fss_basic_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_read_data *data, const f_string filename, const f_string_length target) { f_status status = f_none; f_status status2 = 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 0b0c2c9..8397f93 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -119,19 +119,19 @@ extern "C" { #endif // _di_fss_basic_read_data_ #ifndef _di_fss_basic_read_print_version_ - f_extern f_return_status fss_basic_read_print_version(f_const fss_basic_read_data data); + extern f_return_status fss_basic_read_print_version(const fss_basic_read_data data); #endif // _di_fss_basic_read_print_version_ #ifndef _di_fss_basic_read_print_help_ - f_extern f_return_status fss_basic_read_print_help(f_const fss_basic_read_data data); + extern f_return_status fss_basic_read_print_help(const fss_basic_read_data data); #endif // _di_fss_basic_read_print_help_ #ifndef _di_fss_basic_read_main_ - f_extern f_return_status fss_basic_read_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_read_data *data); + extern f_return_status fss_basic_read_main(const f_array_length argc, const f_string argv[], fss_basic_read_data *data); #endif // _di_fss_basic_read_main_ #ifndef _di_fss_basic_read_delete_data_ - f_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 *data); #endif // _di_fss_basic_read_delete_data_ #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 3678523..0b10e52 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -12,7 +12,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_fss_basic_write_print_version_ - f_return_status fss_basic_write_print_version(f_const fss_basic_write_data data) { + f_return_status fss_basic_write_print_version(const fss_basic_write_data data) { printf("%s\n", fss_basic_write_version); return f_none; @@ -20,7 +20,7 @@ extern "C" { #endif // _fss_basic_write_print_version_ #ifndef _di_fss_basic_write_print_help_ - f_return_status fss_basic_write_print_help(f_const fss_basic_write_data data) { + f_return_status fss_basic_write_print_help(const fss_basic_write_data data) { printf("\n"); fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_basic_write_name_long); @@ -103,7 +103,7 @@ extern "C" { #endif // _di_fss_basic_write_print_help_ #ifndef _di_fss_basic_write_main_ - f_return_status fss_basic_write_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_write_data *data) { + f_return_status fss_basic_write_main(const f_array_length argc, const f_string argv[], fss_basic_write_data *data) { f_status status = f_none; f_status status2 = 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 226942c..6411efc 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.h +++ b/level_3/fss_basic_write/c/fss_basic_write.h @@ -102,19 +102,19 @@ extern "C" { #endif // _di_fss_basic_write_data_ #ifndef _di_fss_basic_write_print_version_ - f_extern f_return_status fss_basic_write_print_version(f_const fss_basic_write_data data); + extern f_return_status fss_basic_write_print_version(const fss_basic_write_data data); #endif // _di_fss_basic_write_print_version_ #ifndef _di_fss_basic_write_print_help_ - f_extern f_return_status fss_basic_write_print_help(f_const fss_basic_write_data data); + extern f_return_status fss_basic_write_print_help(const fss_basic_write_data data); #endif // _di_fss_basic_write_print_help_ #ifndef _di_fss_basic_write_main_ - f_extern f_return_status fss_basic_write_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_write_data *data); + extern f_return_status fss_basic_write_main(const f_array_length argc, const f_string argv[], fss_basic_write_data *data); #endif // _di_fss_basic_write_main_ #ifndef _di_fss_basic_write_delete_data_ - f_extern f_return_status fss_basic_write_delete_data(fss_basic_write_data *data); + extern f_return_status fss_basic_write_delete_data(fss_basic_write_data *data); #endif // _di_fss_basic_write_delete_data_ #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 829d538..ed15b9c 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -12,7 +12,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_fss_extended_read_print_version_ - f_return_status fss_extended_read_print_version(f_const fss_extended_read_data data) { + f_return_status fss_extended_read_print_version(const fss_extended_read_data data) { printf("%s\n", fss_extended_read_version); return f_none; @@ -20,7 +20,7 @@ extern "C" { #endif // _fss_extended_read_print_version_ #ifndef _di_fss_extended_read_print_help_ - f_return_status fss_extended_read_print_help(f_const fss_extended_read_data data) { + f_return_status fss_extended_read_print_help(const fss_extended_read_data data) { printf("\n"); fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_extended_read_name_long); @@ -122,9 +122,9 @@ extern "C" { #endif // _di_fss_extended_read_print_help_ #ifndef _di_fss_extended_read_main_ - f_return_status fss_extended_read_main_process_file(f_const f_array_length argc, f_const f_string argv[], fss_extended_read_data *data, f_const f_string filename, f_const f_string_length target, f_const f_string_length select) f_gcc_attribute_visibility_internal; + f_return_status fss_extended_read_main_process_file(const f_array_length argc, const f_string argv[], fss_extended_read_data *data, const f_string filename, const f_string_length target, const f_string_length select) f_gcc_attribute_visibility_internal; - f_return_status fss_extended_read_main(f_const f_array_length argc, f_const f_string argv[], fss_extended_read_data *data) { + f_return_status fss_extended_read_main(const f_array_length argc, const f_string argv[], fss_extended_read_data *data) { f_status status = f_none; f_status status2 = f_none; @@ -315,7 +315,7 @@ extern "C" { return status; } - f_return_status fss_extended_read_main_process_file(f_const f_array_length argc, f_const f_string argv[], fss_extended_read_data *data, f_const f_string filename, f_const f_string_length target, f_const f_string_length select) { + f_return_status fss_extended_read_main_process_file(const f_array_length argc, const f_string argv[], fss_extended_read_data *data, const f_string filename, const f_string_length target, const f_string_length select) { f_status status = f_none; f_status status2 = 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 d143cbc..5bf71d6 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -123,19 +123,19 @@ extern "C" { #endif // _di_fss_extended_read_data_ #ifndef _di_fss_extended_read_print_version_ - f_extern f_return_status fss_extended_read_print_version(f_const fss_extended_read_data data); + extern f_return_status fss_extended_read_print_version(const fss_extended_read_data data); #endif // _di_fss_extended_read_print_version_ #ifndef _di_fss_extended_read_print_help_ - f_extern f_return_status fss_extended_read_print_help(f_const fss_extended_read_data data); + extern f_return_status fss_extended_read_print_help(const fss_extended_read_data data); #endif // _di_fss_extended_read_print_help_ #ifndef _di_fss_extended_read_main_ - f_extern f_return_status fss_extended_read_main(f_const f_array_length argc, f_const f_string argv[], fss_extended_read_data *data); + extern f_return_status fss_extended_read_main(const f_array_length argc, const f_string argv[], fss_extended_read_data *data); #endif // _di_fss_extended_read_main_ #ifndef _di_fss_extended_read_delete_data_ - f_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 *data); #endif // _di_fss_extended_read_delete_data_ #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 34f2aed..90c045f 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -12,7 +12,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_fss_extended_write_print_version_ - f_return_status fss_extended_write_print_version(f_const fss_extended_write_data data) { + f_return_status fss_extended_write_print_version(const fss_extended_write_data data) { printf("%s\n", fss_extended_write_version); return f_none; @@ -20,7 +20,7 @@ extern "C" { #endif // _fss_extended_write_print_version_ #ifndef _di_fss_extended_write_print_help_ - f_return_status fss_extended_write_print_help(f_const fss_extended_write_data data) { + f_return_status fss_extended_write_print_help(const fss_extended_write_data data) { printf("\n"); fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_extended_write_name_long); @@ -110,7 +110,7 @@ extern "C" { #endif // _di_fss_extended_write_print_help_ #ifndef _di_fss_extended_write_main_ - f_return_status fss_extended_write_main(f_const f_array_length argc, f_const f_string argv[], fss_extended_write_data *data) { + f_return_status fss_extended_write_main(const f_array_length argc, const f_string argv[], fss_extended_write_data *data) { f_status status = f_none; f_status status2 = 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 ad6678a..0f5a83f 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.h +++ b/level_3/fss_extended_write/c/fss_extended_write.h @@ -107,19 +107,19 @@ extern "C" { #endif // _di_fss_extended_write_data_ #ifndef _di_fss_extended_write_print_version_ - f_extern f_return_status fss_extended_write_print_version(f_const fss_extended_write_data data); + extern f_return_status fss_extended_write_print_version(const fss_extended_write_data data); #endif // _di_fss_extended_write_print_version_ #ifndef _di_fss_extended_write_print_help_ - f_extern f_return_status fss_extended_write_print_help(f_const fss_extended_write_data data); + extern f_return_status fss_extended_write_print_help(const fss_extended_write_data data); #endif // _di_fss_extended_write_print_help_ #ifndef _di_fss_extended_write_main_ - f_extern f_return_status fss_extended_write_main(f_const f_array_length argc, f_const f_string argv[], fss_extended_write_data *data); + extern f_return_status fss_extended_write_main(const f_array_length argc, const f_string argv[], fss_extended_write_data *data); #endif // _di_fss_extended_write_main_ #ifndef _di_fss_extended_write_delete_data_ - f_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 *data); #endif // _di_fss_extended_write_delete_data_ #ifdef __cplusplus diff --git a/level_3/fss_return_code/c/fss_return_code.c b/level_3/fss_return_code/c/fss_return_code.c index f3d4994..fb65f95 100644 --- a/level_3/fss_return_code/c/fss_return_code.c +++ b/level_3/fss_return_code/c/fss_return_code.c @@ -12,7 +12,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_fss_return_code_print_version_ - f_return_status fss_return_code_print_version(f_const fss_return_code_data data) { + f_return_status fss_return_code_print_version(const fss_return_code_data data) { printf("%s\n", fss_return_code_version); return f_none; @@ -20,7 +20,7 @@ extern "C" { #endif // _fss_return_code_print_version_ #ifndef _di_fss_return_code_print_help_ - f_return_status fss_return_code_print_help(f_const fss_return_code_data data) { + f_return_status fss_return_code_print_help(const fss_return_code_data data) { printf("\n"); fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_return_code_name_long); @@ -116,7 +116,7 @@ extern "C" { #endif // _di_fss_return_code_print_help_ #ifndef _di_fss_return_code_main_ - f_return_status fss_return_code_main(f_const f_array_length argc, f_const f_string argv[], fss_return_code_data *data) { + f_return_status fss_return_code_main(const f_array_length argc, const f_string argv[], fss_return_code_data *data) { f_status status = f_none; f_status allocation_status = f_none; diff --git a/level_3/fss_return_code/c/fss_return_code.h b/level_3/fss_return_code/c/fss_return_code.h index 9dd0abf..672cf6f 100644 --- a/level_3/fss_return_code/c/fss_return_code.h +++ b/level_3/fss_return_code/c/fss_return_code.h @@ -105,19 +105,19 @@ extern "C" { #endif // _di_fss_return_code_data_ #ifndef _di_fss_return_code_print_version_ - f_extern f_return_status fss_return_code_print_version(f_const fss_return_code_data data); + extern f_return_status fss_return_code_print_version(const fss_return_code_data data); #endif // _di_fss_return_code_print_version_ #ifndef _di_fss_return_code_print_help_ - f_extern f_return_status fss_return_code_print_help(f_const fss_return_code_data data); + extern f_return_status fss_return_code_print_help(const fss_return_code_data data); #endif // _di_fss_return_code_print_help_ #ifndef _di_fss_return_code_main_ - f_extern f_return_status fss_return_code_main(f_const f_array_length argc, f_const f_string argv[], fss_return_code_data *data); + extern f_return_status fss_return_code_main(const f_array_length argc, const f_string argv[], fss_return_code_data *data); #endif // _di_fss_return_code_main_ #ifndef _di_fss_return_code_delete_data_ - f_extern f_return_status fss_return_code_delete_data(fss_return_code_data *data); + extern f_return_status fss_return_code_delete_data(fss_return_code_data *data); #endif // _di_fss_return_code_delete_data_ #ifdef __cplusplus diff --git a/level_3/return_code/c/return_code.c b/level_3/return_code/c/return_code.c index 62d2b0b..aefc3fd 100644 --- a/level_3/return_code/c/return_code.c +++ b/level_3/return_code/c/return_code.c @@ -12,7 +12,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_return_code_print_version_ - f_return_status return_code_print_version(f_const return_code_data data) { + f_return_status return_code_print_version(const return_code_data data) { printf("%s\n", return_code_version); return f_none; @@ -20,7 +20,7 @@ extern "C" { #endif // _return_code_print_version_ #ifndef _di_return_code_print_help_ - f_return_status return_code_print_help(f_const return_code_data data) { + f_return_status return_code_print_help(const return_code_data data) { printf("\n"); fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", return_code_name_long); @@ -116,7 +116,7 @@ extern "C" { #endif // _di_return_code_print_help_ #ifndef _di_return_code_main_ - f_return_status return_code_main(f_const f_array_length argc, f_const f_string argv[], return_code_data *data) { + f_return_status return_code_main(const f_array_length argc, const f_string argv[], return_code_data *data) { f_status status = f_none; f_status allocation_status = f_none; diff --git a/level_3/return_code/c/return_code.h b/level_3/return_code/c/return_code.h index d3571cb..ceb9b5d 100644 --- a/level_3/return_code/c/return_code.h +++ b/level_3/return_code/c/return_code.h @@ -104,19 +104,19 @@ extern "C" { #endif // _di_return_code_data_ #ifndef _di_return_code_print_version_ - f_extern f_return_status return_code_print_version(f_const return_code_data data); + extern f_return_status return_code_print_version(const return_code_data data); #endif // _di_return_code_print_version_ #ifndef _di_return_code_print_help_ - f_extern f_return_status return_code_print_help(f_const return_code_data data); + extern f_return_status return_code_print_help(const return_code_data data); #endif // _di_return_code_print_help_ #ifndef _di_return_code_main_ - f_extern f_return_status return_code_main(f_const f_array_length argc, f_const f_string argv[], return_code_data *data); + extern f_return_status return_code_main(const f_array_length argc, const f_string argv[], return_code_data *data); #endif // _di_return_code_main_ #ifndef _di_return_code_delete_data_ - f_extern f_return_status return_code_delete_data(return_code_data *data); + extern f_return_status return_code_delete_data(return_code_data *data); #endif // _di_return_code_delete_data_ #ifdef __cplusplus -- 1.8.3.1