From 045ae8876501a6e9a27fd1f577765cc8937ee557 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 15 Oct 2021 21:32:09 -0500 Subject: [PATCH] Refactor: fll_error_print_t is now fl_print_t. After using fll_error_print_t for a while now, I find that it is in practice superior to the regular print approach (such as with "f_file_t output;"). This made coding far easier than I imagined. This refactor changes renames this from an error purpose print to a generic all-purpose print. The existing "f_file_t output;" designs are not changed with this factor and will be changed in a later commit. This refactor allows this to be moved from a level 2 project to a level 1 project. In following with my completeness principle, I have added a "suffix" to compliment the "prefix". I also added the "set" as a pointer to make it optional and to also not take up as much resources the full object rather than a pointer. Having used fll_error_print_t for some time, I have found that I occasionally needed more than just the "context" and "notable". While working on this, I realized I could improve my practice of handling "static" strings (such as fll_error_print_debug_s). The practice is now to have the defines more closely match the names, but begin with the F_, FL_, etc.. in the same way that status codes are used. This then allows: | old | new | ---------------------------------------------- | fll_error_print_debug_s | fl_print_debug_s | <--- variable. | fll_error_print_debug | FL_print_debug_s | <--- define/macro. A future commit will convert all existing code that follows the old way. --- build/level_1/settings | 4 +- build/monolithic/settings | 4 +- level_1/fl_print/c/print-common.c | 16 +++++ level_1/fl_print/c/print-common.h | 78 ++++++++++++++++++++++ level_1/fl_print/c/print.h | 10 +-- level_1/fl_print/data/build/dependencies | 1 + level_1/fl_print/data/build/settings | 6 +- level_2/fll_error/c/error-common.c | 6 -- level_2/fll_error/c/error-common.h | 45 ------------- level_2/fll_error/c/error.c | 6 +- level_2/fll_error/c/error.h | 6 +- level_2/fll_error/c/private-error.c | 4 +- level_2/fll_error/c/private-error.h | 4 +- level_2/fll_print/data/build/settings | 2 +- level_3/byte_dump/c/byte_dump.h | 8 +-- level_3/control/c/control.h | 8 +-- level_3/controller/c/controller.h | 8 +-- level_3/controller/c/private-common.c | 6 +- level_3/controller/c/private-common.h | 6 +- level_3/controller/c/private-controller.c | 2 +- level_3/controller/c/private-entry.c | 4 +- level_3/controller/c/private-entry.h | 4 +- level_3/controller/c/private-rule.c | 18 ++--- level_3/controller/c/private-rule.h | 16 ++--- level_3/fake/c/fake.h | 8 +-- level_3/fake/c/private-common.h | 4 +- level_3/fake/c/private-make.c | 47 ++++++++----- level_3/fake/c/private-make.h | 12 ++-- level_3/fake/c/private-print.c | 22 +++--- level_3/fake/c/private-print.h | 18 ++--- level_3/firewall/c/firewall.h | 8 +-- level_3/firewall/c/private-common.c | 14 ++-- level_3/firewall/c/private-common.h | 14 ++-- .../fss_basic_list_read/c/fss_basic_list_read.h | 8 +-- .../fss_basic_list_write/c/fss_basic_list_write.h | 8 +-- level_3/fss_basic_read/c/fss_basic_read.h | 8 +-- level_3/fss_basic_write/c/fss_basic_write.h | 8 +-- .../c/fss_embedded_list_read.h | 8 +-- .../c/fss_embedded_list_write.h | 8 +-- .../c/fss_extended_list_read.h | 8 +-- .../c/fss_extended_list_write.h | 8 +-- level_3/fss_extended_read/c/fss_extended_read.h | 8 +-- level_3/fss_extended_write/c/fss_extended_write.h | 8 +-- level_3/fss_identify/c/fss_identify.h | 8 +-- level_3/fss_status_code/c/fss_status_code.h | 8 +-- level_3/iki_read/c/iki_read.h | 8 +-- level_3/iki_write/c/iki_write.h | 8 +-- level_3/status_code/c/status_code.h | 8 +-- 48 files changed, 300 insertions(+), 239 deletions(-) create mode 100644 level_1/fl_print/c/print-common.c create mode 100644 level_1/fl_print/c/print-common.h diff --git a/build/level_1/settings b/build/level_1/settings index 66e8161..961f550 100644 --- a/build/level_1/settings +++ b/build/level_1/settings @@ -22,10 +22,10 @@ build_language c build_libraries -lc -lcap build_libraries-level -lfll_0 build_libraries-level_threadless -lfll_0 -build_sources_library console.c control_group.c conversion.c private-conversion.c directory.c private-directory.c environment.c private-fss.c fss_basic.c fss_basic_list.c fss_embedded_list.c fss_extended.c fss_extended_list.c iki.c print.c private-print.c signal.c status.c string.c private-string.c utf.c private-utf.c utf_file.c private-utf_file.c +build_sources_library console.c control_group.c conversion.c private-conversion.c directory.c private-directory.c environment.c private-fss.c fss_basic.c fss_basic_list.c fss_embedded_list.c fss_extended.c fss_extended_list.c iki.c print.c print-common.c private-print.c signal.c status.c string.c private-string.c utf.c private-utf.c utf_file.c private-utf_file.c build_sources_library-level build_sources_program -build_sources_headers console.h control_group.h conversion.h directory.h environment.h execute.h execute-common.h fss.h fss_basic.h fss_basic_list.h fss_embedded_list.h fss_extended.h fss_extended_list.h fss_status.h iki.h print.h signal.h signal-common.h status.h string.h utf.h utf_file.h +build_sources_headers console.h control_group.h conversion.h directory.h environment.h execute.h execute-common.h fss.h fss_basic.h fss_basic_list.h fss_embedded_list.h fss_extended.h fss_extended_list.h fss_status.h iki.h print.h print-common.h signal.h signal-common.h status.h string.h utf.h utf_file.h build_sources_headers-level build_sources_script build_sources_setting diff --git a/build/monolithic/settings b/build/monolithic/settings index 7576bb0..9efd79e 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -22,10 +22,10 @@ build_language c build_libraries -lc -lcap build_libraries-monolithic build_libraries-monolithic_threadless -build_sources_library level_0/account.c level_0/private-account.c level_0/capability.c level_0/color.c level_0/color-common.c level_0/console.c level_0/console-common.c level_0/control_group.c level_0/control_group-common.c level_0/conversion.c level_0/conversion-common.c level_0/private-conversion.c level_0/directory.c level_0/private-directory.c level_0/environment.c level_0/private-environment.c level_0/execute.c level_0/file.c level_0/file-common.c level_0/private-file.c level_0/fss.c level_0/private-fss.c level_0/fss-common.c level_0/fss_named.c level_0/fss_nest.c level_0/fss_set.c level_0/iki.c level_0/iki-common.c level_0/private-iki.c level_0/limit.c level_0/memory.c level_0/memory_structure.c level_0/private-memory.c level_0/path.c level_0/path-common.c level_0/private-path.c level_0/pipe.c level_0/print.c level_0/print-common.c level_0/private-print.c level_0/serialize.c level_0/serialize-common.c level_0/private-serialize.c level_0/signal.c level_0/socket.c level_0/string.c level_0/string-common.c level_0/private-string.c level_0/string_dynamic.c level_0/string_map.c level_0/string_quantity.c level_0/string_range.c level_0/string_triple.c level_0/type_array.c level_0/private-type_array.c level_0/utf.c level_0/utf-common.c level_0/private-utf.c level_0/utf_dynamic.c level_0/utf_map.c level_0/utf_triple.c level_1/console.c level_1/control_group.c level_1/conversion.c level_1/private-conversion.c level_1/directory.c level_1/private-directory.c level_1/environment.c level_1/private-fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_embedded_list.c level_1/fss_extended.c level_1/fss_extended_list.c level_1/iki.c level_1/print.c level_1/private-print.c level_1/signal.c level_1/status.c level_1/string.c level_1/private-string.c level_1/utf.c level_1/private-utf.c level_1/utf_file.c level_1/private-utf_file.c level_2/control_group.c level_2/error.c level_2/error-common.c level_2/private-error.c level_2/execute.c level_2/private-execute.c level_2/file.c level_2/private-file.c level_2/fss.c level_2/private-fss.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_embedded_list.c level_2/fss_extended.c level_2/fss_extended_list.c level_2/fss_status.c level_2/iki.c level_2/private-iki.c level_2/path.c level_2/print.c level_2/program.c level_2/status.c +build_sources_library level_0/account.c level_0/private-account.c level_0/capability.c level_0/color.c level_0/color-common.c level_0/console.c level_0/console-common.c level_0/control_group.c level_0/control_group-common.c level_0/conversion.c level_0/conversion-common.c level_0/private-conversion.c level_0/directory.c level_0/private-directory.c level_0/environment.c level_0/private-environment.c level_0/execute.c level_0/file.c level_0/file-common.c level_0/private-file.c level_0/fss.c level_0/private-fss.c level_0/fss-common.c level_0/fss_named.c level_0/fss_nest.c level_0/fss_set.c level_0/iki.c level_0/iki-common.c level_0/private-iki.c level_0/limit.c level_0/memory.c level_0/memory_structure.c level_0/private-memory.c level_0/path.c level_0/path-common.c level_0/private-path.c level_0/pipe.c level_0/print.c level_0/print-common.c level_0/private-print.c level_0/serialize.c level_0/serialize-common.c level_0/private-serialize.c level_0/signal.c level_0/socket.c level_0/string.c level_0/string-common.c level_0/private-string.c level_0/string_dynamic.c level_0/string_map.c level_0/string_quantity.c level_0/string_range.c level_0/string_triple.c level_0/type_array.c level_0/private-type_array.c level_0/utf.c level_0/utf-common.c level_0/private-utf.c level_0/utf_dynamic.c level_0/utf_map.c level_0/utf_triple.c level_1/console.c level_1/control_group.c level_1/conversion.c level_1/private-conversion.c level_1/directory.c level_1/private-directory.c level_1/environment.c level_1/private-fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_embedded_list.c level_1/fss_extended.c level_1/fss_extended_list.c level_1/iki.c level_1/print.c level_1/print-common.c level_1/private-print.c level_1/signal.c level_1/status.c level_1/string.c level_1/private-string.c level_1/utf.c level_1/private-utf.c level_1/utf_file.c level_1/private-utf_file.c level_2/control_group.c level_2/error.c level_2/error-common.c level_2/private-error.c level_2/execute.c level_2/private-execute.c level_2/file.c level_2/private-file.c level_2/fss.c level_2/private-fss.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_embedded_list.c level_2/fss_extended.c level_2/fss_extended_list.c level_2/fss_status.c level_2/iki.c level_2/private-iki.c level_2/path.c level_2/print.c level_2/program.c level_2/status.c build_sources_library-monolithic level_0/thread.c level_0/private-thread.c build_sources_program -build_sources_headers level_0/account.h level_0/account-common.h level_0/capability.h level_0/capability-common.h level_0/color.h level_0/color-common.h level_0/console.h level_0/console-common.h level_0/control_group.h level_0/control_group-common.h level_0/conversion.h level_0/conversion-common.h level_0/directory.h level_0/directory_type.h level_0/directory-common.h level_0/environment.h level_0/environment-common.h level_0/execute.h level_0/execute-common.h level_0/file.h level_0/file-common.h level_0/fss.h level_0/fss-common.h level_0/fss_comment.h level_0/fss_delimit.h level_0/fss_named.h level_0/fss_nest.h level_0/fss_quote.h level_0/fss_set.h level_0/iki.h level_0/iki-common.h level_0/limit.h level_0/limit-common.h level_0/memory.h level_0/memory_structure.h level_0/memory-common.h level_0/path.h level_0/path-common.h level_0/pipe.h level_0/print.h level_0/print-common.h level_0/serialize.h level_0/serialize-common.h level_0/signal.h level_0/signal-common.h level_0/socket.h level_0/socket-common.h level_0/status.h level_0/string.h level_0/string-common.h level_0/string_dynamic.h level_0/string_map.h level_0/string_quantity.h level_0/string_range.h level_0/string_triple.h level_0/type.h level_0/type_array.h level_0/type_array-common.h level_0/utf.h level_0/utf-common.h level_0/utf_dynamic.h level_0/utf_map.h level_0/utf_triple.h level_1/console.h level_1/control_group.h level_1/conversion.h level_1/directory.h level_1/environment.h level_1/execute.h level_1/execute-common.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_embedded_list.h level_1/fss_extended.h level_1/fss_extended_list.h level_1/fss_status.h level_1/iki.h level_1/print.h level_1/signal.h level_1/signal-common.h level_1/status.h level_1/string.h level_1/utf.h level_1/utf_file.h level_2/control_group.h level_2/error.h level_2/error-common.h level_2/execute.h level_2/file.h level_2/fss.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_embedded_list.h level_2/fss_extended.h level_2/fss_extended_list.h level_2/fss_status.h level_2/iki.h level_2/path.h level_2/print.h level_2/program.h level_2/status.h +build_sources_headers level_0/account.h level_0/account-common.h level_0/capability.h level_0/capability-common.h level_0/color.h level_0/color-common.h level_0/console.h level_0/console-common.h level_0/control_group.h level_0/control_group-common.h level_0/conversion.h level_0/conversion-common.h level_0/directory.h level_0/directory_type.h level_0/directory-common.h level_0/environment.h level_0/environment-common.h level_0/execute.h level_0/execute-common.h level_0/file.h level_0/file-common.h level_0/fss.h level_0/fss-common.h level_0/fss_comment.h level_0/fss_delimit.h level_0/fss_named.h level_0/fss_nest.h level_0/fss_quote.h level_0/fss_set.h level_0/iki.h level_0/iki-common.h level_0/limit.h level_0/limit-common.h level_0/memory.h level_0/memory_structure.h level_0/memory-common.h level_0/path.h level_0/path-common.h level_0/pipe.h level_0/print.h level_0/print-common.h level_0/serialize.h level_0/serialize-common.h level_0/signal.h level_0/signal-common.h level_0/socket.h level_0/socket-common.h level_0/status.h level_0/string.h level_0/string-common.h level_0/string_dynamic.h level_0/string_map.h level_0/string_quantity.h level_0/string_range.h level_0/string_triple.h level_0/type.h level_0/type_array.h level_0/type_array-common.h level_0/utf.h level_0/utf-common.h level_0/utf_dynamic.h level_0/utf_map.h level_0/utf_triple.h level_1/console.h level_1/control_group.h level_1/conversion.h level_1/directory.h level_1/environment.h level_1/execute.h level_1/execute-common.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_embedded_list.h level_1/fss_extended.h level_1/fss_extended_list.h level_1/fss_status.h level_1/iki.h level_1/print.h level_1/print-common.h level_1/signal.h level_1/signal-common.h level_1/status.h level_1/string.h level_1/utf.h level_1/utf_file.h level_2/control_group.h level_2/error.h level_2/error-common.h level_2/execute.h level_2/file.h level_2/fss.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_embedded_list.h level_2/fss_extended.h level_2/fss_extended_list.h level_2/fss_status.h level_2/iki.h level_2/path.h level_2/print.h level_2/program.h level_2/status.h build_sources_headers-monolithic level_0/thread.h level_0/thread-common.h build_sources_script build_sources_setting diff --git a/level_1/fl_print/c/print-common.c b/level_1/fl_print/c/print-common.c new file mode 100644 index 0000000..b739e9f --- /dev/null +++ b/level_1/fl_print/c/print-common.c @@ -0,0 +1,16 @@ +#include "print.h" +#include "private-print.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fl_print_t_ + const f_string_t fl_print_debug_s = FL_print_debug_s; + const f_string_t fl_print_error_s = FL_print_error_s; + const f_string_t fl_print_warning_s = FL_print_warning_s; +#endif // _di_fl_print_t_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_1/fl_print/c/print-common.h b/level_1/fl_print/c/print-common.h new file mode 100644 index 0000000..843c2d0 --- /dev/null +++ b/level_1/fl_print/c/print-common.h @@ -0,0 +1,78 @@ +/** + * FLL - Level 1 + * + * Project: Print + * API Version: 0.5 + * Licenses: lgplv2.1 + * + * Defines common data to be used for/by project print. + * + * This is auto-included by print.h and should not need to be explicitly included. + */ +#ifndef _FL_print_common_h +#define _FL_print_common_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Structure for facilitating colored or other managed printing. + * + * to: The file to print to. + * verbosity: The verbosity mode. + * prefix: An optional prefix string for displaying before any special messages. + * suffix: An optional suffix string for displaying after any special messages. + * context: The color codes for the entire error message. + * notable: The color codes for a part of the message to make more visible. + * set: An optional pointer to a set of all available color contexts for explicit use. + */ +#ifndef _di_fl_print_t_ + #define FL_print_debug_s "DEBUG: " + #define FL_print_error_s "ERROR: " + #define FL_print_warning_s "WARNING: " + + #define FL_debug_s_length 7 + #define FL_error_s_length 7 + #define FL_warning_s_length 9 + + extern const f_string_t fl_print_debug_s; + extern const f_string_t fl_print_error_s; + extern const f_string_t fl_print_warning_s; + + typedef struct { + f_file_t to; + uint8_t verbosity; + + const char *prefix; + const char *suffix; + + f_color_set_t context; + f_color_set_t notable; + f_color_set_context_t *set; + } fl_print_t; + + #define fl_print_t_initialize { \ + macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ + f_console_verbosity_normal, \ + 0, \ + 0, \ + f_color_set_t_initialize, \ + f_color_set_t_initialize, \ + 0, \ + } + + #define macro_fl_print_t_initialize(to, verbosity, prefix, suffix, context, notable, set) { to, verbosity, prefix, suffix, context, notable, set } + #define macro_fl_print_t_initialize_debug() macro_fl_print_t_initialize(macro_f_file_t_initialize2(f_type_debug, f_type_descriptor_debug, f_file_flag_write_only), f_console_verbosity_normal, fl_print_debug_s, 0, f_color_set_t_initialize, f_color_set_t_initialize, 0) + #define macro_fl_print_t_initialize_debug2(suffix, set) macro_fl_print_t_initialize(macro_f_file_t_initialize2(f_type_debug, f_type_descriptor_debug, f_file_flag_write_only), f_console_verbosity_normal, fl_print_debug_s, suffix, f_color_set_t_initialize, f_color_set_t_initialize, set) + #define macro_fl_print_t_initialize_error() macro_fl_print_t_initialize(macro_f_file_t_initialize2(f_type_error, f_type_descriptor_error, f_file_flag_write_only), f_console_verbosity_normal, fl_print_error_s, 0, f_color_set_t_initialize, f_color_set_t_initialize, 0) + #define macro_fl_print_t_initialize_error2(suffix, set) macro_fl_print_t_initialize(macro_f_file_t_initialize2(f_type_error, f_type_descriptor_error, f_file_flag_write_only), f_console_verbosity_normal, fl_print_error_s, suffix, f_color_set_t_initialize, f_color_set_t_initialize, set) + #define macro_fl_print_t_initialize_warning() macro_fl_print_t_initialize(macro_f_file_t_initialize2(f_type_warning, f_type_descriptor_warning, f_file_flag_write_only), f_console_verbosity_normal, fl_print_warning_s, 0, f_color_set_t_initialize, f_color_set_t_initialize, 0) + #define macro_fl_print_t_initialize_warning2(suffix, set) macro_fl_print_t_initialize(macro_f_file_t_initialize2(f_type_warning, f_type_descriptor_warning, f_file_flag_write_only), f_console_verbosity_normal, fl_print_warning_s, suffix, f_color_set_t_initialize, f_color_set_t_initialize, set) +#endif // _di_fl_print_t_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _FL_print_common_h diff --git a/level_1/fl_print/c/print.h b/level_1/fl_print/c/print.h index 6114179..37b0ead 100644 --- a/level_1/fl_print/c/print.h +++ b/level_1/fl_print/c/print.h @@ -8,16 +8,14 @@ * Provides some standard printing functions not available in a libc. * * Functions provided here are UTF-8 aware. - * - * @fixme the except_in and except_at only apply to 1-byte characters, so what happens if a single except byte is only a part of a single multibyte character? */ #ifndef _FL_print_h #define _FL_print_h -// libc includes +// libc includes. #include -// fll-0 includes +// fll-0 includes. #include #include #include @@ -25,8 +23,12 @@ #include #include #include +#include #include +// fll-1 print includes. +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/level_1/fl_print/data/build/dependencies b/level_1/fl_print/data/build/dependencies index a0ae75a..a8e1bfb 100644 --- a/level_1/fl_print/data/build/dependencies +++ b/level_1/fl_print/data/build/dependencies @@ -7,4 +7,5 @@ f_string f_utf f_color f_conversion +f_file f_print diff --git a/level_1/fl_print/data/build/settings b/level_1/fl_print/data/build/settings index fe6ce39..a88a408 100644 --- a/level_1/fl_print/data/build/settings +++ b/level_1/fl_print/data/build/settings @@ -20,10 +20,10 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lf_color -lf_conversion -lf_memory -lf_print -lf_string -lf_utf -build_sources_library print.c private-print.c +build_libraries-individual -lf_color -lf_conversion -lf_file -lf_memory -lf_print -lf_string -lf_utf +build_sources_library print.c print-common.c private-print.c build_sources_program -build_sources_headers print.h +build_sources_headers print.h print-common.h build_sources_script build_sources_setting build_script yes diff --git a/level_2/fll_error/c/error-common.c b/level_2/fll_error/c/error-common.c index e4238ea..7f7cb5c 100644 --- a/level_2/fll_error/c/error-common.c +++ b/level_2/fll_error/c/error-common.c @@ -11,12 +11,6 @@ extern "C" { const f_string_t fll_error_file_type_string_pipe_s = fll_error_file_type_string_pipe; #endif // _di_fll_error_file_type_ -#ifndef _di_fll_error_print_t_ - const f_string_t fll_error_print_debug_s = fll_error_print_debug; - const f_string_t fll_error_print_error_s = fll_error_print_error; - const f_string_t fll_error_print_warning_s = fll_error_print_warning; -#endif // _di_fll_error_print_t_ - #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 d34f5bb..3b98c29 100644 --- a/level_2/fll_error/c/error-common.h +++ b/level_2/fll_error/c/error-common.h @@ -39,51 +39,6 @@ extern "C" { extern const f_string_t fll_error_file_type_string_pipe_s; #endif // _di_fll_error_file_type_ -/** - * Structure for facilitating the error printing. - * - * to: The file to print to. - * verbosity: The verbosity mode. - * prefix: A prefix string to display before the error. - * context: The color codes for the entire error message. - * notable: The color codes for a part of the message to make more visible. - */ -#ifndef _di_fll_error_print_t_ - #define fll_error_print_debug "DEBUG: " - #define fll_error_print_error "ERROR: " - #define fll_error_print_warning "WARNING: " - - #define fll_error_print_debug_length 7 - #define fll_error_print_error_length 7 - #define fll_error_print_warning_length 9 - - extern const f_string_t fll_error_print_debug_s; - extern const f_string_t fll_error_print_error_s; - extern const f_string_t fll_error_print_warning_s; - - typedef struct { - f_file_t to; - uint8_t verbosity; - - const char *prefix; - - f_color_set_t context; - f_color_set_t notable; - } fll_error_print_t; - - #define fll_error_print_t_initialize { \ - macro_f_file_t_initialize2(f_type_error, f_type_descriptor_error, f_file_flag_write_only), \ - f_console_verbosity_normal, \ - fll_error_print_error_s, \ - f_color_set_t_initialize, \ - f_color_set_t_initialize, \ - } - - #define macro_fll_error_print_t_initialize(to, verbosity, prefix, context, notable) { to, verbosity, prefix, context, notable } - #define macro_fll_error_print_t_initialize_debug() macro_fll_error_print_t_initialize(macro_f_file_t_initialize2(f_type_debug, f_type_descriptor_debug, f_file_flag_write_only), f_console_verbosity_normal, fll_error_print_debug_s, f_color_set_t_initialize, f_color_set_t_initialize) - #define macro_fll_error_print_t_initialize_warning() macro_fll_error_print_t_initialize(macro_f_file_t_initialize2(f_type_warning, f_type_descriptor_warning, f_file_flag_write_only), f_console_verbosity_normal, fll_error_print_warning_s, f_color_set_t_initialize, f_color_set_t_initialize) -#endif // _di_fll_error_print_t_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_2/fll_error/c/error.c b/level_2/fll_error/c/error.c index 3fb8929..717703d 100644 --- a/level_2/fll_error/c/error.c +++ b/level_2/fll_error/c/error.c @@ -6,14 +6,14 @@ extern "C" { #endif #ifndef _di_fll_error_print_ - f_status_t fll_error_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback) { + f_status_t fll_error_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback) { return private_fll_error_print(print, status, function, fallback); } #endif // _di_fll_error_print_ #ifndef _di_fll_error_file_print_ - f_status_t fll_error_file_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type) { + f_status_t fll_error_file_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type) { const char *type_name = fll_error_file_type_string_file; @@ -555,7 +555,7 @@ extern "C" { #endif // _di_fll_error_file_print_ #ifndef _di_fll_error_parameter_integer_print_ - f_status_t fll_error_parameter_integer_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t parameter, const f_string_t argument) { + f_status_t fll_error_parameter_integer_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t parameter, const f_string_t argument) { if (status == F_data_not) { if (print.verbosity != f_console_verbosity_quiet) { diff --git a/level_2/fll_error/c/error.h b/level_2/fll_error/c/error.h index 6c7321f..f53f723 100644 --- a/level_2/fll_error/c/error.h +++ b/level_2/fll_error/c/error.h @@ -53,7 +53,7 @@ extern "C" { * F_true is returned if the status code is unknown. */ #ifndef _di_fll_error_print_ - extern f_status_t fll_error_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback); + extern f_status_t fll_error_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback); #endif // _di_fll_error_print_ /** @@ -81,7 +81,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_fll_error_file_print_ - extern f_status_t fll_error_file_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type); + extern f_status_t fll_error_file_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type); #endif // _di_fll_error_file_print_ /** @@ -107,7 +107,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_fll_error_parameter_integer_print_ - extern f_status_t fll_error_parameter_integer_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t parameter, const f_string_t argument); + extern f_status_t fll_error_parameter_integer_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t parameter, const f_string_t argument); #endif // _di_fll_error_parameter_integer_print_ #ifdef __cplusplus diff --git a/level_2/fll_error/c/private-error.c b/level_2/fll_error/c/private-error.c index 05f14f0..7cd5874 100644 --- a/level_2/fll_error/c/private-error.c +++ b/level_2/fll_error/c/private-error.c @@ -6,7 +6,7 @@ extern "C" { #endif #if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_) - f_status_t private_fll_error_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback) { + f_status_t private_fll_error_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback) { if (status == F_access_denied) { if (print.verbosity != f_console_verbosity_quiet) { @@ -180,7 +180,7 @@ extern "C" { #endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_) #if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_) - void private_fll_error_print_function(const fll_error_print_t print, const f_string_t function) { + void private_fll_error_print_function(const fl_print_t print, const f_string_t function) { if (function) { fl_print_format(" when calling function%] ", print.to.stream, print.context); diff --git a/level_2/fll_error/c/private-error.h b/level_2/fll_error/c/private-error.h index 570999d..7d6fae5 100644 --- a/level_2/fll_error/c/private-error.h +++ b/level_2/fll_error/c/private-error.h @@ -39,7 +39,7 @@ extern "C" { * @see fll_error_file_print() */ #if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_) - extern f_status_t private_fll_error_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback) f_attribute_visibility_internal; + extern f_status_t private_fll_error_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback) f_attribute_visibility_internal; #endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_) /** @@ -61,7 +61,7 @@ extern "C" { * @see fll_error_file_print() */ #if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_) - void private_fll_error_print_function(const fll_error_print_t print, const f_string_t function) f_attribute_visibility_internal; + void private_fll_error_print_function(const fl_print_t print, const f_string_t function) f_attribute_visibility_internal; #endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_) #ifdef __cplusplus diff --git a/level_2/fll_print/data/build/settings b/level_2/fll_print/data/build/settings index ef22549..9444cea 100644 --- a/level_2/fll_print/data/build/settings +++ b/level_2/fll_print/data/build/settings @@ -20,7 +20,7 @@ build_compiler gcc build_indexer ar build_language c build_libraries -lc -build_libraries-individual -lfl_print -lf_color -lf_conversion -lf_memory -lf_print -lf_string -lf_utf +build_libraries-individual -lfl_print -lf_color -lf_conversion -lf_file -lf_memory -lf_print -lf_string -lf_utf build_sources_library print.c build_sources_program build_sources_headers print.h diff --git a/level_3/byte_dump/c/byte_dump.h b/level_3/byte_dump/c/byte_dump.h index b8a020e..dd55ce2 100644 --- a/level_3/byte_dump/c/byte_dump.h +++ b/level_3/byte_dump/c/byte_dump.h @@ -230,8 +230,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; uint64_t first; uint64_t last; @@ -248,8 +248,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ 0, \ 0, \ 8, \ diff --git a/level_3/control/c/control.h b/level_3/control/c/control.h index a7ced47..2205404 100644 --- a/level_3/control/c/control.h +++ b/level_3/control/c/control.h @@ -101,8 +101,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_color_context_t context; } control_main_t; @@ -113,8 +113,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } #endif // _di_control_data_t_ diff --git a/level_3/controller/c/controller.h b/level_3/controller/c/controller.h index 73c241c..3e32543 100644 --- a/level_3/controller/c/controller.h +++ b/level_3/controller/c/controller.h @@ -224,8 +224,8 @@ extern "C" { bool as_init; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; pid_t pid; mode_t umask; @@ -247,8 +247,8 @@ extern "C" { F_false, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ 0, \ 0, \ 0, \ diff --git a/level_3/controller/c/private-common.c b/level_3/controller/c/private-common.c index fe1c530..634b4d2 100644 --- a/level_3/controller/c/private-common.c +++ b/level_3/controller/c/private-common.c @@ -196,7 +196,7 @@ extern "C" { #endif // _di_controller_entry_items_delete_simple_ #ifndef _di_controller_error_file_print_ - void controller_error_file_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type, controller_thread_t *thread) { + void controller_error_file_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type, controller_thread_t *thread) { if (print.verbosity == f_console_verbosity_quiet) return; @@ -213,7 +213,7 @@ extern "C" { } #endif // _di_controller_error_file_print_ #ifndef _di_controller_error_print_ - void controller_error_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) { + void controller_error_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) { if (print.verbosity == f_console_verbosity_quiet) return; if (status == F_interrupt) return; @@ -303,7 +303,7 @@ extern "C" { #endif // _di_controller_lock_delete_simple_ #ifndef _di_controller_lock_error_critical_print_ - void controller_lock_error_critical_print(const fll_error_print_t print, const f_status_t status, const bool read, controller_thread_t *thread) { + void controller_lock_error_critical_print(const fl_print_t print, const f_status_t status, const bool read, controller_thread_t *thread) { // A signal is not an error. if (status == F_signal) { diff --git a/level_3/controller/c/private-common.h b/level_3/controller/c/private-common.h index f727163..e0c72fc 100644 --- a/level_3/controller/c/private-common.h +++ b/level_3/controller/c/private-common.h @@ -1767,7 +1767,7 @@ extern "C" { * @see fll_error_file_print() */ #ifndef _di_controller_error_file_print_ - extern void controller_error_file_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type, controller_thread_t *thread) f_attribute_visibility_internal; + extern void controller_error_file_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type, controller_thread_t *thread) f_attribute_visibility_internal; #endif // _di_controller_error_file_print_ /** @@ -1790,7 +1790,7 @@ extern "C" { * @see fll_error_print() */ #ifndef _di_controller_error_print_ - extern void controller_error_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) f_attribute_visibility_internal; + extern void controller_error_print(const fl_print_t print, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) f_attribute_visibility_internal; #endif // _di_controller_error_print_ /** @@ -1867,7 +1867,7 @@ extern "C" { * @see controller_entry_error_print_cache() */ #ifndef _di_controller_lock_error_critical_print_ - extern void controller_lock_error_critical_print(const fll_error_print_t print, const f_status_t status, const bool read, controller_thread_t *thread) f_attribute_visibility_internal; + extern void controller_lock_error_critical_print(const fl_print_t print, const f_status_t status, const bool read, controller_thread_t *thread) f_attribute_visibility_internal; #endif // _di_controller_lock_error_critical_print_ /** diff --git a/level_3/controller/c/private-controller.c b/level_3/controller/c/private-controller.c index a84419d..89aaf75 100644 --- a/level_3/controller/c/private-controller.c +++ b/level_3/controller/c/private-controller.c @@ -816,7 +816,7 @@ extern "C" { } else { if ((entry_action->code & controller_entry_rule_code_require) && global->main->error.verbosity != f_console_verbosity_quiet || !(entry_action->code & controller_entry_rule_code_require) && (global->main->warning.verbosity == f_console_verbosity_verbose || global->main->warning.verbosity == f_console_verbosity_debug)) { - fll_error_print_t *output = 0; + fl_print_t *output = 0; if (entry_action->code & controller_entry_rule_code_require) { output = &global->main->error; diff --git a/level_3/controller/c/private-entry.c b/level_3/controller/c/private-entry.c index fb09e5a..36d2a82 100644 --- a/level_3/controller/c/private-entry.c +++ b/level_3/controller/c/private-entry.c @@ -717,7 +717,7 @@ extern "C" { #endif // _di_controller_entry_actions_read_ #ifndef _di_controller_entry_error_print_ - void controller_entry_error_print(const bool is_entry, const fll_error_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) { + void controller_entry_error_print(const bool is_entry, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) { if (print.verbosity == f_console_verbosity_quiet) return; if (status == F_interrupt) return; @@ -736,7 +736,7 @@ extern "C" { #endif // _di_controller_entry_error_print_ #ifndef _di_controller_entry_error_print_cache_ - void controller_entry_error_print_cache(const bool is_entry, const fll_error_print_t output, const controller_cache_action_t cache) { + void controller_entry_error_print_cache(const bool is_entry, const fl_print_t output, const controller_cache_action_t cache) { fl_print_format("%c%[%SWhile processing ", output.to.stream, f_string_eol_s[0], output.context, output.prefix); diff --git a/level_3/controller/c/private-entry.h b/level_3/controller/c/private-entry.h index f9ed1a4..616c67f 100644 --- a/level_3/controller/c/private-entry.h +++ b/level_3/controller/c/private-entry.h @@ -153,7 +153,7 @@ extern "C" { * @see controller_entry_error_print_cache() */ #ifndef _di_controller_entry_error_print_ - extern void controller_entry_error_print(const bool is_entry, const fll_error_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) f_attribute_visibility_internal; + extern void controller_entry_error_print(const bool is_entry, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) f_attribute_visibility_internal; #endif // _di_controller_entry_error_print_ /** @@ -175,7 +175,7 @@ extern "C" { * @see controller_entry_read() */ #ifndef _di_controller_entry_error_print_cache_ - extern void controller_entry_error_print_cache(const bool is_entry, const fll_error_print_t output, const controller_cache_action_t cache) f_attribute_visibility_internal; + extern void controller_entry_error_print_cache(const bool is_entry, const fl_print_t output, const controller_cache_action_t cache) f_attribute_visibility_internal; #endif // _di_controller_entry_error_print_cache_ /** diff --git a/level_3/controller/c/private-rule.c b/level_3/controller/c/private-rule.c index a8fcd59..c0337ad 100644 --- a/level_3/controller/c/private-rule.c +++ b/level_3/controller/c/private-rule.c @@ -1020,7 +1020,7 @@ extern "C" { #endif // _di_controller_rule_copy_ #ifndef _di_controller_rule_error_print_ - void controller_rule_error_print(const fll_error_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item, controller_thread_t *thread) { + void controller_rule_error_print(const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item, controller_thread_t *thread) { if (print.verbosity == f_console_verbosity_quiet) return; if (status == F_interrupt) return; @@ -1039,7 +1039,7 @@ extern "C" { #endif // _di_controller_rule_error_print_ #ifndef _di_controller_rule_error_print_cache_ - void controller_rule_error_print_cache(const fll_error_print_t print, const controller_cache_action_t cache, const bool item) { + void controller_rule_error_print_cache(const fl_print_t print, const controller_cache_action_t cache, const bool item) { if (print.verbosity == f_console_verbosity_quiet) return; @@ -1070,7 +1070,7 @@ extern "C" { #endif // _di_controller_rule_error_print_cache_ #ifndef _di_controller_rule_item_error_print_ - void controller_rule_item_error_print(const fll_error_print_t print, const controller_cache_action_t cache, const bool item, const f_status_t status, controller_thread_t *thread) { + void controller_rule_item_error_print(const fl_print_t print, const controller_cache_action_t cache, const bool item, const f_status_t status, controller_thread_t *thread) { if (print.verbosity == f_console_verbosity_quiet) return; if (status == F_interrupt) return; @@ -1090,7 +1090,7 @@ extern "C" { void controller_rule_item_error_print_execute(const bool script_is, const f_string_t name, const f_status_t status, controller_process_t * const process) { if (((controller_main_t *) process->main_data)->error.verbosity != f_console_verbosity_quiet) { - fll_error_print_t * const print = &((controller_main_t *) process->main_data)->error; + fl_print_t * const print = &((controller_main_t *) process->main_data)->error; controller_print_lock(print->to, (controller_thread_t *) process->main_thread); @@ -1223,7 +1223,7 @@ extern "C" { #endif // _di_controller_rule_item_error_print_execute_ #ifndef _di_controller_rule_item_error_print_need_want_wish_ - void controller_rule_item_error_print_need_want_wish(const fll_error_print_t print, const f_string_t need_want_wish, const f_string_t value, const f_string_t why) { + void controller_rule_item_error_print_need_want_wish(const fl_print_t print, const f_string_t need_want_wish, const f_string_t value, const f_string_t why) { if (print.verbosity == f_console_verbosity_quiet) return; @@ -1234,7 +1234,7 @@ extern "C" { #endif // _di_controller_rule_item_error_print_need_want_wish_ #ifndef _di_controller_rule_item_error_print_rule_not_loaded_ - void controller_rule_item_error_print_rule_not_loaded(const fll_error_print_t print, const f_string_t alias) { + void controller_rule_item_error_print_rule_not_loaded(const fl_print_t print, const f_string_t alias) { if (print.verbosity == f_console_verbosity_quiet) return; @@ -1245,7 +1245,7 @@ extern "C" { #endif // _di_controller_rule_item_error_print_rule_not_loaded_ #ifndef _di_controller_rule_action_error_missing_pid_ - void controller_rule_action_error_missing_pid(const fll_error_print_t print, const f_string_t alias) { + void controller_rule_action_error_missing_pid(const fl_print_t print, const f_string_t alias) { if (print.verbosity == f_console_verbosity_quiet) return; @@ -5679,7 +5679,7 @@ extern "C" { #endif // _di_controller_rule_setting_read_print_value_ #ifndef _di_controller_rule_setting_read_problem_print_ - void controller_rule_setting_read_problem_print(const fll_error_print_t print, const f_string_t message, const f_array_length_t index, const f_array_length_t line_item, controller_thread_t *thread, controller_cache_t *cache) { + void controller_rule_setting_read_problem_print(const fl_print_t print, const f_string_t message, const f_array_length_t index, const f_array_length_t line_item, controller_thread_t *thread, controller_cache_t *cache) { if (print.verbosity == f_console_verbosity_quiet) return; @@ -5700,7 +5700,7 @@ extern "C" { #endif // _di_controller_rule_setting_read_problem_print_ #ifndef _di_controller_rule_setting_read_problem_print_with_range_ - void controller_rule_setting_read_problem_print_with_range(const fll_error_print_t print, const f_string_t before, const f_string_range_t range, const f_string_t after, const f_array_length_t index, const f_array_length_t line_item, controller_thread_t *thread, controller_cache_t *cache) { + void controller_rule_setting_read_problem_print_with_range(const fl_print_t print, const f_string_t before, const f_string_range_t range, const f_string_t after, const f_array_length_t index, const f_array_length_t line_item, controller_thread_t *thread, controller_cache_t *cache) { if (print.verbosity == f_console_verbosity_quiet) return; diff --git a/level_3/controller/c/private-rule.h b/level_3/controller/c/private-rule.h index 2d3f311..cb5ea03 100644 --- a/level_3/controller/c/private-rule.h +++ b/level_3/controller/c/private-rule.h @@ -242,7 +242,7 @@ extern "C" { * @see controller_entry_error_print_cache() */ #ifndef _di_controller_rule_error_print_ - extern void controller_rule_error_print(const fll_error_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item, controller_thread_t *thread) f_attribute_visibility_internal; + extern void controller_rule_error_print(const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item, controller_thread_t *thread) f_attribute_visibility_internal; #endif // _di_controller_rule_error_print_ /** @@ -267,7 +267,7 @@ extern "C" { * @see controller_rule_setting_read() */ #ifndef _di_controller_rule_error_print_cache_ - extern void controller_rule_error_print_cache(const fll_error_print_t print, const controller_cache_action_t cache, const bool item) f_attribute_visibility_internal; + extern void controller_rule_error_print_cache(const fl_print_t print, const controller_cache_action_t cache, const bool item) f_attribute_visibility_internal; #endif // _di_controller_rule_error_print_cache_ /** @@ -290,7 +290,7 @@ extern "C" { * @see controller_rule_error_print_cache() */ #ifndef _di_controller_rule_item_error_print_ - extern void controller_rule_item_error_print(const fll_error_print_t print, const controller_cache_action_t cache, const bool item, const f_status_t status, controller_thread_t *thread) f_attribute_visibility_internal; + extern void controller_rule_item_error_print(const fl_print_t print, const controller_cache_action_t cache, const bool item, const f_status_t status, controller_thread_t *thread) f_attribute_visibility_internal; #endif // _di_controller_rule_item_error_print_ /** @@ -326,7 +326,7 @@ extern "C" { * A short explanation on why this is an error or warning. */ #ifndef _di_controller_rule_item_error_print_need_want_wish_ - extern void controller_rule_item_error_print_need_want_wish(const fll_error_print_t print, const f_string_t need_want_wish, const f_string_t value, const f_string_t why) f_attribute_visibility_internal; + extern void controller_rule_item_error_print_need_want_wish(const fl_print_t print, const f_string_t need_want_wish, const f_string_t value, const f_string_t why) f_attribute_visibility_internal; #endif // _di_controller_rule_item_error_print_need_want_wish_ /** @@ -338,7 +338,7 @@ extern "C" { * The rule alias of the rule that is not loaded. */ #ifndef _di_controller_rule_item_error_print_rule_not_loaded_ - extern void controller_rule_item_error_print_rule_not_loaded(const fll_error_print_t print, const f_string_t alias) f_attribute_visibility_internal; + extern void controller_rule_item_error_print_rule_not_loaded(const fl_print_t print, const f_string_t alias) f_attribute_visibility_internal; #endif // _di_controller_rule_item_error_print_rule_not_loaded_ /** @@ -350,7 +350,7 @@ extern "C" { * The rule alias of the rule that is missing the pid file designation. */ #ifndef _di_controller_rule_action_error_missing_pid_ - extern void controller_rule_action_error_missing_pid(const fll_error_print_t print, const f_string_t alias) f_attribute_visibility_internal; + extern void controller_rule_action_error_missing_pid(const fl_print_t print, const f_string_t alias) f_attribute_visibility_internal; #endif // _di_controller_rule_action_error_missing_pid_ /** @@ -922,7 +922,7 @@ extern "C" { * @see controller_rule_setting_read() */ #ifndef _di_controller_rule_setting_read_problem_print_ - extern void controller_rule_setting_read_problem_print(const fll_error_print_t print, const f_string_t message, const f_array_length_t index, const f_array_length_t line_item, controller_thread_t *thread, controller_cache_t *cache) f_attribute_visibility_internal; + extern void controller_rule_setting_read_problem_print(const fl_print_t print, const f_string_t message, const f_array_length_t index, const f_array_length_t line_item, controller_thread_t *thread, controller_cache_t *cache) f_attribute_visibility_internal; #endif // _di_controller_rule_setting_read_problem_print_ /** @@ -951,7 +951,7 @@ extern "C" { * @see controller_rule_setting_read() */ #ifndef _di_controller_rule_setting_read_problem_print_with_range_ - extern void controller_rule_setting_read_problem_print_with_range(const fll_error_print_t print, const f_string_t before, const f_string_range_t range, const f_string_t after, const f_array_length_t index, const f_array_length_t line_item, controller_thread_t *thread, controller_cache_t *cache) f_attribute_visibility_internal; + extern void controller_rule_setting_read_problem_print_with_range(const fl_print_t print, const f_string_t before, const f_string_range_t range, const f_string_t after, const f_array_length_t index, const f_array_length_t line_item, controller_thread_t *thread, controller_cache_t *cache) f_attribute_visibility_internal; #endif // _di_controller_rule_setting_read_problem_print_with_range_ /** diff --git a/level_3/fake/c/fake.h b/level_3/fake/c/fake.h index 21d971c..66840e3 100644 --- a/level_3/fake/c/fake.h +++ b/level_3/fake/c/fake.h @@ -390,8 +390,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; uint8_t operation; @@ -461,8 +461,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ 0, \ 0, \ 0, \ diff --git a/level_3/fake/c/private-common.h b/level_3/fake/c/private-common.h index 73ae703..8abe3f4 100644 --- a/level_3/fake/c/private-common.h +++ b/level_3/fake/c/private-common.h @@ -790,7 +790,7 @@ extern "C" { fake_make_parameter_t parameter; fake_make_path_t path; // @todo review this, check if path.current is used anymore. - fll_error_print_t error; + fl_print_t error; f_fss_nameds_t fakefile; @@ -806,7 +806,7 @@ extern "C" { f_string_maps_t_initialize, \ fake_make_parameter_t_initialize, \ fake_make_path_t_initialize, \ - fll_error_print_t_initialize, \ + fl_print_t_initialize, \ f_fss_nameds_t_initialize, \ f_string_dynamic_t_initialize, \ f_string_dynamic_t_initialize, \ diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index 200a1e3..ca18674 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -45,7 +45,7 @@ extern "C" { #endif // _di_fake_make_assure_inside_project_ #ifndef _di_fake_make_get_id_group_ - f_status_t fake_make_get_id_group(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, gid_t *id) { + f_status_t fake_make_get_id_group(const fake_main_t main, const fl_print_t print, const f_string_static_t buffer, gid_t *id) { const f_string_range_t range = macro_f_string_range_t_initialize(buffer.used); @@ -60,7 +60,7 @@ extern "C" { status = f_account_id_group_by_name(buffer.string, id); if (F_status_is_error(status)) { - fll_error_print(error, F_status_set_fine(status), "f_account_id_group_by_name", F_true); + fll_error_print(print, F_status_set_fine(status), "f_account_id_group_by_name", F_true); return F_status_set_error(status); } @@ -81,7 +81,7 @@ extern "C" { return F_none; } - fll_error_print(error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true); + fll_error_print(print, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true); return F_status_set_error(status); } else if (number > f_type_size_32_unsigned) { @@ -102,10 +102,10 @@ extern "C" { #endif // _di_fake_make_get_id_group_ #ifndef _di_fake_make_get_id_mode_ - f_status_t fake_make_get_id_mode(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) { + f_status_t fake_make_get_id_mode(const fake_main_t main, const fl_print_t print, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) { if (!buffer.used) { - fll_error_print(error, F_parameter, "fake_make_get_id_mode", F_true); + fll_error_print(print, F_parameter, "fake_make_get_id_mode", F_true); return F_status_set_error(F_parameter); } @@ -124,7 +124,7 @@ extern "C" { funlockfile(main.error.to.stream); } else { - fll_error_print(error, status, "f_file_mode_from_string", F_true); + fll_error_print(print, status, "f_file_mode_from_string", F_true); } } @@ -136,7 +136,7 @@ extern "C" { #endif // _di_fake_make_get_id_mode_ #ifndef _di_fake_make_get_id_owner_ - f_status_t fake_make_get_id_owner(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, uid_t *id) { + f_status_t fake_make_get_id_owner(const fake_main_t main, const fl_print_t print, const f_string_static_t buffer, uid_t *id) { const f_string_range_t range = macro_f_string_range_t_initialize(buffer.used); @@ -151,7 +151,7 @@ extern "C" { status = f_account_id_user_by_name(buffer.string, id); if (F_status_is_error(status)) { - fll_error_print(error, status, "f_account_id_user_by_name", F_true); + fll_error_print(print, status, "f_account_id_user_by_name", F_true); return F_status_set_error(status); } @@ -172,7 +172,7 @@ extern "C" { return F_none; } - fll_error_print(error, status, "fl_conversion_string_to_number_unsigned", F_true); + fll_error_print(print, status, "fl_conversion_string_to_number_unsigned", F_true); return F_status_set_error(status); } else if (number > f_type_size_32_unsigned) { @@ -1159,7 +1159,7 @@ extern "C" { if (F_status_is_error(status)) { macro_fake_make_data_t_delete_simple(data_make); - // signal is set with error code only to prevent further execution above, return without the error bit set. + // signal is set with print code only to prevent further execution above, return without the print bit set. if (F_status_set_fine(status) == F_signal) { return F_signal; } @@ -1168,22 +1168,29 @@ extern "C" { } if (data_make.setting_make.fail == fake_make_operation_fail_type_exit) { - data_make.error.prefix = fll_error_print_error_s; + data_make.error.prefix = fl_print_error_s; + data_make.error.suffix = 0; data_make.error.context = main->context.set.error; data_make.error.notable = main->context.set.notable; data_make.error.to.stream = f_type_error; data_make.error.to.id = f_type_descriptor_error; + data_make.error.set = &main->context.set; } else if (data_make.setting_make.fail == fake_make_operation_fail_type_warn) { - data_make.error.prefix = fll_error_print_warning_s; + data_make.error.prefix = fl_print_warning_s; + data_make.error.suffix = 0; data_make.error.context = main->context.set.warning; data_make.error.notable = main->context.set.notable; data_make.error.to.stream = f_type_warning; data_make.error.to.id = f_type_descriptor_warning; + data_make.error.set = &main->context.set; } else { data_make.error.to.stream = 0; + data_make.error.prefix = 0; + data_make.error.suffix = 0; data_make.error.to.id = -1; + data_make.error.set = &main->context.set; } { @@ -2250,11 +2257,13 @@ extern "C" { // break acts identical to fail when at the top of the stack. if (F_status_set_fine(*status) == F_signal_abort && !section_stack->used) { data_make->setting_make.fail = fake_make_operation_fail_type_exit; - data_make->error.prefix = fll_error_print_error; + data_make->error.prefix = fl_print_error_s; + data_make->error.suffix = 0; data_make->error.context = main->context.set.error; data_make->error.notable = main->context.set.notable; data_make->error.to.stream = f_type_error; data_make->error.to.id = f_type_descriptor_error; + data_make->error.set = &main->context.set; } fake_print_message_section_operation_failed(*main, data_make->error, data_make->buffer, section->name, section->objects.array[i]); @@ -2735,11 +2744,13 @@ extern "C" { // forcing exit forces fail mode. data_make->setting_make.fail = fake_make_operation_fail_type_exit; - data_make->error.prefix = fll_error_print_error; + data_make->error.prefix = fl_print_error_s; + data_make->error.suffix = 0; data_make->error.context = main->context.set.error; data_make->error.notable = main->context.set.notable; data_make->error.to.stream = f_type_error; data_make->error.to.id = f_type_descriptor_error; + data_make->error.set = &main->context.set; } else { return 0; @@ -2756,19 +2767,23 @@ extern "C" { if (fl_string_dynamic_compare_string(fake_make_operation_argument_exit, arguments.array[0], fake_make_operation_argument_exit_length) == F_equal_to) { data_make->setting_make.fail = fake_make_operation_fail_type_exit; - data_make->error.prefix = fll_error_print_error; + data_make->error.prefix = fl_print_error_s; + data_make->error.suffix = 0; data_make->error.context = main->context.set.error; data_make->error.notable = main->context.set.notable; data_make->error.to.stream = f_type_error; data_make->error.to.id = f_type_descriptor_error; + data_make->error.set = &main->context.set; } else if (fl_string_dynamic_compare_string(fake_make_operation_argument_warn, arguments.array[0], fake_make_operation_argument_warn_length) == F_equal_to) { data_make->setting_make.fail = fake_make_operation_fail_type_warn; - data_make->error.prefix = fll_error_print_warning; + data_make->error.prefix = fl_print_warning_s; + data_make->error.suffix = 0; data_make->error.context = main->context.set.warning; data_make->error.notable = main->context.set.notable; data_make->error.to.stream = f_type_warning; data_make->error.to.id = f_type_descriptor_warning; + data_make->error.set = &main->context.set; } else if (fl_string_dynamic_compare_string(fake_make_operation_argument_ignore, arguments.array[0], fake_make_operation_argument_ignore_length) == F_equal_to) { data_make->setting_make.fail = fake_make_operation_fail_type_ignore; diff --git a/level_3/fake/c/private-make.h b/level_3/fake/c/private-make.h index 0cbd5f6..091cead 100644 --- a/level_3/fake/c/private-make.h +++ b/level_3/fake/c/private-make.h @@ -38,7 +38,7 @@ extern "C" { * * @param main * The main data. - * @param error + * @param print * The error/warning print data. * @param buffer * The string containing the name or number. @@ -52,7 +52,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_get_id_group_ - f_status_t fake_make_get_id_group(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, gid_t *id) f_attribute_visibility_internal; + f_status_t fake_make_get_id_group(const fake_main_t main, const fl_print_t print, const f_string_static_t buffer, gid_t *id) f_attribute_visibility_internal; #endif // _di_fake_make_get_id_group_ /** @@ -60,7 +60,7 @@ extern "C" { * * @param main * The main data. - * @param error + * @param print * The error/warning print data. * @param buffer * The string containing the name or number. @@ -78,7 +78,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_get_id_mode_ - f_status_t fake_make_get_id_mode(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) f_attribute_visibility_internal; + f_status_t fake_make_get_id_mode(const fake_main_t main, const fl_print_t print, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) f_attribute_visibility_internal; #endif // _di_fake_make_get_id_mode_ /** @@ -86,7 +86,7 @@ extern "C" { * * @param main * The main data. - * @param error + * @param print * The error/warning print data. * @param buffer * The string containing the name or number. @@ -100,7 +100,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_get_id_owner_ - f_status_t fake_make_get_id_owner(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, uid_t *id) f_attribute_visibility_internal; + f_status_t fake_make_get_id_owner(const fake_main_t main, const fl_print_t print, const f_string_static_t buffer, uid_t *id) f_attribute_visibility_internal; #endif // _di_fake_make_get_id_owner_ /** diff --git a/level_3/fake/c/private-print.c b/level_3/fake/c/private-print.c index 87711f2..c5b1b28 100644 --- a/level_3/fake/c/private-print.c +++ b/level_3/fake/c/private-print.c @@ -357,9 +357,9 @@ extern "C" { #endif // _di_fake_print_error_parameter_too_many_ #ifndef _di_fake_print_message_section_operation_failed_ - void fake_print_message_section_operation_failed(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) { + void fake_print_message_section_operation_failed(const fake_main_t main, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) { - if (main.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return; + if (main.error.verbosity == f_console_verbosity_quiet || !print.to.stream) return; f_array_length_t line = 1; @@ -380,9 +380,9 @@ extern "C" { #endif // _di_fake_print_message_section_operation_failed_ #ifndef _di_fake_print_message_section_operation_path_outside_ - void fake_print_message_section_operation_path_outside(const fake_main_t main, const fll_error_print_t error, const f_status_t status, const f_string_t function, const f_string_t path) { + void fake_print_message_section_operation_path_outside(const fake_main_t main, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_t path) { - if (main.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return; + if (main.error.verbosity == f_console_verbosity_quiet || !print.to.stream) return; flockfile(main.error.to.stream); @@ -400,9 +400,9 @@ extern "C" { #endif // _di_fake_print_message_section_operation_path_outside_ #ifndef _di_fake_print_message_section_operation_path_stack_max_ - void fake_print_message_section_operation_path_stack_max(const fake_main_t main, fll_error_print_t error, const f_status_t status, const f_string_t function, const f_string_t path) { + void fake_print_message_section_operation_path_stack_max(const fake_main_t main, fl_print_t print, const f_status_t status, const f_string_t function, const f_string_t path) { - if (main.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return; + if (main.error.verbosity == f_console_verbosity_quiet || !print.to.stream) return; if (status == F_array_too_large) { flockfile(main.error.to.stream); @@ -421,15 +421,15 @@ extern "C" { funlockfile(main.error.to.stream); } else { - fll_error_file_print(error, status, function, F_true, path, "change path to", fll_error_file_type_directory); + fll_error_file_print(print, status, function, F_true, path, "change path to", fll_error_file_type_directory); } } #endif // _di_fake_print_message_section_operation_path_stack_max_ #ifndef _di_fake_print_message_section_operation_stack_max_ - void fake_print_message_section_operation_stack_max(const fake_main_t main, fll_error_print_t error, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max) { + void fake_print_message_section_operation_stack_max(const fake_main_t main, fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max) { - if (main.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return; + if (main.error.verbosity == f_console_verbosity_quiet || !print.to.stream) return; f_array_length_t line = 1; @@ -452,9 +452,9 @@ extern "C" { #endif // _di_fake_print_message_section_operation_stack_max_ #ifndef _di_fake_print_message_section_operation_unknown_ - void fake_print_message_section_operation_unknown(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) { + void fake_print_message_section_operation_unknown(const fake_main_t main, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) { - if (main.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return; + if (main.error.verbosity == f_console_verbosity_quiet || !print.to.stream) return; f_array_length_t line = 1; diff --git a/level_3/fake/c/private-print.h b/level_3/fake/c/private-print.h index 15321a7..fe22f2b 100644 --- a/level_3/fake/c/private-print.h +++ b/level_3/fake/c/private-print.h @@ -97,7 +97,7 @@ extern "C" { * * @param main * The main data. - * @param error + * @param print * Designates how the section error/warning should be printed. * @param buffer * The buffer containing the fakefile data. @@ -107,7 +107,7 @@ extern "C" { * The range within the buffer representing the operation name within the section. */ #ifndef _di_fake_print_message_section_operation_failed_ - extern void fake_print_message_section_operation_failed(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) f_attribute_visibility_internal; + extern void fake_print_message_section_operation_failed(const fake_main_t main, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) f_attribute_visibility_internal; #endif // _di_fake_print_message_section_operation_failed_ /** @@ -115,7 +115,7 @@ extern "C" { * * @param main * The main data. - * @param error + * @param print * Designates how the section error/warning should be printed. * @param status * The status code representing an error. @@ -125,7 +125,7 @@ extern "C" { * The path that is outside of the project path. */ #ifndef _di_fake_print_message_section_operation_path_outside_ - extern void fake_print_message_section_operation_path_outside(const fake_main_t main, const fll_error_print_t error, const f_status_t status, const f_string_t function, const f_string_t path) f_attribute_visibility_internal; + extern void fake_print_message_section_operation_path_outside(const fake_main_t main, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_t path) f_attribute_visibility_internal; #endif // _fake_print_message_section_operation_path_outside_ /** @@ -144,7 +144,7 @@ extern "C" { * The path to the directory. */ #ifndef _di_fake_print_message_section_operation_path_stack_max_ - extern void fake_print_message_section_operation_path_stack_max(const fake_main_t main, fll_error_print_t error, const f_status_t status, const f_string_t function, const f_string_t path) f_attribute_visibility_internal; + extern void fake_print_message_section_operation_path_stack_max(const fake_main_t main, fl_print_t error, const f_status_t status, const f_string_t function, const f_string_t path) f_attribute_visibility_internal; #endif // _di_fake_print_message_section_operation_path_stack_max_ /** @@ -152,7 +152,7 @@ extern "C" { * * @param main * The main data. - * @param error + * @param print * Designates how the section error/warning should be printed. * @param buffer * The buffer containing the fakefile data. @@ -164,7 +164,7 @@ extern "C" { * The max stack depth. */ #ifndef _di_fake_print_message_section_operation_stack_max_ - extern void fake_print_message_section_operation_stack_max(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max) f_attribute_visibility_internal; + extern void fake_print_message_section_operation_stack_max(const fake_main_t main, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max) f_attribute_visibility_internal; #endif // _di_fake_print_message_section_operation_stack_max_ /** @@ -172,7 +172,7 @@ extern "C" { * * @param main * The main data. - * @param error + * @param print * Designates how the section error/warning should be printed. * @param buffer * The buffer containing the fakefile data. @@ -182,7 +182,7 @@ extern "C" { * The range within the buffer representing the operation name within the section. */ #ifndef _di_fake_print_message_section_operation_unknown_ - extern void fake_print_message_section_operation_unknown(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) f_attribute_visibility_internal; + extern void fake_print_message_section_operation_unknown(const fake_main_t main, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) f_attribute_visibility_internal; #endif // _di_fake_print_message_section_operation_unknown_ /** diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index 36e3f10..65e23ec 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -282,8 +282,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_string_dynamics_t chains; f_string_dynamics_t devices; @@ -297,8 +297,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_string_dynamics_t_initialize, \ f_string_dynamics_t_initialize, \ f_color_context_t_initialize, \ diff --git a/level_3/firewall/c/private-common.c b/level_3/firewall/c/private-common.c index 062c6c8..1104364 100644 --- a/level_3/firewall/c/private-common.c +++ b/level_3/firewall/c/private-common.c @@ -5,7 +5,7 @@ extern "C" { #endif -void firewall_print_debug_tool(const fll_error_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) { +void firewall_print_debug_tool(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) { if (output.verbosity != f_console_verbosity_debug) return; @@ -22,28 +22,28 @@ void firewall_print_debug_tool(const fll_error_print_t output, const f_string_t funlockfile(output.to.stream); } -void firewall_print_error_on_allocation_failure(const fll_error_print_t output) { +void firewall_print_error_on_allocation_failure(const fl_print_t output) { if (output.verbosity == f_console_verbosity_quiet) return; fll_print_format("%c%[%sUnable to allocate memory.%]%c", output.to.stream, f_string_eol_s[0], output.context, output.prefix, output.context, f_string_eol_s[0]); } -void firewall_print_error_on_invalid_parameter(const fll_error_print_t output, const f_string_t function) { +void firewall_print_error_on_invalid_parameter(const fl_print_t output, const f_string_t function) { if (output.verbosity == f_console_verbosity_quiet) return; fll_print_format("%c%[%sInvalid parameter when calling %S().%]%c", output.to.stream, f_string_eol_s[0], output.context, output.prefix, function, output.context, f_string_eol_s[0]); } -void firewall_print_error_on_invalid_parameter_for_file(const fll_error_print_t output, const f_string_t function, const f_string_t filename) { +void firewall_print_error_on_invalid_parameter_for_file(const fl_print_t output, const f_string_t function, const f_string_t filename) { if (output.verbosity == f_console_verbosity_quiet) return; fll_print_format("%c%[%sInvalid parameter when calling %S() for the file '%S'.%]%c", output.to.stream, f_string_eol_s[0], output.context, output.prefix, function, filename, output.context, f_string_eol_s[0]); } -void firewall_print_error_on_operation(const fll_error_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) { +void firewall_print_error_on_operation(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) { if (output.verbosity == f_console_verbosity_quiet) return; @@ -61,14 +61,14 @@ void firewall_print_error_on_operation(const fll_error_print_t output, const f_s funlockfile(output.to.stream); } -void firewall_print_error_on_unhandled(const fll_error_print_t output, const f_string_t function, const f_status_t status) { +void firewall_print_error_on_unhandled(const fl_print_t output, const f_string_t function, const f_status_t status) { if (output.verbosity == f_console_verbosity_quiet) return; fll_print_format("%c%[%sAn unhandled error (%ui) has occurred while calling %S().%]%c", output.to.stream, f_string_eol_s[0], output.context, output.prefix, status, function, output.context, f_string_eol_s[0]); } -void firewall_print_error_on_unhandled_for_file(const fll_error_print_t output, const f_string_t function, const f_status_t status, const f_string_t filename) { +void firewall_print_error_on_unhandled_for_file(const fl_print_t output, const f_string_t function, const f_status_t status, const f_string_t filename) { if (output.verbosity == f_console_verbosity_quiet) return; diff --git a/level_3/firewall/c/private-common.h b/level_3/firewall/c/private-common.h index 7f2437c..224b9fd 100644 --- a/level_3/firewall/c/private-common.h +++ b/level_3/firewall/c/private-common.h @@ -108,7 +108,7 @@ typedef struct { * @param arguments * The arguments passed to the tool. */ -extern void firewall_print_debug_tool(const fll_error_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) f_attribute_visibility_internal; +extern void firewall_print_debug_tool(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) f_attribute_visibility_internal; /** * Print an memory allocation error. @@ -116,7 +116,7 @@ extern void firewall_print_debug_tool(const fll_error_print_t output, const f_st * @param output * The output to print to. */ -extern void firewall_print_error_on_allocation_failure(const fll_error_print_t output) f_attribute_visibility_internal; +extern void firewall_print_error_on_allocation_failure(const fl_print_t output) f_attribute_visibility_internal; /** * Print an invalid parameter error for the given function. @@ -126,7 +126,7 @@ extern void firewall_print_error_on_allocation_failure(const fll_error_print_t o * @param function * The function that failed. */ -extern void firewall_print_error_on_invalid_parameter(const fll_error_print_t output, const f_string_t function) f_attribute_visibility_internal; +extern void firewall_print_error_on_invalid_parameter(const fl_print_t output, const f_string_t function) f_attribute_visibility_internal; /** * Print an invalid parameter error for the given function. @@ -138,7 +138,7 @@ extern void firewall_print_error_on_invalid_parameter(const fll_error_print_t ou * @param filename * The name of the file. */ -extern void firewall_print_error_on_invalid_parameter_for_file(const fll_error_print_t output, const f_string_t function, const f_string_t filename) f_attribute_visibility_internal; +extern void firewall_print_error_on_invalid_parameter_for_file(const fl_print_t output, const f_string_t function, const f_string_t filename) f_attribute_visibility_internal; /** * Print an error about the given operation failed. @@ -150,7 +150,7 @@ extern void firewall_print_error_on_invalid_parameter_for_file(const fll_error_p * @param arguments * The arguments passed to the tool. */ -extern void firewall_print_error_on_operation(const fll_error_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) f_attribute_visibility_internal; +extern void firewall_print_error_on_operation(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) f_attribute_visibility_internal; /** * Print an unhandled error for the given function. @@ -162,7 +162,7 @@ extern void firewall_print_error_on_operation(const fll_error_print_t output, co * @param status * The failure status code. */ -extern void firewall_print_error_on_unhandled(const fll_error_print_t output, const f_string_t function, const f_status_t status) f_attribute_visibility_internal; +extern void firewall_print_error_on_unhandled(const fl_print_t output, const f_string_t function, const f_status_t status) f_attribute_visibility_internal; /** * Print an unhandled error for the given function for some given file. @@ -176,7 +176,7 @@ extern void firewall_print_error_on_unhandled(const fll_error_print_t output, co * @param filename * The name of the file. */ -extern void firewall_print_error_on_unhandled_for_file(const fll_error_print_t output, const f_string_t function, const f_status_t status, const f_string_t filename) f_attribute_visibility_internal; +extern void firewall_print_error_on_unhandled_for_file(const fl_print_t output, const f_string_t function, const f_status_t status, const f_string_t filename) f_attribute_visibility_internal; #ifdef __cplusplus } // extern "C" 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 79b4125..d1738c0 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 @@ -210,8 +210,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_color_context_t context; } fss_basic_list_read_main_t; @@ -222,8 +222,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } #endif // _di_fss_basic_list_read_main_t_ diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.h b/level_3/fss_basic_list_write/c/fss_basic_list_write.h index efe812d..71cb190 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.h +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.h @@ -145,8 +145,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_string_static_t prepend; f_color_context_t context; @@ -158,8 +158,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_string_static_t_initialize, \ f_color_context_t_initialize, \ } 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 9a808a4..a03835c 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -210,8 +210,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_color_context_t context; } fss_basic_read_main_t; @@ -222,8 +222,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } #endif // _di_fss_basic_read_main_t_ diff --git a/level_3/fss_basic_write/c/fss_basic_write.h b/level_3/fss_basic_write/c/fss_basic_write.h index 9b0edca..0cda402 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.h +++ b/level_3/fss_basic_write/c/fss_basic_write.h @@ -146,8 +146,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_color_context_t context; } fss_basic_write_main_t; @@ -158,8 +158,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } #endif // _di_fss_basic_write_data_ diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h index f885347..e682cd9 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h @@ -191,8 +191,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_string_dynamic_t buffer; f_fss_nest_t nest; @@ -210,8 +210,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_string_dynamic_t_initialize, \ f_fss_nest_t_initialize, \ f_string_quantity_t_initialize, \ diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h index 820107a..1c8a16f 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h @@ -146,8 +146,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_string_static_t prepend; f_color_context_t context; @@ -159,8 +159,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_string_static_t_initialize, \ f_color_context_t_initialize, \ } 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 210bf79..da5858a 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 @@ -210,8 +210,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_color_context_t context; } fss_extended_list_read_main_t; @@ -222,8 +222,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } #endif // _di_fss_extended_list_read_main_t_ diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.h b/level_3/fss_extended_list_write/c/fss_extended_list_write.h index 7ac0fd0..2d0c913 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.h +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.h @@ -146,8 +146,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_string_static_t prepend; @@ -160,8 +160,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_string_static_t_initialize, \ f_color_context_t_initialize, \ } 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 1312daa..deb5132 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -211,8 +211,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_color_context_t context; } fss_extended_read_main_t; @@ -223,8 +223,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } #endif // _di_fss_extended_read_main_t_ diff --git a/level_3/fss_extended_write/c/fss_extended_write.h b/level_3/fss_extended_write/c/fss_extended_write.h index 3037c35..df9c47d 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.h +++ b/level_3/fss_extended_write/c/fss_extended_write.h @@ -145,8 +145,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_string_static_t prepend; f_color_context_t context; @@ -158,8 +158,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_string_static_t_initialize, \ f_color_context_t_initialize, \ } diff --git a/level_3/fss_identify/c/fss_identify.h b/level_3/fss_identify/c/fss_identify.h index b6791ba..ecf227e 100644 --- a/level_3/fss_identify/c/fss_identify.h +++ b/level_3/fss_identify/c/fss_identify.h @@ -129,8 +129,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_color_context_t context; } fss_identify_main_t; @@ -141,8 +141,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } #endif // _di_fss_identify_data_t_ diff --git a/level_3/fss_status_code/c/fss_status_code.h b/level_3/fss_status_code/c/fss_status_code.h index f0569c2..abe0f6f 100644 --- a/level_3/fss_status_code/c/fss_status_code.h +++ b/level_3/fss_status_code/c/fss_status_code.h @@ -122,8 +122,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_color_context_t context; } fss_status_code_main_t; @@ -134,8 +134,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } #endif // _di_fss_status_code_main_t_ diff --git a/level_3/iki_read/c/iki_read.h b/level_3/iki_read/c/iki_read.h index 9e90d48..8530a85 100644 --- a/level_3/iki_read/c/iki_read.h +++ b/level_3/iki_read/c/iki_read.h @@ -199,8 +199,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; uint8_t mode; @@ -220,8 +220,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ 0, \ 0, \ 0, \ diff --git a/level_3/iki_write/c/iki_write.h b/level_3/iki_write/c/iki_write.h index e827d30..a89ba7b 100644 --- a/level_3/iki_write/c/iki_write.h +++ b/level_3/iki_write/c/iki_write.h @@ -134,8 +134,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_string_dynamic_t buffer; @@ -148,8 +148,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_string_dynamic_t_initialize, \ f_color_context_t_initialize, \ } diff --git a/level_3/status_code/c/status_code.h b/level_3/status_code/c/status_code.h index 38d09aa..04ddc42 100644 --- a/level_3/status_code/c/status_code.h +++ b/level_3/status_code/c/status_code.h @@ -121,8 +121,8 @@ extern "C" { bool process_pipe; f_file_t output; - fll_error_print_t error; - fll_error_print_t warning; + fl_print_t error; + fl_print_t warning; f_color_context_t context; } status_code_main_t; @@ -133,8 +133,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ - fll_error_print_t_initialize, \ - macro_fll_error_print_t_initialize_warning(), \ + fl_print_t_initialize, \ + macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } #endif // _di_status_code_main_t_ -- 1.8.3.1