Have the programs expose these functions to the public API.
The enumerations, consequently must also be exposed publicly.
#endif // _di_control_parameters_
/**
- * Get the name of the action type.
+ * Codes representing supported actions.
+ *
+ * freeze: Perform the freeze controller operation.
+ * kill: Perform the kill controller operation.
+ * pause: Perform the pause controller operation.
+ * reboot: Perform the reboot controller operation (only for init mode).
+ * reload: Perform the reload controller operation.
+ * rerun: Perform the rerun controller operation.
+ * restart: Perform the restart controller operation.
+ * resume: Perform the resume controller operation.
+ * shutdown: Perform the shutdown controller operation (only for init mode).
+ * start: Perform the start controller operation.
+ * stop: Perform the stop controller operation.
+ * thaw: Perform the thaw controller operation.
+ */
+#ifndef _di_control_action_types_
+ enum {
+ control_action_type_freeze_e = 1,
+ control_action_type_kill_e,
+ control_action_type_pause_e,
+ control_action_type_reboot_e,
+ control_action_type_reload_e,
+ control_action_type_rerun_e,
+ control_action_type_restart_e,
+ control_action_type_resume_e,
+ control_action_type_shutdown_e,
+ control_action_type_start_e,
+ control_action_type_stop_e,
+ control_action_type_thaw_e,
+ };
+#endif // _di_control_action_types_
+
+/**
+ * Supported payload types.
+ *
+ * error: The payload is an error payload.
+ * controller: The payload is a controller payload.
+ */
+#ifndef _di_control_payload_types_
+ enum {
+ control_payload_type_error_e = 1,
+ control_payload_type_controller_e,
+ };
+#endif // _di_control_payload_types_
+
+/**
+ * Get a string representing the action type.
*
* @param type
* The action type id.
*
* @return
- * The string associated with the action type.
+ * The string with used > 0 on success.
+ * The string with used == 0 if no match was found.
*/
#ifndef _di_control_action_type_name_
extern f_string_static_t control_action_type_name(const uint8_t type);
#endif // _di_control_action_type_name_
/**
- * Get the name of the payload type.
+ * Get a string representing the payload type.
*
* @param type
* The payload type id.
*
* @return
- * The string associated with the payload type.
+ * The string with used > 0 on success.
+ * The string with used == 0 if no match was found.
*/
#ifndef _di_control_payload_type_name_
extern f_string_static_t control_payload_type_name(const uint8_t type);
#endif // _di_control_strings_s_
/**
- * Codes representing supported actions.
- *
- * freeze: Perform the freeze controller operation.
- * kill: Perform the kill controller operation.
- * pause: Perform the pause controller operation.
- * reboot: Perform the reboot controller operation (only for init mode).
- * reload: Perform the reload controller operation.
- * rerun: Perform the rerun controller operation.
- * restart: Perform the restart controller operation.
- * resume: Perform the resume controller operation.
- * shutdown: Perform the shutdown controller operation (only for init mode).
- * start: Perform the start controller operation.
- * stop: Perform the stop controller operation.
- * thaw: Perform the thaw controller operation.
- */
-#ifndef _di_control_action_types_
- enum {
- control_action_type_freeze_e = 1,
- control_action_type_kill_e,
- control_action_type_pause_e,
- control_action_type_reboot_e,
- control_action_type_reload_e,
- control_action_type_rerun_e,
- control_action_type_restart_e,
- control_action_type_resume_e,
- control_action_type_shutdown_e,
- control_action_type_start_e,
- control_action_type_stop_e,
- control_action_type_thaw_e,
- };
-#endif // _di_control_action_types_
-
-/**
* The control cache.
*
* large: A buffer for storing large sets of data.
#endif // _di_control_data_t_
/**
- * Supported payload types.
- *
- * error: The payload is an error payload.
- * controller: The payload is a controller payload.
- */
-#ifndef _di_control_payload_types_
- enum {
- control_payload_type_error_e = 1,
- control_payload_type_controller_e,
- };
-#endif // _di_control_payload_types_
-
-/**
* The packet payload header data.
*
* The FSS-000E (Payload) supports multiple objects, but the Control packet does not support this, yet.
#include "controller.h"
+#include "common/private-common.h"
#ifdef __cplusplus
extern "C" {
const f_string_static_t controller_long_validate_s = macro_f_string_static_t_initialize(CONTROLLER_long_validate_s, 0, CONTROLLER_long_validate_s_length);
#endif // _di_controller_parameters_
+#ifndef _di_controller_entry_action_type_name_
+ f_string_static_t controller_entry_action_type_name(const uint8_t type) {
+
+ switch (type) {
+ case controller_entry_action_type_consider_e:
+ return controller_consider_s;
+
+ case controller_entry_action_type_execute_e:
+ return controller_execute_s;
+
+ case controller_entry_action_type_failsafe_e:
+ return controller_failsafe_s;
+
+ case controller_entry_action_type_freeze_e:
+ return controller_freeze_s;
+
+ case controller_entry_action_type_item_e:
+ return controller_item_s;
+
+ case controller_entry_action_type_kill_e:
+ return controller_kill_s;
+
+ case controller_entry_action_type_pause_e:
+ return controller_pause_s;
+
+ case controller_entry_action_type_ready_e:
+ return controller_ready_s;
+
+ case controller_entry_action_type_reload_e:
+ return controller_reload_s;
+
+ case controller_entry_action_type_restart_e:
+ return controller_restart_s;
+
+ case controller_entry_action_type_resume_e:
+ return controller_resume_s;
+
+ case controller_entry_action_type_start_e:
+ return controller_start_s;
+
+ case controller_entry_action_type_stop_e:
+ return controller_stop_s;
+
+ case controller_entry_action_type_thaw_e:
+ return controller_thaw_s;
+
+ case controller_entry_action_type_timeout_e:
+ return controller_timeout_s;
+ }
+
+ return f_string_empty_s;
+ }
+#endif // _di_controller_entry_action_type_name_
+
#ifndef _di_controller_main_delete_
f_status_t controller_main_delete(controller_main_t * const main) {
}
#endif // _di_controller_main_delete_
+#ifndef _di_controller_rule_action_type_name_
+ f_string_static_t controller_rule_action_type_name(const uint8_t type) {
+
+ switch (type) {
+ case controller_rule_action_type_freeze_e:
+ return controller_freeze_s;
+
+ case controller_rule_action_type_group_e:
+ return controller_group_s;
+
+ case controller_rule_action_type_kill_e:
+ return controller_kill_s;
+
+ case controller_rule_action_type_pause_e:
+ return controller_pause_s;
+
+ case controller_rule_action_type_pid_file_e:
+ return controller_pid_file_s;
+
+ case controller_rule_action_type_rerun_e:
+ return controller_rerun_s;
+
+ case controller_rule_action_type_reload_e:
+ return controller_reload_s;
+
+ case controller_rule_action_type_restart_e:
+ return controller_restart_s;
+
+ case controller_rule_action_type_resume_e:
+ return controller_resume_s;
+
+ case controller_rule_action_type_start_e:
+ return controller_start_s;
+
+ case controller_rule_action_type_stop_e:
+ return controller_stop_s;
+
+ case controller_rule_action_type_thaw_e:
+ return controller_thaw_s;
+
+ case controller_rule_action_type_user_e:
+ return controller_user_s;
+
+ case controller_rule_action_type_with_e:
+ return controller_with_s;
+ }
+
+ return f_string_empty_s;
+ }
+#endif // _di_controller_rule_action_type_name_
+
+#ifndef _di_controller_rule_action_type_execute_name_
+ f_string_static_t controller_rule_action_type_execute_name(const uint8_t type) {
+
+ switch (type) {
+ case controller_rule_action_type_execute_freeze_e:
+ return controller_freeze_s;
+
+ case controller_rule_action_type_execute_kill_e:
+ return controller_kill_s;
+
+ case controller_rule_action_type_execute_pause_e:
+ return controller_pause_s;
+
+ case controller_rule_action_type_execute_reload_e:
+ return controller_reload_s;
+
+ case controller_rule_action_type_execute_restart_e:
+ return controller_restart_s;
+
+ case controller_rule_action_type_execute_resume_e:
+ return controller_resume_s;
+
+ case controller_rule_action_type_execute_start_e:
+ return controller_start_s;
+
+ case controller_rule_action_type_execute_stop_e:
+ return controller_stop_s;
+
+ case controller_rule_action_type_execute_thaw_e:
+ return controller_thaw_s;
+ }
+
+ return f_string_empty_s;
+ }
+#endif // _di_controller_rule_action_type_execute_name_
+
+#ifndef _di_controller_rule_item_type_name_
+ f_string_static_t controller_rule_item_type_name(const uint8_t type) {
+
+ switch (type) {
+ case controller_rule_item_type_command_e:
+ return controller_command_s;
+
+ case controller_rule_item_type_script_e:
+ return controller_script_s;
+
+ case controller_rule_item_type_service_e:
+ return controller_service_s;
+
+ case controller_rule_item_type_setting_e:
+ return controller_setting_s;
+
+ case controller_rule_item_type_utility_e:
+ return controller_utility_s;
+ }
+
+ return f_string_empty_s;
+ }
+#endif // _di_controller_rule_item_type_name_
+
+#ifndef _di_controller_rule_setting_limit_type_name_
+ f_string_static_t controller_rule_setting_limit_type_name(const uint8_t type) {
+
+ switch (type) {
+ case controller_resource_limit_type_as_e:
+ return controller_as_s;
+
+ case controller_resource_limit_type_core_e:
+ return controller_core_s;
+
+ case controller_resource_limit_type_cpu_e:
+ return controller_cpu_s;
+
+ case controller_resource_limit_type_data_e:
+ return controller_data_s;
+
+ case controller_resource_limit_type_fsize_e:
+ return controller_fsize_s;
+
+ case controller_resource_limit_type_locks_e:
+ return controller_locks_s;
+
+ case controller_resource_limit_type_memlock_e:
+ return controller_memlock_s;
+
+ case controller_resource_limit_type_msgqueue_e:
+ return controller_msgqueue_s;
+
+ case controller_resource_limit_type_nice_e:
+ return controller_nice_s;
+
+ case controller_resource_limit_type_nofile_e:
+ return controller_nofile_s;
+
+ case controller_resource_limit_type_nproc_e:
+ return controller_nproc_s;
+
+ case controller_resource_limit_type_rss_e:
+ return controller_rss_s;
+
+ case controller_resource_limit_type_rtprio_e:
+ return controller_rtprio_s;
+
+ case controller_resource_limit_type_rttime_e:
+ return controller_rttime_s;
+
+ case controller_resource_limit_type_sigpending_e:
+ return controller_sigpending_s;
+
+ case controller_resource_limit_type_stack_e:
+ return controller_stack_s;
+ }
+
+ return f_string_empty_s;
+ }
+#endif // _di_controller_rule_setting_limit_type_name_
+
#ifdef __cplusplus
} // extern "C"
#endif
* warning: The output file for warning printing.
* signal: The process signal management structure.
* context: The color context.
- *
- * @todo
*/
#ifndef _di_controller_main_t_
typedef struct {
#endif // _di_controller_main_t_
/**
+ * Codes representing supported actions.
+ *
+ * freeze: Perform the freeze controller operation.
+ * kill: Perform the kill controller operation.
+ * pause: Perform the pause controller operation.
+ * reboot: Perform the reboot controller operation (only for init mode).
+ * reload: Perform the reload controller operation.
+ * rerun: Perform the rerun controller operation.
+ * restart: Perform the restart controller operation.
+ * resume: Perform the resume controller operation.
+ * shutdown: Perform the shutdown controller operation (only for init mode).
+ * start: Perform the start controller operation.
+ * stop: Perform the stop controller operation.
+ * thaw: Perform the thaw controller operation.
+ */
+#ifndef _di_controller_entry_action_types_t_
+ enum {
+ controller_entry_action_type_consider_e = 1,
+ controller_entry_action_type_execute_e,
+ controller_entry_action_type_failsafe_e,
+ controller_entry_action_type_freeze_e,
+ controller_entry_action_type_item_e,
+ controller_entry_action_type_kill_e,
+ controller_entry_action_type_pause_e,
+ controller_entry_action_type_ready_e,
+ controller_entry_action_type_reload_e,
+ controller_entry_action_type_restart_e,
+ controller_entry_action_type_resume_e,
+ controller_entry_action_type_start_e,
+ controller_entry_action_type_stop_e,
+ controller_entry_action_type_timeout_e,
+ controller_entry_action_type_thaw_e,
+ };
+#endif // _di_controller_entry_action_types_t_
+
+/**
+ * Codes representing items.
+ *
+ * command: The item type represents a command operation.
+ * script: The item type represents a script operation.
+ * service: The item type represents a service operation.
+ * setting: The item type represents a setting operation.
+ * utility: The item type represents a utility operation.
+ */
+#ifndef _di_controller_rule_item_types_t_
+ enum {
+ controller_rule_item_type_command_e = 1,
+ controller_rule_item_type_script_e,
+ controller_rule_item_type_service_e,
+ controller_rule_item_type_setting_e,
+ controller_rule_item_type_utility_e,
+ };
+#endif // _di_controller_rule_item_types_t_
+
+/**
+ * A set of codes for resource limitations.
+ *
+ * This essentally converts the POSIX standard names into a more verbose format.
+ */
+#ifndef _di_controller_resource_limit_t_
+ enum {
+ controller_resource_limit_type_as_e = RLIMIT_AS,
+ controller_resource_limit_type_core_e = RLIMIT_CORE,
+ controller_resource_limit_type_cpu_e = RLIMIT_CPU,
+ controller_resource_limit_type_data_e = RLIMIT_DATA,
+ controller_resource_limit_type_fsize_e = RLIMIT_FSIZE,
+ controller_resource_limit_type_locks_e = RLIMIT_LOCKS,
+ controller_resource_limit_type_memlock_e = RLIMIT_MEMLOCK,
+ controller_resource_limit_type_msgqueue_e = RLIMIT_MSGQUEUE,
+ controller_resource_limit_type_nice_e = RLIMIT_NICE,
+ controller_resource_limit_type_nofile_e = RLIMIT_NOFILE,
+ controller_resource_limit_type_nproc_e = RLIMIT_NPROC,
+ controller_resource_limit_type_rss_e = RLIMIT_RSS,
+ controller_resource_limit_type_rtprio_e = RLIMIT_RTPRIO,
+ controller_resource_limit_type_rttime_e = RLIMIT_RTTIME,
+ controller_resource_limit_type_sigpending_e = RLIMIT_SIGPENDING,
+ controller_resource_limit_type_stack_e = RLIMIT_STACK,
+ };
+#endif // _di_controller_resource_limit_t_
+
+/**
+ * Get a string representing the entry action type.
+ *
+ * @param type
+ * The entry action type code.
+ *
+ * @return
+ * The string with used > 0 on success.
+ * The string with used == 0 if no match was found.
+ */
+#ifndef _di_controller_entry_action_type_name_
+ extern f_string_static_t controller_entry_action_type_name(const uint8_t type);
+#endif // _di_controller_entry_action_type_name_
+
+/**
* Deallocate main.
*
* Be sure to call this after executing controller_main().
extern f_status_t controller_main_delete(controller_main_t * const main);
#endif // _di_controller_main_delete_
+/**
+ * Get a string representing the rule action type.
+ *
+ * @param type
+ * The rule action type code.
+ *
+ * @return
+ * The string with used > 0 on success.
+ * The string with used == 0 if no match was found.
+ */
+#ifndef _di_controller_rule_action_type_name_
+ extern f_string_static_t controller_rule_action_type_name(const uint8_t type);
+#endif // _di_controller_rule_action_type_name_
+
+/**
+ * Get a string representing the rule action execute type.
+ *
+ * @param type
+ * The rule action type execute code.
+ *
+ * @return
+ * The string with used > 0 on success.
+ * The string with used == 0 if no match was found.
+ */
+#ifndef _di_controller_rule_action_type_execute_name_
+ extern f_string_static_t controller_rule_action_type_execute_name(const uint8_t type);
+#endif // _di_controller_rule_action_type_execute_name_
+
+/**
+ * Get a string representing the rule item type.
+ *
+ * @param type
+ * The rule item type code.
+ *
+ * @return
+ * The string with used > 0 on success.
+ * The string with used == 0 if no match was found.
+ */
+#ifndef _di_controller_rule_item_type_name_
+ extern f_string_static_t controller_rule_item_type_name(const uint8_t type);
+#endif // _di_controller_rule_item_type_name_
+
+/**
+ * Get a string representing the rule setting limit type.
+ *
+ * @param type
+ * The rule setting limit type code.
+ *
+ * @return
+ * The string with used > 0 on success.
+ * The string with used == 0 if no match was found.
+ */
+#ifndef _di_controller_rule_setting_limit_type_name_
+ extern f_string_static_t controller_rule_setting_limit_type_name(const uint8_t type);
+#endif // di_controller_rule_setting_limit_type_name_
+
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _di_controller_string_s_
/**
- * A set of codes for resource limitations.
- *
- * This essentally converts the POSIX standard names into a more verbose format.
- */
-#ifndef _di_controller_resource_limit_t_
- enum {
- controller_resource_limit_type_as_e = RLIMIT_AS,
- controller_resource_limit_type_core_e = RLIMIT_CORE,
- controller_resource_limit_type_cpu_e = RLIMIT_CPU,
- controller_resource_limit_type_data_e = RLIMIT_DATA,
- controller_resource_limit_type_fsize_e = RLIMIT_FSIZE,
- controller_resource_limit_type_locks_e = RLIMIT_LOCKS,
- controller_resource_limit_type_memlock_e = RLIMIT_MEMLOCK,
- controller_resource_limit_type_msgqueue_e = RLIMIT_MSGQUEUE,
- controller_resource_limit_type_nice_e = RLIMIT_NICE,
- controller_resource_limit_type_nofile_e = RLIMIT_NOFILE,
- controller_resource_limit_type_nproc_e = RLIMIT_NPROC,
- controller_resource_limit_type_rss_e = RLIMIT_RSS,
- controller_resource_limit_type_rtprio_e = RLIMIT_RTPRIO,
- controller_resource_limit_type_rttime_e = RLIMIT_RTTIME,
- controller_resource_limit_type_sigpending_e = RLIMIT_SIGPENDING,
- controller_resource_limit_type_stack_e = RLIMIT_STACK,
- };
-#endif // _di_controller_resource_limit_t_
-
-/**
* Provide common/generic definitions.
*
* The controller_common_allocation_large_d or controller_common_allocation_small_d must be at least 2 for this project.
* parameters: The values associated with the Action.
*/
#ifndef _di_controller_entry_action_t_
- enum {
- controller_entry_action_type_consider_e = 1,
- controller_entry_action_type_execute_e,
- controller_entry_action_type_failsafe_e,
- controller_entry_action_type_freeze_e,
- controller_entry_action_type_item_e,
- controller_entry_action_type_kill_e,
- controller_entry_action_type_pause_e,
- controller_entry_action_type_ready_e,
- controller_entry_action_type_reload_e,
- controller_entry_action_type_restart_e,
- controller_entry_action_type_resume_e,
- controller_entry_action_type_start_e,
- controller_entry_action_type_stop_e,
- controller_entry_action_type_timeout_e,
- controller_entry_action_type_thaw_e,
- };
-
#define controller_entry_rule_code_asynchronous_d 0x1
#define controller_entry_rule_code_require_d 0x2
#define controller_entry_rule_code_wait_d 0x4
* actions: The actions associated with the Rule Item.
*/
#ifndef _di_controller_rule_item_t_
- enum {
- controller_rule_item_type_command_e = 1,
- controller_rule_item_type_script_e,
- controller_rule_item_type_service_e,
- controller_rule_item_type_setting_e,
- controller_rule_item_type_utility_e,
- };
-
typedef struct {
uint8_t type;
uint8_t with;
}
#endif // _di_controller_entry_action_type_is_rule_
-#ifndef _di_controller_entry_action_type_name_
- f_string_static_t controller_entry_action_type_name(const uint8_t type) {
-
- switch (type) {
- case controller_entry_action_type_consider_e:
- return controller_consider_s;
-
- case controller_entry_action_type_execute_e:
- return controller_execute_s;
-
- case controller_entry_action_type_failsafe_e:
- return controller_failsafe_s;
-
- case controller_entry_action_type_freeze_e:
- return controller_freeze_s;
-
- case controller_entry_action_type_item_e:
- return controller_item_s;
-
- case controller_entry_action_type_kill_e:
- return controller_kill_s;
-
- case controller_entry_action_type_pause_e:
- return controller_pause_s;
-
- case controller_entry_action_type_ready_e:
- return controller_ready_s;
-
- case controller_entry_action_type_reload_e:
- return controller_reload_s;
-
- case controller_entry_action_type_restart_e:
- return controller_restart_s;
-
- case controller_entry_action_type_resume_e:
- return controller_resume_s;
-
- case controller_entry_action_type_start_e:
- return controller_start_s;
-
- case controller_entry_action_type_stop_e:
- return controller_stop_s;
-
- case controller_entry_action_type_thaw_e:
- return controller_thaw_s;
-
- case controller_entry_action_type_timeout_e:
- return controller_timeout_s;
- }
-
- return f_string_empty_s;
- }
-#endif // _di_controller_entry_action_type_name_
-
#ifndef _di_controller_entry_action_type_to_rule_action_type_
uint8_t controller_entry_action_type_to_rule_action_type(uint8_t type) {
#endif // _di_controller_entry_action_type_is_rule_
/**
- * Get a string representing the entry action type.
- *
- * @param type
- * The entry action type code.
- *
- * @return
- * The string with used > 0 on success.
- * The string with used == 0 if no match was found.
- */
-#ifndef _di_controller_entry_action_type_name_
- extern f_string_static_t controller_entry_action_type_name(const uint8_t type) F_attribute_visibility_internal_d;
-#endif // _di_controller_entry_action_type_name_
-
-/**
* Convert the Entry Action type to Rule Action type.
*
* @param type
}
#endif // _di_controller_rule_action_type_to_action_execute_type_
-#ifndef _di_controller_rule_action_type_name_
- f_string_static_t controller_rule_action_type_name(const uint8_t type) {
-
- switch (type) {
- case controller_rule_action_type_freeze_e:
- return controller_freeze_s;
-
- case controller_rule_action_type_group_e:
- return controller_group_s;
-
- case controller_rule_action_type_kill_e:
- return controller_kill_s;
-
- case controller_rule_action_type_pause_e:
- return controller_pause_s;
-
- case controller_rule_action_type_pid_file_e:
- return controller_pid_file_s;
-
- case controller_rule_action_type_rerun_e:
- return controller_rerun_s;
-
- case controller_rule_action_type_reload_e:
- return controller_reload_s;
-
- case controller_rule_action_type_restart_e:
- return controller_restart_s;
-
- case controller_rule_action_type_resume_e:
- return controller_resume_s;
-
- case controller_rule_action_type_start_e:
- return controller_start_s;
-
- case controller_rule_action_type_stop_e:
- return controller_stop_s;
-
- case controller_rule_action_type_thaw_e:
- return controller_thaw_s;
-
- case controller_rule_action_type_user_e:
- return controller_user_s;
-
- case controller_rule_action_type_with_e:
- return controller_with_s;
- }
-
- return f_string_empty_s;
- }
-#endif // _di_controller_rule_action_type_name_
-
-#ifndef _di_controller_rule_action_type_execute_name_
- f_string_static_t controller_rule_action_type_execute_name(const uint8_t type) {
-
- switch (type) {
- case controller_rule_action_type_execute_freeze_e:
- return controller_freeze_s;
-
- case controller_rule_action_type_execute_kill_e:
- return controller_kill_s;
-
- case controller_rule_action_type_execute_pause_e:
- return controller_pause_s;
-
- case controller_rule_action_type_execute_reload_e:
- return controller_reload_s;
-
- case controller_rule_action_type_execute_restart_e:
- return controller_restart_s;
-
- case controller_rule_action_type_execute_resume_e:
- return controller_resume_s;
-
- case controller_rule_action_type_execute_start_e:
- return controller_start_s;
-
- case controller_rule_action_type_execute_stop_e:
- return controller_stop_s;
-
- case controller_rule_action_type_execute_thaw_e:
- return controller_thaw_s;
- }
-
- return f_string_empty_s;
- }
-#endif // _di_controller_rule_action_type_execute_name_
-
#ifndef _di_controller_rule_action_read_
f_status_t controller_rule_action_read(const controller_global_t global, const bool is_normal, const uint8_t type, const uint8_t method, controller_cache_t * const cache, controller_rule_item_t *item, controller_rule_actions_t *actions, f_string_range_t *range) {
}
#endif // _di_controller_rule_item_read_
-#ifndef _di_controller_rule_item_type_name_
- f_string_static_t controller_rule_item_type_name(const uint8_t type) {
-
- f_string_static_t buffer = f_string_static_t_initialize;
-
- switch (type) {
- case controller_rule_item_type_command_e:
- buffer = controller_command_s;
- break;
-
- case controller_rule_item_type_script_e:
- buffer = controller_script_s;
- break;
-
- case controller_rule_item_type_service_e:
- buffer = controller_service_s;
- break;
-
- case controller_rule_item_type_setting_e:
- buffer = controller_setting_s;
- break;
-
- case controller_rule_item_type_utility_e:
- buffer = controller_utility_s;
- break;
- }
-
- buffer.size = buffer.used;
-
- return buffer;
- }
-#endif // _di_controller_rule_item_type_name_
-
#ifndef _di_controller_rule_items_increase_by_
f_status_t controller_rule_items_increase_by(const f_array_length_t amount, controller_rule_items_t * const items) {
}
#endif // _di_controller_rule_items_increase_by_
-#ifndef _di_controller_rule_setting_limit_type_name_
- f_string_static_t controller_rule_setting_limit_type_name(const uint8_t type) {
-
- switch (type) {
- case controller_resource_limit_type_as_e:
- return controller_as_s;
-
- case controller_resource_limit_type_core_e:
- return controller_core_s;
-
- case controller_resource_limit_type_cpu_e:
- return controller_cpu_s;
-
- case controller_resource_limit_type_data_e:
- return controller_data_s;
-
- case controller_resource_limit_type_fsize_e:
- return controller_fsize_s;
-
- case controller_resource_limit_type_locks_e:
- return controller_locks_s;
-
- case controller_resource_limit_type_memlock_e:
- return controller_memlock_s;
-
- case controller_resource_limit_type_msgqueue_e:
- return controller_msgqueue_s;
-
- case controller_resource_limit_type_nice_e:
- return controller_nice_s;
-
- case controller_resource_limit_type_nofile_e:
- return controller_nofile_s;
-
- case controller_resource_limit_type_nproc_e:
- return controller_nproc_s;
-
- case controller_resource_limit_type_rss_e:
- return controller_rss_s;
-
- case controller_resource_limit_type_rtprio_e:
- return controller_rtprio_s;
-
- case controller_resource_limit_type_rttime_e:
- return controller_rttime_s;
-
- case controller_resource_limit_type_sigpending_e:
- return controller_sigpending_s;
-
- case controller_resource_limit_type_stack_e:
- return controller_stack_s;
- }
-
- return f_string_empty_s;
- }
-#endif // _di_controller_rule_setting_limit_type_name_
-
#ifndef _di_controller_rule_process_
f_status_t controller_rule_process(const controller_global_t global, controller_process_t * const process) {
* The converted action type, converted into an action execute type.
*
* The code controller_rule_action_type_execute__enum_size_e is returned for unknown types.
- *
*/
#ifndef _di_controller_rule_action_type_to_action_execute_type_
extern uint8_t controller_rule_action_type_to_action_execute_type(const uint8_t type) F_attribute_visibility_internal_d;
#endif // _di_controller_rule_action_type_to_action_execute_type_
/**
- * Get a string representing the rule action type.
- *
- * @param type
- * The rule action type code.
- *
- * @return
- * The string with used > 0 on success.
- * The string with used == 0 if no match was found.
- */
-#ifndef _di_controller_rule_action_type_name_
- extern f_string_static_t controller_rule_action_type_name(const uint8_t type) F_attribute_visibility_internal_d;
-#endif // _di_controller_rule_action_type_name_
-
-/**
- * Get a string representing the rule action execute type.
- *
- * @param type
- * The rule action type execute code.
- *
- * @return
- * The string with used > 0 on success.
- * The string with used == 0 if no match was found.
- */
-#ifndef _di_controller_rule_action_type_execute_name_
- extern f_string_static_t controller_rule_action_type_execute_name(const uint8_t type) F_attribute_visibility_internal_d;
-#endif // _di_controller_rule_action_type_execute_name_
-
-/**
* Read the content within the buffer, processing the action (or a set of within a list) for the given item.
*
* This will automatically increase the size of the actions array as needed.
#endif // _di_controller_rule_item_read_
/**
- * Get a string representing the rule item type.
- *
- * @param type
- * The rule item type code.
- *
- * @return
- * The string with used > 0 on success.
- * The string with used == 0 if no match was found.
- */
-#ifndef _di_controller_rule_item_type_name_
- extern f_string_static_t controller_rule_item_type_name(const uint8_t type) F_attribute_visibility_internal_d;
-#endif // _di_controller_rule_item_type_name_
-
-/**
* Increase the size of the rule items array by the specified amount, but only if necessary.
*
* This only increases size if the current used plus amount is greater than the currently allocated size.
#endif // _di_controller_rule_items_increase_by_
/**
- * Get a string representing the rule setting limit type.
- *
- * @param type
- * The rule setting limit type code.
- *
- * @return
- * The string with used > 0 on success.
- * The string with used == 0 if no match was found.
- */
-#ifndef _di_controller_rule_setting_limit_type_name_
- extern f_string_static_t controller_rule_setting_limit_type_name(const uint8_t type) F_attribute_visibility_internal_d;
-#endif // di_controller_rule_setting_limit_type_name_
-
-/**
* Process and execute the given rule.
*
* Any dependent rules are processed and executed as per "need", "want", and "wish" rule settings.