From a47de0b65997ae886268d14de93abba6c49a6d03 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 15 Mar 2024 23:10:49 -0500 Subject: [PATCH] Progress: Controller program migration from 0.6 to 0.7. This gets most things compiling. This should not work. The changes made are just to reduce the compilation errors and to get the code into a near good enough state to start really migrating. I am going to rewrite this side-by-side to this code now that I have seen what I need to do. I may likely use this as a starting point for porting this over into its own separate project. That project has already been created but is pretty much empty. This will be long and rather painful migration process but it will be worth it. --- level_3/controller/c/common.c | 8 +- level_3/controller/c/common.h | 27 +- level_3/controller/c/common/private-common.h | 1 + .../controller/c/controller/private-controller.c | 32 +- .../c/controller/private-controller_print.c | 12 +- .../c/controller/private-controller_print.h | 4 +- level_3/controller/c/entry/private-entry.c | 226 ++++----- level_3/controller/c/entry/private-entry_print.c | 80 ++-- level_3/controller/c/entry/private-entry_print.h | 16 +- level_3/controller/c/lock/private-lock_print.c | 26 +- level_3/controller/c/lock/private-lock_print.h | 2 +- level_3/controller/c/main.c | 12 +- level_3/controller/c/process/private-process.c | 6 +- level_3/controller/c/rule/private-rule.c | 526 ++++++++++----------- level_3/controller/c/rule/private-rule_print.c | 112 ++--- level_3/controller/c/rule/private-rule_print.h | 16 +- level_3/controller/c/thread/private-thread.c | 16 +- .../controller/c/thread/private-thread_process.c | 2 +- .../controller/c/thread/private-thread_signal.c | 48 +- .../controller/c/thread/private-thread_signal.h | 4 +- 20 files changed, 595 insertions(+), 581 deletions(-) diff --git a/level_3/controller/c/common.c b/level_3/controller/c/common.c index 08d3502..12f9219 100644 --- a/level_3/controller/c/common.c +++ b/level_3/controller/c/common.c @@ -682,15 +682,15 @@ extern "C" { f_string_static_t * const args = main->program.parameters.arguments.array; if (main->process) { - main->process->control.server.address = main->process->control.address; // @fixme is this actually f_socket_address_t? + //main->process->control.server.address = main->process->control.address; // @fixme is this actually f_socket_address_t? main->process->control.server.domain = f_socket_protocol_family_local_e; main->process->control.server.type = f_socket_type_stream_e; main->process->control.server.length = sizeof(struct sockaddr_un); - memset(&main->process->control.server.address, 0, main->process->control.server.length); + //memset(&main->process->control.server.address, 0, main->process->control.server.length); if (main->program.parameters.remaining.used) { - main->setting.state.status = f_string_dynamic_append(arguments.argv[main->program.parameters.remaining.array[0]], &main->process->name_entry); + main->setting.state.status = f_string_dynamic_append(args[main->program.parameters.remaining.array[0]], &main->process->name_entry); } else { main->setting.state.status = f_string_dynamic_append(controller_default_s, &main->process->name_entry); @@ -885,7 +885,7 @@ extern "C" { #ifndef _di_controller_rule_delete_ void controller_rule_delete(controller_rule_t * const rule) { - if (!rule) return F_status_set_error(F_parameter); + if (!rule) return; f_memory_array_resize(0, sizeof(f_char_t), (void **) &rule->engine.string, &rule->engine.used, &rule->engine.size); f_memory_array_resize(0, sizeof(f_char_t), (void **) &rule->name.string, &rule->name.used, &rule->name.size); diff --git a/level_3/controller/c/common.h b/level_3/controller/c/common.h index c2fd548..85c04c5 100644 --- a/level_3/controller/c/common.h +++ b/level_3/controller/c/common.h @@ -383,6 +383,31 @@ extern "C" { #endif // _di_controller_main_flag_e_ /** + * Flags for fine-tuned print control. + * + * controller_print_flag_*_e: + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. + */ +#ifndef _di_controller_print_flag_e_ + enum { + controller_print_flag_none_e = 0x0, + controller_print_flag_debug_e = 0x1, + controller_print_flag_error_e = 0x2, + controller_print_flag_file_e = 0x4, + controller_print_flag_in_e = 0x8, + controller_print_flag_out_e = 0x10, + controller_print_flag_message_e = 0x20, + controller_print_flag_warning_e = 0x40, + }; // enum +#endif // _di_controller_print_flag_e_ + +/** * The controller main program settings. * * This is passed to the program-specific main entry point to designate program settings. @@ -1371,7 +1396,7 @@ extern "C" { { \ fll_program_data_t_initialize, \ controller_setting_t_initialize, \ - controller_process_t_initialize, \ + 0, \ } #endif // _di_controller_main_t_ diff --git a/level_3/controller/c/common/private-common.h b/level_3/controller/c/common/private-common.h index ba3ac5e..00e2b21 100644 --- a/level_3/controller/c/common/private-common.h +++ b/level_3/controller/c/common/private-common.h @@ -162,6 +162,7 @@ extern "C" { #define CONTROLLER_Entry_s "Entry" #define CONTROLLER_Exit_s "Exit" + #define CONTROLLER_Item_s "Item" #define CONTROLLER_parameter_map_option_s ":option" #define CONTROLLER_parameter_map_value_s ":value" diff --git a/level_3/controller/c/controller/private-controller.c b/level_3/controller/c/controller/private-controller.c index 45c409e..d678939 100644 --- a/level_3/controller/c/controller/private-controller.c +++ b/level_3/controller/c/controller/private-controller.c @@ -60,7 +60,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true); return status; } @@ -101,7 +101,7 @@ extern "C" { } if (global.main->program.error.verbosity > f_console_verbosity_quiet_e) { - controller_print_error_file(global.thread, global.main->program.error, F_status_set_fine(status), "f_file_stream_open", F_true, path, f_file_operation_open_s, fll_error_file_type_file_e); + controller_print_error_file(global.thread, &global.main->program.error, F_status_set_fine(status), "f_file_stream_open", F_true, path, f_file_operation_open_s, fll_error_file_type_file_e); } } else { @@ -109,7 +109,7 @@ extern "C" { if (F_status_is_error(status)) { if (global.main->program.error.verbosity > f_console_verbosity_quiet_e) { - controller_print_error_file(global.thread, global.main->program.error, F_status_set_fine(status), "f_file_stream_read", F_true, path, f_file_operation_read_s, fll_error_file_type_file_e); + controller_print_error_file(global.thread, &global.main->program.error, F_status_set_fine(status), "f_file_stream_read", F_true, path, f_file_operation_read_s, fll_error_file_type_file_e); } } } @@ -124,12 +124,12 @@ extern "C" { if (F_status_is_error(status)) { if (global.main->program.error.verbosity > f_console_verbosity_quiet_e) { - controller_print_error_file(global.thread, global.main->program.error, F_status_set_fine(status), "f_file_stat", F_true, path, f_file_operation_stat_s, fll_error_file_type_file_e); + controller_print_error_file(global.thread, &global.main->program.error, F_status_set_fine(status), "f_file_stat", F_true, path, f_file_operation_stat_s, fll_error_file_type_file_e); } } else { cache->timestamp.seconds = stat_file.st_ctim.tv_sec; - cache->timestamp.nanoseconds = stat_file.st_ctim.tv_nsec; + cache->timestamp.seconds_nano = stat_file.st_ctim.tv_nsec; } } @@ -437,11 +437,11 @@ extern "C" { if (global->main->program.error.verbosity > f_console_verbosity_quiet_e) { controller_lock_print(global->main->program.error.to, global->thread); - controller_print_error_file(0, global->main->program.error, F_status_set_fine(status), "controller_file_pid_create", F_true, global->setting->path_pid, f_file_operation_create_s, fll_error_file_type_file_e); + controller_print_error_file(0, &global->main->program.error, F_status_set_fine(status), "controller_file_pid_create", F_true, global->setting->path_pid, f_file_operation_create_s, fll_error_file_type_file_e); f_file_stream_lock(global->main->program.error.to); - controller_entry_print_error_cache(is_entry, global->main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global->main->program.error, cache->action); controller_unlock_print_flush(global->main->program.error.to, global->thread); } @@ -458,10 +458,10 @@ extern "C" { fl_print_format("%[' could not be written because the destination is read only.%]%r", global->main->program.warning.to, global->main->program.warning.context, global->main->program.warning.context, f_string_eol_s); } else { - controller_print_error_file(0, global->main->program.warning, F_status_set_fine(status), "controller_file_pid_create", F_true, global->setting->path_pid, f_file_operation_create_s, fll_error_file_type_file_e); + controller_print_error_file(0, &global->main->program.warning, F_status_set_fine(status), "controller_file_pid_create", F_true, global->setting->path_pid, f_file_operation_create_s, fll_error_file_type_file_e); } - controller_entry_print_error_cache(is_entry, global->main->program.warning, cache->action); + controller_entry_print_error_cache(is_entry, &global->main->program.warning, cache->action); controller_unlock_print_flush(global->main->program.warning.to, global->thread); } @@ -522,7 +522,7 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_memory_not) { - controller_print_error(global->thread, global->main->program.error, F_status_set_fine(status), "f_socket_create", F_true); + controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_socket_create", F_true); } else if (global->main->program.output.verbosity == f_console_verbosity_debug_e) { controller_lock_print(global->main->program.output.to, global->thread); @@ -543,13 +543,13 @@ extern "C" { status = f_file_remove(global->setting->path_control); if (F_status_set_fine(status) == F_memory_not) { - controller_print_error(global->thread, global->main->program.error, F_status_set_fine(status), "f_file_remove", F_true); + controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_file_remove", F_true); return status; } } - global->setting->control.server.name = global->setting->path_control.string; + global->setting->control.server.name = global->setting->path_control; status = f_socket_bind(&global->setting->control.server); @@ -561,7 +561,7 @@ extern "C" { } if (F_status_set_fine(status) == F_memory_not) { - controller_print_error(global->thread, global->main->program.error, F_status_set_fine(status), "f_socket_bind", F_true); + controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_socket_bind", F_true); } else if (global->main->program.output.verbosity == f_console_verbosity_debug_e) { controller_lock_print(global->main->program.output.to, global->thread); @@ -589,7 +589,7 @@ extern "C" { } if (F_status_set_fine(status) == F_memory_not) { - controller_print_error(global->thread, global->main->program.error, F_status_set_fine(status), "f_file_role_change", F_true); + controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_file_role_change", F_true); } else if (global->main->program.output.verbosity == f_console_verbosity_debug_e) { controller_lock_print(global->main->program.output.to, global->thread); @@ -618,7 +618,7 @@ extern "C" { } if (F_status_set_fine(status) == F_memory_not) { - controller_print_error(global->thread, global->main->program.error, F_status_set_fine(status), "f_file_role_change", F_true); + controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_file_role_change", F_true); } else if (global->main->program.output.verbosity == f_console_verbosity_debug_e) { controller_lock_print(global->main->program.output.to, global->thread); @@ -668,7 +668,7 @@ extern "C" { } if (global->main->program.error.verbosity > f_console_verbosity_quiet_e) { - controller_print_error(global->thread, global->main->program.error, F_status_set_fine(status), "f_thread_create", F_true); + controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_thread_create", F_true); } } diff --git a/level_3/controller/c/controller/private-controller_print.c b/level_3/controller/c/controller/private-controller_print.c index 236b6de..bcc04a8 100644 --- a/level_3/controller/c/controller/private-controller_print.c +++ b/level_3/controller/c/controller/private-controller_print.c @@ -8,9 +8,9 @@ extern "C" { #endif #ifndef _di_controller_print_error_ - void controller_print_error(controller_thread_t * const thread, const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag) { + void controller_print_error(controller_thread_t * const thread, fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag) { - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; if (status == F_interrupt) return; // fll_error_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_lock_print(). @@ -18,7 +18,7 @@ extern "C" { f_thread_mutex_lock(&thread->lock.print); } - fll_error_print(&print, status, function, flag); // @fixme the print is a const and it is being passed as a pointer; the function needs to change. + fll_error_print(print, status, function, flag); if (thread) { f_thread_mutex_unlock(&thread->lock.print); @@ -27,9 +27,9 @@ extern "C" { #endif // _di_controller_print_error_ #ifndef _di_controller_print_error_file_ - void controller_print_error_file(controller_thread_t * const thread, const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { + void controller_print_error_file(controller_thread_t * const thread, fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; if (status == F_interrupt) return; // fll_error_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_lock_print(). @@ -37,7 +37,7 @@ extern "C" { f_thread_mutex_lock(&thread->lock.print); } - fll_error_file_print(&print, status, function, flag, name, operation, type); // @fixme the print is a const and it is being passed as a pointer; the function needs to change. + fll_error_file_print(print, status, function, flag, name, operation, type); if (thread) { f_thread_mutex_unlock(&thread->lock.print); diff --git a/level_3/controller/c/controller/private-controller_print.h b/level_3/controller/c/controller/private-controller_print.h index 49f9256..969751b 100644 --- a/level_3/controller/c/controller/private-controller_print.h +++ b/level_3/controller/c/controller/private-controller_print.h @@ -32,7 +32,7 @@ extern "C" { * @see fll_error_print() */ #ifndef _di_controller_print_error_ - extern void controller_print_error(controller_thread_t * const thread, const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag) F_attribute_visibility_internal_d; + extern void controller_print_error(controller_thread_t * const thread, fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag) F_attribute_visibility_internal_d; #endif // _di_controller_print_error_ /** @@ -61,7 +61,7 @@ extern "C" { * @see fll_error_file_print() */ #ifndef _di_controller_print_error_file_ - extern void controller_print_error_file(controller_thread_t * const thread, const fl_print_t print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) F_attribute_visibility_internal_d; + extern void controller_print_error_file(controller_thread_t * const thread, fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) F_attribute_visibility_internal_d; #endif // _di_controller_print_error_file_ #ifdef __cplusplus diff --git a/level_3/controller/c/entry/private-entry.c b/level_3/controller/c/entry/private-entry.c index dc7d060..7774e08 100644 --- a/level_3/controller/c/entry/private-entry.c +++ b/level_3/controller/c/entry/private-entry.c @@ -98,21 +98,21 @@ extern "C" { f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_okay, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0); f_range_t range = content_range; - status = fll_fss_extended_read(cache->buffer_file, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0, &state); + fll_fss_extended_read(cache->buffer_file, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0, &state); } if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, global.thread); return status; } f_state_t state = f_state_t_initialize; - status = f_fss_apply_delimit(state, cache->delimits, &cache->buffer_file); + f_fss_apply_delimit(cache->delimits, &cache->buffer_file, &state); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_apply_delimit", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_apply_delimit", F_true, global.thread); return status; } @@ -122,7 +122,7 @@ extern "C" { status = controller_entry_actions_increase_by(cache->object_actions.used, actions); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "controller_entry_actions_increase_by", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "controller_entry_actions_increase_by", F_true, global.thread); return status; } @@ -149,10 +149,10 @@ extern "C" { action->status = F_known_not; action->parameters.used = 0; - status = f_fss_count_lines(cache->buffer_file, cache->object_actions.array[i].start, &cache->action.line_action, &global->setting->state); + f_fss_count_lines(cache->buffer_file, cache->object_actions.array[i].start, &cache->action.line_action, &global.main->setting.state); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, global.thread); break; } @@ -162,7 +162,7 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->object_actions.array[i], &cache->action.name_action); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true, global.thread); break; } @@ -220,7 +220,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.warning.to, global.main->program.warning.notable, cache->action.name_action, global.main->program.warning.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.warning.to, global.main->program.warning.context, global.main->program.warning.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.warning, cache->action); + controller_entry_print_error_cache(is_entry, &global.main->program.warning, cache->action); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -307,7 +307,7 @@ extern "C" { status = f_memory_array_increase_by(allocate, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, global.thread); action->status = status; @@ -327,7 +327,7 @@ extern "C" { status = f_memory_array_increase_by((cache->content_actions.array[i].array[j].stop - cache->content_actions.array[i].array[j].start) + 1, sizeof(f_char_t), (void **) &action->parameters.array[j].string, &action->parameters.array[j].used, &action->parameters.array[j].size); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, global.thread); break; } @@ -335,7 +335,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_file, cache->content_actions.array[i].array[j], &action->parameters.array[j]); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, global.thread); break; } @@ -351,7 +351,7 @@ extern "C" { status = controller_path_canonical_relative(global.setting, action->parameters.array[0], &cache->buffer_path); if (F_status_is_error(status)) { - controller_entry_print_error_file(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "controller_path_canonical_relative", F_true, cache->action.generic, f_file_operation_analyze_s, fll_error_file_type_path_e, global.thread); + controller_entry_print_error_file(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "controller_path_canonical_relative", F_true, cache->action.generic, f_file_operation_analyze_s, fll_error_file_type_path_e, global.thread); action->status = status; @@ -384,7 +384,7 @@ extern "C" { status = f_file_name_base(action->parameters.array[1], &cache->buffer_path); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_file_name_base", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_file_name_base", F_true, global.thread); if (F_status_set_fine(status) == F_memory_not) { status_action = status; @@ -541,7 +541,7 @@ extern "C" { } if (F_status_set_fine(status) == F_memory_not) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_to_unsigned_detect", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_to_unsigned_detect", F_true, global.thread); status_action = status; @@ -627,10 +627,10 @@ extern "C" { cache->action.name_action.used = 0; cache->action.name_item.used = 0; - macro_f_number_unsigneds_t_increase_by(status, cache->ats, controller_common_allocation_small_d) + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &cache->ats.array, &cache->ats.used, &cache->ats.size); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "macro_f_number_unsigneds_t_increase_by", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, global.thread); return status; } @@ -643,10 +643,10 @@ extern "C" { cache->action.line_item = entry->items.array[0].line; cache->action.name_item.used = 0; - status = f_string_dynamic_append_nulless(entry->items.array[0].key, &cache->action.name_item); + status = f_string_dynamic_append_nulless(entry->items.array[0].name, &cache->action.name_item); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true, global.thread); return status; } @@ -663,7 +663,7 @@ extern "C" { status2 = f_string_dynamic_append_nulless(controller_entry_action_type_name(actions->array[cache->ats.array[at_j]].type), &cache->action.name_action); if (F_status_is_error(status2)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status2), "f_string_dynamic_append_nulless", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status2), "f_string_dynamic_append_nulless", F_true, global.thread); return status2; } @@ -678,7 +678,7 @@ extern "C" { fl_print_format(f_string_format_r_single_s.string, global.main->program.warning.to, global.main->program.warning.notable, controller_ready_s, global.main->program.warning.notable); fl_print_format("%[' %r item actions detected; only the first will be used.%]%r", global.main->program.warning.to, global.main->program.warning.context, is_entry ? controller_entry_s : controller_exit_s, global.main->program.warning.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.warning, cache->action); + controller_entry_print_error_cache(is_entry, &global.main->program.warning, cache->action); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -701,7 +701,7 @@ extern "C" { // Walk though each items and check to see if the item actually exists. for (i = 1; i < entry->items.used && controller_thread_is_enabled(is_entry, global.thread); ++i) { - if (f_compare_dynamic(entry->items.array[i].key, actions->array[cache->ats.array[at_j]].parameters.array[0]) == F_equal_to) { + if (f_compare_dynamic(entry->items.array[i].name, actions->array[cache->ats.array[at_j]].parameters.array[0]) == F_equal_to) { // Check to see if "i" is already in the stack (to prevent recursion) (skipping main). for (j = 2; j < cache->ats.used; j += 2) { @@ -711,10 +711,10 @@ extern "C" { controller_lock_print(global.main->program.error.to, global.thread); fl_print_format("%r%[%QThe %r item named '%]", global.main->program.error.to, f_string_eol_s, global.main->program.error.context, is_entry ? controller_entry_s : controller_exit_s, global.main->program.error.prefix, global.main->program.error.context); - fl_print_format(f_string_format_Q_single_s.string, global.main->program.error.to, global.main->program.error.notable, entry->items.array[i].key, global.main->program.error.notable); + fl_print_format(f_string_format_Q_single_s.string, global.main->program.error.to, global.main->program.error.notable, entry->items.array[i].name, global.main->program.error.notable); fl_print_format("%[' cannot be executed because recursion is not allowed.%]%r", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global.main->program.error, cache->action); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -730,10 +730,10 @@ extern "C" { if (error_has) break; - macro_f_number_unsigneds_t_increase_by(status2, cache->ats, controller_common_allocation_small_d) + status2 = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &cache->ats.array, &cache->ats.used, &cache->ats.size); if (F_status_is_error(status2)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status2), "macro_f_number_unsigneds_t_increase_by", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status2), "f_memory_array_increase", F_true, global.thread); return status2; } @@ -755,10 +755,10 @@ extern "C" { cache->action.name_item.used = 0; cache->action.line_item = entry->items.array[i].line; - status2 = f_string_dynamic_append_nulless(entry->items.array[i].key, &cache->action.name_item); + status2 = f_string_dynamic_append_nulless(entry->items.array[i].name, &cache->action.name_item); if (F_status_is_error(status2)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status2), "f_string_dynamic_append_nulless", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status2), "f_string_dynamic_append_nulless", F_true, global.thread); return status2; } @@ -776,7 +776,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.error.to, global.main->program.error.notable, actions->array[cache->ats.array[at_j]].parameters.array[0], global.main->program.error.notable); fl_print_format("%[' does not exist.%]%r", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global.main->program.error, cache->action); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -813,7 +813,7 @@ extern "C" { status2 = f_string_dynamic_append_nulless(entry->items.array[cache->ats.array[at_i]].name, &cache->action.name_item); if (F_status_is_error(status2)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status2), "f_string_dynamic_append_nulless", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status2), "f_string_dynamic_append_nulless", F_true, global.thread); return status2; } @@ -860,10 +860,10 @@ extern "C" { cache->action.name_action.used = 0; cache->action.name_item.used = 0; - macro_f_number_unsigneds_t_increase_by(status, cache->ats, controller_common_allocation_small_d) + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &cache->ats.array, &cache->ats.used, &cache->ats.size); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global->main->program.error, cache->action, F_status_set_fine(status), "macro_f_number_unsigneds_t_increase_by", F_true, global->thread); + controller_entry_print_error(is_entry, &global->main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, global->thread); return status; } @@ -879,7 +879,7 @@ extern "C" { status = f_string_dynamic_append_nulless(entry->items.array[cache->ats.array[0]].name, &cache->action.name_item); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global->main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true, global->thread); + controller_entry_print_error(is_entry, &global->main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true, global->thread); return status; } @@ -915,7 +915,7 @@ extern "C" { status = f_string_dynamic_append_nulless(controller_entry_action_type_name(entry_action->type), &cache->action.name_action); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global->main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true, global->thread); + controller_entry_print_error(is_entry, &global->main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true, global->thread); return status; } @@ -931,7 +931,7 @@ extern "C" { if (entry_action->parameters.used) { fl_print_format(" %[", global->main->program.output.to, global->main->program.context.set.notable); - controller_entry_action_parameters_print(global->main->program.output.to, *entry_action); + controller_entry_action_parameters_print(&global->main->program.output, *entry_action); fl_print_format("%]", global->main->program.output.to, global->main->program.context.set.notable); } @@ -945,49 +945,49 @@ extern "C" { } else { if ((entry_action->code & controller_entry_rule_code_require_d) && global->main->program.error.verbosity > f_console_verbosity_quiet_e || !(entry_action->code & controller_entry_rule_code_require_d) && (global->main->program.warning.verbosity == f_console_verbosity_verbose_e || global->main->program.warning.verbosity == f_console_verbosity_debug_e)) { - fl_print_t *output = 0; + fl_print_t *print = 0; if (entry_action->code & controller_entry_rule_code_require_d) { - output = &global->main->program.error; + print = &global->main->program.error; } else if (global->main->program.error.verbosity != f_console_verbosity_error_e) { - output = &global->main->program.warning; + print = &global->main->program.warning; } - if (output) { - controller_lock_print(output->to, global->thread); + if (print) { + controller_lock_print(print->to, global->thread); - fl_print_format("%r%[%QThe %r item action '%]", output->to, f_string_eol_s, output->context, output->prefix, is_entry ? controller_entry_s : controller_exit_s, output->context); - fl_print_format(f_string_format_Q_single_s.string, output->to, output->notable, cache->action.name_action, output->notable); + fl_print_format("%r%[%QThe %r item action '%]", print->to, 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, print->notable, cache->action.name_action, print->notable); if (entry_action->parameters.used) { - fl_print_format(" %[", output->to, global->main->program.context.set.notable); + fl_print_format(" %[", print->to, global->main->program.context.set.notable); - controller_entry_action_parameters_print(output->to, *entry_action); + controller_entry_action_parameters_print(print, *entry_action); - fl_print_format("%]", output->to, global->main->program.context.set.notable); + fl_print_format("%]", print->to, global->main->program.context.set.notable); } if (entry_action->code & controller_entry_rule_code_require_d) { - fl_print_format("%[' is%] %[required%]", output->to, output->context, output->context, output->notable, output->notable); + fl_print_format("%[' is%] %[required%]", print->to, print->context, print->context, print->notable, print->notable); } else { - fl_print_format("%[' is%] %[optional%]", output->to, output->context, output->context, output->notable, output->notable); + fl_print_format("%[' is%] %[optional%]", print->to, print->context, print->context, print->notable, print->notable); } - fl_print_format(" %[and is in a%] %[failed%]", output->to, output->context, output->context, output->notable, output->notable); + fl_print_format(" %[and is in a%] %[failed%]", print->to, print->context, print->context, print->notable, print->notable); if (entry_action->code & controller_entry_rule_code_require_d) { - fl_print_format(" %[state, aborting.%]%r", output->to, output->context, output->context, f_string_eol_s); + fl_print_format(" %[state, aborting.%]%r", print->to, print->context, print->context, f_string_eol_s); } else { - fl_print_format(" %[state, skipping.%]%r", output->to, output->context, output->context, f_string_eol_s); + fl_print_format(" %[state, skipping.%]%r", print->to, print->context, print->context, f_string_eol_s); } - controller_entry_print_error_cache(is_entry, *output, cache->action); + controller_entry_print_error_cache(is_entry, print, cache->action); - controller_unlock_print_flush(output->to, global->thread); + controller_unlock_print_flush(print->to, global->thread); } } @@ -1054,7 +1054,7 @@ extern "C" { fl_print_format("%[%un%]", global->main->program.error.to, global->main->program.error.notable, entry_action->number, global->main->program.error.notable); fl_print_format("%[' detected.%]%r", global->main->program.error.to, global->main->program.error.context, global->main->program.error.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global->main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global->main->program.error, cache->action); controller_unlock_print_flush(global->main->program.error.to, global->thread); } @@ -1062,10 +1062,10 @@ extern "C" { return F_status_is_error(F_critical); } - macro_f_number_unsigneds_t_increase_by(status, cache->ats, controller_common_allocation_small_d) + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &cache->ats.array, &cache->ats.used, &cache->ats.size); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global->main->program.error, cache->action, F_status_set_fine(status), "macro_f_number_unsigneds_t_increase_by", F_true, global->thread); + controller_entry_print_error(is_entry, &global->main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, global->thread); return status; } @@ -1088,7 +1088,7 @@ extern "C" { status = f_string_dynamic_append_nulless(entry->items.array[cache->ats.array[at_i]].name, &cache->action.name_item); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global->main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true, global->thread); + controller_entry_print_error(is_entry, &global->main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true, global->thread); return status; } @@ -1112,7 +1112,7 @@ extern "C" { status_lock = controller_lock_write(is_entry, global->thread, &global->thread->lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global->main->program.error, F_status_set_fine(status_lock), F_false, global->thread); + controller_lock_print_error_critical(&global->main->program.error, F_status_set_fine(status_lock), F_false, global->thread); break; } @@ -1122,7 +1122,7 @@ extern "C" { f_thread_unlock(&global->thread->lock.rule); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global->main->program.error, cache->action, F_status_set_fine(status), "controller_rules_increase", F_true, global->thread); + controller_entry_print_error(is_entry, &global->main->program.error, cache->action, F_status_set_fine(status), "controller_rules_increase", F_true, global->thread); return status; } @@ -1140,7 +1140,7 @@ extern "C" { status_lock = controller_lock_read(is_entry, global->thread, &global->thread->lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global->main->program.error, F_status_set_fine(status_lock), F_true, global->thread); + controller_lock_print_error_critical(&global->main->program.error, F_status_set_fine(status_lock), F_true, global->thread); break; } @@ -1218,7 +1218,7 @@ extern "C" { cache->action.line_item = cache_line_item; if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global->main->program.error, F_status_set_fine(status_lock), F_false, global->thread); + controller_lock_print_error_critical(&global->main->program.error, F_status_set_fine(status_lock), F_false, global->thread); break; } @@ -1233,7 +1233,7 @@ extern "C" { if (global->main->program.error.verbosity > f_console_verbosity_quiet_e) { controller_lock_print(global->main->program.error.to, global->thread); - controller_entry_print_error_cache(is_entry, global->main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global->main->program.error, cache->action); controller_unlock_print_flush(global->main->program.error.to, global->thread); } @@ -1343,13 +1343,13 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global->main->program.error.to, global->main->program.error.notable, entry_action->parameters.array[0], global->main->program.error.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global->main->program.error.to, global->main->program.error.context, global->main->program.error.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global->main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global->main->program.error, cache->action); controller_unlock_print_flush(global->main->program.error.to, global->thread); } } else { - controller_entry_print_error(is_entry, global->main->program.error, cache->action, F_status_set_fine(status), "fll_execute_into", F_true, global->thread); + controller_entry_print_error(is_entry, &global->main->program.error, cache->action, F_status_set_fine(status), "fll_execute_into", F_true, global->thread); } return F_status_set_error(F_execute); @@ -1362,7 +1362,7 @@ extern "C" { fl_print_format("%[%i%]", global->main->program.error.to, global->main->program.error.notable, result, global->main->program.error.notable); fl_print_format("$['.%]%r", global->main->program.error.to, global->main->program.error.context, global->main->program.error.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global->main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global->main->program.error, cache->action); controller_unlock_print_flush(global->main->program.error.to, global->thread); } @@ -1402,7 +1402,7 @@ extern "C" { fl_print_format("%r%[%QFailsafe may not be specified when running in failsafe, ignoring.%]%r", global->main->program.warning.to, f_string_eol_s, global->main->program.warning.context, global->main->program.warning.prefix, global->main->program.warning.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global->main->program.warning, cache->action); + controller_entry_print_error_cache(is_entry, &global->main->program.warning, cache->action); controller_unlock_print_flush(global->main->program.warning.to, global->thread); } @@ -1418,7 +1418,7 @@ extern "C" { fl_print_format("%[%un%]", global->main->program.error.to, global->main->program.error.notable, entry_action->number, global->main->program.error.notable); fl_print_format("%[' detected.%]%r", global->main->program.error.to, global->main->program.error.context, global->main->program.error.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global->main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global->main->program.error, cache->action); controller_unlock_print_flush(global->main->program.error.to, global->thread); } @@ -1464,7 +1464,7 @@ extern "C" { status = f_string_dynamic_append_nulless(entry->items.array[cache->ats.array[at_i]].name, &cache->action.name_item); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global->main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true, global->thread); + controller_entry_print_error(is_entry, &global->main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true, global->thread); break; } @@ -1519,7 +1519,7 @@ extern "C" { entry->status = F_known_not; entry->items.used = 0; - if (global.main->as_init) { + if (global.main->setting.flag & controller_main_flag_init_e) { entry->session = controller_entry_session_new_e; } else { @@ -1578,16 +1578,16 @@ extern "C" { f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_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); - status = fll_fss_basic_list_read(cache->buffer_file, state, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments); + fll_fss_basic_list_read(cache->buffer_file, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fll_fss_basic_list_read", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fll_fss_basic_list_read", F_true); } else { - status = f_fss_apply_delimit(state, cache->delimits, &cache->buffer_file); + f_fss_apply_delimit(cache->delimits, &cache->buffer_file, &state); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_apply_delimit", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_apply_delimit", F_true, global.thread); } } } @@ -1608,7 +1608,7 @@ extern "C" { status = controller_entry_items_increase_by(cache->object_items.used, &entry->items); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "controller_entry_items_increase_by", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "controller_entry_items_increase_by", F_true, global.thread); } else { @@ -1651,7 +1651,7 @@ extern "C" { status = controller_entry_items_increase_by(controller_common_allocation_small_d, &entry->items); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "controller_entry_items_increase_by", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "controller_entry_items_increase_by", F_true, global.thread); break; } @@ -1659,15 +1659,15 @@ extern "C" { status = f_string_dynamic_partial_append(cache->buffer_file, cache->object_items.array[i], &cache->action.name_item); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append", F_true, global.thread); break; } - status = f_fss_count_lines(cache->buffer_file, cache->object_items.array[i].start, &cache->action.line_item, &global.main->setting.state); + f_fss_count_lines(cache->buffer_file, cache->object_items.array[i].start, &cache->action.line_item, &global.main->setting.state); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, global.thread); break; } @@ -1684,7 +1684,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.warning.to, global.main->program.warning.notable, cache->action.name_file, global.main->program.warning.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.warning.to, global.main->program.warning.context, global.main->program.warning.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.warning, cache->action); + controller_entry_print_error_cache(is_entry, &global.main->program.warning, cache->action); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -1719,7 +1719,7 @@ extern "C" { else { // skip position 0, which is reserved for "main". - entry->items.array[0].key.used = 0; + entry->items.array[0].name.used = 0; at = 1; entry->items.used = 2; @@ -1730,7 +1730,7 @@ extern "C" { status = f_string_dynamic_append_nulless(cache->action.name_item, &entry->items.array[at].name); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); break; } @@ -1741,7 +1741,7 @@ extern "C" { if (F_status_set_fine(status) != F_interrupt) { controller_lock_print(global.main->program.error.to, global.thread); - controller_entry_print_error_cache(is_entry, global.main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global.main->program.error, cache->action); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -1813,10 +1813,10 @@ extern "C" { cache->action.line_action = action->line; cache->action.line_item = entry->items.array[i].line; - status = f_string_dynamic_append_nulless(entry->items.array[i].key, &cache->action.name_item); + status = f_string_dynamic_append_nulless(entry->items.array[i].name, &cache->action.name_item); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); break; } @@ -1828,7 +1828,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.error.to, global.main->program.error.notable, action->parameters.array[0], global.main->program.error.notable); fl_print_format("%[' does not exist.%]%r", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global.main->program.error, cache->action); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -1852,7 +1852,7 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) != F_interrupt) { - controller_entry_print_error_cache(is_entry, global.main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global.main->program.error, cache->action); } entry->status = controller_status_simplify_error(F_status_set_fine(status)); @@ -1875,11 +1875,11 @@ extern "C" { f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_okay, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0); f_range_t range = content_range; - status = fll_fss_extended_read(cache->buffer_file, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0, &state); + fll_fss_extended_read(cache->buffer_file, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0, &state); } if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, global.thread); return status; } @@ -1887,11 +1887,11 @@ extern "C" { { f_state_t state = f_state_t_initialize; - status = f_fss_apply_delimit(state, cache->delimits, &cache->buffer_file); + f_fss_apply_delimit(cache->delimits, &cache->buffer_file, &state); } if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_apply_delimit", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_apply_delimit", F_true, global.thread); return status; } @@ -1907,10 +1907,10 @@ extern "C" { cache->action.line_action = 0; - status = f_fss_count_lines(cache->buffer_file, cache->object_actions.array[i].start, &cache->action.line_action, &global->setting->state); + f_fss_count_lines(cache->buffer_file, cache->object_actions.array[i].start, &cache->action.line_action, &global.main->setting.state); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, global.thread); break; } @@ -1921,7 +1921,7 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->object_actions.array[i], &cache->action.name_action); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true, global.thread); break; } @@ -1949,7 +1949,7 @@ extern "C" { fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.error, cache->action); + controller_entry_print_error_cache(is_entry, &global.main->program.error, cache->action); controller_unlock_print_flush(global.main->program.error.to, global.thread); @@ -1967,7 +1967,7 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->content_actions.array[i].array[0], &cache->action.generic); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true, global.thread); break; } @@ -1977,7 +1977,7 @@ extern "C" { status = controller_path_canonical_relative(global.setting, cache->action.generic, &global.setting->path_control); if (F_status_is_error(status)) { - controller_entry_print_error_file(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "controller_path_canonical_relative", F_true, cache->action.generic, f_file_operation_analyze_s, fll_error_file_type_path_e, global.thread); + controller_entry_print_error_file(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "controller_path_canonical_relative", F_true, cache->action.generic, f_file_operation_analyze_s, fll_error_file_type_path_e, global.thread); continue; } @@ -1991,16 +1991,16 @@ extern "C" { status = F_status_set_fine(status); if (status == F_exist_not) { - controller_entry_setting_read_print_error_with_range(is_entry, global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[0], ", because no group was found by that name", global.thread, cache); + controller_entry_setting_read_print_error_with_range(is_entry, &global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[0], ", because no group was found by that name", global.thread, cache); } else if (status == F_number_too_large) { - controller_entry_setting_read_print_error_with_range(is_entry, global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[0], ", because the given ID is too large", global.thread, cache); + controller_entry_setting_read_print_error_with_range(is_entry, &global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[0], ", because the given ID is too large", global.thread, cache); } else if (status == F_number) { - controller_entry_setting_read_print_error_with_range(is_entry, global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number", global.thread, cache); + controller_entry_setting_read_print_error_with_range(is_entry, &global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number", global.thread, cache); } else { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "controller_get_id_group", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "controller_get_id_group", F_true, global.thread); } continue; @@ -2019,15 +2019,15 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->content_actions.array[i].array[0], &cache->action.generic); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true, global.thread); break; } - status = f_file_mode_from_string(cache->action.generic, global.main->umask, &mode_file, &replace); + status = f_file_mode_from_string(cache->action.generic, global.main->program.umask, &mode_file, &replace); if (F_status_is_error(status)) { - controller_entry_setting_read_print_error_with_range(is_entry, global.main->program.error, " has an unsupported mode", cache->content_actions.array[i].array[0], ", because the format is unknown or contains invalid data", global.thread, cache); + controller_entry_setting_read_print_error_with_range(is_entry, &global.main->program.error, " has an unsupported mode", cache->content_actions.array[i].array[0], ", because the format is unknown or contains invalid data", global.thread, cache); continue; } @@ -2035,7 +2035,7 @@ extern "C" { status = f_file_mode_to_mode(mode_file, &mode); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_file_mode_to_mode", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_file_mode_to_mode", F_true, global.thread); continue; } @@ -2052,16 +2052,16 @@ extern "C" { status = F_status_set_fine(status); if (status == F_exist_not) { - controller_entry_setting_read_print_error_with_range(is_entry, global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because no user was found by that name", global.thread, cache); + controller_entry_setting_read_print_error_with_range(is_entry, &global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because no user was found by that name", global.thread, cache); } else if (status == F_number_too_large) { - controller_entry_setting_read_print_error_with_range(is_entry, global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is too large", global.thread, cache); + controller_entry_setting_read_print_error_with_range(is_entry, &global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is too large", global.thread, cache); } else if (status == F_number) { - controller_entry_setting_read_print_error_with_range(is_entry, global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number", global.thread, cache); + controller_entry_setting_read_print_error_with_range(is_entry, &global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number", global.thread, cache); } else { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "controller_get_id_user", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "controller_get_id_user", F_true, global.thread); } continue; @@ -2080,7 +2080,7 @@ extern "C" { status = controller_entry_settings_read_map(cache->buffer_file, cache->content_actions.array[i], &entry->define); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "controller_entry_settings_read_map", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "controller_entry_settings_read_map", F_true, global.thread); continue; } @@ -2117,7 +2117,7 @@ extern "C" { status = controller_entry_settings_read_map(cache->buffer_file, cache->content_actions.array[i], &entry->parameter); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "controller_entry_settings_read_map", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "controller_entry_settings_read_map", F_true, global.thread); continue; } @@ -2160,7 +2160,7 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->content_actions.array[i].array[0], &cache->action.generic); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true, global.thread); continue; } @@ -2170,7 +2170,7 @@ extern "C" { status = controller_path_canonical_relative(global.setting, cache->action.generic, &global.setting->path_pid); if (F_status_is_error(status)) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "controller_path_canonical_relative", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "controller_path_canonical_relative", F_true, global.thread); continue; } @@ -2277,7 +2277,7 @@ extern "C" { *time = time_previous; if (F_status_set_fine(status) == F_memory_not) { - controller_entry_print_error(is_entry, global.main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_unsigned_detect", F_true, global.thread); + controller_entry_print_error(is_entry, &global.main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_unsigned_detect", F_true, global.thread); continue; } @@ -2563,7 +2563,7 @@ extern "C" { for (i = 0; i < entry->items.used; ++i) { - fl_print_format("%r%Q %Q %[%Q%] {%r", global.main->program.output.to, f_string_eol_s, is_entry ? controller_Entry_s : controller_Exit_s, controller_Item_s, global.main->program.context.set.title, entry->items.array[i].key, global.main->program.context.set.title, f_string_eol_s); + fl_print_format("%r%Q %Q %[%Q%] {%r", global.main->program.output.to, f_string_eol_s, is_entry ? controller_Entry_s : controller_Exit_s, controller_Item_s, global.main->program.context.set.title, entry->items.array[i].name, global.main->program.context.set.title, f_string_eol_s); for (j = 0; j < entry->items.array[i].actions.used; ++j) { diff --git a/level_3/controller/c/entry/private-entry_print.c b/level_3/controller/c/entry/private-entry_print.c index 90fc365..0dd28b2 100644 --- a/level_3/controller/c/entry/private-entry_print.c +++ b/level_3/controller/c/entry/private-entry_print.c @@ -15,17 +15,17 @@ extern "C" { #endif // _di_controller_entry_print_string_s_ #ifndef _di_controller_entry_action_parameters_print_ - void controller_entry_action_parameters_print(FILE * const stream, const controller_entry_action_t action) { + void controller_entry_action_parameters_print(fl_print_t * const print, const controller_entry_action_t action) { for (f_number_unsigned_t index = 0; ;) { - f_print_dynamic_safely(action.parameters.array[index], stream); + f_print_dynamic_safely(action.parameters.array[index], print->to); ++index; if (index == action.parameters.used) break; - f_print_dynamic_raw(f_string_space_s, stream); + f_print_dynamic_raw(f_string_space_s, print->to); } // for } #endif // _di_controller_entry_action_parameters_print_ @@ -59,87 +59,87 @@ extern "C" { #endif // _di_controller_entry_preprocess_print_simulate_setting_value_ #ifndef _di_controller_entry_print_error_ - void controller_entry_print_error(const bool is_entry, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) { + void controller_entry_print_error(const bool is_entry, fl_print_t * const print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) { - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; if (status == F_interrupt) return; // fll_error_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_lock_print(). f_thread_mutex_lock(&thread->lock.print); - fll_error_print(&print, status, function, fallback); // @fixme the print is a const and it is being passed as a pointer; the function needs to change. + fll_error_print(print, status, function, fallback); - f_file_stream_lock(print.to); + f_file_stream_lock(print->to); controller_entry_print_error_cache(is_entry, print, cache); - controller_unlock_print_flush(print.to, thread); + controller_unlock_print_flush(print->to, thread); } #endif // _di_controller_entry_print_error_ #ifndef _di_controller_entry_print_error_cache_ - void controller_entry_print_error_cache(const bool is_entry, const fl_print_t output, const controller_cache_action_t cache) { + void controller_entry_print_error_cache(const bool is_entry, fl_print_t * const print, const controller_cache_action_t cache) { - fl_print_format("%r%[%QWhile processing ", output.to, f_string_eol_s, output.context, output.prefix); + fl_print_format("%r%[%QWhile processing ", print->to, f_string_eol_s, print->context, print->prefix); if (cache.name_action.used) { - fl_print_format("action '%]", output.to, output.context); - fl_print_format(f_string_format_Q_single_s.string, output.to, output.notable, cache.name_action, output.notable); - fl_print_format("%[' on line%] ", output.to, output.context, output.context); - fl_print_format("%[%un%]", output.to, output.notable, cache.line_action, output.notable); - fl_print_format("%[ for ", output.to, output.context); + fl_print_format("action '%]", print->to, print->context); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache.name_action, print->notable); + fl_print_format("%[' on line%] ", print->to, print->context, print->context); + fl_print_format("%[%un%]", print->to, print->notable, cache.line_action, print->notable); + fl_print_format("%[ for ", print->to, print->context); } if (cache.name_item.used) { - fl_print_format("%r item '%]", output.to, is_entry ? controller_entry_s : controller_exit_s, output.context); - fl_print_format(f_string_format_Q_single_s.string, output.to, output.notable, cache.name_item, output.notable); - fl_print_format("%[' on line%] ", output.to, output.context, output.context); - fl_print_format("%[%un%]", output.to, output.notable, cache.line_item, output.notable); - fl_print_format("%[ for ", output.to, output.context); + fl_print_format("%r item '%]", print->to, is_entry ? controller_entry_s : controller_exit_s, print->context); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache.name_item, print->notable); + fl_print_format("%[' on line%] ", print->to, print->context, print->context); + fl_print_format("%[%un%]", print->to, print->notable, cache.line_item, print->notable); + fl_print_format("%[ for ", print->to, print->context); } if (cache.name_file.used) { - fl_print_format("%r file '%]", output.to, is_entry ? controller_entry_s : controller_exit_s, output.context); - fl_print_format("%[%Q%]%['", output.to, output.notable, cache.name_file, output.notable, output.context); + fl_print_format("%r file '%]", print->to, is_entry ? controller_entry_s : controller_exit_s, print->context); + fl_print_format("%[%Q%]%['", print->to, print->notable, cache.name_file, print->notable, print->context); } - fl_print_format(".%]%r", output.to, output.context, f_string_eol_s); + fl_print_format(".%]%r", print->to, print->context, f_string_eol_s); } #endif // _di_controller_entry_print_error_cache_ #ifndef _di_controller_entry_print_error_file_ - void controller_entry_print_error_file(const bool is_entry, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, controller_thread_t *thread) { + void controller_entry_print_error_file(const bool is_entry, fl_print_t * const print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, controller_thread_t *thread) { - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; if (status == F_interrupt) return; // fll_error_file_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_lock_print(). f_thread_mutex_lock(&thread->lock.print); - fll_error_file_print(&print, status, function, flag, name, operation, type); // @fixme the print is a const and it is being passed as a pointer; the function needs to change. + fll_error_file_print(print, status, function, flag, name, operation, type); - f_file_stream_lock(print.to); + f_file_stream_lock(print->to); controller_entry_print_error_cache(is_entry, print, cache); - controller_unlock_print_flush(print.to, thread); + controller_unlock_print_flush(print->to, thread); } #endif // _di_controller_entry_print_error_file_ #ifndef _di_controller_entry_setting_read_print_error_with_range_ - void controller_entry_setting_read_print_error_with_range(const bool is_entry, const fl_print_t print, const f_string_t before, const f_range_t range, const f_string_t after, controller_thread_t * const thread, controller_cache_t * const cache) { + void controller_entry_setting_read_print_error_with_range(const bool is_entry, fl_print_t * const print, const f_string_t before, const f_range_t range, const f_string_t after, controller_thread_t * const thread, controller_cache_t * const cache) { - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; - controller_lock_print(print.to, thread); + controller_lock_print(print->to, thread); - fl_print_format("%r%[%Q%r setting%S '%]", print.to, f_string_eol_s, print.context, print.prefix, is_entry ? controller_Entry_s : controller_Exit_s, before, print.context); - fl_print_format(f_string_format_Q_range_single_s.string, print.to, print.notable, cache->buffer_file, range, print.notable); - fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); + fl_print_format("%r%[%Q%r setting%S '%]", print->to, f_string_eol_s, print->context, print->prefix, is_entry ? controller_Entry_s : controller_Exit_s, before, print->context); + fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->notable, cache->buffer_file, range, print->notable); + fl_print_format("%['%S.%]%r", print->to, print->context, after, print->context, f_string_eol_s); controller_entry_print_error_cache(is_entry, print, cache->action); - controller_unlock_print_flush(print.to, thread); + controller_unlock_print_flush(print->to, thread); } #endif // _di_controller_entry_setting_read_print_error_with_range_ @@ -154,7 +154,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.warning.to, global.main->program.warning.notable, cache.action.name_action, global.main->program.warning.notable); fl_print_format("%[' is being ignored.%]%r", global.main->program.warning.to, global.main->program.warning.context, global.main->program.warning.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.warning, cache.action); + controller_entry_print_error_cache(is_entry, &global.main->program.warning, cache.action); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -175,7 +175,7 @@ extern "C" { fl_print_format("%[%un%]", global.main->program.error.to, global.main->program.error.notable, maximum, global.main->program.error.notable); fl_print_format("%[ Content.%]%r", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.error, cache.action); + controller_entry_print_error_cache(is_entry, &global.main->program.error, cache.action); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -194,7 +194,7 @@ extern "C" { fl_print_format("%[%un%]", global.main->program.error.to, global.main->program.error.notable, total, global.main->program.error.notable); fl_print_format("%[ Content.%]%r", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.error, cache.action); + controller_entry_print_error_cache(is_entry, &global.main->program.error, cache.action); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -211,7 +211,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.warning.to, global.main->program.warning.notable, cache.action.name_action, global.main->program.warning.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.warning.to, global.main->program.warning.context, global.main->program.warning.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.warning, cache.action); + controller_entry_print_error_cache(is_entry, &global.main->program.warning, cache.action); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -230,7 +230,7 @@ extern "C" { fl_print_format(f_string_format_Q_range_single_s.string, global.main->program.warning.to, global.main->program.warning.notable, cache.buffer_file, cache.content_actions.array[index].array[0], global.main->program.warning.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.warning.to, global.main->program.warning.context, global.main->program.warning.context, f_string_eol_s); - controller_entry_print_error_cache(is_entry, global.main->program.warning, cache.action); + controller_entry_print_error_cache(is_entry, &global.main->program.warning, cache.action); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } diff --git a/level_3/controller/c/entry/private-entry_print.h b/level_3/controller/c/entry/private-entry_print.h index adb6297..7baddc5 100644 --- a/level_3/controller/c/entry/private-entry_print.h +++ b/level_3/controller/c/entry/private-entry_print.h @@ -35,13 +35,13 @@ extern "C" { /** * Print all parameters for some action, separated by a space. * - * @param stream - * The file stream to print to. + * @param print + * The print to use. * @param action * The entry action whose parameters will be printed. */ #ifndef _di_controller_entry_action_parameters_print_ - extern void controller_entry_action_parameters_print(FILE * const stream, const controller_entry_action_t action) F_attribute_visibility_internal_d; + extern void controller_entry_action_parameters_print(fl_print_t * const print, const controller_entry_action_t action) F_attribute_visibility_internal_d; #endif // _di_controller_entry_action_parameters_print_ /** @@ -91,7 +91,7 @@ extern "C" { * @see controller_entry_print_error_cache() */ #ifndef _di_controller_entry_print_error_ - extern void controller_entry_print_error(const bool is_entry, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) F_attribute_visibility_internal_d; + extern void controller_entry_print_error(const bool is_entry, fl_print_t * const print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) F_attribute_visibility_internal_d; #endif // _di_controller_entry_print_error_ /** @@ -104,7 +104,7 @@ extern "C" { * @param is_entry * If TRUE, then this loads as an entry. * If FALSE, then this loads as an exit. - * @param output + * @param print * Designates how printing is to be performed. * @param cache * The action cache. @@ -113,7 +113,7 @@ extern "C" { * @see controller_entry_read() */ #ifndef _di_controller_entry_print_error_cache_ - extern void controller_entry_print_error_cache(const bool is_entry, const fl_print_t output, const controller_cache_action_t cache) F_attribute_visibility_internal_d; + extern void controller_entry_print_error_cache(const bool is_entry, fl_print_t * const print, const controller_cache_action_t cache) F_attribute_visibility_internal_d; #endif // _di_controller_entry_print_error_cache_ /** @@ -147,7 +147,7 @@ extern "C" { * @see controller_entry_print_error_cache() */ #ifndef _di_controller_entry_print_error_file_ - extern void controller_entry_print_error_file(const bool is_entry, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, controller_thread_t *thread) F_attribute_visibility_internal_d; + extern void controller_entry_print_error_file(const bool is_entry, fl_print_t * const print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const uint8_t flag, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, controller_thread_t *thread) F_attribute_visibility_internal_d; #endif // _di_controller_entry_print_error_file_ /** @@ -175,7 +175,7 @@ extern "C" { * @see controller_entry_settings_read() */ #ifndef _di_controller_entry_setting_read_print_error_with_range_ - extern void controller_entry_setting_read_print_error_with_range(const bool is_entry, const fl_print_t print, const f_string_t before, const f_range_t range, const f_string_t after, controller_thread_t * const thread, controller_cache_t * const cache) F_attribute_visibility_internal_d; + extern void controller_entry_setting_read_print_error_with_range(const bool is_entry, fl_print_t * const print, const f_string_t before, const f_range_t range, const f_string_t after, controller_thread_t * const thread, controller_cache_t * const cache) F_attribute_visibility_internal_d; #endif // _di_controller_entry_setting_read_print_error_with_range_ /** diff --git a/level_3/controller/c/lock/private-lock_print.c b/level_3/controller/c/lock/private-lock_print.c index b0b9bb9..65895bd 100644 --- a/level_3/controller/c/lock/private-lock_print.c +++ b/level_3/controller/c/lock/private-lock_print.c @@ -7,38 +7,38 @@ extern "C" { #endif #ifndef _di_controller_lock_print_error_critical_ - void controller_lock_print_error_critical(const fl_print_t print, const f_status_t status, const bool read, controller_thread_t *thread) { + void controller_lock_print_error_critical(fl_print_t * const print, const f_status_t status, const bool read, controller_thread_t *thread) { // A signal is not an error. if (status == F_interrupt) return; - if (print.verbosity != f_console_verbosity_quiet_e) { - controller_lock_print(print.to, thread); + if (print->verbosity != f_console_verbosity_quiet_e) { + controller_lock_print(print->to, thread); - fl_print_format("%r%[%QThe pid file '%]", print.to, f_string_eol_s, print.context, print.prefix, print.context); - fl_print_format("%['Critical failure while attempting to establish '%]", print.to, print.context, print.context); - fl_print_format("%[%r lock%]", print.to, print.notable, read ? f_file_operation_read_s : f_file_operation_write_s, print.notable); + fl_print_format("%r%[%QThe pid file '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context); + fl_print_format("%['Critical failure while attempting to establish '%]", print->to, print->context, print->context); + fl_print_format("%[%r lock%]", print->to, print->notable, read ? f_file_operation_read_s : f_file_operation_write_s, print->notable); if (status != F_failure) { - fl_print_format(" %['due to%] ", print.to, print.context, print.context); + fl_print_format(" %['due to%] ", print->to, print->context, print->context); if (status == F_parameter) { - fl_print_format("%[Invalid Parameter%]", print.to, print.notable, print.notable); + fl_print_format("%[Invalid Parameter%]", print->to, print->notable, print->notable); } else if (status == F_deadlock) { - fl_print_format("%[Deadlock%]", print.to, print.notable, print.notable); + fl_print_format("%[Deadlock%]", print->to, print->notable, print->notable); } else if (status == F_resource_not) { - fl_print_format("%[Too Many Locks%]", print.to, print.notable, print.notable); + fl_print_format("%[Too Many Locks%]", print->to, print->notable, print->notable); } else { - fl_print_format("%[Unknown Error%]", print.to, print.notable, print.notable); + fl_print_format("%[Unknown Error%]", print->to, print->notable, print->notable); } } - fl_print_format(f_string_format_sentence_end_quote_s.string, print.to, print.context, print.context, f_string_eol_s); + fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s); - controller_unlock_print_flush(print.to, thread); + controller_unlock_print_flush(print->to, thread); } } #endif // _di_controller_lock_print_error_critical_ diff --git a/level_3/controller/c/lock/private-lock_print.h b/level_3/controller/c/lock/private-lock_print.h index 019ec58..8f30ef4 100644 --- a/level_3/controller/c/lock/private-lock_print.h +++ b/level_3/controller/c/lock/private-lock_print.h @@ -29,7 +29,7 @@ extern "C" { * The thread data. */ #ifndef _di_controller_lock_print_error_critical_ - extern void controller_lock_print_error_critical(const fl_print_t print, const f_status_t status, const bool read, controller_thread_t *thread) F_attribute_visibility_internal_d; + extern void controller_lock_print_error_critical(fl_print_t * const print, const f_status_t status, const bool read, controller_thread_t *thread) F_attribute_visibility_internal_d; #endif // _di_controller_lock_print_error_critical_ /** diff --git a/level_3/controller/c/main.c b/level_3/controller/c/main.c index 75b40a5..eec477c 100644 --- a/level_3/controller/c/main.c +++ b/level_3/controller/c/main.c @@ -36,9 +36,9 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { // When run as "init" by default, provide the default system-level init path. #ifdef _controller_as_init_ - data.setting.as_init = F_true; + data.setting.flag |= controller_main_flag_init_e; #else - data.setting.as_init = F_false; + data.setting.flag &= ~controller_main_flag_init_e; #endif // _controller_as_init_ controller_process_t process = controller_process_t_initialize; @@ -73,10 +73,10 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { memset(&id_signal, 0, sizeof(f_thread_id_t)); - data.setting.state.status = f_thread_create(0, &id_signal, &controller_thread_signal, (void *) &data); + //data.setting.state.status = f_thread_create(0, &id_signal, &controller_thread_signal, (void *) &data); // @fixme if (F_status_is_error(data.setting.state.status)) { - controller_print_error(&data.program.error, macro_controller_f(f_thread_create)); + //controller_print_error(thread, &data.program.error, macro_controller_f(f_thread_create)); // @fixme } else { { @@ -100,8 +100,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_down(&data.program); // When the child process exits, it must return the code to the parent so the parent knows how to handle the exit. - if (status == F_child) { - exit(data.child); + if (data.setting.state.status == F_child) { + exit(data.program.child); } return F_status_is_error(data.setting.state.status) ? 1 : 0; diff --git a/level_3/controller/c/process/private-process.c b/level_3/controller/c/process/private-process.c index 1a51b7c..9c8cc28 100644 --- a/level_3/controller/c/process/private-process.c +++ b/level_3/controller/c/process/private-process.c @@ -42,7 +42,7 @@ extern "C" { status = controller_lock_write(is_normal, global.thread, &global.thread->lock.process); if (F_status_is_error(status)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status), F_false, global.thread); } else { status = controller_processs_increase(&global.thread->processs); @@ -55,7 +55,7 @@ extern "C" { status = controller_lock_write(is_normal, global.thread, &process->lock); if (F_status_is_error(status)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status), F_false, global.thread); } else { process->action = action; @@ -143,7 +143,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); break; } diff --git a/level_3/controller/c/rule/private-rule.c b/level_3/controller/c/rule/private-rule.c index 8a0ba8e..84c4315 100644 --- a/level_3/controller/c/rule/private-rule.c +++ b/level_3/controller/c/rule/private-rule.c @@ -76,7 +76,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), content ? "f_memory_array_increase_by" : "f_memory_array_increase", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), content ? "f_memory_array_increase_by" : "f_memory_array_increase", F_true); return status; } @@ -89,7 +89,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), content ? "f_memory_array_increase_by" : "f_memory_array_increase", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), content ? "f_memory_array_increase_by" : "f_memory_array_increase", F_true); return status; } @@ -103,7 +103,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(buffer, *object, &action->parameters.array[0]); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); return status; } @@ -116,7 +116,7 @@ extern "C" { status = f_memory_array_increase_by(content->used, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_memory_array_increase_by", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_memory_array_increase_by", F_true); return status; } @@ -124,7 +124,7 @@ extern "C" { status = f_memory_array_increase_by(content->used, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_memory_array_increase_by", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_memory_array_increase_by", F_true); return status; } @@ -144,7 +144,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(buffer, content->array[i], &action->parameters.array[action->parameters.used]); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); return status; } @@ -153,10 +153,10 @@ extern "C" { range.start = 0; range.stop = action->parameters.array[action->parameters.used].used - 1; - status = fl_iki_read(&action->parameters.array[action->parameters.used], &range, &action->ikis.array[action->ikis.used], state); + fl_iki_read(&action->parameters.array[action->parameters.used], &range, &action->ikis.array[action->ikis.used], state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fl_iki_read", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fl_iki_read", F_true); action->parameters.array[action->parameters.used].used = 0; @@ -247,19 +247,19 @@ extern "C" { cache->content_action.used = 0; if (method == controller_rule_action_method_extended_list_e) { - status = fl_fss_extended_list_content_read(cache->buffer_item, state, range, &cache->content_action, &cache->delimits, &cache->comments); + fl_fss_extended_list_content_read(cache->buffer_item, range, &cache->content_action, &cache->delimits, &cache->comments, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fl_fss_extended_list_content_read", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fl_fss_extended_list_content_read", F_true); return status; } if (status == F_fss_found_content) { - status = f_fss_apply_delimit(state, cache->delimits, &cache->buffer_item); + f_fss_apply_delimit(cache->delimits, &cache->buffer_item, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true); return status; } @@ -271,7 +271,7 @@ extern "C" { status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &actions->array[actions->used].parameters.array, &actions->array[actions->used].parameters.used, &actions->array[actions->used].parameters.size); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); return status; } @@ -279,7 +279,7 @@ extern "C" { status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_iki_data_t), (void **) &actions->array[actions->used].ikis.array, &actions->array[actions->used].ikis.used, &actions->array[actions->used].ikis.size); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); return status; } @@ -291,7 +291,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_action.array[0], &actions->array[actions->used].parameters.array[0]); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); actions->array[actions->used++].status = controller_status_simplify_error(F_status_set_fine(status)); @@ -305,10 +305,10 @@ extern "C" { f_range_t range_iki = macro_f_range_t_initialize_2(actions->array[actions->used].parameters.array[0].used); - status = fl_iki_read(&actions->array[actions->used].parameters.array[0], &range_iki, &actions->array[actions->used].ikis.array[0], state); + fl_iki_read(&actions->array[actions->used].parameters.array[0], &range_iki, &actions->array[actions->used].ikis.array[0], &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fl_iki_read", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fl_iki_read", F_true); actions->array[actions->used++].status = controller_status_simplify_error(F_status_set_fine(status)); @@ -325,18 +325,18 @@ extern "C" { cache->delimits.used = 0; // The object_actions and content_actions caches are being used for the purposes of getting the parameters a given the action. - status = fll_fss_extended_read(cache->buffer_item, state, &cache->content_action.array[0], &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0); + fll_fss_extended_read(cache->buffer_item, &cache->content_action.array[0], &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fll_fss_extended_read", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fll_fss_extended_read", F_true); return status; } - status = f_fss_apply_delimit(state, cache->delimits, &cache->buffer_item); + f_fss_apply_delimit(cache->delimits, &cache->buffer_item, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true); return status; } @@ -346,15 +346,15 @@ extern "C" { status = controller_rule_actions_increase_by(controller_common_allocation_small_d, actions); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "controller_rule_actions_increase_by", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "controller_rule_actions_increase_by", F_true); return status; } - status = f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &actions->array[actions->used].line, &setting->state); + f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &actions->array[actions->used].line, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_fss_count_lines", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_fss_count_lines", F_true); return status; } @@ -363,7 +363,7 @@ extern "C" { actions->array[actions->used].line += ++item->line; actions->array[actions->used].status = F_known_not; - status = controller_rule_parameters_read(global, cache->buffer_item, state, &cache->object_actions.array[i], &cache->content_actions.array[i], &actions->array[actions->used]); + status = controller_rule_parameters_read(global, cache->buffer_item, &cache->object_actions.array[i], &cache->content_actions.array[i], &actions->array[actions->used], &state); if (F_status_is_error(status)) { actions->array[actions->used++].status = controller_status_simplify_error(F_status_set_fine(status)); @@ -381,16 +381,16 @@ extern "C" { } } else { - status = fl_fss_extended_content_read(cache->buffer_item, state, range, &cache->content_action, 0, &cache->delimits); + fl_fss_extended_content_read(cache->buffer_item, range, &cache->content_action, 0, &cache->delimits, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fll_fss_extended_content_read", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fll_fss_extended_content_read", F_true); } else if (status == F_fss_found_content) { - status = f_fss_apply_delimit(state, cache->delimits, &cache->buffer_item); + f_fss_apply_delimit(cache->delimits, &cache->buffer_item, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true); } else if (type == controller_rule_action_type_pid_file_e) { item->pid_file.used = 0; @@ -398,7 +398,7 @@ extern "C" { status = f_rip_dynamic_partial(cache->buffer_item, cache->content_action.array[0], &item->pid_file); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_rip_dynamic_partial", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_rip_dynamic_partial", F_true); } } else if (type == controller_rule_action_type_rerun_e) { @@ -454,7 +454,7 @@ extern "C" { fl_print_format(f_string_format_r_single_s.string, global.main->program.error.to, global.main->program.error.notable, controller_thaw_s, global.main->program.error.notable, global.main->program.error.context); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_true); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -487,7 +487,7 @@ extern "C" { fl_print_format(f_string_format_r_single_s.string, global.main->program.error.to, global.main->program.error.notable, controller_thaw_s, global.main->program.error.notable, global.main->program.error.context); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_true); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -516,7 +516,7 @@ extern "C" { fl_print_format(f_string_format_Q_range_single_s.string, global.main->program.error.to, global.main->program.error.notable, cache->buffer_item, cache->content_action.array[i], global.main->program.error.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_true); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -552,7 +552,7 @@ extern "C" { fl_print_format("%[' for rule item action '%]%[%r%]", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, global.main->program.error.notable, controller_with_s, global.main->program.error.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_true); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -567,7 +567,7 @@ extern "C" { status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &actions->array[actions->used].parameters.array, &actions->array[actions->used].parameters.used, &actions->array[actions->used].parameters.size); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); return status; } @@ -575,7 +575,7 @@ extern "C" { status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_iki_data_t), (void **) &actions->array[actions->used].ikis.array, &actions->array[actions->used].ikis.used, &actions->array[actions->used].ikis.size); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); return status; } @@ -592,7 +592,7 @@ extern "C" { } // for if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_mash_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_mash_nulless", F_true); actions->array[actions->used++].status = controller_status_simplify_error(F_status_set_fine(status)); @@ -606,10 +606,10 @@ extern "C" { f_range_t range_iki = macro_f_range_t_initialize_2(actions->array[actions->used].parameters.array[0].used); - status = fl_iki_read(&actions->array[actions->used].parameters.array[0], &range_iki, &actions->array[actions->used].ikis.array[0], state); + fl_iki_read(&actions->array[actions->used].parameters.array[0], &range_iki, &actions->array[actions->used].ikis.array[0], &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fl_iki_read", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fl_iki_read", F_true); actions->array[actions->used++].status = controller_status_simplify_error(F_status_set_fine(status)); @@ -621,10 +621,10 @@ extern "C" { actions->array[actions->used++].parameters.used = 1; } else { - status = f_fss_count_lines(cache->buffer_item, range->start, &actions->array[actions->used].line, &setting->state); + f_fss_count_lines(cache->buffer_item, range->start, &actions->array[actions->used].line, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_fss_count_lines", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_fss_count_lines", F_true); return status; } @@ -633,7 +633,7 @@ extern "C" { actions->array[actions->used].line += ++item->line; actions->array[actions->used].status = F_known_not; - status = controller_rule_parameters_read(global, cache->buffer_item, state, 0, &cache->content_action, &actions->array[actions->used]); + status = controller_rule_parameters_read(global, cache->buffer_item, 0, &cache->content_action, &actions->array[actions->used], &state); if (F_status_is_error(status)) { actions->array[actions->used++].status = controller_status_simplify_error(F_status_set_fine(status)); @@ -655,7 +655,7 @@ extern "C" { fl_print_format("%r%[%QAction is empty, nothing to do.%]%r", global.main->program.warning.to, f_string_eol_s, global.main->program.warning.context, global.main->program.warning.prefix, global.main->program.warning.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.warning, cache->action, F_true); + controller_rule_print_error_cache(&global.main->program.warning, cache->action, F_true); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -691,7 +691,7 @@ extern "C" { status = F_status_set_fine(status); if (status != F_valid_not && status != F_number && status != F_number_decimal && status != F_number_overflow && status != F_number_underflow && status != F_number_negative) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_signed_detect", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_signed_detect", F_true); } else { controller_lock_print(global.main->program.error.to, global.thread); @@ -719,7 +719,7 @@ extern "C" { } } - controller_rule_print_error_cache(global.main->program.error, cache->action, F_true); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -759,7 +759,7 @@ extern "C" { destination->group = source.group; destination->timestamp.seconds = source.timestamp.seconds; - destination->timestamp.nanoseconds = source.timestamp.nanoseconds; + destination->timestamp.seconds_nano = source.timestamp.seconds_nano; destination->alias.used = 0; destination->engine.used = 0; @@ -853,7 +853,7 @@ extern "C" { destination->ons.used = source.ons.used; } - status = f_int32s_append_all(source.affinity, &destination->affinity); + status = f_memory_array_append_all(source.affinity.array, source.affinity.used, sizeof(int32_t), (void **) &destination->affinity.array, &destination->affinity.used, &destination->affinity.size); if (F_status_is_error(status)) return status; if (source.capability) { @@ -864,11 +864,11 @@ extern "C" { status = f_control_group_copy(source.cgroup, &destination->cgroup); if (F_status_is_error(status)) return status; - status = f_int32s_append_all(source.groups, &destination->groups); + status = f_memory_array_append_all(source.groups.array, source.groups.used, sizeof(int32_t), (void **) &destination->groups.array, &destination->groups.used, &destination->groups.size); if (F_status_is_error(status)) return status; destination->limits.used = 0; - status = f_limit_sets_append_all(source.limits, &destination->limits); + status = f_memory_array_append_all(source.limits.array, source.limits.used, sizeof(f_limit_set_t), (void **) &destination->limits.array, &destination->limits.used, &destination->limits.size); if (F_status_is_error(status)) return status; if (source.items.used) { @@ -978,7 +978,7 @@ extern "C" { status = fll_control_group_prepare(process->rule.cgroup); if (F_status_is_error(status)) { - controller_print_error_file(global.thread, global.main->program.error, F_status_set_fine(status), "fll_control_group_prepare", F_true, process->rule.cgroup.path, controller_rule_print_control_groups_prepare_s, fll_error_file_type_directory_e); + controller_print_error_file(global.thread, &global.main->program.error, F_status_set_fine(status), "fll_control_group_prepare", F_true, process->rule.cgroup.path, controller_rule_print_control_groups_prepare_s, fll_error_file_type_directory_e); return status; } @@ -1013,7 +1013,7 @@ extern "C" { status = fl_environment_load_names(process->rule.environment, &environment); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fl_environment_load_names", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fl_environment_load_names", F_true); return status; } @@ -1037,14 +1037,14 @@ extern "C" { for (k = 0; k < environment.used; ++k) { - if (f_compare_dynamic(entry->define.array[i].key, environment.array[k].name) == F_equal_to) { + if (f_compare_dynamic(entry->define.array[i].key, environment.array[k].key) == F_equal_to) { environment.array[k].value.used = 0; status = f_string_dynamic_append(entry->define.array[i].value, &environment.array[k].value); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true); return status; } @@ -1057,7 +1057,7 @@ extern "C" { status = f_string_maps_append(entry->define.array[i], &environment); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true); return status; } @@ -1078,14 +1078,14 @@ extern "C" { for (k = 0; k < environment.used; ++k) { - if (f_compare_dynamic(process->rule.define.array[i].key, environment.array[k].name) == F_equal_to) { + if (f_compare_dynamic(process->rule.define.array[i].key, environment.array[k].key) == F_equal_to) { environment.array[k].value.used = 0; status = f_string_dynamic_append(process->rule.define.array[i].value, &environment.array[k].value); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true); return status; } @@ -1098,7 +1098,7 @@ extern "C" { status = f_string_maps_append(process->rule.define.array[i], &environment); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true); return status; } @@ -1126,7 +1126,7 @@ extern "C" { status = f_environment_get_all(&environment); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_environment_get_all", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_environment_get_all", F_true); return status; } @@ -1136,7 +1136,7 @@ extern "C" { status = f_string_maps_append(entry->define.array[i], &environment); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true); return status; } @@ -1147,7 +1147,7 @@ extern "C" { status = f_string_maps_append(process->rule.define.array[i], &environment); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true); return status; } @@ -1189,7 +1189,7 @@ extern "C" { status = controller_rule_expand(global, process->rule.items.array[i].actions.array[j], process); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, process->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, process->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); break; } @@ -1219,7 +1219,7 @@ extern "C" { status = controller_rule_expand(global, process->rule.items.array[i].actions.array[j], process); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, process->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, process->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); break; } @@ -1261,7 +1261,7 @@ extern "C" { status = controller_rule_expand(global, process->rule.items.array[i].actions.array[j], process); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, process->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, process->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); break; } @@ -1291,7 +1291,7 @@ extern "C" { else { success = F_status_set_error(F_failure); - controller_rule_action_print_error_missing_pid(global.main->program.error, process->rule.alias); + controller_rule_action_print_error_missing_pid(&global.main->program.error, process->rule.alias); } } else if (process->rule.items.array[i].type == controller_rule_item_type_utility_e) { @@ -1299,7 +1299,7 @@ extern "C" { status = controller_rule_expand(global, process->rule.items.array[i].actions.array[j], process); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, process->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, process->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false); break; } @@ -1335,7 +1335,7 @@ extern "C" { else { success = F_status_set_error(F_failure); - controller_rule_action_print_error_missing_pid(global.main->program.error, process->rule.alias); + controller_rule_action_print_error_missing_pid(&global.main->program.error, process->rule.alias); } } else { @@ -1344,7 +1344,7 @@ extern "C" { fl_print_format("%r%[%QAction type is unknown, ignoring.%]%r", global.main->program.warning.to, f_string_eol_s, global.main->program.warning.context, global.main->program.warning.prefix, global.main->program.warning.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.warning, process->cache.action, F_true); + controller_rule_print_error_cache(&global.main->program.warning, process->cache.action, F_true); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -1362,7 +1362,7 @@ extern "C" { } } // for - macro_f_string_maps_t_delete_simple(environment); + f_memory_arrays_resize(0, sizeof(f_string_map_t), (void **) &environment.array, &environment.used, &environment.size, &f_string_maps_delete_callback); // Lock failed, attempt to re-establish lock before returning. if (F_status_set_fine(status) == F_lock) { @@ -1406,7 +1406,7 @@ extern "C" { status = controller_pids_increase(&process->childs); if (F_status_is_error(status)) { - controller_print_error(thread, main->program.error, F_status_set_fine(status), "controller_pids_increase", F_true); + controller_print_error(thread, &main->program.error, F_status_set_fine(status), "controller_pids_increase", F_true); return status; } @@ -1595,7 +1595,7 @@ extern "C" { controller_rule_item_print_error_execute(type == controller_rule_item_type_script_e, program.used ? program : arguments.array[0], status, process); } else { - controller_print_error(thread, main->program.error, F_status_set_fine(status), "fll_execute_program", F_true); + controller_print_error(thread, &main->program.error, F_status_set_fine(status), "fll_execute_program", F_true); } status = F_status_set_error(status); @@ -1619,7 +1619,7 @@ extern "C" { status = controller_pids_increase(&process->childs); if (F_status_is_error(status)) { - controller_print_error(thread, main->program.error, F_status_set_fine(status), "controller_pids_increase", F_true); + controller_print_error(thread, &main->program.error, F_status_set_fine(status), "controller_pids_increase", F_true); return status; } @@ -1627,7 +1627,7 @@ extern "C" { status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &process->path_pids.array, &process->path_pids.used, &process->path_pids.size); if (F_status_is_error(status)) { - controller_print_error(thread, main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); + controller_print_error(thread, &main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); return status; } @@ -1664,13 +1664,13 @@ extern "C" { status = f_file_exists(pid_file, F_true); if (F_status_is_error(status)) { - controller_print_error_file(thread, main->program.error, F_status_set_fine(status), "f_file_exists", F_true, pid_file, f_file_operation_find_s, fll_error_file_type_file_e); + controller_print_error_file(thread, &main->program.error, F_status_set_fine(status), "f_file_exists", F_true, pid_file, f_file_operation_find_s, fll_error_file_type_file_e); return status; } if (status == F_true) { - controller_print_error_file(thread, main->program.error, F_file_found, "f_file_exists", F_true, pid_file, f_file_operation_find_s, fll_error_file_type_file_e); + controller_print_error_file(thread, &main->program.error, F_file_found, "f_file_exists", F_true, pid_file, f_file_operation_find_s, fll_error_file_type_file_e); return F_status_set_error(F_file_found); } @@ -1678,7 +1678,7 @@ extern "C" { status = f_string_dynamic_append_nulless(pid_file, child_pid_file); if (F_status_is_error(status)) { - controller_print_error(thread, main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); + controller_print_error(thread, &main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); return status; } @@ -1852,7 +1852,7 @@ extern "C" { controller_rule_item_print_error_execute(type == controller_rule_item_type_utility_e, program.used ? program : arguments.array[0], status, process); } else { - controller_print_error(thread, main->program.error, F_status_set_fine(status), "fll_execute_program", F_true); + controller_print_error(thread, &main->program.error, F_status_set_fine(status), "fll_execute_program", F_true); } return F_status_set_error(status); @@ -2097,8 +2097,8 @@ extern "C" { } } else if (f_compare_dynamic_partial_string(controller_program_s.string, source, controller_program_s.used, vocabulary) == F_equal_to) { - f_string_static_t * const argv = ((controller_main_t *) process->main_data)->parameters.arguments.array; - f_console_parameters_t * const parameters = &((controller_main_t *) process->main_data)->parameters; + f_string_static_t * const argv = ((controller_main_t *) process->main_data)->program.parameters.arguments.array; + f_console_parameters_t * const parameters = &((controller_main_t *) process->main_data)->program.parameters; const f_string_static_t options[] = { f_console_standard_long_light_s, @@ -2314,7 +2314,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(source, directory, alias); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); return status; } @@ -2322,7 +2322,7 @@ extern "C" { status = f_string_dynamic_append(f_path_separator_s, alias); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true); return status; } @@ -2330,7 +2330,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(source, basename, alias); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true); return status; } @@ -2370,10 +2370,10 @@ extern "C" { for (; range.start < cache->buffer_item.used && range.start <= range.stop; last = range.start, cache->delimits.used = 0, cache->comments.used = 0) { - status = fl_fss_extended_list_object_read(cache->buffer_item, state, &range, &cache->range_action, &cache->delimits); + fl_fss_extended_list_object_read(cache->buffer_item, &range, &cache->range_action, &cache->delimits, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fl_fss_extended_list_object_read", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fl_fss_extended_list_object_read", F_true); break; } @@ -2387,10 +2387,10 @@ extern "C" { cache->delimits.used = 0; // The current line is not an Extended List object, so the next possibility is a Basic List (and Extended List, both use the same Object structure). - fl_fss_extended_object_read(cache->buffer_item, &range, &cache->range_action, 0, &cache->delimits, state); + fl_fss_extended_object_read(cache->buffer_item, &range, &cache->range_action, 0, &cache->delimits, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fl_fss_extended_object_read", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fl_fss_extended_object_read", F_true); break; } @@ -2399,18 +2399,18 @@ extern "C" { if (status != F_fss_found_object) continue; } - status = f_fss_apply_delimit(state, cache->delimits, &cache->buffer_item); + f_fss_apply_delimit(cache->delimits, &cache->buffer_item, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true); break; } - status = f_fss_count_lines(cache->buffer_item, cache->range_action.start, &cache->action.line_action, &setting->state); + f_fss_count_lines(cache->buffer_item, cache->range_action.start, &cache->action.line_action, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_fss_count_lines", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_fss_count_lines", F_true); break; } @@ -2421,7 +2421,7 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_item, cache->range_action, &cache->action.name_action); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true); break; } @@ -2476,7 +2476,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.warning.to, global.main->program.warning.notable, cache->action.name_action, global.main->program.warning.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.warning.to, global.main->program.warning.context, global.main->program.warning.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.warning, cache->action, F_true); + controller_rule_print_error_cache(&global.main->program.warning, cache->action, F_true); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -2510,7 +2510,7 @@ extern "C" { status = controller_rule_actions_increase_by(controller_common_allocation_small_d, &item->actions); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "controller_rule_actions_increase_by", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "controller_rule_actions_increase_by", F_true); break; } @@ -2569,7 +2569,7 @@ extern "C" { fl_print_format(f_string_format_r_single_s.string, global.main->program.error.to, global.main->program.error.notable, controller_rule_action_type_name(process->action), global.main->program.error.notable); fl_print_format("%[' while attempting to execute rule.%]%r", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, process->cache.action, F_true); + controller_rule_print_error_cache(&global.main->program.error, process->cache.action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -2591,7 +2591,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, process->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); + controller_rule_print_error(global.thread, &global.main->program.error, process->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); return status; } @@ -2599,7 +2599,7 @@ extern "C" { status = f_string_dynamic_append(process->rule.alias, &process->cache.action.name_file); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, process->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); + controller_rule_print_error(global.thread, &global.main->program.error, process->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); return status; } @@ -2611,7 +2611,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, process->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); + controller_rule_print_error(global.thread, &global.main->program.error, process->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true); return status; } @@ -2669,7 +2669,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &global.thread->lock.process); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); } else { status = controller_process_prepare_process_type(global, process->type, process->action, dynamics[i]->array[j], &id_dependency); @@ -2684,8 +2684,8 @@ extern "C" { if (global.main->program.error.verbosity > f_console_verbosity_quiet_e) { controller_lock_print(global.main->program.error.to, global.thread); - controller_rule_item_print_error_rule_not_loaded(global.main->program.error, dynamics[i]->array[j]); - controller_rule_print_error_cache(global.main->program.error, process->cache.action, F_false); + controller_rule_item_print_error_rule_not_loaded(&global.main->program.error, dynamics[i]->array[j]); + controller_rule_print_error_cache(&global.main->program.error, process->cache.action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -2704,7 +2704,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &dependency->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); status = F_false; dependency = 0; @@ -2717,7 +2717,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &global.thread->lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); status = F_false; } @@ -2739,8 +2739,8 @@ extern "C" { if (i == 0) { controller_lock_print(global.main->program.error.to, global.thread); - controller_rule_item_print_error_need_want_wish(global.main->program.error, strings[i], dynamics[i]->array[j], "is not found"); - controller_rule_print_error_cache(global.main->program.error, process->cache.action, F_true); + controller_rule_item_print_error_need_want_wish(&global.main->program.error, strings[i], dynamics[i]->array[j], "is not found"); + controller_rule_print_error_cache(&global.main->program.error, process->cache.action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); @@ -2758,9 +2758,9 @@ extern "C" { if (global.main->program.warning.verbosity == f_console_verbosity_debug_e) { controller_lock_print(global.main->program.warning.to, global.thread); - controller_rule_item_print_error_need_want_wish(global.main->program.warning, strings[i], dynamics[i]->array[j], "is not found"); + controller_rule_item_print_error_need_want_wish(&global.main->program.warning, strings[i], dynamics[i]->array[j], "is not found"); - controller_rule_print_error_cache(global.main->program.warning, process->cache.action, F_true); + controller_rule_print_error_cache(&global.main->program.warning, process->cache.action, F_true); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -2770,7 +2770,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &global.thread->lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); found = F_false; status = status_lock; @@ -2794,7 +2794,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &dependency->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); status = status_lock; } @@ -2811,7 +2811,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &global.thread->lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); f_thread_unlock(&dependency->lock); @@ -2844,8 +2844,8 @@ extern "C" { if (i == 0 || i == 1 || F_status_set_fine(status) == F_memory_not) { controller_lock_print(global.main->program.error.to, global.thread); - controller_rule_item_print_error_need_want_wish(global.main->program.error, strings[i], alias_other_buffer, "failed during execution"); - controller_rule_print_error_cache(global.main->program.error, process->cache.action, F_true); + controller_rule_item_print_error_need_want_wish(&global.main->program.error, strings[i], alias_other_buffer, "failed during execution"); + controller_rule_print_error_cache(&global.main->program.error, process->cache.action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); @@ -2859,9 +2859,9 @@ extern "C" { if (global.main->program.warning.verbosity == f_console_verbosity_debug_e) { controller_lock_print(global.main->program.warning.to, global.thread); - controller_rule_item_print_error_need_want_wish(global.main->program.warning, strings[i], alias_other_buffer, "failed during execution"); + controller_rule_item_print_error_need_want_wish(&global.main->program.warning, strings[i], alias_other_buffer, "failed during execution"); - controller_rule_print_error_cache(global.main->program.warning, process->cache.action, F_true); + controller_rule_print_error_cache(&global.main->program.warning, process->cache.action, F_true); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -2886,13 +2886,13 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &global.thread->lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); } } if (F_status_is_error(status_lock)) { if (F_status_is_error(status_lock)) { - controller_rule_item_print_error_need_want_wish(global.main->program.error, strings[i], alias_other_buffer, "due to lock failure"); + controller_rule_item_print_error_need_want_wish(&global.main->program.error, strings[i], alias_other_buffer, "due to lock failure"); } status = status_lock; @@ -2903,9 +2903,9 @@ extern "C" { if (i == 0 || i == 1) { controller_lock_print(global.main->program.error.to, global.thread); - controller_rule_item_print_error_need_want_wish(global.main->program.error, strings[i], alias_other_buffer, "is in a failed state"); + controller_rule_item_print_error_need_want_wish(&global.main->program.error, strings[i], alias_other_buffer, "is in a failed state"); - controller_rule_print_error_cache(global.main->program.error, process->cache.action, F_true); + controller_rule_print_error_cache(&global.main->program.error, process->cache.action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); @@ -2921,9 +2921,9 @@ extern "C" { if (global.main->program.warning.verbosity == f_console_verbosity_debug_e) { controller_lock_print(global.main->program.warning.to, global.thread); - controller_rule_item_print_error_need_want_wish(global.main->program.warning, strings[i], alias_other_buffer, "is in a failed state"); + controller_rule_item_print_error_need_want_wish(&global.main->program.warning, strings[i], alias_other_buffer, "is in a failed state"); - controller_rule_print_error_cache(global.main->program.warning, process->cache.action, F_true); + controller_rule_print_error_cache(&global.main->program.warning, process->cache.action, F_true); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -2954,7 +2954,7 @@ extern "C" { } if ((process->options & controller_process_option_wait_d) && F_status_is_error_not(status) && (process->options & controller_process_option_validate_d)) { - status_lock = controller_rule_wait_all_process_type(global, process->type, F_false, process); + status_lock = controller_rule_wait_all_process_type(global, process->type, F_false); if (F_status_set_fine(status_lock) == F_interrupt) { return status_lock; @@ -3008,7 +3008,7 @@ extern "C" { fl_print_format("%[') to execute.%]%r", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); } - controller_rule_print_error_cache(global.main->program.error, process->cache.action, F_true); + controller_rule_print_error_cache(&global.main->program.error, process->cache.action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -3025,7 +3025,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_rule_item_print_error(global.thread, global.main->program.error, process->cache.action, F_true, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, process->cache.action, F_true, F_status_set_fine(status)); } } } @@ -3037,7 +3037,7 @@ extern "C" { status_lock = controller_lock_write_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); if (F_status_set_fine(status) != F_interrupt) { status = controller_lock_read_process(process, global.thread, &process->lock); @@ -3057,7 +3057,7 @@ extern "C" { status_lock = controller_lock_write_process(process, global.thread, &global.thread->lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); f_thread_unlock(&process->lock); @@ -3094,7 +3094,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); return F_status_set_error(F_lock); } @@ -3118,7 +3118,7 @@ extern "C" { status = controller_lock_read_process_type(type, global.thread, &global.thread->lock.process); if (F_status_is_error(status)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status), F_true, global.thread); return status; } @@ -3134,8 +3134,8 @@ extern "C" { if (global.main->program.error.verbosity > f_console_verbosity_quiet_e) { controller_lock_print(global.main->program.error.to, global.thread); - controller_rule_item_print_error_rule_not_loaded(global.main->program.error, alias_rule); - controller_rule_print_error_cache(global.main->program.error, cache.action, F_false); + controller_rule_item_print_error_rule_not_loaded(&global.main->program.error, alias_rule); + controller_rule_print_error_cache(&global.main->program.error, cache.action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -3148,8 +3148,8 @@ extern "C" { status = controller_lock_read_process_type(type, global.thread, &process->active); if (F_status_is_error(status)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status), F_true, global.thread); - controller_rule_item_print_error(global.thread, global.main->program.error, cache.action, F_false, F_status_set_fine(status)); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status), F_true, global.thread); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache.action, F_false, F_status_set_fine(status)); f_thread_unlock(&global.thread->lock.process); @@ -3159,7 +3159,7 @@ extern "C" { status_lock = controller_lock_write_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); f_thread_unlock(&process->active); f_thread_unlock(&global.thread->lock.process); @@ -3195,7 +3195,7 @@ extern "C" { status_lock = controller_lock_write_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); f_thread_unlock(&process->active); @@ -3242,7 +3242,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_memory_array_resize", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_memory_array_resize", F_true); } else { for (f_number_unsigned_t i = 0; i < stack.used; ++i) { @@ -3264,7 +3264,7 @@ extern "C" { status = f_string_dynamic_append(cache.action.name_item, &process->cache.action.name_item); } else { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true); } } @@ -3280,7 +3280,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_thread_create", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_thread_create", F_true); } } else { @@ -3299,7 +3299,7 @@ extern "C" { status_lock = controller_lock_write_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); f_thread_unlock(&process->active); @@ -3343,7 +3343,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &process->active); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); return status_lock; } @@ -3352,7 +3352,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); if (options_force & controller_process_option_asynchronous_d) { f_thread_unlock(&process->active); @@ -3370,7 +3370,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &global.thread->lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); f_thread_unlock(&process->lock); @@ -3387,7 +3387,7 @@ extern "C" { status_lock = controller_lock_write_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); f_thread_unlock(&global.thread->lock.rule); @@ -3407,7 +3407,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); f_thread_unlock(&global.thread->lock.rule); @@ -3421,7 +3421,7 @@ extern "C" { f_thread_unlock(&global.thread->lock.rule); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "controller_rule_copy", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "controller_rule_copy", F_true); } else if (!process->action) { @@ -3445,7 +3445,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.error.to, global.main->program.error.notable, process->rule.alias, global.main->program.error.notable); fl_print_format("%[' is already on the execution dependency stack, this recursion is prohibited.%]%r", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, process->cache.action, F_true); + controller_rule_print_error_cache(&global.main->program.error, process->cache.action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -3471,7 +3471,7 @@ extern "C" { status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &process->stack.array, &process->stack.used, &process->stack.size); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true); } else { f_thread_unlock(&process->lock); @@ -3479,7 +3479,7 @@ extern "C" { status_lock = controller_lock_write_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); if (options_force & controller_process_option_asynchronous_d) { f_thread_unlock(&process->active); @@ -3495,7 +3495,7 @@ extern "C" { status_lock = controller_lock_read_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); if (options_force & controller_process_option_asynchronous_d) { f_thread_unlock(&process->active); @@ -3519,8 +3519,8 @@ extern "C" { if (global.main->program.error.verbosity > f_console_verbosity_quiet_e) { controller_lock_print(global.main->program.error.to, global.thread); - controller_rule_item_print_error_rule_not_loaded(global.main->program.error, process->rule.alias); - controller_rule_print_error_cache(global.main->program.error, process->cache.action, F_false); + controller_rule_item_print_error_rule_not_loaded(&global.main->program.error, process->rule.alias); + controller_rule_print_error_cache(&global.main->program.error, process->cache.action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -3539,7 +3539,7 @@ extern "C" { status_lock = controller_lock_write_process(process, global.thread, &global.thread->lock.rule); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); if (F_status_set_fine(status) != F_lock) { f_thread_unlock(&process->lock); @@ -3575,7 +3575,7 @@ extern "C" { status_lock = controller_lock_write_process(process, global.thread, &process->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); if (options_force & controller_process_option_asynchronous_d) { f_thread_unlock(&process->active); @@ -3774,7 +3774,7 @@ extern "C" { status = f_string_dynamic_append_nulless(alias, &rule->alias); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true); } else { status = controller_file_load(global, F_true, controller_rules_s, rule->alias, controller_rule_s, cache); @@ -3788,16 +3788,16 @@ extern "C" { f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_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); - status = fll_fss_basic_list_read(cache->buffer_file, state, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments); + fll_fss_basic_list_read(cache->buffer_file, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "fll_fss_basic_list_read", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "fll_fss_basic_list_read", F_true); } else { - status = f_fss_apply_delimit(state, cache->delimits, &cache->buffer_file); + f_fss_apply_delimit(cache->delimits, &cache->buffer_file, &state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true); } } } @@ -3807,7 +3807,7 @@ extern "C" { status = controller_rule_items_increase_by(cache->object_items.used, &rule->items); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "controller_rule_items_increase_by", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "controller_rule_items_increase_by", F_true); } else { f_number_unsigned_t i = 0; @@ -3842,10 +3842,10 @@ extern "C" { for_item = F_true; - status = f_fss_count_lines(cache->buffer_file, cache->object_items.array[i].start, &cache->action.line_item, &global.main->setting.state); + f_fss_count_lines(cache->buffer_file, cache->object_items.array[i].start, &cache->action.line_item, &global.main->setting.state); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_fss_count_lines", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_fss_count_lines", F_true); break; } @@ -3855,7 +3855,7 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->object_items.array[i], &cache->action.name_item); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true); break; } @@ -3883,7 +3883,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.warning.to, global.main->program.warning.notable, cache->action.name_item, global.main->program.warning.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.warning.to, global.main->program.warning.context, global.main->program.warning.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.warning, cache->action, F_true); + controller_rule_print_error_cache(&global.main->program.warning, cache->action, F_true); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -3894,7 +3894,7 @@ extern "C" { status = f_string_dynamic_partial_append(cache->buffer_file, cache->content_items.array[i].array[0], &cache->buffer_item); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append", F_true); break; } @@ -3930,7 +3930,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, for_item, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, for_item, F_status_set_fine(status)); rule->status[0] = controller_status_simplify_error(F_status_set_fine(status)); @@ -3953,10 +3953,10 @@ extern "C" { controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize_1(is_normal, global.thread); f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_okay, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0); - status = fll_fss_extended_read(cache->buffer_item, state, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0); + fll_fss_extended_read(cache->buffer_item, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0, &state); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, F_false); return status; } @@ -3991,7 +3991,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->object_actions.array[i], &cache->action.name_item); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -4009,7 +4009,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -4080,7 +4080,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.warning.to, global.main->program.warning.notable, cache->action.name_item, global.main->program.warning.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.warning.to, global.main->program.warning.context, global.main->program.warning.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.warning, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.warning, cache->action, F_false); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -4095,7 +4095,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, range2, &cache->action.name_action); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); // Get the current line number within the settings item. cache->action.line_item = line_item; @@ -4103,7 +4103,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -4132,7 +4132,7 @@ extern "C" { fl_print_format("%r%[%QEmpty rule setting.%]%r", global.main->program.warning.to, f_string_eol_s, global.main->program.warning.context, global.main->program.warning.prefix, global.main->program.warning.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.warning, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.warning, cache->action, F_false); controller_unlock_print_flush(global.main->program.warning.to, global.thread); } @@ -4143,7 +4143,7 @@ extern "C" { if (type == controller_rule_setting_type_affinity_e) { if (!cache->content_actions.array[i].used) { - controller_rule_setting_read_print_error(global.main->program.error, "requires one or more Content", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error(&global.main->program.error, "requires one or more Content", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -4158,10 +4158,10 @@ extern "C" { for (j = 0; j < cache->content_actions.array[i].used; ++j, number = 0) { - status = f_int32s_increase(controller_common_allocation_small_d, &rule->affinity); + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(int32_t), (void **) &rule->affinity.array, &rule->affinity.used, &rule->affinity.size); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_int32s_increase", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); break; } @@ -4182,13 +4182,13 @@ extern "C" { if (status == F_data_not || status == F_number || status == F_number_overflow || status == F_number_underflow || status == F_number_negative || status == F_number_decimal) { if (status == F_number_underflow) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too small for this system", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too small for this system", i, line_item, global.thread, cache); } else if (status == F_number_overflow || status == F_number_positive) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too large for this system", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too large for this system", i, line_item, global.thread, cache); } else { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an invalid number", cache->content_actions.array[i].array[j], ", only whole numbers are allowed for an affinity value", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an invalid number", cache->content_actions.array[i].array[j], ", only whole numbers are allowed for an affinity value", i, line_item, global.thread, cache); } status = F_status_set_error(F_valid_not); @@ -4198,7 +4198,7 @@ extern "C" { } } else { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); status = F_status_set_error(status); @@ -4220,7 +4220,7 @@ extern "C" { if (type == controller_rule_setting_type_define_e || type == controller_rule_setting_type_parameter_e) { if (cache->content_actions.array[i].used != 2) { - controller_rule_setting_read_print_error(global.main->program.error, "requires exactly two Content", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error(&global.main->program.error, "requires exactly two Content", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -4239,7 +4239,7 @@ extern "C" { status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_map_t), (void **) &setting_maps->array, &setting_maps->used, &setting_maps->size); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -4257,18 +4257,18 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } - setting_maps->array[setting_maps->used].name.used = 0; + setting_maps->array[setting_maps->used].key.used = 0; setting_maps->array[setting_maps->used].value.used = 0; - status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &setting_maps->array[setting_maps->used].name); + status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &setting_maps->array[setting_maps->used].key); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -4285,7 +4285,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -4293,7 +4293,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[1], &setting_maps->array[setting_maps->used].value); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -4311,7 +4311,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -4325,7 +4325,7 @@ extern "C" { if (type == controller_rule_setting_type_cgroup_e) { if (cache->content_actions.array[i].used < 2 || rule->has & controller_rule_has_cgroup_d) { - controller_rule_setting_read_print_error(global.main->program.error, "requires two or more Content", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error(&global.main->program.error, "requires two or more Content", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -4341,7 +4341,7 @@ extern "C" { rule->cgroup.as_new = F_true; } else { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an unknown option", cache->content_actions.array[i].array[0], "", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an unknown option", cache->content_actions.array[i].array[0], "", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -4355,7 +4355,7 @@ extern "C" { status = f_string_dynamic_append(global.setting->path_cgroup, &rule->cgroup.path); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_false); } else { rule->cgroup.groups.used = 0; @@ -4365,7 +4365,7 @@ extern "C" { status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &rule->cgroup.groups.array, &rule->cgroup.groups.used, &rule->cgroup.groups.size); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); break; } @@ -4375,7 +4375,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[j], &rule->cgroup.groups.array[rule->cgroup.groups.used]); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); break; } @@ -4402,7 +4402,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -4416,7 +4416,7 @@ extern "C" { if (type == controller_rule_setting_type_limit_e) { if (cache->content_actions.array[i].used != 3) { - controller_rule_setting_read_print_error(global.main->program.error, "requires three Content", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error(&global.main->program.error, "requires three Content", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -4488,7 +4488,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.error.to, global.main->program.error.notable, cache->action.name_action, global.main->program.error.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_true); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_true); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -4515,7 +4515,7 @@ extern "C" { fl_print_format("%r%[%QThe resource limit type is already specified%]%r", global.main->program.error.to, f_string_eol_s, global.main->program.error.context, global.main->program.error.prefix, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -4530,10 +4530,10 @@ extern "C" { if (F_status_is_error(status)) continue; - macro_f_limit_sets_t_increase(status, controller_common_allocation_small_d, rule->limits); + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_limit_set_t), (void **) &rule->limits.array, &rule->limits.used, &rule->limits.size); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_limit_sets_increase", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -4551,7 +4551,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -4576,13 +4576,13 @@ extern "C" { if (status == F_data_not || status == F_number || status == F_number_overflow || status == F_number_underflow || status == F_number_negative || status == F_number_positive || status == F_number_decimal) { if (status == F_number_underflow) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too small for this system", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too small for this system", i, line_item, global.thread, cache); } else if (status == F_number_overflow) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too large for this system", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", the number is too large for this system", i, line_item, global.thread, cache); } else { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", only whole numbers are allowed for a resource limit value", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[j], ", only whole numbers are allowed for a resource limit value", i, line_item, global.thread, cache); } status = F_status_set_error(F_valid_not); @@ -4592,7 +4592,7 @@ extern "C" { } } else { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); status = F_status_set_error(status); @@ -4634,7 +4634,7 @@ extern "C" { } if (setting_value->used || !cache->content_actions.array[i].used) { - controller_rule_setting_read_print_error(global.main->program.error, "requires one or more Content", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error(&global.main->program.error, "requires one or more Content", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -4684,7 +4684,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -4709,7 +4709,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.error.to, global.main->program.error.notable, *setting_value, global.main->program.error.notable); fl_print_format("%[', there must be at least 1 graph character.%]%r", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -4721,13 +4721,13 @@ extern "C" { else { // This function should only return F_complete_not_utf on error. - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_complete_not_utf, "controller_validate_has_graph", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_complete_not_utf, "controller_validate_has_graph", F_true, F_false); if (F_status_is_error_not(status_return)) { status_return = status; } - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); } setting_value->used = 0; @@ -4741,7 +4741,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], setting_value); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -4761,7 +4761,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -4774,7 +4774,7 @@ extern "C" { if (type == controller_rule_setting_type_scheduler_e) { if (cache->content_actions.array[i].used < 1 || cache->content_actions.array[i].used > 2 || rule->has & controller_rule_has_scheduler_d) { - controller_rule_setting_read_print_error(global.main->program.error, "requires either one or two Content", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error(&global.main->program.error, "requires either one or two Content", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -4808,7 +4808,7 @@ extern "C" { rule->scheduler.priority = 49; } else { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an unknown scheduler", cache->content_actions.array[i].array[0], "", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an unknown scheduler", cache->content_actions.array[i].array[0], "", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -4862,7 +4862,7 @@ extern "C" { fl_print_format(" allowed for the designated scheduler.%]%r", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -4872,7 +4872,7 @@ extern "C" { } } else { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); status = F_status_set_error(status); if (F_status_is_error_not(status_return)) { @@ -4895,7 +4895,7 @@ extern "C" { if (type == controller_rule_setting_type_timeout_e) { if (cache->content_actions.array[i].used != 2) { - controller_rule_setting_read_print_error(global.main->program.error, "requires exactly two Content", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error(&global.main->program.error, "requires exactly two Content", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -4930,7 +4930,7 @@ extern "C" { fl_print_format(f_string_format_Q_range_single_s.string, global.main->program.error.to, global.main->program.error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->program.error.notable); fl_print_format("%[' but only supports %r, %r, and %r.%]%r", global.main->program.error.to, global.main->program.error.context, controller_kill_s, controller_start_s, controller_stop_s, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -4959,10 +4959,10 @@ extern "C" { status = F_status_set_fine(status); if (status == F_number_overflow) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[1], ", the number is too large for this system", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an unsupported number", cache->content_actions.array[i].array[1], ", the number is too large for this system", i, line_item, global.thread, cache); } else if (status == F_data_not || status == F_number || status == F_number_underflow || status == F_number_negative || status == F_number_positive || status == F_number_decimal) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an invalid number", cache->content_actions.array[i].array[1], ", only positive whole numbers are allowed", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an invalid number", cache->content_actions.array[i].array[1], ", only positive whole numbers are allowed", i, line_item, global.thread, cache); } else { @@ -4972,7 +4972,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_print_error(global.thread, global.main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); } if (F_status_is_error_not(status_return)) { @@ -5005,7 +5005,7 @@ extern "C" { status = f_rip_dynamic_partial_nulless(cache->buffer_item, cache->content_actions.array[i].array[1], &cache->action.generic); if (F_status_is_error(status)) { - controller_print_error(global.thread, global.main->program.error, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true); + controller_print_error(global.thread, &global.main->program.error, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true); break; } @@ -5019,7 +5019,7 @@ extern "C" { if (type == controller_rule_setting_type_capability_e || type == controller_rule_setting_type_nice_e || type == controller_rule_setting_type_user_e) { if (cache->content_actions.array[i].used != 1 || type == controller_rule_setting_type_capability_e && rule->capability || type == controller_rule_setting_type_group_e && (rule->has & controller_rule_has_group_d) || type == controller_rule_setting_type_nice_e && (rule->has & controller_rule_has_nice_d) || type == controller_rule_setting_type_user_e && (rule->has & controller_rule_has_user_d)) { - controller_rule_setting_read_print_error(global.main->program.error, "requires exactly one Content", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error(&global.main->program.error, "requires exactly one Content", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -5043,9 +5043,9 @@ extern "C" { controller_lock_print(global.main->program.error.to, global.thread); - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); @@ -5073,9 +5073,9 @@ extern "C" { controller_lock_print(global.main->program.error.to, global.thread); - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_capability_from_text", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_capability_from_text", F_true, F_false); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); @@ -5084,7 +5084,7 @@ extern "C" { break; } - controller_rule_setting_read_print_error(global.main->program.error, "failed to process the capabilities", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error(&global.main->program.error, "failed to process the capabilities", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -5131,7 +5131,7 @@ extern "C" { fl_print_format("%[19%]", global.main->program.error.to, global.main->program.error.notable, global.main->program.error.notable); fl_print_format(" %[are allowed.%]%r", global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -5141,7 +5141,7 @@ extern "C" { } } else { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false); status = F_status_set_error(status); if (F_status_is_error_not(status_return)) { @@ -5168,9 +5168,9 @@ extern "C" { controller_lock_print(global.main->program.error.to, global.thread); - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); @@ -5200,13 +5200,13 @@ extern "C" { status = F_status_set_fine(status); if (status == F_exist_not) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because no user was found by that name", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because no user was found by that name", i, line_item, global.thread, cache); } else if (status == F_number_too_large) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is too large", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is too large", i, line_item, global.thread, cache); } else if (status == F_number) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an invalid user", cache->content_actions.array[i].array[0], ", because the given ID is not a valid supported number", i, line_item, global.thread, cache); } else { @@ -5216,9 +5216,9 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_print_error(global.thread, global.main->program.error, cache->action, status, "controller_get_id_user", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, status, "controller_get_id_user", F_true, F_false); - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); } if (F_status_is_error_not(status_return)) { @@ -5244,7 +5244,7 @@ extern "C" { if (type == controller_rule_setting_type_group_e) { if (!cache->content_actions.array[i].used) { - controller_rule_setting_read_print_error(global.main->program.error, "requires one or more Content", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error(&global.main->program.error, "requires one or more Content", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -5259,10 +5259,10 @@ extern "C" { for (j = 0; j < cache->content_actions.array[i].used; ++j) { - macro_f_int32s_t_increase_by(status, rule->groups, controller_common_allocation_small_d); + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_int32s_t), (void **) &rule->groups.array, &rule->groups.used, &rule->groups.size); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "macro_f_number_unsigneds_t_increase_by", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -5280,7 +5280,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -5291,13 +5291,13 @@ extern "C" { status = F_status_set_fine(status); if (status == F_exist_not) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because no group was found by that name", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because no group was found by that name", i, line_item, global.thread, cache); } else if (status == F_number_too_large) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because the given ID is too large", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because the given ID is too large", i, line_item, global.thread, cache); } else if (status == F_number) { - controller_rule_setting_read_print_error_with_range(global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because the given ID is not a valid supported number", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error_with_range(&global.main->program.error, " has an invalid group", cache->content_actions.array[i].array[j], ", because the given ID is not a valid supported number", i, line_item, global.thread, cache); } else { @@ -5307,9 +5307,9 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_print_error(global.thread, global.main->program.error, cache->action, status, "f_account_group_id_by_name", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, status, "f_account_group_id_by_name", F_true, F_false); - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); } if (F_status_is_error_not(status_return)) { @@ -5337,10 +5337,10 @@ extern "C" { for (j = 0; j < cache->content_actions.array[i].used; ++j) { - status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values.array, &setting_values.used, &setting_values.size); + status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values->array, &setting_values->used, &setting_values->size); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -5358,7 +5358,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -5368,7 +5368,7 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[j], &setting_values->array[setting_values->used]); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false); setting_values->array[setting_values->used].used = 0; @@ -5388,7 +5388,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -5411,7 +5411,7 @@ extern "C" { fl_print_format(f_string_format_Q_single_s.string, global.main->program.error.to, global.main->program.error.notable, setting_values->array[setting_values->used], global.main->program.error.notable); fl_print_format(f_string_format_sentence_end_quote_s.string, global.main->program.error.to, global.main->program.error.context, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -5423,7 +5423,7 @@ extern "C" { else { // This function should only return F_complete_not_utf on error. - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_complete_not_utf, "controller_validate_environment_name", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_complete_not_utf, "controller_validate_environment_name", F_true, F_false); if (F_status_is_error_not(status_return)) { status_return = status; @@ -5432,7 +5432,7 @@ extern "C" { setting_values->array[setting_values->used].used = 0; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -5460,7 +5460,7 @@ extern "C" { // The "on" Rule Setting. if (cache->content_actions.array[i].used != 4) { - controller_rule_setting_read_print_error(global.main->program.error, "requires exactly four Content", i, line_item, global.thread, cache); + controller_rule_setting_read_print_error(&global.main->program.error, "requires exactly four Content", i, line_item, global.thread, cache); if (F_status_is_error_not(status_return)) { status_return = F_status_set_error(F_valid_not); @@ -5514,7 +5514,7 @@ extern "C" { fl_print_format("%[' but only supports %r, %r, %r, %r, %r", global.main->program.error.to, global.main->program.error.context, controller_freeze_s, controller_kill_s, controller_pause_s, controller_reload_s, controller_restart_s); fl_print_format("%r, %r, %r, and %r.%]%r", global.main->program.error.to, controller_resume_s, controller_start_s, controller_stop_s, controller_thaw_s, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -5535,7 +5535,7 @@ extern "C" { } if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "controller_rule_ons_increase", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "controller_rule_ons_increase", F_true, F_false); } else { if (f_compare_dynamic_partial_string(controller_need_s.string, cache->buffer_item, controller_need_s.used, cache->content_actions.array[i].array[1]) == F_equal_to) { @@ -5562,7 +5562,7 @@ extern "C" { fl_print_format(f_string_format_Q_range_single_s.string, global.main->program.error.to, global.main->program.error.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->program.error.notable); fl_print_format("%[' but only supports %r, %r, and %r.%]%r", global.main->program.error.to, global.main->program.error.context, controller_need_s, controller_want_s, controller_wish_s, global.main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(global.main->program.error, cache->action, F_false); + controller_rule_print_error_cache(&global.main->program.error, cache->action, F_false); controller_unlock_print_flush(global.main->program.error.to, global.thread); } @@ -5577,7 +5577,7 @@ extern "C" { status = f_memory_array_increase_by(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values->array, &setting_values->used, &setting_values->size); if (F_status_is_error(status)) { - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, F_false); } } @@ -5598,7 +5598,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -5623,7 +5623,7 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_rule_item_print_error(global.thread, global.main->program.error, cache->action, F_false, F_status_set_fine(status)); + controller_rule_item_print_error(global.thread, &global.main->program.error, cache->action, F_false, F_status_set_fine(status)); continue; } @@ -5635,7 +5635,7 @@ extern "C" { if (F_status_is_error(status)) { setting_values->array[setting_values->used].used = 0; - controller_rule_print_error(global.thread, global.main->program.error, cache->action, F_status_set_fine(status), "f_file_name_base", F_true, F_false); + controller_rule_print_error(global.thread, &global.main->program.error, cache->action, F_status_set_fine(status), "f_file_name_base", F_true, F_false); if (F_status_set_fine(status) == F_memory_not) { status_return = status; @@ -5685,7 +5685,7 @@ extern "C" { #ifndef _di_controller_rule_validate_ void controller_rule_validate(const controller_global_t global, const controller_rule_t rule, const uint8_t action, const uint8_t options, controller_cache_t * const cache) { - const controller_main_t *main = global.main; + controller_main_t * const main = global.main; switch (action) { case controller_rule_action_type_freeze_e: @@ -5707,7 +5707,7 @@ extern "C" { fl_print_format(f_string_format_r_single_s.string, main->program.error.to, main->program.error.notable, controller_rule_action_type_name(action), main->program.error.notable); fl_print_format("%[' while attempting to validate rule execution.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s); - controller_rule_print_error_cache(main->program.error, cache->action, F_true); + controller_rule_print_error_cache(&main->program.error, cache->action, F_true); controller_unlock_print_flush(main->program.error.to, global.thread); } @@ -6182,7 +6182,7 @@ extern "C" { f_status_t status_lock = controller_lock_read(is_normal, global.thread, &global.thread->lock.process); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); return status_lock; } @@ -6261,7 +6261,7 @@ extern "C" { status_lock = controller_lock_write(is_normal, global.thread, &process_list[i]->lock); if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_false, global.thread); f_thread_unlock(&process_list[i]->active); @@ -6364,7 +6364,7 @@ extern "C" { } // for if (F_status_is_error(status_lock)) { - controller_lock_print_error_critical(global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); + controller_lock_print_error_critical(&global.main->program.error, F_status_set_fine(status_lock), F_true, global.thread); return status_lock; } diff --git a/level_3/controller/c/rule/private-rule_print.c b/level_3/controller/c/rule/private-rule_print.c index 74a8f62..07e615d 100644 --- a/level_3/controller/c/rule/private-rule_print.c +++ b/level_3/controller/c/rule/private-rule_print.c @@ -11,59 +11,59 @@ extern "C" { #endif // _di_controller_rule_print_string_s_ #ifndef _di_controller_rule_print_error_ - void controller_rule_print_error(controller_thread_t * const thread, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item) { + void controller_rule_print_error(controller_thread_t * const thread, fl_print_t * const print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item) { - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; if (status == F_interrupt) return; // fll_error_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_lock_print(). f_thread_mutex_lock(&thread->lock.print); - fll_error_print(&print, status, function, fallback); // @fixme the print is a const and it is being passed as a pointer; the function needs to change. + fll_error_print(print, status, function, fallback); - f_file_stream_lock(print.to); + f_file_stream_lock(print->to); controller_rule_print_error_cache(print, cache, item); - controller_unlock_print_flush(print.to, thread); + controller_unlock_print_flush(print->to, thread); } #endif // _di_controller_rule_print_error_ #ifndef _di_controller_rule_print_error_cache_ - void controller_rule_print_error_cache(const fl_print_t print, const controller_cache_action_t cache, const bool item) { + void controller_rule_print_error_cache(fl_print_t * const print, const controller_cache_action_t cache, const bool item) { - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; - fl_print_format("%r%[%QWhile processing ", print.to, f_string_eol_s, print.context, print.prefix); + fl_print_format("%r%[%QWhile processing ", print->to, f_string_eol_s, print->context, print->prefix); if (cache.name_action.used) { - fl_print_format("%r '%]", print.to, item ? controller_action_s : controller_value_s, print.context); - fl_print_format(f_string_format_Q_single_s.string, print.to, print.notable, cache.name_action, print.notable); - fl_print_format("%[' on line%] ", print.to, print.context, print.context); - fl_print_format("%[%un%]", print.to, print.notable, cache.line_action, print.notable); - fl_print_format("%[ for ", print.to, print.context); + fl_print_format("%r '%]", print->to, item ? controller_action_s : controller_value_s, print->context); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache.name_action, print->notable); + fl_print_format("%[' on line%] ", print->to, print->context, print->context); + fl_print_format("%[%un%]", print->to, print->notable, cache.line_action, print->notable); + fl_print_format("%[ for ", print->to, print->context); } if (cache.name_item.used) { - fl_print_format("rule %r '%]", print.to, item ? controller_item_s : controller_settings_s, print.context); - fl_print_format(f_string_format_Q_single_s.string, print.to, print.notable, cache.name_item, print.notable); - fl_print_format("%[' on line%] ", print.to, print.context, print.context); - fl_print_format("%[%un%]", print.to, print.notable, cache.line_item, print.notable); - fl_print_format("%[ for ", print.to, print.context); + fl_print_format("rule %r '%]", print->to, item ? controller_item_s : controller_settings_s, print->context); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache.name_item, print->notable); + fl_print_format("%[' on line%] ", print->to, print->context, print->context); + fl_print_format("%[%un%]", print->to, print->notable, cache.line_item, print->notable); + fl_print_format("%[ for ", print->to, print->context); } if (cache.name_file.used) { - fl_print_format("rule file '%]%[%Q%]%['", print.to, print.context, print.notable, cache.name_file, print.notable, print.context); + fl_print_format("rule file '%]%[%Q%]%['", print->to, print->context, print->notable, cache.name_file, print->notable, print->context); } - fl_print_format(".%]%r", print.to, print.context, f_string_eol_s); + fl_print_format(".%]%r", print->to, print->context, f_string_eol_s); } #endif // _di_controller_rule_print_error_cache_ #ifndef _di_controller_rule_item_print_error_ - void controller_rule_item_print_error(controller_thread_t * const thread, const fl_print_t print, const controller_cache_action_t cache, const bool item, const f_status_t status) { + void controller_rule_item_print_error(controller_thread_t * const thread, fl_print_t * const print, const controller_cache_action_t cache, const bool item, const f_status_t status) { - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; if (status == F_interrupt) return; // fll_error_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_lock_print(). @@ -71,9 +71,9 @@ extern "C" { controller_rule_print_error_cache(print, cache, item); - f_file_stream_lock(print.to); + f_file_stream_lock(print->to); - controller_unlock_print_flush(print.to, thread); + controller_unlock_print_flush(print->to, thread); } #endif // _di_controller_rule_item_print_error_ @@ -329,45 +329,45 @@ extern "C" { #endif // _di_controller_rule_item_print_error_execute_ #ifndef _di_controller_rule_action_print_error_missing_pid_ - void controller_rule_action_print_error_missing_pid(const fl_print_t print, const f_string_static_t alias) { + void controller_rule_action_print_error_missing_pid(fl_print_t * const print, const f_string_static_t alias) { - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; - fl_print_format("%r%[%QThe rule '%]", 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, alias, print.notable); - fl_print_format("%[' is not designating a pid file.%]%r", print.to, print.context, print.context, f_string_eol_s); + fl_print_format("%r%[%QThe rule '%]", 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, alias, print->notable); + fl_print_format("%[' is not designating a pid file.%]%r", print->to, print->context, print->context, f_string_eol_s); } #endif // _di_controller_rule_action_print_error_missing_pid_ #ifndef _di_controller_rule_item_print_error_need_want_wish_ - void controller_rule_item_print_error_need_want_wish(const fl_print_t print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why) { + void controller_rule_item_print_error_need_want_wish(fl_print_t * const print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why) { - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; - fl_print_format("%r%[%QThe %r rule '%]", print.to, f_string_eol_s, print.context, print.prefix, need_want_wish, print.context); - fl_print_format(f_string_format_Q_single_s.string, print.to, print.notable, value, print.notable); - fl_print_format("%[' %S.%]%r", print.to, print.context, why, print.context, f_string_eol_s); + fl_print_format("%r%[%QThe %r rule '%]", print->to, f_string_eol_s, print->context, print->prefix, need_want_wish, print->context); + fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, value, print->notable); + fl_print_format("%[' %S.%]%r", print->to, print->context, why, print->context, f_string_eol_s); } #endif // _di_controller_rule_item_print_error_need_want_wish_ #ifndef _di_controller_rule_item_print_error_rule_not_loaded_ - void controller_rule_item_print_error_rule_not_loaded(const fl_print_t print, const f_string_static_t alias) { + void controller_rule_item_print_error_rule_not_loaded(fl_print_t * const print, const f_string_static_t alias) { - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; - fl_print_format("%r%[%QThe rule '%]", 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, alias, print.notable); - fl_print_format("%[' is no longer loaded.%]%r", print.to, print.context, print.context, f_string_eol_s); + fl_print_format("%r%[%QThe rule '%]", 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, alias, print->notable); + fl_print_format("%[' is no longer loaded.%]%r", print->to, print->context, print->context, f_string_eol_s); } #endif // _di_controller_rule_item_print_error_rule_not_loaded_ #ifndef _di_controller_rule_setting_read_print_error_ - void controller_rule_setting_read_print_error(const fl_print_t print, const f_string_t message, const f_number_unsigned_t index, const f_number_unsigned_t line_item, controller_thread_t * const thread, controller_cache_t * const cache) { + void controller_rule_setting_read_print_error(fl_print_t * const print, const f_string_t message, const f_number_unsigned_t index, const f_number_unsigned_t line_item, controller_thread_t * const thread, controller_cache_t * const cache) { - if (!print.custom) return; - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (!print->custom) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; - controller_main_t * const main = (controller_main_t *) print.custom; + controller_main_t * const main = (controller_main_t *) print->custom; f_state_t state = f_state_t_initialize; @@ -377,23 +377,23 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_lock_print(print.to, thread); + controller_lock_print(print->to, thread); - fl_print_format("%r%[%QRule setting %S.%]%r", print.to, f_string_eol_s, print.context, print.prefix, message, print.context, f_string_eol_s); + fl_print_format("%r%[%QRule setting %S.%]%r", print->to, f_string_eol_s, print->context, print->prefix, message, print->context, f_string_eol_s); controller_rule_print_error_cache(print, cache->action, F_false); - controller_unlock_print_flush(print.to, thread); + controller_unlock_print_flush(print->to, thread); } #endif // _di_controller_rule_setting_read_print_error_ #ifndef _di_controller_rule_setting_read_print_error_with_range_ - void controller_rule_setting_read_print_error_with_range(const fl_print_t print, const f_string_t before, const f_range_t range, const f_string_t after, const f_number_unsigned_t index, const f_number_unsigned_t line_item, controller_thread_t * const thread, controller_cache_t * const cache) { + void controller_rule_setting_read_print_error_with_range(fl_print_t * const print, const f_string_t before, const f_range_t range, const f_string_t after, const f_number_unsigned_t index, const f_number_unsigned_t line_item, controller_thread_t * const thread, controller_cache_t * const cache) { - if (!print.custom) return; - if (print.verbosity == f_console_verbosity_quiet_e) return; + if (!print->custom) return; + if (print->verbosity == f_console_verbosity_quiet_e) return; - controller_main_t * const main = (controller_main_t *) print.custom; + controller_main_t * const main = (controller_main_t *) print->custom; f_state_t state = f_state_t_initialize; @@ -403,15 +403,15 @@ extern "C" { cache->action.line_action = ++cache->action.line_item; - controller_lock_print(print.to, thread); + controller_lock_print(print->to, thread); - fl_print_format("%r%[%QRule setting%S '%]", print.to, f_string_eol_s, print.context, print.prefix, before, print.context); - fl_print_format(f_string_format_Q_range_single_s.string, print.to, print.notable, cache->buffer_item, range, print.notable); - fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); + fl_print_format("%r%[%QRule setting%S '%]", print->to, f_string_eol_s, print->context, print->prefix, before, print->context); + fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->notable, cache->buffer_item, range, print->notable); + fl_print_format("%['%S.%]%r", print->to, print->context, after, print->context, f_string_eol_s); controller_rule_print_error_cache(print, cache->action, F_false); - controller_unlock_print_flush(print.to, thread); + controller_unlock_print_flush(print->to, thread); } #endif // _di_controller_rule_setting_read_print_error_with_range_ @@ -427,7 +427,7 @@ extern "C" { controller_lock_print(global.main->program.output.to, global.thread); fl_print_format("%rProcessing rule item action '%[%Q%]'", global.main->program.output.to, f_string_eol_s, global.main->program.context.set.title, name, global.main->program.context.set.title); - fl_print_format(" mapping '%[%Q%]'", global.main->program.output.to, global.main->program.context.set.important, map.name, global.main->program.context.set.important); + fl_print_format(" mapping '%[%Q%]'", global.main->program.output.to, global.main->program.context.set.important, map.key, global.main->program.context.set.important); fl_print_format(" to value '%[%Q%]'.%r", global.main->program.output.to, global.main->program.context.set.important, map.value, global.main->program.context.set.important, f_string_eol_s); controller_unlock_print_flush(global.main->program.output.to, global.thread); diff --git a/level_3/controller/c/rule/private-rule_print.h b/level_3/controller/c/rule/private-rule_print.h index 6271042..38452e2 100644 --- a/level_3/controller/c/rule/private-rule_print.h +++ b/level_3/controller/c/rule/private-rule_print.h @@ -49,7 +49,7 @@ extern "C" { * @see controller_rule_print_error_cache() */ #ifndef _di_controller_rule_print_error_ - extern void controller_rule_print_error(controller_thread_t * const thread, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item) F_attribute_visibility_internal_d; + extern void controller_rule_print_error(controller_thread_t * const thread, fl_print_t * const print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item) F_attribute_visibility_internal_d; #endif // _di_controller_rule_print_error_ /** @@ -74,7 +74,7 @@ extern "C" { * @see controller_rule_setting_read() */ #ifndef _di_controller_rule_print_error_cache_ - extern void controller_rule_print_error_cache(const fl_print_t print, const controller_cache_action_t cache, const bool item) F_attribute_visibility_internal_d; + extern void controller_rule_print_error_cache(fl_print_t * const print, const controller_cache_action_t cache, const bool item) F_attribute_visibility_internal_d; #endif // _di_controller_rule_print_error_cache_ /** @@ -97,7 +97,7 @@ extern "C" { * @see controller_rule_print_error_cache() */ #ifndef _di_controller_rule_item_print_error_ - extern void controller_rule_item_print_error(controller_thread_t * const thread, const fl_print_t print, const controller_cache_action_t cache, const bool item, const f_status_t status) F_attribute_visibility_internal_d; + extern void controller_rule_item_print_error(controller_thread_t * const thread, fl_print_t * const print, const controller_cache_action_t cache, const bool item, const f_status_t status) F_attribute_visibility_internal_d; #endif // _di_controller_rule_item_print_error_ /** @@ -128,7 +128,7 @@ extern "C" { * The rule alias of the rule that is missing the pid file designation. */ #ifndef _di_controller_rule_action_print_error_missing_pid_ - extern void controller_rule_action_print_error_missing_pid(const fl_print_t print, const f_string_static_t alias) F_attribute_visibility_internal_d; + extern void controller_rule_action_print_error_missing_pid(fl_print_t * const print, const f_string_static_t alias) F_attribute_visibility_internal_d; #endif // _di_controller_rule_action_print_error_missing_pid_ /** @@ -145,7 +145,7 @@ extern "C" { * A short explanation on why this is an error or warning. */ #ifndef _di_controller_rule_item_print_error_need_want_wish_ - extern void controller_rule_item_print_error_need_want_wish(const fl_print_t print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why) F_attribute_visibility_internal_d; + extern void controller_rule_item_print_error_need_want_wish(fl_print_t * const print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why) F_attribute_visibility_internal_d; #endif // _di_controller_rule_item_print_error_need_want_wish_ /** @@ -157,7 +157,7 @@ extern "C" { * The rule alias of the rule that is not loaded. */ #ifndef _di_controller_rule_item_print_error_rule_not_loaded_ - extern void controller_rule_item_print_error_rule_not_loaded(const fl_print_t print, const f_string_static_t alias) F_attribute_visibility_internal_d; + extern void controller_rule_item_print_error_rule_not_loaded(fl_print_t * const print, const f_string_static_t alias) F_attribute_visibility_internal_d; #endif // _di_controller_rule_item_print_error_rule_not_loaded_ /** @@ -182,7 +182,7 @@ extern "C" { * @see controller_rule_setting_read() */ #ifndef _di_controller_rule_setting_read_print_error_ - extern void controller_rule_setting_read_print_error(const fl_print_t print, const f_string_t message, const f_number_unsigned_t index, const f_number_unsigned_t line_item, controller_thread_t * const thread, controller_cache_t * const cache) F_attribute_visibility_internal_d; + extern void controller_rule_setting_read_print_error(fl_print_t * const print, const f_string_t message, const f_number_unsigned_t index, const f_number_unsigned_t line_item, controller_thread_t * const thread, controller_cache_t * const cache) F_attribute_visibility_internal_d; #endif // _di_controller_rule_setting_read_print_error_ /** @@ -211,7 +211,7 @@ extern "C" { * @see controller_rule_setting_read() */ #ifndef _di_controller_rule_setting_read_print_error_with_range_ - extern void controller_rule_setting_read_print_error_with_range(const fl_print_t print, const f_string_t before, const f_range_t range, const f_string_t after, const f_number_unsigned_t index, const f_number_unsigned_t line_item, controller_thread_t * const thread, controller_cache_t * const cache) F_attribute_visibility_internal_d; + extern void controller_rule_setting_read_print_error_with_range(fl_print_t * const print, const f_string_t before, const f_range_t range, const f_string_t after, const f_number_unsigned_t index, const f_number_unsigned_t line_item, controller_thread_t * const thread, controller_cache_t * const cache) F_attribute_visibility_internal_d; #endif // _di_controller_rule_setting_read_print_error_with_range_ /** diff --git a/level_3/controller/c/thread/private-thread.c b/level_3/controller/c/thread/private-thread.c index 0630c39..ed0a500 100644 --- a/level_3/controller/c/thread/private-thread.c +++ b/level_3/controller/c/thread/private-thread.c @@ -95,7 +95,7 @@ extern "C" { status = f_thread_lock_write(&process->lock); if (F_status_is_error(status)) { - controller_lock_print_error_critical(global->main->program.error, F_status_set_fine(status), F_false, global->thread); + controller_lock_print_error_critical(&global->main->program.error, F_status_set_fine(status), F_false, global->thread); f_thread_unlock(&process->active); continue; @@ -173,11 +173,7 @@ extern "C" { #ifndef _di_controller_thread_is_enabled_ f_status_t controller_thread_is_enabled(const bool is_normal, controller_thread_t * const thread) { - if (is_normal) { - return thread->enabled == controller_thread_enabled_e; - } - - return thread->enabled; + return is_normal ? thread->enabled == controller_thread_enabled_e : thread->enabled; } #endif // _di_controller_thread_is_enabled_ @@ -215,7 +211,7 @@ extern "C" { status = controller_processs_increase(&thread.processs); if (F_status_is_error(status)) { - controller_print_error(&thread, main->program.error, F_status_set_fine(status), "controller_processs_increase", F_true); + controller_print_error(&thread, &main->program.error, F_status_set_fine(status), "controller_processs_increase", F_true); } } @@ -227,7 +223,7 @@ extern "C" { thread.id_signal = 0; if (main->program.error.verbosity > f_console_verbosity_quiet_e) { - controller_print_error(&thread, main->program.error, F_status_set_fine(status), "f_thread_create", F_true); + controller_print_error(&thread, &main->program.error, F_status_set_fine(status), "f_thread_create", F_true); } } else { @@ -256,7 +252,7 @@ extern "C" { if (F_status_is_error(status)) { if (main->program.error.verbosity > f_console_verbosity_quiet_e) { - controller_print_error(&thread, main->program.error, F_status_set_fine(status), "f_thread_create", F_true); + controller_print_error(&thread, &main->program.error, F_status_set_fine(status), "f_thread_create", F_true); } } else { @@ -289,7 +285,7 @@ extern "C" { thread.id_cleanup = 0; if (main->program.error.verbosity > f_console_verbosity_quiet_e) { - controller_print_error(&thread, main->program.error, F_status_set_fine(status), "f_thread_create", F_true); + controller_print_error(&thread, &main->program.error, F_status_set_fine(status), "f_thread_create", F_true); } } } diff --git a/level_3/controller/c/thread/private-thread_process.c b/level_3/controller/c/thread/private-thread_process.c index 8565e7a..e93d767 100644 --- a/level_3/controller/c/thread/private-thread_process.c +++ b/level_3/controller/c/thread/private-thread_process.c @@ -363,7 +363,7 @@ extern "C" { if (F_status_is_error(status)) { if (global->main->program.error.verbosity > f_console_verbosity_quiet_e) { - controller_print_error(global->thread, global->main->program.error, F_status_set_fine(status), "f_thread_create", F_true); + controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_thread_create", F_true); } if (F_status_is_error_not(f_thread_mutex_lock(&global->thread->lock.alert))) { diff --git a/level_3/controller/c/thread/private-thread_signal.c b/level_3/controller/c/thread/private-thread_signal.c index 006cdd5..c65b1f1 100644 --- a/level_3/controller/c/thread/private-thread_signal.c +++ b/level_3/controller/c/thread/private-thread_signal.c @@ -43,46 +43,38 @@ extern "C" { #endif // _di_controller_thread_signal_ #ifndef _di_controller_thread_signal_state_fss_ - f_status_t controller_thread_signal_state_fss(f_state_t * const state, void * const internal) { + void controller_thread_signal_state_fss(f_state_t * const state, void * const internal) { - if (!state || !state->custom) { - return F_interrupt_not; - } - - controller_state_interrupt_t *custom = (controller_state_interrupt_t *) state->custom; - controller_thread_t *thread = custom->thread; + if (!state || !state->custom) return; - if (!controller_thread_is_enabled(custom->is_normal, thread)) { - return F_status_set_error(F_interrupt); - } + controller_global_t * const global = (controller_global_t *) state->custom; - if (thread->signal == F_signal_interrupt || thread->signal == F_signal_abort || thread->signal == F_signal_quit || thread->signal == F_signal_termination) { - return F_status_set_error(F_interrupt); + /*if (!controller_thread_is_enabled(custom->is_normal, global->thread)) { + global->main->program.signal_received = F_signal_abort; + global->main->setting.state.status = F_status_set_error(F_interrupt); } - - return F_interrupt_not; + else if (global->thread->signal == F_signal_interrupt || global->thread->signal == F_signal_abort || global->thread->signal == F_signal_quit || global->thread->signal == F_signal_termination) { + global->main->program.signal_received = F_signal_abort; + global->main->setting.state.status = F_status_set_error(F_interrupt); + }*/ } #endif // _di_controller_thread_signal_state_fss_ #ifndef _di_controller_thread_signal_state_iki_ - f_status_t controller_thread_signal_state_iki(f_state_t * const state, void * const internal) { + void controller_thread_signal_state_iki(f_state_t * const state, void * const internal) { - if (!state || !state->custom) { - return F_interrupt_not; - } - - controller_state_interrupt_t *custom = (controller_state_interrupt_t *) state->custom; - controller_thread_t *thread = custom->thread; + if (!state || !state->custom) return; - if (!controller_thread_is_enabled(custom->is_normal, thread)) { - return F_status_set_error(F_interrupt); - } + controller_global_t * const global = (controller_global_t *) state->custom; - if (thread->signal == F_signal_interrupt || thread->signal == F_signal_abort || thread->signal == F_signal_quit || thread->signal == F_signal_termination) { - return F_status_set_error(F_interrupt); + /*if (!controller_thread_is_enabled(custom->is_normal, global->thread)) { + global->main->program.signal_received = F_signal_abort; + global->main->setting.state.status = F_status_set_error(F_interrupt); } - - return F_interrupt_not; + else if (global->thread->signal == F_signal_interrupt || global->thread->signal == F_signal_abort || global->thread->signal == F_signal_quit || global->thread->signal == F_signal_termination) { + global->main->program.signal_received = F_signal_abort; + global->main->setting.state.status = F_status_set_error(F_interrupt); + }*/ } #endif // _di_controller_thread_signal_state_iki_ diff --git a/level_3/controller/c/thread/private-thread_signal.h b/level_3/controller/c/thread/private-thread_signal.h index 8cfc53c..218ff2e 100644 --- a/level_3/controller/c/thread/private-thread_signal.h +++ b/level_3/controller/c/thread/private-thread_signal.h @@ -39,7 +39,7 @@ extern "C" { * F_interrupt (with error bit) if interrupted. */ #ifndef _di_controller_thread_signal_state_fss_ - extern f_status_t controller_thread_signal_state_fss(f_state_t * const state, void * const internal) F_attribute_visibility_internal_d; + extern void controller_thread_signal_state_fss(f_state_t * const state, void * const internal); #endif // _di_controller_thread_signal_state_fss_ /** @@ -56,7 +56,7 @@ extern "C" { * F_interrupt (with error bit) if interrupted. */ #ifndef _di_controller_thread_signal_state_iki_ - extern f_status_t controller_thread_signal_state_iki(f_state_t * const state, void * const internal) F_attribute_visibility_internal_d; + extern void controller_thread_signal_state_iki(f_state_t * const state, void * const internal); #endif // _di_controller_thread_signal_state_iki_ /** -- 1.8.3.1