]> Kevux Git Server - controller/commitdiff
Refactor: Change bit-wise enumerations into defines.
authorKevin Day <Kevin@kevux.org>
Wed, 31 Jul 2024 02:45:38 +0000 (21:45 -0500)
committerKevin Day <Kevin@kevux.org>
Wed, 31 Jul 2024 02:45:38 +0000 (21:45 -0500)
I did some reviewing of how the enumerations used for flags are used.
These generally are not being used as a type.
An enumeration slightly increases the resulting binary size.
Enumeration values might be limited to just type of int.

This seems like an easy (small) optimization to just use defines rather than enumerations for flags and other bit-wise numbers.

21 files changed:
sources/c/program/controller/controller/main.c
sources/c/program/controller/init/main.c
sources/c/program/controller/main/common.c
sources/c/program/controller/main/common/define.h
sources/c/program/controller/main/common/enumeration.h
sources/c/program/controller/main/common/type.h
sources/c/program/controller/main/entry/process.c
sources/c/program/controller/main/entry/setting.c
sources/c/program/controller/main/perform.c
sources/c/program/controller/main/print/error/rule/setting.c
sources/c/program/controller/main/print/message/entry/item.c
sources/c/program/controller/main/print/output/entry/setting.c
sources/c/program/controller/main/print/output/rule/setting.c
sources/c/program/controller/main/process.c
sources/c/program/controller/main/rule/instance.c
sources/c/program/controller/main/rule/setting.c
sources/c/program/controller/main/thread/cleanup.c
sources/c/program/controller/main/thread/entry.c
sources/c/program/controller/main/thread/instance.c
sources/c/program/controller/main/thread/signal.c
sources/c/program/controller/main/time.c

index 45ad6f88e30f54f9cddfe208764423a45642eddd..aa68c3d04a33142d1932fa93396832422bc4db08 100644 (file)
@@ -25,7 +25,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     data.program.pipe = fll_program_data_pipe_input_e;
   }
 
-  data.setting.flag |= controller_main_flag_interruptible_e;
+  data.setting.flag |= controller_main_flag_interruptible_d;
 
   fll_program_standard_set_up(&data.program);
 
index 369db13be4155a35ed4f383c73876cadf1dc2642..c9d77a3ea41b3afc934f7bef811c87a63630bf52 100644 (file)
@@ -29,7 +29,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   data.process.entry.pid = controller_entry_pid_disable_e;
   data.process.entry.show = controller_entry_show_init_e;
   data.process.mode = controller_process_mode_service_e;
-  data.setting.flag &= ~controller_main_flag_interruptible_e;
+  data.setting.flag &= ~controller_main_flag_interruptible_d;
 
   fll_program_standard_set_up(&data.program);
 
index d06449ec21815b701073e73fc3d8ac0754fb5843..02c3c33255ed57baca6fb43f89c11269c8052810 100644 (file)
@@ -105,28 +105,28 @@ extern "C" {
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
-      main->setting.flag |= controller_main_flag_help_e;
+      main->setting.flag |= controller_main_flag_help_d;
 
       return;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
-      main->setting.flag |= controller_main_flag_version_e;
+      main->setting.flag |= controller_main_flag_version_d;
 
       return;
     }
 
     if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
-      main->setting.flag |= controller_main_flag_copyright_e;
+      main->setting.flag |= controller_main_flag_copyright_d;
 
       return;
     }
 
     if (main->program.pipe & fll_program_data_pipe_input_e) {
-      main->setting.flag |= controller_main_flag_pipe_e;
+      main->setting.flag |= controller_main_flag_pipe_d;
     }
     else {
-      main->setting.flag &= ~controller_main_flag_pipe_e;
+      main->setting.flag &= ~controller_main_flag_pipe_d;
     }
 
     f_string_static_t * const args = main->program.parameters.arguments.array;
