]> Kevux Git Server - controller/commitdiff
Update: Minimal changes to compile with the error printing changes in FLL.
authorKevin Day <Kevin@kevux.org>
Tue, 11 Nov 2025 03:23:59 +0000 (21:23 -0600)
committerKevin Day <Kevin@kevux.org>
Tue, 11 Nov 2025 03:23:59 +0000 (21:23 -0600)
This functionality originated here, but there will still need to be changes in the follow up commit.

data/build/stand_alone/config.h
sources/c/program/controller/main/print/debug/perform/pid.c
sources/c/program/controller/main/print/debug/perform/pid.h
sources/c/program/controller/main/print/error.c
sources/c/program/controller/main/print/error.h
sources/c/program/controller/main/print/error/entry.c
sources/c/program/controller/main/print/error/entry.h
sources/c/program/controller/main/print/error/perform/pid.c
sources/c/program/controller/main/print/error/perform/pid.h
sources/c/program/controller/main/print/error/rule.c
sources/c/program/controller/main/print/error/rule.h

index eec26fc..4c111c2 100644 (file)
 #define _di_f_string_format_Z_s_
 #define _di_f_string_format_Z_single_s_
 //#define _di_f_string_format_bracket_close_s_
-#define _di_f_string_format_bracket_open_s_
+//#define _di_f_string_format_bracket_open_s_
 #define _di_f_string_format_c_s_
 #define _di_f_string_format_d_double_s_
 #define _di_f_string_format_d_s_
 #define _di_f_string_format_s_double_s_
 #define _di_f_string_format_s_s_
 #define _di_f_string_format_s_single_s_
+#define _di_f_string_format_sentence_end_basic_s_
+#define _di_f_string_format_sentence_end_double_basic_s_
 #define _di_f_string_format_sentence_end_double_quote_s_
+#define _di_f_string_format_sentence_end_double_quote_basic_s_
 #define _di_f_string_format_sentence_end_double_s_
 //#define _di_f_string_format_sentence_end_quote_s_
 //#define _di_f_string_format_sentence_end_s_
+//#define _di_f_string_format_sentence_end_single_basic_s_
 //#define _di_f_string_format_sentence_end_single_quote_s_
+#define _di_f_string_format_sentence_end_single_quote_basic_s_
 //#define _di_f_string_format_sentence_end_single_s_
 #define _di_f_string_format_ss_double_s_
 #define _di_f_string_format_ss_single_s_
 //#define _di_fll_error_file_type_socket_s_
 #define _di_fll_error_parameter_integer_print_
 //#define _di_fll_error_print_
+#define _di_fll_error_print_debug_
 //#define _di_fll_error_s_a_
 //#define _di_fll_error_s_e_
 #define _di_fll_execute_arguments_add_
