From 7438f4d28ccbb3b5ac838084dcf18b28a528f681 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 25 Nov 2025 22:23:59 -0600 Subject: [PATCH] Update: Error printing functions. Use `debug` instead of `function`. Ensure that the status code printed has the error bit removed. --- .../program/kevux/tools/tacocat/main/print/error.c | 26 +++++++------- .../program/kevux/tools/tacocat/main/print/error.h | 41 ++++++++++++---------- 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/sources/c/program/kevux/tools/tacocat/main/print/error.c b/sources/c/program/kevux/tools/tacocat/main/print/error.c index 807543a..14f9d59 100644 --- a/sources/c/program/kevux/tools/tacocat/main/print/error.c +++ b/sources/c/program/kevux/tools/tacocat/main/print/error.c @@ -5,43 +5,43 @@ extern "C" { #endif #ifndef _di_kt_tacocat_print_error_ - f_status_t kt_tacocat_print_error(fl_print_t * const print, const f_string_t function) { + f_status_t kt_tacocat_print_error(fl_print_t * const print, const f_string_t debug) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; - fll_error_print(print, F_status_set_fine(((kt_tacocat_main_t *) print->custom)->setting.state.status), function, F_true); + fll_error_print(print, F_status_set_fine(((kt_tacocat_main_t *) print->custom)->setting.state.status), debug, F_true); return F_okay; } #endif // _di_kt_tacocat_print_error_ #ifndef _di_kt_tacocat_print_error_status_ - f_status_t kt_tacocat_print_error_status(fl_print_t * const print, const f_string_t function, const f_status_t status) { + f_status_t kt_tacocat_print_error_status(fl_print_t * const print, const f_string_t debug, const f_status_t status) { if (!print) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; - fll_error_print(print, F_status_set_fine(status), function, F_true); + fll_error_print(print, F_status_set_fine(status), debug, F_true); return F_okay; } #endif // _di_kt_tacocat_print_error_status_ #ifndef _di_kt_tacocat_print_error_file_ - f_status_t kt_tacocat_print_error_file(fl_print_t * const print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { + f_status_t kt_tacocat_print_error_file(fl_print_t * const print, const f_string_t debug, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; - fll_error_file_print(print, F_status_set_fine(((kt_tacocat_main_t *) print->custom)->setting.state.status), function, F_true, name, operation, type); + fll_error_file_print(print, F_status_set_fine(((kt_tacocat_main_t *) print->custom)->setting.state.status), debug, F_true, name, operation, type); return F_okay; } #endif // _di_kt_tacocat_print_error_file_ #ifndef _di_kt_tacocat_print_error_on_ - f_status_t kt_tacocat_print_error_on(fl_print_t * const print, const f_string_t function, const f_string_static_t on, const f_string_static_t network, const f_status_t status, const f_string_static_t name) { + f_status_t kt_tacocat_print_error_on(fl_print_t * const print, const f_string_t debug, const f_string_static_t on, const f_string_static_t network, const f_status_t status, const f_string_static_t name) { if (!print) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -58,7 +58,7 @@ extern "C" { f_file_stream_unlock(print->to); - fll_error_print(print, F_status_set_fine(status), function, F_true); + fll_error_print(print, F_status_set_fine(status), debug, F_true); return F_okay; } @@ -111,7 +111,7 @@ extern "C" { #endif // _di_kt_tacocat_print_error_on_busy_ #ifndef _di_kt_tacocat_print_error_on_file_receive_ - f_status_t kt_tacocat_print_error_on_file_receive(fl_print_t * const print, const f_string_t function, const f_string_static_t on, const f_string_static_t network, const f_status_t status, const f_string_static_t name, const f_string_static_t operation) { + f_status_t kt_tacocat_print_error_on_file_receive(fl_print_t * const print, const f_string_t debug, const f_string_static_t on, const f_string_static_t network, const f_status_t status, const f_string_static_t name, const f_string_static_t operation) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -128,12 +128,12 @@ extern "C" { f_file_stream_unlock(print->to); - fll_error_file_print(print, F_status_set_fine(((kt_tacocat_main_t *) print->custom)->setting.state.status), function, F_true, name, operation, fll_error_file_type_file_e); + fll_error_file_print(print, F_status_set_fine(((kt_tacocat_main_t *) print->custom)->setting.state.status), debug, F_true, name, operation, fll_error_file_type_file_e); } #endif // _di_kt_tacocat_print_error_on_file_receive_ #ifndef _di_kt_tacocat_print_error_on_file_send_ - f_status_t kt_tacocat_print_error_on_file_send(fl_print_t * const print, const f_string_t function, const f_string_static_t on, const f_string_static_t network, const f_status_t status, const f_string_static_t name, const f_string_static_t operation) { + f_status_t kt_tacocat_print_error_on_file_send(fl_print_t * const print, const f_string_t debug, const f_string_static_t on, const f_string_static_t network, const f_status_t status, const f_string_static_t name, const f_string_static_t operation) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -150,7 +150,7 @@ extern "C" { f_file_stream_unlock(print->to); - fll_error_file_print(print, F_status_set_fine(((kt_tacocat_main_t *) print->custom)->setting.state.status), function, F_true, name, operation, fll_error_file_type_file_e); + fll_error_file_print(print, F_status_set_fine(((kt_tacocat_main_t *) print->custom)->setting.state.status), debug, F_true, name, operation, fll_error_file_type_file_e); } #endif // _di_kt_tacocat_print_error_on_file_send_ @@ -173,7 +173,7 @@ extern "C" { fl_print_format("%[' and Content '%]", print->to, print->set->error, print->set->error, f_string_eol_s); fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->set->notable, buffer, content, print->set->notable); fl_print_format("%[' with a status code of %]", print->to, print->set->error, print->set->error, f_string_eol_s); - fl_print_format(f_string_format_ul_single_s.string, print->to, print->set->notable, status, print->set->notable); + fl_print_format(f_string_format_ul_single_s.string, print->to, print->set->notable, F_status_set_fine(status), print->set->notable); fl_print_format(f_string_format_sentence_end_s.string, print->to, print->set->error, print->set->error, f_string_eol_s); f_file_stream_unlock(print->to); diff --git a/sources/c/program/kevux/tools/tacocat/main/print/error.h b/sources/c/program/kevux/tools/tacocat/main/print/error.h index 6547a94..368b428 100644 --- a/sources/c/program/kevux/tools/tacocat/main/print/error.h +++ b/sources/c/program/kevux/tools/tacocat/main/print/error.h @@ -17,7 +17,7 @@ extern "C" { #endif /** - * Print generic error message regarding a function failing in some way. + * Print generic error message regarding some failure. * * @param print * The output structure to print to. @@ -27,8 +27,10 @@ extern "C" { * Must not be NULL. * * This does not alter print.custom.setting.state.status. - * @param function - * A string representing the function that has an error. + * @param debug + * (optional) The debug details, such as file, line number, and function. + * + * Set to NULL to disable. * * @return * F_okay on success. @@ -39,7 +41,7 @@ extern "C" { * @see fll_error_print() */ #ifndef _di_kt_tacocat_print_error_ - extern f_status_t kt_tacocat_print_error(fl_print_t * const print, const f_string_t function); + extern f_status_t kt_tacocat_print_error(fl_print_t * const print, const f_string_t debug); #endif // _di_kt_tacocat_print_error_ /** @@ -51,8 +53,10 @@ extern "C" { * Must not be NULL. * * This does not alter print.custom.setting.state.status. - * @param function - * A string representing the function that has an error. + * @param debug + * (optional) The debug details, such as file, line number, and function. + * + * Set to NULL to disable. * @param status * The status code representing the error being reported. * @@ -79,9 +83,10 @@ extern "C" { * Must not be NULL. * * This does not alter print.custom.setting.state.status. - * @param function - * The name of the function where the error happened. - * Set to 0 to disable. + * @param debug + * (optional) The debug details, such as file, line number, and function. + * + * Set to NULL to disable. * @param name * The name of the file or directory. * @param operation @@ -110,10 +115,10 @@ extern "C" { * Must not be NULL. * * This does not alter print.custom.setting.state.status. - * @param function - * (optional) The name of the function where the error happened. + * @param debug + * (optional) The debug details, such as file, line number, and function. * - * Set to 0 to disable. + * Set to NULL to disable. * @param on * The network connection direction, which should either be "receive" or "send". * @param network @@ -200,10 +205,10 @@ extern "C" { * Must not be NULL. * * This does not alter print.custom.setting.state.status. - * @param function - * (optional) The name of the function where the error happened. + * @param debug + * (optional) The debug details, such as file, line number, and function. * - * Set to 0 to disable. + * Set to NULL to disable. * @param on * The network connection direction, which should either be "receive" or "send". * @param network @@ -236,10 +241,10 @@ extern "C" { * Must not be NULL. * * This does not alter print.custom.setting.state.status. - * @param function - * (optional) The name of the function where the error happened. + * @param debug + * (optional) The debug details, such as file, line number, and function. * - * Set to 0 to disable. + * Set to NULL to disable. * @param on * The network connection direction, which should either be "receive" or "send". * @param network -- 1.8.3.1