From 312ed47664dbe56a2b761e80713fc2458a4f5728 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 9 Dec 2020 22:09:41 -0600 Subject: [PATCH] Update: Add missing header and add/update static variables relating to strings. The string.h header is not being directly included by f_color and should be. Also add the missing dependency. This adds a small amount of static variables. There is more work to do in this regard, such as with f_file related strings. Replace fll_error_string_null_s with f_color_set_string_null_s. Utilize f_string_empty_s in place of "". This skips making changes in controller. The appropriate changes will be made in the appropriate work in Progress commit. --- level_0/f_color/c/color.h | 8 ++++ level_0/f_color/data/build/dependencies | 1 + level_0/f_file/c/file-common.h | 3 ++ level_0/f_string/c/string.h | 12 +++++ level_2/fll_error/c/error-common.h | 7 --- level_2/fll_error/c/error.c | 54 +++++++++++----------- level_2/fll_error/c/private-error.c | 16 +++---- level_3/control/c/control.c | 37 +++++++++++---- level_3/fake/c/private-build.c | 2 +- level_3/fake/c/private-fake.c | 2 +- level_3/fake/c/private-make.c | 2 +- .../fss_basic_list_write/c/fss_basic_list_write.c | 2 +- level_3/fss_basic_write/c/fss_basic_write.c | 2 +- .../c/fss_embedded_list_write.c | 2 +- .../c/fss_extended_list_write.c | 2 +- level_3/fss_extended_write/c/fss_extended_write.c | 2 +- level_3/iki_write/c/iki_write.c | 2 +- level_3/init/c/init.c | 2 +- 18 files changed, 96 insertions(+), 62 deletions(-) diff --git a/level_0/f_color/c/color.h b/level_0/f_color/c/color.h index 3fec240..eda04bf 100644 --- a/level_0/f_color/c/color.h +++ b/level_0/f_color/c/color.h @@ -13,6 +13,7 @@ // fll-0 includes #include +#include #ifdef __cplusplus extern "C" { @@ -271,6 +272,13 @@ extern "C" { #endif // _di_f_color_set_t_ /** + * Set the context and notable to this to safely allow for fprintf uses when there is no color to be used. + */ +#ifndef _di_f_color_set_string_null_s_ + const static f_string_static_t f_color_set_string_null_s = f_macro_string_static_t_initialize(f_string_empty_s, 0); +#endif // _di_f_color_set_string_null_s_ + +/** * Provide a set of color contexts. * * This is intended to be used for printing, such that the printed code is prefixed with the "before" and postfixed with the "after", for each context. diff --git a/level_0/f_color/data/build/dependencies b/level_0/f_color/data/build/dependencies index 1e9ec2a..b4d4980 100644 --- a/level_0/f_color/data/build/dependencies +++ b/level_0/f_color/data/build/dependencies @@ -1,3 +1,4 @@ # fss-0000 f_type +f_string diff --git a/level_0/f_file/c/file-common.h b/level_0/f_file/c/file-common.h index 47bcb1c..4aece7b 100644 --- a/level_0/f_file/c/file-common.h +++ b/level_0/f_file/c/file-common.h @@ -91,6 +91,9 @@ extern "C" { #define f_macro_file_open_mode_read_truncate "w+" #define f_macro_file_open_mode_read_write "r+" #define f_macro_file_open_mode_truncate "w" + + // @todo consider adding the following for the different strings in this project. + //static char * const f_file_open_mode_append_s = f_macro_file_open_mode_append; #endif // _di_f_file_type_ /** diff --git a/level_0/f_string/c/string.h b/level_0/f_string/c/string.h index 535294c..eb5a4a2 100644 --- a/level_0/f_string/c/string.h +++ b/level_0/f_string/c/string.h @@ -32,6 +32,18 @@ extern "C" { #endif +#ifndef _di_f_string_has_empty_ + const static f_string_t f_string_empty_s = ""; +#endif // _di_f_string_has_empty_ + +#ifndef _di_f_string_has_eol_ + const static f_string_t f_string_eol_s = f_string_eol; +#endif // _di_f_string_has_eol_ + +#ifndef _di_f_string_has_placeholder_ + const static f_string_t f_string_placeholder_s = f_string_placeholder; +#endif // _di_f_string_has_placeholder_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_2/fll_error/c/error-common.h b/level_2/fll_error/c/error-common.h index b39544e..b5d8e0c 100644 --- a/level_2/fll_error/c/error-common.h +++ b/level_2/fll_error/c/error-common.h @@ -76,13 +76,6 @@ extern "C" { #define fll_macro_error_print_t_initialize_warning() fll_macro_error_print_t_initialize(f_macro_file_t_initialize(f_type_warning, f_type_descriptor_warning, f_file_flag_write_only), f_console_verbosity_normal, fll_error_print_warning, f_color_set_t_initialize, f_color_set_t_initialize) #endif // _di_fll_error_print_t_ -/** - * Set the context and notable to this to safely allow for fprintf uses when there is no color to be used. - */ -#ifndef _di_fll_error_string_null_s_ - const static f_string_static_t fll_error_string_null_s = f_macro_string_static_t_initialize("", 0); -#endif // _di_fll_error_string_null_s_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_2/fll_error/c/error.c b/level_2/fll_error/c/error.c index 6dcf4c9..3baa775 100644 --- a/level_2/fll_error/c/error.c +++ b/level_2/fll_error/c/error.c @@ -25,7 +25,7 @@ extern "C" { if (status == F_access_denied) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sAccess denied while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name); + fprintf(error.to.stream, "%s%sAccess denied while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -36,7 +36,7 @@ extern "C" { if (status == F_access_group) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sCurrrent user is not allowed to use the given group while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name); + fprintf(error.to.stream, "%s%sCurrrent user is not allowed to use the given group while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -47,7 +47,7 @@ extern "C" { if (status == F_access_owner) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sCurrrent user is not allowed to use the given owner while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name); + fprintf(error.to.stream, "%s%sCurrrent user is not allowed to use the given owner while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -58,7 +58,7 @@ extern "C" { if (status == F_directory) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid directory while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name); + fprintf(error.to.stream, "%s%sInvalid directory while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -69,7 +69,7 @@ extern "C" { if (status == F_directory_empty_not) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name); + fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s' is not empty.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -80,7 +80,7 @@ extern "C" { if (status == F_file_closed) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name); + fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s' is not open.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -91,7 +91,7 @@ extern "C" { if (status == F_file_found) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name); + fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s' already exists.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -102,7 +102,7 @@ extern "C" { if (status == F_file_found_not) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sFailed to find %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name); + fprintf(error.to.stream, "%s%sFailed to find %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -111,7 +111,7 @@ extern "C" { } if (status == F_file_open) { - fprintf(error.to.stream, "%s%sUnable to open the %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name); + fprintf(error.to.stream, "%s%sUnable to open the %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); @@ -119,7 +119,7 @@ extern "C" { } if (status == F_file_descriptor) { - fprintf(error.to.stream, "%s%sFile descriptor error while trying to open the %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name); + fprintf(error.to.stream, "%s%sFile descriptor error while trying to open the %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%c", f_string_eol[0]); @@ -127,7 +127,7 @@ extern "C" { } if (status == F_number_underflow) { - fprintf(error.to.stream, "%s%sInteger underflow while trying to buffer the %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name); + fprintf(error.to.stream, "%s%sInteger underflow while trying to buffer the %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); @@ -137,7 +137,7 @@ extern "C" { if (status == F_file_read) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sA read error occurred while accessing the %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name); + fprintf(error.to.stream, "%s%sA read error occurred while accessing the %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -148,7 +148,7 @@ extern "C" { if (status == F_file_seek) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sA seek error occurred while accessing the %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name); + fprintf(error.to.stream, "%s%sA seek error occurred while accessing the %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -159,7 +159,7 @@ extern "C" { if (status == F_loop) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sLoop while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name); + fprintf(error.to.stream, "%s%sLoop while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -170,7 +170,7 @@ extern "C" { if (status == F_name) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid %s name '", error.context.before->string, error.prefix ? error.prefix : "", type_name); + fprintf(error.to.stream, "%s%sInvalid %s name '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -181,7 +181,7 @@ extern "C" { if (status == F_number_overflow) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sOverflow while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name); + fprintf(error.to.stream, "%s%sOverflow while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -192,7 +192,7 @@ extern "C" { if (status == F_parameter) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid parameter", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sInvalid parameter", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); private_fll_error_print_function(error, function); @@ -207,7 +207,7 @@ extern "C" { if (status == F_prohibited) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sProhibited by system while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name); + fprintf(error.to.stream, "%s%sProhibited by system while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -219,7 +219,7 @@ extern "C" { if (status == F_file_type_not_directory) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid or missing directory in path while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name); + fprintf(error.to.stream, "%s%sInvalid or missing directory in path while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -232,7 +232,7 @@ extern "C" { if (status == F_directory_found_not) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sFailed to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name); + fprintf(error.to.stream, "%s%sFailed to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s' due to an invalid directory in the path.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -244,7 +244,7 @@ extern "C" { if (status == F_failure) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sFailed to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name); + fprintf(error.to.stream, "%s%sFailed to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -264,7 +264,7 @@ extern "C" { if (status == F_data_not) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument for the parameter '", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sThe argument for the parameter '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); fprintf(error.to.stream, "%s' must not be an empty string.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); } @@ -275,7 +275,7 @@ extern "C" { if (status == F_number) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string); fprintf(error.to.stream, "%s' is not a valid number for the parameter '", error.context.before->string); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); @@ -288,7 +288,7 @@ extern "C" { if (status == F_number_negative) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string); fprintf(error.to.stream, "%s' is negative, which is not allowed for the parameter '", error.context.before->string); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); @@ -301,7 +301,7 @@ extern "C" { if (status == F_number_overflow) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string); fprintf(error.to.stream, "%s' is too large for the parameter '", error.context.before->string); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); @@ -314,7 +314,7 @@ extern "C" { if (status == F_number_positive) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string); fprintf(error.to.stream, "%s' is positive, which is not allowed for the parameter '", error.context.before->string); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); @@ -327,7 +327,7 @@ extern "C" { if (status == F_number_underflow) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string); fprintf(error.to.stream, "%s' is too small for the parameter '", error.context.before->string); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); diff --git a/level_2/fll_error/c/private-error.c b/level_2/fll_error/c/private-error.c index 35a24c4..84700d1 100644 --- a/level_2/fll_error/c/private-error.c +++ b/level_2/fll_error/c/private-error.c @@ -11,7 +11,7 @@ extern "C" { if (status == F_array_too_large) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sMaximum array length reached while processing ", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sMaximum array length reached while processing ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); private_fll_error_print_function(error, function); @@ -24,7 +24,7 @@ extern "C" { if (status == F_buffer_too_large) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sMaximum buffer length reached while processing ", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sMaximum buffer length reached while processing ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); private_fll_error_print_function(error, function); @@ -37,7 +37,7 @@ extern "C" { if (status == F_memory_allocation || status == F_memory_reallocation || status == F_memory_not) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sUnable to allocate memory in function ", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sUnable to allocate memory in function ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); private_fll_error_print_function(error, function); @@ -50,7 +50,7 @@ extern "C" { if (status == F_parameter) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid parameter", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sInvalid parameter", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); private_fll_error_print_function(error, function); @@ -63,7 +63,7 @@ extern "C" { if (status == F_string_too_large) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sMaximum string length reached while processing ", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sMaximum string length reached while processing ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); private_fll_error_print_function(error, function); @@ -76,7 +76,7 @@ extern "C" { if (status == F_utf) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid UTF-8 character while calling ", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sInvalid UTF-8 character while calling ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); private_fll_error_print_function(error, function); @@ -89,7 +89,7 @@ extern "C" { if (status == F_complete_not_utf) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid (incomplete) UTF-8 character while calling ", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%sInvalid (incomplete) UTF-8 character while calling ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); private_fll_error_print_function(error, function); @@ -102,7 +102,7 @@ extern "C" { if (fallback && error.verbosity != f_console_verbosity_quiet) { if (error.verbosity != f_console_verbosity_quiet) { fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%s(", error.context.before->string, error.prefix ? error.prefix : ""); + fprintf(error.to.stream, "%s%s(", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); fprintf(error.to.stream, "%s%s%llu%s", error.context.after->string, error.notable.before->string, status, error.notable.after->string); fprintf(error.to.stream, "%s)", error.context.before->string); diff --git a/level_3/control/c/control.c b/level_3/control/c/control.c index ee12ecf..0048352 100644 --- a/level_3/control/c/control.c +++ b/level_3/control/c/control.c @@ -20,7 +20,7 @@ extern "C" { fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - fll_program_print_help_usage(output, context, control_name, ""); + fll_program_print_help_usage(output, context, control_name, f_string_empty_s); return F_none; } @@ -47,15 +47,32 @@ extern "C" { data->warning.notable = data->context.set.notable; } else { - data->error.context.before = &fll_error_string_null_s; - data->error.context.after = &fll_error_string_null_s; - data->error.notable.before = &fll_error_string_null_s; - data->error.notable.after = &fll_error_string_null_s; - - data->warning.context.before = &fll_error_string_null_s; - data->warning.context.after = &fll_error_string_null_s; - data->warning.notable.before = &fll_error_string_null_s; - data->warning.notable.after = &fll_error_string_null_s; + data->context.set.warning.before = &f_color_set_string_null_s; + data->context.set.warning.after = &f_color_set_string_null_s; + data->context.set.error.before = &f_color_set_string_null_s; + data->context.set.error.after = &f_color_set_string_null_s; + data->context.set.title.before = &f_color_set_string_null_s; + data->context.set.title.after = &f_color_set_string_null_s; + data->context.set.notable.before = &f_color_set_string_null_s; + data->context.set.notable.after = &f_color_set_string_null_s; + data->context.set.important.before = &f_color_set_string_null_s; + data->context.set.important.after = &f_color_set_string_null_s; + data->context.set.standout.before = &f_color_set_string_null_s; + data->context.set.standout.after = &f_color_set_string_null_s; + data->context.set.normal.before = &f_color_set_string_null_s; + data->context.set.normal.after = &f_color_set_string_null_s; + data->context.set.normal_reset.before = &f_color_set_string_null_s; + data->context.set.normal_reset.after = &f_color_set_string_null_s; + + data->error.context.before = &f_color_set_string_null_s; + data->error.context.after = &f_color_set_string_null_s; + data->error.notable.before = &f_color_set_string_null_s; + data->error.notable.after = &f_color_set_string_null_s; + + data->warning.context.before = &f_color_set_string_null_s; + data->warning.context.after = &f_color_set_string_null_s; + data->warning.notable.before = &f_color_set_string_null_s; + data->warning.notable.after = &f_color_set_string_null_s; } if (F_status_is_error(status)) { diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index a2a227a..8691c8f 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -1583,7 +1583,7 @@ extern "C" { f_string_dynamics_t version_minor = f_string_dynamics_t_initialize; f_string_dynamics_t version_target = f_string_dynamics_t_initialize; - f_string_dynamics_t * settings_value[] = { + f_string_dynamics_t *settings_value[] = { &build_compiler, &build_indexer, &build_language, diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index fb6adf4..9969f72 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -62,7 +62,7 @@ extern "C" { if (data.error.verbosity != f_console_verbosity_quiet) { fprintf(data.error.to.stream, "%c", f_string_eol[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to find program '", fll_error_print_error); - fl_color_print(data.error.to.stream, data.context.set.notable, "%s", program.used ? program.string : ""); + fl_color_print(data.error.to.stream, data.context.set.notable, "%s", program.used ? program.string : f_string_empty_s); fl_color_print(data.error.to.stream, data.context.set.error, "' for executing.%c", f_string_eol[0]); } } diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index 716b6c5..f2ed7aa 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -2529,7 +2529,7 @@ extern "C" { *status = f_environment_set(arguments.array[0].string, arguments.array[1].string, F_true); } else { - *status = f_environment_set(arguments.array[0].string, "", F_true); + *status = f_environment_set(arguments.array[0].string, f_string_empty_s, F_true); } if (F_status_is_error(*status)) { 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 eaee3e7..0c53c10 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 @@ -32,7 +32,7 @@ extern "C" { fll_program_print_help_option(output, context, fss_basic_list_write_short_single, fss_basic_list_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes."); fll_program_print_help_option(output, context, fss_basic_list_write_short_trim, fss_basic_list_write_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names."); - fll_program_print_help_usage(output, context, fss_basic_list_write_name, ""); + fll_program_print_help_usage(output, context, fss_basic_list_write_name, f_string_empty_s); fprintf(output.stream, " The pipe uses the Backspace character '"); fl_color_print(output.stream, context.set.notable, "\\b"); 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 c9defc1..d909e85 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -32,7 +32,7 @@ extern "C" { fll_program_print_help_option(output, context, fss_basic_write_short_single, fss_basic_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes."); fll_program_print_help_option(output, context, fss_basic_write_short_trim, fss_basic_write_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names."); - fll_program_print_help_usage(output, context, fss_basic_write_name, ""); + fll_program_print_help_usage(output, context, fss_basic_write_name, f_string_empty_s); fprintf(output.stream, " The pipe uses the Backspace character '"); fl_color_print(output.stream, context.set.notable, "\\b"); diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c index dae753a..c31bc37 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c @@ -32,7 +32,7 @@ extern "C" { fll_program_print_help_option(output, context, fss_embedded_list_write_short_single, fss_embedded_list_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes."); fll_program_print_help_option(output, context, fss_embedded_list_write_short_trim, fss_embedded_list_write_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names."); - fll_program_print_help_usage(output, context, fss_embedded_list_write_name, ""); + fll_program_print_help_usage(output, context, fss_embedded_list_write_name, f_string_empty_s); fprintf(output.stream, " The pipe uses the Backspace character '"); fl_color_print(output.stream, context.set.notable, "\\b"); diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.c b/level_3/fss_extended_list_write/c/fss_extended_list_write.c index 45dd866..687b0c8 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.c @@ -32,7 +32,7 @@ extern "C" { fll_program_print_help_option(output, context, fss_extended_list_write_short_single, fss_extended_list_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes."); fll_program_print_help_option(output, context, fss_extended_list_write_short_trim, fss_extended_list_write_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names."); - fll_program_print_help_usage(output, context, fss_extended_list_write_name, ""); + fll_program_print_help_usage(output, context, fss_extended_list_write_name, f_string_empty_s); fprintf(output.stream, " The pipe uses the Backspace character '"); fl_color_print(output.stream, context.set.notable, "\\b"); 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 93321fb..5e973ad 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -32,7 +32,7 @@ extern "C" { fll_program_print_help_option(output, context, fss_extended_write_short_single, fss_extended_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes."); fll_program_print_help_option(output, context, fss_extended_write_short_trim, fss_extended_write_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names."); - fll_program_print_help_usage(output, context, fss_extended_write_name, ""); + fll_program_print_help_usage(output, context, fss_extended_write_name, f_string_empty_s); fprintf(output.stream, " The pipe uses the Backspace character '"); fl_color_print(output.stream, context.set.notable, "\\b"); diff --git a/level_3/iki_write/c/iki_write.c b/level_3/iki_write/c/iki_write.c index 1fd329f..ff95dae 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -28,7 +28,7 @@ extern "C" { fll_program_print_help_option(output, context, iki_write_short_object, iki_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " The object to output."); fll_program_print_help_option(output, context, iki_write_short_single, iki_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes."); - fll_program_print_help_usage(output, context, iki_write_name, ""); + fll_program_print_help_usage(output, context, iki_write_name, f_string_empty_s); fl_color_print(output.stream, context.set.important, " Notes:"); diff --git a/level_3/init/c/init.c b/level_3/init/c/init.c index 9d14801..bac47ac 100644 --- a/level_3/init/c/init.c +++ b/level_3/init/c/init.c @@ -16,7 +16,7 @@ extern "C" { fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - fll_program_print_help_usage(output, context, init_name, ""); + fll_program_print_help_usage(output, context, init_name, f_string_empty_s); fl_color_print(output.stream, context.set.important, " Notes:"); fprintf(output.stream, "%c", f_string_eol[0]); -- 1.8.3.1