index 8ccff95..1bfce55 100644 (file)
@@ -30,7 +30,7 @@ extern "C" {
 #endif // _di_controller_print_debug_perform_pid_file_control_socket_
 
 #ifndef _di_controller_print_debug_perform_pid_file_create_problem_
-  f_status_t controller_print_debug_perform_pid_file_create_problem(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t is_entry) {
+  f_status_t controller_print_debug_perform_pid_file_create_problem(fl_print_t * const print, const f_status_t status, const f_string_t debug, const uint8_t is_entry) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
     if (print->verbosity < f_console_verbosity_debug_e) return F_output_not;
@@ -45,7 +45,7 @@ extern "C" {
       fl_print_format("%[' could not be written because the destination is read only.%]%r", print->to, print->context, print->context, f_string_eol_s);
     }
     else {
-      controller_print_error_file_status(print, function, main->process.path_pid, f_file_operation_create_s, fll_error_file_type_file_e, status);
+      controller_print_error_file_status(print, debug, main->process.path_pid, f_file_operation_create_s, fll_error_file_type_file_e, status);
     }
 
     f_file_stream_lock(print->to);
index 455ee87..df0d016 100644 (file)
@@ -48,8 +48,10 @@ extern "C" {
  * @param status
  *   The status code to process.
  *   Make sure this has F_status_set_fine() called if the status code has any error or warning bits.
- * @param function
- *   The name of the function associated with the error.
+ * @param debug
+ *   (optional) The debug details, such as file, line number, and function.
+ *
+ *   Set to NULL to disable.
  * @param is_entry
  *   If TRUE, then this operates as an Entry.
  *   If FALSE, then this operates as an Exit.
index 1a2a28c..424a612 100644 (file)
@@ -5,7 +5,7 @@ extern "C" {
 #endif
 
 #ifndef _di_controller_print_error_
-  f_status_t controller_print_error(fl_print_t * const print, const f_string_t function) {
+  f_status_t controller_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;
@@ -14,7 +14,7 @@ extern "C" {
 
     f_thread_mutex_lock(&main->thread.lock.print.mutex);
 
-    fll_error_print(print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_fallback_e);
+    fll_error_print(print, F_status_set_fine(main->setting.state.status), debug, fll_error_file_flag_fallback_e);
 
     f_thread_mutex_unlock(&main->thread.lock.print.mutex);
 
@@ -41,7 +41,7 @@ extern "C" {
 #endif // _di_controller_print_error_failsafe_item_
 
 #ifndef _di_controller_print_error_file_
-  f_status_t controller_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 controller_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_quiet_e) return F_output_not;
@@ -50,7 +50,7 @@ extern "C" {
 
     f_thread_mutex_lock(&main->thread.lock.print.mutex);
 
-    fll_error_file_print(print, F_status_set_fine(main->setting.state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
+    fll_error_file_print(print, F_status_set_fine(main->setting.state.status), debug, fll_error_file_flag_fallback_e, name, operation, type);
 
     f_thread_mutex_unlock(&main->thread.lock.print.mutex);
 
@@ -59,7 +59,7 @@ extern "C" {
 #endif // _di_controller_print_error_file_
 
 #ifndef _di_controller_print_error_file_status_
-  f_status_t controller_print_error_file_status(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, const f_status_t status) {
+  f_status_t controller_print_error_file_status(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, const f_status_t status) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
     if (print->verbosity == f_console_verbosity_quiet_e) return F_output_not;
@@ -68,7 +68,7 @@ extern "C" {
 
     f_thread_mutex_lock(&main->thread.lock.print.mutex);
 
-    fll_error_file_print(print, status, function, fll_error_file_flag_fallback_e, name, operation, type);
+    fll_error_file_print(print, status, debug, fll_error_file_flag_fallback_e, name, operation, type);
 
     f_thread_mutex_unlock(&main->thread.lock.print.mutex);
 
@@ -97,7 +97,7 @@ extern "C" {
 #endif // _di_controller_print_error_file_pid_exists_
 
 #ifndef _di_controller_print_error_status_
-  f_status_t controller_print_error_status(fl_print_t * const print, const f_string_t function, const f_status_t status) {
+  f_status_t controller_print_error_status(fl_print_t * const print, const f_string_t debug, const f_status_t status) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
     if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
@@ -106,7 +106,7 @@ extern "C" {
 
     f_thread_mutex_lock(&main->thread.lock.print.mutex);
 
-    fll_error_print(print, status, function, fll_error_file_flag_fallback_e);
+    fll_error_print(print, status, debug, fll_error_file_flag_fallback_e);
 
     f_thread_mutex_unlock(&main->thread.lock.print.mutex);
 
index 75d906f..f99d6aa 100644 (file)
@@ -27,8 +27,10 @@ extern "C" {
  *   This does not alter print.custom.setting.state.status.
  *
  *   Must not be NULL.
- * @param function
- *   The name of the function associated with the error.
+ * @param debug
+ *   (optional) The debug details, such as file, line number, and function.
+ *
+ *   Set to NULL to disable.
  *
  * @return
  *   F_okay on success.
@@ -37,7 +39,7 @@ extern "C" {
  *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_controller_print_error_
-  extern f_status_t controller_print_error(fl_print_t * const print, const f_string_t function);
+  extern f_status_t controller_print_error(fl_print_t * const print, const f_string_t debug);
 #endif // _di_controller_print_error_
 
 /**
@@ -79,9 +81,10 @@ extern "C" {
  *   This does not alter print.custom.setting.state.status.
  *
  *   Must not be NULL.
- * @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
@@ -96,7 +99,7 @@ extern "C" {
  *   F_output_not (with error bit) if a parameter is NULL.
  */
 #ifndef _di_controller_print_error_file_
-  extern f_status_t controller_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);
+  extern f_status_t controller_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);
 #endif // _di_controller_print_error_file_
 
 /**
@@ -110,9 +113,10 @@ extern "C" {
  *   This does not alter print.custom.setting.state.status.
  *
  *   Must not be NULL.
- * @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
@@ -129,7 +133,7 @@ extern "C" {
  *   F_output_not (with error bit) if a parameter is NULL.
  */
 #ifndef _di_controller_print_error_file_status_
-  extern f_status_t controller_print_error_file_status(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, const f_status_t status);
+  extern f_status_t controller_print_error_file_status(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, const f_status_t status);
 #endif // _di_controller_print_error_file_status_
 
 /**
@@ -143,8 +147,10 @@ extern "C" {
  *   This does not alter print.custom.setting.state.status.
  *
  *   Must not be NULL.
- * @param function
- *   The name of the function associated with the error.
+ * @param debug
+ *   (optional) The debug details, such as file, line number, and function.
+ *
+ *   Set to NULL to disable.
  * @param status
  *   The status code to print an error message about.
  *
@@ -155,7 +161,7 @@ extern "C" {
  *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_controller_print_error_status_
-  extern f_status_t controller_print_error_status(fl_print_t * const print, const f_string_t function, const f_status_t status);
+  extern f_status_t controller_print_error_status(fl_print_t * const print, const f_string_t debug, const f_status_t status);
 #endif // _di_controller_print_error_status_
 
 /**
index d6f519c..2128410 100644 (file)
@@ -5,7 +5,7 @@ extern "C" {
 #endif
 
 #ifndef _di_controller_print_error_entry_
-  f_status_t controller_print_error_entry(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const f_string_t function, const uint8_t fallback, const f_string_t line_file) {
+  f_status_t controller_print_error_entry(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const f_string_t debug, const uint8_t fallback, const f_string_t line_file) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
     if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
@@ -15,7 +15,7 @@ extern "C" {
 
     f_thread_mutex_lock(&main->thread.lock.print.mutex);
 
-    fll_error_print(print, status, function, fallback);
+    fll_error_print(print, status, debug, fallback);
 
     f_file_stream_lock(print->to);
 
@@ -62,7 +62,7 @@ extern "C" {
 #endif // _di_controller_print_error_entry_cache_
 
 #ifndef _di_controller_print_error_entry_file_
-  f_status_t controller_print_error_entry_file(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const f_string_t function, const uint8_t fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, const f_string_t line_file) {
+  f_status_t controller_print_error_entry_file(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const f_string_t debug, const uint8_t fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, const f_string_t line_file) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
     if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
@@ -73,7 +73,7 @@ extern "C" {
     // fll_error_file_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_lock_print().
     f_thread_mutex_lock(&main->thread.lock.print.mutex);
 
-    fll_error_file_print(print, status, function, fallback, name, operation, type);
+    fll_error_file_print(print, status, debug, fallback, name, operation, type);
 
     f_file_stream_lock(print->to);
 
index 5ff7a99..9177fee 100644 (file)
@@ -33,9 +33,10 @@ extern "C" {
  * @param status
  *   The status code to process.
  *   Make sure this has F_status_set_fine() called if the status code has any error or warning bits.
- * @param function
- *   (optional) 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 fallback
  *   Set to F_true to print the fallback error message for unknown errors.
  * @param thread
@@ -53,7 +54,7 @@ extern "C" {
  *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_controller_print_error_entry_
-  extern f_status_t controller_print_error_entry(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const f_string_t function, const uint8_t fallback, const f_string_t line_file);
+  extern f_status_t controller_print_error_entry(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const f_string_t debug, const uint8_t fallback, const f_string_t line_file);
 #endif // _di_controller_print_error_entry_
 
 /**
@@ -111,9 +112,10 @@ extern "C" {
  * @param status
  *   The status code to process.
  *   Make sure this has F_status_set_fine() called if the status code has any error or warning bits.
- * @param function
- *   (optional) 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 fallback
  *   If TRUE, then print the fallback error message for unknown errors.
  *   If FALSE, then do not print the fallback error message.
@@ -136,7 +138,7 @@ extern "C" {
  *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_controller_print_error_entry_file_
-  extern f_status_t controller_print_error_entry_file(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const f_string_t function, const uint8_t fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, const f_string_t line_file);
+  extern f_status_t controller_print_error_entry_file(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const f_string_t debug, const uint8_t fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, const f_string_t line_file);
 #endif // _di_controller_print_error_entry_file_
 
 #ifdef __cplusplus
index 06c166a..4d41077 100644 (file)
@@ -5,7 +5,7 @@ extern "C" {
 #endif
 
 #ifndef _di_controller_print_error_perform_pid_file_create_
-  f_status_t controller_print_error_perform_pid_file_create(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t is_entry, const f_string_t line_file) {
+  f_status_t controller_print_error_perform_pid_file_create(fl_print_t * const print, const f_status_t status, const f_string_t debug, const uint8_t is_entry, const f_string_t line_file) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
     if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
@@ -14,7 +14,7 @@ extern "C" {
 
     controller_lock_print(print->to, &main->thread);
 
-    controller_print_error_file_status(print, function, main->process.path_pid, f_file_operation_create_s, fll_error_file_type_file_e, status);
+    controller_print_error_file_status(print, debug, main->process.path_pid, f_file_operation_create_s, fll_error_file_type_file_e, status);
 
     f_file_stream_lock(print->to);
 
index 47eb99c..d599152 100644 (file)
@@ -30,8 +30,10 @@ extern "C" {
  * @param status
  *   The status code to process.
  *   Make sure this has F_status_set_fine() called if the status code has any error or warning bits.
- * @param function
- *   The name of the function associated with the error.
+ * @param debug
+ *   (optional) The debug details, such as file, line number, and function.
+ *
+ *   Set to NULL to disable.
  * @param is_entry
  *   If TRUE, then this operates as an Entry.
  *   If FALSE, then this operates as an Exit.
@@ -48,7 +50,7 @@ extern "C" {
  *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_controller_print_error_perform_pid_file_create_
-  extern f_status_t controller_print_error_perform_pid_file_create(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t is_entry, const f_string_t line_file);
+  extern f_status_t controller_print_error_perform_pid_file_create(fl_print_t * const print, const f_status_t status, const f_string_t debug, const uint8_t is_entry, const f_string_t line_file);
 #endif // _di_controller_print_error_perform_pid_file_create_
 
 #ifdef __cplusplus
index fd9c29c..b38594b 100644 (file)
@@ -5,7 +5,7 @@ extern "C" {
 #endif
 
 #ifndef _di_controller_print_error_rule_
-  f_status_t controller_print_error_rule(fl_print_t * const print, controller_cache_action_t * const action, const f_status_t status, const f_string_t function, const uint8_t fallback, const uint8_t item, const f_string_t line_file) {
+  f_status_t controller_print_error_rule(fl_print_t * const print, controller_cache_action_t * const action, const f_status_t status, const f_string_t debug, const uint8_t fallback, const uint8_t item, const f_string_t line_file) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
     if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
@@ -15,7 +15,7 @@ extern "C" {
 
     f_thread_mutex_lock(&main->thread.lock.print.mutex);
 
-    fll_error_print(print, status, function, fallback);
+    fll_error_print(print, status, debug, fallback);
 
     f_file_stream_lock(print->to);
 
index 92370f8..3427c1a 100644 (file)
@@ -36,9 +36,10 @@ extern "C" {
  * @param status
  *   The status code to process.
  *   Make sure this has F_status_set_fine() called if the status code has any error or warning bits.
- * @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 fallback
  *   Set to F_true to print the fallback error message for unknown errors.
  * @param item
@@ -57,7 +58,7 @@ extern "C" {
  *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_controller_print_error_rule_
-  extern f_status_t controller_print_error_rule(fl_print_t * const print, controller_cache_action_t * const action, const f_status_t status, const f_string_t function, const uint8_t fallback, const uint8_t item, const f_string_t line_file);
+  extern f_status_t controller_print_error_rule(fl_print_t * const print, controller_cache_action_t * const action, const f_status_t status, const f_string_t debug, const uint8_t fallback, const uint8_t item, const f_string_t line_file);
 #endif // _di_controller_print_error_rule_
 
 /**