From ffe6812dc686fb2b8663c882c9ae14e5b2a6763a Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 19 Nov 2019 20:21:07 -0600 Subject: [PATCH] Feature: add new project fll_file This project contains the function fll_file_error_print() for handling common error output. --- level_2/fll_file/c/file.c | 68 ++++++++++++++++++++++ level_2/fll_file/c/file.h | 57 ++++++++++++++++++ level_2/fll_file/data/build/dependencies | 6 ++ level_2/fll_file/data/build/settings | 30 ++++++++++ .../fss_basic_list_read/c/fss_basic_list_read.h | 1 + .../c/private-fss_basic_list_read.c | 60 ++----------------- .../fss_basic_list_read/data/build/dependencies | 1 + level_3/fss_basic_list_read/data/build/settings | 2 +- .../fss_basic_list_write/c/fss_basic_list_write.c | 6 +- .../fss_basic_list_write/data/build/dependencies | 1 + level_3/fss_basic_list_write/data/build/settings | 2 +- level_3/fss_basic_read/c/fss_basic_read.h | 1 + level_3/fss_basic_read/c/private-fss_basic_read.c | 60 ++----------------- level_3/fss_basic_read/data/build/dependencies | 1 + level_3/fss_basic_read/data/build/settings | 2 +- level_3/fss_basic_write/c/fss_basic_write.c | 6 +- level_3/fss_basic_write/data/build/dependencies | 1 + level_3/fss_basic_write/data/build/settings | 2 +- .../c/fss_extended_list_read.h | 1 + .../c/private-fss_extended_list_read.c | 58 ++---------------- .../fss_extended_list_read/data/build/dependencies | 1 + level_3/fss_extended_list_read/data/build/settings | 2 +- level_3/fss_extended_read/c/fss_extended_read.h | 1 + .../c/private-fss_extended_read.c | 60 ++----------------- level_3/fss_extended_read/data/build/dependencies | 1 + level_3/fss_extended_read/data/build/settings | 2 +- level_3/fss_extended_write/c/fss_extended_write.c | 8 +-- level_3/fss_extended_write/data/build/dependencies | 1 + level_3/fss_extended_write/data/build/settings | 2 +- level_3/fss_status_code/data/build/dependencies | 1 + level_3/fss_status_code/data/build/settings | 2 +- 31 files changed, 214 insertions(+), 233 deletions(-) create mode 100644 level_2/fll_file/c/file.c create mode 100644 level_2/fll_file/c/file.h create mode 100644 level_2/fll_file/data/build/dependencies create mode 100644 level_2/fll_file/data/build/settings diff --git a/level_2/fll_file/c/file.c b/level_2/fll_file/c/file.c new file mode 100644 index 0000000..68fdd47 --- /dev/null +++ b/level_2/fll_file/c/file.c @@ -0,0 +1,68 @@ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fll_file_error_print_ + f_return_status fll_file_error_print(FILE *file, const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { + + if (status == f_error_allocation || status == f_error_reallocation) { + fl_color_print_line(file, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); + } + else if (status == f_file_not_open) { + fl_color_print(file, context.error, context.reset, "INTERNAL ERROR: The file '"); + fl_color_print(file, context.notable, context.reset, "%s", file_name); + fl_color_print_line(file, context.error, context.reset, "' is no longer open."); + } + else if (status == f_file_error_seek) { + fl_color_print(file, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); + fl_color_print(file, context.notable, context.reset, "%s", file_name); + fl_color_print_line(file, context.error, context.reset, "'."); + } + else if (status == f_file_error_read) { + fl_color_print(file, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); + fl_color_print(file, context.notable, context.reset, "%s", file_name); + fl_color_print_line(file, context.error, context.reset, "'."); + } + else if (status == f_file_not_found) { + fl_color_print(file, context.error, context.reset, "ERROR: Unable to find the file '"); + fl_color_print(file, context.notable, context.reset, "%s", file_name); + fl_color_print_line(file, context.error, context.reset, "'."); + } + else if (status == f_file_error_open) { + fl_color_print(file, context.error, context.reset, "ERROR: Unable to open the file '"); + fl_color_print(file, context.notable, context.reset, "%s", file_name); + fl_color_print_line(file, context.error, context.reset, "'."); + } + else if (status == f_file_error_descriptor) { + fl_color_print(file, context.error, context.reset, "ERROR: File descriptor error while trying to open the file '"); + fl_color_print(file, context.notable, context.reset, "%s", file_name); + fl_color_print_line(file, context.error, context.reset, "'."); + } + else if (status == f_invalid_parameter) { + fl_color_print(file, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(file, context.notable, context.reset, "%s()", function_name); + fl_color_print_line(file, context.error, context.reset, "."); + } + else if (status == f_number_overflow) { + fl_color_print(file, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); + fl_color_print(file, context.notable, context.reset, "%s", file_name); + fl_color_print_line(file, context.error, context.reset, "'."); + } + else if (status == f_number_underflow) { + fl_color_print(file, context.error, context.reset, "ERROR: Integer underflow while trying to buffer the file '"); + fl_color_print(file, context.notable, context.reset, "%s", file_name); + fl_color_print_line(file, context.error, context.reset, "'."); + } + else { + return f_false; + } + + return f_true; + } +#endif // _di_fll_file_error_print_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_2/fll_file/c/file.h b/level_2/fll_file/c/file.h new file mode 100644 index 0000000..7a1b76f --- /dev/null +++ b/level_2/fll_file/c/file.h @@ -0,0 +1,57 @@ +/** + * FLL - Level 2 + * + * Project: File + * API Version: 0.5 + * Licenses: lgplv2.1 + * + * Provides file-related functionality. + */ +#ifndef _FLL_file_h +#define _FLL_file_h + +// libc includes +#include + +// fll-0 includes +#include +#include +#include +#include +#include + +// fll-1 includes +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print file error messages. + * + * @param file + * The file to write to, such as f_standard_output or f_standard_error. + * @param context + * The color context information to use when printing. + * @param function_name + * The name of the function responsible for the error. + * @param file_name + * The name of the file with the error. + * @param status + * The status code representing the error. + * The status code should be passed through f_status_set_fine() if it contains error or warning bits. + * + * @return + * f_true if error message was printed. + * f_false if no error message was printed. + */ +#ifndef _di_fll_file_error_print_ + extern f_return_status fll_file_error_print(FILE *file, const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status); +#endif // _di_fll_file_error_print_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _FLL_file_h diff --git a/level_2/fll_file/data/build/dependencies b/level_2/fll_file/data/build/dependencies new file mode 100644 index 0000000..c73716f --- /dev/null +++ b/level_2/fll_file/data/build/dependencies @@ -0,0 +1,6 @@ +f_type +f_status +f_memory +f_string +f_utf +fl_color diff --git a/level_2/fll_file/data/build/settings b/level_2/fll_file/data/build/settings new file mode 100644 index 0000000..862d37d --- /dev/null +++ b/level_2/fll_file/data/build/settings @@ -0,0 +1,30 @@ +# fss-0000 + +project_name fll_file +project_level 2 + +version_major 0 +version_minor 5 +version_micro 0 + +build_compiler gcc +build_linker ar +build_libraries -lc +build_libraries_fll -lfl_color -lf_utf -lf_memory +build_sources_library file.c +build_sources_program +build_sources_headers file.h +build_sources_bash +build_sources_settings +build_shared yes +build_static yes + +defines_all +defines_static +defines_shared + +flags_all -z now -g +flags_shared +flags_static +flags_library -fPIC +flags_program -fPIE 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 6557052..3a071e3 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 @@ -36,6 +36,7 @@ // fll-2 includes #include +#include #include #include diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c index 6a43577..b282b87 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c @@ -8,58 +8,10 @@ extern "C" { #ifndef _di_fss_basic_list_read_print_file_error_ void fss_basic_list_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { - if (status == f_invalid_parameter) { - fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "."); - } - else if (status == f_number_overflow) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_not_open) { - fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: The file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "' is no longer open."); - } - else if (status == f_file_error_seek) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_read) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_not_found) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to find the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_open) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to open the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_descriptor) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: File descriptor error while trying to open the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_number_overflow) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_error_allocation || status == f_error_reallocation) { - fl_color_print_line(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); - } - else { + if (fll_file_error_print(f_standard_error, context, function_name, file_name, status) == f_false) { fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_standard_error, context.notable, context.reset, "%u", status); - fl_color_print(f_standard_error, context.error, context.reset, ") has occured while calling "); + fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling "); fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_standard_error, context.error, context.reset, "."); } @@ -119,7 +71,7 @@ extern "C" { else { fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_standard_error, context.notable, context.reset, "%u", status); - fl_color_print(f_standard_error, context.error, context.reset, ") has occured while calling "); + fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling "); fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print(f_standard_error, context.error, context.reset, "' for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); @@ -276,19 +228,19 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else if (status == f_incomplete_utf_on_stop) { - fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occured on invalid UTF-8 character at stop position (at "); + fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at "); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ")."); } else if (status == f_incomplete_utf_on_eos) { - fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occured on invalid UTF-8 character at end of string (at "); + fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at "); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ")."); } else { fl_color_print(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%u", status); - fl_color_print(f_standard_error, data->context.error, data->context.reset, ") has occured while calling "); + fl_color_print(f_standard_error, data->context.error, data->context.reset, ") has occurred while calling "); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()"); fl_color_print(f_standard_error, data->context.error, data->context.reset, " for the file '"); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename); diff --git a/level_3/fss_basic_list_read/data/build/dependencies b/level_3/fss_basic_list_read/data/build/dependencies index fd8beec..2615941 100644 --- a/level_3/fss_basic_list_read/data/build/dependencies +++ b/level_3/fss_basic_list_read/data/build/dependencies @@ -14,5 +14,6 @@ fl_fss fl_status fl_string fll_execute +fll_file fll_fss fll_program diff --git a/level_3/fss_basic_list_read/data/build/settings b/level_3/fss_basic_list_read/data/build/settings index e868d7b..76fadc1 100644 --- a/level_3/fss_basic_list_read/data/build/settings +++ b/level_3/fss_basic_list_read/data/build/settings @@ -10,7 +10,7 @@ version_micro 0 build_compiler gcc build_linker ar build_libraries -lc -build_libraries_fll -lfll_program -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory +build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory #build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 #build_libraries_fll-monolithic -lfll build_sources_library fss_basic_list_read.c private-fss_basic_list_read.c 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 0bc9e51..5e9de17 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 @@ -82,7 +82,7 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open()", status); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } f_status status2 = f_none; @@ -163,7 +163,7 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open()", status); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } fss_basic_list_write_delete_data(data); @@ -183,7 +183,7 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fl_file_write()", status); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_write()", status); } fss_basic_list_write_delete_data(data); diff --git a/level_3/fss_basic_list_write/data/build/dependencies b/level_3/fss_basic_list_write/data/build/dependencies index fd8beec..2615941 100644 --- a/level_3/fss_basic_list_write/data/build/dependencies +++ b/level_3/fss_basic_list_write/data/build/dependencies @@ -14,5 +14,6 @@ fl_fss fl_status fl_string fll_execute +fll_file fll_fss fll_program diff --git a/level_3/fss_basic_list_write/data/build/settings b/level_3/fss_basic_list_write/data/build/settings index b99d6a9..ee732b1 100644 --- a/level_3/fss_basic_list_write/data/build/settings +++ b/level_3/fss_basic_list_write/data/build/settings @@ -10,7 +10,7 @@ version_micro 0 build_compiler gcc build_linker ar build_libraries -lc -build_libraries_fll -lfll_program -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory +build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory #build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 #build_libraries_fll-monolithic -lfll build_sources_library fss_basic_list_write.c 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 55e000a..440ce77 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -36,6 +36,7 @@ // fll-2 includes #include +#include #include #include diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.c b/level_3/fss_basic_read/c/private-fss_basic_read.c index a91db2b..af081a7 100644 --- a/level_3/fss_basic_read/c/private-fss_basic_read.c +++ b/level_3/fss_basic_read/c/private-fss_basic_read.c @@ -8,58 +8,10 @@ extern "C" { #ifndef _di_fss_basic_read_print_file_error_ void fss_basic_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { - if (status == f_invalid_parameter) { - fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "."); - } - else if (status == f_number_overflow) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_not_open) { - fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: The file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "' is no longer open."); - } - else if (status == f_file_error_seek) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_read) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_not_found) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to find the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_open) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to open the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_descriptor) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: File descriptor error while trying to open the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_number_overflow) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_error_allocation || status == f_error_reallocation) { - fl_color_print_line(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); - } - else { + if (fll_file_error_print(f_standard_error, context, function_name, file_name, status) == f_false) { fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_standard_error, context.notable, context.reset, "%u", status); - fl_color_print(f_standard_error, context.error, context.reset, ") has occured while calling "); + fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling "); fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_standard_error, context.error, context.reset, "."); } @@ -119,7 +71,7 @@ extern "C" { else { fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_standard_error, context.notable, context.reset, "%u", status); - fl_color_print(f_standard_error, context.error, context.reset, ") has occured while calling "); + fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling "); fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print(f_standard_error, context.error, context.reset, "' for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); @@ -276,19 +228,19 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else if (status == f_incomplete_utf_on_stop) { - fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occured on invalid UTF-8 character at stop position (at "); + fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at "); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ")."); } else if (status == f_incomplete_utf_on_eos) { - fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occured on invalid UTF-8 character at end of string (at "); + fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at "); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ")."); } else { fl_color_print(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%u", status); - fl_color_print(f_standard_error, data->context.error, data->context.reset, ") has occured while calling "); + fl_color_print(f_standard_error, data->context.error, data->context.reset, ") has occurred while calling "); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()"); fl_color_print(f_standard_error, data->context.error, data->context.reset, " for the file '"); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename); diff --git a/level_3/fss_basic_read/data/build/dependencies b/level_3/fss_basic_read/data/build/dependencies index fd8beec..2615941 100644 --- a/level_3/fss_basic_read/data/build/dependencies +++ b/level_3/fss_basic_read/data/build/dependencies @@ -14,5 +14,6 @@ fl_fss fl_status fl_string fll_execute +fll_file fll_fss fll_program diff --git a/level_3/fss_basic_read/data/build/settings b/level_3/fss_basic_read/data/build/settings index 84b96e8..6506de8 100644 --- a/level_3/fss_basic_read/data/build/settings +++ b/level_3/fss_basic_read/data/build/settings @@ -10,7 +10,7 @@ version_micro 0 build_compiler gcc build_linker ar build_libraries -lc -build_libraries_fll -lfll_program -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory +build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory #build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 #build_libraries_fll-monolithic -lfll build_sources_library fss_basic_read.c private-fss_basic_read.c 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 442b1ef..ec928a5 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -82,7 +82,7 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open()", status); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } f_status status2 = f_none; @@ -163,7 +163,7 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open()", status); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } fss_basic_write_delete_data(data); @@ -183,7 +183,7 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fl_file_write()", status); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_write()", status); } fss_basic_write_delete_data(data); diff --git a/level_3/fss_basic_write/data/build/dependencies b/level_3/fss_basic_write/data/build/dependencies index fd8beec..2615941 100644 --- a/level_3/fss_basic_write/data/build/dependencies +++ b/level_3/fss_basic_write/data/build/dependencies @@ -14,5 +14,6 @@ fl_fss fl_status fl_string fll_execute +fll_file fll_fss fll_program diff --git a/level_3/fss_basic_write/data/build/settings b/level_3/fss_basic_write/data/build/settings index 79c15cb..27cb99b 100644 --- a/level_3/fss_basic_write/data/build/settings +++ b/level_3/fss_basic_write/data/build/settings @@ -10,7 +10,7 @@ version_micro 0 build_compiler gcc build_linker ar build_libraries -lc -build_libraries_fll -lfll_program -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory +build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory #build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 #build_libraries_fll-monolithic -lfll build_sources_library fss_basic_write.c diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.h b/level_3/fss_extended_list_read/c/fss_extended_list_read.h index 9e58829..91187c2 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.h @@ -36,6 +36,7 @@ // fll-2 includes #include +#include #include #include diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c index 9f5dcf3..75a4c4b 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c @@ -8,58 +8,10 @@ extern "C" { #ifndef _di_fss_extended_list_read_print_file_error_ void fss_extended_list_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { - if (status == f_invalid_parameter) { - fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "."); - } - else if (status == f_number_overflow) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_not_open) { - fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: The file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "' is no longer open."); - } - else if (status == f_file_error_seek) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_read) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_not_found) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to find the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_open) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to open the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_descriptor) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: File descriptor error while trying to open the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_number_overflow) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_error_allocation || status == f_error_reallocation) { - fl_color_print_line(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); - } - else { + if (fll_file_error_print(f_standard_error, context, function_name, file_name, status) == f_false) { fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_standard_error, context.notable, context.reset, "%u", status); - fl_color_print(f_standard_error, context.error, context.reset, ") has occured while calling "); + fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling "); fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_standard_error, context.error, context.reset, "."); } @@ -242,13 +194,13 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else if (status == f_incomplete_utf_on_stop) { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occured on invalid UTF-8 character at stop position (at %d).", input.start); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at %d).", input.start); } else if (status == f_incomplete_utf_on_eos) { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occured on invalid UTF-8 character at end of string (at %d).", input.start); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at %d).", input.start); } else { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fll_fss_extended_list_read() for the file '%s'", status, filename); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_extended_list_read() for the file '%s'", status, filename); } fss_extended_list_read_delete_data(data); diff --git a/level_3/fss_extended_list_read/data/build/dependencies b/level_3/fss_extended_list_read/data/build/dependencies index fd8beec..2615941 100644 --- a/level_3/fss_extended_list_read/data/build/dependencies +++ b/level_3/fss_extended_list_read/data/build/dependencies @@ -14,5 +14,6 @@ fl_fss fl_status fl_string fll_execute +fll_file fll_fss fll_program diff --git a/level_3/fss_extended_list_read/data/build/settings b/level_3/fss_extended_list_read/data/build/settings index ee7055b..538361a 100644 --- a/level_3/fss_extended_list_read/data/build/settings +++ b/level_3/fss_extended_list_read/data/build/settings @@ -10,7 +10,7 @@ version_micro 0 build_compiler gcc build_linker ar build_libraries -lc -build_libraries_fll -lfll_program -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory +build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory #build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 #build_libraries_fll-monolithic -lfll build_sources_library fss_extended_list_read.c private-fss_extended_list_read.c 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 9a91c45..1123446 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -36,6 +36,7 @@ // fll-2 includes #include +#include #include #include diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.c b/level_3/fss_extended_read/c/private-fss_extended_read.c index a1ef4fa..6b09eaf 100644 --- a/level_3/fss_extended_read/c/private-fss_extended_read.c +++ b/level_3/fss_extended_read/c/private-fss_extended_read.c @@ -8,58 +8,10 @@ extern "C" { #ifndef _di_fss_extended_read_print_file_error_ void fss_extended_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { - if (status == f_invalid_parameter) { - fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "."); - } - else if (status == f_number_overflow) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_not_open) { - fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: The file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "' is no longer open."); - } - else if (status == f_file_error_seek) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_read) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_not_found) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to find the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_open) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to open the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_file_error_descriptor) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: File descriptor error while trying to open the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_number_overflow) { - fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); - fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_standard_error, context.error, context.reset, "'."); - } - else if (status == f_error_allocation || status == f_error_reallocation) { - fl_color_print_line(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); - } - else { + if (fll_file_error_print(f_standard_error, context, function_name, file_name, status) == f_false) { fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_standard_error, context.notable, context.reset, "%u", status); - fl_color_print(f_standard_error, context.error, context.reset, ") has occured while calling "); + fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling "); fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_standard_error, context.error, context.reset, "."); } @@ -119,7 +71,7 @@ extern "C" { else { fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_standard_error, context.notable, context.reset, "%u", status); - fl_color_print(f_standard_error, context.error, context.reset, ") has occured while calling "); + fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling "); fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print(f_standard_error, context.error, context.reset, "' for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); @@ -276,19 +228,19 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else if (status == f_incomplete_utf_on_stop) { - fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occured on invalid UTF-8 character at stop position (at "); + fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at "); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ")."); } else if (status == f_incomplete_utf_on_eos) { - fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occured on invalid UTF-8 character at end of string (at "); + fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at "); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ")."); } else { fl_color_print(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%u", status); - fl_color_print(f_standard_error, data->context.error, data->context.reset, ") has occured while calling "); + fl_color_print(f_standard_error, data->context.error, data->context.reset, ") has occurred while calling "); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "fll_fss_extended_list_read()"); fl_color_print(f_standard_error, data->context.error, data->context.reset, " for the file '"); fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename); diff --git a/level_3/fss_extended_read/data/build/dependencies b/level_3/fss_extended_read/data/build/dependencies index fd8beec..2615941 100644 --- a/level_3/fss_extended_read/data/build/dependencies +++ b/level_3/fss_extended_read/data/build/dependencies @@ -14,5 +14,6 @@ fl_fss fl_status fl_string fll_execute +fll_file fll_fss fll_program diff --git a/level_3/fss_extended_read/data/build/settings b/level_3/fss_extended_read/data/build/settings index f25b633..54bc245 100644 --- a/level_3/fss_extended_read/data/build/settings +++ b/level_3/fss_extended_read/data/build/settings @@ -10,7 +10,7 @@ version_micro 0 build_compiler gcc build_linker ar build_libraries -lc -build_libraries_fll -lfll_program -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory +build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory #build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 #build_libraries_fll-monolithic -lfll build_sources_library fss_extended_read.c private-fss_extended_read.c 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 7d14bfe..1e6c374 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -65,7 +65,7 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_console_parameter_process()."); } else { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_console_parameter_process().", status); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_console_parameter_process().", status); } fss_extended_write_delete_data(data); @@ -109,7 +109,7 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open()", status); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } f_status status2 = f_none; @@ -228,7 +228,7 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open()", status); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } fss_extended_write_delete_data(data); @@ -248,7 +248,7 @@ extern "C" { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fl_file_write()", status); + fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_write()", status); } fss_extended_write_delete_data(data); diff --git a/level_3/fss_extended_write/data/build/dependencies b/level_3/fss_extended_write/data/build/dependencies index 2f284aa..04aa5c1 100644 --- a/level_3/fss_extended_write/data/build/dependencies +++ b/level_3/fss_extended_write/data/build/dependencies @@ -13,5 +13,6 @@ fl_fss fl_status fl_string fll_execute +fll_file fll_fss fll_program diff --git a/level_3/fss_extended_write/data/build/settings b/level_3/fss_extended_write/data/build/settings index 95818e5..d49ec12 100644 --- a/level_3/fss_extended_write/data/build/settings +++ b/level_3/fss_extended_write/data/build/settings @@ -10,7 +10,7 @@ version_micro 0 build_compiler gcc build_linker ar build_libraries -lc -build_libraries_fll -lfll_program -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory +build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_file -lfl_directory -lfl_color -lf_utf -lf_file -lf_print -lf_pipe -lf_console -lf_memory #build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 #build_libraries_fll-monolithic -lfll build_sources_library fss_extended_write.c diff --git a/level_3/fss_status_code/data/build/dependencies b/level_3/fss_status_code/data/build/dependencies index 8f6fe51..18f7ab2 100644 --- a/level_3/fss_status_code/data/build/dependencies +++ b/level_3/fss_status_code/data/build/dependencies @@ -19,6 +19,7 @@ fl_status fl_string fl_utf fll_execute +fll_file fll_fss fll_program fll_status diff --git a/level_3/fss_status_code/data/build/settings b/level_3/fss_status_code/data/build/settings index 34756fe..0112eb7 100644 --- a/level_3/fss_status_code/data/build/settings +++ b/level_3/fss_status_code/data/build/settings @@ -10,7 +10,7 @@ version_micro 0 build_compiler gcc build_linker ar build_libraries -lc -build_libraries_fll -lfll_status -lfll_program -lfll_fss -lfll_execute -lfl_utf -lfl_string -lfl_status -lfl_fss -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_print -lf_pipe -lf_file -lf_conversion -lf_console -lf_memory +build_libraries_fll -lfll_program -lfll_file -lfll_fss -lfll_execute -lfll_status -lfl_utf -lfl_string -lfl_status -lfl_fss -lfl_file -lfl_directory -lfl_console -lfl_color -lf_utf -lf_print -lf_pipe -lf_file -lf_conversion -lf_console -lf_memory #build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0 #build_libraries_fll-monolithic -lfll build_sources_library fss_status_code.c private-fss_status_code.c -- 1.8.3.1