@@ -155,7 +155,7 @@ extern "C" {
 
       const uint16_t flags[] = {
         0,
-        controller_main_flag_pid_e,
+        controller_main_flag_pid_d,
         0,
         0,
       };
@@ -206,9 +206,9 @@ extern "C" {
       };
 
       const uint16_t flags[] = {
-        controller_main_flag_daemon_e,
-        controller_main_flag_simulate_e,
-        controller_main_flag_validate_e,
+        controller_main_flag_daemon_d,
+        controller_main_flag_simulate_d,
+        controller_main_flag_validate_d,
       };
 
       for (index = 0; index < 3; ++index) {
@@ -239,7 +239,7 @@ extern "C" {
       }
     }
 
-    if (!main->process.path_pid.used && !(main->setting.flag & controller_main_flag_pid_e)) {
+    if (!main->process.path_pid.used && !(main->setting.flag & controller_main_flag_pid_d)) {
       main->setting.state.status = f_string_dynamic_append(controller_default_path_pid_s, &main->process.path_pid);
 
       if (F_status_is_error_not(main->setting.state.status)) {
@@ -314,18 +314,18 @@ extern "C" {
     if (main->program.parameters.array[controller_parameter_interruptible_e].result & f_console_result_found_e) {
       if (main->program.parameters.array[controller_parameter_uninterruptible_e].result & f_console_result_found_e) {
         if (main->program.parameters.array[controller_parameter_interruptible_e].location < main->program.parameters.array[controller_parameter_uninterruptible_e].location) {
-          main->setting.flag &= ~controller_main_flag_interruptible_e;
+          main->setting.flag &= ~controller_main_flag_interruptible_d;
         }
         else {
-          main->setting.flag |= controller_main_flag_interruptible_e;
+          main->setting.flag |= controller_main_flag_interruptible_d;
         }
       }
       else {
-        main->setting.flag |= controller_main_flag_interruptible_e;
+        main->setting.flag |= controller_main_flag_interruptible_d;
       }
     }
     else if (main->program.parameters.array[controller_parameter_uninterruptible_e].result & f_console_result_found_e) {
-      main->setting.flag &= ~controller_main_flag_interruptible_e;
+      main->setting.flag &= ~controller_main_flag_interruptible_d;
     }
   }
 #endif // _di_controller_setting_load_
index 817d1d96729af7a451e109876cd1a692fa7bb704..191e8b04d3272dbade05fa947c8a5d06b8daa31a 100644 (file)
@@ -37,6 +37,62 @@ extern "C" {
 #endif // _di_controller_allocation_d_
 
 /**
+ * Controller lock defines.
+ *
+ * controller_lock_*_d:
+ *   - mutex_max_retry: The maximum amount of times to retry the mutex lock before giving up.
+ */
+#ifndef _di_controller_lock_d_
+  #define controller_lock_mutex_max_retry_d 1000000
+#endif // _di_controller_lock_d_
+
+/**
+ * Flags associated with Controller locks.
+ *
+ * controller_lock_flag_*_d:
+ *   - setup_not: No locks are initialized, so do not attempt to deallocate them.
+ */
+#ifndef _di_controller_lock_flag_d_
+  #define controller_lock_flag_setup_not_d 0x1
+#endif // _di_controller_lock_flag_d_
+
+/**
+ * Flags passed to the main function or program.
+ *
+ * When number mode is not specified, then mode is "string" mode (there is no flag for "string" mode).
+ *
+ * controller_main_flag_*_d:
+ *   - none:                   No flags set.
+ *   - copyright:              Print copyright.
+ *   - daemon:                 Run the process in the background and create a PID file.
+ *   - error:                  Check if status is "error".
+ *   - fine:                   Check if status is "fine".
+ *   - help:                   Print help.
+ *   - interruptible:          The process is interruptible.
+ *   - pid:                    Designate that a custom PID is specified.
+ *   - pipe:                   Use the input pipe.
+ *   - simulate:               Perform simulation of rules rather than execution.
+ *   - validate:               Perform validation of rules rather than execution.
+ *   - version:                Print version.
+ *   - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set.
+ */
+#ifndef _di_controller_main_flag_d_
+  #define controller_main_flag_none_d                   0x0
+  #define controller_main_flag_copyright_d              0x1
+  #define controller_main_flag_daemon_d                 0x2
+  #define controller_main_flag_error_d                  0x4
+  #define controller_main_flag_fine_d                   0x8
+  #define controller_main_flag_help_d                   0x10
+  #define controller_main_flag_interruptible_d          0x20
+  #define controller_main_flag_pid_d                    0x40
+  #define controller_main_flag_pipe_d                   0x80
+  #define controller_main_flag_simulate_d               0x100
+  #define controller_main_flag_validate_d               0x200
+  #define controller_main_flag_version_d                0x400
+  #define controller_main_flag_version_copyright_help_d 0x411
+#endif // _di_controller_main_flag_d_
+
+/**
  * The program signal defines.
  *
  * controller_signal_*_d:
@@ -66,26 +122,6 @@ extern "C" {
   #define controller_with_session_same_d 0x4
 #endif // _di_controller_with_d_
 
-/**
- * Controller lock defines.
- *
- * controller_lock_*_d:
- *   - mutex_max_retry: The maximum amount of times to retry the mutex lock before giving up.
- */
-#ifndef _di_controller_lock_d_
-  #define controller_lock_mutex_max_retry_d 1000000
-#endif // _di_controller_lock_d_
-
-/**
- * Flags associated with Controller locks.
- *
- * controller_lock_flag_*_d:
- *   - setup_not: No locks are initialized, so do not attempt to deallocate them.
- */
-#ifndef _di_controller_lock_flag_d_
-  #define controller_lock_flag_setup_not_d 0x1
-#endif // _di_controller_lock_flag_d_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index ba5b38a34210ee1c064584885734d165f6bebe2f..929164fa3d54dfbb4669131d6689f3792b729129 100644 (file)
@@ -17,44 +17,6 @@ extern "C" {
 #endif
 
 /**
- * Flags passed to the main function or program.
- *
- * When number mode is not specified, then mode is "string" mode (there is no flag for "string" mode).
- *
- * controller_main_flag_*_e:
- *   - none:                   No flags set.
- *   - copyright:              Print copyright.
- *   - daemon:                 Run the process in the background and create a PID file.
- *   - error:                  Check if status is "error".
- *   - fine:                   Check if status is "fine".
- *   - help:                   Print help.
- *   - interruptible:          The process is interruptible.
- *   - pid:                    Designate that a custom PID is specified.
- *   - pipe:                   Use the input pipe.
- *   - simulate:               Perform simulation of rules rather than execution.
- *   - validate:               Perform validation of rules rather than execution.
- *   - version:                Print version.
- *   - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set.
- */
-#ifndef _di_controller_main_flag_e_
-  enum {
-    controller_main_flag_none_e                   = 0x0,
-    controller_main_flag_copyright_e              = 0x1,
-    controller_main_flag_daemon_e                 = 0x2,
-    controller_main_flag_error_e                  = 0x4,
-    controller_main_flag_fine_e                   = 0x8,
-    controller_main_flag_help_e                   = 0x10,
-    controller_main_flag_interruptible_e          = 0x20,
-    controller_main_flag_pid_e                    = 0x40,
-    controller_main_flag_pipe_e                   = 0x80,
-    controller_main_flag_simulate_e               = 0x100,
-    controller_main_flag_validate_e               = 0x200,
-    controller_main_flag_version_e                = 0x400,
-    controller_main_flag_version_copyright_help_e = 0x411,
-  }; // enum
-#endif // _di_controller_main_flag_e_
-
-/**
  * The main program parameters.
  */
 #ifndef _di_controller_parameter_e_
index 7eedbbf2bf6ae36b9ff95c2f9cd527351554285f..c75a9d522af45cf5af3ecb60c9393d493028c41e 100644 (file)
@@ -44,7 +44,7 @@ extern "C" {
 
   #define controller_setting_t_initialize \
     { \
-      controller_main_flag_none_e, \
+      controller_main_flag_none_d, \
       F_okay, \
       f_state_t_initialize, \
       f_string_dynamic_t_initialize, \
index c0ef3aec7e37c04c8979fc1fcdaf6a1f90cf34d4..47fe4dd31ca3bbb5077dd5fccc3feb37a3e70eb9 100644 (file)
@@ -56,7 +56,7 @@ extern "C" {
       return status;
     }
 
-    if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.message.verbosity > f_console_verbosity_normal_e) {
+    if ((main->setting.flag & controller_main_flag_simulate_d) || main->program.message.verbosity > f_console_verbosity_normal_e) {
       controller_print_message_entry_item_process(&main->program.message, is_entry, failsafe ? controller_failsafe_s : f_string_empty_s, cache->action.name_item);
     }
 
@@ -86,7 +86,7 @@ extern "C" {
         }
 
         if (F_status_is_error(entry_action->status)) {
-          if (main->setting.flag & controller_main_flag_simulate_e) {
+          if (main->setting.flag & controller_main_flag_simulate_d) {
             controller_print_message_entry_action_state_failed(&main->program.message, cache, entry_action, is_entry);
           }
           else {
@@ -112,23 +112,23 @@ extern "C" {
 
         if (entry_action->type == controller_entry_action_type_ready_e) {
           if ((entry_action->code & controller_entry_rule_code_wait_d) || main->process.ready == controller_process_ready_wait_e) {
-            if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.error.verbosity == f_console_verbosity_verbose_e || main->program.error.verbosity == f_console_verbosity_debug_e || entry->show == controller_entry_show_init_e) {
+            if ((main->setting.flag & controller_main_flag_simulate_d) || main->program.error.verbosity == f_console_verbosity_verbose_e || main->program.error.verbosity == f_console_verbosity_debug_e || entry->show == controller_entry_show_init_e) {
               controller_print_message_entry_action_wait(&main->program.message, is_entry, controller_ready_s);
             }
 
-            if (!(main->setting.flag & controller_main_flag_validate_e)) {
+            if (!(main->setting.flag & controller_main_flag_validate_d)) {
               status = controller_rule_wait_all(main, is_entry, F_false);
               if (F_status_is_error(status)) return status;
             }
           }
 
           if (main->process.ready == controller_process_ready_yes_e) {
-            if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.error.verbosity == f_console_verbosity_verbose_e || main->program.error.verbosity == f_console_verbosity_debug_e) {
+            if ((main->setting.flag & controller_main_flag_simulate_d) || main->program.error.verbosity == f_console_verbosity_verbose_e || main->program.error.verbosity == f_console_verbosity_debug_e) {
               controller_print_message_entry_action_ready(&main->program.message, is_entry, controller_ready_s);
             }
           }
           else {
-            if (!failsafe && (main->program.error.verbosity == f_console_verbosity_verbose_e || entry->show == controller_entry_show_init_e) && !(main->setting.flag & controller_main_flag_simulate_e)) {
+            if (!failsafe && (main->program.error.verbosity == f_console_verbosity_verbose_e || entry->show == controller_entry_show_init_e) && !(main->setting.flag & controller_main_flag_simulate_d)) {
               controller_print_message_entry_state(&main->program.message, is_entry, controller_ready_s);
             }
 
@@ -176,7 +176,7 @@ extern "C" {
             return status;
           }
 
-          if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.message.verbosity > f_console_verbosity_normal_e) {
+          if ((main->setting.flag & controller_main_flag_simulate_d) || main->program.message.verbosity > f_console_verbosity_normal_e) {
             controller_print_message_entry_item_process(&main->program.message, is_entry, f_string_empty_s, cache->action.name_item);
           }
 
@@ -224,7 +224,7 @@ extern "C" {
 
           f_thread_unlock(&main->thread.lock.rule);
 
-          if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.error.verbosity == f_console_verbosity_verbose_e || main->program.error.verbosity == f_console_verbosity_debug_e || (entry->show == controller_entry_show_init_e && entry_action->type != controller_entry_action_type_consider_e)) {
+          if ((main->setting.flag & controller_main_flag_simulate_d) || main->program.error.verbosity == f_console_verbosity_verbose_e || main->program.error.verbosity == f_console_verbosity_debug_e || (entry->show == controller_entry_show_init_e && entry_action->type != controller_entry_action_type_consider_e)) {
             controller_print_message_entry_item_rule(&main->program.message, entry, entry_action, is_entry, alias_rule);
           }
 
@@ -295,7 +295,7 @@ extern "C" {
               // Designate the Action as failed.
               entry_action->status = controller_status_simplify_error(F_failure);
 
-              if (!(main->setting.flag & controller_main_flag_simulate_e)) {
+              if (!(main->setting.flag & controller_main_flag_simulate_d)) {
                 f_thread_unlock(&main->thread.lock.rule);
 
                 if (entry_action->code & controller_entry_rule_code_require_d) return F_status_set_error(F_require);
@@ -316,7 +316,7 @@ extern "C" {
             options_force = 0;
             options_instance = 0;
 
-            if (main->setting.flag & controller_main_flag_simulate_e) {
+            if (main->setting.flag & controller_main_flag_simulate_d) {
               options_instance |= controller_instance_option_simulate_e;
             }
 
@@ -328,12 +328,12 @@ extern "C" {
               options_instance |= controller_instance_option_wait_e;
             }
 
-            if (main->setting.flag & controller_main_flag_validate_e) {
+            if (main->setting.flag & controller_main_flag_validate_d) {
               options_instance |= controller_instance_option_validate_e;
             }
 
             if (entry_action->code & controller_entry_rule_code_asynchronous_d) {
-              if (!(main->setting.flag & controller_main_flag_validate_e)) {
+              if (!(main->setting.flag & controller_main_flag_validate_d)) {
                 options_force |= controller_instance_option_asynchronous_e;
               }
 
@@ -343,17 +343,17 @@ extern "C" {
             status = controller_rule_instance_begin(main, cache, options_force, alias_rule, controller_entry_action_type_to_rule_action_type(entry_action->type), options_instance, is_entry ? controller_instance_type_entry_e : controller_instance_type_exit_e, stack);
             if (F_status_set_fine(status) == F_memory_not || status == F_child || F_status_set_fine(status) == F_interrupt) break;
 
-            if (F_status_is_error(status) && !(main->setting.flag & controller_main_flag_simulate_e) && (entry_action->code & controller_entry_rule_code_require_d)) {
+            if (F_status_is_error(status) && !(main->setting.flag & controller_main_flag_simulate_d) && (entry_action->code & controller_entry_rule_code_require_d)) {
               return F_status_set_error(F_require);
             }
           }
         }
         else if (entry_action->type == controller_entry_action_type_execute_e) {
-          if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.message.verbosity > f_console_verbosity_normal_e || entry->show == controller_entry_show_init_e) {
+          if ((main->setting.flag & controller_main_flag_simulate_d) || main->program.message.verbosity > f_console_verbosity_normal_e || entry->show == controller_entry_show_init_e) {
             controller_print_message_entry_item_executing(&main->program.message, is_entry, &entry_action->parameters);
           }
 
-          if (main->setting.flag & controller_main_flag_simulate_e) return F_execute;
+          if (main->setting.flag & controller_main_flag_simulate_d) return F_execute;
 
           controller_thread_instance_cancel(main, is_entry, is_entry ? controller_thread_cancel_execute_e : controller_thread_cancel_exit_execute_e);
 
@@ -467,13 +467,13 @@ extern "C" {
     if (F_status_is_error(status_lock)) return status_lock;
 
     // Check to see if any required processes failed, but do not do this if already operating in failsafe.
-    if (F_status_is_error_not(status) && !failsafe && !(main->setting.flag & controller_main_flag_validate_e) && main->process.mode != controller_process_mode_helper_e) {
+    if (F_status_is_error_not(status) && !failsafe && !(main->setting.flag & controller_main_flag_validate_d) && main->process.mode != controller_process_mode_helper_e) {
       const f_status_t status_wait = controller_rule_wait_all(main, is_entry, F_true);
       if (F_status_is_error(status_wait)) return status_wait;
       if (status_wait == F_require) return F_status_set_error(F_require);
     }
 
-    if (((main->setting.flag & controller_main_flag_simulate_e) && main->program.error.verbosity > f_console_verbosity_error_e) || main->program.error.verbosity > f_console_verbosity_normal_e) {
+    if (((main->setting.flag & controller_main_flag_simulate_d) && main->program.error.verbosity > f_console_verbosity_error_e) || main->program.error.verbosity > f_console_verbosity_normal_e) {
       controller_print_message_entry_item_done(&main->program.message, is_entry, failsafe, controller_main_s);
     }
 
index ed0de4021f82163159bc409cf6006995e4ee98bf..307e8495cd2b6771308fd45a63249bfcd84ee286 100644 (file)
@@ -269,7 +269,7 @@ extern "C" {
           continue;
         }
 
-        if (main->setting.flag & controller_main_flag_pid_e) {
+        if (main->setting.flag & controller_main_flag_pid_d) {
           controller_print_error_entry_setting_ignored(&main->program.error, cache, is_entry);
         }
         else {
index 80f769d898afda68f6e2098b3987d60c8fd487c3..cb2961d9bc003cbf1cd878d125fe785fe8e6761c 100644 (file)
@@ -10,8 +10,8 @@ extern "C" {
     if (!main) return F_status_set_error(F_parameter);
     if (!is_entry) return F_okay;
 
-    if (main->setting.flag & controller_main_flag_validate_e) {
-      if ((main->setting.flag & controller_main_flag_simulate_e)) {
+    if (main->setting.flag & controller_main_flag_validate_d) {
+      if ((main->setting.flag & controller_main_flag_simulate_d)) {
         controller_print_debug_perform_pid_file_control_socket(&main->program.debug);
       }
 
index 4f50a1febe64f838d72d725edb768e749d0f3fce..a6ef4470b5f276fcb05e2f0f19d0e988072733e1 100644 (file)
@@ -78,7 +78,7 @@ extern "C" {
     controller_t * const main = (controller_t *) print->custom;
 
     if (print->verbosity != f_console_verbosity_debug_e) {
-      if (!(print->verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_e))) {
+      if (!(print->verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_d))) {
         return F_output_not;
       }
     }
@@ -255,7 +255,7 @@ extern "C" {
     controller_t * const main = (controller_t *) print->custom;
 
     if (print->verbosity != f_console_verbosity_debug_e) {
-      if (!(print->verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_e))) {
+      if (!(print->verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_d))) {
         return F_output_not;
       }
     }
@@ -288,7 +288,7 @@ extern "C" {
     controller_t * const main = (controller_t *) print->custom;
 
     if (print->verbosity != f_console_verbosity_debug_e) {
-      if (!(print->verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_e))) {
+      if (!(print->verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_d))) {
         return F_output_not;
       }
     }
index 89c60ddd59e4402f77b994f14041d54d6e70d871..4af097106f542eeeb528f847604a7d8255ec6b46 100644 (file)
@@ -112,7 +112,7 @@ extern "C" {
     fl_print_format("%r%r %r Item Rule ", print->to, f_string_eol_s, action->type == controller_entry_action_type_consider_e ? controller_print_entry_considering_s : controller_print_entry_processing_s, is_entry ? controller_entry_s : controller_exit_s);
     fl_print_format("'%[%Q%]'", print->to, print->set->title, alias_rule, print->set->title);
 
-    if (entry->show == controller_entry_show_init_e && !(main->setting.flag & controller_main_flag_simulate_e)) {
+    if (entry->show == controller_entry_show_init_e && !(main->setting.flag & controller_main_flag_simulate_d)) {
       fl_print_format(" [%[%r%]]", print->to, print->notable, action->code == controller_entry_rule_code_asynchronous_d ? controller_asynchronous_s : controller_synchronous_s, print->notable);
 
       if (action->code == controller_entry_rule_code_wait_d) {
index ebe966ad5a32ad3ec531062b1847f4b52f255762..59e6153b3589e50a39519cb75160c3785b29e235 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
 
     controller_t * const main = (controller_t *) print->custom;
 
-    if (print->verbosity < f_console_verbosity_debug_e && !((main->setting.flag & controller_main_flag_simulate_e) && print->verbosity > f_console_verbosity_normal_e)) {
+    if (print->verbosity < f_console_verbosity_debug_e && !((main->setting.flag & controller_main_flag_simulate_d) && print->verbosity > f_console_verbosity_normal_e)) {
       return F_output_not;
     }
 
index 2594602a4254fb1e41cb38ee9efcff3f3ad3a054..a0c4c12d3c27295631cea96131b6c888c646d376 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
 
     controller_t * const main = (controller_t *) print->custom;
 
-    if (print->verbosity < f_console_verbosity_debug_e && !((main->setting.flag & controller_main_flag_simulate_e) && print->verbosity > f_console_verbosity_normal_e)) {
+    if (print->verbosity < f_console_verbosity_debug_e && !((main->setting.flag & controller_main_flag_simulate_d) && print->verbosity > f_console_verbosity_normal_e)) {
       return F_output_not;
     }
 
@@ -35,7 +35,7 @@ extern "C" {
 
     controller_t * const main = (controller_t *) print->custom;
 
-    if (print->verbosity < f_console_verbosity_debug_e && !((main->setting.flag & controller_main_flag_simulate_e) && print->verbosity > f_console_verbosity_normal_e)) {
+    if (print->verbosity < f_console_verbosity_debug_e && !((main->setting.flag & controller_main_flag_simulate_d) && print->verbosity > f_console_verbosity_normal_e)) {
       return F_output_not;
     }
 
index 29d513a5b7245d08d464b8dfdd85b3e9e4c8b963..caba90eb7ebdf746687ac6226235eac7b0214170 100644 (file)
@@ -11,14 +11,14 @@ extern "C" {
 
     main->setting.state.status = F_okay;
 
-    if (main->setting.flag & controller_main_flag_version_copyright_help_e) {
-      if (main->setting.flag & controller_main_flag_help_e) {
+    if (main->setting.flag & controller_main_flag_version_copyright_help_d) {
+      if (main->setting.flag & controller_main_flag_help_d) {
         controller_print_message_help(&main->program.message, F_false);
       }
-      else if (main->setting.flag & controller_main_flag_version_e) {
+      else if (main->setting.flag & controller_main_flag_version_d) {
         fll_program_print_version(&main->program.message, controller_program_version_s);
       }
-      else if (main->setting.flag & controller_main_flag_copyright_e) {
+      else if (main->setting.flag & controller_main_flag_copyright_d) {
         fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
@@ -54,7 +54,7 @@ extern "C" {
         controller_print_error_status(&main->program.error, macro_controller_f(f_thread_create), status);
       }
       else {
-        if (main->setting.flag & controller_main_flag_daemon_e) {
+        if (main->setting.flag & controller_main_flag_daemon_d) {
           main->process.ready = controller_process_ready_done_e;
 
           if (f_file_exists(main->process.path_pid, F_true) == F_true) {
@@ -82,7 +82,7 @@ extern "C" {
 
     // Only make the Rule and control threads available once any/all pre-processing is complete.
     if (F_status_is_error_not(status) && status != F_failure && status != F_child && main->thread.enabled == controller_thread_enabled_e) {
-      if (!(main->setting.flag & controller_main_flag_validate_e)) {
+      if (!(main->setting.flag & controller_main_flag_validate_d)) {
 
         // Wait for the Entry thread to complete before starting the Rule thread.
         controller_thread_join(&main->thread.id_rule);
@@ -114,7 +114,7 @@ extern "C" {
       return;
     }
 
-    if (F_status_is_error_not(status) && status != F_failure && !(main->setting.flag & controller_main_flag_validate_e) && controller_thread_is_enabled(&main->thread, F_true)) {
+    if (F_status_is_error_not(status) && status != F_failure && !(main->setting.flag & controller_main_flag_validate_d) && controller_thread_is_enabled(&main->thread, F_true)) {
       if (main->process.mode == controller_process_mode_service_e) {
         controller_thread_join(&main->thread.id_signal);
       }
index c933d6c66d7c1efd1c93917ef9bfd4b83cd53084..418a15b446eea543f2090773128beaf273dd8cde 100644 (file)
@@ -261,7 +261,7 @@ extern "C" {
 
                 options_instance = 0;
 
-                if (main->setting.flag & controller_main_flag_simulate_e) {
+                if (main->setting.flag & controller_main_flag_simulate_d) {
                   options_instance |= controller_instance_option_simulate_e;
                 }
 
index 8911a5e6d50e08f1e77bb7862c4ef5229ebb5c47..4ebc66fd5edf948342c488266736aff73c25c7df 100644 (file)
@@ -1069,7 +1069,7 @@ extern "C" {
             rule->timeout_stop = number;
           }
 
-          if (main->program.error.verbosity == f_console_verbosity_debug_e || (main->program.error.verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_e))) {
+          if (main->program.error.verbosity == f_console_verbosity_debug_e || (main->program.error.verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_d))) {
             f_string_static_t name_sub = controller_stop_s;
 
             if (timeout_code == controller_rule_timeout_code_kill_d) {
@@ -1225,7 +1225,7 @@ extern "C" {
             rule->nice = number;
             rule->has |= controller_rule_has_nice_d;
 
-            if ((main->setting.flag & controller_main_flag_simulate_e) || main->program.error.verbosity == f_console_verbosity_verbose_e) {
+            if ((main->setting.flag & controller_main_flag_simulate_d) || main->program.error.verbosity == f_console_verbosity_verbose_e) {
               cache->action.generic.used = 0;
 
               state.status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &cache->action.generic);
@@ -1303,7 +1303,7 @@ extern "C" {
             rule->user = number;
             rule->has |= controller_rule_has_user_d;
 
-            if (main->program.error.verbosity == f_console_verbosity_debug_e || (main->program.error.verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_e))) {
+            if (main->program.error.verbosity == f_console_verbosity_debug_e || (main->program.error.verbosity == f_console_verbosity_verbose_e && (main->setting.flag & controller_main_flag_simulate_d))) {
               cache->action.generic.used = 0;
 
               state.status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &cache->action.generic);
index 73cc28cb087b2c24a19bca5ed462f5fe26a4a34c..77b6e56f07cf516f04d2c60a5f571e677f32601b 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
     if (main->thread.enabled != controller_thread_enabled_e) return 0;
 
     const f_time_spec_t delay = macro_f_time_spec_t_initialize_1(
-      (main->setting.flag & controller_main_flag_simulate_e)
+      (main->setting.flag & controller_main_flag_simulate_d)
         ? controller_thread_cleanup_interval_short_d
         : controller_thread_cleanup_interval_long_d,
       0
index 10d15ab6823f409af50024bbb3f0950756ba6c29..9d863918094c406771469d7a79eb7aefd5e2596f 100644 (file)
@@ -28,13 +28,13 @@ extern "C" {
     else if (*status != F_child) {
       *status = controller_entry_preprocess(main, F_true);
 
-      if ((main->setting.flag & controller_main_flag_simulate_e) && (main->setting.flag & controller_main_flag_validate_e)) {
+      if ((main->setting.flag & controller_main_flag_simulate_d) && (main->setting.flag & controller_main_flag_validate_d)) {
         controller_print_output_entry_setting_validate(&main->program.output, F_true);
       }
     }
 
     if (F_status_is_error_not(*status) && *status != F_child) {
-      if (!(main->setting.flag & controller_main_flag_validate_e) || (main->setting.flag & controller_main_flag_simulate_e)) {
+      if (!(main->setting.flag & controller_main_flag_validate_d) || (main->setting.flag & controller_main_flag_simulate_d)) {
         if (main->process.entry.pid == controller_entry_pid_require_e && f_file_exists(main->process.path_pid, F_true) == F_true) {
           *status = F_status_set_error(F_available_not);
           main->process.ready = controller_process_ready_fail_e;
@@ -94,7 +94,7 @@ extern "C" {
           }
         }
 
-        if (F_status_is_error_not(*status) && *status != F_child && !(main->setting.flag & controller_main_flag_validate_e) && main->process.mode == controller_process_mode_helper_e) {
+        if (F_status_is_error_not(*status) && *status != F_child && !(main->setting.flag & controller_main_flag_validate_d) && main->process.mode == controller_process_mode_helper_e) {
           const f_time_spec_t time = macro_f_time_spec_t_initialize_1(controller_thread_timeout_exit_helper_seconds_d, controller_thread_timeout_exit_helper_nanoseconds_d);
 
           f_time_sleep_spec(time, 0);
@@ -143,13 +143,13 @@ extern "C" {
     else if (*status != F_child) {
       *status = controller_entry_preprocess(main, F_false);
 
-      if ((main->setting.flag & controller_main_flag_simulate_e) && (main->setting.flag & controller_main_flag_validate_e)) {
+      if ((main->setting.flag & controller_main_flag_simulate_d) && (main->setting.flag & controller_main_flag_validate_d)) {
         controller_print_output_entry_setting_validate(&main->program.output, F_false);
       }
     }
 
     if (F_status_is_error_not(*status) && *status != F_child && *status != F_file_found_not) {
-      if (!(main->setting.flag & controller_main_flag_validate_e) || (main->setting.flag & controller_main_flag_simulate_e)) {
+      if (!(main->setting.flag & controller_main_flag_validate_d) || (main->setting.flag & controller_main_flag_simulate_d)) {
 
         *status = controller_entry_process(main, F_false, F_false);
 
index 70685ff170dab878de0f64f34dda9455ff274f44..9cd8c673502df33ab8e8e87b888064af3abbe5b4 100644 (file)
@@ -52,7 +52,7 @@ extern "C" {
     time.tv_sec = 0;
     time.tv_nsec = interval_nanoseconds;
 
-    if (main->process.mode == controller_process_mode_helper_e && !(main->setting.flag & controller_main_flag_validate_e)) {
+    if (main->process.mode == controller_process_mode_helper_e && !(main->setting.flag & controller_main_flag_validate_d)) {
       for (i = 0; i < main->thread.instances.used; ++i) {
 
         if (!main->thread.instances.array[i]) continue;
@@ -115,7 +115,7 @@ extern "C" {
       main->thread.id_signal = 0;
     }
 
-    if (main->process.mode == controller_process_mode_helper_e && !(main->setting.flag & controller_main_flag_validate_e)) {
+    if (main->process.mode == controller_process_mode_helper_e && !(main->setting.flag & controller_main_flag_validate_d)) {
       f_thread_mutex_unlock(&main->thread.lock.cancel);
 
       return;
index b95b888bff124b554c0104654f00089d81f2540b..fb633fc030bd54de81f07f763f43b21ccb72be07 100644 (file)
@@ -9,7 +9,7 @@ extern "C" {
 
     if (!main) return;
     if (!controller_thread_is_enabled(&main->thread, is_normal)) return;
-    if (!(main->setting.flag & controller_main_flag_interruptible_e)) return;
+    if (!(main->setting.flag & controller_main_flag_interruptible_d)) return;
 
     siginfo_t information;
     f_time_spec_t time = f_time_spec_t_initialize;
index 2124fb83a8cbb10a25cdbf0d0f97b4db3d7023d9..d6a957efd620be304656aaaa914bfe877b84267c 100644 (file)
@@ -47,7 +47,7 @@ extern "C" {
     if (!main) return F_status_set_error(F_parameter);
 
     // When sleep is a second or more, instead wait for terminating signals if interruptible.
-    if ((main->setting.flag & controller_main_flag_interruptible_e) && time.tv_sec) {
+    if ((main->setting.flag & controller_main_flag_interruptible_d) && time.tv_sec) {
       siginfo_t information;
       f_signal_t signal = f_signal_t_initialize;