From 801864d88e9b17aaea85a7ed8550d7b36c853da8 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 16 Jun 2024 23:41:42 -0500 Subject: [PATCH] Progress: Continue migrating the project. --- sources/c/init/init.c | 4 +- sources/c/init/init.h | 6 +- sources/c/main/common/enumeration/entry.h | 20 +-- sources/c/main/common/type.c | 1 - sources/c/main/common/type.h | 5 +- sources/c/main/common/type/entry.h | 19 ++- sources/c/main/common/type/process.h | 2 +- sources/c/main/entry.c | 206 ++++++++++++------------------ sources/c/main/entry.h | 10 +- sources/c/main/entry/setting.c | 8 +- sources/c/main/entry/setting.h | 32 ++++- sources/c/main/file.c | 37 +++--- sources/c/main/file.h | 6 +- sources/c/main/perform.c | 4 +- sources/c/main/perform.h | 5 +- sources/c/main/print/debug/perform/pid.c | 2 +- sources/c/main/print/debug/perform/pid.h | 5 +- sources/c/main/print/error/entry.c | 10 +- sources/c/main/print/error/entry.h | 15 +-- sources/c/main/print/message/entry/item.c | 32 ++++- sources/c/main/print/message/entry/item.h | 44 ++++++- sources/c/main/thread/entry.c | 5 +- 22 files changed, 250 insertions(+), 228 deletions(-) diff --git a/sources/c/init/init.c b/sources/c/init/init.c index 17691ab..b9cfa0b 100644 --- a/sources/c/init/init.c +++ b/sources/c/init/init.c @@ -5,9 +5,9 @@ extern "C" { #endif #ifndef _di_controller_init_process_entry_setup_ - f_status_t controller_init_process_entry_setup(controller_t * const main, controller_cache_t * const cache, controller_entry_t * const entry, const uint8_t is_entry) { + f_status_t controller_init_process_entry_setup(controller_t * const main, controller_entry_t * const entry) { - if (!main || !entry || !cache) return F_status_set_error(F_parameter); + if (!main || !entry) return F_status_set_error(F_parameter); entry->session = controller_entry_session_new_e; diff --git a/sources/c/init/init.h b/sources/c/init/init.h index 1518914..99e0930 100644 --- a/sources/c/init/init.h +++ b/sources/c/init/init.h @@ -25,10 +25,6 @@ extern "C" { * The main program data. * * Must not be NULL. - * @param cache - * The cache. - * - * Must not be NULL. * @param entry * The entry data. * @@ -43,7 +39,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_controller_init_process_entry_setup_ - extern f_status_t controller_init_process_entry_setup(controller_t * const main, controller_cache_t * const cache, controller_entry_t * const entry, const uint8_t is_entry); + extern f_status_t controller_init_process_entry_setup(controller_t * const main, controller_entry_t * const entry); #endif // _di_controller_init_process_entry_setup_ #ifdef __cplusplus diff --git a/sources/c/main/common/enumeration/entry.h b/sources/c/main/common/enumeration/entry.h index 5d6925c..8cdb585 100644 --- a/sources/c/main/common/enumeration/entry.h +++ b/sources/c/main/common/enumeration/entry.h @@ -80,19 +80,21 @@ extern "C" { * Controller Entry flags. * * controller_entry_flag_*_e: - * - none_e: No flags are set. - * - timeout_exit_no_e: The exit timeout is disabled. - * - timeout_kill_no_e: The kill timeout is disabled for Rules by default. - * - timeout_start_no_e: The start timeout is disabled for Rules by default. - * - timeout_stop_no_e: The stop timeout is disabled for Rules by default. + * - none: No flags are set. + * - is: Designate that this is an entry rather than an exit. + * - timeout_exit_no: The exit timeout is disabled. + * - timeout_kill_no: The kill timeout is disabled for Rules by default. + * - timeout_start_no: The start timeout is disabled for Rules by default. + * - timeout_stop_no: The stop timeout is disabled for Rules by default. */ #ifndef _di_controller_entry_flag_e_ enum { controller_entry_flag_none_e = 0x0, - controller_entry_flag_timeout_exit_no_e = 0x1, - controller_entry_flag_timeout_kill_no_e = 0x2, - controller_entry_flag_timeout_start_no_e = 0x4, - controller_entry_flag_timeout_stop_no_e = 0x8, + controller_entry_flag_is_e = 0x1, + controller_entry_flag_timeout_exit_no_e = 0x2, + controller_entry_flag_timeout_kill_no_e = 0x4, + controller_entry_flag_timeout_start_no_e = 0x8, + controller_entry_flag_timeout_stop_no_e = 0x10, }; // enum #endif // _di_controller_entry_flag_e_ diff --git a/sources/c/main/common/type.c b/sources/c/main/common/type.c index ba9d40d..56e53d3 100644 --- a/sources/c/main/common/type.c +++ b/sources/c/main/common/type.c @@ -11,7 +11,6 @@ extern "C" { fll_program_data_delete(&main->program); - controller_cache_delete(&main->cache); controller_process_delete(&main->process); controller_setting_delete(&main->setting); controller_thread_delete(&main->thread); diff --git a/sources/c/main/common/type.h b/sources/c/main/common/type.h index aa085fe..97d75b3 100644 --- a/sources/c/main/common/type.h +++ b/sources/c/main/common/type.h @@ -60,7 +60,7 @@ extern "C" { */ #ifndef _di_controller_t_ typedef struct { - f_status_t (*process_entry_setup)(controller_t * const main, controller_cache_t * const cache, controller_entry_t * const entry, const uint8_t is_entry); + f_status_t (*process_entry_setup)(controller_t * const main, controller_entry_t * const entry); } controller_callback_t; #define controller_callback_t_initialize \ @@ -77,7 +77,6 @@ extern "C" { * Properties: * - program: The main program data. * - * - cache: The cache. * - callback: The callbacks. * - process: The process data. * - setting: The settings data. @@ -87,7 +86,6 @@ extern "C" { struct controller_t_ { fll_program_data_t program; - controller_cache_t cache; controller_callback_t callback; controller_process_t process; controller_setting_t setting; @@ -97,7 +95,6 @@ extern "C" { #define controller_t_initialize \ { \ fll_program_data_t_initialize, \ - controller_cache_t_initialize, \ controller_callback_t_initialize, \ controller_process_t_initialize, \ controller_setting_t_initialize, \ diff --git a/sources/c/main/common/type/entry.h b/sources/c/main/common/type/entry.h index 2ae474a..7b9b54a 100644 --- a/sources/c/main/common/type/entry.h +++ b/sources/c/main/common/type/entry.h @@ -134,9 +134,11 @@ extern "C" { * Entry and Exit files are essentially the same structure with minor differences in settings and behavior. * The structure is identical and due to lacking any particularly good name to represent both "entry" or "exit", the name "entry" is being used for both. * + * A special macro_controller_entry_t_initialize_1() is provided to easily initialize with a specific set of flags. + * * Properties: * - define: Any defines (environment variables) made available to all Rules in this entry for IKI substitution or just as environment variables. - * - flag: A set of flags, primarily used to designate that timeouts are disabled. + * - flag: A set of flags associated with the entry. * - items: The array of entry items. * - parameter: Any parameters made available to all Rules in this entry for IKI substitution. * - pid: The PID file generation setting. @@ -182,6 +184,21 @@ extern "C" { f_string_maps_t_initialize, \ controller_entry_items_t_initialize, \ } + + #define macro_controller_entry_t_initialize_1(flag) { \ + F_known_not, \ + controller_entry_pid_require_e, \ + 0, \ + 0, \ + flag, \ + controller_thread_exit_timeout_d, \ + 0, \ + 0, \ + 0, \ + f_string_maps_t_initialize, \ + f_string_maps_t_initialize, \ + controller_entry_items_t_initialize, \ + } #endif // _di_controller_entry_t_ /** diff --git a/sources/c/main/common/type/process.h b/sources/c/main/common/type/process.h index 69b1b33..b665bf1 100644 --- a/sources/c/main/common/type/process.h +++ b/sources/c/main/common/type/process.h @@ -70,7 +70,7 @@ extern "C" { f_string_dynamic_t_initialize, \ f_string_dynamic_t_initialize, \ controller_control_t_initialize, \ - controller_entry_t_initialize, \ + macro_controller_entry_t_initialize_1(controller_entry_flag_is_e), \ controller_entry_t_initialize, \ controller_rules_t_initialize, \ } diff --git a/sources/c/main/entry.c b/sources/c/main/entry.c index 153c59b..92319cd 100644 --- a/sources/c/main/entry.c +++ b/sources/c/main/entry.c @@ -5,105 +5,91 @@ extern "C" { #endif #ifndef _di_controller_entry_read_ - f_status_t controller_entry_read(controller_t * const main, controller_cache_t * const cache, const uint8_t is_entry) { + f_status_t controller_entry_read(controller_t * const main, controller_entry_t * const entry) { - if (!main || !cache) return F_status_set_error(F_parameter); + if (!main) return F_status_set_error(F_parameter); f_status_t status = F_okay; - - controller_entry_t * const entry = is_entry ? &main->process.entry : &main->process.exit; + f_number_unsigned_t i = 0; entry->status = F_known_not; entry->items.used = 0; entry->session = controller_entry_session_same_e; if (main->callback.process_entry_setup) { - status = main->callback.process_entry_setup(main, cache, entry, is_entry); + status = main->callback.process_entry_setup(main, entry); } - cache->action.line_action = 0; - cache->action.line_item = 0; - - cache->timestamp.seconds = 0; - cache->timestamp.seconds_nano = 0; + main->thread.cache.action.line_action = 0; + main->thread.cache.action.line_item = 0; - cache->comments.used = 0; - cache->delimits.used = 0; + main->thread.cache.timestamp.seconds = 0; + main->thread.cache.timestamp.seconds_nano = 0; - cache->content_action.used = 0; + main->thread.cache.comments.used = 0; + main->thread.cache.delimits.used = 0; - { - f_number_unsigned_t i = 0; + main->thread.cache.content_action.used = 0; - for (; i < cache->content_actions.used; ++i) { - cache->content_actions.array[i].used = 0; - } // for + for (; i < main->thread.cache.content_actions.used; ++i) { + main->thread.cache.content_actions.array[i].used = 0; + } // for - for (i = 0; i < cache->content_items.used; ++i) { - cache->content_items.array[i].used = 0; - } // for - } + for (i = 0; i < main->thread.cache.content_items.used; ++i) { + main->thread.cache.content_items.array[i].used = 0; + } // for - cache->content_actions.used = 0; - cache->content_items.used = 0; + main->thread.cache.content_actions.used = 0; + main->thread.cache.content_items.used = 0; - cache->object_actions.used = 0; - cache->object_items.used = 0; + main->thread.cache.object_actions.used = 0; + main->thread.cache.object_items.used = 0; - cache->buffer_file.used = 0; - cache->buffer_path.used = 0; + main->thread.cache.buffer_file.used = 0; + main->thread.cache.buffer_path.used = 0; - cache->action.name_file.used = 0; - cache->action.name_action.used = 0; - cache->action.name_item.used = 0; + main->thread.cache.action.name_file.used = 0; + main->thread.cache.action.name_action.used = 0; + main->thread.cache.action.name_item.used = 0; if (F_status_is_error_not(status)) { - if (is_entry) { - status = controller_file_load(main, cache, F_true, controller_entries_s, main->process.name_entry, controller_entry_s); + if (entry->flag & controller_entry_flag_is_e) { + status = controller_file_load(main, F_true, controller_entries_s, main->process.name_entry, controller_entry_s); } else { - status = controller_file_load(main, cache, F_false, controller_exits_s, main->process.name_entry, controller_exit_s); + status = controller_file_load(main, F_false, controller_exits_s, main->process.name_entry, controller_exit_s); if (status == F_file_found_not) return F_file_found_not; } } if (F_status_is_error_not(status)) { - if (cache->buffer_file.used) { - controller_interrupt_t custom = macro_controller_interrupt_t_initialize_1(is_entry, main); + if (main->thread.cache.buffer_file.used) { + controller_interrupt_t custom = macro_controller_interrupt_t_initialize_1(entry->flag & controller_entry_flag_is_e, main); 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 = macro_f_range_t_initialize_2(cache->buffer_file.used); + f_range_t range = macro_f_range_t_initialize_2(main->thread.cache.buffer_file.used); - fll_fss_basic_list_read(cache->buffer_file, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments, &state); + fll_fss_basic_list_read(main->thread.cache.buffer_file, &range, &main->thread.cache.object_items, &main->thread.cache.content_items, &main->thread.cache.delimits, 0, &main->thread.cache.comments, &state); if (F_status_is_error(status)) { controller_print_error_status(&main->program.error, macro_controller_f(fll_fss_basic_list_read), F_status_set_fine(status)); } else { - f_fss_apply_delimit(cache->delimits, &cache->buffer_file, &state); + f_fss_apply_delimit(main->thread.cache.delimits, &main->thread.cache.buffer_file, &state); if (F_status_is_error(status)) { - controller_print_error_entry(&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, entry->flag & controller_entry_flag_is_e, F_status_set_fine(status), macro_controller_f(f_fss_apply_delimit), F_true); } } } else { - if (main->program.error.verbosity > f_console_verbosity_quiet_e) { - controller_lock_print(main->program.error.to, &main->thread); - - fll_print_format("%r%[%QThe %r file is empty.%]%r", main->program.error.to, f_string_eol_s, main->program.error.context, main->program.error.prefix, is_entry ? controller_entry_s : is_entry ? controller_entry_s : controller_exit_s, main->program.error.context, f_string_eol_s); - - controller_unlock_print_flush(main->program.error.to, &main->thread); - } - - status = F_status_set_error(F_data_not); - } + controller_print_error_file_status(&main->program.error, macro_controller_f(controller_file_load), (entry->flag & controller_entry_flag_is_e) ? controller_entry_s : controller_exit_s, f_file_operation_read_s, fll_error_file_type_file_e, F_status_set_fine(status)); } - if (F_status_is_error_not(status) && cache->object_items.used) { - status = f_memory_array_increase_by(cache->object_items.used, sizeof(f_range_t), (void **) &cache->object_items.array, &cache->object_items.used, &cache->object_items.size); + if (F_status_is_error_not(status) && main->thread.cache.object_items.used) { + status = f_memory_array_increase_by(main->thread.cache.object_items.used, sizeof(f_range_t), (void **) &main->thread.cache.object_items.array, &main->thread.cache.object_items.used, &main->thread.cache.object_items.size); if (F_status_is_error(status)) { - 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); + controller_print_error_entry(&main->program.error, cache, entry->flag & controller_entry_flag_is_e, F_status_set_fine(status), macro_controller_f(f_memory_array_increase_by), F_true); } else { @@ -111,75 +97,69 @@ extern "C" { uint8_t code = 0; f_range_t *range = 0; - f_number_unsigned_t at = 0; - f_number_unsigned_t i = 0; f_number_unsigned_t j = 0; - f_state_t state = f_state_t_initialize; - for (; i < cache->object_items.used && controller_thread_is_enabled(is_entry, &main->thread); ++i) { - - if (code & 0x2) { - code -= 0x2; - } + for (; i < main->thread.cache.object_items.used && controller_thread_is_enabled(entry->flag & controller_entry_flag_is_e, &main->thread); ++i) { + code &= ~0x2; at = 0; range = 0; - cache->action.line_action = 0; - cache->action.line_item = 0; + main->thread.cache.action.line_action = 0; + main->thread.cache.action.line_item = 0; - cache->comments.used = 0; - cache->delimits.used = 0; + main->thread.cache.comments.used = 0; + main->thread.cache.delimits.used = 0; - cache->content_action.used = 0; - cache->content_actions.used = 0; + main->thread.cache.content_action.used = 0; + main->thread.cache.content_actions.used = 0; - cache->object_actions.used = 0; + main->thread.cache.object_actions.used = 0; - cache->buffer_path.used = 0; + main->thread.cache.buffer_path.used = 0; - cache->action.name_action.used = 0; - cache->action.name_item.used = 0; + main->thread.cache.action.name_action.used = 0; + main->thread.cache.action.name_item.used = 0; status = f_memory_array_increase(controller_allocation_small_d, sizeof(controller_entry_item_t), (void **) &entry->items.array, &entry->items.used, &entry->items.size); if (F_status_is_error(status)) { - controller_print_error_entry(&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, entry->flag & controller_entry_flag_is_e, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true); break; } - status = f_string_dynamic_partial_append(cache->buffer_file, cache->object_items.array[i], &cache->action.name_item); + status = f_string_dynamic_partial_append(main->thread.cache.buffer_file, main->thread.cache.object_items.array[i], &main->thread.cache.action.name_item); if (F_status_is_error(status)) { - 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); + controller_print_error_entry(&main->program.error, entry->flag & controller_entry_flag_is_e, F_status_set_fine(status), macro_controller_f(f_string_dynamic_partial_append), F_true); break; } - f_fss_count_lines(cache->buffer_file, cache->object_items.array[i].start, &cache->action.line_item, &main->setting.state); + f_fss_count_lines(main->thread.cache.buffer_file, main->thread.cache.object_items.array[i].start, &main->thread.cache.action.line_item, &main->setting.state); if (F_status_is_error(status)) { - controller_print_error_entry(&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, entry->flag & controller_entry_flag_is_e, F_status_set_fine(status), macro_controller_f(f_fss_count_lines), F_true); break; } - ++cache->action.line_item; + ++main->thread.cache.action.line_item; for (j = (code & 0x1) ? 1 : 0; j < entry->items.used; ++j) { - if (f_compare_dynamic(entry->items.array[j].name, cache->action.name_item) == F_equal_to) { + if (f_compare_dynamic(entry->items.array[j].name, main->thread.cache.action.name_item) == F_equal_to) { if (main->program.warning.verbosity == f_console_verbosity_debug_e) { controller_lock_print(main->program.warning.to, &main->thread); - fl_print_format("%r%[%QIgnoring duplicate %r item '%]", main->program.warning.to, f_string_eol_s, main->program.warning.context, main->program.warning.prefix, is_entry ? controller_entry_s : controller_exit_s, main->program.warning.context); - 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("%r%[%QIgnoring duplicate %r item '%]", main->program.warning.to, f_string_eol_s, main->program.warning.context, main->program.warning.prefix, (entry->flag & controller_entry_flag_is_e) ? controller_entry_s : controller_exit_s, main->program.warning.context); + fl_print_format(f_string_format_Q_single_s.string, main->program.warning.to, main->program.warning.notable, main->thread.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_error_entry_cache(&main->program.warning, &cache->action, is_entry); + controller_print_error_entry_cache(&main->program.warning, &main->thread.cache.action, entry->flag & controller_entry_flag_is_e); controller_unlock_print_flush(main->program.warning.to, &main->thread); } @@ -192,9 +172,9 @@ extern "C" { if (code & 0x2) continue; - range = &cache->content_items.array[i].array[0]; + range = &main->thread.cache.content_items.array[i].array[0]; - if (f_compare_dynamic(controller_main_s, cache->action.name_item) == F_equal_to) { + if (f_compare_dynamic(controller_main_s, main->thread.cache.action.name_item) == F_equal_to) { code |= 0x1; at = 0; @@ -203,8 +183,8 @@ extern "C" { entry->items.used = 1; } } - else if (f_compare_dynamic(controller_settings_s, cache->action.name_item) == F_equal_to) { - status = controller_entry_setting_read(main, cache, is_entry, *range); + else if (f_compare_dynamic(controller_settings_s, main->thread.cache.action.name_item) == F_equal_to) { + status = controller_entry_setting_read(main, cache, entry->flag & controller_entry_flag_is_e, *range); continue; } @@ -220,23 +200,23 @@ extern "C" { entry->items.used = 2; } - entry->items.array[at].line = cache->action.line_item; + entry->items.array[at].line = main->thread.cache.action.line_item; - status = f_string_dynamic_append_nulless(cache->action.name_item, &entry->items.array[at].name); + status = f_string_dynamic_append_nulless(main->thread.cache.action.name_item, &entry->items.array[at].name); if (F_status_is_error(status)) { - controller_print_error(main->thread, &main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); + controller_print_error_status(&main->program.error, macro_controller_f(f_string_dynamic_append_nulless), F_status_set_fine(status)); break; } - status = controller_entry_actions_read(main, cache, is_entry, *range, &entry->items.array[at].actions); + status = controller_entry_actions_read(main, cache, entry->flag & controller_entry_flag_is_e, *range, &entry->items.array[at].actions); if (F_status_is_error(status)) { if (F_status_set_fine(status) != F_interrupt) { 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(entry->flag & controller_entry_flag_is_e, &main->program.error, &main->thread.cache.action); controller_unlock_print_flush(main->program.error.to, &main->thread); } @@ -245,24 +225,16 @@ extern "C" { } } // for - if (is_entry && F_status_set_fine(status) == F_interrupt) return status; + if (entry->flag & controller_entry_flag_is_e && F_status_set_fine(status) == F_interrupt) return status; if (F_status_is_error_not(status)) { - cache->action.name_action.used = 0; - cache->action.name_item.used = 0; + main->thread.cache.action.name_action.used = 0; + main->thread.cache.action.name_item.used = 0; if (!(code & 0x1)) { - if (main->program.error.verbosity > f_console_verbosity_quiet_e) { - controller_lock_print(main->program.error.to, &main->thread); - - fl_print_format("%r%[%QThe required %r item '%]", main->program.error.to, f_string_eol_s, main->program.error.context, main->program.error.prefix, is_entry ? controller_entry_s : controller_exit_s, main->program.error.context); - fl_print_format(f_string_format_r_single_s.string, main->program.error.to, main->program.error.notable, controller_main_s, main->program.error.notable); - fl_print_format("%[' is not found.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - - controller_unlock_print_flush(main->program.error.to, &main->thread); - } - status = F_status_set_error(F_found_not); + + controller_print_message_entry_item_required(&main->program.error, entry->flag & controller_entry_flag_is_e, "is not found"); } if (F_status_is_error_not(status)) { @@ -277,7 +249,7 @@ extern "C" { for (j = 0; j < entry->items.array[i].actions.used; ++j) { - if (!controller_thread_is_enabled(is_entry, &main->thread)) { + if (!controller_thread_is_enabled(entry->flag & controller_entry_flag_is_e, &main->thread)) { return F_status_set_error(F_interrupt); } @@ -301,34 +273,24 @@ extern "C" { if (missing & 0x1) { missing |= 0x2; - cache->action.line_action = action->line; - cache->action.line_item = entry->items.array[i].line; + main->thread.cache.action.line_action = action->line; + main->thread.cache.action.line_item = entry->items.array[i].line; - status = f_string_dynamic_append_nulless(entry->items.array[i].name, &cache->action.name_item); + status = f_string_dynamic_append_nulless(entry->items.array[i].name, &main->thread.cache.action.name_item); if (F_status_is_error(status)) { - controller_print_error(main->thread, &main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); + controller_print_error_status(&main->program.error, macro_controller_f(f_string_dynamic_append_nulless), F_status_set_fine(status)); break; } - if (main->program.error.verbosity > f_console_verbosity_quiet_e) { - controller_lock_print(main->program.error.to, &main->thread); - - fl_print_format("%r%[%QThe required %r item '%]", main->program.error.to, f_string_eol_s, main->program.error.context, main->program.error.prefix, is_entry ? controller_entry_s : controller_exit_s, main->program.error.context); - 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_error_entry_cache(is_entry, &main->program.error, &cache->action); - - controller_unlock_print_flush(main->program.error.to, &main->thread); - } + controller_print_message_entry_item_required(&main->program.error, entry->flag & controller_entry_flag_is_e, "does not exist"); action->number = 0; action->status = controller_status_simplify_error(F_found_not); - cache->action.name_action.used = 0; - cache->action.name_item.used = 0; + main->thread.cache.action.name_action.used = 0; + main->thread.cache.action.name_item.used = 0; } else { action->number = k; @@ -343,7 +305,7 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) != F_interrupt) { - controller_print_error_entry_cache(is_entry, &main->program.error, &cache->action); + controller_print_error_entry_cache(entry->flag & controller_entry_flag_is_e, &main->program.error, &main->thread.cache.action); } entry->status = controller_status_simplify_error(F_status_set_fine(status)); diff --git a/sources/c/main/entry.h b/sources/c/main/entry.h index 9899a8a..6901da3 100644 --- a/sources/c/main/entry.h +++ b/sources/c/main/entry.h @@ -23,14 +23,10 @@ extern "C" { * The main program data. * * Must not be NULL. - * @param cache - * The cache for the specific thread. - * This should be the cache global.thread->asynchronouss.array[global.id].cache. + * @param entry + * The entry data. * * Must not be NULL. - * @param is_entry - * If TRUE, then this loads as an entry. - * If FALSE, then this loads as an exit. * * @return * F_okay on success. @@ -67,7 +63,7 @@ extern "C" { * @see fll_fss_basic_list_read() */ #ifndef _di_controller_entry_read_ - extern f_status_t controller_entry_read(controller_t * const main, controller_cache_t * const cache, const uint8_t is_entry); + extern f_status_t controller_entry_read(controller_t * const main, controller_entry_t * const entry); #endif // _di_controller_entry_read_ #ifdef __cplusplus diff --git a/sources/c/main/entry/setting.c b/sources/c/main/entry/setting.c index af9d890..e6ed71d 100644 --- a/sources/c/main/entry/setting.c +++ b/sources/c/main/entry/setting.c @@ -5,7 +5,9 @@ extern "C" { #endif #ifndef _di_controller_entry_setting_read_ - 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) { + f_status_t controller_entry_setting_read(controller_t * const main, const uint8_t is_entry, const f_range_t content_range) { + + if (!main) return F_status_set_error(F_parameter); f_status_t status = F_okay; @@ -39,7 +41,7 @@ extern "C" { f_number_unsigned_t i = 0; - controller_entry_t *entry = is_entry ? &main->setting.entry : &main->setting.exit; + controller_entry_t * const entry = is_entry ? &main->setting.entry : &main->setting.exit; f_state_t state = f_state_t_initialize; for (; i < cache->object_actions.used; ++i) { @@ -102,7 +104,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_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); + controller_print_error_entry_file(&main->program.error, 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; } diff --git a/sources/c/main/entry/setting.h b/sources/c/main/entry/setting.h index f53bbe8..680c46c 100644 --- a/sources/c/main/entry/setting.h +++ b/sources/c/main/entry/setting.h @@ -23,10 +23,6 @@ extern "C" { * The main program data. * * Must not be NULL. - * @param cache - * A structure for containing and caching relevant data. - * - * Must not be NULL. * @param is_entry * If TRUE, then this loads as an entry. * If FALSE, then this loads as an exit. @@ -35,13 +31,35 @@ extern "C" { * * @return * F_okay on success. + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_file_mode_from_string(). + * Errors (with error bit) from: f_file_mode_to_mode(). + * Errors (with error bit) from: f_fss_apply_delimit(). + * Errors (with error bit) from: f_fss_count_lines(). + * Errors (with error bit) from: f_rip_dynamic_partial_nulless(). + * Errors (with error bit) from: fl_conversion_dynamic_partial_to_unsigned_detect(). + * Errors (with error bit) from: fll_fss_extended_read(). + * + * Errors (with error bit) from: controller_convert_group_id(). + * Errors (with error bit) from: controller_convert_user_id(). + * Errors (with error bit) from: controller_entry_setting_read_map(). + * Errors (with error bit) from: controller_path_canonical_relative(). * - * Errors (with error bit) from: controller_print_error_entry_file(). + * @see f_file_mode_from_string() + * @see f_fss_apply_delimit() + * @see f_fss_count_lines() + * @see f_rip_dynamic_partial_nulless() + * @see fl_conversion_dynamic_partial_to_unsigned_detect() + * @see fll_fss_extended_read() * - * @see controller_print_error_entry_file() + * @see controller_convert_group_id() + * @see controller_convert_user_id() + * @see controller_entry_setting_read_map() + * @see controller_path_canonical_relative() */ #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); + extern f_status_t controller_entry_setting_read(controller_t * const main, const uint8_t is_entry, const f_range_t content_range); #endif // _di_controller_entry_setting_read_ /** diff --git a/sources/c/main/file.c b/sources/c/main/file.c index 71420f9..5b3121e 100644 --- a/sources/c/main/file.c +++ b/sources/c/main/file.c @@ -5,34 +5,33 @@ extern "C" { #endif #ifndef _di_controller_file_load_ - f_status_t controller_file_load(controller_t * const main, controller_cache_t * const cache, const bool required, const f_string_static_t path_prefix, const f_string_static_t path_name, const f_string_static_t path_suffix) { + f_status_t controller_file_load(controller_t * const main, const bool required, const f_string_static_t path_prefix, const f_string_static_t path_name, const f_string_static_t path_suffix) { - if (!main || !cache) return F_status_set_error(F_parameter); + if (!main) return F_status_set_error(F_parameter); - f_status_t status = F_okay; f_file_t file = f_file_t_initialize; - cache->action.name_file.used = 0; - cache->buffer_file.used = 0; - cache->timestamp.seconds = 0; - cache->timestamp.seconds_nano = 0; + main->thread.cache.action.name_file.used = 0; + main->thread.cache.buffer_file.used = 0; + main->thread.cache.timestamp.seconds = 0; + main->thread.cache.timestamp.seconds_nano = 0; - status = f_string_dynamic_append(path_prefix, &cache->action.name_file); + f_status_t status = f_string_dynamic_append(path_prefix, &main->thread.cache.action.name_file); if (F_status_is_error_not(status)) { - status = f_string_dynamic_append(f_path_separator_s, &cache->action.name_file); + status = f_string_dynamic_append(f_path_separator_s, &main->thread.cache.action.name_file); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_append(path_name, &cache->action.name_file); + status = f_string_dynamic_append(path_name, &main->thread.cache.action.name_file); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_append(f_path_extension_separator_s, &cache->action.name_file); + status = f_string_dynamic_append(f_path_extension_separator_s, &main->thread.cache.action.name_file); } if (F_status_is_error_not(status)) { - status = f_string_dynamic_append(path_suffix, &cache->action.name_file); + status = f_string_dynamic_append(path_suffix, &main->thread.cache.action.name_file); } if (F_status_is_error(status)) { @@ -44,10 +43,10 @@ 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 + cache->action.name_file.used; + path.used = main->setting.path_setting.used + F_path_separator_s_length + main->thread.cache.action.name_file.used; } else { - path.used = cache->action.name_file.used; + path.used = main->thread.cache.action.name_file.used; } f_char_t path_string[path.used + 1]; @@ -55,12 +54,12 @@ extern "C" { 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, cache->action.name_file.string, sizeof(f_char_t) * cache->action.name_file.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); path_string[main->setting.path_setting.used] = f_path_separator_s.string[0]; } else { - memcpy(path_string, cache->action.name_file.string, sizeof(f_char_t) * cache->action.name_file.used); + memcpy(path_string, main->thread.cache.action.name_file.string, sizeof(f_char_t) * main->thread.cache.action.name_file.used); } path_string[path.used] = 0; @@ -81,7 +80,7 @@ extern "C" { } } else { - status = f_file_stream_read(file, &cache->buffer_file); + status = f_file_stream_read(file, &main->thread.cache.buffer_file); if (F_status_is_error(status)) { controller_print_error_file_status(&main->program.error, macro_controller_f(f_file_stream_read), path, f_file_operation_read_s, fll_error_file_type_file_e, F_status_set_fine(status)); @@ -100,8 +99,8 @@ extern "C" { controller_print_error_file_status(&main->program.error, macro_controller_f(f_file_stat), path, f_file_operation_stat_s, fll_error_file_type_file_e, F_status_set_fine(status)); } else { - cache->timestamp.seconds = stat_file.st_ctim.tv_sec; - cache->timestamp.seconds_nano = stat_file.st_ctim.tv_nsec; + main->thread.cache.timestamp.seconds = stat_file.st_ctim.tv_sec; + main->thread.cache.timestamp.seconds_nano = stat_file.st_ctim.tv_nsec; } } diff --git a/sources/c/main/file.h b/sources/c/main/file.h index 59ec8f0..2ad4908 100644 --- a/sources/c/main/file.h +++ b/sources/c/main/file.h @@ -22,9 +22,7 @@ extern "C" { * @param main * The main program data. * - * Must not be NULL. - * @param cache - * The following within the cache is updated: + * The following within the main.thread.cache is updated: * - name_file: The partial path of the file is inserted. * - buffer_file: The contents of the file is inserted. * - timestamp: This is updated to reflect the last changed timestamp. @@ -56,7 +54,7 @@ extern "C" { * @see f_string_append() */ #ifndef _di_controller_file_load_ - extern f_status_t controller_file_load(controller_t * const main, controller_cache_t * const cache, const bool required, const f_string_static_t path_prefix, const f_string_static_t path_name, const f_string_static_t path_suffix); + extern f_status_t controller_file_load(controller_t * const main, const bool required, const f_string_static_t path_prefix, const f_string_static_t path_name, const f_string_static_t path_suffix); #endif // _di_controller_file_load_ /** diff --git a/sources/c/main/perform.c b/sources/c/main/perform.c index 0de2de1..f81ab7c 100644 --- a/sources/c/main/perform.c +++ b/sources/c/main/perform.c @@ -40,7 +40,7 @@ extern "C" { else { main->setting.flag |= controller_setting_flag_pid_created_e; - controller_print_debug_perform_pid_file_create_success(&main->program.debug, is_entry); + controller_print_debug_perform_pid_file_create_success(&main->program.debug); } } @@ -59,7 +59,7 @@ extern "C" { #endif // _di_controller_perform_ready_ #ifndef _di_controller_perform_ready_socket_ - f_status_t controller_perform_ready_socket(controller_t * const main, const uint8_t is_entry) { + f_status_t controller_perform_ready_socket(controller_t * const main) { f_status_t status = F_okay; diff --git a/sources/c/main/perform.h b/sources/c/main/perform.h index 5672c95..0ca3b59 100644 --- a/sources/c/main/perform.h +++ b/sources/c/main/perform.h @@ -53,9 +53,6 @@ extern "C" { * The main program data. * * Must not be NULL. - * @param is_entry - * If TRUE, then this operates as an entry. - * If FALSE, then this operates as an exit. * * @return * F_okay on success. @@ -76,7 +73,7 @@ extern "C" { * @see f_thread_create() */ #ifndef _di_controller_perform_ready_socket_ - extern f_status_t controller_perform_ready_socket(controller_t * const main, const uint8_t is_entry); + extern f_status_t controller_perform_ready_socket(controller_t * const main); #endif // _di_controller_perform_ready_socket_ #ifdef __cplusplus diff --git a/sources/c/main/print/debug/perform/pid.c b/sources/c/main/print/debug/perform/pid.c index 8b4efe5..9995826 100644 --- a/sources/c/main/print/debug/perform/pid.c +++ b/sources/c/main/print/debug/perform/pid.c @@ -57,7 +57,7 @@ extern "C" { #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) { + f_status_t controller_print_debug_perform_pid_file_create_success(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; diff --git a/sources/c/main/print/debug/perform/pid.h b/sources/c/main/print/debug/perform/pid.h index e148342..8796cde 100644 --- a/sources/c/main/print/debug/perform/pid.h +++ b/sources/c/main/print/debug/perform/pid.h @@ -73,9 +73,6 @@ extern "C" { * 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. @@ -84,7 +81,7 @@ extern "C" { * 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); + extern f_status_t controller_print_debug_perform_pid_file_create_success(fl_print_t * const print); #endif // _di_controller_print_debug_perform_pid_file_create_success_ #ifdef __cplusplus diff --git a/sources/c/main/print/error/entry.c b/sources/c/main/print/error/entry.c index 22e05b6..f593aae 100644 --- a/sources/c/main/print/error/entry.c +++ b/sources/c/main/print/error/entry.c @@ -5,9 +5,9 @@ extern "C" { #endif #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) { + f_status_t controller_print_error_entry(fl_print_t * const print, 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 || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; if (status == F_interrupt) return F_status_set_error(F_output_not); @@ -20,7 +20,7 @@ extern "C" { f_file_stream_lock(print->to); - controller_print_error_entry_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &main->thread.cache.action, is_entry); controller_unlock_print_flush(print->to, &main->thread); @@ -64,7 +64,7 @@ extern "C" { #endif // _di_controller_print_error_entry_cache_ #ifndef _di_controller_print_error_entry_file_ - f_status_t controller_print_error_entry_file(fl_print_t * const print, 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) { + f_status_t controller_print_error_entry_file(fl_print_t * const print, 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,7 +79,7 @@ extern "C" { f_file_stream_lock(print->to); - controller_print_error_entry_cache(print, &cache->action, is_entry); + controller_print_error_entry_cache(print, &main->thread.cache.action, is_entry); controller_unlock_print_flush(print->to, &main->thread); diff --git a/sources/c/main/print/error/entry.h b/sources/c/main/print/error/entry.h index 18b2871..b507fd4 100644 --- a/sources/c/main/print/error/entry.h +++ b/sources/c/main/print/error/entry.h @@ -27,10 +27,6 @@ extern "C" { * 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. @@ -55,11 +51,11 @@ extern "C" { * @see controller_print_error_entry_cache() */ #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); + extern f_status_t controller_print_error_entry(fl_print_t * const print, 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. + * Print additional error/warning information in addition to existing error that is found within the given action cache. * * This is explicitly intended to be used in addition to the error message. * @@ -105,10 +101,6 @@ extern "C" { * 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. @@ -135,10 +127,9 @@ extern "C" { * 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_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); + extern f_status_t controller_print_error_entry_file(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const 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 diff --git a/sources/c/main/print/message/entry/item.c b/sources/c/main/print/message/entry/item.c index 3b34434..07ee7a8 100644 --- a/sources/c/main/print/message/entry/item.c +++ b/sources/c/main/print/message/entry/item.c @@ -4,6 +4,26 @@ extern "C" { #endif +#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; + + controller_t * const main = (controller_t *) print->custom; + + 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_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_message_entry_item_done_ + #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) { @@ -57,8 +77,8 @@ extern "C" { } #endif // _di_controller_print_message_entry_item_process_ -#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) { +#ifndef _di_controller_print_message_entry_item_required_ + f_status_t controller_print_message_entry_item_required(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name, const f_string_t detail) { if (!print || !print->custom) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_error_e) return F_output_not; @@ -67,15 +87,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("%r%[%QThe required %r item '%]", print->to, f_string_eol_s, print->context, print->prefix, is_entry ? controller_entry_s : controller_exit_s); 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); + fl_print_format("' %Q.", print->to, reason, f_string_eol_s); + + controller_print_error_entry_cache(print, &main->thread.cache.action, is_entry); controller_unlock_print_flush(print->to, &main->thread); return F_okay; } -#endif // _di_controller_print_message_entry_item_done_ +#endif // _di_controller_print_message_entry_item_required_ #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) { diff --git a/sources/c/main/print/message/entry/item.h b/sources/c/main/print/message/entry/item.h index 3447524..8b16abe 100644 --- a/sources/c/main/print/message/entry/item.h +++ b/sources/c/main/print/message/entry/item.h @@ -17,6 +17,37 @@ extern "C" { #endif /** + * Print message about processing an item. + * + * @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 loads as an entry. + * If FALSE, then this loads as an exit. + * @param failsafe + * If TRUE, then running in failsafe. + * If FALSE, then running normally. + * @param name + * The item 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_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 message about the entry item executing. * * @param print @@ -82,7 +113,7 @@ extern "C" { #endif // _di_controller_print_message_entry_item_process_ /** - * Print message about processing an item. + * Print message about a problem with an entry item. * * @param print * The output structure to print to. @@ -93,11 +124,10 @@ extern "C" { * @param is_entry * If TRUE, then this loads as an entry. * If FALSE, then this loads as an exit. - * @param failsafe - * If TRUE, then running in failsafe. - * If FALSE, then running normally. * @param name * The item name. + * @param detail + * The details regarding the problem with the required entry item. * * @return * F_okay on success. @@ -108,9 +138,9 @@ extern "C" { * @see fll_error_file_print() * @see controller_print_error_entry_cache() */ -#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_ +#ifndef _di_controller_print_message_entry_item_required_ + extern f_status_t controller_print_message_entry_item_required(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name, const f_string_t detail); +#endif // _di_controller_print_message_entry_item_required_ /** * Print warning message about multiple actions for a specified item. diff --git a/sources/c/main/thread/entry.c b/sources/c/main/thread/entry.c index 2511584..286ed3e 100644 --- a/sources/c/main/thread/entry.c +++ b/sources/c/main/thread/entry.c @@ -17,7 +17,7 @@ extern "C" { f_status_t * const status = &main->thread.status; - *status = controller_entry_read(main, F_true); + *status = controller_entry_read(main, &main->process.entry); if (F_status_set_fine(*status) == F_interrupt) { main->process.ready = controller_process_ready_abort_e; @@ -130,10 +130,9 @@ extern "C" { f_thread_cancel_state_set(PTHREAD_CANCEL_DEFERRED, 0); controller_t * const main = (controller_t *) argument; - controller_cache_t * const cache = &main->thread.cache; f_status_t * const status = &main->thread.status; - *status = controller_entry_read(main, F_false); + *status = controller_entry_read(main, &main->process.exit); if (F_status_set_fine(*status) == F_interrupt) { main->process.ready = controller_process_ready_abort_e; -- 1.8.3.1