From 766b71c5e4fefc5ced85864743efe4a7972b970a Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 23 Jun 2024 22:08:46 -0500 Subject: [PATCH] Progress: Continue migrating the project. --- sources/c/main/common/print.c | 2 ++ sources/c/main/common/print.h | 2 ++ sources/c/main/entry/preprocess.c | 4 +-- sources/c/main/entry/process.c | 53 +++++++++++++--------------- sources/c/main/entry/setting.c | 32 ++++++++--------- sources/c/main/file.c | 12 +++---- sources/c/main/perform.c | 26 +++++++------- sources/c/main/print/debug/perform/control.c | 6 ++-- sources/c/main/print/debug/perform/pid.c | 14 ++++---- sources/c/main/print/error.c | 2 +- sources/c/main/print/error.h | 4 +-- sources/c/main/print/error/entry/item.c | 2 +- sources/c/main/print/error/entry/item.h | 8 ++--- sources/c/main/print/error/perform/pid.c | 2 +- sources/c/main/print/output/entry/setting.c | 20 +++++------ sources/c/main/print/output/entry/setting.h | 6 ++-- sources/c/main/print/warning/entry/setting.c | 28 +++++++++++++-- sources/c/main/print/warning/entry/setting.h | 39 ++++++++++++++++++-- sources/c/main/rule/action.c | 4 +-- sources/c/main/rule/instance.c | 8 ++--- sources/c/main/rule/instance.h | 10 +++--- sources/c/main/rule/item.c | 2 +- sources/c/main/rule/parameter.h | 8 ++--- sources/c/main/rule/read.c | 4 +-- sources/c/main/rule/read.h | 2 +- sources/c/main/thread/entry.c | 4 +-- sources/c/main/thread/instance.c | 2 +- sources/c/main/thread/instance.h | 2 +- 28 files changed, 184 insertions(+), 124 deletions(-) diff --git a/sources/c/main/common/print.c b/sources/c/main/common/print.c index e4e2e55..27ee392 100644 --- a/sources/c/main/common/print.c +++ b/sources/c/main/common/print.c @@ -8,6 +8,7 @@ extern "C" { const f_string_t controller_f_a[] = { "controller_convert_group_id", "controller_convert_user_id", + "controller_entry_setting_read_map", "controller_file_load", "controller_lock_create", "controller_rule_copy", @@ -15,6 +16,7 @@ extern "C" { "f_console_parameter_process", "f_environment_get_all", "f_file_exists", + "f_file_mode_to_mode", "f_file_name_base", "f_file_stat", "f_file_stream_open", diff --git a/sources/c/main/common/print.h b/sources/c/main/common/print.h index 57bb838..f75af3c 100644 --- a/sources/c/main/common/print.h +++ b/sources/c/main/common/print.h @@ -41,6 +41,7 @@ extern "C" { enum { controller_f_controller_convert_group_id_e, controller_f_controller_convert_user_id_e, + controller_f_controller_entry_setting_read_map_e, controller_f_controller_file_load_e, controller_f_controller_lock_create_e, controller_f_controller_rule_copy_e, @@ -48,6 +49,7 @@ extern "C" { controller_f_f_console_parameter_process_e, controller_f_f_environment_get_all_e, controller_f_f_file_exists_e, + controller_f_f_file_mode_to_mode_e, controller_f_f_file_name_base_e, controller_f_f_file_stat_e, controller_f_f_file_stream_open_e, diff --git a/sources/c/main/entry/preprocess.c b/sources/c/main/entry/preprocess.c index e8664a1..5fdfd56 100644 --- a/sources/c/main/entry/preprocess.c +++ b/sources/c/main/entry/preprocess.c @@ -101,7 +101,7 @@ extern "C" { for (j = 2; j < cache->ats.used; j += 2) { if (cache->ats.array[j] == i) { - controller_print_error_entry_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, is_entry, 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); @@ -154,7 +154,7 @@ extern "C" { if (error_has || i >= entry->items.used) { if (i >= entry->items.used) { - controller_print_error_entry_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, is_entry, 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); diff --git a/sources/c/main/entry/process.c b/sources/c/main/entry/process.c index ef1153b..e9f6f91 100644 --- a/sources/c/main/entry/process.c +++ b/sources/c/main/entry/process.c @@ -40,8 +40,8 @@ extern "C" { return status; } - // utilize the ats cache as an item execution stack (at_i is for item index, and at_j (at_i + 1) is for action index). - cache->ats.array[0] = failsafe ? main->setting.failsafe_item_id : 0; + // Utilize the "ats" cache as an item execution stack (at_i is for item index, and at_j (at_i + 1) is for action index). + cache->ats.array[0] = failsafe ? main->process.failsafe_item_id : 0; cache->ats.array[1] = 0; cache->ats.used = 2; @@ -57,7 +57,7 @@ extern "C" { } if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.message.verbosity > f_console_verbosity_normal_e) { - 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); + controller_print_message_entry_item_process(&main->program.message, is_entry, failsafe ? controller_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. @@ -140,7 +140,7 @@ extern "C" { } } else if (entry_action->type == controller_entry_action_type_item_e) { - if (entry_action->number == 0 || entry_action->number >= entry->items.used || failsafe && entry_action->number == main->setting.failsafe_item_id) { + if (entry_action->number == 0 || entry_action->number >= entry->items.used || failsafe && entry_action->number == main->process.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_error_entry_item_invalid(&main->program.error, cache, is_entry, entry_action->number); @@ -190,17 +190,17 @@ extern "C" { status_lock = controller_lock_write(is_entry, &main->thread, &main->thread.lock.rule); if (F_status_is_error(status_lock)) { - controller_print_error_lock_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); break; } - status = controller_rules_increase(&main->setting.rules); + status = f_memory_array_increase(controller_allocation_small_d, sizeof(controller_rule_t), (void **) &main->process.rules.array, &main->process.rules.used, &main->process.rules.size); f_thread_unlock(&main->thread.lock.rule); if (F_status_is_error(status)) { - controller_print_error_entry(&main->program.error, is_entry, F_status_set_fine(status), macro_controller_f(controller_rules_increase), F_true); + controller_print_error_entry(&main->program.error, is_entry, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true); return status; } @@ -218,17 +218,17 @@ extern "C" { status_lock = controller_lock_read(is_entry, &main->thread, &main->thread.lock.rule); if (F_status_is_error(status_lock)) { - controller_print_error_lock_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); break; } - status = controller_rule_find(alias_rule, main->setting.rules, 0); + status = controller_rule_find(alias_rule, main->process.rules, 0); 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_message_entry_item_rule(&main->program.message, entry, entry_action, is_entry); + controller_print_message_entry_item_rule(&main->program.message, entry, entry_action, is_entry, alias_rule); } if (!controller_thread_is_enabled(is_entry, &main->thread)) break; @@ -255,7 +255,7 @@ extern "C" { status_lock = controller_lock_write(is_entry, &main->thread, &main->thread.lock.rule); if (F_status_is_fine(status_lock)) { - status = controller_rule_read(main, is_entry, alias_rule, cache, entry, &main->setting.rules.array[main->setting.rules.used]); + status = controller_rule_read(main, cache, is_entry, alias_rule, entry, &main->process.rules.array[main->process.rules.used]); } // Restore cache. @@ -275,7 +275,7 @@ extern "C" { cache->action.line_item = cache_line_item; if (F_status_is_error(status_lock)) { - controller_print_error_lock_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); 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_error_entry_cache(is_entry, &main->program.error, &cache->action); + controller_print_error_entry_cache(&main->program.error, &cache->action, is_entry); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -311,7 +311,7 @@ extern "C" { } } else { - ++main->setting.rules.used; + ++main->process.rules.used; } f_thread_unlock(&main->thread.lock.rule); @@ -345,11 +345,8 @@ extern "C" { options_instance |= controller_instance_option_asynchronous_e; } - status = controller_rule_process_begin(main, options_force, alias_rule, controller_entry_action_type_to_rule_action_type(entry_action->type), options_instance, is_entry ? controller_instance_type_entry_e : controller_instance_type_exit_e, stack, *cache); - - if (F_status_set_fine(status) == F_memory_not || status == F_child || F_status_set_fine(status) == F_interrupt) { - break; - } + status = controller_rule_instance_begin(main, cache, options_force, alias_rule, controller_entry_action_type_to_rule_action_type(entry_action->type), options_instance, is_entry ? controller_instance_type_entry_e : controller_instance_type_exit_e, stack); + if (F_status_set_fine(status) == F_memory_not || status == F_child || F_status_set_fine(status) == F_interrupt) break; if (F_status_is_error(status) && !(main->setting.flag & controller_main_flag_simulate_e) && (entry_action->code & controller_entry_rule_code_require_d)) { return F_status_set_error(F_require); @@ -363,7 +360,7 @@ extern "C" { if (main->setting.flag & controller_main_flag_simulate_e) return F_execute; - controller_thread_process_cancel(main, is_entry, is_entry ? controller_thread_cancel_execute_e : controller_thread_cancel_exit_execute_e); + controller_thread_instance_cancel(main, is_entry, is_entry ? controller_thread_cancel_execute_e : controller_thread_cancel_exit_execute_e); int result = 0; int option = FL_execute_parameter_option_path_d; @@ -396,22 +393,22 @@ extern "C" { if (entry_action->code == controller_entry_timeout_code_exit_d) { entry->timeout_exit = entry_action->number; - 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); + controller_print_output_entry_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_exit_s, entry->items.array[main->process.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_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); + controller_print_output_entry_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_kill_s, entry->items.array[main->process.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_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); + controller_print_output_entry_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_start_s, entry->items.array[main->process.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_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); + controller_print_output_entry_setting_simulate_value(&main->program.output, is_entry, controller_timeout_s, controller_stop_s, entry->items.array[main->process.failsafe_item_id].name, controller_print_entry_suffix_megatime_s); } } else if (entry_action->type == controller_entry_action_type_failsafe_e) { @@ -428,10 +425,10 @@ extern "C" { return F_status_is_error(F_critical); } else { - main->setting.flag |= controller_setting_flag_failsafe_e; - main->setting.failsafe_item_id = entry_action->number; + main->setting.flag |= controller_process_flag_failsafe_e; + main->process.failsafe_item_id = entry_action->number; - 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); + controller_print_output_entry_setting_simulate_value(&main->program.output, is_entry, controller_failsafe_s, f_string_empty_s, entry->items.array[main->process.failsafe_item_id].name, f_string_empty_s); } } } @@ -476,7 +473,7 @@ extern "C" { if (F_status_is_error(status_lock)) return status_lock; // Check to see if any required processes failed, but do not do this if already operating in failsafe. - if (F_status_is_error_not(status) && !failsafe && !(main->setting.flag & controller_main_flag_validate_e) && main->setting.mode != controller_process_mode_helper_e) { + if (F_status_is_error_not(status) && !failsafe && !(main->setting.flag & controller_main_flag_validate_e) && main->process.mode != controller_process_mode_helper_e) { const f_status_t status_wait = controller_rule_wait_all(main, is_entry, F_true); if (F_status_is_error(status_wait)) return status_wait; if (status_wait == F_require) return F_status_set_error(F_require); diff --git a/sources/c/main/entry/setting.c b/sources/c/main/entry/setting.c index 405fb7d..9b516d6 100644 --- a/sources/c/main/entry/setting.c +++ b/sources/c/main/entry/setting.c @@ -16,7 +16,7 @@ extern "C" { f_state_t state = macro_f_state_t_initialize_1(controller_allocation_large_d, controller_allocation_small_d, F_okay, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0); f_range_t range = content_range; - fll_fss_extended_read(cache->buffer_file, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0, &state); + fll_fss_extended_read(main->thread.cache.buffer_file, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0, &state); } if (F_status_is_error(status)) { @@ -41,7 +41,7 @@ extern "C" { f_number_unsigned_t i = 0; - controller_entry_t * const entry = is_entry ? &main->setting.entry : &main->setting.exit; + controller_entry_t * const entry = is_entry ? &main->process.entry : &main->process.exit; f_state_t state = f_state_t_initialize; for (; i < cache->object_actions.used; ++i) { @@ -69,7 +69,7 @@ extern "C" { if (is_entry && f_compare_dynamic(controller_control_s, cache->action.name_action) == F_equal_to) { if (cache->content_actions.array[i].used < 1 || cache->content_actions.array[i].used > 2) { - controller_entry_setting_read_print_setting_requires_between(main, is_entry, *cache, 1, 2); + controller_print_error_entry_setting_requires_between(&main->program.error, cache, is_entry, 1, 2); continue; } @@ -89,7 +89,7 @@ extern "C" { } cache->action.generic.used = 0; - main->setting.path_control.used = 0; + main->process.path_control.used = 0; status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->content_actions.array[i].array[0], &cache->action.generic); @@ -99,7 +99,7 @@ extern "C" { break; } - main->setting.path_control.used = 0; + main->process.path_control.used = 0; status = controller_path_canonical_relative(main, main->process.path_current, cache->action.generic, &main->process.path_control); @@ -220,16 +220,16 @@ extern "C" { } if (f_compare_dynamic_partial_string(controller_service_s.string, cache->buffer_file, controller_service_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) { - main->setting.mode = controller_process_mode_service_e; + main->process.mode = controller_process_mode_service_e; } else if (f_compare_dynamic_partial_string(controller_helper_s.string, cache->buffer_file, controller_helper_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) { - main->setting.mode = controller_process_mode_helper_e; + main->process.mode = controller_process_mode_helper_e; } else if (f_compare_dynamic_partial_string(controller_program_s.string, cache->buffer_file, controller_program_s.used, cache->content_actions.array[i].array[0]) == F_equal_to) { - main->setting.mode = controller_process_mode_program_e; + main->process.mode = controller_process_mode_program_e; } else { - controller_entry_setting_read_print_setting_unknown_action_value(main, is_entry, *cache, i); + controller_entry_setting_read_print_setting_unknown_action_value(main, cache, is_entry, cache->action.name_action, cache->content_actions.array[i].array[0]); continue; } @@ -266,7 +266,7 @@ extern "C" { entry->pid = controller_entry_pid_require_e; } else { - controller_entry_setting_read_print_setting_unknown_action_value(main, is_entry, *cache, i); + controller_print_warning_entry_setting_unknown_action_value(&main->program.warning, cache, is_entry, cache->action.name_action, cache->content_actions.array[i].array[0]); continue; } @@ -292,9 +292,9 @@ extern "C" { continue; } - main->setting.path_pid.used = 0; + main->process.path_pid.used = 0; - status = controller_path_canonical_relative(main, main->process.path_current, cache->action.generic, &main->setting.path_pid); + status = controller_path_canonical_relative(main, main->process.path_current, cache->action.generic, &main->process.path_pid); if (F_status_is_error(status)) { controller_print_error_entry(&main->program.error, is_entry, F_status_set_fine(status), macro_controller_f(controller_path_canonical_relative), F_true); @@ -317,7 +317,7 @@ extern "C" { entry->session = controller_entry_session_same_e; } else { - controller_entry_setting_read_print_setting_unknown_action_value(main, is_entry, *cache, i); + controller_print_warning_entry_setting_unknown_action_value(&main->program.warning, cache, is_entry, cache->action.name_action, cache->content_actions.array[i].array[0]); continue; } @@ -336,14 +336,14 @@ extern "C" { entry->show = controller_entry_show_init_e; } else { - controller_entry_setting_read_print_setting_unknown_action_value(main, is_entry, *cache, i); + controller_print_warning_entry_setting_unknown_action_value(&main->program.warning, cache, is_entry, cache->action.name_action, cache->content_actions.array[i].array[0]); continue; } } else if (f_compare_dynamic(controller_timeout_s, cache->action.name_action) == F_equal_to) { if (cache->content_actions.array[i].used < 1 || cache->content_actions.array[i].used > 2) { - controller_entry_setting_read_print_setting_requires_between(main, is_entry, *cache, 1, 2); + controller_print_error_entry_setting_requires_between(&main->program.error, cache, is_entry, 1, 2); continue; } @@ -391,7 +391,7 @@ extern "C" { time = &entry->timeout_stop; } else { - controller_entry_setting_read_print_setting_unknown_action_value(main, is_entry, *cache, i); + controller_print_warning_entry_setting_unknown_action_value(&main->program.warning, cache, is_entry, cache->action.name_action, cache->content_actions.array[i].array[0]); continue; } diff --git a/sources/c/main/file.c b/sources/c/main/file.c index 08455f9..a90981c 100644 --- a/sources/c/main/file.c +++ b/sources/c/main/file.c @@ -42,8 +42,8 @@ extern "C" { f_string_static_t path = f_string_static_t_initialize; - if (main->setting.path_setting.used) { - path.used = main->setting.path_setting.used + F_path_separator_s_length + main->thread.cache.action.name_file.used; + if (main->process.path_setting.used) { + path.used = main->process.path_setting.used + F_path_separator_s_length + main->thread.cache.action.name_file.used; } else { path.used = main->thread.cache.action.name_file.used; @@ -52,11 +52,11 @@ extern "C" { f_char_t path_string[path.used + 1]; path.string = path_string; - if (main->setting.path_setting.used) { - memcpy(path_string, main->setting.path_setting.string, sizeof(f_char_t) * main->setting.path_setting.used); - memcpy(path_string + main->setting.path_setting.used + F_path_separator_s_length, main->thread.cache.action.name_file.string, sizeof(f_char_t) * main->thread.cache.action.name_file.used); + if (main->process.path_setting.used) { + memcpy(path_string, main->process.path_setting.string, sizeof(f_char_t) * main->process.path_setting.used); + memcpy(path_string + main->process.path_setting.used + F_path_separator_s_length, main->thread.cache.action.name_file.string, sizeof(f_char_t) * main->thread.cache.action.name_file.used); - path_string[main->setting.path_setting.used] = f_path_separator_s.string[0]; + path_string[main->process.path_setting.used] = f_path_separator_s.string[0]; } else { memcpy(path_string, main->thread.cache.action.name_file.string, sizeof(f_char_t) * main->thread.cache.action.name_file.used); diff --git a/sources/c/main/perform.c b/sources/c/main/perform.c index 856e500..8241e38 100644 --- a/sources/c/main/perform.c +++ b/sources/c/main/perform.c @@ -20,8 +20,8 @@ extern "C" { f_status_t status = F_okay; - if (main->setting.entry.pid != controller_entry_pid_disable_e && !main->setting.path_pid.used) { - status = controller_file_pid_create(main->program.pid, main->setting.path_pid); + if (main->process.entry.pid != controller_entry_pid_disable_e && !main->process.path_pid.used) { + status = controller_file_pid_create(main->program.pid, main->process.path_pid); // Report pid file error but because this could be an "init" program, consider the pid file as optional and continue on. if (F_status_is_error(status)) { @@ -38,14 +38,14 @@ extern "C" { status = F_okay; } else { - main->setting.flag |= controller_setting_flag_pid_created_e; + main->setting.flag |= controller_process_flag_pid_created_e; controller_print_debug_perform_pid_file_create_success(&main->program.debug); } } // Disabled, all parts are not yet implemented. - /*if (main->setting.path_control.used) { + /*if (main->process.path_control.used) { status = controller_perform_ready_socket(main, is_entry); // Do not fail on non-memory errors related to creating the control socket. @@ -64,7 +64,7 @@ extern "C" { f_status_t status = F_okay; if (main->process.control.flag & controller_control_flag_readonly_e) { - if (f_file_exists(main->setting.path_control, F_true) != F_true) { + if (f_file_exists(main->process.path_control, F_true) != F_true) { controller_print_debug_perform_control_socket_missing_read_only(&main->program.debug); return F_data_not; @@ -86,7 +86,7 @@ extern "C" { } if (!(main->process.control.flag & controller_control_flag_readonly_e)) { - status = f_file_remove(main->setting.path_control); + status = f_file_remove(main->process.path_control); if (F_status_set_fine(status) == F_memory_not) { controller_print_error(global->thread, &main->program.error, F_status_set_fine(status), macro_controller_f(f_file_remove), F_true); @@ -95,7 +95,7 @@ extern "C" { } } - main->process.control.server.name = main->setting.path_control; + main->process.control.server.name = main->process.path_control; status = f_socket_bind(&main->process.control.server); @@ -103,7 +103,7 @@ extern "C" { f_socket_disconnect(&main->process.control.server, f_socket_close_fast_e); if (!(main->process.control.flag & controller_control_flag_readonly_e)) { - f_file_remove(main->setting.path_control); + f_file_remove(main->process.path_control); } if (F_status_set_fine(status) == F_memory_not) { @@ -117,13 +117,13 @@ extern "C" { } if (main->process.control.flag & (controller_control_flag_has_user_e | controller_control_flag_has_group_e)) { - status = f_file_role_change(main->setting.path_control, main->process.control.user, main->process.control.group, F_true); + status = f_file_role_change(main->process.path_control, main->process.control.user, main->process.control.group, F_true); if (F_status_is_error(status)) { f_socket_disconnect(&main->process.control.server, f_socket_close_fast_e); if (!(main->process.control.flag & controller_control_flag_readonly_e)) { - f_file_remove(main->setting.path_control); + f_file_remove(main->process.path_control); } if (F_status_set_fine(status) == F_memory_not) { @@ -138,13 +138,13 @@ extern "C" { } if (main->process.control.flag & controller_control_flag_has_mode_e) { - status = f_file_mode_set(main->setting.path_control, main->process.control.mode); + status = f_file_mode_set(main->process.path_control, main->process.control.mode); if (F_status_is_error(status)) { f_socket_disconnect(&main->process.control.server, f_socket_close_fast_e); if (!(main->process.control.flag & controller_control_flag_readonly_e)) { - f_file_remove(main->setting.path_control); + f_file_remove(main->process.path_control); } if (F_status_set_fine(status) == F_memory_not) { @@ -169,7 +169,7 @@ extern "C" { f_socket_disconnect(&main->process.control.server, f_socket_close_fast_e); if (!(main->process.control.flag & controller_control_flag_readonly_e)) { - f_file_remove(main->setting.path_control); + f_file_remove(main->process.path_control); } if (global->thread->id_control) { diff --git a/sources/c/main/print/debug/perform/control.c b/sources/c/main/print/debug/perform/control.c index 232eb8b..29b7113 100644 --- a/sources/c/main/print/debug/perform/control.c +++ b/sources/c/main/print/debug/perform/control.c @@ -15,7 +15,7 @@ extern "C" { 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(f_string_format_Q_single_s.string, print->to, print->notable, main->process.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); @@ -35,7 +35,7 @@ extern "C" { 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(f_string_format_Q_single_s.string, print->to, print->notable, main->process.path_control, print->notable); fl_print_format("' created.%r", print->to, f_string_eol_s); controller_unlock_print_flush(print->to, &main->thread); @@ -53,7 +53,7 @@ extern "C" { 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(f_string_format_Q_single_s.string, print->to, print->notable, main->process.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); diff --git a/sources/c/main/print/debug/perform/pid.c b/sources/c/main/print/debug/perform/pid.c index 90dfdeb..f26dc10 100644 --- a/sources/c/main/print/debug/perform/pid.c +++ b/sources/c/main/print/debug/perform/pid.c @@ -15,11 +15,11 @@ extern "C" { 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); + fl_print_format("%[%Q%]'.%r", print->to, print->notable, main->process.path_pid, print->notable, f_string_eol_s); - if (main->setting.path_control.used) { + if (main->process.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(f_string_format_Q_single_s.string, print->to, print->notable, main->process.path_control, print->notable); fl_print_format("'.%r", print->to, f_string_eol_s); } @@ -41,16 +41,16 @@ extern "C" { 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(f_string_format_Q_single_s.string, print->to, print->notable, main->process.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); + controller_print_error_file_status(print, function, F_true, main->process.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_print_error_entry_cache(print, &main->thread.cache.action, is_entry); controller_unlock_print_flush(print->to, &main->thread); } @@ -67,7 +67,7 @@ extern "C" { 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); + fl_print_format("%[%Q%]' created.%r", print->to, print->notable, main->process.path_pid, print->notable, f_string_eol_s); controller_unlock_print_flush(print->to, &main->thread); } diff --git a/sources/c/main/print/error.c b/sources/c/main/print/error.c index 871ce48..7d8f620 100644 --- a/sources/c/main/print/error.c +++ b/sources/c/main/print/error.c @@ -19,7 +19,7 @@ extern "C" { #endif // _di_controller_print_error_ #ifndef _di_controller_print_error_failsafe_item_ - f_status_t controller_print_error_failsafe_item(fl_print_t * const print, controller_thread_t * const thread, f_string_dynamic_t * const name) { + f_status_t controller_print_error_failsafe_item(fl_print_t * const print, controller_thread_t * const thread, const f_string_dynamic_t name) { if (!print) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; diff --git a/sources/c/main/print/error.h b/sources/c/main/print/error.h index 2b53e7e..b087ae2 100644 --- a/sources/c/main/print/error.h +++ b/sources/c/main/print/error.h @@ -54,8 +54,6 @@ extern "C" { * @param name * The name of the item. * - * Must not be NULL. - * * @return * F_okay on success. * F_output_not on success, but no printing is performed. @@ -63,7 +61,7 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_controller_print_error_failsafe_item_ - extern f_status_t controller_print_error_failsafe_item(fl_print_t * const print, controller_thread_t * const thread, f_string_dynamic_t * const name); + extern f_status_t controller_print_error_failsafe_item(fl_print_t * const print, controller_thread_t * const thread, const f_string_dynamic_t name); #endif // _di_controller_print_error_failsafe_item_ /** diff --git a/sources/c/main/print/error/entry/item.c b/sources/c/main/print/error/entry/item.c index b5a569e..6deb7b5 100644 --- a/sources/c/main/print/error/entry/item.c +++ b/sources/c/main/print/error/entry/item.c @@ -5,7 +5,7 @@ extern "C" { #endif #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) { + 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_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; diff --git a/sources/c/main/print/error/entry/item.h b/sources/c/main/print/error/entry/item.h index 8e7a0c5..b8ae774 100644 --- a/sources/c/main/print/error/entry/item.h +++ b/sources/c/main/print/error/entry/item.h @@ -17,7 +17,7 @@ extern "C" { #endif /** - * Print the entry item related error. + * Print the Entry Item related error. * * @param print * The output structure to print to. @@ -46,11 +46,11 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. */ #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); + 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_t message); #endif // _di_controller_print_error_entry_item_failure_ /** - * Print an error message for an invalid entry item. + * Print an error message for an invalid Entry Item. * * @param print * The output structure to print to. @@ -81,7 +81,7 @@ extern "C" { #endif // _di_controller_print_error_entry_item_invalid_ /** - * Print an error message about an entry it setting option not being supported. + * Print an error message about an Entry Item Setting option not being supported. * * @param print * The output structure to print to. diff --git a/sources/c/main/print/error/perform/pid.c b/sources/c/main/print/error/perform/pid.c index cc4d2c0..5050350 100644 --- a/sources/c/main/print/error/perform/pid.c +++ b/sources/c/main/print/error/perform/pid.c @@ -14,7 +14,7 @@ extern "C" { 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); + controller_print_error_file_status(print, function, F_true, main->process.path_pid, f_file_operation_create_s, fll_error_file_type_file_e, status); f_file_stream_lock(print->to); diff --git a/sources/c/main/print/output/entry/setting.c b/sources/c/main/print/output/entry/setting.c index b1b5c02..9a1621c 100644 --- a/sources/c/main/print/output/entry/setting.c +++ b/sources/c/main/print/output/entry/setting.c @@ -38,8 +38,8 @@ extern "C" { } #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) { +#ifndef _di_controller_print_output_entry_setting_validate_ + f_status_t controller_print_output_entry_setting_validate(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_error_e) return F_output_not; @@ -60,13 +60,13 @@ extern "C" { // Mode. - if (main->setting.mode == controller_process_mode_service_e) { + if (main->process.mode == controller_process_mode_service_e) { string = &controller_mode_s; } - else if (main->setting.mode == controller_process_mode_helper_e) { + else if (main->process.mode == controller_process_mode_helper_e) { string = &controller_helper_s; } - else if (main->setting.mode == controller_process_mode_program_e) { + else if (main->process.mode == controller_process_mode_program_e) { string = &controller_program_s; } else { @@ -148,8 +148,8 @@ extern "C" { // Pid File. fl_print_format(" %[%r%]", print->to, print->set.important, controller_pid_file_s, print->set.important); - if (main->setting.path_pid.used) { - fl_print_format(" %r", print->to, main->setting.path_pid); + if (main->process.path_pid.used) { + fl_print_format(" %r", print->to, main->process.path_pid); } fl_print_format("%r", print->to, f_string_eol_s); @@ -158,8 +158,8 @@ extern "C" { // Control. fl_print_format(" %[%r%]", print->to, print->set.important, controller_control_s, print->set.important); - if (main->setting.path_control.used) { - fl_print_format(" %Q", print->to, main->setting.path_control); + if (main->process.path_control.used) { + fl_print_format(" %Q", print->to, main->process.path_control); } fl_print_format("%r", print->to, f_string_eol_s); @@ -434,7 +434,7 @@ extern "C" { return F_okay; } -#endif // _di_controller_print_entry_output_setting_validate_ +#endif // _di_controller_print_output_entry_setting_validate_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/output/entry/setting.h b/sources/c/main/print/output/entry/setting.h index 0de8f61..463f093 100644 --- a/sources/c/main/print/output/entry/setting.h +++ b/sources/c/main/print/output/entry/setting.h @@ -71,9 +71,9 @@ extern "C" { * * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_controller_print_entry_output_setting_validate_ - extern f_status_t controller_print_entry_output_setting_validate(fl_print_t * const print, const uint8_t is_entry); -#endif // _di_controller_print_entry_output_setting_validate_ +#ifndef _di_controller_print_output_entry_setting_validate_ + extern f_status_t controller_print_output_entry_setting_validate(fl_print_t * const print, const uint8_t is_entry); +#endif // _di_controller_print_output_entry_setting_validate_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/print/warning/entry/setting.c b/sources/c/main/print/warning/entry/setting.c index 651ebf4..51aa58b 100644 --- a/sources/c/main/print/warning/entry/setting.c +++ b/sources/c/main/print/warning/entry/setting.c @@ -5,7 +5,7 @@ extern "C" { #endif #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) { + 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, 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; @@ -15,7 +15,7 @@ extern "C" { controller_lock_print(print->to, &main->thread); fl_print_format("%r%[%QUnknown %r item setting '%]", print->to.stream, f_string_eol_s, print->context, print->prefix, is_entry ? controller_entry_s : controller_exit_s, print->context); - 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_Q_single_s.string, print->to.stream, print->notable, name, 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_error_entry_cache(print, &cache->action, is_entry); @@ -26,6 +26,30 @@ extern "C" { } #endif // _di_controller_print_warning_entry_setting_unknown_action_ +#ifndef _di_controller_print_warning_entry_setting_unknown_action_value_ + f_status_t controller_print_warning_entry_setting_unknown_action_value(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 unknown) { + + 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%[%QThe %r item setting '%]", print->to.stream, f_string_eol_s, print->context, print->prefix, is_entry ? controller_entry_s : controller_exit_s, print->context); + fl_print_format(f_string_format_Q_single_s.string, print->to.stream, print->notable, name, print->notable); + fl_print_format("%[' has an unknown value '%]", print->to.stream, print->context, print->context); + fl_print_format(f_string_format_Q_single_s.string, print->to.stream, print->notable, unknown, 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_error_entry_cache(print, &cache->action, is_entry); + + controller_unlock_print_flush(print->to, &main->thread); + + return F_okay; + } +#endif // _di_controller_print_warning_entry_setting_unknown_action_value_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/sources/c/main/print/warning/entry/setting.h b/sources/c/main/print/warning/entry/setting.h index 4b12817..c3eadcf 100644 --- a/sources/c/main/print/warning/entry/setting.h +++ b/sources/c/main/print/warning/entry/setting.h @@ -17,7 +17,7 @@ extern "C" { #endif /** - * Print a message for when an entry setting action is unknown. + * Print a message for when an Entry Setting Action is unknown. * * @param print * The output structure to print to. @@ -34,6 +34,8 @@ extern "C" { * @param is_entry * If TRUE, then this loads as an entry. * If FALSE, then this loads as an exit. + * @param name + * The parameter name whose value is unknown. * * @return * F_okay on success. @@ -42,9 +44,42 @@ extern "C" { * F_output_not (with error bit) if setting is NULL. */ #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); + 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, const f_string_static_t name); #endif // _di_controller_print_warning_entry_setting_unknown_action_ +/** + * Print a message for when an Entry Setting Action value is 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. + * @param is_entry + * If TRUE, then this loads as an entry. + * If FALSE, then this loads as an exit. + * @param name + * The parameter name whose value is unknown. + * @param unknown + * The unknown value. + * + * @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_warning_entry_setting_unknown_action_value_ + extern f_status_t controller_print_warning_entry_setting_unknown_action_value(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 unknown); +#endif // _di_controller_print_warning_entry_setting_unknown_action_value_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/sources/c/main/rule/action.c b/sources/c/main/rule/action.c index 566ad02..8601cad 100644 --- a/sources/c/main/rule/action.c +++ b/sources/c/main/rule/action.c @@ -278,10 +278,10 @@ extern "C" { for (i = 2; i < cache->content_action.used; ++i) { if (f_compare_dynamic_partial_string(controller_delay_s.string, cache->buffer_item, controller_delay_s.used, cache->content_action.array[i]) == F_equal_to) { - status = controller_rule_action_read_rerun_number(main, controller_delay_s.string, cache, &i, &rerun_item->delay); + status = controller_rule_action_read_rerun_number(main, cache, controller_delay_s.string, &i, &rerun_item->delay); } else if (f_compare_dynamic_partial_string(controller_max_s.string, cache->buffer_item, controller_max_s.used, cache->content_action.array[i]) == F_equal_to) { - status = controller_rule_action_read_rerun_number(main, controller_max_s.string, cache, &i, &rerun_item->max); + status = controller_rule_action_read_rerun_number(main, cache, controller_max_s.string, &i, &rerun_item->max); } else if (f_compare_dynamic_partial_string(controller_reset_s.string, cache->buffer_item, controller_reset_s.used, cache->content_action.array[i]) == F_equal_to) { 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; diff --git a/sources/c/main/rule/instance.c b/sources/c/main/rule/instance.c index 3394cdf..d70b52f 100644 --- a/sources/c/main/rule/instance.c +++ b/sources/c/main/rule/instance.c @@ -747,7 +747,7 @@ extern "C" { } } else { - status = controller_rule_instance_do(options_force, instance); + status = controller_rule_instance_perform(options_force, instance); if (status == F_child || F_status_set_fine(status) == F_interrupt) { f_thread_unlock(&instance->active); @@ -794,8 +794,8 @@ extern "C" { } #endif // _di_controller_rule_instance_begin_ -#ifndef _di_controller_rule_instance_do_ - f_status_t controller_rule_instance_do(const uint8_t options_force, controller_instance_t * const instance) { +#ifndef _di_controller_rule_instance_perform_ + f_status_t controller_rule_instance_perform(const uint8_t options_force, controller_instance_t * const instance) { if (!instance || !instance->main) return F_status_set_error(F_parameter); @@ -1063,7 +1063,7 @@ extern "C" { return controller_thread_is_enabled_instance(instance) ? status : F_status_set_error(F_interrupt); } -#endif // _di_controller_rule_instance_do_ +#endif // _di_controller_rule_instance_perform_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/rule/instance.h b/sources/c/main/rule/instance.h index 7733ac2..5e9df5e 100644 --- a/sources/c/main/rule/instance.h +++ b/sources/c/main/rule/instance.h @@ -101,7 +101,7 @@ extern "C" { #endif // _di_controller_rule_instance_begin_ /** - * Helper for calling controller_rule_instance(). + * Perform the work * * This does all the preparation work that needs to be synchronously performed within the same thread. * This will copy the rule by the alias to the instance structure. @@ -114,6 +114,8 @@ extern "C" { * @param instance * The instance data. * + * Must not be NULL. + * * @return * F_okay on success. * F_found on the instance was found to already be running (nothing to do). @@ -131,9 +133,9 @@ extern "C" { * @see controller_rule_instance() * @see controller_rule_instance_begin() */ -#ifndef _di_controller_rule_instance_do_ - extern f_status_t controller_rule_instance_do(const uint8_t options_force, controller_instance_t * const instance); -#endif // _di_controller_rule_instance_do_ +#ifndef _di_controller_rule_instance_perform_ + extern f_status_t controller_rule_instance_perform(const uint8_t options_force, controller_instance_t * const instance); +#endif // _di_controller_rule_instance_perform_ #ifdef __cplusplus } // extern "C" diff --git a/sources/c/main/rule/item.c b/sources/c/main/rule/item.c index 32f9131..6b8ede3 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_error_rule_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/parameter.h b/sources/c/main/rule/parameter.h index 158fb23..4924207 100644 --- a/sources/c/main/rule/parameter.h +++ b/sources/c/main/rule/parameter.h @@ -5,12 +5,12 @@ * API Version: 0.7 * Licenses: lgpl-2.1-or-later * - * Provides the rule "read" functionality. + * Provides the rule "parameter" functionality. * * This is auto-included and should not need to be explicitly included. */ -#ifndef _controller_main_rule_read_h -#define _controller_main_rule_read_h +#ifndef _controller_main_rule_parameter_h +#define _controller_main_rule_parameter_h #ifdef __cplusplus extern "C" { @@ -66,4 +66,4 @@ extern "C" { } // extern "C" #endif -#endif // _controller_main_rule_read_h +#endif // _controller_main_rule_parameter_h diff --git a/sources/c/main/rule/read.c b/sources/c/main/rule/read.c index 56c042a..e659e65 100644 --- a/sources/c/main/rule/read.c +++ b/sources/c/main/rule/read.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_controller_rule_read_ - f_status_t controller_rule_read(controller_t * const main, controller_cache_t * const cache, const bool is_normal, const f_string_static_t alias, controller_entry_t * const entry, controller_rule_t * const rule) { + f_status_t controller_rule_read(controller_t * const main, controller_cache_t * const cache, const uint8_t is_normal, const f_string_static_t alias, controller_entry_t * const entry, controller_rule_t * const rule) { if (!main || !cache || !entry || !rule) return F_status_set_error(F_parameter); @@ -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_error_rule_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.h b/sources/c/main/rule/read.h index 0f52db9..5c23160 100644 --- a/sources/c/main/rule/read.h +++ b/sources/c/main/rule/read.h @@ -55,7 +55,7 @@ extern "C" { * @see fll_fss_basic_list_read(). */ #ifndef _di_controller_rule_read_ - extern f_status_t controller_rule_read(controller_t * const main, controller_cache_t * const cache, const bool is_normal, const f_string_static_t alias, controller_entry_t * const entry, controller_rule_t * const rule); + extern f_status_t controller_rule_read(controller_t * const main, controller_cache_t * const cache, const uint8_t is_normal, const f_string_static_t alias, controller_entry_t * const entry, controller_rule_t * const rule); #endif // _di_controller_rule_read_ diff --git a/sources/c/main/thread/entry.c b/sources/c/main/thread/entry.c index 286ed3e..168ad7f 100644 --- a/sources/c/main/thread/entry.c +++ b/sources/c/main/thread/entry.c @@ -29,7 +29,7 @@ extern "C" { *status = controller_entry_preprocess(main, F_true); if ((main->setting.flag & controller_main_flag_simulate_e) && (main->setting.flag & controller_main_flag_validate_e)) { - controller_print_entry_output_setting_validate(main, F_true); + controller_print_output_entry_setting_validate(&main->program.output, F_true); } } @@ -147,7 +147,7 @@ extern "C" { *status = controller_entry_preprocess(main, F_false); if ((main->setting.flag & controller_main_flag_simulate_e) && (main->setting.flag & controller_main_flag_validate_e)) { - controller_print_entry_output_setting_validate(main, F_false); + controller_print_output_entry_setting_validate(&main->program.output, F_false); } } diff --git a/sources/c/main/thread/instance.c b/sources/c/main/thread/instance.c index 8a3ab7c..8d484d0 100644 --- a/sources/c/main/thread/instance.c +++ b/sources/c/main/thread/instance.c @@ -10,7 +10,7 @@ extern "C" { if (!instance || !instance->main) return; if (!controller_thread_is_enabled(is_normal, &instance->main->thread)) return; - const f_status_t status = controller_rule_instance_do(controller_instance_option_asynchronous_e, instance); + const f_status_t status = controller_rule_instance_perform(controller_instance_option_asynchronous_e, instance); // A forked child instance should de-allocate memory on exit. // It seems that this function doesn't return to the calling thread for a forked child instance, even with the "return 0;" below. diff --git a/sources/c/main/thread/instance.h b/sources/c/main/thread/instance.h index 31b0ccb..273045f 100644 --- a/sources/c/main/thread/instance.h +++ b/sources/c/main/thread/instance.h @@ -27,7 +27,7 @@ extern "C" { * * Must not be NULL. * - * @see controller_rule_instance_do() + * @see controller_rule_instance_perform() */ #ifndef _di_controller_thread_instance_ extern void controller_thread_instance(const uint8_t is_normal, controller_instance_t * const instance); -- 1.8.3.1