]> Kevux Git Server - kevux-tools/commitdiff
Update: Error printing functions.
authorKevin Day <Kevin@kevux.org>
Wed, 26 Nov 2025 04:23:59 +0000 (22:23 -0600)
committerKevin Day <Kevin@kevux.org>
Wed, 26 Nov 2025 04:23:59 +0000 (22:23 -0600)
Use `debug` instead of `function`.

Ensure that the status code printed has the error bit removed.

sources/c/program/kevux/tools/tacocat/main/print/error.c
sources/c/program/kevux/tools/tacocat/main/print/error.h

index 807543a2b1b2b9c22d796ca748c3071d6ea986fe..14f9d59970bc1e04bd3f414b60fe0788c63e3529 100644 (file)
@@ -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);
index 6547a9427faad0d94963342d95b29cb5f24e9166..368b428975ceac614387f770a88a19b44669b200 100644 (file)
@@ -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