From: Kevin Day Date: Sun, 17 Jan 2016 20:19:36 +0000 (-0600) Subject: Progress: miscellaneous changes X-Git-Tag: 0.5.0~537 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=dd9aa77758775c0ad55998627e8120dc48be28f9;p=fll Progress: miscellaneous changes I was working on stuff a while back and was taken away from the project for quite a while. These are some uncommitted changes that I would rather commit immediately and then move forward. There are some other changes I will follow up in separate commits, such as the socket work and the init work. --- diff --git a/level_0/f_colors/c/colors.h b/level_0/f_colors/c/colors.h index 1fe0617..bfb2dc6 100644 --- a/level_0/f_colors/c/colors.h +++ b/level_0/f_colors/c/colors.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Colors - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -16,7 +16,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_color_max_size_ @@ -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 { - const f_autochar *bold; - const f_autochar *underline; - const f_autochar *blink; - const f_autochar *reverse; - const f_autochar *conceal; + 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_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 { - const f_autochar *message; - const f_autochar *warning; - const f_autochar *error; - const f_autochar *strong_message; // an emphasized message - const f_autochar *strong_warning; // an emphasized warning - const f_autochar *strong_error; // an emphasized error + 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 } 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 { - const f_autochar *title; // name printed - const f_autochar *version; // version printed - const f_autochar *topic; // topic such as 'Usage' - const f_autochar *command; // color for a specific command, such as '-h' - const f_autochar *syntax; // color for syntax, such as '[' and '<' - const f_autochar *alert; // some form of alert such as 'Not Implemented Yet' - const f_autochar *comment; // not quite important text, but still should be seen - const f_autochar *standard; // the normal text color - const f_autochar *emphasize; // make sure something stands out to emphasize it + 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 } 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 { - const f_autochar *begin; - const f_autochar *medium; - const f_autochar *end; + f_const f_autochar *begin; + f_const f_autochar *medium; + f_const f_autochar *end; } f_colors_format; #define f_colors_format_initialize_linux { "\033[", ";", "m" } @@ -87,44 +87,44 @@ extern "C"{ #ifndef _di_f_colors_ typedef struct { - const f_autochar *reset; - const f_autochar *bold; - const f_autochar *underline; - const f_autochar *blink; - const f_autochar *reverse; - const f_autochar *conceal; - const f_autochar *black; - const f_autochar *red; - const f_autochar *green; - const f_autochar *yellow; - const f_autochar *blue; - const f_autochar *purple; - const f_autochar *teal; - const f_autochar *white; - const f_autochar *black_bg; - const f_autochar *red_bg; - const f_autochar *green_bg; - const f_autochar *yellow_bg; - const f_autochar *blue_bg; - const f_autochar *purple_bg; - const f_autochar *teal_bg; - const f_autochar *white_bg; - const f_autochar *bright_black; - const f_autochar *bright_red; - const f_autochar *bright_green; - const f_autochar *bright_yellow; - const f_autochar *bright_blue; - const f_autochar *bright_purple; - const f_autochar *bright_teal; - const f_autochar *bright_white; - const f_autochar *bright_black_bg; - const f_autochar *bright_red_bg; - const f_autochar *bright_green_bg; - const f_autochar *bright_yellow_bg; - const f_autochar *bright_blue_bg; - const f_autochar *bright_purple_bg; - const f_autochar *bright_teal_bg; - const f_autochar *bright_white_bg; + 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; } 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 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; + 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; #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 222f8cc..8953760 100644 --- a/level_0/f_console/c/console.c +++ b/level_0/f_console/c/console.c @@ -1,22 +1,22 @@ /* FLL - Level 0 * Project: Console - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_console_identify_ - f_return_status f_console_identify(const f_string input, f_console_id *result) { + f_return_status f_console_identify(f_const f_string input, f_console_id *result) { #ifndef _di_level_0_parameter_checking_ - if (result == f_null) return f_error_set_error(f_invalid_parameter); + if (result == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ - const f_string_length length = strnlen(input, 4); + f_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 75f693b..49a8768 100644 --- a/level_0/f_console/c/console.h +++ b/level_0/f_console/c/console.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Console - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -19,7 +19,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // result values that represent the type of command found @@ -93,13 +93,13 @@ extern "C"{ #ifndef _di_f_console_parameter_ typedef struct { - const f_autochar *symbol_short; - const f_autochar *symbol_long; - const f_autochar *symbol_extra; - const f_autochar *symbol_other; + 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 f_bool has_additional; - const f_u_int type; + f_const f_bool has_additional; + f_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(const f_string input, f_console_id *result); + f_extern f_return_status f_console_identify(f_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 4b91ee1..5889548 100644 --- a/level_0/f_conversion/c/conversion.c +++ b/level_0/f_conversion/c/conversion.c @@ -1,17 +1,17 @@ /* FLL - Level 0 * Project: Conversion - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_is_digit_ - f_return_status f_is_digit(const f_autochar character) { + f_return_status f_is_digit(f_const f_autochar 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(const f_autochar character) { + f_return_status f_is_hexdigit(f_const f_autochar character) { switch (character) { case '0': @@ -68,9 +68,9 @@ extern "C"{ #endif // _di_f_is_hexdigit_ #ifndef _di_f_character_to_digit_ - f_return_status f_character_to_digit(const f_autochar character, f_u_long *digit) { + f_return_status f_character_to_digit(f_const f_autochar character, f_u_long *digit) { #ifndef _di_level_0_parameter_checking_ - if (digit == f_null) return f_error_set_error(f_invalid_parameter); + if (digit == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ switch (character) { @@ -93,9 +93,9 @@ extern "C"{ #endif // _di_f_character_to_digit_ #ifndef _di_f_character_to_hexdigit_ - f_return_status f_character_to_hexdigit(const f_autochar character, f_u_long *digit) { + f_return_status f_character_to_hexdigit(f_const f_autochar character, f_u_long *digit) { #ifndef _di_level_0_parameter_checking_ - if (digit == f_null) return f_error_set_error(f_invalid_parameter); + if (digit == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ switch (character) { @@ -130,9 +130,9 @@ extern "C"{ #endif // _di_f_character_to_hexdigit_ #ifndef _di_f_string_to_digit_ - f_return_status f_string_to_digit(const f_string string, f_u_long *digit, const f_string_location location) { + f_return_status f_string_to_digit(f_const f_string string, f_u_long *digit, f_const f_string_location location) { #ifndef _di_level_0_parameter_checking_ - if (digit == f_null) return f_error_set_error(f_invalid_parameter); + if (digit == 0) return f_error_set_error(f_invalid_parameter); 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); if (string == 0) return f_error_set_error(f_invalid_parameter); @@ -165,9 +165,9 @@ extern "C"{ #endif // _di_f_string_to_digit_ #ifndef _di_f_string_to_hexdigit_ - f_return_status f_string_to_hexdigit(const f_string string, f_u_long *digit, const f_string_location location) { + f_return_status f_string_to_hexdigit(f_const f_string string, f_u_long *digit, f_const f_string_location location) { #ifndef _di_level_0_parameter_checking_ - if (digit == f_null) return f_error_set_error(f_invalid_parameter); + if (digit == 0) return f_error_set_error(f_invalid_parameter); 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); if (string == 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 053d94e..d6d1f7a 100644 --- a/level_0/f_conversion/c/conversion.h +++ b/level_0/f_conversion/c/conversion.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Conversion - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -28,41 +28,41 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_is_digit_ // convert a single character into the digit that it represents - f_extern f_return_status f_is_digit(const f_autochar character); + f_extern f_return_status f_is_digit(f_const f_autochar 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(const f_autochar character); + f_extern f_return_status f_is_hexdigit(f_const f_autochar 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(const f_autochar character, f_u_long *digit); + f_extern f_return_status f_character_to_digit(f_const f_autochar 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(const f_autochar character, f_u_long *digit); + f_extern f_return_status f_character_to_hexdigit(f_const f_autochar 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(const f_string string, f_u_long *digit, const f_string_location location); + f_extern f_return_status f_string_to_digit(f_const f_string string, f_u_long *digit, f_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(const f_string string, f_u_long *digit, const f_string_location location); + f_extern f_return_status f_string_to_hexdigit(f_const f_string string, f_u_long *digit, f_const f_string_location location); #endif // _di_f_string_to_hexdigit_ #ifdef __cplusplus diff --git a/level_0/f_errors/c/errors.h b/level_0/f_errors/c/errors.h index c66b5cf..4e7e97b 100644 --- a/level_0/f_errors/c/errors.h +++ b/level_0/f_errors/c/errors.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Errors - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -12,8 +12,11 @@ #ifndef _F_errors_h #define _F_errors_h +// libc includes +#include + #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_macro_test_for_basic_errors_ @@ -240,21 +243,64 @@ enum { #endif // _di_f_errors_signals_ #ifndef _di_f_errors_basic_ - f_none = 197, // start at 197 to allow compatibility with the reserved bash return codes (keep in mind fss return codes can be larger than 255). - f_dummy, // to only be used as a placeholder - f_warn, // warning + f_none = 197, // start at 197 to allow compatibility with the reserved bash return codes (keep in mind fss return codes can be larger than 255). + f_dummy, // to only be used as a placeholder + f_warn, // warning f_critical, - f_unknown, // For the "code should never get here" errors. (this is an EMERGENCY error) + f_unknown, // For the "code should never get here" errors. (this is an EMERGENCY error) f_unsupported, - f_invalid_parameter, - f_invalid_syntax, - f_invalid_data, - f_no_data, // warning + f_no_data, // warning + f_out_of_memory, + f_input_error, f_output_error, + f_input_output_error, f_does_not_exist, + f_not_connected, f_failure, + f_interrupted, // usually by a signal. + f_loop, // such as infinite recursion. #endif // _di_f_errors_basic_ + #ifndef _di_f_errors_invalid_ + f_invalid, + f_invalid_parameter, + f_invalid_syntax, + f_invalid_data, + f_invalid_file, + f_invalid_directory, + f_invalid_socket, + f_invalid_device, + f_invalid_link, + f_invalid_pipe, + f_invalid_address, + f_invalid_port, + f_invalid_value, // similar to f_invalid_parameter, but the parameter value is invalid (example: an integer value representing aboolean and having a 3 as a value). + f_invalid_buffer, + f_invalid_process, + #endif // _di_f_errors_invalid_ + + #ifndef _di_f_errors_busy_ + f_busy, // such as address in use, or port in use. + f_busy_address, + f_busy_port, + f_busy_socket, + f_busy_device, + f_busy_pipe, + f_busy_buffer, + f_busy_process, + #endif // _di_f_errors_busy_ + + #ifndef _di_f_errors_unavailable_ + f_unavailable, + f_unavailable_address, + f_unavailable_port, + f_unavailable_socket, + f_unavailable_device, + f_unavailable_pipe, + f_unavailable_buffer, + f_unavailable_process, + #endif // _di_f_errors_unavailable_ + #ifndef _di_f_errors_digits_ f_underflow, f_overflow, @@ -265,14 +311,14 @@ enum { #endif // _di_f_errors_digits_ #ifndef _di_f_errors_buffers_ - f_no_data_on_eof, // warning - f_no_data_on_eol, // warning - f_no_data_on_eos, // warning - f_no_data_on_stop, // warning - f_none_on_eof, // warning - f_none_on_eol, // warning - f_none_on_eos, // warning - f_none_on_stop, // "stop" location was reached + f_no_data_on_eof, // warning + f_no_data_on_eol, // warning + f_no_data_on_eos, // warning + f_no_data_on_stop, // warning + f_none_on_eof, // warning + f_none_on_eol, // warning + f_none_on_eos, // warning + f_none_on_stop, // "stop" location was reached f_error_on_eof, f_error_on_eol, f_error_on_eos, @@ -300,6 +346,7 @@ enum { #ifndef _di_f_errors_fork_ f_fork_failed, + f_too_many_processes, #endif // _di_f_errors_fork_ #ifndef _di_f_errors_file_ @@ -313,6 +360,7 @@ enum { f_file_synchronize_error, f_file_descriptor_error, f_file_not_found, + f_file_found, f_file_is_empty, f_file_not_open, f_file_allocation_error, @@ -339,6 +387,13 @@ enum { f_directory_error, #endif // _di_f_errors_directory_ + #ifndef _di_f_errors_socket_ + f_socket_connection_client_error, + f_socket_connection_target_error, + f_socket_receive_error, + f_socket_send_error, + #endif // _di_f_errors_socket_ + #ifndef _di_f_errors_non_ f_less_than, f_equal_to, @@ -346,6 +401,17 @@ enum { f_greater_than, #endif // _di_f_errors_non_ + #ifndef _di_f_errors_access_denied_ + f_access_denied, + f_access_denied_user, + f_access_denied_group, + f_access_denied_world, + f_access_denied_read, + f_access_denied_write, + f_access_denied_execute, + f_access_denied_super, // not super user (aka: not root). + #endif // _di_f_errors_access_denied_ + // required f_last_error_code }; // enum diff --git a/level_0/f_file/c/file.c b/level_0/f_file/c/file.c index 016747b..bace897 100644 --- a/level_0/f_file/c/file.c +++ b/level_0/f_file/c/file.c @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: File - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -11,13 +11,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_file_open_ - f_return_status f_file_open(f_file *file_information, const f_string filename) { + f_return_status f_file_open(f_file *file_information, f_const f_string filename) { #ifndef _di_level_0_parameter_checking_ - if (file_information == f_null) return f_error_set_error(f_invalid_parameter); + if (file_information == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ // if file->mode is unset, then this may cause a segfault, depending on whether or not the libc will handle this appropriately @@ -39,7 +39,7 @@ extern "C"{ #ifndef _di_f_file_close_ f_return_status f_file_close(f_file *file_information) { #ifndef _di_level_0_parameter_checking_ - if (file_information == f_null) return f_error_set_error(f_invalid_parameter); + if (file_information == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ if (file_information->file == 0) return f_error_set_error(f_file_not_open); @@ -61,7 +61,7 @@ extern "C"{ #ifndef _di_f_file_flush_ f_return_status f_file_flush(f_file *file_information) { #ifndef _di_level_0_parameter_checking_ - if (file_information == f_null) return f_error_set_error(f_invalid_parameter); + if (file_information == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ if (file_information->file == 0) return f_error_set_error(f_file_not_open); @@ -72,9 +72,9 @@ 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, const f_file_position location) { + f_return_status f_file_read(f_file *file_information, f_dynamic_string *buffer, f_const f_file_position location) { #ifndef _di_level_0_parameter_checking_ - if (file_information == f_null) return f_error_set_error(f_invalid_parameter); + 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); if (location.buffer_start < 0) return f_error_set_error(f_invalid_parameter); @@ -136,7 +136,7 @@ extern "C"{ #ifndef _di_f_file_read_fifo_ f_return_status f_file_read_fifo(f_file *file_information, f_dynamic_string *buffer) { #ifndef _di_level_0_parameter_checking_ - if (file_information == f_null) return f_error_set_error(f_invalid_parameter); + 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); #endif // _di_level_0_parameter_checking_ @@ -161,6 +161,88 @@ 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) { + return f_none; + } + + f_int result = 0; + + result = stat(file, stat); + if (result < 0) { + if (errno == ENAMETOOLONG || errno == EFAULT) { + return f_error_set_error(f_invalid_parameter); + } + else if (errno == ENOMEM) { + return f_error_set_error(f_out_of_memory); + } + else if (errno == EOVERFLOW) { + return f_error_set_error(f_overflow); + } + else if (errno == ENOTDIR) { + return f_error_set_error(f_invalid_directory); + } + else if (errno == ENOENT) { + return f_file_not_found; + } + else if (errno == EACCESS) { + return f_error_set_error(f_access_denied); + } + else if (errno == ELOOP) { + return f_error_set_error(f_loop); + } + + return f_error_set_error(f_file_stat_error); + } + + return f_none; + } +#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) { + #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) { + return f_none; + } + + f_int result = 0; + + result = stat(file, stat); + if (result < 0) { + if (errno == ENAMETOOLONG || errno == EFAULT) { + return f_error_set_error(f_invalid_parameter); + } + else if (errno == ENOMEM) { + return f_error_set_error(f_out_of_memory); + } + else if (errno == EOVERFLOW) { + return f_error_set_error(f_overflow); + } + else if (errno == ENOTDIR) { + return f_error_set_error(f_invalid_directory); + } + else if (errno == ENOENT) { + return f_file_not_found; + } + else if (errno == EACCESS) { + return f_error_set_error(f_access_denied); + } + else if (errno == ELOOP) { + return f_error_set_error(f_loop); + } + + return f_error_set_error(f_file_stat_error); + } + + return f_none; + } +#endif // _di_f_file_stat_by_id_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_file/c/file.h b/level_0/f_file/c/file.h index 31a3b6c..745421d 100644 --- a/level_0/f_file/c/file.h +++ b/level_0/f_file/c/file.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: File - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -24,7 +24,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_file_types_ @@ -54,7 +54,7 @@ extern "C"{ #ifndef _di_f_file_ typedef struct { f_file_id id; // file descriptor - f_file_type file; // the file data type + f_file_p 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) } f_file; @@ -198,7 +198,7 @@ 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, const f_string filename); + f_extern f_return_status f_file_open(f_file *file_information, f_const f_string filename); #endif // _di_f_file_open_ #ifndef _di_f_file_close_ @@ -213,7 +213,7 @@ extern "C"{ #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, const f_file_position location); + f_extern f_return_status f_file_read(f_file *file_information, f_dynamic_string *buffer, f_const f_file_position location); #endif // _di_f_file_read_ #ifndef _di_f_file_read_fifo_ @@ -221,6 +221,14 @@ extern "C"{ f_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); +#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); +#endif // _di_f_file_stat_by_id_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_fss/c/fss.h b/level_0/f_fss/c/fss.h index 024149c..6c35769 100644 --- a/level_0/f_fss/c/fss.h +++ b/level_0/f_fss/c/fss.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -19,7 +19,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_fss_types_ @@ -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((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_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_resize_fss_object(status, object, old_length, new_length) \ - status = f_resize((void **) & object, sizeof(f_fss_object), old_length, new_length) + status = f_resize((f_void_p *) & object, sizeof(f_fss_object), old_length, new_length) #define f_adjust_fss_object(status, object, old_length, new_length) \ - status = f_adjust((void **) & object, sizeof(f_fss_object), old_length, new_length) + status = f_adjust((f_void_p *) & 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 ed3316e..1d892e0 100644 --- a/level_0/f_memory/c/memory.c +++ b/level_0/f_memory/c/memory.c @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Memory - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -10,11 +10,11 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_new_ - f_return_status f_new_array(void **pointer, const f_memory_size_t type, const f_memory_length length) { + f_return_status f_new_array(f_void_p *pointer, f_const f_memory_size_t type, f_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); @@ -37,7 +37,7 @@ extern "C"{ #endif // _di_f_new_ #if ! ( defined (_di_f_delete_) || defined (_f_memory_FORCE_secure_memory_) ) - f_return_status f_delete(void **pointer, const f_memory_size_t type, const f_memory_length length) { + f_return_status f_delete(f_void_p *pointer, f_const f_memory_size_t type, f_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_ @@ -55,7 +55,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(void **pointer, const f_memory_size_t type, const f_memory_length length) { + f_return_status f_destroy(f_void_p *pointer, f_const f_memory_size_t type, f_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); @@ -79,7 +79,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(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length) { + 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) { #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); @@ -91,7 +91,7 @@ extern "C"{ if (old_length == new_length) return f_none; if (*pointer != 0) { - void *new_pointer = 0; + f_void_p new_pointer = 0; // allocate new space if (new_length > 0) { @@ -109,7 +109,7 @@ extern "C"{ if (new_pointer != *pointer) { if (new_length > old_length) { // bool * 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 (void *) having arithmetic issues + // this is done to avoid problems with (f_void_p) having arithmetic issues memset(((char *) new_pointer) + (type * old_length), 0, type * (new_length - old_length)); } @@ -133,7 +133,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(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length) { + 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) { #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); @@ -145,12 +145,12 @@ extern "C"{ if (old_length == new_length) return f_none; if (*pointer != 0) { - void *new_pointer = 0; + f_void_p new_pointer = 0; if (old_length > 0) { if (new_length < old_length) { // bool * 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 (void *) having arithmetic issues + // this is done to avoid problems with (f_void_p) having arithmetic issues memset(((char *)*pointer) + new_length, 0, type * (old_length - new_length)); } } @@ -171,7 +171,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 (void *) having arithmetic issues + // this is done to avoid problems with (f_void_p) 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 e29303d..9223620 100644 --- a/level_0/f_memory/c/memory.h +++ b/level_0/f_memory/c/memory.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Memory - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -33,7 +33,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifdef _f_memory_FORCE_secure_memory_ @@ -67,32 +67,32 @@ extern "C"{ #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(void **pointer, const f_memory_size_t type, const f_memory_length length); + 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); #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(void **pointer, const f_memory_size_t type, const f_memory_length length); + f_extern f_return_status f_delete(f_void_p *pointer, f_const f_memory_size_t type, f_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(void **pointer, const f_memory_size_t type, const f_memory_length length); + f_extern f_return_status f_destroy(f_void_p *pointer, f_const f_memory_size_t type, f_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(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length); + 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); #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(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length); + 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); #endif // _di_f_adjust_ @@ -103,7 +103,7 @@ extern "C"{ // structure: the structure to operate on // type: the structure type #define f_delete_structure(status, structure, type) \ - status = f_delete((void **) & structure.array, sizeof(type), structure.size); \ + status = f_delete((f_void_p *) & structure.array, sizeof(type), structure.size); \ if (status == f_none) { \ structure.size = 0; \ structure.used = 0; \ @@ -115,7 +115,7 @@ extern "C"{ // structure: the structure to operate on // type: the structure type #define f_destroy_structure(status, structure, type) \ - status = f_destroy((void **) & structure.array, sizeof(type), structure.size); \ + status = f_destroy((f_void_p *) & structure.array, sizeof(type), structure.size); \ if (status == f_none) { \ structure.size = 0; \ structure.used = 0; \ @@ -127,7 +127,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((void **) & structure.array, sizeof(type), structure.size, new_length); \ + status = f_resize((f_void_p *) & 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; \ @@ -139,7 +139,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((void **) & structure.array, sizeof(type), structure.size, new_length); \ + status = f_adjust((f_void_p *) & 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; \ @@ -160,7 +160,7 @@ extern "C"{ f_delete_structure(status, structures.array[structures.size], type); \ if (status != f_none) break; \ } \ - if (status == f_none) status = f_delete((void **) & structures.array, sizeof(type), structures.size); \ + if (status == f_none) status = f_delete((f_void_p *) & structures.array, sizeof(type), structures.size); \ if (status == f_none) structures.used = 0; #endif // _di_f_delete_structures_ @@ -175,7 +175,7 @@ extern "C"{ f_destroy_structure(status, structures.array[structures.size], type); \ if (status != f_none) break; \ } \ - if (status == f_none) status = f_destroy((void **) & structures.array, sizeof(type), structures.size); \ + if (status == f_none) status = f_destroy((f_void_p *) & structures.array, sizeof(type), structures.size); \ if (status == f_none) structures.used = 0; #endif // _di_f_destroy_structures_ @@ -192,7 +192,7 @@ extern "C"{ if (status != f_none) break; \ } \ } \ - if (status == f_none) status = f_resize((void **) & structures.array, sizeof(type), structures.size, new_length); \ + if (status == f_none) status = f_resize((f_void_p *) & structures.array, sizeof(type), structures.size, new_length); \ if (status == f_none) { \ if (new_length > structures.size) { \ length_variable i = structures.size; \ @@ -218,7 +218,7 @@ extern "C"{ if (status != f_none) break; \ } \ } \ - if (status == f_none) status = f_adjust((void **) & structures.array, sizeof(type), structures.size, new_length); \ + if (status == f_none) status = f_adjust((f_void_p *) & 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_paths/c/filesystem_paths.h b/level_0/f_paths/c/filesystem_paths.h index 63ebbc1..8e6701e 100644 --- a/level_0/f_paths/c/filesystem_paths.h +++ b/level_0/f_paths/c/filesystem_paths.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Paths - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -13,137 +13,146 @@ #define _F_filesystem_paths_h #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // KFS Filesystem Paths -#ifdef _en_kevux_filesystem_paths_ +#ifdef _di_kevux_standard_paths_ // disable the FHS default paths - #define _di_filesystem_paths_ + #define _di_filesystem_hierarch_standard_paths_ // KFS Root Level - #define f_path_devices "/devices" - #define f_path_external "/external" - #define f_path_libraries "/libraries" - #define f_path_programs "/programs" - #define f_path_system "/system" - #define f_path_temporary "/temporary" - #define f_path_home "/home" - - // FHS Root Level - #define f_path_boot f_path_devices"/boot" - #define f_path_hardware f_path_devices"/devices" - #define f_path_processes f_path_devices"/processes" - #define f_path_systemfs f_path_devices"/systemfs" + #define f_path_devices "/devices" + #define f_path_external "/external" + #define f_path_libraries "/libraries" + #define f_path_programs "/programs" + #define f_path_temporary "/temporary" + #define f_path_home "/home" + #define f_path_run "/run" + #define f_path_binary "/.system" + + // Kernel Level + #define f_path_boot f_path_devices"/boot" + #define f_path_hardware f_path_devices"/devices" + #define f_path_processes f_path_devices"/processes" + #define f_path_system f_path_devices"/system" // Program Level - #define f_path_programs_public f_path_programs"/public" - #define f_path_programs_system f_path_programs"/system" - #define f_path_programs_remote f_path_programs"/remote" - #define f_path_programs_services f_path_programs"/services" - #define f_path_programs_toolchain f_path_programs"/toolchain" - #define f_path_programs_users f_path_programs"/users" - #define f_path_programs_susers f_path_programs"/users" - #define f_path_programs_boot f_path_boot"/programs" - #define f_path_programs_sboot f_path_boot"/programs" + #define f_path_programs_public f_path_programs"/public" + #define f_path_programs_system f_path_programs"/system" + #define f_path_programs_remote f_path_programs"/remote" + #define f_path_programs_services f_path_programs"/targets" + #define f_path_programs_toolchain f_path_programs"/toolchain" + #define f_path_programs_users f_path_programs"/users" + #define f_path_programs_susers f_path_programs"/users" + #define f_path_programs_boot f_path_boot"/programs" + #define f_path_programs_sboot f_path_boot"/programs" // Library Level - #define f_path_libraries_public f_path_libraries"/public" - #define f_path_libraries_system f_path_libraries"/system" - #define f_path_libraries_remote f_path_libraries"/remote" - #define f_path_libraries_services f_path_libraries"/services" - #define f_path_libraries_toolchain f_path_libraries"/toolchain" - #define f_path_libraries_users f_path_libraries"/users" - #define f_path_libraries_boot f_path_boot"/libraries" + #define f_path_libraries_public f_path_libraries"/public" + #define f_path_libraries_system f_path_libraries"/system" + #define f_path_libraries_remote f_path_libraries"/remote" + #define f_path_libraries_services f_path_libraries"/targets" + #define f_path_libraries_toolchain f_path_libraries"/toolchain" + #define f_path_libraries_users f_path_libraries"/users" + #define f_path_libraries_boot f_path_boot"/libraries" // Home Level - #define f_path_home_services f_path_home"/services" - #define f_path_home_share f_path_home"/share" - #define f_path_home_users f_path_home"/users" - #define f_path_home_websites f_path_home"/websites" + #define f_path_home_services f_path_home"/services" + #define f_path_home_share f_path_home"/share" + #define f_path_home_users f_path_home"/users" + #define f_path_home_websites f_path_home"/websites" // System Level - #define f_path_system_logs f_path_system"/logs" - #define f_path_system_settings f_path_system"/settings" - #define f_path_system_data f_path_system"/data" - #define f_path_system_variables f_path_system"/variables" // for backwards FHS support only, use of this directory is considered bad practice for KFS, use f_path_temporary_variables instead + #define f_path_system_logs f_path_system"/logs" + #define f_path_system_settings f_path_system"/settings" + #define f_path_system_data f_path_system"/data" + #define f_path_system_variables f_path_system"/variables" // for backwards FHS support only, use of this directory is considered bad practice for KFS, use f_path_temporary_variables instead // Temporary Level - #define f_path_temporary_public f_path_temporary"/public" - #define f_path_temporary_services f_path_temporary"/services" - #define f_path_temporary_users f_path_temporary"/users" - #define f_path_temporary_variables f_path_temporary"/variables" + #define f_path_temporary_public f_path_temporary"/public" + #define f_path_temporary_services f_path_temporary"/services" + #define f_path_temporary_users f_path_temporary"/users" + #define f_path_temporary_variables f_path_temporary"/variables" // Private User Directories - #define f_path_user_downloads "~/downloads" - #define f_path_user_desktop "~/desktop" - #define f_path_user_private "~/.private" - #define f_path_user_settings "~/.settings" - #define f_path_user_data "~/.data" -#endif //_en_kevux_filesystem_paths_ + #define f_path_user_downloads "downloads" + #define f_path_user_desktop "desktop" + #define f_path_user_private "private" + #define f_path_user_settings "settings" + #define f_path_user_data "data" + #define f_path_user_temporary "temporary" + #define f_path_user_shared "shared" +#endif // _di_kevux_standard_paths_ // FHS Filesystem Paths -#ifndef _di_filesystem_paths_ +#ifndef _di_filesystem_hierarch_standard_paths_ + // disable the kevux standard default paths + #define _di_kevux_standard_paths_ + // KFS Root Level - #define f_path_devices "/" - #define f_path_external "/mnt" - #define f_path_libraries "/" - #define f_path_programs "/" - #define f_path_system "/" - #define f_path_temporary "/" - #define f_path_home "/home" + #define f_path_devices "/" + #define f_path_external "/mnt" + #define f_path_libraries "/" + #define f_path_programs "/" + #define f_path_temporary "/" + #define f_path_home "/home" + #define f_path_run "/run" + #define f_path_binary "/.system" // FHS Root Level - #define f_path_boot "/boot" - #define f_path_hardware "/dev" - #define f_path_processes "/proc" - #define f_path_systemfs "/sysfs" + #define f_path_boot "/boot" + #define f_path_hardware "/dev" + #define f_path_processes "/proc" + #define f_path_system "/sysfs" // Program Level - #define f_path_programs_public "/usr/bin" - #define f_path_programs_system "/usr/sbin" - #define f_path_programs_remote "/usr/bin" - #define f_path_programs_services "/usr/sbin" - #define f_path_programs_toolchain "/usr/bin" - #define f_path_programs_users "/usr/local/bin" - #define f_path_programs_susers "/usr/local/sbin" - #define f_path_programs_boot "/bin" - #define f_path_programs_sboot "/sbin" + #define f_path_programs_public "/usr/bin" + #define f_path_programs_system "/usr/sbin" + #define f_path_programs_remote "/usr/bin" + #define f_path_programs_services "/usr/sbin" + #define f_path_programs_toolchain "/usr/bin" + #define f_path_programs_users "/usr/local/bin" + #define f_path_programs_susers "/usr/local/sbin" + #define f_path_programs_boot "/bin" + #define f_path_programs_sboot "/sbin" // Library Level - #define f_path_libraries_public "/usr/lib" - #define f_path_libraries_system "/usr/lib" - #define f_path_libraries_remote "/usr/lib" - #define f_path_libraries_services "/usr/lib" - #define f_path_libraries_toolchain "/usr/lib" - #define f_path_libraries_users "/usr/local/lib" - #define f_path_libraries_boot "/lib" + #define f_path_libraries_public "/usr/lib" + #define f_path_libraries_system "/usr/lib" + #define f_path_libraries_remote "/usr/lib" + #define f_path_libraries_services "/usr/lib" + #define f_path_libraries_toolchain "/usr/lib" + #define f_path_libraries_users "/usr/local/lib" + #define f_path_libraries_boot "/lib" // Home Level - #define f_path_home_services "/srv" - #define f_path_home_share "/" - #define f_path_home_users f_path_home - #define f_path_home_websites "/srv/www" + #define f_path_home_services "/srv" + #define f_path_home_share "/" + #define f_path_home_users f_path_home + #define f_path_home_websites "/srv/www" // System Level - #define f_path_system_logs "/var/log" - #define f_path_system_settings "/etc" - #define f_path_system_data "/usr/share" - #define f_path_system_variables "/var" + #define f_path_system_logs "/var/log" + #define f_path_system_settings "/etc" + #define f_path_system_data "/usr/share" + #define f_path_system_variables "/var" // Temporary Level - #define f_path_temporary_public "/tmp" - #define f_path_temporary_services "/tmp" - #define f_path_temporary_users "/tmp" - #define f_path_temporary_variables "/var/tmp" + #define f_path_temporary_public "/tmp" + #define f_path_temporary_services "/tmp" + #define f_path_temporary_users "/tmp" + #define f_path_temporary_variables "/var/tmp" // Private User Directories - #define f_path_user_downloads "~" - #define f_path_user_desktop "~/Desktop" - #define f_path_user_private "~" - #define f_path_user_settings "~" - #define f_path_user_data "~" -#endif // _di_filesystem_paths_ + #define f_path_user_downloads "downloads" + #define f_path_user_desktop "desktop" + #define f_path_user_private "" + #define f_path_user_settings "" + #define f_path_user_data "" + #define f_path_user_temporary "" + #define f_path_user_shared "" +#endif // _di_filesystem_hierarch_standard_paths_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_paths/c/fll_paths.h b/level_0/f_paths/c/fll_paths.h index ab93192..8abbb61 100644 --- a/level_0/f_paths/c/fll_paths.h +++ b/level_0/f_paths/c/fll_paths.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Paths - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -16,7 +16,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // TODO: don't forget to completely restructure the paths layout before 0.1.0 is released diff --git a/level_0/f_pipe/c/pipe.c b/level_0/f_pipe/c/pipe.c index f8febb7..87a412b 100644 --- a/level_0/f_pipe/c/pipe.c +++ b/level_0/f_pipe/c/pipe.c @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Pipe - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -10,13 +10,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_pipe_exists_ // returns f_true if the standard input contains piped data. f_return_status f_pipe_exists() { - struct stat st_info; + f_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 75b2c2e..74539b6 100644 --- a/level_0/f_pipe/c/pipe.h +++ b/level_0/f_pipe/c/pipe.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Pipe - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -20,7 +20,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_pipe_ diff --git a/level_0/f_print/c/print.c b/level_0/f_print/c/print.c index 100d7e7..27a2356 100644 --- a/level_0/f_print/c/print.c +++ b/level_0/f_print/c/print.c @@ -1,17 +1,17 @@ /* FLL - Level 0 * Project: Output - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_print_string_ - f_return_status f_print_string(f_file_type output, const f_string string, const f_string_length length) { + f_return_status f_print_string(f_file_p output, f_const f_string string, f_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_type output, const f_dynamic_string buffer) { + f_return_status f_print_dynamic_string(f_file_p output, f_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_type output, const f_dynamic_string buffer, const f_string_location location) { + f_return_status f_print_partial_dynamic_string(f_file_p output, f_const f_dynamic_string buffer, f_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 9b0a5eb..bd08e36 100644 --- a/level_0/f_print/c/print.h +++ b/level_0/f_print/c/print.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Output - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -22,7 +22,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_print_string_ @@ -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_type output, const f_string string, const f_string_length length); + f_extern f_return_status f_print_string(f_file_p output, f_const f_string string, f_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_type output, const f_dynamic_string buffer); + f_extern f_return_status f_print_dynamic_string(f_file_p output, f_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_type output, const f_dynamic_string buffer, const f_string_location location); + 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); #endif // _di_f_print_partial_dynamic_string_ #ifdef __cplusplus diff --git a/level_0/f_serialized/c/serialized.h b/level_0/f_serialized/c/serialized.h index 6631677..d25f287 100644 --- a/level_0/f_serialized/c/serialized.h +++ b/level_0/f_serialized/c/serialized.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Serialized - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -20,7 +20,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_serialized_splitters_ diff --git a/level_0/f_strings/c/strings.h b/level_0/f_strings/c/strings.h index 00fe666..8c75076 100644 --- a/level_0/f_strings/c/strings.h +++ b/level_0/f_strings/c/strings.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Strings - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -19,13 +19,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // BUG: for whatever reason strnlen is considered not included with -Wall, even with __USE_GNU defined // therefore this gets defined here #ifndef _di_BUG_strnlen_ - f_extern size_t strnlen (const char *string, size_t max_length); + f_extern size_t strnlen (f_const char *string, size_t max_length); #endif // _di_BUG_strnlen_ // Define the end of string character @@ -74,15 +74,15 @@ extern "C"{ #define f_string_max_size f_unsigned_long_size #define f_string_initialize f_eos - #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_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_resize_string(status, string, old_length, new_length) \ - status = f_resize((void **) & string, sizeof(f_string), old_length, new_length) + status = f_resize((f_void_p *) & string, sizeof(f_string), old_length, new_length) #define f_adjust_string(status, string, old_length, new_length) \ - status = f_adjust((void **) & string, sizeof(f_string), old_length, new_length) + status = f_adjust((f_void_p *) & 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_unsigned - #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) status = f_delete((void **) & string) - #define f_destroy_string_length(status, string, size) status = f_destroy((void **) & string, sizeof(f_string_length), size) + #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) status = f_delete((f_void_p *) & string) + #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((void **) & length, sizeof(f_string_length), old_length, new_length) + status = f_resize((f_void_p *) & length, sizeof(f_string_length), old_length, new_length) #define f_adjust_string_length(status, length, old_length, new_length) \ - status = f_adjust((void **) & length, sizeof(f_string_length), old_length, new_length) + status = f_adjust((f_void_p *) & length, sizeof(f_string_length), old_length, new_length) #endif // _di_f_string_length_ #ifndef _di_f_string_lengths_ @@ -133,15 +133,15 @@ extern "C"{ #define f_string_location_initialize { 1, 0 } - #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_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_resize_string_location(status, string_location, old_length, new_length) \ - status = f_resize((void **) & string_location, sizeof(f_string_location), old_length, new_length) + status = f_resize((f_void_p *) & 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((void **) & string_location, sizeof(f_string_location), old_length, new_length) + status = f_adjust((f_void_p *) & string_location, sizeof(f_string_location), old_length, new_length) #endif // _di_f_string_location_ // an array of string locations @@ -179,28 +179,28 @@ extern "C"{ #define f_dynamic_string_initialize { f_string_initialize, 0, 0 } #define f_delete_dynamic_string(status, dynamic) \ - status = f_delete((void **) & dynamic.string, sizeof(f_string), dynamic.size); \ + status = f_delete((f_void_p *) & 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((void **) & dynamic.string, sizeof(f_string), dynamic.size); \ + status = f_destroy((f_void_p *) & 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((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \ + status = f_resize((f_void_p *) & 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((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \ + status = f_adjust((f_void_p *) & 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; \ @@ -224,7 +224,7 @@ extern "C"{ f_delete_dynamic_string(status, dynamics.array[dynamics.size]); \ if (status != f_none) break; \ } \ - if (status == f_none) status = f_delete((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \ + if (status == f_none) status = f_delete((f_void_p *) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \ if (status == f_none) dynamics.used = 0; #define f_destroy_dynamic_strings(status, dynamics) \ @@ -234,7 +234,7 @@ extern "C"{ f_destroy_dynamic_string(status, dynamics.array[dynamics.size]); \ if (status != f_none) break; \ } \ - if (status == f_none) status = f_destroy((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \ + if (status == f_none) status = f_destroy((f_void_p *) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \ if (status == f_none) dynamics.used = 0; #define f_resize_dynamic_strings(status, dynamics, new_length) \ @@ -246,7 +246,7 @@ extern "C"{ if (status != f_none) break; \ } \ } \ - if (status == f_none) status = f_resize((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size, new_length); \ + if (status == f_none) status = f_resize((f_void_p *) & 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; \ @@ -267,7 +267,7 @@ extern "C"{ if (status != f_none) break; \ } \ } \ - if (status == f_none) status = f_adjust((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size, new_length); \ + if (status == f_none) status = f_adjust((f_void_p *) & 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 8d2ac15..b6ea66e 100644 --- a/level_0/f_types/c/types.h +++ b/level_0/f_types/c/types.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Types - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -35,7 +35,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_types_normal @@ -66,32 +66,38 @@ extern "C"{ #define f_nlink_t nlink_t #define f_off_t off_t #define f_fpos_t fpos_t - #define f_file_type FILE * - #define f_null NULL + #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. -// TODO: Should min_char be implemented? #ifndef _di_f_types_min #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_s_short_short + #define f_min_s_short_short f_t_s_short_short #define f_min_s_long_long f_s_long_long - #define f_min_s_double f_s_double + #define f_min_s_double f_t_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_u_short + #define f_min_u_short f_t_u_short #define f_min_u_long f_u_long - #define f_min_u_short_short f_u_short_short + #define f_min_u_short_short f_t_u_short_short #define f_min_u_long_long f_u_long_long - #define f_min_u_double f_u_double + #define f_min_u_double f_t_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. -// TODO: Should max_char be implemented? #ifndef _di_f_types_max #define f_max_s_int f_s_int #define f_max_s_short f_s_short @@ -107,16 +113,17 @@ 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 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 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 // 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 const f_status + #define f_return_status f_const f_status #else #define f_return_status f_status #endif // __cplusplus @@ -151,11 +158,15 @@ extern "C"{ // Defines a variable to be used by arrays. #ifndef _di_f_array_length_ - typedef f_u_long f_array_length; - typedef f_u_int f_array_length_short; - typedef f_u_long_long f_array_length_long; + typedef f_u_long f_t_array_length; + typedef f_u_int f_t_array_length_short; + typedef f_u_long_long f_t_array_length_long; #endif // _di_f_array_length_ +#ifndef _di_f_gcc_specific_ +#define f_gcc_attribute_visibility_internal __attribute__((visibility("internal"))) +#endif // _di_f_gcc_specific_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_types/c/types_array.h b/level_0/f_types/c/types_array.h index 41ac453..9b150ff 100644 --- a/level_0/f_types/c/types_array.h +++ b/level_0/f_types/c/types_array.h @@ -1,6 +1,6 @@ /* FLL - Level 0 * Project: Types Array - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -19,7 +19,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_f_array_lengths_ diff --git a/level_1/fl_colors/c/colors.c b/level_1/fl_colors/c/colors.c index d77f247..863a65d 100644 --- a/level_1/fl_colors/c/colors.c +++ b/level_1/fl_colors/c/colors.c @@ -1,56 +1,56 @@ /* FLL - Level 1 * Project: Colors - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_set_color_ - f_return_status fl_set_color(f_file_type file, const f_colors_format format, const f_autochar *color1, const f_autochar *color2, const f_autochar *color3, const f_autochar *color4, const f_autochar *color5) { + 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) { #ifndef _di_level_1_parameter_checking_ - if (file == f_null) return f_error_set_error(f_invalid_parameter); - if (color1 == f_null) return f_error_set_error(f_invalid_parameter); + if (file == 0) return f_error_set_error(f_invalid_parameter); + if (color1 == 0) return f_error_set_error(f_invalid_parameter); // make sure all data is in the proper order - if (color2 == f_null && (color3 != f_null || color4 != f_null || color5 != f_null)) return f_invalid_parameter; - if (color3 == f_null && (color4 != f_null || color5 != f_null)) return f_invalid_parameter; - if (color4 == f_null && color5 != f_null) return f_invalid_parameter; + if (color2 == 0 && (color3 != 0 || color4 != 0 || color5 != 0)) return f_invalid_parameter; + if (color3 == 0 && (color4 != 0 || color5 != 0)) return f_invalid_parameter; + if (color4 == 0 && color5 != 0) return f_invalid_parameter; #endif // _di_level_1_parameter_checking_ - if (color2 == f_null) fprintf(file, "%s%s%s", format.begin, color1, format.end); - else if (color3 == f_null) fprintf(file, "%s%s%s%s%s", format.begin, color1, format.medium, color2, format.end); - else if (color4 == f_null) fprintf(file, "%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.end); - else if (color5 == f_null) fprintf(file, "%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.end); - else fprintf(file, "%s%s%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.medium, color5, format.end); + if (color2 == 0) fprintf(file, "%s%s%s", format.begin, color1, format.end); + else if (color3 == 0) fprintf(file, "%s%s%s%s%s", format.begin, color1, format.medium, color2, format.end); + else if (color4 == 0) fprintf(file, "%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.end); + else if (color5 == 0) fprintf(file, "%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.end); + else fprintf(file, "%s%s%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.medium, color5, format.end); return f_none; } #endif // _di_fl_set_color_ #ifndef _di_fl_save_color_ - f_return_status fl_save_color(f_dynamic_string *buffer, const f_colors_format format, const f_autochar *color1, const f_autochar *color2, const f_autochar *color3, const f_autochar *color4, const f_autochar *color5) { + 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) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); - if (color1 == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); + if (color1 == 0) return f_error_set_error(f_invalid_parameter); // make sure all data is in the proper order - if (color2 == f_null && (color3 != f_null || color4 != f_null || color5 != f_null)) return f_error_set_error(f_invalid_parameter); - if (color3 == f_null && (color4 != f_null || color5 != f_null)) return f_error_set_error(f_invalid_parameter); - if (color4 == f_null && color5 != f_null) return f_error_set_error(f_invalid_parameter); + if (color2 == 0 && (color3 != 0 || color4 != 0 || color5 != 0)) return f_error_set_error(f_invalid_parameter); + if (color3 == 0 && (color4 != 0 || color5 != 0)) return f_error_set_error(f_invalid_parameter); + if (color4 == 0 && color5 != 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ f_string_length string_size = strnlen(format.begin, f_color_max_size) + strnlen(format.end, f_color_max_size) + 1; - if (color2 == f_null) string_size += strnlen(color1, f_color_max_size); - else if (color3 == f_null) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size); - else if (color4 == f_null) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size); - else if (color5 == f_null) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size) + strnlen(color4, f_color_max_size); - else string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size) + strnlen(color4, f_color_max_size) + strnlen(color5, f_color_max_size); + if (color2 == 0) string_size += strnlen(color1, f_color_max_size); + else if (color3 == 0) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size); + else if (color4 == 0) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size); + else if (color5 == 0) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size) + strnlen(color4, f_color_max_size); + else string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size) + strnlen(color4, f_color_max_size) + strnlen(color5, f_color_max_size); // make sure there is enough allocated space, if not, then allocate some more if (buffer->size - buffer->used - 1 < string_size) { @@ -63,17 +63,17 @@ extern "C"{ } } - if (color2 == f_null) { + if (color2 == 0) { strncat(buffer->string, format.begin, f_color_max_size); strncat(buffer->string, color1, f_color_max_size); strncat(buffer->string, format.end, f_color_max_size); - } else if (color3 == f_null) { + } else if (color3 == 0) { strncat(buffer->string, format.begin, f_color_max_size); strncat(buffer->string, color1, f_color_max_size); strncat(buffer->string, format.medium, f_color_max_size); strncat(buffer->string, color2, f_color_max_size); strncat(buffer->string, format.end, f_color_max_size); - } else if (color4 == f_null) { + } else if (color4 == 0) { strncat(buffer->string, format.begin, f_color_max_size); strncat(buffer->string, color1, f_color_max_size); strncat(buffer->string, format.medium, f_color_max_size); @@ -81,7 +81,7 @@ extern "C"{ strncat(buffer->string, format.medium, f_color_max_size); strncat(buffer->string, color3, f_color_max_size); strncat(buffer->string, format.end, f_color_max_size); - } else if (color5 == f_null) { + } else if (color5 == 0) { strncat(buffer->string, format.begin, f_color_max_size); strncat(buffer->string, color1, f_color_max_size); strncat(buffer->string, format.medium, f_color_max_size); @@ -116,10 +116,10 @@ extern "C"{ #endif // _di_fl_save_color_ #ifndef _di_fl_print_color_ - f_return_status fl_print_color(f_file_type file, const f_dynamic_string start_color, const f_dynamic_string end_color, const f_autochar *string, ...) { + 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, ...) { #ifndef _di_level_1_parameter_checking_ - if (file == f_null) return f_error_set_error(f_invalid_parameter); - if (string == f_null) return f_error_set_error(f_invalid_parameter); + if (file == 0) return f_error_set_error(f_invalid_parameter); + if (string == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ if (start_color.used != 0) { @@ -143,10 +143,10 @@ extern "C"{ #endif // _di_fl_print_color_ #ifndef _di_fl_print_color_line_ - f_return_status fl_print_color_line(f_file_type file, const f_dynamic_string start_color, const f_dynamic_string end_color, const f_autochar *string, ...) { + 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, ...) { #ifndef _di_level_1_parameter_checking_ - if (file == f_null) return f_error_set_error(f_invalid_parameter); - if (string == f_null) return f_error_set_error(f_invalid_parameter); + if (file == 0) return f_error_set_error(f_invalid_parameter); + if (string == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ if (start_color.used != 0) { @@ -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_type file, const f_dynamic_string color) { + f_return_status fl_print_color_code(f_file_p file, f_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 2a079e7..4f7bc7d 100644 --- a/level_1/fl_colors/c/colors.h +++ b/level_1/fl_colors/c/colors.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: Colors - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -23,7 +23,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_color_context_ @@ -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_type file, const f_colors_format format, const f_autochar *color1, const f_autochar *color2, const f_autochar *color3, const f_autochar *color4, const f_autochar *color5); + 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); #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, const f_colors_format format, const f_autochar *color1, const f_autochar *color2, const f_autochar *color3, const f_autochar *color4, const f_autochar *color5); + 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); #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_type file, const f_dynamic_string start_color, const f_dynamic_string end_color, const f_autochar *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, ...); #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_type file, const f_dynamic_string start_color, const f_dynamic_string end_color, const f_autochar *string, ...); + 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, ...); #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_type file, const f_dynamic_string color); + f_extern f_return_status fl_print_color_code(f_file_p file, f_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 ced1872..96c129c 100644 --- a/level_1/fl_console/c/console.c +++ b/level_1/fl_console/c/console.c @@ -1,19 +1,19 @@ /* FLL - Level 1 * Project: Console - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_process_parameters_ - 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) { + 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) { #ifndef _di_level_1_parameter_checking_ - if (remaining == f_null) return f_error_set_error(f_invalid_parameter); + if (remaining == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ f_status status = f_none; diff --git a/level_1/fl_console/c/console.h b/level_1/fl_console/c/console.h index 5254203..72027a2 100644 --- a/level_1/fl_console/c/console.h +++ b/level_1/fl_console/c/console.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: Console - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -20,11 +20,11 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_process_parameters_ - f_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); + 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); #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 b3d5330..86c6a4b 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: Directory - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -8,14 +8,14 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_directory_list_ // put the names of each file and/or directory inside the names parameter - f_return_status fl_directory_list(const f_string directory_path, f_dynamic_strings *names) { + f_return_status fl_directory_list(f_const f_string directory_path, f_dynamic_strings *names) { #ifndef _di_level_1_parameter_checking_ - if (names == f_null) return f_error_set_error(f_invalid_parameter); + if (names == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ struct dirent **listing = 0; @@ -50,11 +50,11 @@ extern "C"{ } // FIXME: the second and third paramater are probably wrong - f_delete((void **) & listing[counter], sizeof(struct dirent), 0); + f_delete((f_void_p *) & listing[counter], sizeof(struct dirent), 0); } // FIXME: the second and third paramater are probably wrong - f_delete((void **) & listing, sizeof(struct dirent *), 0); + f_delete((f_void_p *) & 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 b2710af..40b4ef2 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: Directory - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -25,7 +25,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_directory_limitations_ @@ -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(const f_string directory_path, f_dynamic_strings *names); + f_extern f_return_status fl_directory_list(f_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 85ca5af..dec5c2b 100644 --- a/level_1/fl_errors/c/errors.c +++ b/level_1/fl_errors/c/errors.c @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: Errors - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -10,13 +10,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_errors_to_string_ - f_return_status fl_errors_to_string(const f_status error, f_string *string) { + f_return_status fl_errors_to_string(f_const f_status error, f_string *string) { #ifndef _di_level_1_parameter_checking_ - if (string == f_null) return f_error_set_error(f_invalid_parameter); + if (string == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ f_status umasked_error = f_error_set_fine(error); @@ -303,7 +303,7 @@ extern "C"{ #endif // _di_fl_errors_non_ default: - *string = f_null; + *string = 0; return f_invalid_data; } @@ -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(const f_status error) { + f_return_status fl_errors_is_error(f_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(const f_status error) { + f_return_status fl_errors_is_warning(f_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(const f_status error) { + f_return_status fl_errors_is_fine(f_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 772d7f8..4ff632b 100644 --- a/level_1/fl_errors/c/errors.h +++ b/level_1/fl_errors/c/errors.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: Errors - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -16,30 +16,30 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_errors_to_string_ // Convert error codes to their string equivalents. - f_extern f_return_status fl_errors_to_string(const f_status error, f_string *string); + f_extern f_return_status fl_errors_to_string(f_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(const f_status error); + f_extern f_return_status fl_errors_is_error(f_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(const f_status error); + f_extern f_return_status fl_errors_is_warning(f_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(const f_status error); + f_extern f_return_status fl_errors_is_fine(f_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 d235b7d..ff340d4 100644 --- a/level_1/fl_file/c/file.c +++ b/level_1/fl_file/c/file.c @@ -1,19 +1,19 @@ /* FLL - Level 1 * Project: File - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_file_read_ - f_return_status fl_file_read(f_file file, const f_file_position position, f_dynamic_string *buffer) { + f_return_status fl_file_read(f_file file, f_const f_file_position position, f_dynamic_string *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); if (position.buffer_start < 0) return f_error_set_error(f_invalid_parameter); if (position.file_start < 0) return f_error_set_error(f_invalid_parameter); @@ -68,7 +68,7 @@ extern "C"{ #ifndef _di_fl_file_read_fifo_ f_return_status fl_file_read_fifo(f_file file, f_dynamic_string *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ if (file.file == 0) return f_error_set_warning(f_file_not_open); @@ -108,7 +108,7 @@ extern "C"{ #endif // _di_fl_file_read_fifo_ #ifndef _di_fl_file_write_ - f_return_status fl_file_write(f_file file, const f_dynamic_string buffer) { + f_return_status fl_file_write(f_file file, f_const f_dynamic_string buffer) { if (file.file == 0) return f_error_set_error(f_file_not_open); f_status status = f_none; @@ -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, const f_dynamic_string buffer, const f_string_location position) { + f_return_status fl_file_write_partial(f_file file, f_const f_dynamic_string buffer, f_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_ diff --git a/level_1/fl_file/c/file.h b/level_1/fl_file/c/file.h index a0350ab..c3028f2 100644 --- a/level_1/fl_file/c/file.h +++ b/level_1/fl_file/c/file.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: File - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -15,11 +15,11 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_file_read_ - f_extern f_return_status fl_file_read(f_file file, const f_file_position position, f_dynamic_string *buffer); + f_extern f_return_status fl_file_read(f_file file, f_const f_file_position position, f_dynamic_string *buffer); #endif // _di_fl_file_read_ #ifndef _di_fl_file_read_fifo_ @@ -27,11 +27,11 @@ extern "C"{ #endif // _di_fl_file_read_fifo_ #ifndef _di_fl_file_write_ - f_extern f_return_status fl_file_write(f_file file, const f_dynamic_string buffer); + f_extern f_return_status fl_file_write(f_file file, f_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, const f_dynamic_string buffer, const f_string_location position); + f_extern f_return_status fl_file_write_partial(f_file file, f_const f_dynamic_string buffer, f_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 37f32f7..a599965 100644 --- a/level_1/fl_fss/c/fss.c +++ b/level_1/fl_fss/c/fss.c @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -8,13 +8,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_fss_identify_ - f_return_status fl_fss_identify(const f_dynamic_string buffer, f_fss_header *header) { + f_return_status fl_fss_identify(f_const f_dynamic_string buffer, f_fss_header *header) { #ifndef _di_level_1_parameter_checking_ - if (header == f_null) return f_error_set_error(f_invalid_parameter); + if (header == 0) return f_error_set_error(f_invalid_parameter); if (buffer.used <= 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ @@ -101,8 +101,8 @@ extern "C"{ #ifndef _di_fl_fss_identify_file_ f_return_status fl_fss_identify_file(f_file *file_information, f_fss_header *header) { #ifndef _di_level_1_parameter_checking_ - if (file_information == f_null) return f_error_set_error(f_invalid_parameter); - if (header == f_null) return f_error_set_error(f_invalid_parameter); + if (file_information == 0) return f_error_set_error(f_invalid_parameter); + if (header == 0) return f_error_set_error(f_invalid_parameter); if (file_information->file == 0) return f_file_not_open; if (ferror(file_information->file) != 0) return f_file_error; #endif // _di_level_1_parameter_checking_ @@ -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, const f_string_location location) { +f_return_status fl_fss_shift_delimiters(f_dynamic_string *buffer, f_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 772fe60..e640623 100644 --- a/level_1/fl_fss/c/fss.h +++ b/level_1/fl_fss/c/fss.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ @@ -23,11 +23,11 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_fss_identify_ - f_extern f_return_status fl_fss_identify(const f_dynamic_string buffer, f_fss_header *header); + f_extern f_return_status fl_fss_identify(f_const f_dynamic_string buffer, f_fss_header *header); #endif // _di_fl_fss_identify_ #ifndef _di_fl_fss_identify_file_ @@ -38,7 +38,7 @@ extern "C"{ // 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, const f_string_location location); + f_extern f_return_status fl_fss_shift_delimiters(f_dynamic_string *buffer, f_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 26f2bd7..56f9943 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -1,21 +1,21 @@ /* FLL - Level 1 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_fss_basic_object_read_ f_return_status fl_fss_basic_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); - if (input == f_null) return f_error_set_error(f_invalid_parameter); - if (found == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); + if (input == 0) return f_error_set_error(f_invalid_parameter); + if (found == 0) return f_error_set_error(f_invalid_parameter); if (input->start < 0) return f_error_set_error(f_invalid_parameter); if (input->stop < input->start) return f_error_set_error(f_invalid_parameter); if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter); @@ -302,9 +302,9 @@ extern "C"{ #ifndef _di_fl_fss_basic_content_read_ f_return_status fl_fss_basic_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); - if (input == f_null) return f_error_set_error(f_invalid_parameter); - if (found == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); + if (input == 0) return f_error_set_error(f_invalid_parameter); + if (found == 0) return f_error_set_error(f_invalid_parameter); if (input->start < 0) return f_error_set_error(f_invalid_parameter); if (input->stop < input->start) return f_error_set_error(f_invalid_parameter); if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter); @@ -345,9 +345,9 @@ extern "C"{ #endif // _di_fl_fss_basic_content_read_ #ifndef _di_fl_fss_basic_object_write_ - f_return_status fl_fss_basic_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) { + f_return_status fl_fss_basic_object_write(f_dynamic_string *buffer, f_const f_dynamic_string object, f_string_location *input) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ f_status status = f_none; @@ -549,9 +549,9 @@ extern "C"{ #endif // _di_fl_fss_basic_object_write_ #ifndef _di_fl_fss_basic_content_write_ - f_return_status fl_fss_basic_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) { + f_return_status fl_fss_basic_content_write(f_dynamic_string *buffer, f_const f_dynamic_string content, f_string_location *input) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ f_status status = f_none; diff --git a/level_1/fl_fss/c/fss_basic.h b/level_1/fl_fss/c/fss_basic.h index 8a80f0f..af83dc3 100644 --- a/level_1/fl_fss/c/fss_basic.h +++ b/level_1/fl_fss/c/fss_basic.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -27,7 +27,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_fss_basic_object_read_ @@ -42,12 +42,12 @@ extern "C"{ #ifndef _di_fl_fss_basic_object_write_ // write an fss-0000 object - f_extern f_return_status fl_fss_basic_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer); + f_extern f_return_status fl_fss_basic_object_write(f_dynamic_string *buffer, f_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(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer); + f_extern f_return_status fl_fss_basic_content_write(f_dynamic_string *buffer, f_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 13f78e2..60a8ae8 100644 --- a/level_1/fl_fss/c/fss_basic_list.c +++ b/level_1/fl_fss/c/fss_basic_list.c @@ -1,21 +1,21 @@ /* FLL - Level 1 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_fss_basic_list_object_read_ f_return_status fl_fss_basic_list_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); - if (input == f_null) return f_error_set_error(f_invalid_parameter); - if (found == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); + if (input == 0) return f_error_set_error(f_invalid_parameter); + if (found == 0) return f_error_set_error(f_invalid_parameter); if (input->start < 0) return f_error_set_error(f_invalid_parameter); if (input->stop < input->start) return f_error_set_error(f_invalid_parameter); if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter); @@ -167,9 +167,9 @@ extern "C"{ #ifndef _di_fl_fss_basic_list_content_read_ f_return_status fl_fss_basic_list_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); - if (input == f_null) return f_error_set_error(f_invalid_parameter); - if (found == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); + if (input == 0) return f_error_set_error(f_invalid_parameter); + if (found == 0) return f_error_set_error(f_invalid_parameter); if (input->start < 0) return f_error_set_error(f_invalid_parameter); if (input->stop < input->start) return f_error_set_error(f_invalid_parameter); if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter); @@ -346,9 +346,9 @@ extern "C"{ #endif // _di_fl_fss_basic_list_content_read_ #ifndef _di_fl_fss_basic_list_object_write_ - f_return_status fl_fss_basic_list_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) { + f_return_status fl_fss_basic_list_object_write(f_const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ f_status status = f_none; @@ -468,9 +468,9 @@ extern "C"{ #endif // _di_fl_fss_basic_list_object_write_ #ifndef _di_fl_fss_basic_list_content_write_ - f_return_status fl_fss_basic_list_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) { + f_return_status fl_fss_basic_list_content_write(f_const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ f_status status = f_none; diff --git a/level_1/fl_fss/c/fss_basic_list.h b/level_1/fl_fss/c/fss_basic_list.h index c566d64..c05c114 100644 --- a/level_1/fl_fss/c/fss_basic_list.h +++ b/level_1/fl_fss/c/fss_basic_list.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -28,7 +28,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_fss_basic_list_object_read_ @@ -43,12 +43,12 @@ extern "C"{ #ifndef _di_fl_fss_basic_list_object_write_ // write an fss-0002 object - f_extern f_return_status fl_fss_basic_list_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer); + 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); #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(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer); + 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); #endif // _di_fl_fss_basic_list_content_write_ #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss_errors.h b/level_1/fl_fss/c/fss_errors.h index 30cf86a..d5f1a2a 100644 --- a/level_1/fl_fss/c/fss_errors.h +++ b/level_1/fl_fss/c/fss_errors.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * @@ -15,7 +15,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_macro_test_for_fss_errors_ diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index b01f58b..49b94ea 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -1,21 +1,21 @@ /* FLL - Level 1 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_fss_extended_object_read_ f_return_status fl_fss_extended_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); - if (input == f_null) return f_error_set_error(f_invalid_parameter); - if (found == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); + if (input == 0) return f_error_set_error(f_invalid_parameter); + if (found == 0) return f_error_set_error(f_invalid_parameter); if (input->start < 0) return f_error_set_error(f_invalid_parameter); if (input->stop < input->start) return f_error_set_error(f_invalid_parameter); if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter); @@ -280,9 +280,9 @@ extern "C"{ #ifndef _di_fl_fss_extended_content_read_ f_return_status fl_fss_extended_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); - if (input == f_null) return f_error_set_error(f_invalid_parameter); - if (found == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); + if (input == 0) return f_error_set_error(f_invalid_parameter); + if (found == 0) return f_error_set_error(f_invalid_parameter); if (input->start < 0) return f_error_set_error(f_invalid_parameter); if (input->stop < input->start) return f_error_set_error(f_invalid_parameter); if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter); @@ -603,9 +603,9 @@ extern "C"{ #endif // _di_fl_fss_extended_content_read_ #ifndef _di_fl_fss_extended_object_write_ - f_return_status fl_fss_extended_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) { + f_return_status fl_fss_extended_object_write(f_const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ f_status status = f_none; @@ -823,9 +823,9 @@ extern "C"{ #endif // _di_fl_fss_extended_object_write_ #ifndef _di_fl_fss_extended_content_write_ - f_return_status fl_fss_extended_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) { + f_return_status fl_fss_extended_content_write(f_const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_1_parameter_checking_ f_status status = f_none; diff --git a/level_1/fl_fss/c/fss_extended.h b/level_1/fl_fss/c/fss_extended.h index 22500b9..f9c3e98 100644 --- a/level_1/fl_fss/c/fss_extended.h +++ b/level_1/fl_fss/c/fss_extended.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -27,7 +27,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_fss_extended_object_read_ @@ -42,12 +42,12 @@ extern "C"{ #ifndef _di_fl_fss_extended_object_write_ // write an fss-0001 object - f_extern f_return_status fl_fss_extended_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer); + f_extern f_return_status fl_fss_extended_object_write(f_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(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer); + f_extern f_return_status fl_fss_extended_content_write(f_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_fss/c/fss_macro.h b/level_1/fl_fss/c/fss_macro.h index e44ff59..a8f3960 100644 --- a/level_1/fl_fss/c/fss_macro.h +++ b/level_1/fl_fss/c/fss_macro.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -11,7 +11,7 @@ #define _FL_fss_macro_h #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_macro_fss_apply_delimit_placeholders_ diff --git a/level_1/fl_serialized/c/serialized.c b/level_1/fl_serialized/c/serialized.c index 3909884..8b965c8 100644 --- a/level_1/fl_serialized/c/serialized.c +++ b/level_1/fl_serialized/c/serialized.c @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: Serialized - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ @@ -11,9 +11,9 @@ extern "C" { #endif #ifndef _di_fl_serialize_simple_ - f_return_status fl_serialize_simple(const f_dynamic_string value, f_dynamic_string *serialized) { + f_return_status fl_serialize_simple(f_const f_dynamic_string value, f_dynamic_string *serialized) { #ifndef _di_level_0_parameter_checking_ - if (serialized == f_null) return f_error_set_error(f_invalid_parameter); + if (serialized == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ f_status status = f_none; @@ -39,9 +39,9 @@ extern "C" { #endif // _di_fl_serialize_simple_ #ifndef _di_fl_unserialize_simple_ - f_return_status fl_unserialize_simple(const f_dynamic_string serialized, f_string_locations *locations) { + f_return_status fl_unserialize_simple(f_const f_dynamic_string serialized, f_string_locations *locations) { #ifndef _di_level_0_parameter_checking_ - if (locations == f_null) return f_error_set_error(f_invalid_parameter); + if (locations == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ f_status status = f_none; @@ -78,9 +78,9 @@ extern "C" { #endif // _di_fl_unserialize_simple_ #ifndef _di_fl_unserialize_simple_get_ - f_return_status fl_unserialize_simple_get(const f_dynamic_string serialized, const f_array_length index, f_string_location *location) { + f_return_status fl_unserialize_simple_get(f_const f_dynamic_string serialized, f_const f_array_length index, f_string_location *location) { #ifndef _di_level_0_parameter_checking_ - if (location == f_null) return f_error_set_error(f_invalid_parameter); + if (location == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ f_status status = f_none; diff --git a/level_1/fl_serialized/c/serialized.h b/level_1/fl_serialized/c/serialized.h index 97adab4..845651d 100644 --- a/level_1/fl_serialized/c/serialized.h +++ b/level_1/fl_serialized/c/serialized.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: Serialized - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -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(const f_dynamic_string value, f_dynamic_string *serialized); + f_extern f_return_status fl_serialize_simple(f_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(const f_dynamic_string serialized, f_string_locations *locations); + f_extern f_return_status fl_unserialize_simple(f_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(const f_dynamic_string serialized, const f_array_length index, f_string_location *location); + 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); #endif // _di_fl_unserialize_simple_get_ #ifdef __cplusplus diff --git a/level_1/fl_strings/c/strings.c b/level_1/fl_strings/c/strings.c index c734032..1704fac 100644 --- a/level_1/fl_strings/c/strings.c +++ b/level_1/fl_strings/c/strings.c @@ -1,19 +1,19 @@ /* FLL - Level 1 * Project: Strings - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fl_rip_string_ - f_return_status fl_rip_string(const f_dynamic_string buffer, const f_string_location position, f_dynamic_string *results) { + f_return_status fl_rip_string(f_const f_dynamic_string buffer, f_const f_string_location position, f_dynamic_string *results) { #ifndef _di_level_1_parameter_checking_ - if (results == f_null) return f_error_set_error(f_invalid_parameter); + if (results == 0) return f_error_set_error(f_invalid_parameter); 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); if (buffer.used <= 0) return f_error_set_error(f_invalid_parameter); @@ -43,9 +43,9 @@ extern "C"{ #endif // _di_fl_rip_string_ #ifndef _di_fl_seek_line_past_non_graph_ - f_return_status fl_seek_line_past_non_graph(const f_dynamic_string buffer, f_string_location *position, const f_autochar placeholder) { + f_return_status fl_seek_line_past_non_graph(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar placeholder) { #ifndef _di_level_1_parameter_checking_ - if (position == f_null) return f_error_set_error(f_invalid_parameter); + if (position == 0) return f_error_set_error(f_invalid_parameter); 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); if (buffer.used <= 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(const f_dynamic_string buffer, f_string_location *position, const f_autochar placeholder) { + f_return_status fl_seek_line_until_non_graph(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar 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(const f_dynamic_string buffer, f_string_location *position, const f_autochar seek_to_this) { + f_return_status fl_seek_to(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar 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(const f_string string1, const f_string string2, const f_string_length length1, const f_string_length length2) { + 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) { #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(const f_dynamic_string string1, const f_dynamic_string string2) { + f_return_status fl_compare_dynamic_strings(f_const f_dynamic_string string1, f_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(const f_dynamic_string string1, const f_dynamic_string string2, const f_string_location offset1, const f_string_location offset2) { + 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) { #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 5c73048..e299c20 100644 --- a/level_1/fl_strings/c/strings.h +++ b/level_1/fl_strings/c/strings.h @@ -1,6 +1,6 @@ /* FLL - Level 1 * Project: Strings - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -21,37 +21,37 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #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(const f_dynamic_string buffer, const f_string_location position, f_dynamic_string *results); + f_extern f_return_status fl_rip_string(f_const f_dynamic_string buffer, f_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(const f_dynamic_string buffer, f_string_location *position, const f_autochar 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); #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(const f_dynamic_string buffer, f_string_location *position, const f_autochar 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); #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(const f_dynamic_string buffer, f_string_location *position, const f_autochar seek_to_this); + 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); #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(const f_string string1, const f_string string2, const f_string_length length1, const f_string_length length2); + 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); #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(const f_dynamic_string string1, const f_dynamic_string string2); + f_extern f_return_status fl_compare_dynamic_strings(f_const f_dynamic_string string1, f_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(const f_dynamic_string string1, const f_dynamic_string string2, const f_string_location offset1, const f_string_location offset2); + 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); #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 ceb4151..dffb9cb 100644 --- a/level_2/fll_colors/c/colors.c +++ b/level_2/fll_colors/c/colors.c @@ -1,13 +1,13 @@ /* FLL - Level 2 * Project: Colors - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fll_colors_load_context_ diff --git a/level_2/fll_colors/c/colors.h b/level_2/fll_colors/c/colors.h index b427cd3..fb12457 100644 --- a/level_2/fll_colors/c/colors.h +++ b/level_2/fll_colors/c/colors.h @@ -1,6 +1,6 @@ /* FLL - Level 2 * Project: Colors - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -23,7 +23,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fll_colors_load_context_ diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index 1007970..76c1ca0 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -1,6 +1,6 @@ /* FLL - Level 2 * Project: Execute - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -10,13 +10,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fll_execute_path_ - f_return_status fll_execute_path(const f_string program_path, const f_dynamic_strings arguments, f_s_int *results) { + f_return_status fll_execute_path(f_const f_string program_path, f_const f_dynamic_strings arguments, f_s_int *results) { #ifndef _di_level_2_parameter_checking_ - if (results == f_null) return f_error_set_error(f_invalid_parameter); + if (results == 0) return f_error_set_error(f_invalid_parameter); if (arguments.used < 0) return f_error_set_error(f_invalid_parameter); if (arguments.used > arguments.size) return f_error_set_error(f_invalid_parameter); @@ -32,7 +32,7 @@ extern "C"{ last_slash = strrchr(program_path, '/'); - if (last_slash != f_null) { + if (last_slash != 0) { name_size = strnlen(last_slash, PATH_MAX); if (name_size > 1) { @@ -47,7 +47,7 @@ extern "C"{ } } - status = f_new_array((void **) & arguments_array, sizeof(f_autochar **), arguments.used + 2); + status = f_new_array((f_void_p *) & arguments_array, sizeof(f_autochar **), arguments.used + 2); if (f_error_is_error(status)) { f_status tmp_status = f_none; @@ -77,7 +77,7 @@ extern "C"{ if (process_id < 0) { if (name_size > 0) f_delete_string(status, program_name, name_size); - f_delete((void **) & arguments_array, sizeof(f_autochar), arguments.used + 2); + f_delete((f_void_p *) & arguments_array, sizeof(f_autochar), arguments.used + 2); return f_error_set_error(f_fork_failed); } @@ -93,7 +93,7 @@ extern "C"{ waitpid(process_id, results, 0); if (name_size > 0) f_delete_string(status, program_name, name_size); - f_delete((void **) & arguments_array, sizeof(f_autochar), arguments.used + 2); + f_delete((f_void_p *) & arguments_array, sizeof(f_autochar), arguments.used + 2); if (*results != 0) return f_error_set_error(f_failure); @@ -102,9 +102,9 @@ extern "C"{ #endif // _di_fll_execute_path_ #ifndef _di_fll_execute_program_ - f_return_status fll_execute_program(const f_string program_name, const f_dynamic_strings arguments, f_s_int *results) { + f_return_status fll_execute_program(f_const f_string program_name, f_const f_dynamic_strings arguments, f_s_int *results) { #ifndef _di_level_2_parameter_checking_ - if (results == f_null) return f_error_set_error(f_invalid_parameter); + if (results == 0) return f_error_set_error(f_invalid_parameter); if (arguments.used < 0) return f_error_set_error(f_invalid_parameter); if (arguments.used > arguments.size) return f_error_set_error(f_invalid_parameter); @@ -114,7 +114,7 @@ extern "C"{ f_status status = f_none; f_autochar **arguments_array = 0; - status = f_new_array((void **) & arguments_array, sizeof(f_autochar **), arguments.used + 2); + status = f_new_array((f_void_p *) & arguments_array, sizeof(f_autochar **), arguments.used + 2); if (f_error_is_error(status)) return status; @@ -138,7 +138,7 @@ extern "C"{ process_id = vfork(); if (process_id < 0) { - f_delete((void **) & arguments_array, sizeof(f_autochar), arguments.used + 2); + f_delete((f_void_p *) & arguments_array, sizeof(f_autochar), arguments.used + 2); return f_error_set_error(f_fork_failed); } @@ -153,7 +153,7 @@ extern "C"{ // have the parent wait for the child process to finish waitpid(process_id, results, 0); - f_delete((void **) & arguments_array, sizeof(f_autochar), arguments.used + 2); + f_delete((f_void_p *) & arguments_array, sizeof(f_autochar), arguments.used + 2); if (*results != 0) return f_error_set_error(f_failure); diff --git a/level_2/fll_execute/c/execute.h b/level_2/fll_execute/c/execute.h index 62da020..e7b56e0 100644 --- a/level_2/fll_execute/c/execute.h +++ b/level_2/fll_execute/c/execute.h @@ -1,6 +1,6 @@ /* FLL - Level 2 * Project: Execute - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -27,17 +27,17 @@ // fll-1 includes #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #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(const f_string program_path, const f_dynamic_strings arguments, f_s_int *results); + f_extern f_return_status fll_execute_path(f_const f_string program_path, f_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(const f_string program_name, const f_dynamic_strings arguments, f_s_int *results); + f_extern f_return_status fll_execute_program(f_const f_string program_name, f_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 74b9c69..7fdb2cb 100644 --- a/level_2/fll_fss/c/fss_basic.c +++ b/level_2/fll_fss/c/fss_basic.c @@ -1,21 +1,21 @@ /* FLL - Level 2 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fll_fss_basic_read_ f_return_status fll_fss_basic_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents) { #ifndef _di_level_2_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); - if (objects == f_null) return f_error_set_error(f_invalid_parameter); - if (contents == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); + if (objects == 0) return f_error_set_error(f_invalid_parameter); + if (contents == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ f_status status = f_none; @@ -135,9 +135,9 @@ extern "C"{ #endif // _di_fll_fss_basic_read_ #ifndef _di_fll_fss_basic_write_ - f_return_status fll_fss_basic_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer) { + f_return_status fll_fss_basic_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer) { #ifndef _di_level_2_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); if (contents.used > contents.size) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ @@ -148,7 +148,7 @@ extern "C"{ location.start = 0; location.stop = object.used - 1; - status = fl_fss_basic_object_write(object, &location, buffer); + status = fl_fss_basic_object_write(buffer, object, &location); if (f_macro_test_for_no_data_errors(status)) { return status; @@ -158,7 +158,7 @@ extern "C"{ if (contents.used > 0) { location.start = 0; location.stop = contents.array[0].used - 1; - status = fl_fss_basic_content_write(contents.array[0], &location, buffer); + status = fl_fss_basic_content_write(buffer, contents.array[0], &location); if (f_macro_test_for_no_data_errors(status)) { return status; diff --git a/level_2/fll_fss/c/fss_basic.h b/level_2/fll_fss/c/fss_basic.h index 5935866..f4b3104 100644 --- a/level_2/fll_fss/c/fss_basic.h +++ b/level_2/fll_fss/c/fss_basic.h @@ -1,6 +1,6 @@ /* FLL - Level 2 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -24,7 +24,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fll_fss_basic_read_ @@ -34,7 +34,7 @@ extern "C"{ #ifndef _di_fll_fss_basic_write_ // write an fss-0000 object and then content - f_extern f_return_status fll_fss_basic_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer); + 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); #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 530e947..ee33869 100644 --- a/level_2/fll_fss/c/fss_basic_list.c +++ b/level_2/fll_fss/c/fss_basic_list.c @@ -1,21 +1,21 @@ /* FLL - Level 2 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fll_fss_basic_list_read_ f_return_status fll_fss_basic_list_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents) { #ifndef _di_level_2_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); - if (objects == f_null) return f_error_set_error(f_invalid_parameter); - if (contents == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); + if (objects == 0) return f_error_set_error(f_invalid_parameter); + if (contents == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ f_status status = f_none; @@ -135,9 +135,9 @@ extern "C"{ #endif // _di_fll_fss_basic_list_read_ #ifndef _di_fll_fss_basic_list_write_ - f_return_status fll_fss_basic_list_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer) { + f_return_status fll_fss_basic_list_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer) { #ifndef _di_level_2_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); if (contents.used > contents.size) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ diff --git a/level_2/fll_fss/c/fss_basic_list.h b/level_2/fll_fss/c/fss_basic_list.h index 3d6a811..c9fff08 100644 --- a/level_2/fll_fss/c/fss_basic_list.h +++ b/level_2/fll_fss/c/fss_basic_list.h @@ -1,6 +1,6 @@ /* FLL - Level 2 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -24,7 +24,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fll_fss_basic_list_read_ @@ -34,7 +34,7 @@ extern "C"{ #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(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer); + 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); #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 e20dfcc..1a9f5a3 100644 --- a/level_2/fll_fss/c/fss_errors.c +++ b/level_2/fll_fss/c/fss_errors.c @@ -1,19 +1,19 @@ /* FLL - Level 2 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fll_fss_errors_to_string_ - f_return_status fll_fss_errors_to_string(const f_status error, f_string *string) { + f_return_status fll_fss_errors_to_string(f_const f_status error, f_string *string) { #ifndef _di_level_2_parameter_checking_ - if (string == f_null) return f_error_set_error(f_invalid_parameter); + if (string == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ f_status unmasked_error = f_error_set_fine(error); @@ -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(const f_status error) { + f_return_status fll_fss_errors_is_error(f_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(const f_status error) { + f_return_status fll_fss_errors_is_warning(f_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(const f_status error) { + f_return_status fll_fss_errors_is_fine(f_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 61b02b5..8101b30 100644 --- a/level_2/fll_fss/c/fss_errors.h +++ b/level_2/fll_fss/c/fss_errors.h @@ -1,6 +1,6 @@ /* FLL - Level 2 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -25,31 +25,31 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fll_fss_errors_to_string_ // Convert error codes to their string equivalents. - f_extern f_return_status fll_fss_errors_to_string(const f_status error, f_string *string); + f_extern f_return_status fll_fss_errors_to_string(f_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(const f_status error); + f_extern f_return_status fll_fss_errors_is_error(f_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(const f_status error); + f_extern f_return_status fll_fss_errors_is_warning(f_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(const f_status error); + f_extern f_return_status fll_fss_errors_is_fine(f_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 dc3a969..1bc94ad 100644 --- a/level_2/fll_fss/c/fss_extended.c +++ b/level_2/fll_fss/c/fss_extended.c @@ -1,21 +1,21 @@ /* FLL - Level 2 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fll_fss_extended_read_ f_return_status fll_fss_extended_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents) { #ifndef _di_level_2_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); - if (objects == f_null) return f_error_set_error(f_invalid_parameter); - if (contents == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); + if (objects == 0) return f_error_set_error(f_invalid_parameter); + if (contents == 0) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ f_status status = f_none; @@ -135,9 +135,9 @@ extern "C"{ #endif // _di_fll_fss_extended_read_ #ifndef _di_fll_fss_extended_write_ - f_return_status fll_fss_extended_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer) { + f_return_status fll_fss_extended_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer) { #ifndef _di_level_2_parameter_checking_ - if (buffer == f_null) return f_error_set_error(f_invalid_parameter); + if (buffer == 0) return f_error_set_error(f_invalid_parameter); if (contents.used > contents.size) return f_error_set_error(f_invalid_parameter); #endif // _di_level_2_parameter_checking_ diff --git a/level_2/fll_fss/c/fss_extended.h b/level_2/fll_fss/c/fss_extended.h index a4ed543..2d59c64 100644 --- a/level_2/fll_fss/c/fss_extended.h +++ b/level_2/fll_fss/c/fss_extended.h @@ -1,6 +1,6 @@ /* FLL - Level 2 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -24,7 +24,7 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fll_fss_extended_read_ @@ -34,7 +34,7 @@ extern "C"{ #ifndef _di_fll_fss_extended_write_ // write an fss-0000 object and then content - f_extern f_return_status fll_fss_extended_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer); + 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); #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 af2de59..8bd26e7 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -1,6 +1,6 @@ /* FLL - Level 3 * Project: Firewall - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ @@ -8,12 +8,12 @@ #include "private-firewall.h" #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // 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(const firewall_data data) { + f_return_status firewall_print_version(f_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(const firewall_data data) { + f_return_status firewall_print_help(f_const firewall_data data) { printf("\n"); fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", firewall_name_long); @@ -114,7 +114,7 @@ extern "C"{ #endif // _di_firewall_print_help_ #ifndef _di_firewall_main_ - f_return_status firewall_main(const f_s_int argc, const f_string argv[], firewall_data *data) { + f_return_status firewall_main(f_const f_s_int argc, f_const f_string argv[], firewall_data *data) { f_status status = f_none; f_status status2 = f_none; diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index 08c1360..8d3f3ed 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -1,6 +1,6 @@ /* FLL - Level 3 * Project: Firewall - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -39,13 +39,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_firewall_version_ #define firewall_major_version "0" - #define firewall_minor_version "4" - #define firewall_micro_version "2" + #define firewall_minor_version "5" + #define firewall_micro_version "0" #define firewall_version firewall_major_version "." firewall_minor_version "." firewall_micro_version #endif // _di_firewall_version_ @@ -293,15 +293,15 @@ extern "C"{ #endif // _di_firewall_data_ #ifndef _di_firewall_print_version_ - f_extern f_return_status firewall_print_version(const firewall_data data); + f_extern f_return_status firewall_print_version(f_const firewall_data data); #endif // _di_firewall_print_version_ #ifndef _di_firewall_print_help_ - f_extern f_return_status firewall_print_help(const firewall_data data); + f_extern f_return_status firewall_print_help(f_const firewall_data data); #endif // _di_firewall_print_help_ #ifndef _di_firewall_main_ - f_extern f_return_status firewall_main(const f_s_int argc, const f_string argv[], firewall_data *data); + f_extern f_return_status firewall_main(f_const f_s_int argc, f_const f_string argv[], firewall_data *data); #endif // _di_firewall_main_ #ifndef _di_firewall_delete_data_ diff --git a/level_3/firewall/c/main.c b/level_3/firewall/c/main.c index fbac576..9eb0425 100644 --- a/level_3/firewall/c/main.c +++ b/level_3/firewall/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_s_int argc, const f_string argv[]) { +int main(f_const f_s_int argc, f_const f_string argv[]) { firewall_data data = firewall_data_initialize; return firewall_main(argc, argv, &data); diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 09d7392..67b05c9 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(const firewall_local_data local, const firewall_data data) { + f_return_status firewall_perform_commands(f_const firewall_local_data local, f_const firewall_data data) { f_status status = f_none; f_status status2 = f_none; @@ -327,7 +327,7 @@ arguments.array[arguments.used].size = argument.size; arguments.array[arguments.used].used = argument.used; arguments.used++; - argument.string = f_null; + argument.string = 0; argument.size = 0; argument.used = 0; @@ -370,7 +370,7 @@ arguments.array[arguments.used].size = argument.size; arguments.array[arguments.used].used = argument.used; arguments.used++; - argument.string = f_null; + argument.string = 0; argument.size = 0; argument.used = 0; @@ -425,7 +425,7 @@ arguments.array[arguments.used].size = argument.size; arguments.array[arguments.used].used = argument.used; arguments.used++; - argument.string = f_null; + argument.string = 0; argument.size = 0; argument.used = 0; } @@ -459,7 +459,7 @@ arguments.array[arguments.used].size = argument.size; arguments.array[arguments.used].used = argument.used; arguments.used++; - argument.string = f_null; + argument.string = 0; argument.size = 0; argument.used = 0; } @@ -484,7 +484,7 @@ arguments.array[arguments.used].size = argument.size; arguments.array[arguments.used].used = argument.used; arguments.used++; - argument.string = f_null; + argument.string = 0; argument.size = 0; argument.used = 0; } @@ -506,7 +506,7 @@ arguments.array[arguments.used].size = argument.size; arguments.array[arguments.used].used = argument.used; arguments.used++; - argument.string = f_null; + argument.string = 0; argument.size = 0; argument.used = 0; } @@ -529,7 +529,7 @@ arguments.array[arguments.used].size = argument.size; arguments.array[arguments.used].used = argument.used; arguments.used++; - argument.string = f_null; + argument.string = 0; argument.size = 0; argument.used = 0; } @@ -581,7 +581,7 @@ arguments.array[arguments.used].size = argument.size; arguments.array[arguments.used].used = argument.used; arguments.used++; - argument.string = f_null; + argument.string = 0; argument.size = 0; argument.used = 0; } @@ -972,7 +972,7 @@ } // nullify the static string - static_string.string = f_null; + static_string.string = 0; static_string.used = 0; if (new_chain) { @@ -1129,8 +1129,8 @@ } #endif // _di_firewall_create_custom_chains_ -#ifndef _di_firewall_process_rules_ - f_return_status firewall_buffer_rules(const f_string filename, const f_bool optional, firewall_local_data *local, firewall_data *data) { +#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_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 66b6883..6730a42 100644 --- a/level_3/firewall/c/private-firewall.h +++ b/level_3/firewall/c/private-firewall.h @@ -6,7 +6,7 @@ #define _PRIVATE_firewall_h #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_firewall_local_data_ @@ -77,23 +77,23 @@ extern "C"{ #endif // _di_firewall_macro_private_ #ifndef _di_firewall_perform_commands_ - f_return_status firewall_perform_commands(const firewall_local_data local, const firewall_data data) __attribute__((visibility("internal"))); + f_return_status firewall_perform_commands(f_const firewall_local_data local, f_const firewall_data data) f_gcc_attribute_visibility_internal; #endif // _di_firewall_perform_commands_ #ifndef _di_firewall_create_custom_chains_ - f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved, firewall_local_data *local, firewall_data *data) __attribute__((visibility("internal"))); + f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved, firewall_local_data *local, firewall_data *data) f_gcc_attribute_visibility_internal; #endif // _di_firewall_create_custom_chains_ #ifndef _di_firewall_buffer_rules_ - f_return_status firewall_buffer_rules(const f_string filename, const f_bool optional, firewall_local_data *local, firewall_data *data) __attribute__((visibility("internal"))); + 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; #endif // _di_firewall_buffer_rules_ #ifndef _di_firewall_process_rules_ - f_return_status firewall_process_rules(f_string_location *input, firewall_local_data *local, firewall_data *data) __attribute__((visibility("internal"))); + f_return_status firewall_process_rules(f_string_location *input, firewall_local_data *local, firewall_data *data) f_gcc_attribute_visibility_internal; #endif // _di_firewall_process_rules_ #ifndef _di_firewall_delete_local_data_ - f_return_status firewall_delete_local_data(firewall_local_data *local) __attribute__((visibility("internal"))); + f_return_status firewall_delete_local_data(firewall_local_data *local) f_gcc_attribute_visibility_internal; #endif // _di_firewall_delete_local_data_ #ifdef __cplusplus diff --git a/level_3/firewall/data/settings/firewall-first b/level_3/firewall/data/settings/firewall-first index f655c3b..aebb240 100644 --- a/level_3/firewall/data/settings/firewall-first +++ b/level_3/firewall/data/settings/firewall-first @@ -1,174 +1,4 @@ # fss-0002 main: - # initialize the firewall - direction none - action none - - rule -F - rule -Z - - tool iptables - rule -t nat -F - rule -t mangle -F - tool ip46tables - - # setup initial operations - chain INPUT - direction input - action append - - # Enable ALL local connections (loopback) - device lo - chain OUTPUT - direction output - rule -j ACCEPT - - chain INPUT - direction input - rule -j ACCEPT - device all - - - # Drop all INVALID packets so they aren't even processed - chain OUTPUT - rule -m state --state INVALID -j DROP - - chain INPUT - rule -m state --state INVALID -j DROP - - - # Drop multicasts and broadcasts, they should not exist for a router and in most cases should be avoided. - # unicasts are the normal behavior and blocking them would be very unusual. - chain OUTPUT - rule -m pkttype --pkt-type broadcast -j output-casting - rule -m pkttype --pkt-type multicast -j output-casting - #rule -m pkttype --pkt-type unicast -j output-casting - chain INPUT - rule -m pkttype --pkt-type broadcast -j input-casting - rule -m pkttype --pkt-type multicast -j input-casting - #rule -m pkttype --pkt-type unicast -j input-casting - - - # Allow ALL input&output connections that have already been established by this host (using conntrack might be more efficient) - chain OUTPUT - rule -m state --state ESTABLISHED,RELATED -j ACCEPT - #rule -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT - - chain INPUT - rule -m state --state ESTABLISHED,RELATED -j ACCEPT - #rule -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT - - - # send all tcp packets to the tcp queue - chain OUTPUT - protocol tcp - rule -m state --state NEW -j output-tcp - - chain INPUT - rule -m state --state NEW -j input-tcp - - - # send all udp packets to the udp queue - chain OUTPUT - protocol udp - rule -m state --state NEW -j output-udp - - chain INPUT - rule -m state --state NEW -j input-udp - - - # send all ipv4 icmp packets to the icmp queue - tool iptables - chain OUTPUT - protocol icmp - rule -m state --state NEW -j output-icmp - - chain INPUT - rule -m state --state NEW -j input-icmp - - # send all ipv6 icmp packets to the icmp queue (alternatively put this in its own chain, such as input-icmpv6 and output-icmpv6) - tool ip6tables - chain OUTPUT - protocol icmpv6 - rule -m state --state NEW -j output-icmp - - chain INPUT - rule -m state --state NEW -j input-icmp - - -input-tcp: - direction input - protocol tcp - - # Prevent an XMAS attack - rule --tcp-flags ALL ALL -j DROP - - # Prevent NULL attack - rule --tcp-flags ALL NONE -j DROP - - -input-udp: - direction input - protocol udp - - # Allow dhcp client renewals (from server to client). If these are blocked, you will not be able to renew easily - tool iptables - rule -s 0.0.0.0 --sport 67 -d 255.255.255.255 --dport 68 -j ACCEPT - tool ip46tables - - -input-icmp: - direction input - protocol icmp - - -output-tcp: - direction output - protocol tcp - - -output-udp: - direction output - protocol udp - - -output-icmp: - direction output - protocol icmp - - -input-casting: - # pre-process broadcasts and multicasts. - direction input - protocol none - tool ip46tables - - # do not auto-drop dhcp messages sent from a dhcp server to a local dhcp client. - # dhcp offer/acknowledge (the source address must be the routers address, so do not allow 0.0.0.0/0) - protocol udp - tool iptables - rule --sport 67 -d 255.255.255.255 --dport 68 -j RETURN - protocol none - tool ip46tables - - # drop all remaining broadcasts and multicasts - rule -j DROP - - -output-casting: - # pre-process broadcasts and multicasts. - direction output - protocol none - tool ip46tables - - # do not auto-drop dhcp client messages sent to a dhcp server. - # dhcp discover/request (for the request, the dhcp server ip address is known but for some reason the dhcp standard states tat the src is 0.0.0.0. - protocol udp - tool iptables - rule --sport 68 -d 255.255.255.255 --dport 67 -j RETURN - protocol none - tool ip46tables - - # drop all remaining broadcasts and multicasts - rule -j DROP + rule tty 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 7130a5e..1bb9ba7 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 @@ -1,18 +1,18 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // 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(const fss_basic_list_read_data data) { + f_return_status fss_basic_list_read_print_version(f_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(const fss_basic_list_read_data data) { + f_return_status fss_basic_list_read_print_help(f_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(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_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(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data) { + 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_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(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_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_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 a7df4c9..be94024 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 @@ -1,6 +1,6 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -38,13 +38,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fss_basic_list_read_version_ #define fss_basic_list_read_major_version "0" - #define fss_basic_list_read_minor_version "4" - #define fss_basic_list_read_micro_version "2" + #define fss_basic_list_read_minor_version "5" + #define fss_basic_list_read_micro_version "0" #define fss_basic_list_read_version fss_basic_list_read_major_version "." fss_basic_list_read_minor_version "." fss_basic_list_read_micro_version #endif // _di_fss_basic_list_read_version_ @@ -127,15 +127,15 @@ 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(const fss_basic_list_read_data data); + f_extern f_return_status fss_basic_list_read_print_version(f_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(const fss_basic_list_read_data data); + f_extern f_return_status fss_basic_list_read_print_help(f_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(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data); + 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); #endif // _di_fss_basic_list_read_main_ #ifndef _di_fss_basic_list_read_delete_data_ diff --git a/level_3/fss_basic_list_read/c/main.c b/level_3/fss_basic_list_read/c/main.c index 0339ab0..0cd7ee3 100644 --- a/level_3/fss_basic_list_read/c/main.c +++ b/level_3/fss_basic_list_read/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_array_length argc, const f_string argv[]) { +int main(f_const f_array_length argc, f_const f_string argv[]) { fss_basic_list_read_data data = fss_basic_list_read_data_initialize; if (f_pipe_exists()) { 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 070ed29..70fe441 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 @@ -1,18 +1,18 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // 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(const fss_basic_list_write_data data) { + f_return_status fss_basic_list_write_print_version(f_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(const fss_basic_list_write_data data) { + f_return_status fss_basic_list_write_print_help(f_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(const f_array_length argc, const f_string argv[], fss_basic_list_write_data *data) { + 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_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 517e744..b8428d8 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 @@ -1,6 +1,6 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -32,13 +32,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fss_basic_list_write_version_ #define fss_basic_list_write_major_version "0" - #define fss_basic_list_write_minor_version "4" - #define fss_basic_list_write_micro_version "2" + #define fss_basic_list_write_minor_version "5" + #define fss_basic_list_write_micro_version "0" #define fss_basic_list_write_version fss_basic_list_write_major_version "." fss_basic_list_write_minor_version "." fss_basic_list_write_micro_version #endif // _di_fss_basic_list_write_version_ @@ -101,15 +101,15 @@ 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(const fss_basic_list_write_data data); + f_extern f_return_status fss_basic_list_write_print_version(f_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(const fss_basic_list_write_data data); + f_extern f_return_status fss_basic_list_write_print_help(f_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(const f_array_length argc, const f_string argv[], fss_basic_list_write_data *data); + 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); #endif // _di_fss_basic_list_write_main_ #ifndef _di_fss_basic_list_write_delete_data_ diff --git a/level_3/fss_basic_list_write/c/main.c b/level_3/fss_basic_list_write/c/main.c index e83c8e4..feaa3e9 100644 --- a/level_3/fss_basic_list_write/c/main.c +++ b/level_3/fss_basic_list_write/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_array_length argc, const f_string argv[]) { +int main(f_const f_array_length argc, f_const f_string argv[]) { fss_basic_list_write_data data = fss_basic_list_write_data_initialize; if (f_pipe_exists()) { 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 15e0298..edbae93 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -1,18 +1,18 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // 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(const fss_basic_read_data data) { + f_return_status fss_basic_read_print_version(f_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(const fss_basic_read_data data) { + f_return_status fss_basic_read_print_help(f_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(const f_array_length argc, const f_string argv[], fss_basic_read_data *data, const f_string filename, const f_string_length target) __attribute__((visibility("internal"))); + 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(const f_array_length argc, const f_string argv[], fss_basic_read_data *data) { + f_return_status fss_basic_read_main(f_const f_array_length argc, f_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(const f_array_length argc, const f_string argv[], fss_basic_read_data *data, const f_string filename, const f_string_length target) { + 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_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 d42ea1e..0b0c2c9 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -1,6 +1,6 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -38,13 +38,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fss_basic_read_version_ #define fss_basic_read_major_version "0" - #define fss_basic_read_minor_version "4" - #define fss_basic_read_micro_version "2" + #define fss_basic_read_minor_version "5" + #define fss_basic_read_micro_version "0" #define fss_basic_read_version fss_basic_read_major_version "." fss_basic_read_minor_version "." fss_basic_read_micro_version #endif // _di_fss_basic_read_version_ @@ -119,15 +119,15 @@ 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(const fss_basic_read_data data); + f_extern f_return_status fss_basic_read_print_version(f_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(const fss_basic_read_data data); + f_extern f_return_status fss_basic_read_print_help(f_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(const f_array_length argc, const f_string argv[], fss_basic_read_data *data); + 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); #endif // _di_fss_basic_read_main_ #ifndef _di_fss_basic_read_delete_data_ diff --git a/level_3/fss_basic_read/c/main.c b/level_3/fss_basic_read/c/main.c index a7df3e9..1c27146 100644 --- a/level_3/fss_basic_read/c/main.c +++ b/level_3/fss_basic_read/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_array_length argc, const f_string argv[]) { +int main(f_const f_array_length argc, f_const f_string argv[]) { fss_basic_read_data data = fss_basic_read_data_initialize; if (f_pipe_exists()) { 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 1d3c49d..3678523 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -1,18 +1,18 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // 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(const fss_basic_write_data data) { + f_return_status fss_basic_write_print_version(f_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(const fss_basic_write_data data) { + f_return_status fss_basic_write_print_help(f_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(const f_array_length argc, const f_string argv[], fss_basic_write_data *data) { + f_return_status fss_basic_write_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_write_data *data) { f_status status = f_none; f_status status2 = f_none; @@ -186,13 +186,13 @@ extern "C"{ location.stop = input.used - 1; if (object) { - status = fl_fss_basic_object_write(input, &location, &buffer); + status = fl_fss_basic_object_write(&buffer, input, &location); if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) { return f_error_set_error(status); } } else { - status = fl_fss_basic_content_write(input, &location, &buffer); + status = fl_fss_basic_content_write(&buffer, input, &location); if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) { return f_error_set_error(status); @@ -210,13 +210,13 @@ extern "C"{ location.stop = input.used - 1; if (object) { - status = fl_fss_basic_object_write(input, &location, &buffer); + status = fl_fss_basic_object_write(&buffer, input, &location); if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) { return f_error_set_error(status); } } else { - status = fl_fss_basic_content_write(input, &location, &buffer); + status = fl_fss_basic_content_write(&buffer, input, &location); if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) { return f_error_set_error(status); 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 43f0942..35bb5b6 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.h +++ b/level_3/fss_basic_write/c/fss_basic_write.h @@ -1,6 +1,6 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -32,13 +32,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fss_basic_write_version_ #define fss_basic_write_major_version "0" - #define fss_basic_write_minor_version "4" - #define fss_basic_write_micro_version "2" + #define fss_basic_write_minor_version "5" + #define fss_basic_write_micro_version "0" #define fss_basic_write_version fss_basic_write_major_version "." fss_basic_write_minor_version "." fss_basic_write_micro_version #endif // _di_fss_basic_write_version_ @@ -101,15 +101,15 @@ 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(const fss_basic_write_data data); + f_extern f_return_status fss_basic_write_print_version(f_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(const fss_basic_write_data data); + f_extern f_return_status fss_basic_write_print_help(f_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(const f_array_length argc, const f_string argv[], fss_basic_write_data *data); + 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); #endif // _di_fss_basic_write_main_ #ifndef _di_fss_basic_write_delete_data_ diff --git a/level_3/fss_basic_write/c/main.c b/level_3/fss_basic_write/c/main.c index 842b604..af17f39 100644 --- a/level_3/fss_basic_write/c/main.c +++ b/level_3/fss_basic_write/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_array_length argc, const f_string argv[]) { +int main(f_const f_array_length argc, f_const f_string argv[]) { fss_basic_write_data data = fss_basic_write_data_initialize; if (f_pipe_exists()) { 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 3da2493..829d538 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -1,18 +1,18 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // 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(const fss_extended_read_data data) { + f_return_status fss_extended_read_print_version(f_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(const fss_extended_read_data data) { + f_return_status fss_extended_read_print_help(f_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(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) __attribute__((visibility("internal"))); + 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(const f_array_length argc, const f_string argv[], fss_extended_read_data *data) { + f_return_status fss_extended_read_main(f_const f_array_length argc, f_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(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_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_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 0e3fbf4..d143cbc 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -1,6 +1,6 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -38,13 +38,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fss_extended_read_version_ #define fss_extended_read_major_version "0" - #define fss_extended_read_minor_version "4" - #define fss_extended_read_micro_version "2" + #define fss_extended_read_minor_version "5" + #define fss_extended_read_micro_version "0" #define fss_extended_read_version fss_extended_read_major_version "." fss_extended_read_minor_version "." fss_extended_read_micro_version #endif // _di_fss_extended_read_version_ @@ -123,15 +123,15 @@ 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(const fss_extended_read_data data); + f_extern f_return_status fss_extended_read_print_version(f_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(const fss_extended_read_data data); + f_extern f_return_status fss_extended_read_print_help(f_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(const f_array_length argc, const f_string argv[], fss_extended_read_data *data); + 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); #endif // _di_fss_extended_read_main_ #ifndef _di_fss_extended_read_delete_data_ diff --git a/level_3/fss_extended_read/c/main.c b/level_3/fss_extended_read/c/main.c index 0d69a85..b79163a 100644 --- a/level_3/fss_extended_read/c/main.c +++ b/level_3/fss_extended_read/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_array_length argc, const f_string argv[]) { +int main(f_const f_array_length argc, f_const f_string argv[]) { fss_extended_read_data data = fss_extended_read_data_initialize; if (f_pipe_exists()) { 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 85cf2e5..34f2aed 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -1,18 +1,18 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // 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(const fss_extended_write_data data) { + f_return_status fss_extended_write_print_version(f_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(const fss_extended_write_data data) { + f_return_status fss_extended_write_print_help(f_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(const f_array_length argc, const f_string argv[], fss_extended_write_data *data) { + f_return_status fss_extended_write_main(f_const f_array_length argc, f_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 f8441ba..2f445bd 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.h +++ b/level_3/fss_extended_write/c/fss_extended_write.h @@ -1,6 +1,6 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -32,13 +32,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fss_extended_write_version_ #define fss_extended_write_major_version "0" - #define fss_extended_write_minor_version "4" - #define fss_extended_write_micro_version "2" + #define fss_extended_write_minor_version "5" + #define fss_extended_write_micro_version "0" #define fss_extended_write_version fss_extended_write_major_version "." fss_extended_write_minor_version "." fss_extended_write_micro_version #endif // _di_fss_extended_write_version_ @@ -105,15 +105,15 @@ 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(const fss_extended_write_data data); + f_extern f_return_status fss_extended_write_print_version(f_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(const fss_extended_write_data data); + f_extern f_return_status fss_extended_write_print_help(f_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(const f_array_length argc, const f_string argv[], fss_extended_write_data *data); + 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); #endif // _di_fss_extended_write_main_ #ifndef _di_fss_extended_write_delete_data_ diff --git a/level_3/fss_extended_write/c/main.c b/level_3/fss_extended_write/c/main.c index d929719..ceacde7 100644 --- a/level_3/fss_extended_write/c/main.c +++ b/level_3/fss_extended_write/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_array_length argc, const f_string argv[]) { +int main(f_const f_array_length argc, f_const f_string argv[]) { fss_extended_write_data data = fss_extended_write_data_initialize; if (f_pipe_exists()) { 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 2fa198b..f3d4994 100644 --- a/level_3/fss_return_code/c/fss_return_code.c +++ b/level_3/fss_return_code/c/fss_return_code.c @@ -1,18 +1,18 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // 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(const fss_return_code_data data) { + f_return_status fss_return_code_print_version(f_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(const fss_return_code_data data) { + f_return_status fss_return_code_print_help(f_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(const f_array_length argc, const f_string argv[], fss_return_code_data *data) { + f_return_status fss_return_code_main(f_const f_array_length argc, f_const f_string argv[], fss_return_code_data *data) { f_status status = f_none; f_status allocation_status = f_none; @@ -239,7 +239,7 @@ extern "C"{ if (data->remaining.used > 0) { for (; counter < data->remaining.used; counter++) { f_status code = (f_status) atoll(argv[data->remaining.array[counter]]); - f_string string = f_null; + f_string string = 0; if (fll_fss_errors_to_string(code, &string) == f_none) { printf("%s\n", string); 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 6257098..9dd0abf 100644 --- a/level_3/fss_return_code/c/fss_return_code.h +++ b/level_3/fss_return_code/c/fss_return_code.h @@ -1,6 +1,6 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -32,13 +32,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_fss_return_code_version_ #define fss_return_code_major_version "0" - #define fss_return_code_minor_version "4" - #define fss_return_code_micro_version "2" + #define fss_return_code_minor_version "5" + #define fss_return_code_micro_version "0" #define fss_return_code_version fss_return_code_major_version "." fss_return_code_minor_version "." fss_return_code_micro_version #endif // _di_fss_return_code_version_ @@ -105,15 +105,15 @@ 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(const fss_return_code_data data); + f_extern f_return_status fss_return_code_print_version(f_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(const fss_return_code_data data); + f_extern f_return_status fss_return_code_print_help(f_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(const f_array_length argc, const f_string argv[], fss_return_code_data *data); + 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); #endif // _di_fss_return_code_main_ #ifndef _di_fss_return_code_delete_data_ diff --git a/level_3/fss_return_code/c/main.c b/level_3/fss_return_code/c/main.c index 266212f..fe72b7d 100644 --- a/level_3/fss_return_code/c/main.c +++ b/level_3/fss_return_code/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_array_length argc, const f_string argv[]) { +int main(f_const f_array_length argc, f_const f_string argv[]) { fss_return_code_data data = fss_return_code_data_initialize; if (f_pipe_exists()) { diff --git a/level_3/return_code/c/main.c b/level_3/return_code/c/main.c index 2476a69..facd261 100644 --- a/level_3/return_code/c/main.c +++ b/level_3/return_code/c/main.c @@ -1,6 +1,6 @@ #include -int main(const f_array_length argc, const f_string argv[]) { +int main(f_const f_array_length argc, f_const f_string argv[]) { return_code_data data = return_code_data_initialize; if (f_pipe_exists()) { diff --git a/level_3/return_code/c/return_code.c b/level_3/return_code/c/return_code.c index 2f266ba..62d2b0b 100644 --- a/level_3/return_code/c/return_code.c +++ b/level_3/return_code/c/return_code.c @@ -1,18 +1,18 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day */ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif // 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(const return_code_data data) { + f_return_status return_code_print_version(f_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(const return_code_data data) { + f_return_status return_code_print_help(f_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(const f_array_length argc, const f_string argv[], return_code_data *data) { + f_return_status return_code_main(f_const f_array_length argc, f_const f_string argv[], return_code_data *data) { f_status status = f_none; f_status allocation_status = f_none; @@ -239,7 +239,7 @@ extern "C"{ if (data->remaining.used > 0) { for (; counter < data->remaining.used; counter++) { f_status code = (f_status) atoll(argv[data->remaining.array[counter]]); - f_string string = f_null; + f_string string = 0; if (fl_errors_to_string(code, &string) == f_none) { printf("%s\n", string); diff --git a/level_3/return_code/c/return_code.h b/level_3/return_code/c/return_code.h index 3f708ca..d3571cb 100644 --- a/level_3/return_code/c/return_code.h +++ b/level_3/return_code/c/return_code.h @@ -1,6 +1,6 @@ /* FLL - Level 3 * Project: FSS - * Version: 0.4.2 + * Version: 0.5.0 * Licenses: lgplv2.1 * Programmers: Kevin Day * Documentation: @@ -31,13 +31,13 @@ #include #ifdef __cplusplus -extern "C"{ +extern "C" { #endif #ifndef _di_return_code_version_ #define return_code_major_version "0" - #define return_code_minor_version "4" - #define return_code_micro_version "2" + #define return_code_minor_version "5" + #define return_code_micro_version "0" #define return_code_version return_code_major_version "." return_code_minor_version "." return_code_micro_version #endif // _di_return_code_version_ @@ -104,15 +104,15 @@ extern "C"{ #endif // _di_return_code_data_ #ifndef _di_return_code_print_version_ - f_extern f_return_status return_code_print_version(const return_code_data data); + f_extern f_return_status return_code_print_version(f_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(const return_code_data data); + f_extern f_return_status return_code_print_help(f_const return_code_data data); #endif // _di_return_code_print_help_ #ifndef _di_return_code_main_ - f_extern f_return_status return_code_main(const f_array_length argc, const f_string argv[], return_code_data *data); + f_extern f_return_status return_code_main(f_const f_array_length argc, f_const f_string argv[], return_code_data *data); #endif // _di_return_code_main_ #ifndef _di_return_code_delete_data_