build_sources_library main/instance.c main/path.c
build_sources_library main/rule.c main/rule/action.c main/rule/execute.c main/rule/expand.c main/rule/instance.c main/rule/is.c main/rule/item.c main/rule/parameter.c main/rule/read.c main/rule/setting.c main/rule/validate.c main/rule/wait.c
build_sources_library main/print/action.c main/print/data.c main/print/debug.c main/print/error.c main/print/lock.c main/print/message.c main/print/rule.c main/print/verbose.c main/print/warning.c
+build_sources_library main/print/rule/action.c main/print/rule/item.c main/print/rule/setting.c
build_sources_library main/signal.c main/time.c
build_sources_library main/thread.c main/thread/control.c main/thread/entry.c main/thread/instance.c main/thread/is.c main/thread/rule.c
build_sources_headers main/instance.h main/path.h
build_sources_headers main/rule.h main/rule/action.h main/rule/execute.h main/rule/expand.h main/rule/instance.h main/rule/is.h main/rule/item.h main/rule/parameter.h main/rule/read.h main/rule/setting.h main/rule/validate.h main/rule/wait.h
build_sources_headers main/print/action.h main/print/data.h main/print/debug.h main/print/error.h main/print/lock.h main/print/message.h main/print/rule.h main/print/verbose.h main/print/warning.h
+build_sources_headers main/print/rule/action.h main/print/rule/item.h main/print/rule/setting.h
build_sources_headers main/signal.h main/time.h
build_sources_headers main/thread.h main/thread/control.h main/thread/entry.h main/thread/instance.h main/thread/is.h main/thread/rule.h
return;
}
- // @todo controller_main(&data, &program);
+ // @todo controller_main(&data, &program); (also needs to include things like controller_main_thread())
if (main->setting.state.status == F_status_set_error(F_child)) return;
if (main->setting.state.status == F_status_set_error(F_interrupt)) {
* A subset of status codes (with error bit set).
*/
#ifndef _di_controller_main_error_simplify_
- extern f_status_t controller_main_error_simplify(const f_status_t status) F_attribute_visibility_internal_d;
+ extern f_status_t controller_main_error_simplify(const f_status_t status);
#endif // _di_controller_main_error_simplify_
/**
* The start range will be past the stop range on overflow or on any failure.
*/
#ifndef _di_controller_main_range_after_number_sign_
- extern f_range_t controller_main_range_after_number_sign(const f_string_static_t buffer, const f_range_t range) F_attribute_visibility_internal_d;
+ extern f_range_t controller_main_range_after_number_sign(const f_string_static_t buffer, const f_range_t range);
#endif // _di_controller_main_range_after_number_sign_
/**
controller_rule_t rule;
controller_cache_t cache;
+ // @fixme change this to void *global where global is controller_global_t??
+ // @fixme each instance probably needs its own thread data and this likely needs to be backported if it do-able in a non-breaking-change manner!
+ // @fixme I may want to instead replace the controller_global_t with controller_instance_t during printing calls (maybe more??).
void *main;
controller_program_t *program;
void *thread;
#include <program/controller/main/print/lock.h>
#include <program/controller/main/print/message.h>
#include <program/controller/main/print/rule.h>
+#include <program/controller/main/print/rule/action.h>
+#include <program/controller/main/print/rule/item.h>
+#include <program/controller/main/print/rule/setting.h>
#include <program/controller/main/print/verbose.h>
#include <program/controller/main/print/warning.h>
#include <program/controller/main/signal.h>
}
#endif // _di_controller_main_print_error_status_
-#ifndef _di_controller_main_print_error_rule_
- f_status_t controller_main_print_error_rule(fl_print_t * const print, const f_status_t status, const f_string_t function, const bool fallback, const bool item) {
-
- if (!print || !print->custom) return F_status_set_error(F_output_not);
- if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
-
- // fll_error_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_lock_print().
- f_thread_mutex_lock(&global->thread->lock.print);
-
- controller_global_t * const global = (controller_global_t *) print->custom; // @fixme The print->custom is currently controller_main_t, but threads need to change this. Thread-specific print objects?
-
- fll_error_print(print, F_status_set_fine(global->main->setting.state.status), function, fll_error_file_flag_fallback_e);
-
- fll_error_print(print, status, function, fallback);
-
- f_file_stream_lock(print->to);
-
- controller_rule_print_error_cache(print, cache, item);
-
- controller_unlock_print_flush(print->to, thread);
-
- return F_okay;
- }
-#endif // _di_controller_main_print_error_rule_
-
-#ifndef _di_controller_rule_print_error_cache_
- 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;
-
- 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);
- }
-
- 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);
- }
-
- if (cache.name_file.used) {
- fl_print_format("rule file '%]%[%Q%]%['", print->to, print->context, print->notable, cache.name_file, print->notable, print->context);
- }
-
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
- }
-#endif // _di_controller_rule_print_error_cache_
-
#ifdef __cplusplus
} // extern "C"
#endif
* If FALSE, then this error is associated with a rule setting.
*
* @see fll_error_print()
- * @see controller_rule_print_error_cache()
+ * @see controller_main_print_rule_error_cache()
*/
-#ifndef _di_controller_rule_print_error_
- 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_
+#ifndef _di_controller_main_print_rule_error_
+ extern void controller_main_print_rule_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);
+#endif // _di_controller_main_print_rule_error_
/**
* Print additional error/warning information in addition to existing error.
* @see controller_rule_read()
* @see controller_rule_setting_read()
*/
-#ifndef _di_controller_rule_print_error_cache_
- 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_
+#ifndef _di_controller_main_print_rule_error_cache_
+ extern void controller_main_print_rule_error_cache(fl_print_t * const print, const controller_cache_action_t cache, const bool item);
+#endif // _di_controller_main_print_rule_error_cache_
#ifdef __cplusplus
} // extern "C"
extern "C" {
#endif
-#ifndef _di_controller_main_print_rule_debug_item_action_empty_
- f_status_t controller_main_print_rule_debug_item_action_empty(fl_print_t * const print, controller_cache_t * const cache) {
+#ifndef _di_controller_main_print_rule_error_
+ f_status_t controller_main_print_rule_error(fl_print_t * const print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item) {
- if (!print || !cache) return F_status_set_error(F_output_not);
- if (print->verbosity < f_console_verbosity_debug_e) return F_output_not;
-
- controller_lock_print(print->to, global->thread);
-
- fl_print_format("%r%[%QAction is empty, nothing to do.%]%r", primt->to, f_string_eol_s, print->context, print->prefix, print->context, f_string_eol_s);
-
- controller_rule_print_rule_message_cache(print, cache->action, F_true);
-
- controller_unlock_print_flush(print->to, global->thread);
-
- return F_okay;
- }
-#endif // _di_controller_main_print_rule_debug_item_action_empty_
-
-#ifndef _di_controller_main_print_rule_error_item_action_first_
- f_status_t controller_main_print_rule_error_item_action_first(fl_print_t * const print, controller_cache_t * const cache) {
-
- if (!print || !cache) return F_status_set_error(F_output_not);
+ if (!print || !print->custom) return F_status_set_error(F_output_not);
if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (status == F_interrupt) return F_status_set_error(F_output_not);
- controller_lock_print(print->to, global->thread);
-
- fl_print_format("%r%[%QRule item action '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context);
- fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, controller_rerun_s, print->notable);
- fl_print_format("%[' has '%]", print->to, print->context, print->context);
- fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->notable, cache->buffer_item, cache->content_action.array[0], print->notable);
- fl_print_format("%[' as the first value, only the following are allowed: '%]", print->to, print->context, print->context);
- fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_freeze_s, print->notable, print->context, print->context);
- fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_kill_s, print->notable, print->context, print->context);
- fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_pause_s, print->notable, print->context, print->context);
- fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_reload_s, print->notable, print->context, print->context);
- fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_restart_s, print->notable, print->context, print->context);
- fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_resume_s, print->notable, print->context, print->context);
- fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_start_s, print->notable, print->context, print->context);
- fl_print_format("%[%r%]%[', or '%]", print->to, print->notable, controller_stop_s, print->notable, print->context, print->context);
- fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, controller_thaw_s, print->notable, print->context);
- fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- controller_rule_print_rule_message_cache(print, cache->action, F_true);
-
- controller_unlock_print_flush(print->to, global->thread);
-
- return F_okay;
- }
-#endif // _di_controller_main_print_rule_error_item_action_first_
-
-#ifndef _di_controller_main_print_rule_error_item_action_second_
- f_status_t controller_main_print_rule_error_item_action_second(fl_print_t * const print, controller_cache_t * const cache) {
+ controller_global_t * const global = (controller_global_t *) print->custom;
- if (!print || !cache) return F_status_set_error(F_output_not);
- if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
+ // fll_error_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_lock_print().
+ f_thread_mutex_lock(&global->thread->lock.print);
- controller_lock_print(print->to, global->thread);
+ fll_error_print(print, status, function, fallback);
- fl_print_format("%r%[%QRule item action '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context);
- fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, controller_rerun_s, print->notable);
- fl_print_format("%[' has '%]", print->to, print->context, print->context);
- fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->notable, cache->buffer_item, cache->content_action.array[1], print->notable);
- fl_print_format("%[' as the second value, only the following are allowed: '%]", print->to, print->context, print->context);
- fl_print_format("%[%r%]%[' or '%]", print->to, print->notable, controller_stop_s, print->notable, print->context, print->context);
- fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, controller_thaw_s, print->notable, print->context);
- fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
+ f_file_stream_lock(print->to);
- controller_rule_print_rule_message_cache(print, cache->action, F_true);
+ controller_main_print_rule_error_cache(print, cache, item);
controller_unlock_print_flush(print->to, global->thread);
return F_okay;
}
-#endif // _di_controller_main_print_rule_error_item_action_second_
+#endif // _di_controller_main_print_rule_error_
-#ifndef _di_controller_main_print_rule_error_item_action_unknown_
- f_status_t controller_main_print_rule_error_item_action_unknown(fl_print_t * const print, controller_cache_t * const cache, const f_string_static_t name, const f_number_unsigned_t index) {
+#ifndef _di_controller_main_print_rule_error_cache_
+ f_status_t controller_main_print_rule_error_cache(fl_print_t * const print, const controller_cache_action_t cache, const bool item) {
- if (!print || !cache) return F_status_set_error(F_output_not);
+ if (!print) return F_status_set_error(F_output_not);
if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- controller_lock_print(print->to, global->thread);
-
- fl_print_format("%r%[%QRule item action '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context);
- fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[' has an unknown value '%]", print->to, print->context, print->context);
- fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->notable, cache->buffer_item, cache->content_action.array[index], print->notable);
- fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- controller_rule_print_rule_message_cache(print, cache->action, F_true);
-
- controller_unlock_print_flush(print->to, global->thread);
-
- return F_okay;
- }
-#endif // _di_controller_main_print_rule_error_item_action_unknown_
-
-#ifndef _di_controller_rule_print_rule_message_cache_
- f_status_t controller_rule_print_rule_message_cache(fl_print_t * const print, controller_cache_action_t * const cache, const bool item) {
-
- if (!print || !cache) return F_status_set_error(F_output_not);
-
- 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);
- if (cache->name_action.used) {
+ if (cache.name_action.used) {
fl_print_format("%r '%]", print->to, item ? controller_action_s : controller_value_s, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache->name_action, print->notable);
+ fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache.name_action, print->notable);
fl_print_format("%[' on line%] ", print->to, print->context, print->context);
- fl_print_format("%[%un%]", print->to, print->notable, cache->line_action, print->notable);
+ fl_print_format(f_string_format_un_single_s.string, print->to, print->notable, cache.line_action, print->notable);
fl_print_format("%[ for ", print->to, print->context);
}
- if (cache->name_item.used) {
+ if (cache.name_item.used) {
fl_print_format("rule %r '%]", print->to, item ? controller_item_s : controller_settings_s, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache->name_item, print->notable);
+ fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, cache.name_item, print->notable);
fl_print_format("%[' on line%] ", print->to, print->context, print->context);
- fl_print_format("%[%un%]", print->to, print->notable, cache->line_item, print->notable);
+ fl_print_format(f_string_format_un_single_s.string", print->to, print->notable, cache.line_item, print->notable);
fl_print_format("%[ for ", print->to, print->context);
}
- if (cache->name_file.used) {
- fl_print_format("rule file '%]%[%Q%]%['", print->to, print->context, print->notable, cache->name_file, print->notable, print->context);
+ if (cache.name_file.used) {
+ fl_print_format("rule file '%]%[%Q%]%['", print->to, print->context, print->notable, cache.name_file, print->notable, print->context);
}
fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
return F_okay;
}
-#endif // _di_controller_rule_print_rule_message_cache_
+#endif // _di_controller_main_print_rule_error_cache_
#ifdef __cplusplus
} // extern "C"
#endif
/**
- * Print rule debug message about the rule item action being empty.
+ * Print generic error/warning information.
*
- * @param print
- * The output structure to print to.
- * Must not be NULL.
- * @param cache
- * A structure for containing and caching relevant data.
- * Must not be NULL.
- *
- * @return
- * F_okay on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fl_print_format()
- * @see fll_error_print()
- *
- * @see controller_lock_print()
- * @see controller_rule_print_rule_message_cache()
- * @see controller_unlock_print_flush()
- */
-#ifndef _di_controller_main_print_rule_debug_item_action_empty_
- extern f_status_t controller_main_print_rule_debug_item_action_empty(fl_print_t * const print, controller_cache_t * const cache);
-#endif // _di_controller_main_print_rule_debug_item_action_empty_
-
-/**
- * Print rule error message about the first rule item action parameter being invalid.
+ * This is essentially a wrapper to fll_error_print() that includes locking.
*
* @param print
- * The output structure to print to.
- * Must not be NULL.
+ * Designates how printing is to be performed.
* @param cache
- * A structure for containing and caching relevant data.
- * Must not be NULL.
- *
- * @return
- * F_okay on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
+ * The action cache.
+ * @param status
+ * The status code to process.
+ * Make sure this has F_status_set_fine() called if the status code has any error or warning bits.
+ * @param function
+ * The name of the function where the error happened.
+ * Set to 0 to disable.
+ * @param fallback
+ * Set to F_true to print the fallback error message for unknown errors.
+ * @param item
+ * If TRUE, then this error is associated with an item.
+ * If FALSE, then this error is associated with a rule setting.
*
- * @see fl_print_format()
* @see fll_error_print()
- *
- * @see controller_lock_print()
- * @see controller_rule_print_rule_message_cache()
- * @see controller_unlock_print_flush()
+ * @see controller_main_print_rule_error_cache()
*/
-#ifndef _di_controller_main_print_rule_error_item_action_first_
- extern f_status_t controller_main_print_rule_error_item_action_first(fl_print_t * const print, controller_cache_t * const cache);
-#endif // _di_controller_main_print_rule_error_item_action_first_
+#ifndef _di_controller_main_print_rule_error_
+ extern void controller_main_print_rule_error(fl_print_t * const print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item);
+#endif // _di_controller_main_print_rule_error_
/**
- * Print rule error message about the second rule item action parameter being invalid.
- *
- * @param print
- * The output structure to print to.
- * Must not be NULL.
- * @param cache
- * A structure for containing and caching relevant data.
- * Must not be NULL.
+ * Print additional error/warning information in addition to existing error.
*
- * @return
- * F_okay on success.
- * F_output_not on success, but no printing is performed.
+ * This is explicitly intended to be used in addition to the error message.
*
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fl_print_format()
- * @see fll_error_print()
- *
- * @see controller_lock_print()
- * @see controller_rule_print_rule_message_cache()
- * @see controller_unlock_print_flush()
- */
-#ifndef _di_controller_main_print_rule_error_item_action_second_
- extern f_status_t controller_main_print_rule_error_item_action_second(fl_print_t * const print, controller_cache_t * const cache);
-#endif // _di_controller_main_print_rule_error_item_action_second_
-
-/**
- * Print rule error message about the rule item action being unknown.
- *
- * @param print
- * The output structure to print to.
- * Must not be NULL.
- * @param cache
- * A structure for containing and caching relevant data.
- * Must not be NULL.
- * @param name
- * The parameter name whose value is unknown.
- * @param index
- * The index in the content action cache representing the unknown value.
- *
- * @return
- * F_okay on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fl_print_format()
- * @see fll_error_print()
- *
- * @see controller_lock_print()
- * @see controller_rule_print_rule_message_cache()
- * @see controller_unlock_print_flush()
- */
-#ifndef _di_controller_main_print_rule_error_item_action_unknown_
- extern f_status_t controller_main_print_rule_error_item_action_unknown(fl_print_t * const print, controller_cache_t * const cache, const f_string_static_t name, const f_number_unsigned_t index);
-#endif // _di_controller_main_print_rule_error_item_action_unknown_
-
-/**
- * Print rule error message about the rule item action being unknown.
+ * This neither locks the thread nor does it check to see if output is enabled or disabled.
*
* @param print
- * The output structure to print to.
- * Must not be NULL.
- *
- * This does not lock the stream.
+ * The error or warning output structure.
* @param cache
* A structure for containing and caching relevant data.
- * Must not be NULL.
- * @param name
- * The parameter name related to the message.
- * @param index
- * The index in the content action cache representing the parameter value related to the message.
- *
- * @return
- * F_okay on success.
- * F_output_not on success, but no printing is performed.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fl_print_format()
+ * @param item
+ * If TRUE, then this error is associated with an item.
+ * If FALSE, then this error is associated with a rule setting.
+ *
+ * @see controller_rule_action_read()
+ * @see controller_rule_item_read()
+ * @see controller_rule_items_read()
+ * @see controller_rule_read()
+ * @see controller_rule_setting_read()
*/
-#ifndef _di_controller_rule_print_rule_message_cache_
- extern f_status_t controller_rule_print_rule_message_cache(fl_print_t * const print, controller_cache_action_t * const cache, const bool item);
-#endif // _di_controller_rule_print_rule_message_cache_
+#ifndef _di_controller_main_print_rule_error_cache_
+ extern void controller_main_print_rule_error_cache(fl_print_t * const print, const controller_cache_action_t cache, const bool item);
+#endif // _di_controller_main_print_rule_error_cache_
#ifdef __cplusplus
} // extern "C"
--- /dev/null
+#include "../../controller.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_controller_main_print_rule_action_error_missing_pid_
+ void controller_main_print_rule_action_error_missing_pid(fl_print_t * const print, const f_string_static_t alias) {
+
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ 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_main_print_rule_action_error_missing_pid_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Controller
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print rule action functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _controller_main_print_rule_action_h
+#define _controller_main_print_rule_action_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print an error or warning message about some rule not having the pid file information.
+ *
+ * @param print
+ * The error or warning output structure.
+ * @param alias
+ * The rule alias of the rule that is missing the pid file designation.
+ */
+#ifndef _di_controller_main_print_rule_action_error_missing_pid_
+ extern void controller_main_print_rule_action_error_missing_pid(fl_print_t * const print, const f_string_static_t alias);
+#endif // _di_controller_main_print_rule_action_error_missing_pid_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _controller_main_print_rule_action_h
--- /dev/null
+#include "../../controller.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_controller_main_print_rule_item_debug_action_empty_
+ f_status_t controller_main_print_rule_item_debug_action_empty(fl_print_t * const print, controller_cache_t * const cache) {
+
+ if (!print || !print->custom || !cache) return F_status_set_error(F_output_not);
+ if (print->verbosity < f_console_verbosity_debug_e) return F_output_not;
+
+ controller_global_t * const global = (controller_global_t *) print->custom;
+
+ controller_lock_print(print->to, global->thread);
+
+ fl_print_format("%r%[%QAction is empty, nothing to do.%]%r", primt->to, f_string_eol_s, print->context, print->prefix, print->context, f_string_eol_s);
+
+ controller_main_print_rule_error_cache(print, cache->action, F_true);
+
+ controller_unlock_print_flush(print->to, global->thread);
+
+ return F_okay;
+ }
+#endif // _di_controller_main_print_rule_item_debug_action_empty_
+
+#ifndef _di_controller_main_print_rule_item_error_
+ void controller_main_print_rule_item_error(fl_print_t * const print, const controller_cache_action_t cache, const bool item, const f_status_t status) {
+
+ if (!print || !print->custom) return F_status_set_error(F_output_not);
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (status == F_interrupt) return F_status_set_error(F_output_not);
+
+ controller_global_t * const global = (controller_global_t *) print->custom;
+
+ // fll_error_print() automatically locks, so manually handle only the mutex locking and flushing rather than calling controller_lock_print().
+ f_thread_mutex_lock(&global->thread->lock.print);
+
+ controller_main_print_rule_error_cache(print, cache, item);
+
+ f_file_stream_lock(print->to);
+
+ controller_unlock_print_flush(print->to, global->thread);
+ }
+#endif // _di_controller_main_print_rule_item_error_
+
+#ifndef _di_controller_main_print_rule_item_error_action_first_
+ f_status_t controller_main_print_rule_item_error_action_first(fl_print_t * const print, controller_cache_t * const cache) {
+
+ if (!print || !print->custom || !cache) return F_status_set_error(F_output_not);
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ controller_global_t * const global = (controller_global_t *) print->custom;
+
+ controller_lock_print(print->to, global->thread);
+
+ fl_print_format("%r%[%QRule item action '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context);
+ fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, controller_rerun_s, print->notable);
+ fl_print_format("%[' has '%]", print->to, print->context, print->context);
+ fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->notable, cache->buffer_item, cache->content_action.array[0], print->notable);
+ fl_print_format("%[' as the first value, only the following are allowed: '%]", print->to, print->context, print->context);
+ fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_freeze_s, print->notable, print->context, print->context);
+ fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_kill_s, print->notable, print->context, print->context);
+ fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_pause_s, print->notable, print->context, print->context);
+ fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_reload_s, print->notable, print->context, print->context);
+ fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_restart_s, print->notable, print->context, print->context);
+ fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_resume_s, print->notable, print->context, print->context);
+ fl_print_format("%[%r%]%[', '%]", print->to, print->notable, controller_start_s, print->notable, print->context, print->context);
+ fl_print_format("%[%r%]%[', or '%]", print->to, print->notable, controller_stop_s, print->notable, print->context, print->context);
+ fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, controller_thaw_s, print->notable, print->context);
+ fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
+
+ controller_main_print_rule_error_cache(print, cache->action, F_true);
+
+ controller_unlock_print_flush(print->to, global->thread);
+
+ return F_okay;
+ }
+#endif // _di_controller_main_print_rule_item_error_action_first_
+
+#ifndef _di_controller_main_print_rule_item_error_action_second_
+ f_status_t controller_main_print_rule_item_error_action_second(fl_print_t * const print, controller_cache_t * const cache) {
+
+ if (!print || !print->custom || !cache) return F_status_set_error(F_output_not);
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ controller_global_t * const global = (controller_global_t *) print->custom;
+
+ controller_lock_print(print->to, global->thread);
+
+ fl_print_format("%r%[%QRule item action '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context);
+ fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, controller_rerun_s, print->notable);
+ fl_print_format("%[' has '%]", print->to, print->context, print->context);
+ fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->notable, cache->buffer_item, cache->content_action.array[1], print->notable);
+ fl_print_format("%[' as the second value, only the following are allowed: '%]", print->to, print->context, print->context);
+ fl_print_format("%[%r%]%[' or '%]", print->to, print->notable, controller_stop_s, print->notable, print->context, print->context);
+ fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, controller_thaw_s, print->notable, print->context);
+ fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
+
+ controller_main_print_rule_error_cache(print, cache->action, F_true);
+
+ controller_unlock_print_flush(print->to, global->thread);
+
+ return F_okay;
+ }
+#endif // _di_controller_main_print_rule_item_error_action_second_
+
+#ifndef _di_controller_main_print_rule_item_error_action_unknown_
+ f_status_t controller_main_print_rule_item_error_action_unknown(fl_print_t * const print, controller_cache_t * const cache, const f_string_static_t name, const f_number_unsigned_t index) {
+
+ if (!print || !print->custom || !cache) return F_status_set_error(F_output_not);
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ controller_global_t * const global = (controller_global_t *) print->custom;
+
+ controller_lock_print(print->to, global->thread);
+
+ fl_print_format("%r%[%QRule item action '%]", print->to, f_string_eol_s, print->context, print->prefix, print->context);
+ fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, name, print->notable);
+ fl_print_format("%[' has an unknown value '%]", print->to, print->context, print->context);
+ fl_print_format(f_string_format_Q_range_single_s.string, print->to, print->notable, cache->buffer_item, cache->content_action.array[index], print->notable);
+ fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
+
+ controller_main_print_rule_error_cache(print, cache->action, F_true);
+
+ controller_unlock_print_flush(print->to, global->thread);
+
+ return F_okay;
+ }
+#endif // _di_controller_main_print_rule_item_error_action_unknown_
+
+#ifndef _di_controller_main_print_rule_item_error_execute_
+ void controller_main_print_rule_item_error_execute(fl_print_t * const print, controller_instance_t * const instance, const bool script_is, const f_string_static_t name, const f_status_t status) {
+
+ if (!print || !print->custom) return F_status_set_error(F_output_not);
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ controller_global_t * const global = (controller_global_t *) print->custom;
+
+ controller_lock_print(print->to, global->thread);
+
+ fl_print_format("%r%[%QThe %r '%]", print->to, f_string_eol_s, print->context, print->prefix, script_is ? controller_engine_s : controller_program_s, print->context);
+ fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
+
+ if (status == F_control_group || status == F_limit || status == F_processor || status == F_schedule) {
+ fl_print_format("%[' failed to setup the '%]%[", print->to, print->context, print->context, print->notable);
+
+ if (status == F_control_group) {
+ f_print_dynamic_raw(controller_cgroup_s, print->to);
+ }
+ else if (status == F_limit) {
+ f_print_dynamic_raw(controller_limit_s, print->to);
+ }
+ else if (status == F_processor) {
+ f_print_dynamic_raw(controller_processor_s, print->to);
+ }
+ else if (status == F_schedule) {
+ f_print_dynamic_raw(controller_scheduler_s, print->to);
+ }
+
+ fl_print_format("%]%['.%]%r", print->to, print->notable, print->context, print->context, f_string_eol_s);
+ }
+ else if (WIFEXITED(process->result) ? WEXITSTATUS(process->result) : 0) {
+ const uint8_t code = WIFEXITED(process->result) ? WEXITSTATUS(process->result) : 0;
+
+ if (code == F_execute_access) {
+ fl_print_format("%[' failed, access is denied.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_bad) {
+ fl_print_format("%[' failed, unsupported format.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_buffer) {
+ fl_print_format("%[' invalid memory access in arguments buffer.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_busy) {
+ fl_print_format("%[' required resources are unavailable, too busy.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_capability) {
+ fl_print_format("%[' failed to setup capabilities.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_control_group) {
+ fl_print_format("%[' failed to setup control group.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_child) {
+ fl_print_format("%[' failed to setup child process.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_directory_not) {
+ fl_print_format("%[' invalid path, part of the path is not a valid directory.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_failure) {
+ fl_print_format("%[' failed during execution.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_file_found_not) {
+ fl_print_format("%[' failed, unable to find file.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_file_type_directory) {
+ fl_print_format("%[' ELF interpreter is a directory.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_fork_not) {
+ fl_print_format("%[' fork failure.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_format_not) {
+ fl_print_format("%[' could not be executed because the program has an invalid ELF header.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_group) {
+ fl_print_format("%[' failed to setup group.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_input_output) {
+ fl_print_format("%[' I/O failure.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_limit) {
+ fl_print_format("%[' failed to setup resource limits.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_loop) {
+ fl_print_format("%[' max recursion reached.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_memory_not) {
+ fl_print_format("%[' is out of memory.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_name_not) {
+ fl_print_format("%[' file name or path is too long.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_nice) {
+ fl_print_format("%[' failed to setup niceness.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_parameter) {
+ fl_print_format("%[' failed due to an invalid parameter.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_pipe) {
+ fl_print_format("%[' pipe failed.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_processor) {
+ fl_print_format("%[' failed to setup processor affinity.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_prohibited) {
+ fl_print_format("%[' access prohibited.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_resource_not) {
+ fl_print_format("%[' resource limit reached.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_schedule) {
+ fl_print_format("%[' failed to setup scheduler.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_terminal) {
+ fl_print_format("%[' failed while processing the terminal.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_terminal_known_not) {
+ fl_print_format("%[' cannot process terminal, unknown terminal control command.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_terminal_not) {
+ fl_print_format("%[' cannot process terminal, not a known terminal.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_terminal_prohibited) {
+ fl_print_format("%[' insufficient permissions to process the terminal.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_terminal_valid_not) {
+ fl_print_format("%[' invalid parameter while processing the terminal.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_too_large) {
+ fl_print_format("%[' too many arguments or arguments are too large.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_user) {
+ fl_print_format("%[' failed to setup user.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_valid_not) {
+ fl_print_format("%[' unknown ELF interpreter format.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_invoke_not) {
+ fl_print_format("%[' cannot execute command.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_found_not) {
+ fl_print_format("%[' command not found.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_found_not) {
+ fl_print_format("%[' invalid argument to exit().%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_hangup) {
+ fl_print_format("%[' hang up signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_interrupt) {
+ fl_print_format("%[' interrupt signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_quit) {
+ fl_print_format("%[' quit signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_illegal) {
+ fl_print_format("%[' illegal signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_trap) {
+ fl_print_format("%[' trap signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_abort) {
+ fl_print_format("%[' abort signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_bus_error) {
+ fl_print_format("%[' bus error signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_floating_point_error) {
+ fl_print_format("%[' floating point error signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_kill) {
+ fl_print_format("%[' kill signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_user_1) {
+ fl_print_format("%[' user 1 signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_segmentation_fault) {
+ fl_print_format("%[' segmentation fault signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_user_2) {
+ fl_print_format("%[' user 2 signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_broken_pipe) {
+ fl_print_format("%[' broken pipe signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_alarm_clock) {
+ fl_print_format("%[' alarm clock signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_termination) {
+ fl_print_format("%[' terminate signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_stack_fault) {
+ fl_print_format("%[' stack fault signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_child) {
+ fl_print_format("%[' child signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_continue) {
+ fl_print_format("%[' continue signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_stop) {
+ fl_print_format("%[' stop signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_keyboard_stop) {
+ fl_print_format("%[' keyboard stop signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_tty_in) {
+ fl_print_format("%[' TTY in signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_tty_out) {
+ fl_print_format("%[' TTY out signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_urgent) {
+ fl_print_format("%[' urgent signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_cpu_limit) {
+ fl_print_format("%[' CPU limit signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_file_size_limit) {
+ fl_print_format("%[' file size signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_virtual_alarm_clock) {
+ fl_print_format("%[' virtual alarm clock signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_profile_alarm_clock) {
+ fl_print_format("%[' profile alarm clock signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_window_size_change) {
+ fl_print_format("%[' window size change signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_pollable_event) {
+ fl_print_format("%[' pollable signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_power_failure) {
+ fl_print_format("%[' power failure signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else if (code == F_execute_signal_bad_system_call) {
+ fl_print_format("%[' bad system call signal received.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+ else {
+ fl_print_format("%[' failed with the execute error code %]", print->to, print->context, print->context);
+ fl_print_format("%[%i%]", print->to, print->notable, code, print->notable);
+ fl_print_format(f_string_format_sentence_end_s.string, print->to, print->context, print->context, f_string_eol_s);
+ }
+ }
+ else {
+ fl_print_format("%[' failed.%]%r", print->to, print->context, print->context, f_string_eol_s);
+ }
+
+ controller_unlock_print_flush(print->to, global->thread);
+ }
+#endif // _di_controller_main_print_rule_item_error_execute_
+
+#ifndef _di_controller_main_print_rule_item_error_need_want_wish_
+ void controller_main_print_rule_item_error_need_want_wish(fl_print_t * const print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why) {
+
+ 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);
+ }
+#endif // _di_controller_main_print_rule_item_error_need_want_wish_
+
+#ifndef _di_controller_main_print_rule_item_error_rule_not_loaded_
+ void controller_main_print_rule_item_error_rule_not_loaded(fl_print_t * const print, const f_string_static_t alias) {
+
+ 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);
+ }
+#endif // _di_controller_main_print_rule_item_error_rule_not_loaded_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Controller
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print rule item functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _controller_main_print_rule_item_h
+#define _controller_main_print_rule_item_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print rule debug message about the rule item action being empty.
+ *
+ * @param print
+ * The output structure to print to.
+ * Must not be NULL.
+ * @param cache
+ * A structure for containing and caching relevant data.
+ * Must not be NULL.
+ *
+ * @return
+ * F_okay on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fl_print_format()
+ * @see fll_error_print()
+ *
+ * @see controller_lock_print()
+ * @see controller_main_print_rule_error_cache()
+ * @see controller_unlock_print_flush()
+ */
+#ifndef _di_controller_main_print_rule_item_debug_action_empty_
+ extern f_status_t controller_main_print_rule_item_debug_action_empty(fl_print_t * const print, controller_cache_t * const cache);
+#endif // _di_controller_main_print_rule_item_debug_action_empty_
+
+/**
+ * Print additional error/warning information in addition to existing error.
+ *
+ * This is explicitly intended to be used in addition to the error message.
+ *
+ * @param print
+ * The error or warning print structure.
+ * @param cache
+ * A structure for containing and caching relevant data.
+ * @param item
+ * If TRUE, then this error is associated with an item.
+ * If FALSE, then this error is associated with a rule setting.
+ * @param status
+ * The status code representing the failure (without the error bit set).
+ *
+ * @see controller_main_print_rule_error_cache()
+ */
+#ifndef _di_controller_main_print_rule_item_error_
+ extern void controller_main_print_rule_item_error(fl_print_t * const print, const controller_cache_action_t cache, const bool item, const f_status_t status);
+#endif // _di_controller_main_print_rule_item_error_
+
+/**
+ * Print rule error message about the first rule item action parameter being invalid.
+ *
+ * @param print
+ * The output structure to print to.
+ * Must not be NULL.
+ * @param cache
+ * A structure for containing and caching relevant data.
+ * Must not be NULL.
+ *
+ * @return
+ * F_okay on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fl_print_format()
+ * @see fll_error_print()
+ *
+ * @see controller_lock_print()
+ * @see controller_main_print_rule_error_cache()
+ * @see controller_unlock_print_flush()
+ */
+#ifndef _di_controller_main_print_rule_item_error_action_first_
+ extern f_status_t controller_main_print_rule_item_error_action_first(fl_print_t * const print, controller_cache_t * const cache);
+#endif // _di_controller_main_print_rule_item_error_action_first_
+
+/**
+ * Print rule error message about the second rule item action parameter being invalid.
+ *
+ * @param print
+ * The output structure to print to.
+ * Must not be NULL.
+ * @param cache
+ * A structure for containing and caching relevant data.
+ * Must not be NULL.
+ *
+ * @return
+ * F_okay on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fl_print_format()
+ * @see fll_error_print()
+ *
+ * @see controller_lock_print()
+ * @see controller_main_print_rule_error_cache()
+ * @see controller_unlock_print_flush()
+ */
+#ifndef _di_controller_main_print_rule_item_error_action_second_
+ extern f_status_t controller_main_print_rule_item_error_action_second(fl_print_t * const print, controller_cache_t * const cache);
+#endif // _di_controller_main_print_rule_item_error_action_second_
+
+/**
+ * Print rule error message about the rule item action being unknown.
+ *
+ * @param print
+ * The output structure to print to.
+ * Must not be NULL.
+ * @param cache
+ * A structure for containing and caching relevant data.
+ * Must not be NULL.
+ * @param name
+ * The parameter name whose value is unknown.
+ * @param index
+ * The index in the content action cache representing the unknown value.
+ *
+ * @return
+ * F_okay on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fl_print_format()
+ * @see fll_error_print()
+ *
+ * @see controller_lock_print()
+ * @see controller_main_print_rule_error_cache()
+ * @see controller_unlock_print_flush()
+ */
+#ifndef _di_controller_main_print_rule_item_error_action_unknown_
+ extern f_status_t controller_main_print_rule_item_error_action_unknown(fl_print_t * const print, controller_cache_t * const cache, const f_string_static_t name, const f_number_unsigned_t index);
+#endif // _di_controller_main_print_rule_item_error_action_unknown_
+
+/**
+ * Print an error or warning message related to the failed execution of some program or script.
+ *
+ * @param print
+ * The output structure to print to.
+ *
+ * Must not be NULL.
+ * @param instance
+ * The process instance.
+ *
+ * Must not be NULL.
+ * @param script_is
+ * If TRUE, then this represents a script.
+ * If FALSE, then this represents a program.
+ * @param name
+ * The name of the program or script.
+ * @param code
+ * The code returned by the executed program or script.
+ * @param status
+ * The status code representing the failure (without the error bit set).
+ */
+#ifndef _di_controller_main_print_rule_item_error_execute_
+ extern void controller_main_print_rule_item_error_execute(fl_print_t * const print, controller_instance_t * const instance, const bool script_is, const f_string_static_t name, const f_status_t status);
+#endif // _di_controller_main_print_rule_item_error_execute_
+
+/**
+ * Print an error or warning message related to need/want/wish settings of some rule.
+ *
+ * @param print
+ * The error or warning output structure.
+ * @param need_want_wish
+ * The appropriate string, such as "needs", "wants", or "wishes for" to output when describing this error/warning.
+ * This string is expected to already be "safe" (no control characters, etc..).
+ * @param value
+ * The value that is the error or warning.
+ * @param why
+ * A short explanation on why this is an error or warning.
+ */
+#ifndef _di_controller_main_print_rule_item_error_need_want_wish_
+ extern void controller_main_print_rule_item_error_need_want_wish(fl_print_t * const print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why);
+#endif // _di_controller_main_print_rule_item_error_need_want_wish_
+
+/**
+ * Print an error or warning message about some rule not being loaded.
+ *
+ * @param print
+ * The error or warning output structure.
+ * @param alias
+ * The rule alias of the rule that is not loaded.
+ */
+#ifndef _di_controller_main_print_rule_item_error_rule_not_loaded_
+ extern void controller_main_print_rule_item_error_rule_not_loaded(fl_print_t * const print, const f_string_static_t alias);
+#endif // _di_controller_main_print_rule_item_error_rule_not_loaded_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _controller_main_print_rule_item_h
--- /dev/null
+#include "../../controller.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_controller_main_print_rule_setting_read_error_
+ void controller_main_print_rule_setting_read_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;
+
+ controller_main_t * const main = (controller_main_t *) print->custom;
+
+ f_state_t state = f_state_t_initialize;
+
+ // Get the current line number within the settings item.
+ cache->action.line_item = line_item;
+ f_fss_count_lines(cache->buffer_item, cache->object_actions.array[index].start, &cache->action.line_item, &main->setting.state);
+
+ cache->action.line_action = ++cache->action.line_item;
+
+ 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);
+
+ controller_main_print_rule_error_cache(print, cache->action, F_false);
+
+ controller_unlock_print_flush(print->to, thread);
+ }
+#endif // _di_controller_main_print_rule_setting_read_error_
+
+#ifndef _di_controller_main_print_rule_setting_read_error_with_range_
+ void controller_main_print_rule_setting_read_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;
+
+ controller_main_t * const main = (controller_main_t *) print->custom;
+
+ f_state_t state = f_state_t_initialize;
+
+ // Get the current line number within the settings item.
+ cache->action.line_item = line_item;
+ f_fss_count_lines(cache->buffer_item, cache->object_actions.array[index].start, &cache->action.line_item, &main->setting.state);
+
+ cache->action.line_action = ++cache->action.line_item;
+
+ 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);
+
+ controller_main_print_rule_error_cache(print, cache->action, F_false);
+
+ controller_unlock_print_flush(print->to, thread);
+ }
+#endif // _di_controller_main_print_rule_setting_read_error_with_range_
+
+#ifndef _di_controller_main_print_rule_setting_read_mapping_
+ void controller_main_print_rule_setting_read_mapping(const controller_global_t global, const f_string_static_t name, const f_string_map_t map) {
+
+ if (global.main->program.error.verbosity != f_console_verbosity_debug_e) {
+ if (!(global.main->program.error.verbosity == f_console_verbosity_verbose_e && (global.main->program.parameters.array[controller_parameter_simulate_e].result & f_console_result_found_e))) {
+ return;
+ }
+ }
+
+ 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.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);
+ }
+#endif // _di_controller_main_print_rule_setting_read_mapping_
+
+#ifndef _di_controller_main_print_rule_setting_read_value_
+ void controller_main_print_rule_setting_read_value(const controller_global_t global, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_t suffix) {
+
+ if (global.main->program.error.verbosity != f_console_verbosity_debug_e) {
+ if (!(global.main->program.error.verbosity == f_console_verbosity_verbose_e && (global.main->program.parameters.array[controller_parameter_simulate_e].result & f_console_result_found_e))) {
+ return;
+ }
+ }
+
+ controller_lock_print(global.main->program.output.to, global.thread);
+
+ fl_print_format("%rProcessing rule item action '%[%Q%]' setting ", global.main->program.output.to, f_string_eol_s, global.main->program.context.set.title, name, global.main->program.context.set.title);
+
+ if (name_sub.used) {
+ fl_print_format("'%[%Q%]'", global.main->program.output.to, global.main->program.context.set.notable, name_sub, global.main->program.context.set.notable);
+ }
+ else {
+ f_print_terminated("value", global.main->program.output.to);
+ }
+
+ fl_print_format(" to '%[%Q%]'", global.main->program.output.to, global.main->program.context.set.important, value, global.main->program.context.set.important);
+ fl_print_format("%S.%r", global.main->program.output.to, suffix, f_string_eol_s);
+
+ controller_unlock_print_flush(global.main->program.output.to, global.thread);
+ }
+#endif // _di_controller_main_print_rule_setting_read_value_
+
+#ifndef _di_controller_main_print_rule_setting_read_values_
+ void controller_main_print_rule_setting_read_values(const controller_global_t global, const f_string_static_t name, const f_number_unsigned_t index, controller_cache_t * const cache) {
+
+ if (global.main->program.error.verbosity != f_console_verbosity_debug_e) {
+ if (!(global.main->program.error.verbosity == f_console_verbosity_verbose_e && (global.main->program.parameters.array[controller_parameter_simulate_e].result & f_console_result_found_e))) {
+ return;
+ }
+ }
+
+ controller_lock_print(global.main->program.output.to, global.thread);
+
+ fl_print_format("%rProcessing rule item action '%[%Q%]' setting value to", global.main->program.output.to, f_string_eol_s, global.main->program.context.set.title, name, global.main->program.context.set.title);
+
+ for (f_number_unsigned_t j = 0; j < cache->content_actions.array[index].used; ++j) {
+
+ fl_print_format(" '%[%/Q%]'", global.main->program.output.to, global.main->program.context.set.important, cache->buffer_item, cache->content_actions.array[index].array[j], global.main->program.context.set.important);
+
+ if (j + 2 == cache->content_actions.array[index].used) {
+ if (cache->content_actions.array[index].used > 2) {
+ f_print_terminated(",", global.main->program.output.to);
+ }
+
+ f_print_terminated(" and", global.main->program.output.to);
+ }
+ else if (j + 1 < cache->content_actions.array[index].used) {
+ f_print_terminated(",", global.main->program.output.to);
+ }
+ } // for
+
+ fl_print_format(".%r", global.main->program.output.to, f_string_eol_s);
+
+ controller_unlock_print_flush(global.main->program.output.to, global.thread);
+ }
+#endif // _di_controller_main_print_rule_setting_read_value_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Controller
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print rule setting functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _controller_main_print_rule_setting_h
+#define _controller_main_print_rule_setting_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print a message about a rule setting problem.
+ *
+ * This is intended to be explicitly called by controller_rule_setting_read().
+ * This is intended only to be used for simple messages.
+ *
+ * @param print
+ * The error or warning output structure.
+ * @param message
+ * The string to append to the message being printed.
+ * @param index
+ * The position in the object actions cache representing the object.
+ * @param line_item
+ * The current line number.
+ * @param thread
+ * The thread data.
+ * @param cache
+ * A structure for containing and caching relevant data.
+ *
+ * @see controller_rule_setting_read()
+ */
+#ifndef _di_controller_main_print_rule_setting_read_error_
+ extern void controller_main_print_rule_setting_read_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);
+#endif // _di_controller_main_print_rule_setting_read_error_
+
+/**
+ * Print a message about a rule setting problem, with additional messages about the value.
+ *
+ * This is intended to be explicitly called by controller_rule_setting_read().
+ * This is intended only to be used for simple messages.
+ *
+ * @param print
+ * The error or warning output structure.
+ * @param before
+ * The string to add to the message being printed (before the value).
+ * @param range
+ * The range within the cache item buffer representing the value.
+ * @param after
+ * The string to add to the message being printed (after the value).
+ * @param index
+ * The position in the object actions cache representing the object.
+ * @param line_item
+ * The current line number.
+ * @param thread
+ * The thread data.
+ * @param cache
+ * A structure for containing and caching relevant data.
+ *
+ * @see controller_rule_setting_read()
+ */
+#ifndef _di_controller_main_print_rule_setting_read_error_with_range_
+ extern void controller_main_print_rule_setting_read_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);
+#endif // _di_controller_main_print_rule_setting_read_error_with_range_
+
+/**
+ * Print message regarding the mapping of a setting when in simulation or verbose mode.
+ *
+ * @param global
+ * The global data.
+ * @param name
+ * The Object name of the setting being populated.
+ * @param map
+ * The map being applied.
+ */
+#ifndef _di_controller_main_print_rule_setting_read_mapping_
+ extern void controller_main_print_rule_setting_read_mapping(const controller_global_t global, const f_string_static_t name, const f_string_map_t map);
+#endif // _di_controller_main_print_rule_setting_read_mapping_
+
+/**
+ * Print message regarding the population of a setting when in simulation or verbose mode.
+ *
+ * @param global
+ * The global data.
+ * @param name
+ * The Object name of the setting being populated.
+ * @param name_sub
+ * A sub-name associated with the setting being populated.
+ * Set to a string with used set to 0 to not use.
+ * @param value
+ * The value being set.
+ * @param suffix
+ * An additional message to append at the end (before the final period).
+ */
+#ifndef _di_controller_main_print_rule_setting_read_value_
+ extern void controller_main_print_rule_setting_read_value(const controller_global_t global, const f_string_static_t name, const f_string_static_t name_sub, const f_string_static_t value, const f_string_t suffix);
+#endif // _di_controller_main_print_rule_setting_read_value_
+
+/**
+ * Print message regarding the population of a setting when in simulation or verbose mode.
+ *
+ * This handles the case where there are multiple values stored in the buffer_item at a given content_actions position.
+ *
+ * @param global
+ * The global data.
+ * @param name
+ * The Object name of the setting being populated.
+ * @param index
+ * Position within the content_actions range cache array.
+ * @param cache
+ * A structure for containing and caching relevant data.
+ */
+#ifndef _di_controller_main_print_rule_setting_read_values_
+ extern void controller_main_print_rule_setting_read_values(const controller_global_t global, const f_string_static_t name, const f_number_unsigned_t index, controller_cache_t * const cache);
+#endif // _di_controller_main_print_rule_setting_read_values_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _controller_main_print_rule_setting_h
}
if (!type_rerun) {
- controller_main_print_rule_error_item_action_first(&global->main->program.error, cache);
+ controller_main_print_rule_item_error_action_first(&global->main->program.error, cache);
return F_status_set_error(F_valid_not);
}
}
}
else {
- controller_main_print_rule_error_item_action_second(&global->main->program.error, cache);
+ controller_main_print_rule_item_error_action_second(&global->main->program.error, cache);
return F_status_set_error(F_valid_not);
}
item->reruns[type_rerun].is |= rerun_item == &item->reruns[type_rerun].failure ? controller_rule_rerun_is_failure_reset_d : controller_rule_rerun_is_success_reset_d;
}
else {
- controller_main_print_rule_error_item_action_unknown(&global->main->program.error, cache, controller_rerun_s, i);
+ controller_main_print_rule_item_error_action_unknown(&global->main->program.error, cache, controller_rerun_s, i);
return F_status_set_error(F_valid_not);
}
item->with &= ~controller_with_session_new_d;
}
else {
- controller_main_print_rule_error_item_action_unknown(&global->main->program.error, cache, controller_with_s, i);
+ controller_main_print_rule_item_error_action_unknown(&global->main->program.error, cache, controller_with_s, i);
status = F_status_set_error(F_valid_not);
}
if (F_status_is_error_not(status) && status == F_data_not) {
- controller_main_print_rule_debug_item_action_empty(&global->main->program.debug, cache);
+ controller_main_print_rule_item_debug_action_empty(&global->debug, cache);
}
return status;
}
}
- controller_rule_print_rule_message_cache(&global->main->program.error, &cache->action, F_true);
+ controller_main_print_rule_error_cache(&global->error, &cache->action, F_true);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
status = controller_rule_expand(global, instance->rule.items.array[i].actions.array[j], instance);
if (F_status_is_error(status)) {
- controller_rule_print_error(global->thread, &global->main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false);
+ controller_main_print_rule_error(&global->error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false);
break;
}
status = controller_rule_expand(global, instance->rule.items.array[i].actions.array[j], instance);
if (F_status_is_error(status)) {
- controller_rule_print_error(global->thread, &global->main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false);
+ controller_main_print_rule_error(&global->error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false);
break;
}
status = controller_rule_expand(global, instance->rule.items.array[i].actions.array[j], instance);
if (F_status_is_error(status)) {
- controller_rule_print_error(global->thread, &global->main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false);
+ controller_main_print_rule_error(&global->error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false);
break;
}
else {
success = F_status_set_error(F_failure);
- controller_rule_action_print_error_missing_pid(&global->main->program.error, instance->rule.alias);
+ controller_main_print_rule_action_error_missing_pid(&global->error, instance->rule.alias);
}
}
else if (instance->rule.items.array[i].type == controller_rule_item_type_utility_e) {
status = controller_rule_expand(global, instance->rule.items.array[i].actions.array[j], instance);
if (F_status_is_error(status)) {
- controller_rule_print_error(global->thread, &global->main->program.error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false);
+ controller_main_print_rule_error(&global->error, instance->cache.action, F_status_set_fine(status), "controller_rule_expand", F_true, F_false);
break;
}
else {
success = F_status_set_error(F_failure);
- controller_rule_action_print_error_missing_pid(&global->main->program.error, instance->rule.alias);
+ controller_main_print_rule_action_error_missing_pid(&global->error, instance->rule.alias);
}
}
else {
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_rule_message_cache(&global->main->program.warning, instance->cache.action, F_true);
+ controller_main_print_rule_error_cache(&global->main->program.warning, instance->cache.action, F_true);
controller_unlock_print_flush(global->main->program.warning.to, global->thread);
}
f_status_t status = F_okay;
f_status_t status_lock = F_okay;
- controller_main_t * const main = (controller_main_t *) instance->main_data;
- controller_thread_t * const thread = (controller_thread_t *) instance->main_thread;
+ controller_main_t * const main = ((controller_global_t *) instance->global)->main;
+ controller_thread_t * const thread = ((controller_global_t *) instance->global)->thread;
f_execute_result_t result = f_execute_result_t_initialize;
{
const f_time_spec_t delay = controller_time_milliseconds(controller_thread_simulation_timeout_d);
- if (controller_time_sleep_nanoseconds(main, (controller_process_t *) instance->main_setting, delay) == -1) {
+ if (controller_time_sleep_nanoseconds((controller_global_t *) instance->global, delay) == -1) {
status = F_status_set_error(F_interrupt);
}
}
}
if (F_status_set_fine(status_lock) == F_interrupt || !controller_main_thread_is_enabled_instance(instance, thread)) {
- if (status_lock == F_okay) {
- return F_status_set_error(F_interrupt);
- }
-
- return F_status_set_error(F_lock);
+ return status_lock == F_okay ? F_status_set_error(F_interrupt) : F_status_set_error(F_lock);
}
if (status_lock == F_okay) {
status = F_status_set_fine(status);
if ((WIFEXITED(instance->result) && WEXITSTATUS(instance->result)) || status == F_control_group || status == F_failure || status == F_limit || status == F_processor || status == F_schedule) {
- controller_rule_item_print_error_execute(type == controller_rule_item_type_script_e, program.used ? program : arguments.array[0], status, instance);
+ controller_main_print_rule_item_error_execute(&global->error, instance, type == controller_rule_item_type_script_e, program.used ? program : arguments.array[0], status);
}
else {
- controller_main_print_error_status(&main->program.error, macro_controller_f(fll_execute_program), F_status_set_fine(status));
+ controller_main_print_error_status(&global->error, macro_controller_f(fll_execute_program), F_status_set_fine(status));
}
status = F_status_set_error(status);
f_status_t status = F_okay;
f_status_t status_lock = F_okay;
- controller_main_t * const main = (controller_main_t *) instance->main_data;
- controller_thread_t * const thread = (controller_thread_t *) instance->main_thread;
+ controller_main_t * const main = ((controller_global_t *) instance->global)->main;
+ controller_thread_t * const thread = ((controller_global_t *) instance->global)->thread;
f_execute_result_t result = f_execute_result_t_initialize;
{
const f_time_spec_t delay = controller_time_milliseconds(controller_thread_simulation_timeout_d);
- if (controller_time_sleep_nanoseconds(main, (controller_process_t *) instance->main_setting, delay) == -1) {
+ if (controller_time_sleep_nanoseconds((controller_global_t *) instance->global, delay) == -1) {
status = F_status_set_error(F_interrupt);
}
}
status = F_status_set_fine(status);
if ((WIFEXITED(instance->result) && WEXITSTATUS(instance->result)) || status == F_control_group || status == F_failure || status == F_limit || status == F_processor || status == F_schedule) {
- controller_rule_item_print_error_execute(type == controller_rule_item_type_utility_e, program.used ? program : arguments.array[0], status, instance);
+ controller_main_print_rule_item_error_execute(&global->error, instance, type == controller_rule_item_type_utility_e, program.used ? program : arguments.array[0], status);
}
else {
- controller_main_print_error_status(&main->program.error, macro_controller_f(fll_execute_program), F_status_set_fine(status));
+ controller_main_print_error_status(&global->error, macro_controller_f(fll_execute_program), F_status_set_fine(status));
}
return F_status_set_error(status);
const int result = WIFEXITED(instance->result) ? WEXITSTATUS(instance->result) : 0;
if (item->reruns[action].is & (result ? controller_rule_rerun_is_failure_d : controller_rule_rerun_is_success_d)) {
- controller_main_t * const main = (controller_main_t *) instance->main_data;
- controller_thread_t * const thread = (controller_thread_t *) instance->main_thread;
+ controller_main_t * const main = ((controller_global_t *) instance->global)->main;
+ controller_thread_t * const thread = ((controller_global_t *) instance->global)->thread;
controller_rule_rerun_item_t *rerun_item = result ? &item->reruns[action].failure : &item->reruns[action].success;
if (!controller_main_thread_is_enabled_instance(instance, thread)) return -2;
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(instance->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_rule_message_cache(&global->main->program.error, instance->cache.action, F_true);
+ controller_main_print_rule_error_cache(&global->error, instance->cache.action, F_true);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
}
if (F_status_is_error(status)) {
- controller_rule_print_error(global->thread, &global->main->program.error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true);
+ controller_main_print_rule_error(&global->error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true);
return status;
}
status = f_string_dynamic_append(instance->rule.alias, &instance->cache.action.name_file);
if (F_status_is_error(status)) {
- controller_rule_print_error(global->thread, &global->main->program.error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true);
+ controller_main_print_rule_error(&global->error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true);
return status;
}
}
if (F_status_is_error(status)) {
- controller_rule_print_error(global->thread, &global->main->program.error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true);
+ controller_main_print_rule_error(&global->error, instance->cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_true);
return status;
}
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_rule_message_cache(&global->main->program.error, instance->cache.action, F_false);
+ controller_main_print_rule_item_error_rule_not_loaded(&global->main->program.error, dynamics[i]->array[j]);
+ controller_main_print_rule_error_cache(&global->error, instance->cache.action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
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_rule_message_cache(&global->main->program.error, instance->cache.action, F_true);
+ controller_main_print_rule_item_error_need_want_wish(&global->main->program.error, strings[i], dynamics[i]->array[j], "is not found");
+ controller_main_print_rule_error_cache(&global->error, instance->cache.action, F_true);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
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_main_print_rule_item_error_need_want_wish(&global->main->program.warning, strings[i], dynamics[i]->array[j], "is not found");
- controller_rule_print_rule_message_cache(&global->main->program.warning, instance->cache.action, F_true);
+ controller_main_print_rule_error_cache(&global->main->program.warning, instance->cache.action, F_true);
controller_unlock_print_flush(global->main->program.warning.to, global->thread);
}
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_rule_message_cache(&global->main->program.error, instance->cache.action, F_true);
+ controller_main_print_rule_item_error_need_want_wish(&global->main->program.error, strings[i], alias_other_buffer, "failed during execution");
+ controller_main_print_rule_error_cache(&global->error, instance->cache.action, F_true);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
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_main_print_rule_item_error_need_want_wish(&global->main->program.warning, strings[i], alias_other_buffer, "failed during execution");
- controller_rule_print_rule_message_cache(&global->main->program.warning, instance->cache.action, F_true);
+ controller_main_print_rule_error_cache(&global->main->program.warning, instance->cache.action, F_true);
controller_unlock_print_flush(global->main->program.warning.to, 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_main_print_rule_item_error_need_want_wish(&global->main->program.error, strings[i], alias_other_buffer, "due to lock failure");
}
status = status_lock;
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_main_print_rule_item_error_need_want_wish(&global->main->program.error, strings[i], alias_other_buffer, "is in a failed state");
- controller_rule_print_rule_message_cache(&global->main->program.error, instance->cache.action, F_true);
+ controller_main_print_rule_error_cache(&global->error, instance->cache.action, F_true);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
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_main_print_rule_item_error_need_want_wish(&global->main->program.warning, strings[i], alias_other_buffer, "is in a failed state");
- controller_rule_print_rule_message_cache(&global->main->program.warning, instance->cache.action, F_true);
+ controller_main_print_rule_error_cache(&global->main->program.warning, instance->cache.action, F_true);
controller_unlock_print_flush(global->main->program.warning.to, global->thread);
}
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_rule_message_cache(&global->main->program.error, instance->cache.action, F_true);
+ controller_main_print_rule_error_cache(&global->error, instance->cache.action, F_true);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
}
if (F_status_is_error(status)) {
- controller_rule_item_print_error(global->thread, &global->main->program.error, instance->cache.action, F_true, F_status_set_fine(status));
+ controller_main_print_rule_item_error(global->error, instance->cache.action, F_true, F_status_set_fine(status));
}
}
}
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_rule_message_cache(&global->main->program.error, cache.action, F_false);
+ controller_main_print_rule_item_error_rule_not_loaded(&global->main->program.error, alias_rule);
+ controller_main_print_rule_error_cache(&global->error, cache.action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
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_main_print_rule_item_error(global->error, cache.action, F_false, F_status_set_fine(status));
f_thread_unlock(&global->thread->lock.instance);
instance->stack.used = 0;
- instance->main_data = (void *) global->main;
- instance->main_setting = (void *) global->setting;
- instance->main_thread = (void *) global->thread;
+ instance->global = (void *) global;
if (F_status_is_error_not(status) && stack.used) {
if (instance->stack.size < stack.used) {
fl_print_format(f_string_format_Q_single_s.string, global->main->program.error.to, global->main->program.error.notable, instance->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_rule_message_cache(&global->main->program.error, instance->cache.action, F_true);
+ controller_main_print_rule_error_cache(&global->error, instance->cache.action, F_true);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
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, instance->rule.alias);
- controller_rule_print_rule_message_cache(&global->main->program.error, instance->cache.action, F_false);
+ controller_main_print_rule_item_error_rule_not_loaded(&global->main->program.error, instance->rule.alias);
+ controller_main_print_rule_error_cache(&global->error, instance->cache.action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
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_rule_message_cache(&global->main->program.warning, cache->action, F_true);
+ controller_main_print_rule_error_cache(&global->main->program.warning, cache->action, F_true);
controller_unlock_print_flush(global->main->program.warning.to, global->thread);
}
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_rule_message_cache(&global->main->program.warning, cache->action, F_true);
+ controller_main_print_rule_error_cache(&global->main->program.warning, cache->action, F_true);
controller_unlock_print_flush(global->main->program.warning.to, global->thread);
}
}
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_main_print_rule_item_error(global->error, cache->action, for_item, F_status_set_fine(status));
rule->status[0] = controller_main_error_simplify(F_status_set_fine(status));
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_main_print_rule_error(&global->error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, F_false);
return status;
}
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_main_print_rule_error(&global->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;
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
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_rule_message_cache(&global->main->program.warning, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->main->program.warning, cache->action, F_false);
controller_unlock_print_flush(global->main->program.warning.to, global->thread);
}
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_main_print_rule_error(&global->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;
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
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_rule_message_cache(&global->main->program.warning, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->main->program.warning, cache->action, F_false);
controller_unlock_print_flush(global->main->program.warning.to, global->thread);
}
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_main_print_rule_setting_read_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);
status = f_memory_array_increase(controller_allocation_small_d, sizeof(int32_t), (void **) &rule->affinity.array, &rule->affinity.used, &rule->affinity.size);
if (F_status_is_error(status)) {
- controller_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_main_print_rule_error(&global->error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false);
break;
}
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_main_print_rule_setting_read_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_main_print_rule_setting_read_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_main_print_rule_setting_read_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);
}
}
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_main_print_rule_error(&global->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);
rule->affinity.array[rule->affinity.used++] = number;
} // for
- controller_rule_setting_read_print_values(global, controller_affinity_s, i, cache);
+ controller_main_print_rule_setting_read_values(global, controller_affinity_s, i, cache);
continue;
}
if (type == controller_rule_setting_type_define_e || type == controller_rule_setting_type_parameter_e) {
if (cache->content_actions.array[i].used != 2) {
- controller_rule_setting_read_print_error(&global->main->program.error, "requires exactly two Content", i, line_item, global->thread, cache);
+ controller_main_print_rule_setting_read_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);
status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_map_t), (void **) &setting_maps->array, &setting_maps->used, &setting_maps->size);
if (F_status_is_error(status)) {
- controller_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_main_print_rule_error(&global->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;
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
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_main_print_rule_error(&global->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;
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
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_main_print_rule_error(&global->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;
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
- controller_rule_setting_read_print_mapping(global, type == controller_rule_setting_type_define_e ? controller_define_s : controller_parameter_s, setting_maps->array[setting_maps->used]);
+ controller_main_print_rule_setting_read_mapping(global, type == controller_rule_setting_type_define_e ? controller_define_s : controller_parameter_s, setting_maps->array[setting_maps->used]);
++setting_maps->used;
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_main_print_rule_setting_read_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);
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_main_print_rule_setting_read_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);
status = f_string_dynamic_append(global->program->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_main_print_rule_error(&global->error, cache->action, F_status_set_fine(status), "f_string_dynamic_append", F_true, F_false);
}
else {
rule->cgroup.groups.used = 0;
status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &rule->cgroup.groups.array, &rule->cgroup.groups.used, &rule->cgroup.groups.size);
if (F_status_is_error(status)) {
- controller_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_main_print_rule_error(&global->error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false);
break;
}
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_main_print_rule_error(&global->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false);
break;
}
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
rule->has |= controller_rule_has_cgroup_d;
- controller_rule_setting_read_print_values(global, controller_cgroup_s, i, cache);
+ controller_main_print_rule_setting_read_values(global, controller_cgroup_s, i, cache);
continue;
}
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_main_print_rule_setting_read_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);
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_rule_message_cache(&global->main->program.error, &cache->action, F_true);
+ controller_main_print_rule_error_cache(&global->error, &cache->action, F_true);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
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_rule_message_cache(&global->main->program.error, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->error, cache->action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_limit_set_t), (void **) &rule->limits.array, &rule->limits.used, &rule->limits.size);
if (F_status_is_error(status)) {
- controller_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_main_print_rule_error(&global->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;
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
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_main_print_rule_setting_read_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_main_print_rule_setting_read_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_main_print_rule_setting_read_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);
}
}
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_main_print_rule_error(&global->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);
rule->limits.array[rule->limits.used++].type = type;
- controller_rule_setting_read_print_values(global, controller_limit_s, i, cache);
+ controller_main_print_rule_setting_read_values(global, controller_limit_s, i, cache);
continue;
}
}
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_main_print_rule_setting_read_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);
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
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_rule_message_cache(&global->main->program.error, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->error, cache->action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
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_main_print_rule_error(&global->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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
}
setting_value->used = 0;
continue;
}
- controller_rule_setting_read_print_value(global, type == controller_rule_setting_type_name_e ? controller_name_s : controller_engine_s, f_string_empty_s, *setting_value, 0);
+ controller_main_print_rule_setting_read_value(global, type == controller_rule_setting_type_name_e ? controller_name_s : controller_engine_s, f_string_empty_s, *setting_value, 0);
}
else if (type == controller_rule_setting_type_path_e) {
status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], setting_value);
if (F_status_is_error(status)) {
- controller_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_main_print_rule_error(&global->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;
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
- controller_rule_setting_read_print_value(global, controller_path_s, f_string_empty_s, *setting_value, 0);
+ controller_main_print_rule_setting_read_value(global, controller_path_s, f_string_empty_s, *setting_value, 0);
}
continue;
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_main_print_rule_setting_read_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);
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_main_print_rule_setting_read_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);
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_rule_message_cache(&global->main->program.error, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->error, cache->action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
}
}
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_main_print_rule_error(&global->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)) {
rule->has |= controller_rule_has_scheduler_d;
- controller_rule_setting_read_print_values(global, controller_scheduler_s, i, cache);
+ controller_main_print_rule_setting_read_values(global, controller_scheduler_s, i, cache);
continue;
}
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_main_print_rule_setting_read_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);
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_rule_message_cache(&global->main->program.error, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->error, cache->action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
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_main_print_rule_setting_read_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_main_print_rule_setting_read_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 {
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_main_print_rule_error(&global->error, cache->action, status, "fl_conversion_dynamic_partial_to_signed_detect", F_true, F_false);
}
if (F_status_is_error_not(status_return)) {
break;
}
- controller_rule_setting_read_print_value(global, controller_timeout_s, name_sub, cache->action.generic, 0);
+ controller_main_print_rule_setting_read_value(global, controller_timeout_s, name_sub, cache->action.generic, 0);
}
}
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_main_print_rule_setting_read_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);
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_main_print_rule_error(&global->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false);
- controller_rule_print_rule_message_cache(&global->main->program.error, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->error, cache->action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
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_main_print_rule_error(&global->error, cache->action, F_status_set_fine(status), "f_capability_from_text", F_true, F_false);
- controller_rule_print_rule_message_cache(&global->main->program.error, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->error, cache->action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
break;
}
- controller_rule_setting_read_print_error(&global->main->program.error, "failed to process the capabilities", i, line_item, global->thread, cache);
+ controller_main_print_rule_setting_read_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);
continue;
}
- controller_rule_setting_read_print_value(global, controller_capability_s, f_string_empty_s, cache->action.generic, 0);
+ controller_main_print_rule_setting_read_value(global, controller_capability_s, f_string_empty_s, cache->action.generic, 0);
}
else if (type == controller_rule_setting_type_nice_e) {
f_number_signed_t number = 0;
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_rule_message_cache(&global->main->program.error, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->error, cache->action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
}
}
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_main_print_rule_error(&global->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)) {
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_main_print_rule_error(&global->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false);
- controller_rule_print_rule_message_cache(&global->main->program.error, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->error, cache->action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
if (F_status_is_error_not(status)) {
- controller_rule_setting_read_print_value(global, controller_nice_s, f_string_empty_s, cache->action.generic, 0);
+ controller_main_print_rule_setting_read_value(global, controller_nice_s, f_string_empty_s, cache->action.generic, 0);
}
}
}
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_main_print_rule_setting_read_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_main_print_rule_setting_read_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_main_print_rule_setting_read_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 {
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_main_print_rule_error(&global->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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
}
if (F_status_is_error_not(status_return)) {
status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &cache->action.generic);
- controller_rule_setting_read_print_value(global, controller_user_s, f_string_empty_s, cache->action.generic, 0);
+ controller_main_print_rule_setting_read_value(global, controller_user_s, f_string_empty_s, cache->action.generic, 0);
}
}
}
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_main_print_rule_setting_read_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);
status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_int32s_t), (void **) &rule->groups.array, &rule->groups.used, &rule->groups.size);
if (F_status_is_error(status)) {
- controller_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_main_print_rule_error(&global->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;
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
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_main_print_rule_setting_read_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_main_print_rule_setting_read_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_main_print_rule_setting_read_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 {
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_main_print_rule_error(&global->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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
}
if (F_status_is_error_not(status_return)) {
}
} // for
- controller_rule_setting_read_print_values(global, controller_group_s, i, cache);
+ controller_main_print_rule_setting_read_values(global, controller_group_s, i, cache);
continue;
}
status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values->array, &setting_values->used, &setting_values->size);
if (F_status_is_error(status)) {
- controller_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_main_print_rule_error(&global->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;
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
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_main_print_rule_error(&global->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;
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
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_rule_message_cache(&global->main->program.error, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->error, cache->action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
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_main_print_rule_error(&global->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;
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
rule->has |= controller_rule_has_environment_d;
if (cache->content_actions.array[i].used) {
- controller_rule_setting_read_print_values(global, controller_environment_s, i, cache);
+ controller_main_print_rule_setting_read_values(global, controller_environment_s, i, cache);
}
else {
if (global->main->program.error.verbosity == f_console_verbosity_debug_e || (global->main->program.error.verbosity == f_console_verbosity_verbose_e && (global->main->program.parameters.array[controller_parameter_simulate_e].result & f_console_result_found_e))) {
// 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_main_print_rule_setting_read_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);
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_rule_message_cache(&global->main->program.error, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->error, cache->action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
}
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_main_print_rule_error(&global->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) {
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_rule_message_cache(&global->main->program.error, cache->action, F_false);
+ controller_main_print_rule_error_cache(&global->error, cache->action, F_false);
controller_unlock_print_flush(global->main->program.error.to, global->thread);
}
status = f_memory_array_increase_by(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values->array, &setting_values->used, &setting_values->size);
if (F_status_is_error(status)) {
- controller_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_main_print_rule_error(&global->error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, F_false);
}
}
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
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_main_print_rule_item_error(global->error, cache->action, F_false, F_status_set_fine(status));
continue;
}
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_main_print_rule_error(&global->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;
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_rule_message_cache(&global->main->program.error, &cache->action, F_true);
+ controller_main_print_rule_error_cache(&global->error, &cache->action, F_true);
controller_unlock_print_flush(main->program.error.to, global->thread);
}
if (!instance) return;
if (!controller_main_thread_is_enabled(is_normal, (controller_thread_t * const) instance->thread)) return;
- const f_status_t status = controller_rule_process_do(controller_instance_option_asynchronous_e, instance);
+ const f_status_t status = controller_rule_instance_do(controller_instance_option_asynchronous_e, instance);
// A forked child instance should deallocate memory on exit.
// It seems that this function doesn't return to the calling thread for a forked child instance, even with the "return 0;" below.
* The instance data.
* Must not be NULL.
*
- * @see controller_rule_process_do()
+ * @see controller_rule_instance_do()
*/
#ifndef _di_controller_main_thread_instance_
extern void controller_main_thread_instance(const uint8_t is_normal, controller_instance_t * const instance);