}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fll_error_file_print(global.main->error, F_status_set_fine(status), "f_file_stream_open", F_true, path, "open", fll_error_file_type_file);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_error_file_print(global.main->error, F_status_set_fine(status), "f_file_stream_open", F_true, path, "open", fll_error_file_type_file, global.thread);
}
}
else {
if (F_status_is_error(status)) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fll_error_file_print(global.main->error, F_status_set_fine(status), "f_file_stream_read", F_true, path, "read", fll_error_file_type_file);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_error_file_print(global.main->error, F_status_set_fine(status), "f_file_stream_read", F_true, path, "read", fll_error_file_type_file, global.thread);
}
}
}
if (F_status_is_error(status)) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- fll_error_file_print(global.main->error, F_status_set_fine(status), "f_file_stat", F_true, path, "stat", fll_error_file_type_file);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_error_file_print(global.main->error, F_status_set_fine(status), "f_file_stat", F_true, path, "stat", fll_error_file_type_file, global.thread);
}
}
else {
// always return immediately on memory errors.
if (F_status_set_fine(status) == F_memory_not) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->error.to, global.thread);
+
+ controller_error_file_print(global.main->error, F_status_set_fine(status), "controller_file_pid_create", F_true, global.setting->path_pid.string, "create", fll_error_file_type_file, 0);
- fll_error_file_print(global.main->error, F_status_set_fine(status), "controller_file_pid_create", F_true, global.setting->path_pid.string, "create", fll_error_file_type_file);
+ flockfile(global.main->error.to.stream);
controller_entry_error_print_cache(is_entry, global.main->error, cache->action);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
return status;
}
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->warning.to, global.thread);
- fll_error_file_print(global.main->warning, F_status_set_fine(status), "controller_file_pid_create", F_true, global.setting->path_pid.string, "create", fll_error_file_type_file);
+ controller_error_file_print(global.main->warning, F_status_set_fine(status), "controller_file_pid_create", F_true, global.setting->path_pid.string, "create", fll_error_file_type_file, 0);
+
+ flockfile(global.main->warning.to.stream);
controller_entry_error_print_cache(is_entry, global.main->warning, cache->action);
- controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->warning.to, global.thread);
}
status = F_none;
if (global.setting->ready == controller_setting_ready_wait) {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->warning.to.stream);
+ controller_print_lock(global.main->warning.to, global.thread);
fl_print_format("%c%[%SMultiple '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
fl_print_format("%[%s%]", global.main->warning.to.stream, global.main->warning.notable, controller_string_ready_s, global.main->warning.notable);
controller_entry_error_print_cache(is_entry, global.main->warning, cache->action);
- funlockfile(global.main->warning.to.stream);
-
- controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->warning.to, global.thread);
}
}
if (cache->ats.array[j] == i) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SThe %s item named '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, entry->items.array[i].name, global.main->error.notable);
controller_entry_error_print_cache(is_entry, global.main->error, cache->action);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status)) {
if (error_has || i >= entry->items.used) {
if (i >= entry->items.used) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SThe %s item named '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, actions->array[cache->ats.array[at_j]].parameters.array[0], global.main->error.notable);
controller_entry_error_print_cache(is_entry, global.main->error, cache->action);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status)) {
if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->output.stream);
+ controller_print_lock(global->main->output, global->thread);
fl_print_format("%cProcessing %s%s item '", global->main->output.stream, f_string_eol_s[0], failsafe ? "failsafe " : "", is_entry ? controller_string_entry_s : controller_string_exit_s);
fl_print_format("%[%Q%]'.%c", global->main->output.stream, global->main->context.set.notable, cache->action.name_item, global->main->context.set.notable, f_string_eol_s[0]);
- funlockfile(global->main->output.stream);
-
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
}
if (controller_entry_action_type_is_rule(entry_action->type)) {
if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->output.stream);
+ controller_print_lock(global->main->output, global->thread);
fl_print_format("%cThe %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
fl_print_format("%[%Q%]", global->main->output.stream, global->main->context.set.title, cache->action.name_action, global->main->context.set.title);
if (entry_action->parameters.used) {
fl_print_format(" %[", global->main->output.stream, global->main->context.set.notable);
- controller_entry_action_parameters_print(global->main->output.stream, entry_actions->array[cache->ats.array[at_j]]);
+ controller_entry_action_parameters_print(global->main->output.stream, *entry_action);
fl_print_format("%]", global->main->output.stream, global->main->context.set.notable);
}
fl_print_format("' is %s and is in a %[failed%] state, skipping execution.%c", global->main->output.stream, entry_action->code & controller_entry_rule_code_require ? "required" : "optional", f_string_eol_s[0]);
- funlockfile(global->main->output.stream);
-
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
}
else if ((entry_action->code & controller_entry_rule_code_require) && global->main->error.verbosity != f_console_verbosity_quiet || global->main->warning.verbosity == f_console_verbosity_verbose || global->main->warning.verbosity == f_console_verbosity_debug) {
output = &global->main->warning;
}
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(output->to.stream);
+ controller_print_lock(output->to, global->thread);
fl_print_format("%c%[%SThe %s item action '%]", output->to.stream, f_string_eol_s[0], output->context, output->prefix ? output->prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s, output->context);
fl_print_format("%[%Q%]", output->to.stream, output->notable, cache->action.name_action, output->notable);
if (entry_action->parameters.used) {
- fl_print_format(" %[%S%]", output->to.stream, output->notable, entry_actions->array[cache->ats.array[at_j]], output->notable);
+ fl_print_format(" %[", output->to.stream, global->main->context.set.notable);
+
+ controller_entry_action_parameters_print(output->to.stream, *entry_action);
+
+ fl_print_format("%]", output->to.stream, global->main->context.set.notable);
}
fl_print_format("%[' is%] %[required%]", output->to.stream, output->context, output->context, output->notable, output->notable);
controller_entry_error_print_cache(is_entry, *output, cache->action);
- funlockfile(output->to.stream);
-
- controller_print_unlock_flush(output->to.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(output->to, global->thread);
if (entry_action->code & controller_entry_rule_code_require) {
return F_status_is_error(F_require);
output = &global->main->warning;
}
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(output->to.stream);
+ controller_print_lock(output->to, global->thread);
fl_print_format("%c%[%SThe %s item action '%]", output->to.stream, f_string_eol_s[0], output->context, output->prefix ? output->prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s, output->context);
fl_print_format("%[%Q%]", output->to.stream, output->notable, cache->action.name_action, output->notable);
if (entry_action->parameters.used) {
- fl_print_format(" %[%S%]", output->to.stream, output->notable, entry_actions->array[cache->ats.array[at_j]], output->notable);
+ fl_print_format(" %[", output->to.stream, global->main->context.set.notable);
+
+ controller_entry_action_parameters_print(output->to.stream, *entry_action);
+
+ fl_print_format("%]", output->to.stream, global->main->context.set.notable);
}
fl_print_format(" %[is in a%] %[failed%]", output->to.stream, output->context, output->context, output->notable, output->notable);
controller_entry_error_print_cache(is_entry, *output, cache->action);
- funlockfile(output->to.stream);
-
- controller_print_unlock_flush(output->to.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(output->to, global->thread);
}
}
if (entry_action->code & controller_entry_rule_code_wait) {
if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->output.stream);
+ controller_print_lock(global->main->output, global->thread);
fl_print_format("%cWaiting before processing %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
fl_print_format("%[%s%]", global->main->output.stream, global->main->context.set.title, controller_string_ready_s, global->main->context.set.title);
fl_print_format("'.%c", global->main->output.stream, f_string_eol_s[0]);
- funlockfile(global->main->output.stream);
-
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
}
if (global->setting->ready == controller_setting_ready_wait) {
if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->output.stream);
+ controller_print_lock(global->main->output, global->thread);
fl_print_format("%cWaiting before processing %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
fl_print_format("%[%s%]", global->main->output.stream, global->main->context.set.title, controller_string_ready_s, global->main->context.set.title);
fl_print_format("'.%c", global->main->output.stream, f_string_eol_s[0]);
- funlockfile(global->main->output.stream);
-
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
}
}
else if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->output.stream);
+ controller_print_lock(global->main->output, global->thread);
fl_print_format("%cIgnoring %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
fl_print_format("%[%s%]", global->main->output.stream, global->main->context.set.title, controller_string_ready_s, global->main->context.set.title);
fl_print_format("', state already is ready.%c", global->main->output.stream, f_string_eol_s[0]);
- funlockfile(global->main->output.stream);
-
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
}
}
// This should not happen if the pre-process is working as intended, but in case it doesn't, return a critical error to prevent infinite recursion and similar errors.
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->error.to.stream);
+ controller_print_lock(global->main->error.to, global->thread);
fl_print_format("%c%[Invalid %s item index '%]", global->main->error.to.stream, f_string_eol_s[0], global->main->error.context, is_entry ? controller_string_entry_s : controller_string_exit_s, global->main->error.context);
fl_print_format("%[%un%]", global->main->error.to.stream, global->main->error.notable, entry_action->number, global->main->error.notable);
controller_entry_error_print_cache(is_entry, global->main->error, cache->action);
- funlockfile(global->main->error.to.stream);
-
- controller_print_unlock_flush(global->main->error.to.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->error.to, global->thread);
}
return F_status_is_error(F_critical);
if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->output.stream);
+ controller_print_lock(global->main->output, global->thread);
fl_print_format("%cProcessing %s item '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
fl_print_format("%[%Q%]", global->main->output.stream, global->main->context.set.title, cache->action.name_item, global->main->context.set.title);
fl_print_format("'.%c", global->main->output.stream, f_string_eol_s[0]);
- funlockfile(global->main->output.stream);
-
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
}
if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->output.stream);
+ controller_print_lock(global->main->output, global->thread);
fl_print_format("%c%s %s item rule '", global->main->output.stream, f_string_eol_s[0], entry_action->type == controller_entry_action_type_consider ? "Considering" : "Processing", is_entry ? controller_string_entry_s : controller_string_exit_s);
fl_print_format("%[%Q%]", global->main->output.stream, global->main->context.set.title, alias_rule, global->main->context.set.title);
fl_print_format("'.%c", global->main->output.stream, f_string_eol_s[0]);
- funlockfile(global->main->output.stream);
-
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
}
if (F_status_is_error(status)) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
+ controller_print_lock(global->main->output, global->thread);
controller_entry_error_print_cache(is_entry, global->main->error, cache->action);
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
if (global->main->parameters[controller_parameter_simulate].result == f_console_result_none) {
else if (entry_action->type == controller_entry_action_type_execute) {
if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->output.stream);
+ controller_print_lock(global->main->output, global->thread);
fl_print_format("%c%s is executing '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
fl_print_format("'.%c", global->main->output.stream, f_string_eol_s[0]);
- funlockfile(global->main->output.stream);
-
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
}
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_file_found_not) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->error.to.stream);
+ controller_print_lock(global->main->error.to, global->thread);
fl_print_format("%c%[%SExecution failed, unable to find program or script '%]", global->main->error.to.stream, f_string_eol_s[0], global->main->error.context, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, global->main->error.context);
fl_print_format("%[%Q%]", global->main->error.to.stream, global->main->error.notable, entry_action->parameters.array[0], global->main->error.notable);
controller_entry_error_print_cache(is_entry, global->main->error, cache->action);
- funlockfile(global->main->error.to.stream);
-
- controller_print_unlock_flush(global->main->error.to.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->error.to, global->thread);
}
}
else {
}
else if (result != 0) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->error.to.stream);
+ controller_print_lock(global->main->error.to, global->thread);
fl_print_format("%c%[%SExecution failed with return value of '%]", global->main->error.to.stream, f_string_eol_s[0], global->main->error.context, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, global->main->error.context);
fl_print_format("%[%i%]", global->main->error.to.stream, global->main->error.notable, result, global->main->error.notable);
controller_entry_error_print_cache(is_entry, global->main->error, cache->action);
- funlockfile(global->main->error.to.stream);
-
- controller_print_unlock_flush(global->main->error.to.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->error.to, global->thread);
}
return F_status_set_error(F_execute);
}
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->output.stream);
+ controller_print_lock(global->main->output, global->thread);
fl_print_format("%cProcessing %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
fl_print_format("%[%s%]' setting '", global->main->output.stream, global->main->context.set.title, controller_string_timeout_s, global->main->context.set.title);
fl_print_format("%[%S%]' to '", global->main->output.stream, global->main->context.set.important, code, global->main->context.set.important);
fl_print_format("%[%un%]' MegaTime (milliseconds).%c", global->main->output.stream, global->main->context.set.important, entry_action->number, global->main->context.set.important, f_string_eol_s[0]);
- funlockfile(global->main->output.stream);
-
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
}
if (failsafe) {
if (global->main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->error.to.stream);
+ controller_print_lock(global->main->warning.to, global->thread);
fl_print_format("%c%[%SFailsafe may not be specified when running in failsafe, ignoring.%]%c", global->main->warning.to.stream, f_string_eol_s[0], global->main->warning.context, global->main->warning.prefix ? global->main->warning.prefix : f_string_empty_s, global->main->warning.context, f_string_eol_s[0]);
controller_entry_error_print_cache(is_entry, global->main->warning, cache->action);
- funlockfile(global->main->warning.to.stream);
-
- controller_print_unlock_flush(global->main->warning.to.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->warning.to, global->thread);
}
}
else {
// This should not happen if the pre-process is working as designed, but in case it doesn't, return a critical error to prevent infinite recursion and similar errors.
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->error.to.stream);
+ controller_print_lock(global->main->error.to, global->thread);
fl_print_format("%c%[%SInvalid %s item index '%]", global->main->error.to.stream, f_string_eol_s[0], global->main->error.context, global->main->error.prefix ? global->main->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s, global->main->error.context);
fl_print_format("%[%un%]", global->main->error.to.stream, global->main->error.notable, entry_action->number, global->main->error.notable);
controller_entry_error_print_cache(is_entry, global->main->error, cache->action);
- funlockfile(global->main->error.to.stream);
-
- controller_print_unlock_flush(global->main->error.to.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->error.to, global->thread);
}
return F_status_is_error(F_critical);
if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose) {
if (global->main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->output.stream);
+ controller_print_lock(global->main->output, global->thread);
fl_print_format("%cProcessing %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
fl_print_format("%[%s%]' setting value to '", global->main->output.stream, global->main->context.set.title, controller_string_failsafe_s, global->main->context.set.title);
fl_print_format("%[%Q%]", global->main->output.stream, global->main->context.set.important, entry->items.array[global->setting->failsafe_item_id].name, global->main->context.set.important);
fl_print_format("'.%c", global->main->output.stream, f_string_eol_s[0]);
- funlockfile(global->main->output.stream);
-
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
}
}
}
if ((global->main->parameters[controller_parameter_simulate].result == f_console_result_found && global->main->error.verbosity != f_console_verbosity_quiet) || global->main->error.verbosity == f_console_verbosity_verbose) {
- f_thread_mutex_lock(&global->thread->lock.print);
-
- flockfile(global->main->output.stream);
+ controller_print_lock(global->main->output, global->thread);
fl_print_format("%cDone processing %s item '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s);
fl_print_format("%[%s%]", global->main->output.stream, global->main->context.set.title, controller_string_main_s, global->main->context.set.title);
f_print_terminated(f_string_eol_s, global->main->output.stream);
}
- funlockfile(global->main->output.stream);
-
- controller_print_unlock_flush(global->main->output.stream, &global->thread->lock.print);
+ controller_print_unlock_flush(global->main->output, global->thread);
}
return status;
controller_error_print(global.main->error, F_status_set_fine(status), "f_string_dynamics_increase", F_true, global.thread);
}
else {
-
actions->array[actions->used].type = type;
actions->array[actions->used].line = cache->action.line_action;
actions->array[actions->used].parameters.used = 0;
controller_error_print(global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, global.thread);
}
else {
- actions->array[actions->used].parameters.used = 1;
- ++actions->used;
+ actions->array[actions->used++].parameters.used = 1;
}
}
controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large, controller_common_allocation_small, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+ 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);
}
controller_error_print(global.main->error, F_status_set_fine(status), "fll_fss_extended_read", F_true, global.thread);
}
else {
-
status = fl_fss_apply_delimit(cache->delimits, &cache->buffer_item);
if (F_status_is_error(status)) {
controller_error_print(global.main->error, F_status_set_fine(status), "fl_fss_apply_delimit", F_true, global.thread);
}
else {
-
f_array_length_t i = 0;
f_array_length_t j = 0;
if (F_status_is_error(status)) {
controller_error_print(global.main->error, F_status_set_fine(status), "controller_rule_parameters_read", F_true, global.thread);
- actions->array[actions->used].status = controller_status_simplify_error(F_status_set_fine(status));
+ actions->array[actions->used++].status = controller_status_simplify_error(F_status_set_fine(status));
}
else {
- actions->array[actions->used].status = status;
+ actions->array[actions->used++].status = status;
}
-
- ++actions->used;
}
}
}
if (F_status_is_error_not(status) && status == F_data_not) {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->warning.to.stream);
+ controller_print_lock(global.main->warning.to, global.thread);
fl_print_format("%c%[%SAction is empty, nothing to do.%]%c", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->warning, cache->action, F_true);
- funlockfile(global.main->warning.to.stream);
-
- controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->warning.to, global.thread);
}
}
void controller_rule_error_print(const fll_error_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, controller_thread_t *thread) {
if (print.verbosity != f_console_verbosity_quiet) {
+
+ // fll_error_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_print_lock().
f_thread_mutex_lock(&thread->lock.print);
fll_error_print(print, status, function, fallback);
controller_rule_error_print_cache(print, cache, item);
- funlockfile(print.to.stream);
-
- controller_print_unlock_flush(print.to.stream, &thread->lock.print);
+ controller_print_unlock_flush(print.to, thread);
}
}
#endif // _di_controller_rule_error_print_
#endif // _di_controller_rule_error_print_cache_
#ifndef _di_controller_rule_item_error_print_
- void controller_rule_item_error_print(const fll_error_print_t output, const controller_cache_action_t cache, const bool item, controller_thread_t *thread) {
+ void controller_rule_item_error_print(const fll_error_print_t print, const controller_cache_action_t cache, const bool item, controller_thread_t *thread) {
- if (output.verbosity != f_console_verbosity_quiet) {
+ if (print.verbosity != f_console_verbosity_quiet) {
+
+ // fll_error_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_print_lock().
f_thread_mutex_lock(&thread->lock.print);
- controller_rule_error_print_cache(output, cache, item);
+ controller_rule_error_print_cache(print, cache, item);
+
+ flockfile(print.to.stream);
- controller_print_unlock_flush(output.to.stream, &thread->lock.print);
+ controller_print_unlock_flush(print.to, thread);
}
}
#endif // _di_controller_rule_item_error_print_
#ifndef _di_controller_rule_item_error_print_execute_
- void controller_rule_item_error_print_execute(const fll_error_print_t output, const bool script_is, const f_string_t name, const int code, const f_status_t status) {
+ void controller_rule_item_error_print_execute(const fll_error_print_t output, const bool script_is, const f_string_t name, const int code, const f_status_t status, controller_thread_t * const thread) {
if (output.verbosity != f_console_verbosity_quiet) {
- flockfile(output.to.stream);
+ controller_print_lock(output.to, thread);
fl_print_format("%c%[%SThe %s '%]", output.to.stream, f_string_eol_s[0], output.context, output.prefix, script_is ? controller_string_script_s : controller_string_program_s, output.context);
fl_print_format("%[%S%]", output.to.stream, output.notable, name, output.notable);
fl_print_format("%[' failed.%]%c", output.to.stream, output.context, output.context, f_string_eol_s[0]);
}
- funlockfile(output.to.stream);
+ controller_print_unlock_flush(output.to, thread);
}
}
#endif // _di_controller_rule_item_error_print_execute_
void controller_rule_item_error_print_execute_not_found(const fll_error_print_t output, const bool script_is, const f_string_t name) {
if (output.verbosity != f_console_verbosity_quiet) {
- flockfile(output.to.stream);
-
fl_print_format("%c%[%SThe %s '%]", output.to.stream, f_string_eol_s[0], output.context, output.prefix, script_is ? controller_string_script_s : controller_string_program_s, output.context);
fl_print_format("%[%S%]", output.to.stream, output.notable, name, output.notable);
fl_print_format("%[' could not be executed because it was not found.%]%c", output.to.stream, output.context, output.context, f_string_eol_s[0]);
-
- funlockfile(output.to.stream);
}
}
#endif // _di_controller_rule_item_error_print_execute_not_found_
void controller_rule_item_error_print_need_want_wish(const fll_error_print_t output, const f_string_t need_want_wish, const f_string_t value, const f_string_t why) {
if (output.verbosity != f_console_verbosity_quiet) {
- flockfile(output.to.stream);
-
fl_print_format("%c%[%SThe %s rule '%]", output.to.stream, f_string_eol_s[0], output.context, output.prefix, need_want_wish, output.context);
fl_print_format("%[%S%]", output.to.stream, output.notable, value, output.notable);
fl_print_format("%[' %S.%]%c", output.to.stream, output.context, why, output.context, f_string_eol_s[0]);
-
- funlockfile(output.to.stream);
}
}
#endif // _di_controller_rule_item_error_print_need_want_wish_
void controller_rule_item_error_print_rule_not_loaded(const fll_error_print_t output, const f_string_t alias) {
if (output.verbosity != f_console_verbosity_quiet) {
- flockfile(output.to.stream);
-
fl_print_format("%c%[%SThe rule '%]", output.to.stream, f_string_eol_s[0], output.context, output.prefix, output.context);
fl_print_format("%[%S%]", output.to.stream, output.notable, alias, output.notable);
fl_print_format("%[' is no longer loaded.%]%c", output.to.stream, output.context, output.context, f_string_eol_s[0]);
-
- funlockfile(output.to.stream);
}
}
#endif // _di_controller_rule_item_error_print_rule_not_loaded_
void controller_rule_action_error_missing_pid(const fll_error_print_t output, const f_string_t alias) {
if (output.verbosity != f_console_verbosity_quiet) {
- flockfile(output.to.stream);
-
fl_print_format("%c%[%SThe rule '%]", output.to.stream, f_string_eol_s[0], output.context, output.prefix, output.context);
fl_print_format("%[%S%]", output.to.stream, output.notable, alias, output.notable);
fl_print_format("%[' is not designating a pid file.%]%c", output.to.stream, output.context, output.context, f_string_eol_s[0]);
-
- funlockfile(output.to.stream);
}
}
#endif // _di_controller_rule_action_error_missing_pid_
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->warning.to.stream);
+ controller_print_lock(global.main->warning.to, global.thread);
fl_print_format("%c%[%SAction type is unknown, ignoring.%]%c", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->warning, process->cache.action, F_true);
- funlockfile(global.main->warning.to.stream);
-
- controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->warning.to, global.thread);
}
if (success == F_false) {
status = controller_pids_increase(&process->childs);
if (F_status_is_error(status)) {
- fll_error_print(global.main->error, F_status_set_fine(status), "controller_pids_increase", F_true);
+ controller_error_print(global.main->error, F_status_set_fine(status), "controller_pids_increase", F_true, global.thread);
return status;
}
if (options & controller_process_option_simulate) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->output.stream);
+ controller_print_lock(global.main->output, global.thread);
fl_print_format("%cSimulating execution of '%[", global.main->output.stream, f_string_eol_s[0], global.main->context.set.title);
fl_print_format("%]' from '", global.main->output.stream, global.main->context.set.important);
fl_print_format("%[%Q%]'.%c", global.main->output.stream, global.main->context.set.notable, process->rule.name, global.main->context.set.notable, f_string_eol_s[0]);
- funlockfile(global.main->output.stream);
-
- controller_print_unlock_flush(global.main->output.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->output, global.thread);
}
// sleep for less than a second to better show simulation of synchronous vs asynchronous.
if (F_status_is_error(status)) {
status = F_status_set_fine(status);
- f_thread_mutex_lock(&global.thread->lock.print);
-
if (status == F_control_group || status == F_failure || status == F_limit || status == F_processor || status == F_schedule) {
- controller_rule_item_error_print_execute(global.main->error, type == controller_rule_item_type_script, program ? program : arguments.used ? arguments.array[0].string : f_string_empty_s, result, status);
+ controller_rule_item_error_print_execute(global.main->error, type == controller_rule_item_type_script, program ? program : arguments.used ? arguments.array[0].string : f_string_empty_s, result, status, global.thread);
}
else if (status == F_file_found_not) {
+ controller_print_lock(global.main->error.to, global.thread);
+
controller_rule_item_error_print_execute_not_found(global.main->error, F_false, program);
+
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
else {
controller_error_print(global.main->error, F_status_set_fine(status), "fll_execute_program", F_true, global.thread);
}
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
-
status = F_status_set_error(status);
}
status = controller_pids_increase(&process->childs);
if (F_status_is_error(status)) {
- fll_error_print(global.main->error, F_status_set_fine(status), "controller_pids_increase", F_true);
+ controller_error_print(global.main->error, F_status_set_fine(status), "controller_pids_increase", F_true, global.thread);
return status;
}
status = f_string_dynamics_increase(controller_common_allocation_small, &process->path_pids);
if (F_status_is_error(status)) {
- fll_error_print(global.main->error, F_status_set_fine(status), "f_string_dynamics_increase", F_true);
+ controller_error_print(global.main->error, F_status_set_fine(status), "f_string_dynamics_increase", F_true, global.thread);
return status;
}
status = f_file_exists(pid_file.string);
if (F_status_is_error(status)) {
- fll_error_file_print(global.main->error, F_status_set_fine(status), "f_file_exists", F_true, pid_file.string, "find", fll_error_file_type_file);
+ controller_error_file_print(global.main->error, F_status_set_fine(status), "f_file_exists", F_true, pid_file.string, "find", fll_error_file_type_file, global.thread);
return status;
}
if (status == F_true) {
- fll_error_file_print(global.main->error, F_file_found, "f_file_exists", F_true, pid_file.string, "find", fll_error_file_type_file);
+ controller_error_file_print(global.main->error, F_file_found, "f_file_exists", F_true, pid_file.string, "find", fll_error_file_type_file, global.thread);
return F_status_set_error(F_file_found);
}
status = controller_string_dynamic_append_terminated(pid_file, child_pid_file);
if (F_status_is_error(status)) {
- fll_error_print(global.main->error, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true);
+ controller_error_print(global.main->error, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, global.thread);
return status;
}
if (options & controller_process_option_simulate) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%cSimulating execution of '%[", global.main->error.to.stream, f_string_eol_s[0], global.main->context.set.title);
fl_print_format("%]' from '", global.main->error.to.stream, global.main->context.set.important);
fl_print_format("%[%Q%]'.%c", global.main->error.to.stream, global.main->context.set.notable, process->rule.name, global.main->context.set.notable, f_string_eol_s[0]);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
// sleep for less than a second to better show simulation of synchronous vs asynchronous.
if (F_status_is_error(status)) {
status = F_status_set_fine(status);
- f_thread_mutex_lock(&global.thread->lock.print);
-
if (status == F_control_group || status == F_failure || status == F_limit || status == F_processor || status == F_schedule) {
- controller_rule_item_error_print_execute(global.main->error, type == controller_rule_item_type_utility, program ? program : arguments.used ? arguments.array[0].string : f_string_empty_s, result, status);
+ controller_rule_item_error_print_execute(global.main->error, type == controller_rule_item_type_utility, program ? program : arguments.used ? arguments.array[0].string : f_string_empty_s, result, status, global.thread);
}
else if (status == F_file_found_not) {
+ controller_print_lock(global.main->error.to, global.thread);
+
controller_rule_item_error_print_execute_not_found(global.main->error, F_false, program);
+
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
else {
controller_error_print(global.main->error, F_status_set_fine(status), "fll_execute_program", F_true, global.thread);
}
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
-
return F_status_set_error(status);
}
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->warning.to.stream);
+ controller_print_lock(global.main->warning.to, global.thread);
fl_print_format("%c%[%SUnknown rule item action '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
fl_print_format("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_action, global.main->warning.notable);
controller_rule_error_print_cache(global.main->warning, cache->action, F_true);
- funlockfile(global.main->warning.to.stream);
-
- controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->warning.to, global.thread);
}
continue;
if (type == controller_rule_action_type_group || type == controller_rule_action_type_pid_file || type == controller_rule_action_type_user) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SFSS Extended List is not allowed for the rule item action '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache->action.name_action, global.main->error.notable);
fl_print_format("%['.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
status = F_status_set_error(F_supported_not);
default:
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SUnsupported action type '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%q%]", global.main->error.to.stream, global.main->error.notable, controller_rule_action_type_name(process->action), global.main->error.notable);
controller_rule_error_print_cache(global.main->error, process->cache.action, F_true);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
return F_status_set_error(F_parameter);
}
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->error.to, global.thread);
controller_rule_item_error_print_rule_not_loaded(global.main->error, dynamics[i]->array[j].string);
controller_rule_error_print_cache(global.main->error, process->cache.action, F_false);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
return status;
id_rule = 0;
if (i == 0) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->error.to, global.thread);
controller_rule_item_error_print_need_want_wish(global.main->error, strings[i], dynamics[i]->array[j].string, "was not found");
controller_rule_error_print_cache(global.main->error, process->cache.action, F_true);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
status = F_status_set_error(F_found_not);
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->warning.to, global.thread);
controller_rule_item_error_print_need_want_wish(global.main->warning, strings[i], dynamics[i]->array[j].string, "was not found");
controller_rule_error_print_cache(global.main->warning, process->cache.action, F_true);
- controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->warning.to, global.thread);
}
}
}
if (F_status_is_error(status)) {
if (i == 0 || i == 1 || F_status_set_fine(status) == F_memory_not) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->error.to, global.thread);
controller_rule_item_error_print_need_want_wish(global.main->error, strings[i], alias_other_buffer, "failed during execution");
controller_rule_error_print_cache(global.main->error, process->cache.action, F_true);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
if (!(dependency->options & controller_process_option_simulate) || F_status_set_fine(status) == F_memory_not) {
f_thread_unlock(&dependency->active);
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->warning.to, global.thread);
controller_rule_item_error_print_need_want_wish(global.main->warning, strings[i], alias_other_buffer, "failed during execution");
controller_rule_error_print_cache(global.main->warning, process->cache.action, F_true);
- controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->warning.to, global.thread);
}
}
}
f_thread_unlock(&global.thread->lock.rule);
if (i == 0 || i == 1) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->error.to, global.thread);
controller_rule_item_error_print_need_want_wish(global.main->error, strings[i], alias_other_buffer, "is in a failed state");
- status = F_status_set_error(F_found_not);
controller_rule_error_print_cache(global.main->error, process->cache.action, F_true);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
+
+ status = F_status_set_error(F_found_not);
if (!(dependency->options & controller_process_option_simulate)) {
f_thread_unlock(&dependency->active);
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->warning.to, global.thread);
controller_rule_item_error_print_need_want_wish(global.main->warning, strings[i], alias_other_buffer, "is in a failed state");
+
controller_rule_error_print_cache(global.main->warning, process->cache.action, F_true);
- controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->warning.to, global.thread);
}
}
}
if (missing) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SThe rule '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, process->rule.name, global.main->error.notable);
controller_rule_error_print_cache(global.main->error, process->cache.action, F_true);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
status = F_status_set_error(F_parameter);
f_thread_unlock(&global.thread->lock.process);
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->error.to, global.thread);
controller_rule_item_error_print_rule_not_loaded(global.main->error, alias_rule.string);
controller_rule_error_print_cache(global.main->error, cache.action, F_false);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
return status;
if (process->stack.array[i] == id_rule) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SThe rule '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, process->rule.alias, global.main->error.notable);
controller_rule_error_print_cache(global.main->error, process->cache.action, F_true);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
// never continue on circular recursion errors even in simulate mode.
status = F_status_set_error(F_found_not);
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->error.to, global.thread);
controller_rule_item_error_print_rule_not_loaded(global.main->error, process->rule.alias.string);
controller_rule_error_print_cache(global.main->error, process->cache.action, F_false);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
}
}
else {
if (global.main->warning.verbosity == f_console_verbosity_debug) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->warning.to.stream);
+ controller_print_lock(global.main->warning.to, global.thread);
fl_print_format("%c%[%SUnknown rule item '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
fl_print_format("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_item, global.main->warning.notable);
controller_rule_error_print_cache(global.main->warning, cache->action, F_true);
- funlockfile(global.main->warning.to.stream);
-
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_unlock_flush(global.main->warning.to, global.thread);
}
continue;
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->warning.to.stream);
+ controller_print_lock(global.main->warning.to, global.thread);
fl_print_format("%c%[%SUnknown rule setting '%]", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context);
fl_print_format("%[%Q%]", global.main->warning.to.stream, global.main->warning.notable, cache->action.name_item, global.main->warning.notable);
controller_rule_error_print_cache(global.main->warning, cache->action, F_false);
- funlockfile(global.main->warning.to.stream);
-
- controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->warning.to, global.thread);
}
continue;
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->warning.to.stream);
+ controller_print_lock(global.main->warning.to, global.thread);
fl_print_format("%c%[%SEmpty rule setting.%]%c", global.main->warning.to.stream, f_string_eol_s[0], global.main->warning.context, global.main->warning.prefix, global.main->warning.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->warning, cache->action, F_false);
- funlockfile(global.main->warning.to.stream);
-
- controller_print_unlock_flush(global.main->warning.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->warning.to, global.thread);
}
continue;
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting requires one or more Content.%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
if (status == F_number_overflow || status == F_number_underflow) {
fl_print_format("%c%[%SRule setting has an unsupported number '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
status = F_status_set_error(F_valid_not);
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting requires exactly two Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
if (cache->content_actions.array[i].used < 2 || rule->has & controller_rule_has_control_group) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting requires two or more Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an unknown option '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting requires three Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SUnknown resource limit type '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache->action.name_action, global.main->error.notable);
controller_rule_error_print_cache(global.main->error, cache->action, F_true);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SThe resource limit type is already specified%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
status = F_status_set_error(F_valid_not);
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
if (status == F_number_overflow || status == F_number_underflow) {
fl_print_format("%c%[%SRule setting has an unsupported number'%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
status = F_status_set_error(F_valid_not);
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting requires exactly one Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
if (status == F_false) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an invalid name '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, *setting_value, global.main->error.notable);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting requires either one or two Content.'%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an unknown scheduler '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an invalid number '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->error.notable);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting requires exactly one Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->error.to, global.thread);
controller_rule_error_print(global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false, global.thread);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->error.to, global.thread);
controller_rule_error_print(global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, F_false, global.thread);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
+ controller_print_lock(global.main->error.to, global.thread);
controller_rule_error_print(global.main->error, cache->action, F_status_set_fine(status), "f_capability_from_text", F_true, F_false, global.thread);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
status_return = status;
break;
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting failed to process the capabilities.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an invalid number '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
if (status == F_exist_not) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an invalid user '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
fl_print_format("%[' because no user was found by that name.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
}
else if (status == F_number_too_large) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an invalid user '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
fl_print_format("%[' because the given ID is too large.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
}
else if (status == F_number) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an invalid user '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[0], global.main->error.notable);
fl_print_format("%[' because the given ID is not a valid supported number.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
}
else {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting requires one or more Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
if (status == F_exist_not) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an invalid group '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[j], global.main->error.notable);
fl_print_format("%[' because no group was found by that name.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
}
else if (status == F_number_too_large) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an invalid group '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[j], global.main->error.notable);
fl_print_format("%[' because the given ID is too large.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
}
else if (status == F_number) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an invalid group '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[j], global.main->error.notable);
fl_print_format("%[' because the given ID is not a valid supported number.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
}
else {
if (status == F_false) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting has an invalid environment variable name '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, setting_values->array[setting_values->used], global.main->error.notable);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting requires exactly four Content.%]%c", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context, f_string_eol_s[0]);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
f_thread_mutex_lock(&global.thread->lock.print);
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting's first value has '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->error.notable);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
cache->action.line_action = ++cache->action.line_item;
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SRule setting's second value has '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->error.notable);
controller_rule_error_print_cache(global.main->error, cache->action, F_false);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
if (F_status_is_error_not(status_return)) {
if (fl_string_dynamic_partial_compare_string(cache->buffer_item.string, cache->buffer_path, cache->buffer_item.used, cache->content_actions.array[i].array[1]) == F_equal_to_not) {
if (global.main->error.verbosity != f_console_verbosity_quiet) {
- f_thread_mutex_lock(&global.thread->lock.print);
-
- flockfile(global.main->error.to.stream);
+ controller_print_lock(global.main->error.to, global.thread);
fl_print_format("%c%[%SThe rule item action third parameter '%]", global.main->error.to.stream, f_string_eol_s[0], global.main->error.context, global.main->error.prefix, global.main->error.context);
fl_print_format("%[%/Q%]", global.main->error.to.stream, global.main->error.notable, cache->buffer_item, cache->content_actions.array[i].array[2], global.main->error.notable);
fl_print_format("%[%Q%]", global.main->error.to.stream, cache->buffer_path, global.main->error.notable);
fl_print_format("%['.%]%c", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s[0]);
- funlockfile(global.main->error.to.stream);
-
- controller_print_unlock_flush(global.main->error.to.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(global.main->error.to, global.thread);
}
setting_values->array[setting_values->used].used = 0;
const controller_main_t *main = global.main;
- f_thread_mutex_lock(&global.thread->lock.print);
-
switch (action) {
case controller_rule_action_type_freeze:
case controller_rule_action_type_kill:
default:
if (main->error.verbosity != f_console_verbosity_quiet) {
- flockfile(main->error.to.stream);
+ controller_print_lock(main->error.to, global.thread);
fl_print_format("%c%[%SUnsupported action type '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix ? main->error.prefix : f_string_empty_s, main->error.context);
fl_print_format("%[%q%]", main->error.to.stream, main->error.notable, controller_rule_action_type_name(action), main->error.notable);
controller_rule_error_print_cache(main->error, cache->action, F_true);
- funlockfile(main->error.to.stream);
+ controller_print_unlock_flush(main->error.to, global.thread);
}
- controller_print_unlock_flush(main->error.to.stream, &global.thread->lock.print);
-
return;
}
} // for
if (missing) {
- flockfile(main->output.stream);
+ controller_print_lock(main->output, global.thread);
fl_print_format("%cRule '", main->output.stream, f_string_eol_s[0]);
fl_print_format("%[%Q%]' has no '", main->output.stream, main->context.set.title, rule.name, main->context.set.title);
fl_print_format("%[%s%]' because it is '", main->output.stream, main->context.set.important, options & controller_process_option_require ? controller_string_fail_s : controller_string_succeed_s, main->context.set.important);
fl_print_format("%[%s%]'.%c", main->output.stream, main->context.set.important, options & controller_process_option_require ? controller_string_required_s : controller_string_optional_s, main->context.set.important, f_string_eol_s[0]);
- funlockfile(main->output.stream);
+ controller_print_unlock_flush(main->output, global.thread);
}
}
- flockfile(main->output.stream);
+ controller_print_lock(main->output, global.thread);
fl_print_format("%cRule %[%Q%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.title, rule.alias, main->context.set.title, f_string_eol_s[0]);
fl_print_format(" %[%s%] %Q%c", main->output.stream, main->context.set.important, controller_string_name_s, main->context.set.important, rule.name, f_string_eol_s[0]);
fl_print_format("}%c", main->output.stream, f_string_eol_s[0]);
- funlockfile(main->output.stream);
-
- controller_print_unlock_flush(main->output.stream, &global.thread->lock.print);
+ controller_print_unlock_flush(main->output, global.thread);
}
#endif // _di_controller_rule_validate_