From: Kevin Day Date: Sun, 9 Jun 2024 23:46:12 +0000 (-0500) Subject: Progress: Continue migrating the project. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=1f0be6b5f80998b5ef8046bcc4786ed3a0375548;p=controller Progress: Continue migrating the project. --- diff --git a/data/build/settings b/data/build/settings index dfd614c..535f11b 100644 --- a/data/build/settings +++ b/data/build/settings @@ -48,12 +48,17 @@ build_sources_library main/entry.c main/entry/action.c main/entry/preprocess.c m build_sources_library main/file.c main/lock.c main/path.c main/process.c build_sources_library main/rule.c main/rule/action.c main/rule/execute.c main/rule/expand.c main/rule/instance.c main/rule/is.c main/rule/item.c main/rule/parameter.c main/rule/read.c main/rule/setting.c main/rule/validate.c main/rule/wait.c build_sources_library main/perform.c -build_sources_library main/print/action.c main/print/data.c main/print/debug.c main/print/error.c main/print/lock.c main/print/message.c main/print/rule.c main/print/verbose.c main/print/warning.c -build_sources_library main/print/entry/error.c main/print/entry/error/item.c main/print/entry/error/setting.c -build_sources_library main/print/entry/message.c main/print/entry/message/action.c main/print/entry/message/item.c -build_sources_library main/print/entry/output/setting.c -build_sources_library main/print/entry/warning/action.c main/print/entry/warning/setting.c -build_sources_library main/print/rule/action.c main/print/rule/item.c main/print/rule/setting.c +build_sources_library main/print/data.c +build_sources_library main/print/debug.c main/print/debug/rule/action.c main/print/debug/rule/execute.c main/print/debug/perform/control.c main/print/debug/perform/pid.c +build_sources_library main/print/error.c +build_sources_library main/print/error/entry.c main/print/error/entry/action.c main/print/error/entry/item.c main/print/error/entry/setting.c +build_sources_library main/print/error/perform/pid.c +build_sources_library main/print/error/rule.c main/print/error/rule/action.c main/print/error/rule/item.c main/print/error/rule/setting.c +build_sources_library main/print/lock.c main/print/error/lock.c +build_sources_library main/print/output/entry/setting.c main/print/output/rule/execute.c +build_sources_library main/print/message.c main/print/message/entry.c main/print/message/entry/action.c main/print/message/entry/item.c +build_sources_library main/print/verbose.c +build_sources_library main/print/warning.c main/print/warning/entry/action.c main/print/warning/entry/setting.c build_sources_library main/signal.c main/time.c build_sources_library main/thread.c main/thread/cleanup.c main/thread/control.c main/thread/entry.c main/thread/instance.c main/thread/is.c main/thread/rule.c main/thread/signal.c build_sources_library main/validate.c @@ -68,12 +73,17 @@ build_sources_headers main/entry.h main/entry/action.h main/entry/preprocess.h m build_sources_headers main/file.h main/lock.h main/path.h main/process.h build_sources_headers main/rule.h main/rule/action.h main/rule/execute.h main/rule/expand.h main/rule/instance.h main/rule/is.h main/rule/item.h main/rule/parameter.h main/rule/read.h main/rule/setting.h main/rule/validate.h main/rule/wait.h build_sources_headers main/perform.h -build_sources_headers main/print/action.h main/print/data.h main/print/debug.h main/print/error.h main/print/lock.h main/print/message.h main/print/rule.h main/print/verbose.h main/print/warning.h -build_sources_headers main/print/entry/error.h main/print/entry/error/item.h main/print/entry/error/setting.h -build_sources_headers main/print/entry/message.h main/print/entry/message/action.h main/print/entry/message/item.h -build_sources_headers main/print/entry/output/setting.h -build_sources_headers main/print/entry/warning/action.h main/print/entry/warning/setting.h -build_sources_headers main/print/rule/action.h main/print/rule/item.h main/print/rule/setting.h +build_sources_headers main/print/data.h +build_sources_headers main/print/debug.h main/print/debug/rule/action.h main/print/debug/rule/execute.h main/print/debug/perform/control.h main/print/debug/perform/pid.h +build_sources_headers main/print/error.h +build_sources_headers main/print/error/entry.h main/print/error/entry/action.h main/print/error/entry/item.h main/print/error/entry/setting.h +build_sources_headers main/print/error/perform/pid.h +build_sources_headers main/print/error/rule.h main/print/error/rule/action.h main/print/error/rule/item.h main/print/error/rule/setting.h +build_sources_headers main/print/lock.h main/print/error/lock.h +build_sources_headers main/print/output/entry/setting.h main/print/output/rule/execute.h +build_sources_headers main/print/message.h main/print/message/entry.h main/print/message/entry/action.h main/print/message/entry/item.h +build_sources_headers main/print/verbose.h +build_sources_headers main/print/warning.h main/print/warning/entry/action.h main/print/warning/entry/setting.h build_sources_headers main/signal.h main/time.h build_sources_headers main/thread.h main/thread/cleanup.h main/thread/control.h main/thread/entry.h main/thread/instance.h main/thread/is.h main/thread/rule.h main/thread/signal.h build_sources_headers main/validate.h diff --git a/sources/c/main/controller.h b/sources/c/main/controller.h index ef238c9..47ef9ea 100644 --- a/sources/c/main/controller.h +++ b/sources/c/main/controller.h @@ -109,27 +109,33 @@ #include #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include +#include +#include #include #include #include diff --git a/sources/c/main/entry.c b/sources/c/main/entry.c index 97f98c8..2a6a5d4 100644 --- a/sources/c/main/entry.c +++ b/sources/c/main/entry.c @@ -82,7 +82,7 @@ extern "C" { f_fss_apply_delimit(cache->delimits, &cache->buffer_file, &state); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_fss_apply_delimit), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_fss_apply_delimit), F_true); } } } @@ -103,7 +103,7 @@ extern "C" { status = f_memory_array_increase_by(cache->object_items.used, &entry->items.array, &entry->items.used, &entry->items.size); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_memory_array_increase_by), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_memory_array_increase_by), F_true); } else { @@ -146,7 +146,7 @@ extern "C" { status = controller_entry_items_increase_by(controller_allocation_small_d, &entry->items); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_entry_items_increase_by), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_entry_items_increase_by), F_true); break; } @@ -154,7 +154,7 @@ extern "C" { status = f_string_dynamic_partial_append(cache->buffer_file, cache->object_items.array[i], &cache->action.name_item); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_partial_append), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_partial_append), F_true); break; } @@ -162,7 +162,7 @@ extern "C" { f_fss_count_lines(cache->buffer_file, cache->object_items.array[i].start, &cache->action.line_item, &main->setting.state); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_fss_count_lines), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_fss_count_lines), F_true); break; } @@ -179,7 +179,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, main->program.warning.to, main->program.warning.notable, cache->action.name_file, main->program.warning.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, main->program.warning.to, main->program.warning.context, main->program.warning.context, f_string_eol_s); - controller_print_entry_error_cache(is_entry, &main->program.warning, &cache->action); + controller_print_error_entry_cache(is_entry, &main->program.warning, &cache->action); controller_unlock_print_flush(main->program.warning.to, &main->thread); } @@ -236,7 +236,7 @@ extern "C" { if (F_status_set_fine(status) != F_interrupt) { controller_lock_print(main->program.error.to, &main->thread); - controller_print_entry_error_cache(is_entry, &main->program.error, &cache->action); + controller_print_error_entry_cache(is_entry, &main->program.error, &cache->action); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -319,7 +319,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, main->program.error.to, main->program.error.notable, action->parameters.array[0], main->program.error.notable); fl_print_format("%[' does not exist.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - controller_print_entry_error_cache(is_entry, &main->program.error, &cache->action); + controller_print_error_entry_cache(is_entry, &main->program.error, &cache->action); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -343,7 +343,7 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) != F_interrupt) { - controller_print_entry_error_cache(is_entry, &main->program.error, &cache->action); + controller_print_error_entry_cache(is_entry, &main->program.error, &cache->action); } entry->status = controller_status_simplify_error(F_status_set_fine(status)); diff --git a/sources/c/main/entry/preprocess.c b/sources/c/main/entry/preprocess.c index d44c49d..45f63a4 100644 --- a/sources/c/main/entry/preprocess.c +++ b/sources/c/main/entry/preprocess.c @@ -35,7 +35,7 @@ extern "C" { status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &cache->ats.array, &cache->ats.used, &cache->ats.size); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true); return status; } @@ -51,7 +51,7 @@ extern "C" { status = f_string_dynamic_append_nulless(entry->items.array[0].name, &cache->action.name_item); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_append_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_append_nulless), F_true); return status; } @@ -68,14 +68,14 @@ extern "C" { status2 = f_string_dynamic_append_nulless(controller_entry_action_type_name(actions->array[cache->ats.array[at_j]].type), &cache->action.name_action); if (F_status_is_error(status2)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status2), macro_controller_f(f_string_dynamic_append_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status2), macro_controller_f(f_string_dynamic_append_nulless), F_true); return status2; } if (actions->array[cache->ats.array[at_j]].type == controller_entry_action_type_ready_e) { if (main->setting.ready == controller_setting_ready_wait_e) { - controller_print_entry_warning_action_multiple(&main->program.warning, cache, is_entry, controller_ready_s); + controller_print_warning_entry_action_multiple(&main->program.warning, cache, is_entry, controller_ready_s); } else { main->setting.ready = controller_setting_ready_wait_e; @@ -101,7 +101,7 @@ extern "C" { for (j = 2; j < cache->ats.used; j += 2) { if (cache->ats.array[j] == i) { - controller_print_entry_error_item_failure(&main->program.error, cache, entry->items.array[i].name, "cannot be executed because recursion is not allowed"); + controller_print_error_entry_item_failure(&main->program.error, cache, entry->items.array[i].name, "cannot be executed because recursion is not allowed"); if (F_status_is_error_not(status)) { status = F_status_set_error(F_recurse); @@ -118,7 +118,7 @@ extern "C" { status2 = f_memory_array_increase(controller_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &cache->ats.array, &cache->ats.used, &cache->ats.size); if (F_status_is_error(status2)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status2), macro_controller_f(f_memory_array_increase), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status2), macro_controller_f(f_memory_array_increase), F_true); return status2; } @@ -143,7 +143,7 @@ extern "C" { status2 = f_string_dynamic_append_nulless(entry->items.array[i].name, &cache->action.name_item); if (F_status_is_error(status2)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status2), macro_controller_f(f_string_dynamic_append_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status2), macro_controller_f(f_string_dynamic_append_nulless), F_true); return status2; } @@ -154,7 +154,7 @@ extern "C" { if (error_has || i >= entry->items.used) { if (i >= entry->items.used) { - controller_print_entry_error_item_failure(&main->program.error, cache, actions->array[cache->ats.array[at_j]].parameters.array[0], "does not exist"); + controller_print_error_entry_item_failure(&main->program.error, cache, actions->array[cache->ats.array[at_j]].parameters.array[0], "does not exist"); if (F_status_is_error_not(status)) { status = F_status_set_error(F_valid_not); @@ -188,7 +188,7 @@ extern "C" { status2 = f_string_dynamic_append_nulless(entry->items.array[cache->ats.array[at_i]].name, &cache->action.name_item); if (F_status_is_error(status2)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status2), macro_controller_f(f_string_dynamic_append_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status2), macro_controller_f(f_string_dynamic_append_nulless), F_true); return status2; } diff --git a/sources/c/main/entry/process.c b/sources/c/main/entry/process.c index e25b52c..a158aad 100644 --- a/sources/c/main/entry/process.c +++ b/sources/c/main/entry/process.c @@ -35,7 +35,7 @@ extern "C" { status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &cache->ats.array, &cache->ats.used, &cache->ats.size); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true); return status; } @@ -51,13 +51,13 @@ extern "C" { status = f_string_dynamic_append_nulless(entry->items.array[cache->ats.array[0]].name, &cache->action.name_item); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_append_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_append_nulless), F_true); return status; } if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.message.verbosity > f_console_verbosity_normal_e) { - controller_print_entry_message_item_process(&main->program.message, is_entry, failsafe ? controller_print_entry_failsafe_s : f_string_empty_s, cache->action.name_item); + controller_print_message_entry_item_process(&main->program.message, is_entry, failsafe ? controller_print_entry_failsafe_s : f_string_empty_s, cache->action.name_item); } // The pre-process determines if ready is explicitly specified within the entry file and if it is not start as ready. @@ -80,14 +80,14 @@ extern "C" { status = f_string_dynamic_append_nulless(controller_entry_action_type_name(entry_action->type), &cache->action.name_action); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_append_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_append_nulless), F_true); return status; } if (F_status_is_error(entry_action->status)) { if (main->setting.flag & controller_main_flag_simulate_e) { - controller_print_entry_message_action_state_failed(&main->program.message, cache, entry_action, is_entry); + controller_print_message_entry_action_state_failed(&main->program.message, cache, entry_action, is_entry); } else { if ((entry_action->code & controller_entry_rule_code_require_d) && main->program.error.verbosity > f_console_verbosity_quiet_e || !(entry_action->code & controller_entry_rule_code_require_d) && (main->program.warning.verbosity == f_console_verbosity_verbose_e || main->program.warning.verbosity == f_console_verbosity_debug_e)) { @@ -101,7 +101,7 @@ extern "C" { } if (print) { - controller_print_entry_message_action_state(print, cache, entry_action, is_entry); + controller_print_message_entry_action_state(print, cache, entry_action, is_entry); } } @@ -116,7 +116,7 @@ extern "C" { if (entry_action->type == controller_entry_action_type_ready_e) { if ((entry_action->code & controller_entry_rule_code_wait_d) || main->setting.ready == controller_setting_ready_wait_e) { if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.error.verbosity == f_console_verbosity_verbose_e || main->program.error.verbosity == f_console_verbosity_debug_e || entry->show == controller_entry_show_init_e) { - controller_print_entry_message_action_wait(&main->program.message, is_entry, controller_ready_s); + controller_print_message_entry_action_wait(&main->program.message, is_entry, controller_ready_s); } if (!(main->setting.flag & controller_main_flag_validate_e)) { @@ -127,12 +127,12 @@ extern "C" { if (main->setting.ready == controller_setting_ready_yes_e) { if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.error.verbosity == f_console_verbosity_verbose_e || main->program.error.verbosity == f_console_verbosity_debug_e) { - controller_print_entry_message_action_ready(&main->program.message, is_entry, controller_ready_s); + controller_print_message_entry_action_ready(&main->program.message, is_entry, controller_ready_s); } } else { if (!failsafe && (main->program.error.verbosity == f_console_verbosity_verbose_e || entry->show == controller_entry_show_init_e) && !(main->setting.flag & controller_main_flag_simulate_e)) { - controller_print_entry_message_state(&main->program.message, is_entry, controller_ready_s); + controller_print_message_entry_state(&main->program.message, is_entry, controller_ready_s); } status = controller_perform_ready(main, is_entry); @@ -143,7 +143,7 @@ extern "C" { if (entry_action->number == 0 || entry_action->number >= entry->items.used || failsafe && entry_action->number == main->setting.failsafe_item_id) { // This should not happen if the pre-process is working as intended, but in case it doesn't, return a critical error to prevent infinite recursion and similar errors. - controller_print_entry_error_item_invalid(&main->program.error, cache, is_entry, entry_action->number); + controller_print_error_entry_item_invalid(&main->program.error, cache, is_entry, entry_action->number); return F_status_is_error(F_critical); } @@ -151,7 +151,7 @@ extern "C" { status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &cache->ats.array, &cache->ats.used, &cache->ats.size); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true); return status; } @@ -174,13 +174,13 @@ extern "C" { status = f_string_dynamic_append_nulless(entry->items.array[cache->ats.array[at_i]].name, &cache->action.name_item); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_append_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_append_nulless), F_true); return status; } if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.message.verbosity > f_console_verbosity_normal_e) { - controller_print_entry_message_item_process(&main->program.message, is_entry, f_string_empty_s, cache->action.name_item); + controller_print_message_entry_item_process(&main->program.message, is_entry, f_string_empty_s, cache->action.name_item); } // Exit inner loop to force restarting and start processing the requested item. @@ -190,7 +190,7 @@ extern "C" { status_lock = controller_lock_write(is_entry, &main->thread, &main->thread.lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false, &main->thread); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false, &main->thread); break; } @@ -200,7 +200,7 @@ extern "C" { f_thread_unlock(&main->thread.lock.rule); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_rules_increase), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_rules_increase), F_true); return status; } @@ -218,7 +218,7 @@ extern "C" { status_lock = controller_lock_read(is_entry, &main->thread, &main->thread.lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true, &main->thread); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true, &main->thread); break; } @@ -228,7 +228,7 @@ extern "C" { f_thread_unlock(&main->thread.lock.rule); if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.error.verbosity == f_console_verbosity_verbose_e || main->program.error.verbosity == f_console_verbosity_debug_e || (entry->show == controller_entry_show_init_e && entry_action->type != controller_entry_action_type_consider_e)) { - controller_print_entry_message_item_rule(&main->program.message, entry, entry_action, is_entry); + controller_print_message_entry_item_rule(&main->program.message, entry, entry_action, is_entry); } if (!controller_thread_is_enabled(is_entry, &main->thread)) break; @@ -275,7 +275,7 @@ extern "C" { cache->action.line_item = cache_line_item; if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false, &main->thread); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false, &main->thread); break; } @@ -290,7 +290,7 @@ extern "C" { if (main->program.error.verbosity > f_console_verbosity_quiet_e) { controller_lock_print(main->program.error.to, &main->thread); - controller_print_entry_error_cache(is_entry, &main->program.error, &cache->action); + controller_print_error_entry_cache(is_entry, &main->program.error, &cache->action); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -358,7 +358,7 @@ extern "C" { } else if (entry_action->type == controller_entry_action_type_execute_e) { if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.message.verbosity > f_console_verbosity_normal_e || entry->show == controller_entry_show_init_e) { - controller_print_entry_message_item_executing(&main->program.message, is_entry, &entry_action->parameters); + controller_print_message_entry_item_executing(&main->program.message, is_entry, &entry_action->parameters); } if (main->setting.flag & controller_main_flag_simulate_e) return F_execute; @@ -376,16 +376,16 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_file_found_not) { - controller_print_entry_error_item_action_execution_missing(&main->program.error, cache, is_entry, entry_action->parameters.array[0]); + controller_print_error_entry_action_execution_missing(&main->program.error, cache, is_entry, entry_action->parameters.array[0]); } else { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(fll_execute_into), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(fll_execute_into), F_true); } return F_status_set_error(F_execute); } else if (result != 0) { - controller_print_entry_error_item_action_execution_failure(&main->program.error, cache, is_entry, result); + controller_print_error_entry_action_execution_failure(&main->program.error, cache, is_entry, result); return F_status_set_error(F_execute); } @@ -396,34 +396,34 @@ extern "C" { if (entry_action->code == controller_entry_timeout_code_exit_d) { entry->timeout_exit = entry_action->number; - controller_print_entry_output_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_exit_s, entry->items.array[main->setting.failsafe_item_id].name, controller_print_entry_suffix_megatime_s); + controller_print_output_entry_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_exit_s, entry->items.array[main->setting.failsafe_item_id].name, controller_print_entry_suffix_megatime_s); } else if (entry_action->code == controller_entry_timeout_code_kill_d) { entry->timeout_kill = entry_action->number; - controller_print_entry_output_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_kill_s, entry->items.array[main->setting.failsafe_item_id].name, controller_print_entry_suffix_megatime_s); + controller_print_output_entry_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_kill_s, entry->items.array[main->setting.failsafe_item_id].name, controller_print_entry_suffix_megatime_s); } else if (entry_action->code == controller_entry_timeout_code_start_d) { entry->timeout_start = entry_action->number; - controller_print_entry_output_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_start_s, entry->items.array[main->setting.failsafe_item_id].name, controller_print_entry_suffix_megatime_s); + controller_print_output_entry_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_start_s, entry->items.array[main->setting.failsafe_item_id].name, controller_print_entry_suffix_megatime_s); } else if (entry_action->code == controller_entry_timeout_code_stop_d) { entry->timeout_stop = entry_action->number; - controller_print_entry_output_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_stop_s, entry->items.array[main->setting.failsafe_item_id].name, controller_print_entry_suffix_megatime_s); + controller_print_output_entry_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_stop_s, entry->items.array[main->setting.failsafe_item_id].name, controller_print_entry_suffix_megatime_s); } } else if (entry_action->type == controller_entry_action_type_failsafe_e) { if (failsafe) { - controller_print_entry_warning_action_failsafe_twice(&main->program.warning, cache, is_entry); + controller_print_warning_entry_action_failsafe_twice(&main->program.warning, cache, is_entry); } else { if (entry_action->number == 0 || entry_action->number >= entry->items.used) { // This should not happen if the pre-process is working as designed, but in case it doesn't, return a critical error to prevent infinite recursion and similar errors. - controller_print_entry_error_item_invalid(&main->program.error, cache, is_entry, entry_action->number); + controller_print_error_entry_item_invalid(&main->program.error, cache, is_entry, entry_action->number); return F_status_is_error(F_critical); } @@ -431,7 +431,7 @@ extern "C" { main->setting.flag |= controller_setting_flag_failsafe_e; main->setting.failsafe_item_id = entry_action->number; - controller_print_entry_output_setting_simulate_value(&main->program.output, is_entry, controller_failsafe_s, f_string_empty_s, entry->items.array[main->setting.failsafe_item_id].name, f_string_empty_s); + controller_print_output_entry_setting_simulate_value(&main->program.output, is_entry, controller_failsafe_s, f_string_empty_s, entry->items.array[main->setting.failsafe_item_id].name, f_string_empty_s); } } } @@ -464,7 +464,7 @@ extern "C" { status = f_string_dynamic_append_nulless(entry->items.array[cache->ats.array[at_i]].name, &cache->action.name_item); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_append_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_append_nulless), F_true); break; } @@ -483,7 +483,7 @@ extern "C" { } if ((main->setting.flag & controller_main_flag_simulate_e && main->program.error.verbosity > f_console_verbosity_error_e) || main->program.error.verbosity > f_console_verbosity_normal_e) { - controller_print_entry_message_item_done(&main->program.message, is_entry, failsafe, controller_main_s); + controller_print_message_entry_item_done(&main->program.message, is_entry, failsafe, controller_main_s); } return status; diff --git a/sources/c/main/entry/setting.c b/sources/c/main/entry/setting.c index a25183f..af9d890 100644 --- a/sources/c/main/entry/setting.c +++ b/sources/c/main/entry/setting.c @@ -18,7 +18,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(fll_fss_extended_read), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(fll_fss_extended_read), F_true); return status; } @@ -30,7 +30,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_fss_apply_delimit), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_fss_apply_delimit), F_true); return status; } @@ -49,7 +49,7 @@ extern "C" { f_fss_count_lines(cache->buffer_file, cache->object_actions.array[i].start, &cache->action.line_action, &main->setting.state); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_fss_count_lines), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_fss_count_lines), F_true); break; } @@ -60,7 +60,7 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->object_actions.array[i], &cache->action.name_action); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_rip_dynamic_partial_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_rip_dynamic_partial_nulless), F_true); break; } @@ -77,7 +77,7 @@ extern "C" { main->process.control.flag |= controller_control_flag_readonly_e; } else { - controller_print_entry_error_item_setting_support_not_option(&main->program.error, cache, is_entry, cache->content_actions.array[i].array[1]); + controller_print_error_entry_item_setting_support_not_option(&main->program.error, cache, is_entry, cache->content_actions.array[i].array[1]); continue; } @@ -92,7 +92,7 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->content_actions.array[i].array[0], &cache->action.generic); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_rip_dynamic_partial_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_rip_dynamic_partial_nulless), F_true); break; } @@ -102,7 +102,7 @@ extern "C" { status = controller_path_canonical_relative(main->setting, cache->action.generic, &main->setting.path_control); if (F_status_is_error(status)) { - controller_print_entry_error_file(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_path_canonical_relative), F_true, cache->action.generic, f_file_operation_analyze_s, fll_error_file_type_path_e); + controller_print_error_entry_file(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_path_canonical_relative), F_true, cache->action.generic, f_file_operation_analyze_s, fll_error_file_type_path_e); continue; } @@ -116,16 +116,16 @@ extern "C" { status = F_status_set_fine(status); if (status == F_exist_not) { - controller_print_entry_error_setting_with_range(&main->program.error, cache, is_entry, " has an invalid group", cache->content_actions.array[i].array[0], ", because no group was found by that name"); + controller_print_error_entry_setting_with_range(&main->program.error, cache, is_entry, " has an invalid group", cache->content_actions.array[i].array[0], ", because no group was found by that name"); } else if (status == F_number_too_large) { - controller_print_entry_error_setting_with_range(&main->program.error, cache, is_entry, " has an invalid group", cache->content_actions.array[i].array[0], ", because the given ID is too large"); + controller_print_error_entry_setting_with_range(&main->program.error, cache, is_entry, " has an invalid group", cache->content_actions.array[i].array[0], ", because the given ID is too large"); } else if (status == F_number) { - controller_print_entry_error_setting_with_range(&main->program.error, cache, is_entry, " has an invalid group", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number"); + controller_print_error_entry_setting_with_range(&main->program.error, cache, is_entry, " has an invalid group", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number"); } else { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_convert_group_id), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_convert_group_id), F_true); } continue; @@ -144,7 +144,7 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->content_actions.array[i].array[0], &cache->action.generic); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_rip_dynamic_partial_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_rip_dynamic_partial_nulless), F_true); break; } @@ -152,7 +152,7 @@ extern "C" { status = f_file_mode_from_string(cache->action.generic, main->program.umask, &mode_file, &replace); if (F_status_is_error(status)) { - controller_print_entry_error_setting_with_range(&main->program.error, cache, is_entry, " has an unsupported mode", cache->content_actions.array[i].array[0], ", because the format is unknown or contains invalid data"); + controller_print_error_entry_setting_with_range(&main->program.error, cache, is_entry, " has an unsupported mode", cache->content_actions.array[i].array[0], ", because the format is unknown or contains invalid data"); continue; } @@ -160,7 +160,7 @@ extern "C" { status = f_file_mode_to_mode(mode_file, &mode); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_file_mode_to_mode), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_file_mode_to_mode), F_true); continue; } @@ -177,16 +177,16 @@ extern "C" { status = F_status_set_fine(status); if (status == F_exist_not) { - controller_print_entry_error_setting_with_range(&main->program.error, cache, is_entry, " has an invalid user", cache->content_actions.array[i].array[0], ", because no user was found by that name"); + controller_print_error_entry_setting_with_range(&main->program.error, cache, is_entry, " has an invalid user", cache->content_actions.array[i].array[0], ", because no user was found by that name"); } else if (status == F_number_too_large) { - controller_print_entry_error_setting_with_range(&main->program.error, cache, is_entry, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is too large"); + controller_print_error_entry_setting_with_range(&main->program.error, cache, is_entry, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is too large"); } else if (status == F_number) { - controller_print_entry_error_setting_with_range(&main->program.error, cache, is_entry, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number"); + controller_print_error_entry_setting_with_range(&main->program.error, cache, is_entry, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number"); } else { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_convert_user_id), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_convert_user_id), F_true); } continue; @@ -197,7 +197,7 @@ extern "C" { } else if (f_compare_dynamic(controller_define_s, cache->action.name_action) == F_equal_to) { if (cache->content_actions.array[i].used != 2) { - controller_print_entry_error_setting_requires_exactly(&main->program.error, cache, is_entry, 2); + controller_print_error_entry_setting_requires_exactly(&main->program.error, cache, is_entry, 2); continue; } @@ -205,14 +205,14 @@ extern "C" { status = controller_entry_setting_read_map(cache->buffer_file, cache->content_actions.array[i], &entry->define); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_entry_setting_read_map), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_entry_setting_read_map), F_true); continue; } } else if (is_entry && f_compare_dynamic(controller_mode_s, cache->action.name_action) == F_equal_to) { if (cache->content_actions.array[i].used != 1) { - controller_print_entry_error_setting_requires_exactly(&main->program.error, cache, is_entry, 1); + controller_print_error_entry_setting_requires_exactly(&main->program.error, cache, is_entry, 1); continue; } @@ -234,7 +234,7 @@ extern "C" { } else if (f_compare_dynamic(controller_parameter_s, cache->action.name_action) == F_equal_to) { if (cache->content_actions.array[i].used != 2) { - controller_print_entry_error_setting_requires_exactly(&main->program.error, cache, is_entry, 2); + controller_print_error_entry_setting_requires_exactly(&main->program.error, cache, is_entry, 2); continue; } @@ -242,14 +242,14 @@ extern "C" { status = controller_entry_setting_read_map(cache->buffer_file, cache->content_actions.array[i], &entry->parameter); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_entry_setting_read_map), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_entry_setting_read_map), F_true); continue; } } else if (f_compare_dynamic(controller_pid_s, cache->action.name_action) == F_equal_to) { if (cache->content_actions.array[i].used != 1) { - controller_print_entry_error_setting_requires_exactly(&main->program.error, cache, is_entry, 1); + controller_print_error_entry_setting_requires_exactly(&main->program.error, cache, is_entry, 1); continue; } @@ -271,7 +271,7 @@ extern "C" { } else if (is_entry && f_compare_dynamic(controller_pid_file_s, cache->action.name_action) == F_equal_to) { if (cache->content_actions.array[i].used != 1) { - controller_print_entry_error_setting_requires_exactly(&main->program.error, cache, is_entry, 1); + controller_print_error_entry_setting_requires_exactly(&main->program.error, cache, is_entry, 1); continue; } @@ -285,7 +285,7 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->content_actions.array[i].array[0], &cache->action.generic); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_rip_dynamic_partial_nulless), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_rip_dynamic_partial_nulless), F_true); continue; } @@ -295,7 +295,7 @@ extern "C" { status = controller_path_canonical_relative(main->setting, cache->action.generic, &main->setting.path_pid); if (F_status_is_error(status)) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_path_canonical_relative), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_path_canonical_relative), F_true); continue; } @@ -303,7 +303,7 @@ extern "C" { } else if (f_compare_dynamic(controller_session_s, cache->action.name_action) == F_equal_to) { if (cache->content_actions.array[i].used != 1) { - controller_print_entry_error_setting_requires_exactly(&main->program.error, cache, is_entry, 1); + controller_print_error_entry_setting_requires_exactly(&main->program.error, cache, is_entry, 1); continue; } @@ -322,7 +322,7 @@ extern "C" { } else if (f_compare_dynamic(controller_show_s, cache->action.name_action) == F_equal_to) { if (cache->content_actions.array[i].used != 1) { - controller_print_entry_error_setting_requires_exactly(&main->program.error, cache, is_entry, 1); + controller_print_error_entry_setting_requires_exactly(&main->program.error, cache, is_entry, 1); continue; } @@ -402,12 +402,12 @@ extern "C" { *time = time_previous; if (F_status_set_fine(status) == F_memory_not) { - controller_print_entry_error(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(fl_conversion_dynamic_partial_to_unsigned_detect), F_true); + controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(fl_conversion_dynamic_partial_to_unsigned_detect), F_true); continue; } - controller_print_entry_error_setting_support_not_number(&main->program.error, is_entry, cache->buffer_file, cache->content_actions.array[i].array[1]); + controller_print_error_entry_setting_support_not_number(&main->program.error, is_entry, cache->buffer_file, cache->content_actions.array[i].array[1]); } } else { diff --git a/sources/c/main/entry/setting.h b/sources/c/main/entry/setting.h index 06f8abd..f53bbe8 100644 --- a/sources/c/main/entry/setting.h +++ b/sources/c/main/entry/setting.h @@ -36,9 +36,9 @@ extern "C" { * @return * F_okay on success. * - * Errors (with error bit) from: controller_print_entry_error_file(). + * Errors (with error bit) from: controller_print_error_entry_file(). * - * @see controller_print_entry_error_file() + * @see controller_print_error_entry_file() */ #ifndef _di_controller_entry_setting_read_ extern f_status_t controller_entry_setting_read(controller_t * const main, controller_cache_t * const cache, const uint8_t is_entry, const f_range_t content_range); diff --git a/sources/c/main/instance/prepare.c b/sources/c/main/instance/prepare.c index 760811e..0342f7d 100644 --- a/sources/c/main/instance/prepare.c +++ b/sources/c/main/instance/prepare.c @@ -17,7 +17,7 @@ extern "C" { status = controller_lock_write(is_normal, &main->thread, &main->thread.lock.instance); if (F_status_is_error(status)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status), F_false); } else { status = f_memory_array_increase(controller_allocation_small_d, sizeof(controller_instance_t), (void **) &main->thread.instances.array, &main->thread.instances.used, &main->thread.instances.size); @@ -30,7 +30,7 @@ extern "C" { status = controller_lock_write(is_normal, &main->thread, &instance->lock); if (F_status_is_error(status)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status), F_false); } else { instance->action = action; diff --git a/sources/c/main/instance/wait.c b/sources/c/main/instance/wait.c index 42a8a44..909121d 100644 --- a/sources/c/main/instance/wait.c +++ b/sources/c/main/instance/wait.c @@ -43,7 +43,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); break; } diff --git a/sources/c/main/perform.c b/sources/c/main/perform.c index 0686dbf..0de2de1 100644 --- a/sources/c/main/perform.c +++ b/sources/c/main/perform.c @@ -12,7 +12,7 @@ extern "C" { if (main->setting.flag & controller_main_flag_validate_e) { if ((main->setting.flag & controller_main_flag_simulate_e)) { - controller_print_perform_debug_pid_file_control_socket(&main->program.debug); + controller_print_debug_perform_pid_file_control_socket(&main->program.debug); } return F_okay; @@ -28,19 +28,19 @@ extern "C" { // Always return immediately on memory errors. if (F_status_set_fine(status) == F_memory_not) { - controller_print_perform_error_pid_file_create(&main->program.error, macro_controller_f(controller_file_pid_create), is_entry); + controller_print_error_perform_pid_file_create(&main->program.error, macro_controller_f(controller_file_pid_create), is_entry); return status; } - controller_print_perform_debug_pid_file_create_problem(&main->program.debug, macro_controller_f(controller_file_pid_create), is_entry); + controller_print_debug_perform_pid_file_create_problem(&main->program.debug, macro_controller_f(controller_file_pid_create), is_entry); status = F_okay; } else { main->setting.flag |= controller_setting_flag_pid_created_e; - controller_print_perform_debug_pid_file_create_success(&main->program.debug, is_entry); + controller_print_debug_perform_pid_file_create_success(&main->program.debug, is_entry); } } @@ -65,7 +65,7 @@ extern "C" { if (main->process.control.flag & controller_control_flag_readonly_e) { if (f_file_exists(main->setting.path_control, F_true) != F_true) { - controller_print_perform_debug_control_socket_missing_read_only(&main->program.debug); + controller_print_debug_perform_control_socket_missing_read_only(&main->program.debug); return F_data_not; } @@ -78,8 +78,8 @@ extern "C" { controller_print_error_status(&main->program.error, macro_controller_f(f_socket_create), F_status_set_fine(status)); } else { - // @todo make all message strings passed to controller_print_perform_debug_control_socket_failure() into global static strings and update the function accordingly. - controller_print_perform_debug_control_socket_failure(&main->program.debug, F_status_set_fine(status), "could not be created"); + // @todo make all message strings passed to controller_print_debug_perform_control_socket_failure() into global static strings and update the function accordingly. + controller_print_debug_perform_control_socket_failure(&main->program.debug, F_status_set_fine(status), "could not be created"); } return status; @@ -110,7 +110,7 @@ extern "C" { controller_print_error(global->thread, &main->program.error, F_status_set_fine(status), macro_controller_f(f_socket_bind), F_true); } else { - controller_print_perform_debug_control_socket_failure(&main->program.debug, F_status_set_fine(status), "could not be bound"); + controller_print_debug_perform_control_socket_failure(&main->program.debug, F_status_set_fine(status), "could not be bound"); } return status; @@ -130,7 +130,7 @@ extern "C" { controller_print_error(global->thread, &main->program.error, F_status_set_fine(status), macro_controller_f(f_file_role_change), F_true); } else { - controller_print_perform_debug_control_socket_failure(&main->program.debug, F_status_set_fine(status), "failed to set file roles"); + controller_print_debug_perform_control_socket_failure(&main->program.debug, F_status_set_fine(status), "failed to set file roles"); } return status; @@ -151,7 +151,7 @@ extern "C" { controller_print_error(global->thread, &main->program.error, F_status_set_fine(status), macro_controller_f(f_file_role_change), F_true); } else { - controller_print_perform_debug_control_socket_failure(&main->program.debug, F_status_set_fine(status), "failed to set file mode"); + controller_print_debug_perform_control_socket_failure(&main->program.debug, F_status_set_fine(status), "failed to set file mode"); } return status; diff --git a/sources/c/main/print/action.c b/sources/c/main/print/action.c deleted file mode 100644 index 61f0547..0000000 --- a/sources/c/main/print/action.c +++ /dev/null @@ -1,9 +0,0 @@ -#include "../controller.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/sources/c/main/print/action.h b/sources/c/main/print/action.h deleted file mode 100644 index c020c90..0000000 --- a/sources/c/main/print/action.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print action functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_action_h -#define _controller_main_print_action_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_action_h diff --git a/sources/c/main/print/debug/perform/control.c b/sources/c/main/print/debug/perform/control.c new file mode 100644 index 0000000..232eb8b --- /dev/null +++ b/sources/c/main/print/debug/perform/control.c @@ -0,0 +1,68 @@ +#include "../../controller.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_controller_print_debug_perform_control_socket_failure_ + f_status_t controller_print_debug_perform_control_socket_failure(fl_print_t * const print, const f_status_t status, const f_string_t message) { + + if (!print || !print->custom) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%r%[%QControl socket '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, main->setting.path_control, print->notable); + fl_print_format("%[' %S, code %]", print->to, print->context, message, print->context); + fl_print_format(f_string_format_ui_single_s.string, print->to, print->notable, status, print->notable); + fl_print_format(f_string_format_sentence_end_s.string, print->to, print->context, print->context, f_string_eol_s); + + controller_unlock_print_flush(print->to, &main->thread); + } +#endif // _di_controller_print_debug_perform_control_socket_failure_ + +#ifndef _di_controller_print_debug_perform_control_socket_success_ + f_status_t controller_print_debug_perform_control_socket_success(fl_print_t * const print, const f_status_t status, const f_string_t message) { + + if (!print || !print->custom) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%rControl socket '", print->to, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, main->setting.path_control, print->notable); + fl_print_format("' created.%r", print->to, f_string_eol_s); + + controller_unlock_print_flush(print->to, &main->thread); + } +#endif // _di_controller_print_debug_perform_control_socket_success_ + +#ifndef _di_controller_print_debug_perform_control_socket_missing_read_only_ + f_status_t controller_print_debug_perform_control_socket_missing_read_only(fl_print_t * const print) { + + if (!print || !print->custom) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%r%[%QControl socket '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, main->setting.path_control, print->notable); + fl_print_format("' .%r", print->to, f_string_eol_s); + fl_print_format("%[' cannot be found while read only mode is enabled and so the Control socket is unavailable.%]%r", print->to, print->context, print->context, f_string_eol_s); + + controller_unlock_print_flush(print->to, &main->thread); + + return F_okay; + } +#endif // _di_controller_print_debug_perform_control_socket_missing_read_only_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sources/c/main/print/debug/perform/control.h b/sources/c/main/print/debug/perform/control.h new file mode 100644 index 0000000..d5c12b9 --- /dev/null +++ b/sources/c/main/print/debug/perform/control.h @@ -0,0 +1,87 @@ +/** + * FLL - Level 3 + * + * Project: Controller + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print debug perform control functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _controller_main_print_debug_perform_control_h +#define _controller_main_print_debug_perform_control_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print debug message about control socket failing for the reason specified. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * @param status + * The status code relating to the failure. + * @param message + * A short message describing the reason for the failure. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + */ +#ifndef _di_controller_print_debug_perform_control_socket_failure_ + extern f_status_t controller_print_debug_perform_control_socket_failure(fl_print_t * const print, const f_status_t status, const f_string_t message); +#endif // _di_controller_print_debug_perform_control_socket_failure_ + +/** + * Print debug message about control socket being created. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + */ +#ifndef _di_controller_print_debug_perform_control_socket_success_ + extern f_status_t controller_print_debug_perform_control_socket_success(fl_print_t * const print); +#endif // _di_controller_print_debug_perform_control_socket_success_ + +/** + * Print debug message about control socket missing in read only mode. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + */ +#ifndef _di_controller_print_debug_perform_control_socket_missing_read_only_ + extern f_status_t controller_print_debug_perform_control_socket_missing_read_only(fl_print_t * const print); +#endif // _di_controller_print_debug_perform_pid_file_control_socket_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _controller_main_print_debug_perform_control_h diff --git a/sources/c/main/print/debug/perform/pid.c b/sources/c/main/print/debug/perform/pid.c new file mode 100644 index 0000000..8b4efe5 --- /dev/null +++ b/sources/c/main/print/debug/perform/pid.c @@ -0,0 +1,78 @@ +#include "../../controller.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_controller_print_debug_perform_pid_file_control_socket_ + f_status_t controller_print_debug_perform_pid_file_control_socket(fl_print_t * const print) { + + if (!print || !print->custom) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%rPID file '", print->to, f_string_eol_s); + fl_print_format("%[%Q%]'.%r", print->to, print->notable, main->setting.path_pid, print->notable, f_string_eol_s); + + if (main->setting.path_control.used) { + fl_print_format("%rControl socket '", print->to, f_string_eol_s); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, main->setting.path_control, print->notable); + fl_print_format("'.%r", print->to, f_string_eol_s); + } + + controller_unlock_print_flush(print->to, &main->thread); + + return F_okay; + } +#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_string_t function, const f_status_t status, 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; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + if (F_status_set_fine(status) == F_read_only) { + fl_print_format("%r%[%QThe pid file '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, main->setting.path_pid, print->notable); + 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, F_true, main->setting.path_pid, f_file_operation_create_s, fll_error_file_type_file_e, status); + } + + f_file_stream_lock(print->to); + + controller_print_error_entry_cache(print->to, &main->thread.cache.action, is_entry); + + controller_unlock_print_flush(print->to, &main->thread); + } +#endif // _di_controller_print_debug_perform_pid_file_create_problem_ + +#ifndef _di_controller_print_debug_perform_pid_file_create_success_ + f_status_t controller_print_debug_perform_pid_file_create_success(fl_print_t * const print, 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; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%rPID file '", print->to, f_string_eol_s); + fl_print_format("%[%Q%]' created.%r", print->to, print->notable, main->setting.path_pid, print->notable, f_string_eol_s); + + controller_unlock_print_flush(print->to, &main->thread); + } +#endif // _di_controller_print_debug_perform_pid_file_create_success_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sources/c/main/print/debug/perform/pid.h b/sources/c/main/print/debug/perform/pid.h new file mode 100644 index 0000000..e148342 --- /dev/null +++ b/sources/c/main/print/debug/perform/pid.h @@ -0,0 +1,94 @@ +/** + * FLL - Level 3 + * + * Project: Controller + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print debug perform pid functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _controller_main_print_debug_perform_pid_h +#define _controller_main_print_debug_perform_pid_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print debug message about PID file and control socket. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + */ +#ifndef _di_controller_print_debug_perform_pid_file_control_socket_ + extern f_status_t controller_print_debug_perform_pid_file_control_socket(fl_print_t * const print); +#endif // _di_controller_print_debug_perform_pid_file_control_socket_ + +/** + * Print debug message on problems when creating PID file. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * @param function + * The name of the function associated with the error. + * @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 is_entry + * If TRUE, then this operates as an entry. + * If FALSE, then this operates as an exit. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + */ +#ifndef _di_controller_print_debug_perform_pid_file_create_problem_ + extern f_status_t controller_print_debug_perform_pid_file_create_problem(fl_print_t * const print, const f_string_t function, const f_status_t status, const uint8_t is_entry); +#endif // _di_controller_print_debug_perform_pid_file_create_problem_ + +/** + * Print debug message on success when creating PID file. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * @param is_entry + * If TRUE, then this operates as an entry. + * If FALSE, then this operates as an exit. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + */ +#ifndef _di_controller_print_debug_perform_pid_file_create_success_ + extern f_status_t controller_print_debug_perform_pid_file_create_success(fl_print_t * const print, const uint8_t is_entry); +#endif // _di_controller_print_debug_perform_pid_file_create_success_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _controller_main_print_debug_perform_pid_h diff --git a/sources/c/main/print/debug/rule/action.c b/sources/c/main/print/debug/rule/action.c new file mode 100644 index 0000000..e317db9 --- /dev/null +++ b/sources/c/main/print/debug/rule/action.c @@ -0,0 +1,29 @@ +#include "../../../controller.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_controller_print_debug_rule_action_empty_ + f_status_t controller_print_debug_rule_action_empty(fl_print_t * const print, controller_cache_t * const cache) { + + if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%r%[%QAction is empty, nothing to do.%]%r", print->to, f_string_eol_s, print->context, print->prefix, print->context, f_string_eol_s); + + controller_print_error_rule_cache(print, &cache->action, F_true); + + controller_unlock_print_flush(print->to, &main->thread); + + return F_okay; + } +#endif // _di_controller_print_debug_rule_action_empty_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sources/c/main/print/debug/rule/action.h b/sources/c/main/print/debug/rule/action.h new file mode 100644 index 0000000..3a5afd2 --- /dev/null +++ b/sources/c/main/print/debug/rule/action.h @@ -0,0 +1,52 @@ +/** + * FLL - Level 3 + * + * Project: Controller + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print debug entry action functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _controller_main_print_debug_entry_action_h +#define _controller_main_print_debug_entry_action_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print debug message about the rule item action being empty. + * + * @param print + * The output structure to print to. + * + * Must not be NULL. + * @param cache + * A structure for containing and caching relevant data. + * + * Must not be NULL. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fl_print_format() + * @see fll_error_print() + * + * @see controller_lock_print() + * @see controller_print_error_rule_cache() + * @see controller_unlock_print_flush() + */ +#ifndef _di_controller_print_debug_rule_action_empty_ + extern f_status_t controller_print_debug_rule_action_empty(fl_print_t * const print, controller_cache_t * const cache); +#endif // _di_controller_print_debug_rule_action_empty_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _controller_main_print_debug_entry_action_h diff --git a/sources/c/main/print/debug/rule/execute.c b/sources/c/main/print/debug/rule/execute.c new file mode 100644 index 0000000..1daaa0a --- /dev/null +++ b/sources/c/main/print/debug/rule/execute.c @@ -0,0 +1,41 @@ +#include "../../../controller.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_controller_main_print_debug_rule_execute_rerun_ + f_status_t controller_main_print_debug_rule_execute_rerun(fl_print_t * const print, controller_rule_rerun_item_t * const rerun, const uint8_t action) { + + if (!print || !print->custom || !rerun) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%rRe-running '", print->to, f_string_eol_s); + fl_print_format("%[%r%]' '", print->to, print->set->title, instance->rule.alias, print->set->title); + fl_print_format("%[%r%]' with a ", print->to, print->set->notable, controller_convert_rule_action_execute_type_string(action), print->set->notable); + fl_print_format("%[%r%] of ", print->to, print->set->notable, controller_delay_s, print->set->notable); + fl_print_format("%[%ul%] MegaTime", print->to, print->set->notable, rerun->delay, print->set->notable); + + if (rerun->max) { + fl_print_format(" for %[%ul%]", print->to, print->set->notable, rerun->count, print->set->notable); + fl_print_format(" of %[%r%] ", print->to, print->set->notable, controller_max_s, print->set->notable); + fl_print_format(f_string_format_un_single_s.string, print->to, print->set->notable, rerun->max, print->set->notable); + fl_print_format(".%r", print->to, f_string_eol_s); + } + else { + fl_print_format(" with no %[%r%].%r", print->to, print->set->notable, controller_max_s, print->set->notable, f_string_eol_s); + } + + controller_unlock_print_flush(print->to, &main->thread); + + return F_okay; + } +#endif // _di_controller_main_print_debug_rule_execute_rerun_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sources/c/main/print/debug/rule/execute.h b/sources/c/main/print/debug/rule/execute.h new file mode 100644 index 0000000..851f1c5 --- /dev/null +++ b/sources/c/main/print/debug/rule/execute.h @@ -0,0 +1,54 @@ +/** + * FLL - Level 3 + * + * Project: Controller + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print debug entry action functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _controller_main_print_debug_rule_execute_h +#define _controller_main_print_debug_rule_execute_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print debug message about re-running the execution of some action. + * + * @param print + * The output structure to print to. + * + * Must not be NULL. + * @param rerun + * The rerun data. + * + * Must not be NULL. + * @param action + * The ID of the action being re-run. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fl_print_format() + * @see fll_error_print() + * + * @see controller_lock_print() + * @see controller_print_error_rule_cache() + * @see controller_unlock_print_flush() + */ +#ifndef _di_controller_main_print_debug_rule_execute_rerun_ + extern f_status_t controller_main_print_debug_rule_execute_rerun(fl_print_t * const print, controller_rule_rerun_item_t * const rerun, const uint8_t action); +#endif // _di_controller_main_print_debug_rule_execute_rerun_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _controller_main_print_debug_rule_execute_h diff --git a/sources/c/main/print/entry/error.c b/sources/c/main/print/error/entry.c similarity index 86% rename from sources/c/main/print/entry/error.c rename to sources/c/main/print/error/entry.c index 94d9091..22e05b6 100644 --- a/sources/c/main/print/entry/error.c +++ b/sources/c/main/print/error/entry.c @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef _di_controller_print_entry_error_ - f_status_t controller_print_entry_error(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback) { +#ifndef _di_controller_print_error_entry_ + f_status_t controller_print_error_entry(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -20,16 +20,16 @@ extern "C" { f_file_stream_lock(print->to); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_error_ +#endif // _di_controller_print_error_entry_ -#ifndef _di_controller_print_entry_error_cache_ - f_status_t controller_print_entry_error_cache(fl_print_t * const print, controller_cache_action_t * const cache, const uint8_t is_entry) { +#ifndef _di_controller_print_error_entry_cache_ + f_status_t controller_print_error_entry_cache(fl_print_t * const print, controller_cache_action_t * const cache, const uint8_t is_entry) { if (!print || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -61,10 +61,10 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_entry_error_cache_ +#endif // _di_controller_print_error_entry_cache_ -#ifndef _di_controller_print_entry_error_file_ - f_status_t controller_print_entry_error_file(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { +#ifndef _di_controller_print_error_entry_file_ + f_status_t controller_print_error_entry_file(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -79,13 +79,13 @@ extern "C" { f_file_stream_lock(print->to); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_error_file_ +#endif // _di_controller_print_error_entry_file_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/error.h b/sources/c/main/print/error/entry.h similarity index 87% rename from sources/c/main/print/entry/error.h rename to sources/c/main/print/error/entry.h index e902115..18b2871 100644 --- a/sources/c/main/print/entry/error.h +++ b/sources/c/main/print/error/entry.h @@ -52,11 +52,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_error_ - extern f_status_t controller_print_entry_error(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback); -#endif // _di_controller_print_entry_error_ +#ifndef _di_controller_print_error_entry_ + extern f_status_t controller_print_error_entry(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback); +#endif // _di_controller_print_error_entry_ /** * Print additional error/warning information in addition to existing error that is found within the cache. @@ -90,9 +90,9 @@ extern "C" { * @see controller_entry_actions_read() * @see controller_entry_read() */ -#ifndef _di_controller_print_entry_error_cache_ - extern f_status_t controller_print_entry_error_cache(fl_print_t * const print, controller_cache_action_t * const cache, const uint8_t is_entry); -#endif // _di_controller_print_entry_error_cache_ +#ifndef _di_controller_print_error_entry_cache_ + extern f_status_t controller_print_error_entry_cache(fl_print_t * const print, controller_cache_action_t * const cache, const uint8_t is_entry); +#endif // _di_controller_print_error_entry_cache_ /** * Print the entry related file error. @@ -135,11 +135,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_error_file_ - extern f_status_t controller_print_entry_error_file(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const uint8_t fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type); -#endif // _di_controller_print_entry_error_file_ +#ifndef _di_controller_print_error_entry_file_ + extern f_status_t controller_print_error_entry_file(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const uint8_t fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type); +#endif // _di_controller_print_error_entry_file_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/error/entry/action.c b/sources/c/main/print/error/entry/action.c new file mode 100644 index 0000000..5d486dd --- /dev/null +++ b/sources/c/main/print/error/entry/action.c @@ -0,0 +1,53 @@ +#include "../../../controller.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_controller_print_error_entry_action_execution_failure_ + f_status_t controller_print_error_entry_action_execution_failure(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const int code) { + + if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_error_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%r%[%QExecution failed with return value of '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); + fl_print_format(f_string_format_i_single_s.string, print->to, print->notable, code, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); + + controller_print_error_entry_cache(print, &cache->action, is_entry); + + controller_unlock_print_flush(print->to, &main->thread); + + return F_okay; + } +#endif // _di_controller_print_error_entry_action_execution_failure_ + +#ifndef _di_controller_print_error_entry_action_execution_missing_ + f_status_t controller_print_error_entry_action_execution_missing(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name) { + + if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_error_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%r%[%QExecution failed, unable to find program or script '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); + + controller_print_error_entry_cache(print, &cache->action, is_entry); + + controller_unlock_print_flush(print->to, &main->thread); + + return F_okay; + } +#endif // _di_controller_print_error_entry_action_execution_missing_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sources/c/main/print/error/entry/action.h b/sources/c/main/print/error/entry/action.h new file mode 100644 index 0000000..32da325 --- /dev/null +++ b/sources/c/main/print/error/entry/action.h @@ -0,0 +1,91 @@ +/** + * FLL - Level 3 + * + * Project: Controller + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print entry error action functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _controller_main_print_entry_error_action_h +#define _controller_main_print_entry_error_action_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print an error about a entry item action program or script execution failure. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * + * Must not be NULL. + * @param cache + * The cache. + * + * Must not be NULL. + * @param is_entry + * If TRUE, then this loads as an entry. + * If FALSE, then this loads as an exit. + * @param code + * The return code. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fll_error_file_print() + * @see controller_print_error_entry_cache() + */ +#ifndef _di_controller_print_error_entry_action_execution_failure_ + extern f_status_t controller_print_error_entry_action_execution_failure(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const int code); +#endif // _di_controller_print_error_entry_action_execution_failure_ + +/** + * Print an error about a entry item action program or script not being found. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * + * Must not be NULL. + * @param cache + * The cache. + * + * Must not be NULL. + * @param is_entry + * If TRUE, then this loads as an entry. + * If FALSE, then this loads as an exit. + * @param name + * The program or script name. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fll_error_file_print() + * @see controller_print_error_entry_cache() + */ +#ifndef _di_controller_print_error_entry_action_execution_missing_ + extern f_status_t controller_print_error_entry_action_execution_missing(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name); +#endif // _di_controller_print_error_entry_action_execution_missing_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _controller_main_print_entry_error_action_h diff --git a/sources/c/main/print/entry/error/item.c b/sources/c/main/print/error/entry/item.c similarity index 50% rename from sources/c/main/print/entry/error/item.c rename to sources/c/main/print/error/entry/item.c index 6507a75..b5a569e 100644 --- a/sources/c/main/print/entry/error/item.c +++ b/sources/c/main/print/error/entry/item.c @@ -4,52 +4,8 @@ extern "C" { #endif -#ifndef _di_controller_print_entry_error_item_action_execution_failure_ - f_status_t controller_print_entry_error_item_action_execution_failure(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const int code) { - - if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); - if (print->verbosity < f_console_verbosity_error_e) return F_output_not; - - controller_t * const main = (controller_t *) print->custom; - - controller_lock_print(print->to, &main->thread); - - fl_print_format("%r%[%QExecution failed with return value of '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); - fl_print_format(f_string_format_i_single_s.string, print->to, print->notable, code, print->notable); - fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); - - controller_print_entry_error_cache(print, &cache->action, is_entry); - - controller_unlock_print_flush(print->to, &main->thread); - - return F_okay; - } -#endif // _di_controller_print_entry_error_item_action_execution_failure_ - -#ifndef _di_controller_print_entry_error_item_action_execution_missing_ - f_status_t controller_print_entry_error_item_action_execution_missing(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name) { - - if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); - if (print->verbosity < f_console_verbosity_error_e) return F_output_not; - - controller_t * const main = (controller_t *) print->custom; - - controller_lock_print(print->to, &main->thread); - - fl_print_format("%r%[%QExecution failed, unable to find program or script '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); - fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); - fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); - - controller_print_entry_error_cache(print, &cache->action, is_entry); - - controller_unlock_print_flush(print->to, &main->thread); - - return F_okay; - } -#endif // _di_controller_print_entry_error_item_action_execution_missing_ - -#ifndef _di_controller_print_entry_error_item_failure_ - f_status_t controller_print_entry_error_item_failure(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name, const f_string_static_t message) { +#ifndef _di_controller_print_error_entry_item_failure_ + f_status_t controller_print_error_entry_item_failure(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name, const f_string_static_t message) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -62,16 +18,16 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, parameter, print->notable); fl_print_format("%[' %S.%]%r", print->to, print->context, message, print->context, f_string_eol_s); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_error_item_failure_ +#endif // _di_controller_print_error_entry_item_failure_ -#ifndef _di_controller_print_entry_error_item_invalid_ - f_status_t controller_print_entry_error_item_invalid(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t number) { +#ifndef _di_controller_print_error_entry_item_invalid_ + f_status_t controller_print_error_entry_item_invalid(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t number) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -84,16 +40,16 @@ extern "C" { fl_print_format(f_string_format_un_single_s.string, print->to, print->notable, number, print->notable); fl_print_format("%[' detected.%]%r", print->to, print->context, print->context, f_string_eol_s); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_error_item_invalid_ +#endif // _di_controller_print_error_entry_item_invalid_ -#ifndef _di_controller_print_entry_error_item_setting_support_not_option_ - f_status_t controller_print_entry_error_item_setting_support_not_option(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t setting) { +#ifndef _di_controller_print_error_entry_item_setting_support_not_option_ + f_status_t controller_print_error_entry_item_setting_support_not_option(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t setting) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -109,13 +65,13 @@ extern "C" { fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->notable, cache->buffer_file, setting, print->notable); fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_error_item_setting_support_not_option_ +#endif // _di_controller_print_error_entry_item_setting_support_not_option_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/error/item.h b/sources/c/main/print/error/entry/item.h similarity index 51% rename from sources/c/main/print/entry/error/item.h rename to sources/c/main/print/error/entry/item.h index 186bed5..dc5fd80 100644 --- a/sources/c/main/print/entry/error/item.h +++ b/sources/c/main/print/error/entry/item.h @@ -17,74 +17,6 @@ extern "C" { #endif /** - * Print an error about a entry item action program or script execution failure. - * - * @param print - * The output structure to print to. - * - * This requires print.custom to be controller_t. - * - * This does not alter print.custom.setting.state.status. - * - * Must not be NULL. - * @param cache - * The cache. - * - * Must not be NULL. - * @param is_entry - * If TRUE, then this loads as an entry. - * If FALSE, then this loads as an exit. - * @param code - * The return code. - * - * @return - * F_okay on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - * - * @see fll_error_file_print() - * @see controller_print_entry_error_cache() - */ -#ifndef _di_controller_print_entry_error_item_action_execution_failure_ - extern f_status_t controller_print_entry_error_item_action_execution_failure(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const int code); -#endif // _di_controller_print_entry_error_item_action_execution_failure_ - -/** - * Print an error about a entry item action program or script not being found. - * - * @param print - * The output structure to print to. - * - * This requires print.custom to be controller_t. - * - * This does not alter print.custom.setting.state.status. - * - * Must not be NULL. - * @param cache - * The cache. - * - * Must not be NULL. - * @param is_entry - * If TRUE, then this loads as an entry. - * If FALSE, then this loads as an exit. - * @param name - * The program or script name. - * - * @return - * F_okay on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - * - * @see fll_error_file_print() - * @see controller_print_entry_error_cache() - */ -#ifndef _di_controller_print_entry_error_item_action_execution_missing_ - extern f_status_t controller_print_entry_error_item_action_execution_missing(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name); -#endif // _di_controller_print_entry_error_item_action_execution_missing_ - -/** * Print the entry item related error. * * @param print @@ -114,11 +46,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_error_item_failure_ - extern f_status_t controller_print_entry_error_item_failure(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name, const f_string_static_t message); -#endif // _di_controller_print_entry_error_item_failure_ +#ifndef _di_controller_print_error_entry_item_failure_ + extern f_status_t controller_print_error_entry_item_failure(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name, const f_string_static_t message); +#endif // _di_controller_print_error_entry_item_failure_ /** * Print an error message for an invalid entry item. @@ -148,11 +80,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_error_item_invalid_ - extern f_status_t controller_print_entry_error_item_invalid(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t number); -#endif // _di_controller_print_entry_error_item_invalid_ +#ifndef _di_controller_print_error_entry_item_invalid_ + extern f_status_t controller_print_error_entry_item_invalid(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t number); +#endif // _di_controller_print_error_entry_item_invalid_ /** * Print an error message about an entry it setting option not being supported. @@ -182,11 +114,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_error_item_setting_support_not_option_ - extern f_status_t controller_print_entry_error_item_setting_support_not_option(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t setting); -#endif // _di_controller_print_entry_error_item_setting_support_not_option_ +#ifndef _di_controller_print_error_entry_item_setting_support_not_option_ + extern f_status_t controller_print_error_entry_item_setting_support_not_option(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t setting); +#endif // _di_controller_print_error_entry_item_setting_support_not_option_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/error/setting.c b/sources/c/main/print/error/entry/setting.c similarity index 81% rename from sources/c/main/print/entry/error/setting.c rename to sources/c/main/print/error/entry/setting.c index a6dd5f2..ea09801 100644 --- a/sources/c/main/print/entry/error/setting.c +++ b/sources/c/main/print/error/entry/setting.c @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef _di_controller_print_entry_error_setting_with_range_ - f_status_t controller_print_entry_error_setting_with_range(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_t before, const f_range_t range, const f_string_t after) { +#ifndef _di_controller_print_error_entry_setting_with_range_ + f_status_t controller_print_error_entry_setting_with_range(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_t before, const f_range_t range, const f_string_t after) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -18,16 +18,16 @@ extern "C" { fl_print_format("%[%/Q%]", print->to.stream, print->notable, cache->buffer_file, range, print->notable); fl_print_format("%['%S.%]%r", print->to.stream, print->context, after, print->context, f_string_eol_s); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_error_setting_with_range_ +#endif // _di_controller_print_error_entry_setting_with_range_ -#ifndef _di_controller_print_entry_error_setting_ignored_ - f_status_t controller_print_entry_error_setting_ignored(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry) { +#ifndef _di_controller_print_error_entry_setting_ignored_ + f_status_t controller_print_error_entry_setting_ignored(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; @@ -40,16 +40,16 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, print->to.stream, print->notable, cache->action.name_action, print->notable); fl_print_format("%[' is being ignored.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_error_setting_ignored_ +#endif // _di_controller_print_error_entry_setting_ignored_ -#ifndef _di_controller_print_entry_error_setting_requires_between_ - f_status_t controller_print_entry_error_setting_requires_between(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t minimum, const f_number_unsigned_t maximum) { +#ifndef _di_controller_print_error_entry_setting_requires_between_ + f_status_t controller_print_error_entry_setting_requires_between(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t minimum, const f_number_unsigned_t maximum) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -66,16 +66,16 @@ extern "C" { fl_print_format(f_string_format_un_single_s.string, print->to.stream, print->notable, maximum, print->notable); fl_print_format("%[ Content.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_error_setting_requires_between_ +#endif // _di_controller_print_error_entry_setting_requires_between_ -#ifndef _di_controller_print_entry_error_setting_requires_exactly_ - f_status_t controller_print_entry_error_setting_requires_exactly(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t total) { +#ifndef _di_controller_print_error_entry_setting_requires_exactly_ + f_status_t controller_print_error_entry_setting_requires_exactly(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t total) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -90,16 +90,16 @@ extern "C" { fl_print_format(f_string_format_un_single_s.string, print->to.stream, print->notable, total, print->notable); fl_print_format("%[ Content.%]%r", print->to.stream, print->context, print->context, f_string_eol_s); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_error_setting_requires_exactly_ +#endif // _di_controller_print_error_entry_setting_requires_exactly_ -#ifndef _di_controller_print_entry_error_setting_support_not_number_ - f_status_t controller_print_entry_error_setting_support_not_number(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t buffer, const f_range_t range) { +#ifndef _di_controller_print_error_entry_setting_support_not_number_ + f_status_t controller_print_error_entry_setting_support_not_number(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t buffer, const f_range_t range) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -116,7 +116,7 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_entry_error_setting_support_not_number_ +#endif // _di_controller_print_error_entry_setting_support_not_number_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/error/setting.h b/sources/c/main/print/error/entry/setting.h similarity index 84% rename from sources/c/main/print/entry/error/setting.h rename to sources/c/main/print/error/entry/setting.h index effdee5..f473c31 100644 --- a/sources/c/main/print/entry/error/setting.h +++ b/sources/c/main/print/error/entry/setting.h @@ -52,9 +52,9 @@ extern "C" { * * @see controller_entry_settings_read() */ -#ifndef _di_controller_print_entry_error_setting_with_range_ - extern f_status_t controller_print_entry_error_setting_with_range(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_t before, const f_range_t range, const f_string_t after); -#endif // _di_controller_print_entry_error_setting_with_range_ +#ifndef _di_controller_print_error_entry_setting_with_range_ + extern f_status_t controller_print_error_entry_setting_with_range(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_t before, const f_range_t range, const f_string_t after); +#endif // _di_controller_print_error_entry_setting_with_range_ /** * Print a message for when an entry setting is being ignored. @@ -81,9 +81,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_entry_error_setting_ignored_ - extern f_status_t controller_print_entry_error_setting_ignored(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry); -#endif // _di_controller_print_entry_error_setting_ignored_ +#ifndef _di_controller_print_error_entry_setting_ignored_ + extern f_status_t controller_print_error_entry_setting_ignored(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry); +#endif // _di_controller_print_error_entry_setting_ignored_ /** * Print a message for when an entry setting action has the incorrect number of parameters when the required amount is between a range. @@ -114,9 +114,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_entry_error_setting_requires_between_ - extern f_status_t controller_print_entry_error_setting_requires_between(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t minimum, const f_number_unsigned_t maximum); -#endif // _di_controller_print_entry_error_setting_requires_between_ +#ifndef _di_controller_print_error_entry_setting_requires_between_ + extern f_status_t controller_print_error_entry_setting_requires_between(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t minimum, const f_number_unsigned_t maximum); +#endif // _di_controller_print_error_entry_setting_requires_between_ /** * Print a message for when an entry setting action has the incorrect number of parameters when the required amount is fixed. @@ -145,9 +145,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_entry_error_setting_requires_exactly_ - extern f_status_t controller_print_entry_error_setting_requires_exactly(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t total); -#endif // _di_controller_print_entry_error_setting_requires_exactly_ +#ifndef _di_controller_print_error_entry_setting_requires_exactly_ + extern f_status_t controller_print_error_entry_setting_requires_exactly(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_number_unsigned_t total); +#endif // _di_controller_print_error_entry_setting_requires_exactly_ /** * Print an error message about an entry setting value not being a supported number. @@ -177,11 +177,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_error_setting_support_not_number_ - extern f_status_t controller_print_entry_error_setting_support_not_number(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t buffer, const f_range_t range); -#endif // _di_controller_print_entry_error_setting_support_not_number_ +#ifndef _di_controller_print_error_entry_setting_support_not_number_ + extern f_status_t controller_print_error_entry_setting_support_not_number(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t buffer, const f_range_t range); +#endif // _di_controller_print_error_entry_setting_support_not_number_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/error/lock.c b/sources/c/main/print/error/lock.c new file mode 100644 index 0000000..d4bfbab --- /dev/null +++ b/sources/c/main/print/error/lock.c @@ -0,0 +1,49 @@ +#include "../../controller.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_controller_print_error_lock_critical_ + f_status_t controller_print_error_lock_critical(fl_print_t * const print, const f_status_t status, const uint8_t is_read) { + + // A signal is not an error. + if (!print || !cache) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_error_e || status == F_interrupt) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%r%[%QThe pid file '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); + fl_print_format("%['Critical failure while attempting to establish '%]", print->to, print->context, print->context); + fl_print_format("%[%r lock%]", print->to, print->notable, is_read ? f_file_operation_read_s : f_file_operation_write_s, print->notable); + + if (status != F_failure) { + fl_print_format(" %['due to%] ", print->to, print->context, print->context); + + if (status == F_parameter) { + fl_print_format("%[Invalid Parameter%]", print->to, print->notable, print->notable); + } + else if (status == F_deadlock) { + fl_print_format("%[Deadlock%]", print->to, print->notable, print->notable); + } + else if (status == F_resource_not) { + fl_print_format("%[Too Many Locks%]", print->to, print->notable, print->notable); + } + else { + fl_print_format("%[Unknown Error%]", print->to, print->notable, print->notable); + } + } + + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); + + controller_unlock_print_flush(print->to, &main->thread); + + return F_okay; + } +#endif // _di_controller_print_error_lock_critical_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sources/c/main/print/error/lock.h b/sources/c/main/print/error/lock.h new file mode 100644 index 0000000..3bc4ad0 --- /dev/null +++ b/sources/c/main/print/error/lock.h @@ -0,0 +1,54 @@ +/** + * FLL - Level 3 + * + * Project: Controller + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print error lock functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _controller_main_print_error_lock_h +#define _controller_main_print_error_lock_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print a r/w lock related error message, locking the print mutex during the print. + * + * This will ignore F_interrupt and not print any messages, if passed. + * + * @param print + * The output structure to print to. + * + * Must not be NULL. + * + * This does not alter print.custom.setting.state.status. + * @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 is_read + * If TRUE, then this is for a read lock. + * If FALSE, then this is for a write lock. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fll_error_print() + * @see controller_print_error_entry_cache() + */ +#ifndef _di_controller_print_error_lock_critical_ + extern f_status_t controller_print_error_lock_critical(fl_print_t * const print, const f_status_t status, const uint8_t is_read); +#endif // _di_controller_print_error_lock_critical_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _controller_main_print_error_lock_h diff --git a/sources/c/main/print/error/perform/pid.c b/sources/c/main/print/error/perform/pid.c new file mode 100644 index 0000000..5164bea --- /dev/null +++ b/sources/c/main/print/error/perform/pid.c @@ -0,0 +1,29 @@ +#include "../../controller.h" + +#ifdef __cplusplus +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_string_t function, const f_status_t status, const uint8_t is_entry) { + + if (!print || !print->custom) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_error_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + controller_print_error_file_status(print, function, F_true, main->setting.path_pid, f_file_operation_create_s, fll_error_file_type_file_e, status); + + f_file_stream_lock(print->to); + + controller_print_error_entry_cache(print->to, &main->thread.cache.action, is_entry); + + controller_unlock_print_flush(print->to, &main->thread); + } +#endif // _di_controller_print_error_perform_pid_file_create_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sources/c/main/print/error/perform/pid.h b/sources/c/main/print/error/perform/pid.h new file mode 100644 index 0000000..95b9a77 --- /dev/null +++ b/sources/c/main/print/error/perform/pid.h @@ -0,0 +1,122 @@ +/** + * FLL - Level 3 + * + * Project: Controller + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print error perform pid functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _controller_main_print_error_perform_pid_h +#define _controller_main_print_error_perform_pid_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print debug message about PID file and control socket. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + */ +#ifndef _di_controller_print_debug_perform_pid_file_control_socket_ + extern f_status_t controller_print_debug_perform_pid_file_control_socket(fl_print_t * const print); +#endif // _di_controller_print_debug_perform_pid_file_control_socket_ + +/** + * Print debug message on problems when creating PID file. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * @param function + * The name of the function associated with the error. + * @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 is_entry + * If TRUE, then this operates as an entry. + * If FALSE, then this operates as an exit. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + */ +#ifndef _di_controller_print_debug_perform_pid_file_create_problem_ + extern f_status_t controller_print_debug_perform_pid_file_create_problem(fl_print_t * const print, const f_string_t function, const f_status_t status, const uint8_t is_entry); +#endif // _di_controller_print_debug_perform_pid_file_create_problem_ + +/** + * Print debug message on success when creating PID file. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * @param is_entry + * If TRUE, then this operates as an entry. + * If FALSE, then this operates as an exit. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + */ +#ifndef _di_controller_print_debug_perform_pid_file_create_success_ + extern f_status_t controller_print_debug_perform_pid_file_create_success(fl_print_t * const print, const uint8_t is_entry); +#endif // _di_controller_print_debug_perform_pid_file_create_success_ + +/** + * Print error message on problems when creating PID file. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * @param function + * The name of the function associated with the error. + * @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 is_entry + * If TRUE, then this operates as an entry. + * If FALSE, then this operates as an exit. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * 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_string_t function, const f_status_t status, const uint8_t is_entry); +#endif // _di_controller_print_error_perform_pid_file_create_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _controller_main_print_error_perform_pid_h diff --git a/sources/c/main/print/rule.c b/sources/c/main/print/error/rule.c similarity index 63% rename from sources/c/main/print/rule.c rename to sources/c/main/print/error/rule.c index 52ddcbf..a8e492b 100644 --- a/sources/c/main/print/rule.c +++ b/sources/c/main/print/error/rule.c @@ -1,11 +1,11 @@ -#include "../controller.h" +#include "../../controller.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_controller_print_rule_error_ - f_status_t controller_print_rule_error(fl_print_t * const print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item) { +#ifndef _di_controller_print_error_rule_ + f_status_t controller_print_error_rule(fl_print_t * const print, controller_cache_action_t * const cache, const f_status_t status, const f_string_t function, const uint8_t fallback, const uint8_t item) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -20,47 +20,47 @@ extern "C" { f_file_stream_lock(print->to); - controller_print_rule_error_cache(print, cache, item); + controller_print_error_rule_cache(print, cache, item); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_rule_error_ +#endif // _di_controller_print_error_rule_ -#ifndef _di_controller_print_rule_error_cache_ - f_status_t controller_print_rule_error_cache(fl_print_t * const print, const controller_cache_action_t cache, const bool item) { +#ifndef _di_controller_print_error_rule_cache_ + f_status_t controller_print_error_rule_cache(fl_print_t * const print, controller_cache_action_t * const cache, const uint8_t item) { - if (!print) return F_status_set_error(F_output_not); + if (!print || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; fl_print_format("%r%[%QWhile processing ", print->to, f_string_eol_s, print->context, print->prefix); - if (cache.name_action.used) { + if (cache->name_action.used) { fl_print_format("%r '%]", print->to, item ? controller_action_s : controller_value_s, print->context); - fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache.name_action, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache->name_action, print->notable); fl_print_format("%[' on line%] ", print->to, print->context, print->context); - fl_print_format(f_string_format_un_single_s.string, print->to, print->notable, cache.line_action, print->notable); + fl_print_format(f_string_format_un_single_s.string, print->to, print->notable, cache->line_action, print->notable); fl_print_format("%[ for ", print->to, print->context); } - if (cache.name_item.used) { + if (cache->name_item.used) { fl_print_format("rule %r '%]", print->to, item ? controller_item_s : controller_settings_s, print->context); - fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache.name_item, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache->name_item, print->notable); fl_print_format("%[' on line%] ", print->to, print->context, print->context); - fl_print_format(f_string_format_un_single_s.string, print->to, print->notable, cache.line_item, print->notable); + fl_print_format(f_string_format_un_single_s.string, print->to, print->notable, cache->line_item, print->notable); fl_print_format("%[ for ", print->to, print->context); } - if (cache.name_file.used) { - fl_print_format("rule file '%]%[%Q%]%['", print->to, print->context, print->notable, cache.name_file, print->notable, print->context); + if (cache->name_file.used) { + fl_print_format("rule file '%]%[%Q%]%['", print->to, print->context, print->notable, cache->name_file, print->notable, print->context); } fl_print_format(".%]%r", print->to, print->context, f_string_eol_s); return F_okay; } -#endif // _di_controller_print_rule_error_cache_ +#endif // _di_controller_print_error_rule_cache_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/error/rule.h b/sources/c/main/print/error/rule.h new file mode 100644 index 0000000..e9ed73d --- /dev/null +++ b/sources/c/main/print/error/rule.h @@ -0,0 +1,101 @@ +/** + * FLL - Level 3 + * + * Project: Controller + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print rule error functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _controller_main_print_rule_error_h +#define _controller_main_print_rule_error_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print generic error/warning information. + * + * This is essentially a wrapper to fll_error_print() that includes locking. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * + * Must not be NULL. + * @param cache + * The cache. + * + * Must not be NULL. + * @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 fallback + * Set to F_true to print the fallback error message for unknown errors. + * @param item + * If TRUE, then this error is associated with an item. + * If FALSE, then this error is associated with a rule setting. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fll_error_print() + * @see controller_print_error_rule_cache() + */ +#ifndef _di_controller_print_error_rule_ + extern f_status_t controller_print_error_rule(fl_print_t * const print, controller_cache_action_t * const cache, const f_status_t status, const f_string_t function, const uint8_t fallback, const uint8_t item); +#endif // _di_controller_print_error_rule_ + +/** + * Print additional error/warning information in addition to existing error. + * + * This is explicitly intended to be used in addition to the error message. + * + * This neither locks the thread nor does it check to see if output is enabled or disabled. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * + * Must not be NULL. + * @param cache + * The cache. + * + * Must not be NULL. + * @param item + * If TRUE, then this error is associated with an item. + * If FALSE, then this error is associated with a rule setting. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fll_error_print() + * @see controller_print_error_entry_cache() + */ +#ifndef _di_controller_print_error_rule_cache_ + extern f_status_t controller_print_error_rule_cache(fl_print_t * const print, controller_cache_action_t * const cache, const uint8_t item); +#endif // _di_controller_print_error_rule_cache_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _controller_main_print_rule_error_h diff --git a/sources/c/main/print/rule/action.c b/sources/c/main/print/error/rule/action.c similarity index 72% rename from sources/c/main/print/rule/action.c rename to sources/c/main/print/error/rule/action.c index d8f7cf4..ddb61f3 100644 --- a/sources/c/main/print/rule/action.c +++ b/sources/c/main/print/error/rule/action.c @@ -1,11 +1,11 @@ -#include "../../controller.h" +#include "../../../controller.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_controller_print_rule_action_error_missing_pid_ - f_status_t controller_print_rule_action_error_missing_pid(fl_print_t * const print, const f_string_static_t alias) { +#ifndef _di_controller_print_error_rule_action_missing_pid_ + f_status_t controller_print_error_rule_action_missing_pid(fl_print_t * const print, const f_string_static_t alias) { if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -15,7 +15,7 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_rule_action_error_missing_pid_ +#endif // _di_controller_print_error_rule_action_missing_pid_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/rule/action.h b/sources/c/main/print/error/rule/action.h similarity index 64% rename from sources/c/main/print/rule/action.h rename to sources/c/main/print/error/rule/action.h index 1875a89..e933fb0 100644 --- a/sources/c/main/print/rule/action.h +++ b/sources/c/main/print/error/rule/action.h @@ -5,12 +5,12 @@ * API Version: 0.7 * Licenses: lgpl-2.1-or-later * - * Provides the print rule action functionality. + * Provides the print error entry action functionality. * * This is auto-included and should not need to be explicitly included. */ -#ifndef _controller_main_print_rule_action_h -#define _controller_main_print_rule_action_h +#ifndef _controller_main_print_error_entry_action_h +#define _controller_main_print_error_entry_action_h #ifdef __cplusplus extern "C" { @@ -30,12 +30,12 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_rule_action_error_missing_pid_ - extern f_status_t controller_print_rule_action_error_missing_pid(fl_print_t * const print, const f_string_static_t alias); -#endif // _di_controller_print_rule_action_error_missing_pid_ +#ifndef _di_controller_print_error_rule_action_missing_pid_ + extern f_status_t controller_print_error_rule_action_missing_pid(fl_print_t * const print, const f_string_static_t alias); +#endif // _di_controller_print_error_rule_action_missing_pid_ #ifdef __cplusplus } // extern "C" #endif -#endif // _controller_main_print_rule_action_h +#endif // _controller_main_print_error_entry_action_h diff --git a/sources/c/main/print/rule/item.c b/sources/c/main/print/error/rule/item.c similarity index 86% rename from sources/c/main/print/rule/item.c rename to sources/c/main/print/error/rule/item.c index f515bb2..82487ae 100644 --- a/sources/c/main/print/rule/item.c +++ b/sources/c/main/print/error/rule/item.c @@ -1,31 +1,11 @@ -#include "../../controller.h" +#include "../../../controller.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_controller_print_rule_item_debug_action_empty_ - f_status_t controller_print_rule_item_debug_action_empty(fl_print_t * const print, controller_cache_t * const cache) { - - if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); - if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; - - controller_t * const main = (controller_t *) print->custom; - - controller_lock_print(print->to, &main->thread); - - fl_print_format("%r%[%QAction is empty, nothing to do.%]%r", print->to, f_string_eol_s, print->context, print->prefix, print->context, f_string_eol_s); - - controller_print_rule_error_cache(print, cache->action, F_true); - - controller_unlock_print_flush(print->to, &main->thread); - - return F_okay; - } -#endif // _di_controller_print_rule_item_debug_action_empty_ - -#ifndef _di_controller_print_rule_item_error_ - f_status_t controller_print_rule_item_error(fl_print_t * const print, const controller_cache_action_t cache, const bool item, const f_status_t status) { +#ifndef _di_controller_print_error_rule_item_ + f_status_t controller_print_error_rule_item(fl_print_t * const print, const controller_cache_action_t cache, const bool item, 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; @@ -36,7 +16,7 @@ extern "C" { // fll_error_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); - controller_print_rule_error_cache(print, cache, item); + controller_print_error_rule_cache(print, cache, item); f_file_stream_lock(print->to); @@ -44,10 +24,10 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_rule_item_error_ +#endif // _di_controller_print_error_rule_item_ -#ifndef _di_controller_print_rule_item_error_action_first_ - f_status_t controller_print_rule_item_error_action_first(fl_print_t * const print, controller_cache_t * const cache) { +#ifndef _di_controller_print_error_rule_item_action_first_ + f_status_t controller_print_error_rule_item_action_first(fl_print_t * const print, controller_cache_t * const cache) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -72,16 +52,55 @@ extern "C" { fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, controller_thaw_s, print->notable, print->context); fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); - controller_print_rule_error_cache(print, cache->action, F_true); + controller_print_error_rule_cache(print, &cache->action, F_true); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_rule_item_error_action_first_ +#endif // _di_controller_print_error_rule_item_action_first_ -#ifndef _di_controller_print_rule_item_error_action_second_ - f_status_t controller_print_rule_item_error_action_second(fl_print_t * const print, controller_cache_t * const cache) { +#ifndef _di_controller_print_error_rule_item_action_positive_number_not_ + f_status_t controller_print_error_rule_item_action_positive_number_not(fl_print_t * const print, controller_cache_t * const cache, const f_string_static_t name, const f_number_unsigned_t index) { + + if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_error_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%r%[%QRule item action '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); + fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, controller_rerun_s, print->notable); + fl_print_format("%[' requires a positive whole number or 0 for the '%]", print->to, print->context, print->context); + fl_print_format(f_string_format_S_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format("%[' value", print->to, print->context, print->context); + + if (index + 1 == cache->content_action.used) { + fl_print_format(", but none were given.%]%r", print->to, print->context, f_string_eol_s); + } + else { + fl_print_format(", but '%]%[%/Q%]", print->to, print->context, print->notable, cache->buffer_item, cache->content_action.array[index], print->notable); + + if (status == F_number || status == F_number_decimal) { + fl_print_format("%[' was given.%]%r", print->to, print->context, print->context, f_string_eol_s); + } + else if (status == F_number_overflow) { + fl_print_format("%[' is too large.%]%r", print->to, print->context, print->context, f_string_eol_s); + } + else { + fl_print_format("%[' is negative.%]%r", print->to, print->context, print->context, f_string_eol_s); + } + } + + controller_print_error_rule_cache(print, &cache->action, F_true); + + controller_unlock_print_flush(print->to, &main->thread); + } +#endif // _di_controller_print_error_rule_item_action_positive_number_not_ + +#ifndef _di_controller_print_error_rule_item_action_second_ + f_status_t controller_print_error_rule_item_action_second(fl_print_t * const print, controller_cache_t * const cache) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -99,16 +118,16 @@ extern "C" { fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, controller_thaw_s, print->notable, print->context); fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); - controller_print_rule_error_cache(print, cache->action, F_true); + controller_print_error_rule_cache(print, &cache->action, F_true); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_rule_item_error_action_second_ +#endif // _di_controller_print_error_rule_item_action_second_ -#ifndef _di_controller_print_rule_item_error_action_unknown_ - f_status_t controller_print_rule_item_error_action_unknown(fl_print_t * const print, controller_cache_t * const cache, const f_string_static_t name, const f_string_static_t unknown) { +#ifndef _di_controller_print_error_rule_item_action_unknown_ + f_status_t controller_print_error_rule_item_action_unknown(fl_print_t * const print, controller_cache_t * const cache, const f_string_static_t name, const f_string_static_t unknown) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -118,21 +137,21 @@ extern "C" { controller_lock_print(print->to, &main->thread); fl_print_format("%r%[%QRule item action '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); - fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, name, print->notable); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[' has an unknown value '%]", print->to, print->context, print->context); fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->notable, cache->buffer_item, unknown, print->notable); fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); - controller_print_rule_error_cache(print, cache->action, F_true); + controller_print_error_rule_cache(print, &cache->action, F_true); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_rule_item_error_action_unknown_ +#endif // _di_controller_print_error_rule_item_action_unknown_ -#ifndef _di_controller_print_rule_item_error_execute_ - f_status_t controller_print_rule_item_error_execute(fl_print_t * const print, controller_instance_t * const instance, const bool script_is, const f_string_static_t name, const f_status_t status) { +#ifndef _di_controller_print_error_rule_item_execute_ + f_status_t controller_print_error_rule_item_execute(fl_print_t * const print, controller_instance_t * const instance, const bool script_is, const f_string_static_t name, const f_status_t status) { if (!print || !instance || !instance->main) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -381,10 +400,10 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_rule_item_error_execute_ +#endif // _di_controller_print_error_rule_item_execute_ -#ifndef _di_controller_print_rule_item_error_need_want_wish_ - f_status_t controller_print_rule_item_error_need_want_wish(fl_print_t * const print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why) { +#ifndef _di_controller_print_error_rule_item_need_want_wish_ + f_status_t controller_print_error_rule_item_need_want_wish(fl_print_t * const print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why) { if (print->verbosity == f_console_verbosity_quiet_e) return F_output_not; @@ -394,10 +413,10 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_rule_item_error_need_want_wish_ +#endif // _di_controller_print_error_rule_item_need_want_wish_ -#ifndef _di_controller_print_rule_item_error_rule_not_loaded_ - f_status_t controller_print_rule_item_error_rule_not_loaded(fl_print_t * const print, const f_string_static_t alias) { +#ifndef _di_controller_print_error_rule_item_rule_not_loaded_ + f_status_t controller_print_error_rule_item_rule_not_loaded(fl_print_t * const print, const f_string_static_t alias) { if (print->verbosity == f_console_verbosity_quiet_e) return F_output_not; @@ -407,7 +426,7 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_rule_item_error_rule_not_loaded_ +#endif // _di_controller_print_error_rule_item_rule_not_loaded_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/rule/item.h b/sources/c/main/print/error/rule/item.h similarity index 71% rename from sources/c/main/print/rule/item.h rename to sources/c/main/print/error/rule/item.h index e8c14b6..c183bbc 100644 --- a/sources/c/main/print/rule/item.h +++ b/sources/c/main/print/error/rule/item.h @@ -5,28 +5,31 @@ * API Version: 0.7 * Licenses: lgpl-2.1-or-later * - * Provides the print rule item functionality. + * Provides the print error entry item functionality. * * This is auto-included and should not need to be explicitly included. */ -#ifndef _controller_main_print_rule_item_h -#define _controller_main_print_rule_item_h +#ifndef _controller_main_print_error_entry_item_h +#define _controller_main_print_error_entry_item_h #ifdef __cplusplus extern "C" { #endif /** - * Print rule debug message about the rule item action being empty. + * Print additional error/warning information in addition to existing error. * - * @param print - * The output structure to print to. + * This is explicitly intended to be used in addition to the error message. * - * Must not be NULL. + * @param print + * The error or warning print structure. * @param cache * A structure for containing and caching relevant data. - * - * Must not be NULL. + * @param item + * If TRUE, then this error is associated with an item. + * If FALSE, then this error is associated with a rule setting. + * @param status + * The status code representing the failure (without the error bit set). * * @return * F_okay on success. @@ -34,31 +37,23 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. * - * @see fl_print_format() - * @see fll_error_print() - * - * @see controller_lock_print() - * @see controller_print_rule_error_cache() - * @see controller_unlock_print_flush() + * @see controller_print_error_rule_cache() */ -#ifndef _di_controller_print_rule_item_debug_action_empty_ - extern f_status_t controller_print_rule_item_debug_action_empty(fl_print_t * const print, controller_cache_t * const cache); -#endif // _di_controller_print_rule_item_debug_action_empty_ +#ifndef _di_controller_print_error_rule_item_ + extern f_status_t controller_print_error_rule_item(fl_print_t * const print, const controller_cache_action_t cache, const bool item, const f_status_t status); +#endif // _di_controller_print_error_rule_item_ /** - * Print additional error/warning information in addition to existing error. - * - * This is explicitly intended to be used in addition to the error message. + * Print rule error message about the first rule item action parameter being invalid. * * @param print - * The error or warning print structure. + * The output structure to print to. + * + * Must not be NULL. * @param cache * A structure for containing and caching relevant data. - * @param item - * If TRUE, then this error is associated with an item. - * If FALSE, then this error is associated with a rule setting. - * @param status - * The status code representing the failure (without the error bit set). + * + * Must not be NULL. * * @return * F_okay on success. @@ -66,14 +61,19 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. * - * @see controller_print_rule_error_cache() + * @see fl_print_format() + * @see fll_error_print() + * + * @see controller_lock_print() + * @see controller_print_error_rule_cache() + * @see controller_unlock_print_flush() */ -#ifndef _di_controller_print_rule_item_error_ - extern f_status_t controller_print_rule_item_error(fl_print_t * const print, const controller_cache_action_t cache, const bool item, const f_status_t status); -#endif // _di_controller_print_rule_item_error_ +#ifndef _di_controller_print_error_rule_item_action_first_ + extern f_status_t controller_print_error_rule_item_action_first(fl_print_t * const print, controller_cache_t * const cache); +#endif // _di_controller_print_error_rule_item_action_first_ /** - * Print rule error message about the first rule item action parameter being invalid. + * Print rule error message about the item value not being a positive whole number. * * @param print * The output structure to print to. @@ -83,6 +83,10 @@ extern "C" { * A structure for containing and caching relevant data. * * Must not be NULL. + * @param name + * The Object name. + * @param index + * The index position in cache.content_action representing the Content range for the cache.buffer_item buffer.. * * @return * F_okay on success. @@ -94,12 +98,12 @@ extern "C" { * @see fll_error_print() * * @see controller_lock_print() - * @see controller_print_rule_error_cache() + * @see controller_print_error_rule_cache() * @see controller_unlock_print_flush() */ -#ifndef _di_controller_print_rule_item_error_action_first_ - extern f_status_t controller_print_rule_item_error_action_first(fl_print_t * const print, controller_cache_t * const cache); -#endif // _di_controller_print_rule_item_error_action_first_ +#ifndef _di_controller_print_error_rule_item_action_positive_number_not_ + extern f_status_t controller_print_error_rule_item_action_positive_number_not(fl_print_t * const print, controller_cache_t * const cache, const f_string_static_t name, const f_number_unsigned_t index); +#endif // _di_controller_print_error_rule_item_action_positive_number_not_ /** * Print rule error message about the second rule item action parameter being invalid. @@ -123,12 +127,12 @@ extern "C" { * @see fll_error_print() * * @see controller_lock_print() - * @see controller_print_rule_error_cache() + * @see controller_print_error_rule_cache() * @see controller_unlock_print_flush() */ -#ifndef _di_controller_print_rule_item_error_action_second_ - extern f_status_t controller_print_rule_item_error_action_second(fl_print_t * const print, controller_cache_t * const cache); -#endif // _di_controller_print_rule_item_error_action_second_ +#ifndef _di_controller_print_error_rule_item_action_second_ + extern f_status_t controller_print_error_rule_item_action_second(fl_print_t * const print, controller_cache_t * const cache); +#endif // _di_controller_print_error_rule_item_action_second_ /** * Print rule error message about the rule item action being unknown. @@ -156,12 +160,12 @@ extern "C" { * @see fll_error_print() * * @see controller_lock_print() - * @see controller_print_rule_error_cache() + * @see controller_print_error_rule_cache() * @see controller_unlock_print_flush() */ -#ifndef _di_controller_print_rule_item_error_action_unknown_ - extern f_status_t controller_print_rule_item_error_action_unknown(fl_print_t * const print, controller_cache_t * const cache, const f_string_static_t name, const f_string_static_t unknown); -#endif // _di_controller_print_rule_item_error_action_unknown_ +#ifndef _di_controller_print_error_rule_item_action_unknown_ + extern f_status_t controller_print_error_rule_item_action_unknown(fl_print_t * const print, controller_cache_t * const cache, const f_string_static_t name, const f_string_static_t unknown); +#endif // _di_controller_print_error_rule_item_action_unknown_ /** * Print an error or warning message related to the failed execution of some program or script. @@ -190,9 +194,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_rule_item_error_execute_ - extern f_status_t controller_print_rule_item_error_execute(fl_print_t * const print, controller_instance_t * const instance, const bool script_is, const f_string_static_t name, const f_status_t status); -#endif // _di_controller_print_rule_item_error_execute_ +#ifndef _di_controller_print_error_rule_item_execute_ + extern f_status_t controller_print_error_rule_item_execute(fl_print_t * const print, controller_instance_t * const instance, const bool script_is, const f_string_static_t name, const f_status_t status); +#endif // _di_controller_print_error_rule_item_execute_ /** * Print an error or warning message related to need/want/wish settings of some rule. @@ -213,9 +217,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_rule_item_error_need_want_wish_ - extern f_status_t controller_print_rule_item_error_need_want_wish(fl_print_t * const print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why); -#endif // _di_controller_print_rule_item_error_need_want_wish_ +#ifndef _di_controller_print_error_rule_item_need_want_wish_ + extern f_status_t controller_print_error_rule_item_need_want_wish(fl_print_t * const print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why); +#endif // _di_controller_print_error_rule_item_need_want_wish_ /** * Print an error or warning message about some rule not being loaded. @@ -231,12 +235,12 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_rule_item_error_rule_not_loaded_ - extern f_status_t controller_print_rule_item_error_rule_not_loaded(fl_print_t * const print, const f_string_static_t alias); -#endif // _di_controller_print_rule_item_error_rule_not_loaded_ +#ifndef _di_controller_print_error_rule_item_rule_not_loaded_ + extern f_status_t controller_print_error_rule_item_rule_not_loaded(fl_print_t * const print, const f_string_static_t alias); +#endif // _di_controller_print_error_rule_item_rule_not_loaded_ #ifdef __cplusplus } // extern "C" #endif -#endif // _controller_main_print_rule_item_h +#endif // _controller_main_print_error_entry_item_h diff --git a/sources/c/main/print/rule/setting.c b/sources/c/main/print/error/rule/setting.c similarity index 74% rename from sources/c/main/print/rule/setting.c rename to sources/c/main/print/error/rule/setting.c index ff8bbc2..24f302c 100644 --- a/sources/c/main/print/rule/setting.c +++ b/sources/c/main/print/error/rule/setting.c @@ -1,11 +1,11 @@ -#include "../../controller.h" +#include "../../../controller.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_controller_print_rule_setting_read_error_ - f_status_t controller_print_rule_setting_read_error(fl_print_t * const print, controller_thread_t * const thread, controller_cache_t * const cache, const f_string_t message, const f_number_unsigned_t index, const f_number_unsigned_t line_item) { +#ifndef _di_controller_print_error_rule_setting_ + f_status_t controller_print_error_rule_setting(fl_print_t * const print, controller_thread_t * const thread, controller_cache_t * const cache, const f_string_t message, const f_number_unsigned_t index, const f_number_unsigned_t line_item) { if (!print->custom) return F_status_set_error(F_output_not); if (print->verbosity == f_console_verbosity_quiet_e) return F_output_not; @@ -24,16 +24,16 @@ extern "C" { fl_print_format("%r%[%QRule setting %S.%]%r", print->to, f_string_eol_s, print->context, print->prefix, message, print->context, f_string_eol_s); - controller_print_rule_error_cache(print, cache->action, F_false); + controller_print_error_rule_cache(print, &cache->action, F_false); controller_unlock_print_flush(print->to, thread); return F_okay; } -#endif // _di_controller_print_rule_setting_read_error_ +#endif // _di_controller_print_error_rule_setting_ -#ifndef _di_controller_print_rule_setting_read_error_with_range_ - f_status_t controller_print_rule_setting_read_error_with_range(fl_print_t * const print, controller_thread_t * const thread, controller_cache_t * const cache, const f_string_t before, const f_range_t range, const f_string_t after, const f_number_unsigned_t index, const f_number_unsigned_t line_item) { +#ifndef _di_controller_print_error_rule_setting_with_range_ + f_status_t controller_print_error_rule_setting_with_range(fl_print_t * const print, controller_thread_t * const thread, controller_cache_t * const cache, const f_string_t before, const f_range_t range, const f_string_t after, const f_number_unsigned_t index, const f_number_unsigned_t line_item) { if (!print->custom) return F_status_set_error(F_output_not); if (print->verbosity == f_console_verbosity_quiet_e) return F_output_not; @@ -54,16 +54,16 @@ extern "C" { fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->notable, cache->buffer_item, range, print->notable); fl_print_format("%['%S.%]%r", print->to, print->context, after, print->context, f_string_eol_s); - controller_print_rule_error_cache(print, cache->action, F_false); + controller_print_error_rule_cache(print, &cache->action, F_false); controller_unlock_print_flush(print->to, thread); return F_okay; } -#endif // _di_controller_print_rule_setting_read_error_with_range_ +#endif // _di_controller_print_error_rule_setting_with_range_ -#ifndef _di_controller_print_rule_setting_read_mapping_ - f_status_t controller_print_rule_setting_read_mapping(controller_t * const main, const f_string_static_t name, const f_string_map_t map) { +#ifndef _di_controller_print_error_rule_setting_mapping_ + f_status_t controller_print_error_rule_setting_mapping(controller_t * const main, const f_string_static_t name, const f_string_map_t map) { if (main->program.error.verbosity != f_console_verbosity_debug_e) { if (!(main->program.error.verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_e))) { @@ -81,10 +81,10 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_rule_setting_read_mapping_ +#endif // _di_controller_print_error_rule_setting_mapping_ -#ifndef _di_controller_print_rule_setting_read_value_ - f_status_t controller_print_rule_setting_read_value(controller_t * const main, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_t suffix) { +#ifndef _di_controller_print_error_rule_setting_value_ + f_status_t controller_print_error_rule_setting_value(controller_t * const main, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_t suffix) { if (main->program.error.verbosity != f_console_verbosity_debug_e) { if (!(main->program.error.verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_e))) { @@ -110,10 +110,10 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_rule_setting_read_value_ +#endif // _di_controller_print_error_rule_setting_value_ -#ifndef _di_controller_print_rule_setting_read_values_ - f_status_t controller_print_rule_setting_read_values(controller_t * const main, controller_cache_t * const cache, const f_string_static_t name, const f_number_unsigned_t index) { +#ifndef _di_controller_print_error_rule_setting_values_ + f_status_t controller_print_error_rule_setting_values(controller_t * const main, controller_cache_t * const cache, const f_string_static_t name, const f_number_unsigned_t index) { if (main->program.error.verbosity != f_console_verbosity_debug_e) { if (!(main->program.error.verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_e))) { @@ -147,7 +147,7 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_rule_setting_read_value_ +#endif // _di_controller_print_error_rule_setting_value_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/rule/setting.h b/sources/c/main/print/error/rule/setting.h similarity index 67% rename from sources/c/main/print/rule/setting.h rename to sources/c/main/print/error/rule/setting.h index 6e1c26c..496edd5 100644 --- a/sources/c/main/print/rule/setting.h +++ b/sources/c/main/print/error/rule/setting.h @@ -5,12 +5,12 @@ * API Version: 0.7 * Licenses: lgpl-2.1-or-later * - * Provides the print rule setting functionality. + * Provides the print error entry setting functionality. * * This is auto-included and should not need to be explicitly included. */ -#ifndef _controller_main_print_rule_setting_h -#define _controller_main_print_rule_setting_h +#ifndef _controller_main_print_error_entry_setting_h +#define _controller_main_print_error_entry_setting_h #ifdef __cplusplus extern "C" { @@ -43,9 +43,9 @@ extern "C" { * * @see controller_rule_setting_read() */ -#ifndef _di_controller_print_rule_setting_read_error_ - extern f_status_t controller_print_rule_setting_read_error(fl_print_t * const print, controller_thread_t * const thread, controller_cache_t * const cache, const f_string_t message, const f_number_unsigned_t index, const f_number_unsigned_t line_item); -#endif // _di_controller_print_rule_setting_read_error_ +#ifndef _di_controller_print_error_rule_setting_ + extern f_status_t controller_print_error_rule_setting(fl_print_t * const print, controller_thread_t * const thread, controller_cache_t * const cache, const f_string_t message, const f_number_unsigned_t index, const f_number_unsigned_t line_item); +#endif // _di_controller_print_error_rule_setting_ /** * Print a message about a rule setting problem, with additional messages about the value. @@ -78,9 +78,9 @@ extern "C" { * * @see controller_rule_setting_read() */ -#ifndef _di_controller_print_rule_setting_read_error_with_range_ - extern f_status_t controller_print_rule_setting_read_error_with_range(fl_print_t * const print, controller_thread_t * const thread, controller_cache_t * const cache, const f_string_t before, const f_range_t range, const f_string_t after, const f_number_unsigned_t index, const f_number_unsigned_t line_item); -#endif // _di_controller_print_rule_setting_read_error_with_range_ +#ifndef _di_controller_print_error_rule_setting_with_range_ + extern f_status_t controller_print_error_rule_setting_with_range(fl_print_t * const print, controller_thread_t * const thread, controller_cache_t * const cache, const f_string_t before, const f_range_t range, const f_string_t after, const f_number_unsigned_t index, const f_number_unsigned_t line_item); +#endif // _di_controller_print_error_rule_setting_with_range_ /** * Print message regarding the mapping of a setting when in simulation or verbose mode. @@ -100,9 +100,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_rule_setting_read_mapping_ - extern f_status_t controller_print_rule_setting_read_mapping(controller_t * const main, const f_string_static_t name, const f_string_map_t map); -#endif // _di_controller_print_rule_setting_read_mapping_ +#ifndef _di_controller_print_error_rule_setting_mapping_ + extern f_status_t controller_print_error_rule_setting_mapping(controller_t * const main, const f_string_static_t name, const f_string_map_t map); +#endif // _di_controller_print_error_rule_setting_mapping_ /** * Print message regarding the population of a setting when in simulation or verbose mode. @@ -127,9 +127,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_rule_setting_read_value_ - extern f_status_t controller_print_rule_setting_read_value(controller_t * const main, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_t suffix); -#endif // _di_controller_print_rule_setting_read_value_ +#ifndef _di_controller_print_error_rule_setting_value_ + extern f_status_t controller_print_error_rule_setting_value(controller_t * const main, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_t suffix); +#endif // _di_controller_print_error_rule_setting_value_ /** * Print message regarding the population of a setting when in simulation or verbose mode. @@ -153,12 +153,12 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_rule_setting_read_values_ - extern f_status_t controller_print_rule_setting_read_values(controller_t * const main, controller_cache_t * const cache, const f_string_static_t name, const f_number_unsigned_t index); -#endif // _di_controller_print_rule_setting_read_values_ +#ifndef _di_controller_print_error_rule_setting_values_ + extern f_status_t controller_print_error_rule_setting_values(controller_t * const main, controller_cache_t * const cache, const f_string_static_t name, const f_number_unsigned_t index); +#endif // _di_controller_print_error_rule_setting_values_ #ifdef __cplusplus } // extern "C" #endif -#endif // _controller_main_print_rule_setting_h +#endif // _controller_main_print_error_entry_setting_h diff --git a/sources/c/main/print/lock.c b/sources/c/main/print/lock.c index 09855a2..740f64b 100644 --- a/sources/c/main/print/lock.c +++ b/sources/c/main/print/lock.c @@ -4,45 +4,6 @@ extern "C" { #endif -#ifndef _di_controller_lock_print_error_critical_ - void controller_lock_print_error_critical(fl_print_t * const print, const f_status_t status, const uint8_t is_read) { - - // A signal is not an error. - if (!print || !print->custom || status == F_interrupt) return; - - controller_t * const main = (controller_t *) print->custom; - - if (print->verbosity != f_console_verbosity_quiet_e) { - controller_lock_print(print->to, &main->thread); - - fl_print_format("%r%[%QThe pid file '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); - fl_print_format("%['Critical failure while attempting to establish '%]", print->to, print->context, print->context); - fl_print_format("%[%r lock%]", print->to, print->notable, is_read ? f_file_operation_read_s : f_file_operation_write_s, print->notable); - - if (status != F_failure) { - fl_print_format(" %['due to%] ", print->to, print->context, print->context); - - if (status == F_parameter) { - fl_print_format("%[Invalid Parameter%]", print->to, print->notable, print->notable); - } - else if (status == F_deadlock) { - fl_print_format("%[Deadlock%]", print->to, print->notable, print->notable); - } - else if (status == F_resource_not) { - fl_print_format("%[Too Many Locks%]", print->to, print->notable, print->notable); - } - else { - fl_print_format("%[Unknown Error%]", print->to, print->notable, print->notable); - } - } - - fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); - - controller_unlock_print_flush(print->to, &main->thread); - } - } -#endif // _di_controller_lock_print_error_critical_ - #ifndef _di_controller_lock_print_ void controller_lock_print(const f_file_t to, controller_thread_t * const thread) { diff --git a/sources/c/main/print/lock.h b/sources/c/main/print/lock.h index c655583..f9d96a1 100644 --- a/sources/c/main/print/lock.h +++ b/sources/c/main/print/lock.h @@ -17,28 +17,6 @@ extern "C" { #endif /** - * Print a r/w lock related error message, locking the print mutex during the print. - * - * This will ignore F_interrupt and not print any messages, if passed. - * - * @param print - * The output structure to print to. - * - * Must not be NULL. - * - * This does not alter print.custom.setting.state.status. - * @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 is_read - * If TRUE, then this is for a read lock. - * If FALSE, then this is for a write lock. - */ -#ifndef _di_controller_lock_print_error_critical_ - extern void controller_lock_print_error_critical(fl_print_t * const print, const f_status_t status, const uint8_t is_read); -#endif // _di_controller_lock_print_error_critical_ - -/** * Lock the mutex and the stream. * * This is implemented as a compliment to controller_unlock_print_flush() for consistency reasons. diff --git a/sources/c/main/print/entry/message.c b/sources/c/main/print/message/entry.c similarity index 80% rename from sources/c/main/print/entry/message.c rename to sources/c/main/print/message/entry.c index add3e71..c92cbd9 100644 --- a/sources/c/main/print/entry/message.c +++ b/sources/c/main/print/message/entry.c @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef _di_controller_print_entry_message_state_ - f_status_t controller_print_entry_message_state(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name) { +#ifndef _di_controller_print_message_entry_state_ + f_status_t controller_print_message_entry_state(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_normal_e) return F_output_not; @@ -20,7 +20,7 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_entry_message_state_ +#endif // _di_controller_print_message_entry_state_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/message.h b/sources/c/main/print/message/entry.h similarity index 85% rename from sources/c/main/print/entry/message.h rename to sources/c/main/print/message/entry.h index 8623c56..e3d5f6e 100644 --- a/sources/c/main/print/entry/message.h +++ b/sources/c/main/print/message/entry.h @@ -42,11 +42,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_message_state_ - extern f_status_t controller_print_entry_message_state(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name); -#endif // _di_controller_print_entry_message_state_ +#ifndef _di_controller_print_message_entry_state_ + extern f_status_t controller_print_message_entry_state(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name); +#endif // _di_controller_print_message_entry_state_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/message/action.c b/sources/c/main/print/message/entry/action.c similarity index 80% rename from sources/c/main/print/entry/message/action.c rename to sources/c/main/print/message/entry/action.c index 1b28252..8fcbe90 100644 --- a/sources/c/main/print/entry/message/action.c +++ b/sources/c/main/print/message/entry/action.c @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef _di_controller_print_entry_message_action_parameters_ - f_status_t controller_print_entry_message_action_parameters(fl_print_t * const print, controller_entry_action_t * const action) { +#ifndef _di_controller_print_message_entry_action_parameters_ + f_status_t controller_print_message_entry_action_parameters(fl_print_t * const print, controller_entry_action_t * const action) { if (!print || !action) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -23,10 +23,10 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_entry_message_action_parameters_ +#endif // _di_controller_print_message_entry_action_parameters_ -#ifndef _di_controller_print_entry_message_action_state_ - f_status_t controller_print_entry_message_action_state(fl_print_t * const print, controller_cache_t * const cache, controller_entry_action_t * const action, const uint8_t is_entry) { +#ifndef _di_controller_print_message_entry_action_state_ + f_status_t controller_print_message_entry_action_state(fl_print_t * const print, controller_cache_t * const cache, controller_entry_action_t * const action, const uint8_t is_entry) { if (!print || !print->custom || !cache || !action) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -41,7 +41,7 @@ extern "C" { if (action->parameters.used) { fl_print_format(" %[", print->to, context->notable); - controller_print_entry_message_action_parameters(print, action); + controller_print_message_entry_action_parameters(print, action); fl_print_format("%]", print->to, context->notable); } @@ -62,16 +62,16 @@ extern "C" { fl_print_format(" %[state, skipping.%]%r", print->to, print->context, print->context, f_string_eol_s); } - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_message_action_state_ +#endif // _di_controller_print_message_entry_action_state_ -#ifndef _di_controller_print_entry_message_action_state_failed_ - f_status_t controller_print_entry_message_action_state_failed(fl_print_t * const print, controller_cache_t * const cache, controller_entry_action_t * const action, const uint8_t is_entry) { +#ifndef _di_controller_print_message_entry_action_state_failed_ + f_status_t controller_print_message_entry_action_state_failed(fl_print_t * const print, controller_cache_t * const cache, controller_entry_action_t * const action, const uint8_t is_entry) { if (!print || !print->custom || !cache || !action) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -86,7 +86,7 @@ extern "C" { if (action->parameters.used) { fl_print_format(" %[", print->to, context->notable); - controller_print_entry_message_action_parameters(print, action); + controller_print_message_entry_action_parameters(print, action); fl_print_format("%]", print->to, context->notable); } @@ -99,10 +99,10 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_entry_message_action_state_failed_ +#endif // _di_controller_print_message_entry_action_state_failed_ -#ifndef _di_controller_print_entry_message_action_ready_ - f_status_t controller_print_entry_message_action_ready(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name) { +#ifndef _di_controller_print_message_entry_action_ready_ + f_status_t controller_print_message_entry_action_ready(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_normal_e) return F_output_not; @@ -112,17 +112,17 @@ extern "C" { controller_lock_print(print->to, &main->thread); fl_print_format("%rIgnoring %r item action '", print->to, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s); - fl_print_format(f_string_format_r_single_s.string, print->to, print->set.title, name, print->set.title); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set.title, name, print->set.title); fl_print_format("', state already is ready.%r", print->to, f_string_eol_s); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_message_action_ready_ +#endif // _di_controller_print_message_entry_action_ready_ -#ifndef _di_controller_print_entry_message_action_wait_ - f_status_t controller_print_entry_message_action_wait(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name) { +#ifndef _di_controller_print_message_entry_action_wait_ + f_status_t controller_print_message_entry_action_wait(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_normal_e) return F_output_not; @@ -132,14 +132,14 @@ extern "C" { controller_lock_print(print->to, &main->thread); fl_print_format("%rWaiting before processing %r item action '", print->to, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s); - fl_print_format(f_string_format_r_single_s.string, print->to, print->set.title, name, print->set.title); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set.title, name, print->set.title); fl_print_format("'.%r", print->to, f_string_eol_s); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_message_action_wait_ +#endif // _di_controller_print_message_entry_action_wait_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/message/action.h b/sources/c/main/print/message/entry/action.h similarity index 79% rename from sources/c/main/print/entry/message/action.h rename to sources/c/main/print/message/entry/action.h index e6c6fd2..e660b51 100644 --- a/sources/c/main/print/entry/message/action.h +++ b/sources/c/main/print/message/entry/action.h @@ -38,9 +38,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_entry_message_action_parameters_ - extern f_status_t controller_print_entry_message_action_parameters(fl_print_t * const print, controller_entry_action_t * const action); -#endif // _di_controller_print_entry_message_action_parameters_ +#ifndef _di_controller_print_message_entry_action_parameters_ + extern f_status_t controller_print_message_entry_action_parameters(fl_print_t * const print, controller_entry_action_t * const action); +#endif // _di_controller_print_message_entry_action_parameters_ /** * Print message about entry action state. @@ -68,9 +68,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_entry_message_action_state_ - extern f_status_t controller_print_entry_message_action_state(fl_print_t * const print, controller_cache_t * const cache, controller_entry_action_t * const action, const uint8_t is_entry); -#endif // _di_controller_print_entry_message_action_state_ +#ifndef _di_controller_print_message_entry_action_state_ + extern f_status_t controller_print_message_entry_action_state(fl_print_t * const print, controller_cache_t * const cache, controller_entry_action_t * const action, const uint8_t is_entry); +#endif // _di_controller_print_message_entry_action_state_ /** * Print message about entry action state having failed. @@ -101,9 +101,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_entry_message_action_state_failed_ - extern f_status_t controller_print_entry_message_action_state_failed(fl_print_t * const print, controller_cache_t * const cache, controller_entry_action_t * const action, const uint8_t is_entry); -#endif // _di_controller_print_entry_message_action_state_failed_ +#ifndef _di_controller_print_message_entry_action_state_failed_ + extern f_status_t controller_print_message_entry_action_state_failed(fl_print_t * const print, controller_cache_t * const cache, controller_entry_action_t * const action, const uint8_t is_entry); +#endif // _di_controller_print_message_entry_action_state_failed_ /** * Print message about the specified entry item action being in the ready state. @@ -131,11 +131,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_message_action_ready_ - extern f_status_t controller_print_entry_message_action_ready(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name); -#endif // _di_controller_print_entry_message_action_ready_ +#ifndef _di_controller_print_message_entry_action_ready_ + extern f_status_t controller_print_message_entry_action_ready(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name); +#endif // _di_controller_print_message_entry_action_ready_ /** * Print message about waiting for the specified entry item action. @@ -163,11 +163,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_message_action_wait_ - extern f_status_t controller_print_entry_message_action_wait(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name); -#endif // _di_controller_print_entry_message_action_wait_ +#ifndef _di_controller_print_message_entry_action_wait_ + extern f_status_t controller_print_message_entry_action_wait(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name); +#endif // _di_controller_print_message_entry_action_wait_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/message/item.c b/sources/c/main/print/message/entry/item.c similarity index 84% rename from sources/c/main/print/entry/message/item.c rename to sources/c/main/print/message/entry/item.c index 8abe4bf..3b34434 100644 --- a/sources/c/main/print/entry/message/item.c +++ b/sources/c/main/print/message/entry/item.c @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef _di_controller_print_entry_message_item_executing_ - f_status_t controller_print_entry_message_item_executing(fl_print_t * const print, const uint8_t is_entry, f_string_dynamics_t * const parameters) { +#ifndef _di_controller_print_message_entry_item_executing_ + f_status_t controller_print_message_entry_item_executing(fl_print_t * const print, const uint8_t is_entry, f_string_dynamics_t * const parameters) { if (!print || !print->custom || !parameters) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_normal_e) return F_output_not; @@ -31,10 +31,10 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_entry_message_item_executing_ +#endif // _di_controller_print_message_entry_item_executing_ -#ifndef _di_controller_print_entry_message_item_process_ - f_status_t controller_print_entry_message_item_process(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t prepend, const f_string_static_t name) { +#ifndef _di_controller_print_message_entry_item_process_ + f_status_t controller_print_message_entry_item_process(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t prepend, const f_string_static_t name) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_normal_e) return F_output_not; @@ -55,10 +55,10 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_entry_message_item_process_ +#endif // _di_controller_print_message_entry_item_process_ -#ifndef _di_controller_print_entry_message_item_done_ - f_status_t controller_print_entry_message_item_done(fl_print_t * const print, const uint8_t is_entry, const uint8_t failsafe, const f_string_static_t name) { +#ifndef _di_controller_print_message_entry_item_done_ + f_status_t controller_print_message_entry_item_done(fl_print_t * const print, const uint8_t is_entry, const uint8_t failsafe, const f_string_static_t name) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -68,17 +68,17 @@ extern "C" { controller_lock_print(print->to, &main->thread); fl_print_format("%rDone processing %r item '", print->to, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s); - fl_print_format(f_string_format_r_single_s.string, print->to, print->set.title, name, print->set.title); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->set.title, name, print->set.title); fl_print_format("'.%r%r", print->to, f_string_eol_s, failsafe ? f_string_eol_s : f_string_empty_s); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_message_item_done_ +#endif // _di_controller_print_message_entry_item_done_ -#ifndef _di_controller_print_entry_message_item_rule_ - f_status_t controller_print_entry_message_item_rule(fl_print_t * const print, controller_entry_t * const entry, controller_entry_action_t * const action, const uint8_t is_entry, const f_string_static_t alias_rule) { +#ifndef _di_controller_print_message_entry_item_rule_ + f_status_t controller_print_message_entry_item_rule(fl_print_t * const print, controller_entry_t * const entry, controller_entry_action_t * const action, const uint8_t is_entry, const f_string_static_t alias_rule) { if (!print || !print->custom || !entry || !action) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_normal_e) return F_output_not; @@ -108,7 +108,7 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_entry_message_item_rule_ +#endif // _di_controller_print_message_entry_item_rule_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/message/item.h b/sources/c/main/print/message/entry/item.h similarity index 81% rename from sources/c/main/print/entry/message/item.h rename to sources/c/main/print/message/entry/item.h index e767541..3447524 100644 --- a/sources/c/main/print/entry/message/item.h +++ b/sources/c/main/print/message/entry/item.h @@ -42,11 +42,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_message_item_executing_ - extern f_status_t controller_print_entry_message_item_executing(fl_print_t * const print, const uint8_t is_entry, f_string_dynamics_t * const parameters); -#endif // _di_controller_print_entry_message_item_executing_ +#ifndef _di_controller_print_message_entry_item_executing_ + extern f_status_t controller_print_message_entry_item_executing(fl_print_t * const print, const uint8_t is_entry, f_string_dynamics_t * const parameters); +#endif // _di_controller_print_message_entry_item_executing_ /** * Print message about processing an item. @@ -75,11 +75,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_message_item_process_ - extern f_status_t controller_print_entry_message_item_process(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t prepend, const f_string_static_t name); -#endif // _di_controller_print_entry_message_item_process_ +#ifndef _di_controller_print_message_entry_item_process_ + extern f_status_t controller_print_message_entry_item_process(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t prepend, const f_string_static_t name); +#endif // _di_controller_print_message_entry_item_process_ /** * Print message about processing an item. @@ -106,11 +106,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_message_item_done_ - extern f_status_t controller_print_entry_message_item_done(fl_print_t * const print, const uint8_t is_entry, const uint8_t failsafe, const f_string_static_t name); -#endif // _di_controller_print_entry_message_item_done_ +#ifndef _di_controller_print_message_entry_item_done_ + extern f_status_t controller_print_message_entry_item_done(fl_print_t * const print, const uint8_t is_entry, const uint8_t failsafe, const f_string_static_t name); +#endif // _di_controller_print_message_entry_item_done_ /** * Print warning message about multiple actions for a specified item. @@ -144,11 +144,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_message_item_rule_ - extern f_status_t controller_print_entry_message_item_rule(fl_print_t * const print, controller_entry_t * const entry, controller_entry_action_t * const action, const uint8_t is_entry, const f_string_static_t alias_rule); -#endif // _di_controller_print_entry_message_item_rule_ +#ifndef _di_controller_print_message_entry_item_rule_ + extern f_status_t controller_print_message_entry_item_rule(fl_print_t * const print, controller_entry_t * const entry, controller_entry_action_t * const action, const uint8_t is_entry, const f_string_static_t alias_rule); +#endif // _di_controller_print_message_entry_item_rule_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/output/setting.c b/sources/c/main/print/output/entry/setting.c similarity index 98% rename from sources/c/main/print/entry/output/setting.c rename to sources/c/main/print/output/entry/setting.c index ece31f7..3d1ad8e 100644 --- a/sources/c/main/print/entry/output/setting.c +++ b/sources/c/main/print/output/entry/setting.c @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef _di_controller_print_entry_output_setting_simulate_value_ - f_status_t controller_print_entry_output_setting_simulate_value(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_static_t suffix) { +#ifndef _di_controller_print_output_entry_setting_simulate_value_ + f_status_t controller_print_output_entry_setting_simulate_value(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_static_t suffix) { if (!print || !print->custom) return F_status_set_error(F_output_not); @@ -36,7 +36,7 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_entry_output_setting_simulate_value_ +#endif // _di_controller_print_output_entry_setting_simulate_value_ #ifndef _di_controller_print_entry_output_setting_validate_ f_status_t controller_print_entry_output_setting_validate(fl_print_t * const print, const uint8_t is_entry) { diff --git a/sources/c/main/print/entry/output/setting.h b/sources/c/main/print/output/entry/setting.h similarity index 92% rename from sources/c/main/print/entry/output/setting.h rename to sources/c/main/print/output/entry/setting.h index a2d4035..0de8f61 100644 --- a/sources/c/main/print/entry/output/setting.h +++ b/sources/c/main/print/output/entry/setting.h @@ -46,9 +46,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_entry_output_setting_simulate_value_ - extern f_status_t controller_print_entry_output_setting_simulate_value(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_static_t suffix); -#endif // _di_controller_print_entry_output_setting_simulate_value_ +#ifndef _di_controller_print_output_entry_setting_simulate_value_ + extern f_status_t controller_print_output_entry_setting_simulate_value(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_static_t suffix); +#endif // _di_controller_print_output_entry_setting_simulate_value_ /** * Print a simulated execution of the given entry. diff --git a/sources/c/main/print/output/rule/execute.c b/sources/c/main/print/output/rule/execute.c new file mode 100644 index 0000000..e6d13ac --- /dev/null +++ b/sources/c/main/print/output/rule/execute.c @@ -0,0 +1,47 @@ +#include "../../../controller.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_controller_print_entry_output_execute_simulate_ + f_status_t controller_print_entry_output_execute_simulate(fl_print_t * const print, controller_instance_t * const instance, const f_string_static_t program, const f_string_statics_t arguments) { + + if (!print || !print->custom) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_error_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%rSimulating execution of '%[", print->to, f_string_eol_s, print->set->title); + + if (program.used) { + f_print_dynamic_safely(program, print->to); + } + else { + f_print_dynamic_safely(arguments.array[0], print->to); + } + + fl_print_format("%]' with the arguments: '%[", print->to, print->set->title, print->set->important); + + for (f_number_unsigned_t i = program.used ? 0 : 1; i < arguments.used; ++i) { + + if (program.used && i || !program.used && i > 1) { + f_print_dynamic_raw(f_string_space_s, print->to); + } + + f_print_dynamic_safely(arguments.array[i], print->to); + } // for + + fl_print_format("%]' from '", print->to, print->set->important); + fl_print_format("%[%Q%]'.%r", print->to, print->set->notable, instance->rule.name, print->set->notable, f_string_eol_s); + + controller_unlock_print_flush(print->to, &main->thread); + + return F_okay; + } +#endif // _di_controller_print_entry_output_execute_simulate_ +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sources/c/main/print/output/rule/execute.h b/sources/c/main/print/output/rule/execute.h new file mode 100644 index 0000000..303c318 --- /dev/null +++ b/sources/c/main/print/output/rule/execute.h @@ -0,0 +1,56 @@ +/** + * FLL - Level 3 + * + * Project: Controller + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print output rule execute functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _controller_main_print_output_rule_execute_h +#define _controller_main_print_output_rule_execute_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print the execute simulation. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * + * Must not be NULL. + * @param instance + * The instance performing the simulation. + * + * Must not be NULL. + * @param program + * (optional) The name of the program whose execution is being simulated. + * When disabled, arguments.array[0] will be used as the program. + * + * Set program.used to 0 to disable. + * @param arguments + * The array of arguments passed to the simulated program. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + */ +#ifndef _di_controller_print_entry_output_execute_simulate_ + extern f_status_t controller_print_entry_output_execute_simulate(fl_print_t * const print, controller_instance_t * const instance, const f_string_static_t program, const f_string_statics_t arguments); +#endif // _di_controller_print_entry_output_execute_simulate_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _controller_main_print_output_rule_execute_h diff --git a/sources/c/main/print/perform.c b/sources/c/main/print/perform.c deleted file mode 100644 index e14241b..0000000 --- a/sources/c/main/print/perform.c +++ /dev/null @@ -1,157 +0,0 @@ -#include "../controller.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _di_controller_print_perform_debug_control_socket_failure_ - f_status_t controller_print_perform_debug_control_socket_failure(fl_print_t * const print, const f_status_t status, const f_string_t message) { - - if (!print || !print->custom) return F_status_set_error(F_output_not); - if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; - - controller_t * const main = (controller_t *) print->custom; - - controller_lock_print(print->to, &main->thread); - - fl_print_format("%r%[%QControl socket '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); - fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, main->setting.path_control, print->notable); - fl_print_format("%[' %S, code %]", print->to, print->context, message, print->context); - fl_print_format(f_string_format_ui_single_s.string, print->to, print->notable, status, print->notable); - fl_print_format(f_string_format_sentence_end_s.string, print->to, print->context, print->context, f_string_eol_s); - - controller_unlock_print_flush(print->to, &main->thread); - } -#endif // _di_controller_print_perform_debug_control_socket_failure_ - -#ifndef _di_controller_print_perform_debug_control_socket_success_ - f_status_t controller_print_perform_debug_control_socket_success(fl_print_t * const print, const f_status_t status, const f_string_t message) { - - if (!print || !print->custom) return F_status_set_error(F_output_not); - if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; - - controller_t * const main = (controller_t *) print->custom; - - controller_lock_print(print->to, &main->thread); - - fl_print_format("%rControl socket '", print->to, f_string_eol_s); - fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, main->setting.path_control, print->notable); - fl_print_format("' created.%r", print->to, f_string_eol_s); - - controller_unlock_print_flush(print->to, &main->thread); - } -#endif // _di_controller_print_perform_debug_control_socket_success_ - -#ifndef _di_controller_print_perform_debug_control_socket_missing_read_only_ - f_status_t controller_print_perform_debug_control_socket_missing_read_only(fl_print_t * const print) { - - if (!print || !print->custom) return F_status_set_error(F_output_not); - if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; - - controller_t * const main = (controller_t *) print->custom; - - controller_lock_print(print->to, &main->thread); - - fl_print_format("%r%[%QControl socket '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); - fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, main->setting.path_control, print->notable); - fl_print_format("' .%r", print->to, f_string_eol_s); - fl_print_format("%[' cannot be found while read only mode is enabled and so the Control socket is unavailable.%]%r", print->to, print->context, print->context, f_string_eol_s); - - controller_unlock_print_flush(print->to, &main->thread); - - return F_okay; - } -#endif // _di_controller_print_perform_debug_control_socket_missing_read_only_ - -#ifndef _di_controller_print_perform_debug_pid_file_control_socket_ - f_status_t controller_print_perform_debug_pid_file_control_socket(fl_print_t * const print) { - - if (!print || !print->custom) return F_status_set_error(F_output_not); - if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; - - controller_t * const main = (controller_t *) print->custom; - - controller_lock_print(print->to, &main->thread); - - fl_print_format("%rPID file '", print->to, f_string_eol_s); - fl_print_format("%[%Q%]'.%r", print->to, print->notable, main->setting.path_pid, print->notable, f_string_eol_s); - - if (main->setting.path_control.used) { - fl_print_format("%rControl socket '", print->to, f_string_eol_s); - fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, main->setting.path_control, print->notable); - fl_print_format("'.%r", print->to, f_string_eol_s); - } - - controller_unlock_print_flush(print->to, &main->thread); - - return F_okay; - } -#endif // _di_controller_print_perform_debug_pid_file_control_socket_ - -#ifndef _di_controller_print_perform_debug_pid_file_create_problem_ - f_status_t controller_print_perform_debug_pid_file_create_problem(fl_print_t * const print, const f_string_t function, const f_status_t status, 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; - - controller_t * const main = (controller_t *) print->custom; - - controller_lock_print(print->to, &main->thread); - - if (F_status_set_fine(status) == F_read_only) { - fl_print_format("%r%[%QThe pid file '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); - fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, main->setting.path_pid, print->notable); - 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, F_true, main->setting.path_pid, f_file_operation_create_s, fll_error_file_type_file_e, status); - } - - f_file_stream_lock(print->to); - - controller_print_entry_error_cache(print->to, &main->thread.cache.action, is_entry); - - controller_unlock_print_flush(print->to, &main->thread); - } -#endif // _di_controller_print_perform_debug_pid_file_create_problem_ - -#ifndef _di_controller_print_perform_debug_pid_file_create_success_ - f_status_t controller_print_perform_debug_pid_file_create_success(fl_print_t * const print, 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; - - controller_t * const main = (controller_t *) print->custom; - - controller_lock_print(print->to, &main->thread); - - fl_print_format("%rPID file '", print->to, f_string_eol_s); - fl_print_format("%[%Q%]' created.%r", print->to, print->notable, main->setting.path_pid, print->notable, f_string_eol_s); - - controller_unlock_print_flush(print->to, &main->thread); - } -#endif // _di_controller_print_perform_debug_pid_file_create_success_ - -#ifndef _di_controller_print_perform_error_pid_file_create_ - f_status_t controller_print_perform_error_pid_file_create(fl_print_t * const print, const f_string_t function, const f_status_t status, const uint8_t is_entry) { - - if (!print || !print->custom) return F_status_set_error(F_output_not); - if (print->verbosity < f_console_verbosity_error_e) return F_output_not; - - controller_t * const main = (controller_t *) print->custom; - - controller_lock_print(print->to, &main->thread); - - controller_print_error_file_status(print, function, F_true, main->setting.path_pid, f_file_operation_create_s, fll_error_file_type_file_e, status); - - f_file_stream_lock(print->to); - - controller_print_entry_error_cache(print->to, &main->thread.cache.action, is_entry); - - controller_unlock_print_flush(print->to, &main->thread); - } -#endif // _di_controller_print_perform_error_pid_file_create_ - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/sources/c/main/print/perform.h b/sources/c/main/print/perform.h deleted file mode 100644 index 578e62b..0000000 --- a/sources/c/main/print/perform.h +++ /dev/null @@ -1,186 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print perform functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_perform_h -#define _controller_main_print_perform_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Print debug message about control socket failing for the reason specified. - * - * @param print - * The output structure to print to. - * - * This requires print.custom to be controller_t. - * - * This does not alter print.custom.setting.state.status. - * @param status - * The status code relating to the failure. - * @param message - * A short message describing the reason for the failure. - * - * @return - * F_okay on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - */ -#ifndef _di_controller_print_perform_debug_control_socket_failure_ - extern f_status_t controller_print_perform_debug_control_socket_failure(fl_print_t * const print, const f_status_t status, const f_string_t message); -#endif // _di_controller_print_perform_debug_control_socket_failure_ - -/** - * Print debug message about control socket being created. - * - * @param print - * The output structure to print to. - * - * This requires print.custom to be controller_t. - * - * This does not alter print.custom.setting.state.status. - * - * @return - * F_okay on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - */ -#ifndef _di_controller_print_perform_debug_control_socket_success_ - extern f_status_t controller_print_perform_debug_control_socket_success(fl_print_t * const print); -#endif // _di_controller_print_perform_debug_control_socket_success_ - -/** - * Print debug message about control socket missing in read only mode. - * - * @param print - * The output structure to print to. - * - * This requires print.custom to be controller_t. - * - * This does not alter print.custom.setting.state.status. - * - * @return - * F_okay on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - */ -#ifndef _di_controller_print_perform_debug_control_socket_missing_read_only_ - extern f_status_t controller_print_perform_debug_control_socket_missing_read_only(fl_print_t * const print); -#endif // _di_controller_print_perform_debug_pid_file_control_socket_ - -/** - * Print debug message about PID file and control socket. - * - * @param print - * The output structure to print to. - * - * This requires print.custom to be controller_t. - * - * This does not alter print.custom.setting.state.status. - * - * @return - * F_okay on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - */ -#ifndef _di_controller_print_perform_debug_pid_file_control_socket_ - extern f_status_t controller_print_perform_debug_pid_file_control_socket(fl_print_t * const print); -#endif // _di_controller_print_perform_debug_pid_file_control_socket_ - -/** - * Print debug message on problems when creating PID file. - * - * @param print - * The output structure to print to. - * - * This requires print.custom to be controller_t. - * - * This does not alter print.custom.setting.state.status. - * @param function - * The name of the function associated with the error. - * @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 is_entry - * If TRUE, then this operates as an entry. - * If FALSE, then this operates as an exit. - * - * @return - * F_okay on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - */ -#ifndef _di_controller_print_perform_debug_pid_file_create_problem_ - extern f_status_t controller_print_perform_debug_pid_file_create_problem(fl_print_t * const print, const f_string_t function, const f_status_t status, const uint8_t is_entry); -#endif // _di_controller_print_perform_debug_pid_file_create_problem_ - -/** - * Print debug message on success when creating PID file. - * - * @param print - * The output structure to print to. - * - * This requires print.custom to be controller_t. - * - * This does not alter print.custom.setting.state.status. - * @param is_entry - * If TRUE, then this operates as an entry. - * If FALSE, then this operates as an exit. - * - * @return - * F_okay on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - */ -#ifndef _di_controller_print_perform_debug_pid_file_create_success_ - extern f_status_t controller_print_perform_debug_pid_file_create_success(fl_print_t * const print, const uint8_t is_entry); -#endif // _di_controller_print_perform_debug_pid_file_create_success_ - -/** - * Print error message on problems when creating PID file. - * - * @param print - * The output structure to print to. - * - * This requires print.custom to be controller_t. - * - * This does not alter print.custom.setting.state.status. - * @param function - * The name of the function associated with the error. - * @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 is_entry - * If TRUE, then this operates as an entry. - * If FALSE, then this operates as an exit. - * - * @return - * F_okay on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - */ -#ifndef _di_controller_print_perform_error_pid_file_create_ - extern f_status_t controller_print_perform_error_pid_file_create(fl_print_t * const print, const f_string_t function, const f_status_t status, const uint8_t is_entry); -#endif // _di_controller_print_perform_error_pid_file_create_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_perform_h diff --git a/sources/c/main/print/rule.h b/sources/c/main/print/rule.h deleted file mode 100644 index 77031ed..0000000 --- a/sources/c/main/print/rule.h +++ /dev/null @@ -1,76 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Controller - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print rule functionality. - * - * This is auto-included and should not need to be explicitly included. - */ -#ifndef _controller_main_print_rule_h -#define _controller_main_print_rule_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Print generic error/warning information. - * - * This is essentially a wrapper to fll_error_print() that includes locking. - * - * @param print - * Designates how printing is to be performed. - * @param cache - * The action cache. - * @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 fallback - * Set to F_true to print the fallback error message for unknown errors. - * @param item - * If TRUE, then this error is associated with an item. - * If FALSE, then this error is associated with a rule setting. - * - * @see fll_error_print() - * @see controller_print_rule_error_cache() - */ -#ifndef _di_controller_print_rule_error_ - extern f_status_t controller_print_rule_error(fl_print_t * const print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item); -#endif // _di_controller_print_rule_error_ - -/** - * Print additional error/warning information in addition to existing error. - * - * This is explicitly intended to be used in addition to the error message. - * - * This neither locks the thread nor does it check to see if output is enabled or disabled. - * - * @param print - * The error or warning output structure. - * @param cache - * A structure for containing and caching relevant data. - * @param item - * If TRUE, then this error is associated with an item. - * If FALSE, then this error is associated with a rule setting. - * - * @see controller_rule_action_read() - * @see controller_rule_item_read() - * @see controller_rule_items_read() - * @see controller_rule_read() - * @see controller_rule_setting_read() - */ -#ifndef _di_controller_print_rule_error_cache_ - extern f_status_t controller_print_rule_error_cache(fl_print_t * const print, const controller_cache_action_t cache, const bool item); -#endif // _di_controller_print_rule_error_cache_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _controller_main_print_rule_h diff --git a/sources/c/main/print/entry/warning/action.c b/sources/c/main/print/warning/entry/action.c similarity index 76% rename from sources/c/main/print/entry/warning/action.c rename to sources/c/main/print/warning/entry/action.c index c58def6..cf925b9 100644 --- a/sources/c/main/print/entry/warning/action.c +++ b/sources/c/main/print/warning/entry/action.c @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef _di_controller_print_entry_warning_action_failsafe_twice_ - f_status_t controller_print_entry_warning_action_failsafe_twice(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry) { +#ifndef _di_controller_print_warning_entry_action_failsafe_twice_ + f_status_t controller_print_warning_entry_action_failsafe_twice(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; @@ -16,16 +16,16 @@ extern "C" { fl_print_format("%r%[%QFailsafe may not be specified when running in failsafe, ignoring.%]%r", print->to, f_string_eol_s, print->context, print->prefix, print->context, f_string_eol_s); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_warning_action_failsafe_twice_ +#endif // _di_controller_print_warning_entry_action_failsafe_twice_ -#ifndef _di_controller_print_entry_warning_action_multiple_ - f_status_t controller_print_entry_warning_action_multiple(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name) { +#ifndef _di_controller_print_warning_entry_action_multiple_ + f_status_t controller_print_warning_entry_action_multiple(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; @@ -38,13 +38,13 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable); fl_print_format("%[' %r item actions detected; only the first will be used.%]%r", print->to, print->context, is_entry ? controller_entry_s : controller_exit_s, print->context, f_string_eol_s); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_warning_action_multiple_ +#endif // _di_controller_print_warning_entry_action_multiple_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/warning/action.h b/sources/c/main/print/warning/entry/action.h similarity index 74% rename from sources/c/main/print/entry/warning/action.h rename to sources/c/main/print/warning/entry/action.h index 52f32e8..89b1c74 100644 --- a/sources/c/main/print/entry/warning/action.h +++ b/sources/c/main/print/warning/entry/action.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _controller_main_print_entry_warning_action_h -#define _controller_main_print_entry_warning_action_h +#ifndef _controller_main_print_warning_entry_action_h +#define _controller_main_print_warning_entry_action_h #ifdef __cplusplus extern "C" { @@ -42,11 +42,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_warning_action_failsafe_twice_ - extern f_status_t controller_print_entry_warning_action_failsafe_twice(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry); -#endif // _di_controller_print_entry_warning_action_failsafe_twice_ +#ifndef _di_controller_print_warning_entry_action_failsafe_twice_ + extern f_status_t controller_print_warning_entry_action_failsafe_twice(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry); +#endif // _di_controller_print_warning_entry_action_failsafe_twice_ /** * Print warning message about multiple actions for a specified item. @@ -76,14 +76,14 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. * * @see fll_error_file_print() - * @see controller_print_entry_error_cache() + * @see controller_print_error_entry_cache() */ -#ifndef _di_controller_print_entry_warning_action_multiple_ - extern f_status_t controller_print_entry_warning_action_multiple(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name); -#endif // _di_controller_print_entry_warning_action_multiple_ +#ifndef _di_controller_print_warning_entry_action_multiple_ + extern f_status_t controller_print_warning_entry_action_multiple(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_string_static_t name); +#endif // _di_controller_print_warning_entry_action_multiple_ #ifdef __cplusplus } // extern "C" #endif -#endif // _controller_main_print_entry_warning_action_h +#endif // _controller_main_print_warning_entry_action_h diff --git a/sources/c/main/print/entry/warning/setting.c b/sources/c/main/print/warning/entry/setting.c similarity index 80% rename from sources/c/main/print/entry/warning/setting.c rename to sources/c/main/print/warning/entry/setting.c index c1ea8aa..651ebf4 100644 --- a/sources/c/main/print/entry/warning/setting.c +++ b/sources/c/main/print/warning/entry/setting.c @@ -4,8 +4,8 @@ extern "C" { #endif -#ifndef _di_controller_print_entry_warning_setting_unknown_action_ - f_status_t controller_print_entry_warning_setting_unknown_action(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry) { +#ifndef _di_controller_print_warning_entry_setting_unknown_action_ + f_status_t controller_print_warning_entry_setting_unknown_action(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry) { if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; @@ -18,13 +18,13 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, print->to.stream, print->notable, cache->action.name_action, print->notable); fl_print_format(f_string_format_sentence_end_quote_s.string, print->to.stream, print->context, print->context, f_string_eol_s); - controller_print_entry_error_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &cache->action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_entry_warning_setting_unknown_action_ +#endif // _di_controller_print_warning_entry_setting_unknown_action_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/entry/warning/setting.h b/sources/c/main/print/warning/entry/setting.h similarity index 86% rename from sources/c/main/print/entry/warning/setting.h rename to sources/c/main/print/warning/entry/setting.h index cbd51c4..8c398f0 100644 --- a/sources/c/main/print/entry/warning/setting.h +++ b/sources/c/main/print/warning/entry/setting.h @@ -41,9 +41,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_entry_warning_setting_unknown_action_ - extern f_status_t controller_print_entry_warning_setting_unknown_action(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry); -#endif // _di_controller_print_entry_warning_setting_unknown_action_ +#ifndef _di_controller_print_warning_entry_setting_unknown_action_ + extern f_status_t controller_print_warning_entry_setting_unknown_action(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry); +#endif // _di_controller_print_warning_entry_setting_unknown_action_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/warning/rule/action.c b/sources/c/main/print/warning/rule/action.c new file mode 100644 index 0000000..a2a2af5 --- /dev/null +++ b/sources/c/main/print/warning/rule/action.c @@ -0,0 +1,29 @@ +#include "../../../controller.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_controller_print_warning_rule_action_unknown_ + f_status_t controller_print_warning_rule_action_unknown(fl_print_t * const print, controller_cache_t * const cache) { + + if (!print || !print->custom || !cache) return F_status_set_error(F_output_not); + if (print->verbosity < f_console_verbosity_debug_e) return F_output_not; + + controller_t * const main = (controller_t *) print->custom; + + controller_lock_print(print->to, &main->thread); + + fl_print_format("%r%[%QAction type is unknown, ignoring.%]%r", print->to, f_string_eol_s, print->context, print->prefix, print->context, f_string_eol_s); + + controller_print_error_rule_cache(print, cache->action, F_true); + + controller_unlock_print_flush(print->to, &main->thread); + + return F_okay; + } +#endif // _di_controller_print_warning_rule_action_unknown_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sources/c/main/print/warning/rule/action.h b/sources/c/main/print/warning/rule/action.h new file mode 100644 index 0000000..4295bd0 --- /dev/null +++ b/sources/c/main/print/warning/rule/action.h @@ -0,0 +1,52 @@ +/** + * FLL - Level 3 + * + * Project: Controller + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print entry warning action functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _controller_main_print_warning_rule_action_h +#define _controller_main_print_warning_rule_action_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print warning message about rule action being unknown. + * + * @param print + * The output structure to print to. + * + * This requires print.custom to be controller_t. + * + * This does not alter print.custom.setting.state.status. + * + * Must not be NULL. + * @param cache + * The cache. + * + * Must not be NULL. + * + * @return + * F_okay on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fll_error_file_print() + * @see controller_print_error_entry_cache() + */ +#ifndef _di_controller_print_warning_entry_action_multiple_ + extern f_status_t controller_print_warning_rule_action_unknown(fl_print_t * const print, controller_cache_t * const cache); +#endif // _di_controller_print_warning_entry_action_multiple_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _controller_main_print_warning_rule_action_h diff --git a/sources/c/main/rule/action.c b/sources/c/main/rule/action.c index 86e2eb2..332b29d 100644 --- a/sources/c/main/rule/action.c +++ b/sources/c/main/rule/action.c @@ -252,7 +252,7 @@ extern "C" { } if (!type_rerun) { - controller_print_rule_item_error_action_first(&main->program.error, cache); + controller_print_error_rule_item_action_first(&main->program.error, cache); return F_status_set_error(F_valid_not); } @@ -270,7 +270,7 @@ extern "C" { } } else { - controller_print_rule_item_error_action_second(&main->program.error, cache); + controller_print_error_rule_item_action_second(&main->program.error, cache); return F_status_set_error(F_valid_not); } @@ -287,7 +287,7 @@ extern "C" { item->reruns[type_rerun].is |= rerun_item == &item->reruns[type_rerun].failure ? controller_rule_rerun_is_failure_reset_d : controller_rule_rerun_is_success_reset_d; } else { - controller_print_rule_item_error_action_unknown(&main->program.error, cache, controller_rerun_s, cache->content_action.array[i]); + controller_print_error_rule_item_action_unknown(&main->program.error, cache, controller_rerun_s, cache->content_action.array[i]); return F_status_set_error(F_valid_not); } @@ -312,7 +312,7 @@ extern "C" { item->with &= ~controller_with_session_new_d; } else { - controller_print_rule_item_error_action_unknown(&main->program.error, cache, controller_with_s, cache->content_action.array[i]); + controller_print_error_rule_item_action_unknown(&main->program.error, cache, controller_with_s, cache->content_action.array[i]); status = F_status_set_error(F_valid_not); @@ -407,7 +407,7 @@ extern "C" { } if (F_status_is_error_not(status) && status == F_data_not) { - controller_print_rule_item_debug_action_empty(&main->program.debug, cache); + controller_print_debug_rule_action_empty(&main->program.debug, cache); } return status; @@ -443,34 +443,7 @@ extern "C" { controller_print_error(&main->program.error, macro_controller_f(fl_conversion_dynamic_partial_to_signed_detect)); } else { - controller_lock_print(main->program.error.to, &main->thread); - - fl_print_format("%r%[%QRule item action '%]", main->program.error.to, f_string_eol_s, main->program.error.context, main->program.error.prefix, main->program.error.context); - fl_print_format(f_string_format_r_single_s.string, main->program.error.to, main->program.error.notable, controller_rerun_s, main->program.error.notable); - fl_print_format("%[' requires a positive whole number or 0 for the '%]", main->program.error.to, main->program.error.context, main->program.error.context); - fl_print_format("%[%S%]", main->program.error.to, main->program.error.notable, name, main->program.error.notable); - fl_print_format("%[' value", main->program.error.to, main->program.error.context, main->program.error.context); - - if (*index + 1 == cache->content_action.used) { - fl_print_format(", but none were given.%]%r", main->program.error.to, main->program.error.context, f_string_eol_s); - } - else { - fl_print_format(", but '%]%[%/Q%]", main->program.error.to, main->program.error.context, main->program.error.notable, cache->buffer_item, cache->content_action.array[*index], main->program.error.notable); - - if (status == F_number || status == F_number_decimal) { - fl_print_format("%[' was given.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - } - else if (status == F_number_overflow) { - fl_print_format("%[' is too large.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - } - else { - fl_print_format("%[' is negative.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - } - } - - controller_print_rule_error_cache(&main->program.error, cache->action, F_true); - - controller_unlock_print_flush(main->program.error.to, &main->thread); + controller_print_error_rule_item_action_positive_number_not(&main->program.error, cache, name, *index); } } diff --git a/sources/c/main/rule/execute.c b/sources/c/main/rule/execute.c index 105d5c9..935639a 100644 --- a/sources/c/main/rule/execute.c +++ b/sources/c/main/rule/execute.c @@ -252,7 +252,7 @@ extern "C" { status = controller_rule_expand(main, instance->rule.items.array[i].actions.array[j], instance); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); + controller_print_error_rule(&main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); break; } @@ -263,7 +263,7 @@ extern "C" { if (status == F_child || F_status_set_fine(status) == F_interrupt || F_status_set_fine(status) == F_lock) break; if (F_status_is_error(status) && F_status_set_fine(status) != F_failure) break; - } while (controller_rule_execute_rerun(controller_rule_action_type_to_action_execute_type(action), instance, &instance->rule.items.array[i]) > 0); + } while (controller_rule_execute_rerun(instance, &instance->rule.items.array[i], controller_rule_action_type_to_action_execute_type(action)) > 0); if (status == F_child || F_status_set_fine(status) == F_interrupt || F_status_set_fine(status) == F_lock) break; @@ -282,7 +282,7 @@ extern "C" { status = controller_rule_expand(main, instance->rule.items.array[i].actions.array[j], instance); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); + controller_print_error_rule(&main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); break; } @@ -305,7 +305,7 @@ extern "C" { if (status == F_child || F_status_set_fine(status) == F_lock) break; if (F_status_is_error(status) && F_status_set_fine(status) != F_failure) break; - } while (controller_rule_execute_rerun(controller_rule_action_type_to_action_execute_type(action), instance, &instance->rule.items.array[i]) > 0); + } while (controller_rule_execute_rerun(instance, &instance->rule.items.array[i], controller_rule_action_type_to_action_execute_type(action)) > 0); if (status == F_child || F_status_set_fine(status) == F_interrupt || F_status_set_fine(status) == F_lock) break; @@ -324,7 +324,7 @@ extern "C" { status = controller_rule_expand(main, instance->rule.items.array[i].actions.array[j], instance); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); + controller_print_error_rule(&main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); break; } @@ -336,7 +336,7 @@ extern "C" { if (status == F_child || F_status_set_fine(status) == F_interrupt || F_status_set_fine(status) == F_lock) break; if (F_status_is_error(status) && F_status_set_fine(status) != F_failure) break; - } while (controller_rule_execute_rerun(controller_rule_action_type_to_action_execute_type(action), instance, &instance->rule.items.array[i]) > 0); + } while (controller_rule_execute_rerun(instance, &instance->rule.items.array[i], controller_rule_action_type_to_action_execute_type(action)) > 0); if (status == F_child || F_status_set_fine(status) == F_interrupt || F_status_set_fine(status) == F_lock) break; @@ -354,7 +354,7 @@ extern "C" { else { success = F_status_set_error(F_failure); - controller_print_rule_action_error_missing_pid(&main->program.error, instance->rule.alias); + controller_print_error_rule_action_missing_pid(&main->program.error, instance->rule.alias); } } else if (instance->rule.items.array[i].type == controller_rule_item_type_utility_e) { @@ -362,7 +362,7 @@ extern "C" { status = controller_rule_expand(main, instance->rule.items.array[i].actions.array[j], instance); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); + controller_print_error_rule(&main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); break; } @@ -380,7 +380,7 @@ extern "C" { if (status == F_child || F_status_set_fine(status) == F_interrupt || F_status_set_fine(status) == F_lock) break; if (F_status_is_error(status) && F_status_set_fine(status) != F_failure) break; - } while (controller_rule_execute_rerun(controller_rule_action_type_to_action_execute_type(action), instance, &instance->rule.items.array[i]) > 0); + } while (controller_rule_execute_rerun(instance, &instance->rule.items.array[i], controller_rule_action_type_to_action_execute_type(action)) > 0); if (status == F_child || F_status_set_fine(status) == F_interrupt || F_status_set_fine(status) == F_lock) break; @@ -398,19 +398,11 @@ extern "C" { else { success = F_status_set_error(F_failure); - controller_print_rule_action_error_missing_pid(&main->program.error, instance->rule.alias); + controller_print_error_rule_action_missing_pid(&main->program.error, instance->rule.alias); } } else { - if (main->program.warning.verbosity == f_console_verbosity_debug_e) { - controller_lock_print(main->program.warning.to, &main->thread); - - fl_print_format("%r%[%QAction type is unknown, ignoring.%]%r", main->program.warning.to, f_string_eol_s, main->program.warning.context, main->program.warning.prefix, main->program.warning.context, f_string_eol_s); - - controller_print_rule_error_cache(&main->program.warning, instance->cache.action, F_true); - - controller_unlock_print_flush(main->program.warning.to, &main->thread); - } + controller_print_warning_rule_action_unknown(&main->program.warning, &instance->cache); if (success == F_false) { success = F_ignore; @@ -435,21 +427,10 @@ extern "C" { success = F_false; } - if (!controller_thread_is_enabled_instance(instance)) { - return F_status_set_error(F_interrupt); - } - - if (status == F_child || F_status_is_error(status)) { - return status; - } - - if (success == F_false || success == F_failure) { - return F_status_set_error(F_failure); - } - - if (success == F_ignore) { - return F_ignore; - } + if (!controller_thread_is_enabled_instance(instance)) return F_status_set_error(F_interrupt); + if (status == F_child || F_status_is_error(status)) return status; + if (success == F_false || success == F_failure) return F_status_set_error(F_failure); + if (success == F_ignore) return F_ignore; return F_okay; } @@ -492,34 +473,7 @@ extern "C" { } if (options & controller_instance_option_simulate_e) { - if (main->program.output.verbosity != f_console_verbosity_quiet_e) { - controller_lock_print(main->program.output.to, &instance->main->thread); - - fl_print_format("%rSimulating execution of '%[", main->program.output.to, f_string_eol_s, main->program.context.set.title); - - if (program.used) { - f_print_dynamic_safely(program, main->program.output.to); - } - else { - f_print_dynamic_safely(arguments.array[0], main->program.output.to); - } - - fl_print_format("%]' with the arguments: '%[", main->program.output.to, main->program.context.set.title, main->program.context.set.important); - - for (f_number_unsigned_t i = program.used ? 0 : 1; i < arguments.used; ++i) { - - if (program.used && i || !program.used && i > 1) { - f_print_dynamic_raw(f_string_space_s, main->program.output.to); - } - - f_print_dynamic_safely(arguments.array[i], main->program.output.to); - } // for - - fl_print_format("%]' from '", main->program.output.to, main->program.context.set.important); - fl_print_format("%[%Q%]'.%r", main->program.output.to, main->program.context.set.notable, instance->rule.name, main->program.context.set.notable, f_string_eol_s); - - controller_unlock_print_flush(main->program.output.to, &instance->main->thread); - } + controller_print_entry_output_execute_simulate(&main->program.output, instance, program, arguments); // Sleep for less than a second to better show simulation of synchronous vs asynchronous. { @@ -554,14 +508,11 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false); if (F_status_set_fine(status_lock) != F_interrupt) { status = controller_lock_read_instance(instance, &instance->active); - - if (status == F_okay) { - return status_lock; - } + if (status == F_okay) return status_lock; } return F_status_set_error(F_lock); @@ -575,7 +526,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &instance->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); } if (F_status_set_fine(status_lock) != F_interrupt) { @@ -595,7 +546,7 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false); if (F_status_set_fine(status_lock) != F_interrupt) { status = controller_lock_read_instance(instance, &instance->active); @@ -615,7 +566,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &instance->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); return F_status_set_error(F_lock); } @@ -650,7 +601,7 @@ extern "C" { status = F_status_set_fine(status); if ((WIFEXITED(instance->result) && WEXITSTATUS(instance->result)) || status == F_control_group || status == F_failure || status == F_limit || status == F_processor || status == F_schedule) { - controller_print_rule_item_error_execute(&instance->main->program.error, instance, type == controller_rule_item_type_script_e, program.used ? program : arguments.array[0], status); + controller_print_error_rule_item_execute(&instance->main->program.error, instance, type == controller_rule_item_type_script_e, program.used ? program : arguments.array[0], status); } else { controller_print_error_status(&instance->main->program.error, macro_controller_f(fll_execute_program), F_status_set_fine(status)); @@ -737,34 +688,7 @@ extern "C" { } if (options & controller_instance_option_simulate_e) { - if (main->program.error.verbosity > f_console_verbosity_error_e) { - controller_lock_print(main->program.error.to, &instance->main->thread); - - fl_print_format("%rSimulating execution of '%[", main->program.error.to, f_string_eol_s, main->program.context.set.title); - - if (program.used) { - f_print_dynamic_safely(program, main->program.error.to); - } - else { - f_print_dynamic_safely(arguments.array[0], main->program.error.to); - } - - fl_print_format("%]' with the arguments: '%[", main->program.error.to, main->program.context.set.title, main->program.context.set.important); - - for (f_number_unsigned_t i = program.used ? 0 : 1; i < arguments.used; ++i) { - - if (program.used && i || !program.used && i > 1) { - f_print_dynamic_raw(f_string_space_s, main->program.error.to); - } - - f_print_dynamic_safely(arguments.array[i], main->program.error.to); - } // for - - fl_print_format("%]' from '", main->program.error.to, main->program.context.set.important); - fl_print_format("%[%Q%]'.%r", main->program.error.to, main->program.context.set.notable, instance->rule.name, main->program.context.set.notable, f_string_eol_s); - - controller_unlock_print_flush(main->program.error.to, &instance->main->thread); - } + controller_print_entry_output_execute_simulate(&main->program.output, instance, program, arguments); // Sleep for less than a second to better show simulation of synchronous vs asynchronous. { @@ -800,14 +724,11 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false); if (F_status_set_fine(status_lock) != F_interrupt) { status = controller_lock_read_instance(instance, &instance->active); - - if (status == F_okay) { - return status_lock; - } + if (status == F_okay) return status_lock; } return F_status_set_error(F_lock); @@ -821,7 +742,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &instance->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); } if (F_status_set_fine(status_lock) != F_interrupt) { @@ -831,11 +752,7 @@ extern "C" { } if (!controller_thread_is_enabled_instance(instance)) { - if (status_lock == F_okay) { - return F_status_set_error(F_interrupt); - } - - return F_status_set_error(F_lock); + return status_lock == F_okay ? F_status_set_error(F_interrupt) : F_status_set_error(F_lock); } if (status_lock == F_okay) { @@ -845,14 +762,11 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false); if (F_status_set_fine(status_lock) != F_interrupt) { status = controller_lock_read_instance(instance, &instance->active); - - if (status == F_okay) { - return status_lock; - } + if (status == F_okay) return status_lock; } return F_status_set_error(F_lock); @@ -868,7 +782,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &instance->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); return F_status_set_error(F_lock); } @@ -883,9 +797,7 @@ extern "C" { else { main->program.child = result.status; - if (!controller_thread_is_enabled_instance(instance)) { - return F_status_set_error(F_interrupt); - } + if (!controller_thread_is_enabled_instance(instance)) return F_status_set_error(F_interrupt); } if (F_status_is_error(status)) { @@ -899,15 +811,13 @@ extern "C" { } } - if (status == F_child || F_status_set_fine(status) == F_interrupt) { - return status; - } + if (status == F_child || F_status_set_fine(status) == F_interrupt) return status; if (F_status_is_error(status)) { status = F_status_set_fine(status); if ((WIFEXITED(instance->result) && WEXITSTATUS(instance->result)) || status == F_control_group || status == F_failure || status == F_limit || status == F_processor || status == F_schedule) { - controller_print_rule_item_error_execute(&instance->main->program.error, instance, type == controller_rule_item_type_utility_e, program.used ? program : arguments.array[0], status); + controller_print_error_rule_item_execute(&instance->main->program.error, instance, type == controller_rule_item_type_utility_e, program.used ? program : arguments.array[0], status); } else { controller_print_error_status(&instance->main->program.error, macro_controller_f(fll_execute_program), F_status_set_fine(status)); @@ -921,7 +831,7 @@ extern "C" { #endif // _di_controller_rule_execute_pid_with_ #ifndef _di_controller_rule_execute_rerun_ - int8_t controller_rule_execute_rerun(const uint8_t action, controller_instance_t * const instance, controller_rule_item_t * const item) { + int8_t controller_rule_execute_rerun(controller_instance_t * const instance, controller_rule_item_t * const item, const uint8_t action) { if (!instance || !instance->main || !item) return F_false; @@ -934,27 +844,7 @@ extern "C" { if (!controller_thread_is_enabled_instance(instance)) return -2; if (!rerun_item->max || rerun_item->count < rerun_item->max) { - if (main->program.error.verbosity == f_console_verbosity_debug_e) { - controller_lock_print(main->program.output.to, &instance->main->thread); - - fl_print_format("%rRe-running '", main->program.output.to, f_string_eol_s); - fl_print_format("%[%r%]' '", main->program.output.to, main->program.context.set.title, instance->rule.alias, main->program.context.set.title); - fl_print_format("%[%r%]' with a ", main->program.output.to, main->program.context.set.notable, controller_convert_rule_action_execute_type_string(action), main->program.context.set.notable); - fl_print_format("%[%r%] of ", main->program.output.to, main->program.context.set.notable, controller_delay_s, main->program.context.set.notable); - fl_print_format("%[%ul%] MegaTime", main->program.output.to, main->program.context.set.notable, rerun_item->delay, main->program.context.set.notable); - - if (rerun_item->max) { - fl_print_format(" for %[%ul%]", main->program.output.to, main->program.context.set.notable, rerun_item->count, main->program.context.set.notable); - fl_print_format(" of %[%r%] ", main->program.output.to, main->program.context.set.notable, controller_max_s, main->program.context.set.notable); - fl_print_format(f_string_format_un_single_s.string, main->program.output.to, main->program.context.set.notable, rerun_item->max, main->program.context.set.notable); - fl_print_format(".%r", main->program.output.to, f_string_eol_s); - } - else { - fl_print_format(" with no %[%r%].%r", main->program.output.to, main->program.context.set.notable, controller_max_s, main->program.context.set.notable, f_string_eol_s); - } - - controller_unlock_print_flush(main->program.output.to, &instance->main->thread); - } + controller_main_print_debug_rule_execute_rerun(&main->program.output, return_item, action); if (rerun_item->delay) { f_time_spec_t delay = f_time_spec_t_initialize; diff --git a/sources/c/main/rule/execute.h b/sources/c/main/rule/execute.h index 8f409ec..9cde8f5 100644 --- a/sources/c/main/rule/execute.h +++ b/sources/c/main/rule/execute.h @@ -140,13 +140,17 @@ extern "C" { /** * Determine whether or not an execute rule should be re-run, applying a delay as requested. * - * @param action - * The action type. * @param instance * The instance data for processing this rule. + * + * Must not be NULL. * @param item * The rule item being executed. * + * Must not be NULL. + * @param action + * The action type. + * * @return * A positive number to designate re-run. * 0 to designate do not re-run. @@ -157,7 +161,7 @@ extern "C" { * -2 to designate exit due to signal/disabled thread. */ #ifndef _di_controller_rule_execute_rerun_ - extern int8_t controller_rule_execute_rerun(const uint8_t action, controller_instance_t * const instance, controller_rule_item_t * const item); + extern int8_t controller_rule_execute_rerun(controller_instance_t * const instance, controller_rule_item_t * const item, const uint8_t action); #endif // _di_controller_rule_execute_rerun_ #ifdef __cplusplus diff --git a/sources/c/main/rule/instance.c b/sources/c/main/rule/instance.c index ade4ce9..3394cdf 100644 --- a/sources/c/main/rule/instance.c +++ b/sources/c/main/rule/instance.c @@ -28,10 +28,10 @@ extern "C" { controller_lock_print(main->program.error.to, &main->thread); fl_print_format("%r%[%QUnsupported action type '%]", main->program.error.to, f_string_eol_s, main->program.error.context, main->program.error.prefix, main->program.error.context); - fl_print_format(f_string_format_r_single_s.string, main->program.error.to, main->program.error.notable, controller_convert_rule_action_type_string(instance->action), main->program.error.notable); + fl_print_format(f_string_format_Q_single_s.string, main->program.error.to, main->program.error.notable, controller_convert_rule_action_type_string(instance->action), main->program.error.notable); fl_print_format("%[' while attempting to execute rule.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.error, instance->cache.action, F_true); + controller_print_error_rule_cache(&main->program.error, instance->cache.action, F_true); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -53,7 +53,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); + controller_print_error_rule(&main->program.error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); return status; } @@ -61,7 +61,7 @@ extern "C" { status = f_string_dynamic_append(instance->rule.alias, &instance->cache.action.name_file); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); + controller_print_error_rule(&main->program.error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); return status; } @@ -73,7 +73,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); + controller_print_error_rule(&main->program.error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); return status; } @@ -131,7 +131,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &main->thread.lock.instance); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); } else { status = controller_instance_prepare_instance_type(main, instance->type, instance->action, dynamics[i]->array[j], &id_dependency); @@ -146,8 +146,8 @@ extern "C" { if (main->program.error.verbosity > f_console_verbosity_quiet_e) { controller_lock_print(main->program.error.to, &main->thread); - controller_print_rule_item_error_rule_not_loaded(&main->program.error, dynamics[i]->array[j]); - controller_print_rule_error_cache(&main->program.error, instance->cache.action, F_false); + controller_print_error_rule_item_rule_not_loaded(&main->program.error, dynamics[i]->array[j]); + controller_print_error_rule_cache(&main->program.error, instance->cache.action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -166,7 +166,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &dependency->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); status = F_false; dependency = 0; @@ -179,7 +179,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &main->thread.lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); status = F_false; } @@ -201,8 +201,8 @@ extern "C" { if (i == 0) { controller_lock_print(main->program.error.to, &main->thread); - controller_print_rule_item_error_need_want_wish(&main->program.error, strings[i], dynamics[i]->array[j], "is not found"); - controller_print_rule_error_cache(&main->program.error, instance->cache.action, F_true); + controller_print_error_rule_item_need_want_wish(&main->program.error, strings[i], dynamics[i]->array[j], "is not found"); + controller_print_error_rule_cache(&main->program.error, instance->cache.action, F_true); controller_unlock_print_flush(main->program.error.to, &main->thread); @@ -220,9 +220,9 @@ extern "C" { if (main->program.warning.verbosity == f_console_verbosity_debug_e) { controller_lock_print(main->program.warning.to, &main->thread); - controller_print_rule_item_error_need_want_wish(&main->program.warning, strings[i], dynamics[i]->array[j], "is not found"); + controller_print_error_rule_item_need_want_wish(&main->program.warning, strings[i], dynamics[i]->array[j], "is not found"); - controller_print_rule_error_cache(&main->program.warning, instance->cache.action, F_true); + controller_print_error_rule_cache(&main->program.warning, instance->cache.action, F_true); controller_unlock_print_flush(main->program.warning.to, &main->thread); } @@ -232,7 +232,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &main->thread.lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); found = F_false; status = status_lock; @@ -256,7 +256,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &dependency->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); status = status_lock; } @@ -273,7 +273,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &main->thread.lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); f_thread_unlock(&dependency->lock); @@ -306,8 +306,8 @@ extern "C" { if (i == 0 || i == 1 || F_status_set_fine(status) == F_memory_not) { controller_lock_print(main->program.error.to, &main->thread); - controller_print_rule_item_error_need_want_wish(&main->program.error, strings[i], alias_other_buffer, "failed during execution"); - controller_print_rule_error_cache(&main->program.error, instance->cache.action, F_true); + controller_print_error_rule_item_need_want_wish(&main->program.error, strings[i], alias_other_buffer, "failed during execution"); + controller_print_error_rule_cache(&main->program.error, instance->cache.action, F_true); controller_unlock_print_flush(main->program.error.to, &main->thread); @@ -321,9 +321,9 @@ extern "C" { if (main->program.warning.verbosity == f_console_verbosity_debug_e) { controller_lock_print(main->program.warning.to, &main->thread); - controller_print_rule_item_error_need_want_wish(&main->program.warning, strings[i], alias_other_buffer, "failed during execution"); + controller_print_error_rule_item_need_want_wish(&main->program.warning, strings[i], alias_other_buffer, "failed during execution"); - controller_print_rule_error_cache(&main->program.warning, instance->cache.action, F_true); + controller_print_error_rule_cache(&main->program.warning, instance->cache.action, F_true); controller_unlock_print_flush(main->program.warning.to, &main->thread); } @@ -348,13 +348,13 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &main->thread.lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false); } } if (F_status_is_error(status_lock)) { if (F_status_is_error(status_lock)) { - controller_print_rule_item_error_need_want_wish(&main->program.error, strings[i], alias_other_buffer, "due to lock failure"); + controller_print_error_rule_item_need_want_wish(&main->program.error, strings[i], alias_other_buffer, "due to lock failure"); } status = status_lock; @@ -365,9 +365,9 @@ extern "C" { if (i == 0 || i == 1) { controller_lock_print(main->program.error.to, &main->thread); - controller_print_rule_item_error_need_want_wish(&main->program.error, strings[i], alias_other_buffer, "is in a failed state"); + controller_print_error_rule_item_need_want_wish(&main->program.error, strings[i], alias_other_buffer, "is in a failed state"); - controller_print_rule_error_cache(&main->program.error, instance->cache.action, F_true); + controller_print_error_rule_cache(&main->program.error, instance->cache.action, F_true); controller_unlock_print_flush(main->program.error.to, &main->thread); @@ -383,9 +383,9 @@ extern "C" { if (main->program.warning.verbosity == f_console_verbosity_debug_e) { controller_lock_print(main->program.warning.to, &main->thread); - controller_print_rule_item_error_need_want_wish(&main->program.warning, strings[i], alias_other_buffer, "is in a failed state"); + controller_print_error_rule_item_need_want_wish(&main->program.warning, strings[i], alias_other_buffer, "is in a failed state"); - controller_print_rule_error_cache(&main->program.warning, instance->cache.action, F_true); + controller_print_error_rule_cache(&main->program.warning, instance->cache.action, F_true); controller_unlock_print_flush(main->program.warning.to, &main->thread); } @@ -451,7 +451,7 @@ extern "C" { fl_print_format("%r%[%QThe rule '%]", main->program.error.to, f_string_eol_s, main->program.error.context, main->program.error.prefix, main->program.error.context); fl_print_format(f_string_format_Q_single_s.string, main->program.error.to, main->program.error.notable, instance->rule.name, main->program.error.notable); fl_print_format("%[' has no '%]", main->program.error.to, main->program.error.context, main->program.error.context); - fl_print_format(f_string_format_r_single_s.string, main->program.error.to, main->program.error.notable, controller_convert_rule_action_type_string(instance->action), main->program.error.notable); + fl_print_format(f_string_format_Q_single_s.string, main->program.error.to, main->program.error.notable, controller_convert_rule_action_type_string(instance->action), main->program.error.notable); fl_print_format("%[' action to execute.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); } else { @@ -470,7 +470,7 @@ extern "C" { fl_print_format("%[') to execute.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); } - controller_print_rule_error_cache(&main->program.error, instance->cache.action, F_true); + controller_print_error_rule_cache(&main->program.error, instance->cache.action, F_true); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -487,7 +487,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_rule_item_error(&main->program.error, instance->cache.action, F_true, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, instance->cache.action, F_true, F_status_set_fine(status)); } } } @@ -499,7 +499,7 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false); if (F_status_set_fine(status) != F_interrupt) { status = controller_lock_read_instance(instance, &instance->lock); @@ -519,7 +519,7 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &main->thread.lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false); f_thread_unlock(&instance->lock); @@ -556,7 +556,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); return F_status_set_error(F_lock); } @@ -582,7 +582,7 @@ extern "C" { status = controller_lock_read_instance_type(type, &main->thread, &main->thread.lock.instance); if (F_status_is_error(status)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status), F_true); return status; } @@ -598,8 +598,8 @@ extern "C" { if (main->program.error.verbosity > f_console_verbosity_quiet_e) { controller_lock_print(main->program.error.to, &main->thread); - controller_print_rule_item_error_rule_not_loaded(&main->program.error, alias_rule); - controller_print_rule_error_cache(&main->program.error, cache.action, F_false); + controller_print_error_rule_item_rule_not_loaded(&main->program.error, alias_rule); + controller_print_error_rule_cache(&main->program.error, cache.action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -612,8 +612,8 @@ extern "C" { status = controller_lock_read_instance_type(type, &main->thread, &instance->active); if (F_status_is_error(status)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status), F_true); - controller_print_rule_item_error(&main->program.error, cache.action, F_false, F_status_set_fine(status)); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status), F_true); + controller_print_error_rule_item(&main->program.error, cache.action, F_false, F_status_set_fine(status)); f_thread_unlock(&main->thread.lock.instance); @@ -623,7 +623,7 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false); f_thread_unlock(&instance->active); f_thread_unlock(&main->thread.lock.instance); @@ -659,7 +659,7 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false); f_thread_unlock(&instance->active); @@ -762,7 +762,7 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false); f_thread_unlock(&instance->active); @@ -806,7 +806,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &instance->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); return status_lock; } @@ -815,7 +815,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); if (options_force & controller_instance_option_asynchronous_e) { f_thread_unlock(&instance->active); @@ -833,7 +833,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &instance->main->thread.lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); f_thread_unlock(&instance->lock); @@ -850,7 +850,7 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_false); f_thread_unlock(&instance->main->thread.lock.rule); @@ -870,7 +870,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); f_thread_unlock(&instance->main->thread.lock.rule); @@ -908,7 +908,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, instance->main->program.error.to, instance->main->program.error.notable, instance->rule.alias, instance->main->program.error.notable); fl_print_format("%[' is already on the execution dependency stack, this recursion is prohibited.%]%r", instance->main->program.error.to, instance->main->program.error.context, instance->main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&instance->main->program.error, instance->cache.action, F_true); + controller_print_error_rule_cache(&instance->main->program.error, instance->cache.action, F_true); controller_unlock_print_flush(instance->main->program.error.to, &instance->main->thread); } @@ -942,7 +942,7 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_false); if (options_force & controller_instance_option_asynchronous_e) { f_thread_unlock(&instance->active); @@ -958,7 +958,7 @@ extern "C" { status_lock = controller_lock_read_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_true); if (options_force & controller_instance_option_asynchronous_e) { f_thread_unlock(&instance->active); @@ -982,8 +982,8 @@ extern "C" { if (instance->main->program.error.verbosity > f_console_verbosity_quiet_e) { controller_lock_print(instance->main->program.error.to, &instance->main->thread); - controller_print_rule_item_error_rule_not_loaded(&instance->main->program.error, instance->rule.alias); - controller_print_rule_error_cache(&instance->main->program.error, instance->cache.action, F_false); + controller_print_error_rule_item_rule_not_loaded(&instance->main->program.error, instance->rule.alias); + controller_print_error_rule_cache(&instance->main->program.error, instance->cache.action, F_false); controller_unlock_print_flush(instance->main->program.error.to, &instance->main->thread); } @@ -1002,7 +1002,7 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->main->thread.lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_false); if (F_status_set_fine(status) != F_lock) { f_thread_unlock(&instance->lock); @@ -1038,7 +1038,7 @@ extern "C" { status_lock = controller_lock_write_instance(instance, &instance->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&instance->main->program.error, F_status_set_fine(status_lock), F_false); if (options_force & controller_instance_option_asynchronous_e) { f_thread_unlock(&instance->active); diff --git a/sources/c/main/rule/item.c b/sources/c/main/rule/item.c index d7bdf5b..dbf29c7 100644 --- a/sources/c/main/rule/item.c +++ b/sources/c/main/rule/item.c @@ -129,7 +129,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, main->program.warning.to, main->program.warning.notable, cache->action.name_action, main->program.warning.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, main->program.warning.to, main->program.warning.context, main->program.warning.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.warning, cache->action, F_true); + controller_print_error_rule_cache(&main->program.warning, cache->action, F_true); controller_unlock_print_flush(main->program.warning.to, &main->thread); } diff --git a/sources/c/main/rule/read.c b/sources/c/main/rule/read.c index 7c9611f..56c042a 100644 --- a/sources/c/main/rule/read.c +++ b/sources/c/main/rule/read.c @@ -280,7 +280,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, main->program.warning.to, main->program.warning.notable, cache->action.name_item, main->program.warning.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, main->program.warning.to, main->program.warning.context, main->program.warning.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.warning, cache->action, F_true); + controller_print_error_rule_cache(&main->program.warning, cache->action, F_true); controller_unlock_print_flush(main->program.warning.to, &main->thread); } @@ -327,7 +327,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_rule_item_error(&main->program.error, cache->action, for_item, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, for_item, F_status_set_fine(status)); rule->status[0] = controller_error_simplify(F_status_set_fine(status)); diff --git a/sources/c/main/rule/setting.c b/sources/c/main/rule/setting.c index e4d9990..bb2dd58 100644 --- a/sources/c/main/rule/setting.c +++ b/sources/c/main/rule/setting.c @@ -102,7 +102,7 @@ extern "C" { fll_fss_extended_read(cache->buffer_item, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0, &state); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, F_false); return status; } @@ -137,7 +137,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->object_actions.array[i], &cache->action.name_item); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -155,7 +155,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -226,7 +226,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, main->program.warning.to, main->program.warning.notable, cache->action.name_item, main->program.warning.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, main->program.warning.to, main->program.warning.context, main->program.warning.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.warning, cache->action, F_false); + controller_print_error_rule_cache(&main->program.warning, cache->action, F_false); controller_unlock_print_flush(main->program.warning.to, &main->thread); } @@ -241,7 +241,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, range2, &cache->action.name_action); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); // Get the current line number within the settings item. cache->action.line_item = line_item; @@ -249,7 +249,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -278,7 +278,7 @@ extern "C" { fl_print_format("%r%[%QEmpty rule setting.%]%r", main->program.warning.to, f_string_eol_s, main->program.warning.context, main->program.warning.prefix, main->program.warning.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.warning, cache->action, F_false); + controller_print_error_rule_cache(&main->program.warning, cache->action, F_false); controller_unlock_print_flush(main->program.warning.to, &main->thread); } @@ -289,7 +289,7 @@ extern "C" { if (type == controller_rule_setting_type_affinity_e) { if (!cache->content_actions.array[i].used) { - controller_print_rule_setting_read_error(&main->program.error, "requires one or more Content", i, line_item, &main->thread, cache); + controller_print_error_rule_setting(&main->program.error, "requires one or more Content", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -307,7 +307,7 @@ extern "C" { status = f_memory_array_increase(controller_allocation_small_d, sizeof(int32_t), (void **) &rule->affinity.array, &rule->affinity.used, &rule->affinity.size); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); break; } @@ -328,13 +328,13 @@ extern "C" { if (status == F_data_not || status == F_number || status == F_number_overflow || status == F_number_underflow || status == F_number_negative || status == F_number_decimal) { if (status == F_number_underflow) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too small for this system", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too small for this system", i, line_item, &main->thread, cache); } else if (status == F_number_overflow || status == F_number_positive) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too large for this system", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too large for this system", i, line_item, &main->thread, cache); } else { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an invalid number", cache->content_actions.array[i].array[j], ", only whole numbers are allowed for an affinity value", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an invalid number", cache->content_actions.array[i].array[j], ", only whole numbers are allowed for an affinity value", i, line_item, &main->thread, cache); } status = F_status_set_error(F_valid_not); @@ -344,7 +344,7 @@ extern "C" { } } else { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); status = F_status_set_error(status); @@ -359,14 +359,14 @@ extern "C" { rule->affinity.array[rule->affinity.used++] = number; } // for - controller_print_rule_setting_read_values(main, controller_affinity_s, i, cache); + controller_print_error_rule_setting_values(main, controller_affinity_s, i, cache); continue; } if (type == controller_rule_setting_type_define_e || type == controller_rule_setting_type_parameter_e) { if (cache->content_actions.array[i].used != 2) { - controller_print_rule_setting_read_error(&main->program.error, "requires exactly two Content", i, line_item, &main->thread, cache); + controller_print_error_rule_setting(&main->program.error, "requires exactly two Content", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -385,7 +385,7 @@ extern "C" { status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_map_t), (void **) &setting_maps->array, &setting_maps->used, &setting_maps->size); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -403,7 +403,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -414,7 +414,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &setting_maps->array[setting_maps->used].key); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -431,7 +431,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -439,7 +439,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[1], &setting_maps->array[setting_maps->used].value); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -457,12 +457,12 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } - controller_print_rule_setting_read_mapping(main, type == controller_rule_setting_type_define_e ? controller_define_s : controller_parameter_s, setting_maps->array[setting_maps->used]); + controller_print_error_rule_setting_mapping(main, type == controller_rule_setting_type_define_e ? controller_define_s : controller_parameter_s, setting_maps->array[setting_maps->used]); ++setting_maps->used; @@ -471,7 +471,7 @@ extern "C" { if (type == controller_rule_setting_type_cgroup_e) { if (cache->content_actions.array[i].used < 2 || rule->has & controller_rule_has_cgroup_d) { - controller_print_rule_setting_read_error(&main->program.error, "requires two or more Content", i, line_item, &main->thread, cache); + controller_print_error_rule_setting(&main->program.error, "requires two or more Content", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -487,7 +487,7 @@ extern "C" { rule->cgroup.as_new = F_true; } else { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an unknown option", cache->content_actions.array[i].array[0], "", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an unknown option", cache->content_actions.array[i].array[0], "", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -501,7 +501,7 @@ extern "C" { status = f_string_dynamic_append(main->process.path_cgroup, &rule->cgroup.path); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_false); } else { rule->cgroup.groups.used = 0; @@ -511,7 +511,7 @@ extern "C" { status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &rule->cgroup.groups.array, &rule->cgroup.groups.used, &rule->cgroup.groups.size); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); break; } @@ -521,7 +521,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[j], &rule->cgroup.groups.array[rule->cgroup.groups.used]); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); break; } @@ -549,21 +549,21 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } rule->has |= controller_rule_has_cgroup_d; - controller_print_rule_setting_read_values(main, controller_cgroup_s, i, cache); + controller_print_error_rule_setting_values(main, controller_cgroup_s, i, cache); continue; } if (type == controller_rule_setting_type_limit_e) { if (cache->content_actions.array[i].used != 3) { - controller_print_rule_setting_read_error(&main->program.error, "requires three Content", i, line_item, &main->thread, cache); + controller_print_error_rule_setting(&main->program.error, "requires three Content", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -635,7 +635,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, main->program.error.to, main->program.error.notable, cache->action.name_action, main->program.error.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.error, cache->action, F_true); + controller_print_error_rule_cache(&main->program.error, cache->action, F_true); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -662,7 +662,7 @@ extern "C" { fl_print_format("%r%[%QThe resource limit type is already specified%]%r", main->program.error.to, f_string_eol_s, main->program.error.context, main->program.error.prefix, main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.error, cache->action, F_false); + controller_print_error_rule_cache(&main->program.error, cache->action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -680,7 +680,7 @@ extern "C" { status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_limit_set_t), (void **) &rule->limits.array, &rule->limits.used, &rule->limits.size); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -698,7 +698,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -723,13 +723,13 @@ extern "C" { if (status == F_data_not || status == F_number || status == F_number_overflow || status == F_number_underflow || status == F_number_negative || status == F_number_positive || status == F_number_decimal) { if (status == F_number_underflow) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too small for this system", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too small for this system", i, line_item, &main->thread, cache); } else if (status == F_number_overflow) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too large for this system", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too large for this system", i, line_item, &main->thread, cache); } else { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", only whole numbers are allowed for a resource limit value", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", only whole numbers are allowed for a resource limit value", i, line_item, &main->thread, cache); } status = F_status_set_error(F_valid_not); @@ -739,7 +739,7 @@ extern "C" { } } else { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); status = F_status_set_error(status); @@ -763,7 +763,7 @@ extern "C" { rule->limits.array[rule->limits.used++].type = type; - controller_print_rule_setting_read_values(main, controller_limit_s, i, cache); + controller_print_error_rule_setting_values(main, controller_limit_s, i, cache); continue; } @@ -781,7 +781,7 @@ extern "C" { } if (setting_value->used || !cache->content_actions.array[i].used) { - controller_print_rule_setting_read_error(&main->program.error, "requires one or more Content", i, line_item, &main->thread, cache); + controller_print_error_rule_setting(&main->program.error, "requires one or more Content", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -831,7 +831,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -856,7 +856,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, main->program.error.to, main->program.error.notable, *setting_value, main->program.error.notable); fl_print_format("%[', there must be at least 1 graph character.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.error, cache->action, F_false); + controller_print_error_rule_cache(&main->program.error, cache->action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -868,13 +868,13 @@ extern "C" { else { // This function should only return F_complete_not_utf on error. - controller_print_rule_error(&main->program.error, cache->action, F_complete_not_utf, "controller_validate_has_graph", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_complete_not_utf, "controller_validate_has_graph", F_true, F_false); if (F_status_is_error_not(status_return)) { status_return = status; } - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); } setting_value->used = 0; @@ -882,13 +882,13 @@ extern "C" { continue; } - controller_print_rule_setting_read_value(main, type == controller_rule_setting_type_name_e ? controller_name_s : controller_engine_s, f_string_empty_s, *setting_value, 0); + controller_print_error_rule_setting_value(main, type == controller_rule_setting_type_name_e ? controller_name_s : controller_engine_s, f_string_empty_s, *setting_value, 0); } else if (type == controller_rule_setting_type_path_e) { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], setting_value); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -908,12 +908,12 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } - controller_print_rule_setting_read_value(main, controller_path_s, f_string_empty_s, *setting_value, 0); + controller_print_error_rule_setting_value(main, controller_path_s, f_string_empty_s, *setting_value, 0); } continue; @@ -921,7 +921,7 @@ extern "C" { if (type == controller_rule_setting_type_scheduler_e) { if (cache->content_actions.array[i].used < 1 || cache->content_actions.array[i].used > 2 || rule->has & controller_rule_has_scheduler_d) { - controller_print_rule_setting_read_error(&main->program.error, "requires either one or two Content", i, line_item, &main->thread, cache); + controller_print_error_rule_setting(&main->program.error, "requires either one or two Content", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -955,7 +955,7 @@ extern "C" { rule->scheduler.priority = 49; } else { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an unknown scheduler", cache->content_actions.array[i].array[0], "", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an unknown scheduler", cache->content_actions.array[i].array[0], "", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -1009,7 +1009,7 @@ extern "C" { fl_print_format(" allowed for the designated scheduler.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.error, cache->action, F_false); + controller_print_error_rule_cache(&main->program.error, cache->action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -1019,7 +1019,7 @@ extern "C" { } } else { - controller_print_rule_error(&main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); status = F_status_set_error(status); if (F_status_is_error_not(status_return)) { @@ -1035,14 +1035,14 @@ extern "C" { rule->has |= controller_rule_has_scheduler_d; - controller_print_rule_setting_read_values(main, controller_scheduler_s, i, cache); + controller_print_error_rule_setting_values(main, controller_scheduler_s, i, cache); continue; } if (type == controller_rule_setting_type_timeout_e) { if (cache->content_actions.array[i].used != 2) { - controller_print_rule_setting_read_error(&main->program.error, "requires exactly two Content", i, line_item, &main->thread, cache); + controller_print_error_rule_setting(&main->program.error, "requires exactly two Content", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -1077,7 +1077,7 @@ extern "C" { fl_print_format(f_string_format_Q_range_single_s.string, main->program.error.to, main->program.error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], main->program.error.notable); fl_print_format("%[' but only supports %r, %r, and %r.%]%r", main->program.error.to, main->program.error.context, controller_kill_s, controller_start_s, controller_stop_s, main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.error, cache->action, F_false); + controller_print_error_rule_cache(&main->program.error, cache->action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -1106,10 +1106,10 @@ extern "C" { status = F_status_set_fine(status); if (status == F_number_overflow) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[1], ", the number is too large for this system", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an unsupported number", cache->content_actions.array[i].array[1], ", the number is too large for this system", i, line_item, &main->thread, cache); } else if (status == F_data_not || status == F_number || status == F_number_underflow || status == F_number_negative || status == F_number_positive || status == F_number_decimal) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an invalid number", cache->content_actions.array[i].array[1], ", only positive whole numbers are allowed", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an invalid number", cache->content_actions.array[i].array[1], ", only positive whole numbers are allowed", i, line_item, &main->thread, cache); } else { @@ -1119,7 +1119,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_error(&main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); } if (F_status_is_error_not(status_return)) { @@ -1157,7 +1157,7 @@ extern "C" { break; } - controller_print_rule_setting_read_value(main, controller_timeout_s, name_sub, cache->action.generic, 0); + controller_print_error_rule_setting_value(main, controller_timeout_s, name_sub, cache->action.generic, 0); } } @@ -1166,7 +1166,7 @@ extern "C" { if (type == controller_rule_setting_type_capability_e || type == controller_rule_setting_type_nice_e || type == controller_rule_setting_type_user_e) { if (cache->content_actions.array[i].used != 1 || type == controller_rule_setting_type_capability_e && rule->capability || type == controller_rule_setting_type_group_e && (rule->has & controller_rule_has_group_d) || type == controller_rule_setting_type_nice_e && (rule->has & controller_rule_has_nice_d) || type == controller_rule_setting_type_user_e && (rule->has & controller_rule_has_user_d)) { - controller_print_rule_setting_read_error(&main->program.error, "requires exactly one Content", i, line_item, &main->thread, cache); + controller_print_error_rule_setting(&main->program.error, "requires exactly one Content", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -1190,9 +1190,9 @@ extern "C" { controller_lock_print(main->program.error.to, &main->thread); - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); - controller_print_rule_error_cache(&main->program.error, cache->action, F_false); + controller_print_error_rule_cache(&main->program.error, cache->action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); @@ -1220,9 +1220,9 @@ extern "C" { controller_lock_print(main->program.error.to, &main->thread); - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_capability_from_text", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_capability_from_text", F_true, F_false); - controller_print_rule_error_cache(&main->program.error, cache->action, F_false); + controller_print_error_rule_cache(&main->program.error, cache->action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); @@ -1231,7 +1231,7 @@ extern "C" { break; } - controller_print_rule_setting_read_error(&main->program.error, "failed to process the capabilities", i, line_item, &main->thread, cache); + controller_print_error_rule_setting(&main->program.error, "failed to process the capabilities", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -1240,7 +1240,7 @@ extern "C" { continue; } - controller_print_rule_setting_read_value(main, controller_capability_s, f_string_empty_s, cache->action.generic, 0); + controller_print_error_rule_setting_value(main, controller_capability_s, f_string_empty_s, cache->action.generic, 0); } else if (type == controller_rule_setting_type_nice_e) { f_number_signed_t number = 0; @@ -1278,7 +1278,7 @@ extern "C" { fl_print_format("%[19%]", main->program.error.to, main->program.error.notable, main->program.error.notable); fl_print_format(" %[are allowed.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.error, cache->action, F_false); + controller_print_error_rule_cache(&main->program.error, cache->action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -1288,7 +1288,7 @@ extern "C" { } } else { - controller_print_rule_error(&main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); status = F_status_set_error(status); if (F_status_is_error_not(status_return)) { @@ -1315,9 +1315,9 @@ extern "C" { controller_lock_print(main->program.error.to, &main->thread); - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); - controller_print_rule_error_cache(&main->program.error, cache->action, F_false); + controller_print_error_rule_cache(&main->program.error, cache->action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); @@ -1333,7 +1333,7 @@ extern "C" { } if (F_status_is_error_not(status)) { - controller_print_rule_setting_read_value(main, controller_nice_s, f_string_empty_s, cache->action.generic, 0); + controller_print_error_rule_setting_value(main, controller_nice_s, f_string_empty_s, cache->action.generic, 0); } } } @@ -1347,13 +1347,13 @@ extern "C" { status = F_status_set_fine(status); if (status == F_exist_not) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because no user was found by that name", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because no user was found by that name", i, line_item, &main->thread, cache); } else if (status == F_number_too_large) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is too large", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is too large", i, line_item, &main->thread, cache); } else if (status == F_number) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number", i, line_item, &main->thread, cache); } else { @@ -1363,9 +1363,9 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_error(&main->program.error, cache->action, status, "controller_convert_user_id", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, status, "controller_convert_user_id", F_true, F_false); - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); } if (F_status_is_error_not(status_return)) { @@ -1381,7 +1381,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &cache->action.generic); - controller_print_rule_setting_read_value(main, controller_user_s, f_string_empty_s, cache->action.generic, 0); + controller_print_error_rule_setting_value(main, controller_user_s, f_string_empty_s, cache->action.generic, 0); } } } @@ -1391,7 +1391,7 @@ extern "C" { if (type == controller_rule_setting_type_group_e) { if (!cache->content_actions.array[i].used) { - controller_print_rule_setting_read_error(&main->program.error, "requires one or more Content", i, line_item, &main->thread, cache); + controller_print_error_rule_setting(&main->program.error, "requires one or more Content", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -1409,7 +1409,7 @@ extern "C" { status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_int32s_t), (void **) &rule->groups.array, &rule->groups.used, &rule->groups.size); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -1427,7 +1427,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -1438,13 +1438,13 @@ extern "C" { status = F_status_set_fine(status); if (status == F_exist_not) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because no group was found by that name", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because no group was found by that name", i, line_item, &main->thread, cache); } else if (status == F_number_too_large) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because the given ID is too large", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because the given ID is too large", i, line_item, &main->thread, cache); } else if (status == F_number) { - controller_print_rule_setting_read_error_with_range(&main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because the given ID is not a valid supported number", i, line_item, &main->thread, cache); + controller_print_error_rule_setting_with_range(&main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because the given ID is not a valid supported number", i, line_item, &main->thread, cache); } else { @@ -1454,9 +1454,9 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_error(&main->program.error, cache->action, status, "f_account_group_id_by_name", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, status, "f_account_group_id_by_name", F_true, F_false); - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); } if (F_status_is_error_not(status_return)) { @@ -1474,7 +1474,7 @@ extern "C" { } } // for - controller_print_rule_setting_read_values(main, controller_group_s, i, cache); + controller_print_error_rule_setting_values(main, controller_group_s, i, cache); continue; } @@ -1487,7 +1487,7 @@ extern "C" { status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values->array, &setting_values->used, &setting_values->size); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -1505,7 +1505,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -1515,7 +1515,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[j], &setting_values->array[setting_values->used]); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); setting_values->array[setting_values->used].used = 0; @@ -1535,7 +1535,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -1558,7 +1558,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, main->program.error.to, main->program.error.notable, setting_values->array[setting_values->used], main->program.error.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.error, cache->action, F_false); + controller_print_error_rule_cache(&main->program.error, cache->action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -1570,7 +1570,7 @@ extern "C" { else { // This function should only return F_complete_not_utf on error. - controller_print_rule_error(&main->program.error, cache->action, F_complete_not_utf, "controller_validate_environment_name", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_complete_not_utf, "controller_validate_environment_name", F_true, F_false); if (F_status_is_error_not(status_return)) { status_return = status; @@ -1579,7 +1579,7 @@ extern "C" { setting_values->array[setting_values->used].used = 0; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -1590,7 +1590,7 @@ extern "C" { rule->has |= controller_rule_has_environment_d; if (cache->content_actions.array[i].used) { - controller_print_rule_setting_read_values(main, controller_environment_s, i, cache); + controller_print_error_rule_setting_values(main, controller_environment_s, i, cache); } else { if (main->program.error.verbosity == f_console_verbosity_debug_e || (main->program.error.verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_e))) { @@ -1607,7 +1607,7 @@ extern "C" { // The "on" Rule Setting. if (cache->content_actions.array[i].used != 4) { - controller_print_rule_setting_read_error(&main->program.error, "requires exactly four Content", i, line_item, &main->thread, cache); + controller_print_error_rule_setting(&main->program.error, "requires exactly four Content", i, line_item, &main->thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -1661,7 +1661,7 @@ extern "C" { fl_print_format("%[' but only supports %r, %r, %r, %r, %r", main->program.error.to, main->program.error.context, controller_freeze_s, controller_kill_s, controller_pause_s, controller_reload_s, controller_restart_s); fl_print_format("%r, %r, %r, and %r.%]%r", main->program.error.to, controller_resume_s, controller_start_s, controller_stop_s, controller_thaw_s, main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.error, cache->action, F_false); + controller_print_error_rule_cache(&main->program.error, cache->action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -1682,7 +1682,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true, F_false); } else { if (f_compare_dynamic_partial_string(controller_need_s.string, cache->buffer_item, controller_need_s.used, cache->content_actions.array[i].array[1]) == F_equal_to) { @@ -1709,7 +1709,7 @@ extern "C" { fl_print_format(f_string_format_Q_range_single_s.string, main->program.error.to, main->program.error.notable, cache->buffer_item, cache->content_actions.array[i].array[1], main->program.error.notable); fl_print_format("%[' but only supports %r, %r, and %r.%]%r", main->program.error.to, main->program.error.context, controller_need_s, controller_want_s, controller_wish_s, main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.error, cache->action, F_false); + controller_print_error_rule_cache(&main->program.error, cache->action, F_false); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -1724,7 +1724,7 @@ extern "C" { status = f_memory_array_increase_by(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values->array, &setting_values->used, &setting_values->size); if (F_status_is_error(status)) { - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, F_false); } } @@ -1745,7 +1745,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -1771,7 +1771,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_print_rule_item_error(&main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_print_error_rule_item(&main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -1783,7 +1783,7 @@ extern "C" { if (F_status_is_error(status)) { setting_values->array[setting_values->used].used = 0; - controller_print_rule_error(&main->program.error, cache->action, F_status_set_fine(status), "f_file_name_base", F_true, F_false); + controller_print_error_rule(&main->program.error, cache->action, F_status_set_fine(status), "f_file_name_base", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; diff --git a/sources/c/main/rule/validate.c b/sources/c/main/rule/validate.c index 1c0f389..35ccc6d 100644 --- a/sources/c/main/rule/validate.c +++ b/sources/c/main/rule/validate.c @@ -26,10 +26,10 @@ extern "C" { controller_lock_print(main->program.error.to, &main->thread); fl_print_format("%r%[%QUnsupported action type '%]", main->program.error.to, f_string_eol_s, main->program.error.context, main->program.error.prefix, main->program.error.context); - fl_print_format(f_string_format_r_single_s.string, main->program.error.to, main->program.error.notable, controller_convert_rule_action_type_string(action), main->program.error.notable); + fl_print_format(f_string_format_Q_single_s.string, main->program.error.to, main->program.error.notable, controller_convert_rule_action_type_string(action), main->program.error.notable); fl_print_format("%[' while attempting to validate rule execution.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - controller_print_rule_error_cache(&main->program.error, cache->action, F_true); + controller_print_error_rule_cache(&main->program.error, cache->action, F_true); controller_unlock_print_flush(main->program.error.to, &main->thread); } diff --git a/sources/c/main/rule/wait.c b/sources/c/main/rule/wait.c index 74bf74f..3712570 100644 --- a/sources/c/main/rule/wait.c +++ b/sources/c/main/rule/wait.c @@ -12,7 +12,7 @@ extern "C" { f_status_t status_lock = controller_lock_read(is_normal, &main->thread, &main->thread.lock.instance); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); return status_lock; } @@ -91,7 +91,7 @@ extern "C" { status_lock = controller_lock_write(is_normal, &main->thread, &instance_list[i]->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_false); f_thread_unlock(&instance_list[i]->active); @@ -194,7 +194,7 @@ extern "C" { } // for if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status_lock), F_true); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status_lock), F_true); return status_lock; } diff --git a/sources/c/main/thread/cleanup.c b/sources/c/main/thread/cleanup.c index 4cd3838..a14465f 100644 --- a/sources/c/main/thread/cleanup.c +++ b/sources/c/main/thread/cleanup.c @@ -88,7 +88,7 @@ extern "C" { status = f_thread_lock_write(&instance->lock); if (F_status_is_error(status)) { - controller_lock_print_error_critical(&main->program.error, F_status_set_fine(status), F_false); + controller_print_error_lock_critical(&main->program.error, F_status_set_fine(status), F_false); f_thread_unlock(&instance->active);