]> Kevux Git Server - fll/commitdiff
Cleanup: Restructure to have the *_type_name() functions into public functions under...
authorKevin Day <thekevinday@gmail.com>
Fri, 18 Mar 2022 02:56:39 +0000 (21:56 -0500)
committerKevin Day <thekevinday@gmail.com>
Fri, 18 Mar 2022 02:56:39 +0000 (21:56 -0500)
Have the programs expose these functions to the public API.

The enumerations, consequently must also be exposed publicly.

level_3/control/c/common.h
level_3/control/c/private-common.h
level_3/controller/c/common.c
level_3/controller/c/common.h
level_3/controller/c/common/private-common.h
level_3/controller/c/common/private-entry.h
level_3/controller/c/common/private-rule.h
level_3/controller/c/entry/private-entry.c
level_3/controller/c/entry/private-entry.h
level_3/controller/c/rule/private-rule.c
level_3/controller/c/rule/private-rule.h

index 02261fa851810912cea1a3bf2a252727564e4821..61225e26fb58c4e980653f4913f06af52683d3db 100644 (file)
@@ -131,26 +131,74 @@ extern "C" {
 #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);
index b8214a284427fd3ec71cca6b1590a511fba04c7e..4f6a64d6a08a67fadc196885544a1bccf702d3a3 100644 (file)
@@ -206,39 +206,6 @@ extern "C" {
 #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.
@@ -311,19 +278,6 @@ extern "C" {
 #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.
index aed3165a8abe535b4000e4fab557b50f0dd3b21a..588251c46dba970ba78aa9ecf6dcdd3a8a001726 100644 (file)
@@ -1,4 +1,5 @@
 #include "controller.h"
+#include "common/private-common.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -54,6 +55,60 @@ 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) {
 
@@ -65,6 +120,174 @@ extern "C" {
   }
 #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
index 3c3c3633fcc13420cc0bd5388f89544b75b9c156..fdcdc38f711de91d8ef43fd8af4e305d673a9cd7 100644 (file)
@@ -332,8 +332,6 @@ extern "C" {
  * 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 {
@@ -383,6 +381,101 @@ extern "C" {
 #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().
@@ -409,6 +502,62 @@ extern "C" {
   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
index 6318fc33eaaf961e2750347ef6a998632c8a0627..941f26e5652fa8e10ef6a00f71be8f0b8f189a60 100644 (file)
@@ -411,32 +411,6 @@ extern "C" {
 #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.
index 306121365392da2fad615bc6101773eabfed02b8..64f48988ecf005efefea7b2e9230c8208dff9f5b 100644 (file)
@@ -45,24 +45,6 @@ extern "C" {
  * 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
index 5c7c189b41c5c930193d955bc9753b84dc740f4c..8dbbf9e9261396a217391f21df44f24eac11badf 100644 (file)
@@ -209,14 +209,6 @@ extern "C" {
  * 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;
index 3920741febf49e8129c0be4b0f17cb545dfd4dc1..cbda287192ef78d3af8861f948466ac9005c4710 100644 (file)
@@ -35,60 +35,6 @@ extern "C" {
   }
 #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) {
 
index 175daf66c8b02608caf6cdd2cc653fad66b79e7d..3ce7ba0e8650eef03924eca4dcf4136b6a26683e 100644 (file)
@@ -27,20 +27,6 @@ extern "C" {
 #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
index b52ff2497c8a6ed3bf1b98e91d9af183f14a06d6..8cc278fe58affaf1bcf7885471848a8184c971bd 100644 (file)
@@ -216,93 +216,6 @@ extern "C" {
   }
 #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) {
 
@@ -2477,39 +2390,6 @@ extern "C" {
   }
 #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) {
 
@@ -2531,63 +2411,6 @@ extern "C" {
   }
 #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) {
 
index 504c0fd4c9c2c137af29b7f07814dae965d3b32f..3579478368f3b8e998f612387e34943278be331c 100644 (file)
@@ -114,41 +114,12 @@ extern "C" {
  *   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.
@@ -503,20 +474,6 @@ extern "C" {
 #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.
@@ -539,20 +496,6 @@ extern "C" {
 #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.