]> Kevux Git Server - fll/commitdiff
Update: Improve entry/exit verbose messages, display exit with -tv, and wait all...
authorKevin Day <thekevinday@gmail.com>
Sun, 25 Apr 2021 17:13:54 +0000 (12:13 -0500)
committerKevin Day <thekevinday@gmail.com>
Sun, 25 Apr 2021 17:50:26 +0000 (12:50 -0500)
The verbose messages should be distinguishing between an entry and an exit now.

When both --simulate and --test are specified, the printout should include both the entry and the exit.
Previously, only the entry was printed.

The wait all should only be triggered to wait for all processes at the current moment in time.
Furthermore, the read lock is being held too long (for the entire loop).
Maintain the read lock long enough to build a list of all processes to wait for.

level_3/controller/c/private-controller.c
level_3/controller/c/private-entry.c
level_3/controller/c/private-entry.h
level_3/controller/c/private-rule.c
level_3/controller/c/private-rule.h
level_3/controller/c/private-thread.c

index 4273068a80864cfbc48cf62ae09496a0ec2a7136..22141815ff9e99fb564b1a62ee5778a361809fbe 100644 (file)
@@ -422,7 +422,7 @@ extern "C" {
 
             fll_error_file_print(main.data->error, F_status_set_fine(status), "controller_file_pid_create", F_true, main.setting->path_pid.string, "create", fll_error_file_type_file);
 
-            controller_entry_error_print_cache(main.data->error, cache->action);
+            controller_entry_error_print_cache(is_entry, main.data->error, cache->action);
 
             controller_print_unlock_flush(main.data->error.to.stream, &main.thread->lock.print);
           }
@@ -435,7 +435,7 @@ extern "C" {
 
           fll_error_file_print(main.data->warning, F_status_set_fine(status), "controller_file_pid_create", F_true, main.setting->path_pid.string, "create", fll_error_file_type_file);
 
-          controller_entry_error_print_cache(main.data->warning, cache->action);
+          controller_entry_error_print_cache(is_entry, main.data->warning, cache->action);
 
           controller_print_unlock_flush(main.data->warning.to.stream, &main.thread->lock.print);
         }
@@ -482,7 +482,7 @@ extern "C" {
     f_macro_array_lengths_t_increase_by(status, cache->ats, controller_default_allocation_step)
 
     if (F_status_is_error(status)) {
-      controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true, main.thread);
+      controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true, main.thread);
 
       return status;
     }
@@ -498,7 +498,7 @@ extern "C" {
     status = controller_string_dynamic_append_terminated(entry->items.array[0].name, &cache->action.name_item);
 
     if (F_status_is_error(status)) {
-      controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, main.thread);
+      controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, main.thread);
 
       return status;
     }
@@ -515,7 +515,7 @@ extern "C" {
         status2 = controller_string_dynamic_append_terminated(controller_entry_action_type_name(actions->array[cache->ats.array[at_j]].type), &cache->action.name_action);
 
         if (F_status_is_error(status2)) {
-          controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status2), "controller_string_dynamic_append_terminated", F_true, main.thread);
+          controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status2), "controller_string_dynamic_append_terminated", F_true, main.thread);
 
           return status2;
         }
@@ -529,9 +529,9 @@ extern "C" {
               fprintf(main.data->warning.to.stream, "%c", f_string_eol_s[0]);
               fprintf(main.data->warning.to.stream, "%s%sMultiple '", main.data->warning.context.before->string, main.data->warning.prefix ? main.data->warning.prefix : f_string_empty_s);
               fprintf(main.data->warning.to.stream, "%s%s%s%s", main.data->warning.context.after->string, main.data->warning.notable.before->string, controller_string_ready_s, main.data->warning.notable.after->string);
-              fprintf(main.data->warning.to.stream, "%s' entry item actions detected; only the first will be used.%s%c", main.data->warning.context.before->string, main.data->warning.context.after->string, f_string_eol_s[0]);
+              fprintf(main.data->warning.to.stream, "%s' %s item actions detected; only the first will be used.%s%c", main.data->warning.context.before->string, is_entry ? controller_string_entry_s : controller_string_exit_s, main.data->warning.context.after->string, f_string_eol_s[0]);
 
-              controller_entry_error_print_cache(main.data->warning, cache->action);
+              controller_entry_error_print_cache(is_entry, main.data->warning, cache->action);
 
               controller_print_unlock_flush(main.data->warning.to.stream, &main.thread->lock.print);
             }
@@ -563,11 +563,11 @@ extern "C" {
                     f_thread_mutex_lock(&main.thread->lock.print);
 
                     fprintf(main.data->error.to.stream, "%c", f_string_eol_s[0]);
-                    fprintf(main.data->error.to.stream, "%s%sThe entry item named '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s);
+                    fprintf(main.data->error.to.stream, "%s%sThe %s item named '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
                     fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, entry->items.array[i].name.string, main.data->error.notable.after->string);
                     fprintf(main.data->error.to.stream, "%s' cannot be executed because recursion is not allowed.%s%c", main.data->error.context.before->string, main.data->error.context.after->string, f_string_eol_s[0]);
 
-                    controller_entry_error_print_cache(main.data->error, cache->action);
+                    controller_entry_error_print_cache(is_entry, main.data->error, cache->action);
 
                     controller_print_unlock_flush(main.data->error.to.stream, &main.thread->lock.print);
                   }
@@ -586,7 +586,7 @@ extern "C" {
               f_macro_array_lengths_t_increase_by(status2, cache->ats, controller_default_allocation_step)
 
               if (F_status_is_error(status2)) {
-                controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status2), "f_macro_array_lengths_t_increase_by", F_true, main.thread);
+                controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status2), "f_macro_array_lengths_t_increase_by", F_true, main.thread);
 
                 return status2;
               }
@@ -611,7 +611,7 @@ extern "C" {
               status2 = controller_string_dynamic_append_terminated(entry->items.array[i].name, &cache->action.name_item);
 
               if (F_status_is_error(status2)) {
-                controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status2), "controller_string_dynamic_append_terminated", F_true, main.thread);
+                controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status2), "controller_string_dynamic_append_terminated", F_true, main.thread);
 
                 return status2;
               }
@@ -626,11 +626,11 @@ extern "C" {
                 f_thread_mutex_lock(&main.thread->lock.print);
 
                 fprintf(main.data->error.to.stream, "%c", f_string_eol_s[0]);
-                fprintf(main.data->error.to.stream, "%s%sThe entry item named '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s);
+                fprintf(main.data->error.to.stream, "%s%sThe %s item named '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
                 fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, actions->array[cache->ats.array[at_j]].parameters.array[0].string, main.data->error.notable.after->string);
                 fprintf(main.data->error.to.stream, "%s' does not exist.%s%c", main.data->error.context.before->string, main.data->error.context.after->string, f_string_eol_s[0]);
 
-                controller_entry_error_print_cache(main.data->error, cache->action);
+                controller_entry_error_print_cache(is_entry, main.data->error, cache->action);
 
                 controller_print_unlock_flush(main.data->error.to.stream, &main.thread->lock.print);
               }
@@ -667,7 +667,7 @@ extern "C" {
         status2 = controller_string_dynamic_append_terminated(entry->items.array[cache->ats.array[at_i]].name, &cache->action.name_item);
 
         if (F_status_is_error(status2)) {
-          controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status2), "controller_string_dynamic_append_terminated", F_true, main.thread);
+          controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status2), "controller_string_dynamic_append_terminated", F_true, main.thread);
 
           return status2;
         }
@@ -728,7 +728,7 @@ extern "C" {
     f_macro_array_lengths_t_increase_by(status, cache->ats, controller_default_allocation_step)
 
     if (F_status_is_error(status)) {
-      controller_entry_error_print(main->data->error, cache->action, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true, main->thread);
+      controller_entry_error_print(is_entry, main->data->error, cache->action, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true, main->thread);
 
       return status;
     }
@@ -744,17 +744,17 @@ extern "C" {
     status = controller_string_dynamic_append_terminated(entry->items.array[cache->ats.array[0]].name, &cache->action.name_item);
 
     if (F_status_is_error(status)) {
-      controller_entry_error_print(main->data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, main->thread);
+      controller_entry_error_print(is_entry, main->data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, main->thread);
 
       return status;
     }
 
-    if (simulate) {
+    if (simulate || main->data->error.verbosity == f_console_verbosity_verbose) {
       if (main->data->error.verbosity != f_console_verbosity_quiet) {
         f_thread_mutex_lock(&main->thread->lock.print);
 
         fprintf(main->data->output.stream, "%c", f_string_eol_s[0]);
-        fprintf(main->data->output.stream, "Processing %sentry item '", (failsafe ? "failsafe " : ""));
+        fprintf(main->data->output.stream, "Processing %s%s item '", (failsafe ? "failsafe " : ""), is_entry ? controller_string_entry_s : controller_string_exit_s);
         fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.title.before->string, cache->action.name_item.string, main->data->context.set.title.after->string);
         fprintf(main->data->output.stream, "'.%c", f_string_eol_s[0]);
 
@@ -776,7 +776,7 @@ extern "C" {
         status = controller_string_dynamic_append_terminated(controller_entry_action_type_name(entry_action->type), &cache->action.name_action);
 
         if (F_status_is_error(status)) {
-          controller_entry_error_print(main->data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, main->thread);
+          controller_entry_error_print(is_entry, main->data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, main->thread);
 
           return status;
         }
@@ -788,7 +788,7 @@ extern "C" {
                 f_thread_mutex_lock(&main->thread->lock.print);
 
                 fprintf(main->data->output.stream, "%c", f_string_eol_s[0]);
-                fprintf(main->data->output.stream, "The entry item action '");
+                fprintf(main->data->output.stream, "The %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
                 fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.title.before->string, cache->action.name_action.string, main->data->context.set.title.after->string);
 
                 if (entry_action->parameters.used) {
@@ -804,12 +804,11 @@ extern "C" {
               }
             }
             else if (entry_action->code & controller_entry_rule_code_require) {
-
               if (main->data->error.verbosity != f_console_verbosity_quiet) {
                 f_thread_mutex_lock(&main->thread->lock.print);
 
                 fprintf(main->data->error.to.stream, "%c", f_string_eol_s[0]);
-                fprintf(main->data->error.to.stream, "%s%sThe entry item action '", main->data->error.context.before->string, main->data->error.prefix ? main->data->error.prefix : f_string_empty_s);
+                fprintf(main->data->error.to.stream, "%s%sThe %s item action '", main->data->error.context.before->string, main->data->error.prefix ? main->data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
                 fprintf(main->data->error.to.stream, "%s%s%s", main->data->error.context.after->string, main->data->error.notable.before->string, cache->action.name_action.string);
 
                 if (entry_action->parameters.used) {
@@ -823,18 +822,18 @@ extern "C" {
                 fprintf(main->data->error.to.stream, "%s%sfailed%s", main->data->error.context.after->string, main->data->error.notable.before->string, main->data->error.notable.after->string);
                 fprintf(main->data->error.to.stream, "%s state, skipping execution.%s%c", main->data->error.context.before->string, main->data->error.context.after->string, f_string_eol_s[0]);
 
-                controller_entry_error_print_cache(main->data->error, cache->action);
+                controller_entry_error_print_cache(is_entry, main->data->error, cache->action);
 
                 controller_print_unlock_flush(main->data->error.to.stream, &main->thread->lock.print);
               }
 
               return F_status_is_error(F_require);
             }
-            else if (main->data->warning.verbosity == f_console_verbosity_debug) {
+            else if (main->data->warning.verbosity == f_console_verbosity_verbose || main->data->warning.verbosity == f_console_verbosity_debug) {
               f_thread_mutex_lock(&main->thread->lock.print);
 
               fprintf(main->data->warning.to.stream, "%c", f_string_eol_s[0]);
-              fprintf(main->data->warning.to.stream, "%s%sThe entry item action '", main->data->warning.context.before->string, main->data->warning.prefix ? main->data->warning.prefix : f_string_empty_s);
+              fprintf(main->data->warning.to.stream, "%s%sThe %s item action '", main->data->warning.context.before->string, main->data->warning.prefix ? main->data->warning.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
               fprintf(main->data->warning.to.stream, "%s%s%s", main->data->warning.context.after->string, main->data->warning.notable.before->string, cache->action.name_action.string);
 
               if (entry_action->parameters.used) {
@@ -848,7 +847,7 @@ extern "C" {
               fprintf(main->data->warning.to.stream, "%s%sfailed%s", main->data->warning.context.after->string, main->data->warning.notable.before->string, main->data->warning.notable.after->string);
               fprintf(main->data->warning.to.stream, "%s state, skipping execution.%s%c", main->data->warning.context.before->string, main->data->warning.context.after->string, f_string_eol_s[0]);
 
-              controller_entry_error_print_cache(main->data->warning, cache->action);
+              controller_entry_error_print_cache(is_entry, main->data->warning, cache->action);
 
               controller_print_unlock_flush(main->data->warning.to.stream, &main->thread->lock.print);
             }
@@ -859,7 +858,7 @@ extern "C" {
                 f_thread_mutex_lock(&main->thread->lock.print);
 
                 fprintf(main->data->output.stream, "%c", f_string_eol_s[0]);
-                fprintf(main->data->output.stream, "The entry item action '");
+                fprintf(main->data->output.stream, "The %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
                 fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.title.before->string, cache->action.name_action.string, main->data->context.set.title.after->string);
 
                 if (entry_action->parameters.used) {
@@ -874,11 +873,11 @@ extern "C" {
                 controller_print_unlock_flush(main->data->output.stream, &main->thread->lock.print);
               }
             }
-            else if (main->data->warning.verbosity == f_console_verbosity_debug) {
+            else if (main->data->warning.verbosity == f_console_verbosity_debug || main->data->error.verbosity == f_console_verbosity_verbose) {
               f_thread_mutex_lock(&main->thread->lock.print);
 
               fprintf(main->data->warning.to.stream, "%c", f_string_eol_s[0]);
-              fprintf(main->data->warning.to.stream, "%s%sThe entry item action '", main->data->warning.context.before->string, main->data->warning.prefix ? main->data->warning.prefix : f_string_empty_s);
+              fprintf(main->data->warning.to.stream, "%s%sThe %s item action '", main->data->warning.context.before->string, main->data->warning.prefix ? main->data->warning.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
               fprintf(main->data->warning.to.stream, "%s%s", main->data->warning.notable.before->string, cache->action.name_action.string);
 
               if (entry_action->parameters.used) {
@@ -890,7 +889,7 @@ extern "C" {
               fprintf(main->data->warning.to.stream, "%s%sfailed%s", main->data->warning.context.after->string, main->data->warning.notable.before->string, main->data->warning.notable.after->string);
               fprintf(main->data->warning.to.stream, "%s state, skipping.%s%c", main->data->warning.context.before->string, main->data->warning.context.after->string, f_string_eol_s[0]);
 
-              controller_entry_error_print_cache(main->data->warning, cache->action);
+              controller_entry_error_print_cache(is_entry, main->data->warning, cache->action);
 
               controller_print_unlock_flush(main->data->warning.to.stream, &main->thread->lock.print);
             }
@@ -900,14 +899,13 @@ extern "C" {
         }
 
         if (entry_action->type == controller_entry_action_type_ready) {
-
           if (entry_action->code & controller_entry_rule_code_wait) {
-            if (simulate) {
+            if (simulate || main->data->error.verbosity == f_console_verbosity_verbose) {
               if (main->data->error.verbosity != f_console_verbosity_quiet) {
                 f_thread_mutex_lock(&main->thread->lock.print);
 
                 fprintf(main->data->output.stream, "%c", f_string_eol_s[0]);
-                fprintf(main->data->output.stream, "Waiting before processing entry item action '");
+                fprintf(main->data->output.stream, "Waiting before processing %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
                 fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.title.before->string, controller_string_ready_s, main->data->context.set.title.after->string);
                 fprintf(main->data->output.stream, "'.%c", f_string_eol_s[0]);
 
@@ -921,19 +919,20 @@ extern "C" {
           }
 
           if (main->setting->ready == controller_setting_ready_wait) {
-            if (simulate) {
+            if (simulate || main->data->error.verbosity == f_console_verbosity_verbose) {
               if (main->data->error.verbosity != f_console_verbosity_quiet) {
                 f_thread_mutex_lock(&main->thread->lock.print);
 
                 fprintf(main->data->output.stream, "%c", f_string_eol_s[0]);
-                fprintf(main->data->output.stream, "Processing entry item action '");
+                fprintf(main->data->output.stream, "Processing %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
                 fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.title.before->string, controller_string_ready_s, main->data->context.set.title.after->string);
                 fprintf(main->data->output.stream, "'.%c", f_string_eol_s[0]);
 
                 controller_print_unlock_flush(main->data->output.stream, &main->thread->lock.print);
               }
             }
-            else {
+
+            if (!simulate) {
               controller_perform_ready(is_entry, *main, cache);
 
               if (F_status_is_error(status)) return status;
@@ -941,12 +940,12 @@ extern "C" {
 
             main->setting->ready = controller_setting_ready_yes;
           }
-          else if (simulate) {
+          else if (simulate || main->data->error.verbosity == f_console_verbosity_verbose) {
             if (main->data->error.verbosity != f_console_verbosity_quiet) {
               f_thread_mutex_lock(&main->thread->lock.print);
 
               fprintf(main->data->output.stream, "%c", f_string_eol_s[0]);
-              fprintf(main->data->output.stream, "Ignoring entry item action '");
+              fprintf(main->data->output.stream, "Ignoring %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
               fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.title.before->string, controller_string_ready_s, main->data->context.set.title.after->string);
               fprintf(main->data->output.stream, "', state already is ready.%c", f_string_eol_s[0]);
 
@@ -955,7 +954,6 @@ extern "C" {
           }
         }
         else if (entry_action->type == controller_entry_action_type_item) {
-
           if (entry_action->number == 0 || entry_action->number >= entry->items.used || failsafe && entry_action->number == main->setting->failsafe_item_id) {
 
             // This should not happen if the pre-process is working as designed, but in case it doesn't, return a critical error to prevent infinite recursion and similar errors.
@@ -963,11 +961,11 @@ extern "C" {
               f_thread_mutex_lock(&main->thread->lock.print);
 
               fprintf(main->data->error.to.stream, "%c", f_string_eol_s[0]);
-              fprintf(main->data->error.to.stream, "%s%sInvalid entry item index ", main->data->error.context.before->string, main->data->error.prefix ? main->data->error.prefix : f_string_empty_s);
+              fprintf(main->data->error.to.stream, "%s%sInvalid %s item index ", main->data->error.context.before->string, main->data->error.prefix ? main->data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
               fprintf(main->data->error.to.stream, "%s%s%llu%s", main->data->error.context.after->string, main->data->error.notable.before->string, entry_action->number, main->data->error.notable.after->string);
               fprintf(main->data->error.to.stream, "%s detected.%s%c", main->data->error.context.before->string, main->data->error.context.after->string, f_string_eol_s[0]);
 
-              controller_entry_error_print_cache(main->data->error, cache->action);
+              controller_entry_error_print_cache(is_entry, main->data->error, cache->action);
 
               controller_print_unlock_flush(main->data->error.to.stream, &main->thread->lock.print);
             }
@@ -978,7 +976,7 @@ extern "C" {
           f_macro_array_lengths_t_increase_by(status, cache->ats, controller_default_allocation_step)
 
           if (F_status_is_error(status)) {
-            controller_entry_error_print(main->data->error, cache->action, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true, main->thread);
+            controller_entry_error_print(is_entry, main->data->error, cache->action, F_status_set_fine(status), "f_macro_array_lengths_t_increase_by", F_true, main->thread);
 
             return status;
           }
@@ -1001,17 +999,17 @@ extern "C" {
           status = controller_string_dynamic_append_terminated(entry->items.array[cache->ats.array[at_i]].name, &cache->action.name_item);
 
           if (F_status_is_error(status)) {
-            controller_entry_error_print(main->data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, main->thread);
+            controller_entry_error_print(is_entry, main->data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, main->thread);
 
             return status;
           }
 
-          if (simulate) {
+          if (simulate || main->data->error.verbosity == f_console_verbosity_verbose) {
             if (main->data->error.verbosity != f_console_verbosity_quiet) {
               f_thread_mutex_lock(&main->thread->lock.print);
 
               fprintf(main->data->output.stream, "%c", f_string_eol_s[0]);
-              fprintf(main->data->output.stream, "Processing entry item '");
+              fprintf(main->data->output.stream, "Processing %s item '", is_entry ? controller_string_entry_s : controller_string_exit_s);
               fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.title.before->string, cache->action.name_item.string, main->data->context.set.title.after->string);
               fprintf(main->data->output.stream, "'.%c", f_string_eol_s[0]);
 
@@ -1036,7 +1034,7 @@ extern "C" {
           f_thread_unlock(&main->thread->lock.rule);
 
           if (F_status_is_error(status)) {
-            controller_entry_error_print(main->data->error, cache->action, F_status_set_fine(status), "controller_rules_increase", F_true, main->thread);
+            controller_entry_error_print(is_entry, main->data->error, cache->action, F_status_set_fine(status), "controller_rules_increase", F_true, main->thread);
 
             return status;
           }
@@ -1063,12 +1061,12 @@ extern "C" {
 
           f_thread_unlock(&main->thread->lock.rule);
 
-          if (simulate) {
+          if (simulate || main->data->error.verbosity == f_console_verbosity_verbose) {
             if (main->data->error.verbosity != f_console_verbosity_quiet) {
               f_thread_mutex_lock(&main->thread->lock.print);
 
               fprintf(main->data->output.stream, "%c", f_string_eol_s[0]);
-              fprintf(main->data->output.stream, "%s entry item rule '", entry_action->type == controller_entry_action_type_consider ? "Considering" : "Processing");
+              fprintf(main->data->output.stream, "%s %s item rule '", entry_action->type == controller_entry_action_type_consider ? "Considering" : "Processing", is_entry ? controller_string_entry_s : controller_string_exit_s);
               fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.title.before->string, alias_rule.string, main->data->context.set.title.after->string);
               fprintf(main->data->output.stream, "'.%c", f_string_eol_s[0]);
 
@@ -1136,7 +1134,7 @@ extern "C" {
               if (main->data->error.verbosity != f_console_verbosity_quiet) {
                 f_thread_mutex_lock(&main->thread->lock.print);
 
-                controller_entry_error_print_cache(main->data->error, cache->action);
+                controller_entry_error_print_cache(is_entry, main->data->error, cache->action);
 
                 controller_print_unlock_flush(main->data->output.stream, &main->thread->lock.print);
               }
@@ -1194,7 +1192,7 @@ extern "C" {
         }
         else if (entry_action->type == controller_entry_action_type_timeout) {
 
-          if (simulate) {
+          if (simulate || main->data->error.verbosity == f_console_verbosity_verbose) {
             f_string_t code = "";
 
             if (entry_action->code == controller_entry_timeout_code_kill) {
@@ -1211,7 +1209,7 @@ extern "C" {
               f_thread_mutex_lock(&main->thread->lock.print);
 
               fprintf(main->data->output.stream, "%c", f_string_eol_s[0]);
-              fprintf(main->data->output.stream, "Processing entry item action '");
+              fprintf(main->data->output.stream, "Processing %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
               fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.title.before->string, controller_string_timeout_s, main->data->context.set.title.after->string);
               fprintf(main->data->output.stream, "' setting '");
               fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.important.before->string, code, main->data->context.set.important.after->string);
@@ -1242,7 +1240,7 @@ extern "C" {
               fprintf(main->data->warning.to.stream, "%c", f_string_eol_s[0]);
               fprintf(main->data->warning.to.stream, "%s%sFailsafe may not be specified when running in failsafe, ignoring.%s%c", main->data->warning.context.before->string, main->data->warning.prefix ? main->data->warning.prefix : f_string_empty_s, main->data->warning.context.after->string, f_string_eol_s[0]);
 
-              controller_entry_error_print_cache(main->data->warning, cache->action);
+              controller_entry_error_print_cache(is_entry, main->data->warning, cache->action);
 
               controller_print_unlock_flush(main->data->warning.to.stream, &main->thread->lock.print);
             }
@@ -1255,11 +1253,11 @@ extern "C" {
                 f_thread_mutex_lock(&main->thread->lock.print);
 
                 fprintf(main->data->error.to.stream, "%c", f_string_eol_s[0]);
-                fprintf(main->data->error.to.stream, "%s%sInvalid entry item index ", main->data->error.context.before->string, main->data->error.prefix ? main->data->error.prefix : f_string_empty_s);
+                fprintf(main->data->error.to.stream, "%s%sInvalid %s item index ", main->data->error.context.before->string, main->data->error.prefix ? main->data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
                 fprintf(main->data->error.to.stream, "%s%s%llu%s", main->data->error.context.after->string, main->data->error.notable.before->string, entry_action->number, main->data->error.notable.after->string);
                 fprintf(main->data->error.to.stream, "%s detected.%s%c", main->data->error.context.before->string, main->data->error.context.after->string, f_string_eol_s[0]);
 
-                controller_entry_error_print_cache(main->data->error, cache->action);
+                controller_entry_error_print_cache(is_entry, main->data->error, cache->action);
 
                 controller_print_unlock_flush(main->data->error.to.stream, &main->thread->lock.print);
               }
@@ -1270,12 +1268,12 @@ extern "C" {
               main->setting->failsafe_enabled = F_true;
               main->setting->failsafe_item_id = entry_action->number;
 
-              if (simulate) {
+              if (simulate || main->data->error.verbosity == f_console_verbosity_verbose) {
                 if (main->data->error.verbosity != f_console_verbosity_quiet) {
                   f_thread_mutex_lock(&main->thread->lock.print);
 
                   fprintf(main->data->output.stream, "%c", f_string_eol_s[0]);
-                  fprintf(main->data->output.stream, "Processing entry item action '");
+                  fprintf(main->data->output.stream, "Processing %s item action '", is_entry ? controller_string_entry_s : controller_string_exit_s);
                   fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.title.before->string, controller_string_failsafe_s, main->data->context.set.title.after->string);
                   fprintf(main->data->output.stream, "' setting value to '");
                   fprintf(main->data->output.stream, "%s%s%s", main->data->context.set.important.before->string, entry->items.array[main->setting->failsafe_item_id].name.string, main->data->context.set.important.after->string);
@@ -1322,7 +1320,7 @@ extern "C" {
         status = controller_string_dynamic_append_terminated(entry->items.array[cache->ats.array[at_i]].name, &cache->action.name_item);
 
         if (F_status_is_error(status)) {
-          controller_entry_error_print(main->data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, main->thread);
+          controller_entry_error_print(is_entry, main->data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_append_terminated", F_true, main->thread);
 
           break;
         }
index bc636b505150d97492a397715f65717efc9f6b6c..a584dcc7e52f51aebea00d79a0cf85af51720a13 100644 (file)
@@ -187,7 +187,7 @@ extern "C" {
 #endif // _di_controller_entry_actions_increase_by_
 
 #ifndef _di_controller_entry_actions_read_
-  f_status_t controller_entry_actions_read(const f_string_range_t content_range, controller_main_t main, controller_cache_t *cache, controller_entry_actions_t *actions) {
+  f_status_t controller_entry_actions_read(const bool is_entry, const f_string_range_t content_range, controller_main_t main, controller_cache_t *cache, controller_entry_actions_t *actions) {
     f_status_t status = F_none;
     f_status_t status_action = F_none;
 
@@ -215,7 +215,7 @@ extern "C" {
     }
 
     if (F_status_is_error(status)) {
-      controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, main.thread);
+      controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, main.thread);
 
       return status;
     }
@@ -223,7 +223,7 @@ extern "C" {
     status = fl_fss_apply_delimit(cache->delimits, &cache->buffer_file);
 
     if (F_status_is_error(status)) {
-      controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "fl_fss_apply_delimit", F_true, main.thread);
+      controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "fl_fss_apply_delimit", F_true, main.thread);
 
       return status;
     }
@@ -233,7 +233,7 @@ extern "C" {
     status = controller_entry_actions_increase_by(cache->object_actions.used, actions);
 
     if (F_status_is_error(status)) {
-      controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "controller_entry_actions_increase_by", F_true, main.thread);
+      controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "controller_entry_actions_increase_by", F_true, main.thread);
 
       return status;
     }
@@ -263,7 +263,7 @@ extern "C" {
       status = f_fss_count_lines(cache->buffer_file, cache->object_actions.array[i].start, &cache->action.line_action);
 
       if (F_status_is_error(status)) {
-        controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, main.thread);
+        controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, main.thread);
         break;
       }
 
@@ -272,7 +272,7 @@ extern "C" {
       status = controller_string_dynamic_rip_nulless_terminated(cache->buffer_file, cache->object_actions.array[i], &cache->action.name_action);
 
       if (F_status_is_error(status)) {
-        controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_rip_nulless_terminated", F_true, main.thread);
+        controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_rip_nulless_terminated", F_true, main.thread);
         break;
       }
 
@@ -320,13 +320,13 @@ extern "C" {
       }
       else {
         if (main.data->warning.verbosity == f_console_verbosity_debug) {
-          fprintf(main.data->warning.to.stream, "%s%sUnknown entry item action '", main.data->warning.context.before->string, main.data->warning.prefix ? main.data->warning.prefix : f_string_empty_s);
+          fprintf(main.data->warning.to.stream, "%s%sUnknown %s item action '", main.data->warning.context.before->string, main.data->warning.prefix ? main.data->warning.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
           fprintf(main.data->warning.to.stream, "%s%s", main.data->warning.context.after->string, main.data->warning.notable.before->string);
           f_print_dynamic(main.data->warning.to.stream, cache->action.name_action);
           fprintf(main.data->warning.to.stream, "%s", main.data->warning.notable.after->string);
           fprintf(main.data->warning.to.stream, "%s'.%s%c", main.data->warning.context.before->string, main.data->warning.context.after->string, f_string_eol_s[0]);
 
-          controller_entry_error_print_cache(main.data->warning, cache->action);
+          controller_entry_error_print_cache(is_entry, main.data->warning, cache->action);
         }
 
         continue;
@@ -358,7 +358,7 @@ extern "C" {
 
         if (main.data->error.verbosity != f_console_verbosity_quiet) {
           fprintf(main.data->error.to.stream, "%c", f_string_eol_s[0]);
-          fprintf(main.data->error.to.stream, "%s%sThe entry item action '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s);
+          fprintf(main.data->error.to.stream, "%s%sThe %s item action '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
           fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, cache->action.name_action.string, main.data->error.notable.after->string);
           fprintf(main.data->error.to.stream, "%s' requires ", main.data->error.context.before->string);
 
@@ -399,7 +399,7 @@ extern "C" {
         status = f_string_dynamics_increase_by(allocate, &action->parameters);
 
         if (F_status_is_error(status)) {
-          controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true, main.thread);
+          controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true, main.thread);
 
           action->status = status;
 
@@ -417,7 +417,7 @@ extern "C" {
           status = f_string_dynamic_partial_append_nulless(cache->buffer_file, cache->content_actions.array[i].array[j], &action->parameters.array[j]);
 
           if (F_status_is_error(status)) {
-            controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, main.thread);
+            controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, main.thread);
 
             action->status = status;
 
@@ -439,7 +439,7 @@ extern "C" {
               status = fll_path_canonical(action->parameters.array[0].string, &cache->buffer_path);
 
               if (F_status_is_error(status)) {
-                controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "fll_path_canonical", F_true, main.thread);
+                controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "fll_path_canonical", F_true, main.thread);
 
                 action->status = status;
 
@@ -462,7 +462,7 @@ extern "C" {
 
               if (main.data->error.verbosity != f_console_verbosity_quiet) {
                 fprintf(main.data->error.to.stream, "%c", f_string_eol_s[0]);
-                fprintf(main.data->error.to.stream, "%s%sThe entry item action must not have an empty string for a path (the first parameter).%s%c", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, main.data->error.context.after->string, f_string_eol_s[0]);
+                fprintf(main.data->error.to.stream, "%s%sThe %s item action must not have an empty string for a path (the first parameter).%s%c", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s, main.data->error.context.after->string, f_string_eol_s[0]);
               }
             }
 
@@ -472,7 +472,7 @@ extern "C" {
               status = f_file_name_base(action->parameters.array[1].string, action->parameters.array[1].used, &cache->buffer_path);
 
               if (F_status_is_error(status)) {
-                controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "f_file_name_base", F_true, main.thread);
+                controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "f_file_name_base", F_true, main.thread);
 
                 if (F_status_set_fine(status) == F_memory_not) {
                   status_action = status;
@@ -492,7 +492,7 @@ extern "C" {
                     status = f_string_dynamic_terminate_after(&cache->buffer_path);
 
                     if (F_status_is_error(status)) {
-                      controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, main.thread);
+                      controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, main.thread);
 
                       action->status = status;
 
@@ -504,7 +504,7 @@ extern "C" {
                     }
 
                     fprintf(main.data->error.to.stream, "%c", f_string_eol_s[0]);
-                    fprintf(main.data->error.to.stream, "%s%sThe entry item action second parameter '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s);
+                    fprintf(main.data->error.to.stream, "%s%sThe %s item action second parameter '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
                     fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, action->parameters.array[1].string, main.data->error.notable.after->string);
                     fprintf(main.data->error.to.stream, "%s' must be a base path name, such as '", main.data->error.context.before->string);
                     fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, cache->buffer_path.string, main.data->error.notable.after->string);
@@ -528,7 +528,7 @@ extern "C" {
 
               if (main.data->error.verbosity != f_console_verbosity_quiet) {
                 fprintf(main.data->error.to.stream, "%c", f_string_eol_s[0]);
-                fprintf(main.data->error.to.stream, "%s%sThe entry item action must not have an empty string for a rule name (the second parameter).%s%c", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, main.data->error.context.after->string, f_string_eol_s[0]);
+                fprintf(main.data->error.to.stream, "%s%sThe %s item action must not have an empty string for a rule name (the second parameter).%s%c", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s, main.data->error.context.after->string, f_string_eol_s[0]);
               }
             }
 
@@ -554,7 +554,7 @@ extern "C" {
 
                 if (main.data->error.verbosity != f_console_verbosity_quiet) {
                   fprintf(main.data->error.to.stream, "%c", f_string_eol_s[0]);
-                  fprintf(main.data->error.to.stream, "%s%sThe entry item action third parameter (and beyond) must be one of '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s);
+                  fprintf(main.data->error.to.stream, "%s%sThe %s item action third parameter (and beyond) must be one of '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
                   fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, controller_string_asynchronous_s, main.data->error.notable.after->string);
                   fprintf(main.data->error.to.stream, "%s', '", main.data->error.context.before->string);
                   fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, controller_string_require_s, main.data->error.notable.after->string);
@@ -577,7 +577,7 @@ extern "C" {
 
               if (main.data->error.verbosity != f_console_verbosity_quiet) {
                 fprintf(main.data->error.to.stream, "%c", f_string_eol_s[0]);
-                fprintf(main.data->error.to.stream, "%s%sThe entry item action may not specify the reserved item '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s);
+                fprintf(main.data->error.to.stream, "%s%sThe %s item action may not specify the reserved item '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
                 fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, controller_string_main_s, main.data->error.notable.after->string);
                 fprintf(main.data->error.to.stream, "%s'.%s%c", main.data->error.context.before->string, main.data->error.context.after->string, f_string_eol_s[0]);
               }
@@ -603,7 +603,7 @@ extern "C" {
 
               if (main.data->error.verbosity != f_console_verbosity_quiet) {
                 fprintf(main.data->error.to.stream, "%c", f_string_eol_s[0]);
-                fprintf(main.data->error.to.stream, "%s%sThe entry item action must have one of '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s);
+                fprintf(main.data->error.to.stream, "%s%sThe %s item action must have one of '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
                 fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, controller_string_kill_s, main.data->error.notable.after->string);
                 fprintf(main.data->error.to.stream, "%s', '", main.data->error.context.before->string);
                 fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, controller_string_start_s, main.data->error.notable.after->string);
@@ -631,7 +631,7 @@ extern "C" {
                 }
 
                 if (F_status_set_fine(status) == F_memory_not) {
-                  controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, main.thread);
+                  controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, main.thread);
 
                   status_action = status;
                   break;
@@ -639,7 +639,7 @@ extern "C" {
 
                 if (main.data->error.verbosity != f_console_verbosity_quiet) {
                   fprintf(main.data->error.to.stream, "%c", f_string_eol_s[0]);
-                  fprintf(main.data->error.to.stream, "%s%sThe entry item action parameter '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s);
+                  fprintf(main.data->error.to.stream, "%s%sThe %s item action parameter '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
                   fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, action->parameters.array[1].string, main.data->error.notable.after->string);
                   fprintf(main.data->error.to.stream, "%s' is not a valid supported number.%s%c", main.data->error.context.before->string, main.data->error.context.after->string, f_string_eol_s[0]);
                 }
@@ -656,7 +656,7 @@ extern "C" {
 
                 if (main.data->error.verbosity != f_console_verbosity_quiet) {
                   fprintf(main.data->error.to.stream, "%c", f_string_eol_s[0]);
-                  fprintf(main.data->error.to.stream, "%s%sThe entry item action may only have '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s);
+                  fprintf(main.data->error.to.stream, "%s%sThe %s item action may only have '", main.data->error.context.before->string, main.data->error.prefix ? main.data->error.prefix : f_string_empty_s, is_entry ? controller_string_entry_s : controller_string_exit_s);
                   fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, controller_string_wait_s, main.data->error.notable.after->string);
                   fprintf(main.data->error.to.stream, "%s' but instead has '", main.data->error.context.before->string);
                   fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, action->parameters.array[0].string, main.data->error.notable.after->string);
@@ -680,13 +680,13 @@ extern "C" {
 #endif // _di_controller_entry_actions_read_
 
 #ifndef _di_controller_entry_error_print_
-  void controller_entry_error_print(const fll_error_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) {
+  void controller_entry_error_print(const bool is_entry, const fll_error_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) {
 
     if (print.verbosity != f_console_verbosity_quiet) {
       f_thread_mutex_lock(&thread->lock.print);
 
       fll_error_print(print, status, function, fallback);
-      controller_entry_error_print_cache(print, cache);
+      controller_entry_error_print_cache(is_entry, print, cache);
 
       controller_print_unlock_flush(print.to.stream, &thread->lock.print);
     }
@@ -694,7 +694,7 @@ extern "C" {
 #endif // _di_controller_entry_error_print_
 
 #ifndef _di_controller_entry_error_print_cache_
-  void controller_entry_error_print_cache(const fll_error_print_t print, const controller_cache_action_t cache) {
+  void controller_entry_error_print_cache(const bool is_entry, const fll_error_print_t print, const controller_cache_action_t cache) {
 
     fprintf(print.to.stream, "%c", f_string_eol_s[0]);
     fprintf(print.to.stream, "%s%sWhile processing ", print.context.before->string, print.prefix ? print.prefix : f_string_empty_s);
@@ -708,7 +708,7 @@ extern "C" {
     }
 
     if (cache.name_item.used) {
-      fprintf(print.to.stream, "entry item '");
+      fprintf(print.to.stream, "%s item '", is_entry ? controller_string_entry_s : controller_string_exit_s);
       fprintf(print.to.stream, "%s%s%s%s", print.context.after->string, print.notable.before->string, cache.name_item.string, print.notable.after->string);
       fprintf(print.to.stream, "%s' on line ", print.context.before->string);
       fprintf(print.to.stream, "%s%s%llu%s", print.context.after->string, print.notable.before->string, cache.line_item, print.notable.after->string);
@@ -716,7 +716,7 @@ extern "C" {
     }
 
     if (cache.name_file.used) {
-      fprintf(print.to.stream, "entry file '");
+      fprintf(print.to.stream, "%s file '", is_entry ? controller_string_entry_s : controller_string_exit_s);
       fprintf(print.to.stream, "%s%s%s%s", print.context.after->string, print.notable.before->string, cache.name_file.string, print.notable.after->string);
       fprintf(print.to.stream, "%s'.%s%c", print.context.before->string, print.context.after->string, f_string_eol_s[0]);
     }
@@ -813,7 +813,7 @@ extern "C" {
           status = fl_fss_apply_delimit(cache->delimits, &cache->buffer_file);
 
           if (F_status_is_error(status)) {
-            controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "fl_fss_apply_delimit", F_true, main.thread);
+            controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "fl_fss_apply_delimit", F_true, main.thread);
           }
         }
       }
@@ -835,7 +835,7 @@ extern "C" {
       status = controller_entry_items_increase_by(cache->object_items.used, &entry->items);
 
       if (F_status_is_error(status)) {
-        controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "controller_entry_items_increase_by", F_true, main.thread);
+        controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "controller_entry_items_increase_by", F_true, main.thread);
       }
       else {
 
@@ -876,21 +876,21 @@ extern "C" {
           status = controller_entry_items_increase_by(controller_default_allocation_step, &entry->items);
 
           if (F_status_is_error(status)) {
-            controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "controller_entry_items_increase_by", F_true, main.thread);
+            controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "controller_entry_items_increase_by", F_true, main.thread);
             break;
           }
 
           status = controller_string_dynamic_partial_append_terminated(cache->buffer_file, cache->object_items.array[i], &cache->action.name_item);
 
           if (F_status_is_error(status)) {
-            controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_partial_append_terminated", F_true, main.thread);
+            controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_partial_append_terminated", F_true, main.thread);
             break;
           }
 
           status = f_fss_count_lines(cache->buffer_file, cache->object_items.array[i].start, &cache->action.line_item);
 
           if (F_status_is_error(status)) {
-            controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, main.thread);
+            controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, main.thread);
             break;
           }
 
@@ -907,7 +907,7 @@ extern "C" {
                 fprintf(main.data->warning.to.stream, "%s%s%s%s", main.data->warning.context.after->string, main.data->warning.notable.before->string, cache->action.name_file.string, main.data->warning.notable.after->string);
                 fprintf(main.data->warning.to.stream, "%s'.%s%c", main.data->warning.context.before->string, main.data->warning.context.after->string, f_string_eol_s[0]);
 
-                controller_entry_error_print_cache(main.data->warning, cache->action);
+                controller_entry_error_print_cache(is_entry, main.data->warning, cache->action);
 
                 controller_print_unlock_flush(main.data->warning.to.stream, &main.thread->lock.print);
               }
@@ -957,12 +957,12 @@ extern "C" {
             break;
           }
 
-          status = controller_entry_actions_read(*range, main, cache, &entry->items.array[at].actions);
+          status = controller_entry_actions_read(is_entry, *range, main, cache, &entry->items.array[at].actions);
 
           if (F_status_is_error(status)) {
             f_thread_mutex_lock(&main.thread->lock.print);
 
-            controller_entry_error_print_cache(main.data->error, cache->action);
+            controller_entry_error_print_cache(is_entry, main.data->error, cache->action);
 
             controller_print_unlock_flush(main.data->error.to.stream, &main.thread->lock.print);
 
@@ -1051,7 +1051,7 @@ extern "C" {
                       fprintf(main.data->error.to.stream, "%s%s%s%s", main.data->error.context.after->string, main.data->error.notable.before->string, action->parameters.array[0].string, main.data->error.notable.after->string);
                       fprintf(main.data->error.to.stream, "%s' does not exist.%s%c", main.data->error.context.before->string, main.data->error.context.after->string, f_string_eol_s[0]);
 
-                      controller_entry_error_print_cache(main.data->error, cache->action);
+                      controller_entry_error_print_cache(is_entry, main.data->error, cache->action);
 
                       controller_print_unlock_flush(main.data->error.to.stream, &main.thread->lock.print);
                     }
@@ -1074,7 +1074,7 @@ extern "C" {
     }
 
     if (F_status_is_error(status)) {
-      controller_entry_error_print_cache(main.data->error, cache->action);
+      controller_entry_error_print_cache(is_entry, main.data->error, cache->action);
 
       entry->status = controller_status_simplify_error(F_status_set_fine(status));
     }
@@ -1097,7 +1097,7 @@ extern "C" {
     }
 
     if (F_status_is_error(status)) {
-      controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, main.thread);
+      controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "fll_fss_extended_read", F_true, main.thread);
 
       return status;
     }
@@ -1105,7 +1105,7 @@ extern "C" {
     status = fl_fss_apply_delimit(cache->delimits, &cache->buffer_file);
 
     if (F_status_is_error(status)) {
-      controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "fl_fss_apply_delimit", F_true, main.thread);
+      controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "fl_fss_apply_delimit", F_true, main.thread);
 
       return status;
     }
@@ -1121,7 +1121,7 @@ extern "C" {
       status = f_fss_count_lines(cache->buffer_file, cache->object_actions.array[i].start, &cache->action.line_action);
 
       if (F_status_is_error(status)) {
-        controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, main.thread);
+        controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "f_fss_count_lines", F_true, main.thread);
         break;
       }
 
@@ -1130,7 +1130,7 @@ extern "C" {
       status = controller_string_dynamic_rip_nulless_terminated(cache->buffer_file, cache->object_actions.array[i], &cache->action.name_action);
 
       if (F_status_is_error(status)) {
-        controller_entry_error_print(main.data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_rip_nulless_terminated", F_true, main.thread);
+        controller_entry_error_print(is_entry, main.data->error, cache->action, F_status_set_fine(status), "controller_string_dynamic_rip_nulless_terminated", F_true, main.thread);
         break;
       }
 
@@ -1165,7 +1165,7 @@ extern "C" {
             fprintf(main.data->warning.to.stream, "%s", main.data->warning.notable.after->string);
             fprintf(main.data->warning.to.stream, "%s'.%s%c", main.data->warning.context.before->string, main.data->warning.context.after->string, f_string_eol_s[0]);
 
-            controller_entry_error_print_cache(main.data->warning, cache->action);
+            controller_entry_error_print_cache(is_entry, main.data->warning, cache->action);
           }
 
           continue;
@@ -1179,7 +1179,7 @@ extern "C" {
           fprintf(main.data->warning.to.stream, "%s", main.data->warning.notable.after->string);
           fprintf(main.data->warning.to.stream, "%s'.%s%c", main.data->warning.context.before->string, main.data->warning.context.after->string, f_string_eol_s[0]);
 
-          controller_entry_error_print_cache(main.data->warning, cache->action);
+          controller_entry_error_print_cache(is_entry, main.data->warning, cache->action);
         }
 
         continue;
index 059c6fba35761c859604621bcac44bb4d15c9f3c..cc5820f634c0fc87e5c68f946d6473fec30f0e82 100644 (file)
@@ -91,6 +91,9 @@ extern "C" {
 /**
  * Read the entry list, extracting all items and values.
  *
+ * @param is_entry
+ *   If TRUE, then this loads as an entry.
+ *   If FALSE, then this loads as an exit.
  * @param content_range
  *   The range in the list buffer representing the content.
  * @param main
@@ -122,12 +125,15 @@ extern "C" {
  * @see fll_fss_extended_read()
  */
 #ifndef _di_controller_entry_actions_read_
-  extern f_status_t controller_entry_actions_read(const f_string_range_t content_range, controller_main_t main, controller_cache_t *cache, controller_entry_actions_t *actions) f_gcc_attribute_visibility_internal;
+  extern f_status_t controller_entry_actions_read(const bool is_entry, const f_string_range_t content_range, controller_main_t main, controller_cache_t *cache, controller_entry_actions_t *actions) f_gcc_attribute_visibility_internal;
 #endif // _di_controller_entry_actions_read_
 
 /**
  * Print the entry related error, locking the print mutex during the print.
  *
+ * @param is_entry
+ *   If TRUE, then this loads as an entry.
+ *   If FALSE, then this loads as an exit.
  * @param print
  *   Designates how printing is to be performed.
  * @param cache
@@ -147,7 +153,7 @@ extern "C" {
  * @see controller_entry_error_print_cache()
  */
 #ifndef _di_controller_entry_error_print_
-  extern void controller_entry_error_print(const fll_error_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) f_gcc_attribute_visibility_internal;
+  extern void controller_entry_error_print(const bool is_entry, const fll_error_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, controller_thread_t *thread) f_gcc_attribute_visibility_internal;
 #endif // _di_controller_entry_error_print_
 
 /**
@@ -157,6 +163,9 @@ extern "C" {
  *
  * This neither locks the thread nor does it check to see if output is enabled or disabled.
  *
+ * @param is_entry
+ *   If TRUE, then this loads as an entry.
+ *   If FALSE, then this loads as an exit.
  * @param print
  *   Designates how printing is to be performed.
  * @param cache
@@ -166,7 +175,7 @@ extern "C" {
  * @see controller_entry_read()
  */
 #ifndef _di_controller_entry_error_print_cache_
-  extern void controller_entry_error_print_cache(const fll_error_print_t print, const controller_cache_action_t cache) f_gcc_attribute_visibility_internal;
+  extern void controller_entry_error_print_cache(const bool is_entry, const fll_error_print_t print, const controller_cache_action_t cache) f_gcc_attribute_visibility_internal;
 #endif // _di_controller_entry_error_print_cache_
 
 /**
index 7f81f5029a9e9e4b8bc36add3b9a46e1e6d3c9cb..890229c9a66bf5f4cbbe966670de873dad78795a 100644 (file)
@@ -1301,7 +1301,6 @@ extern "C" {
     }
 
     if (options & controller_process_option_simulate) {
-
       if (main.data->error.verbosity != f_console_verbosity_quiet) {
         f_thread_mutex_lock(&main.thread->lock.print);
 
@@ -2531,7 +2530,7 @@ extern "C" {
       }
 
       if (F_status_is_error(status)) {
-        controller_entry_error_print(main.data->error, cache.action, F_status_set_fine(status), "f_type_array_lengths_resize", F_true, main.thread);
+        controller_error_print(main.data->error, F_status_set_fine(status), "f_type_array_lengths_resize", F_true, main.thread);
       }
       else {
         for (f_array_length_t i = 0; i < stack.used; ++i) {
@@ -2553,7 +2552,7 @@ extern "C" {
         status = f_string_dynamic_append(cache.action.name_item, &process->cache.action.name_item);
       }
       else {
-        controller_entry_error_print(main.data->error, cache.action, F_status_set_fine(status), "f_string_dynamic_append", F_true, main.thread);
+        controller_error_print(main.data->error, F_status_set_fine(status), "f_string_dynamic_append", F_true, main.thread);
       }
     }
 
@@ -2564,7 +2563,7 @@ extern "C" {
         status = f_thread_create(0, &process->id_thread, controller_thread_process, (void *) process);
 
         if (F_status_is_error(status)) {
-          controller_entry_error_print(main.data->error, cache.action, F_status_set_fine(status), "f_thread_create", F_true, main.thread);
+          controller_error_print(main.data->error, F_status_set_fine(status), "f_thread_create", F_true, main.thread);
         }
       }
       else {
@@ -2579,6 +2578,7 @@ extern "C" {
     }
 
     if (!action || F_status_is_error(status) && (process->state == controller_process_state_active || process->state == controller_process_state_busy)) {
+
       status = controller_lock_write_process(process, main.thread, &process->lock);
 
       if (status == F_signal || F_status_is_error(status)) {
@@ -2703,7 +2703,7 @@ extern "C" {
       f_thread_unlock(&main.thread->lock.rule);
 
       if (F_status_is_error(status)) {
-        controller_entry_error_print(main.data->error, process->cache.action, F_status_set_fine(status), "controller_rule_copy", F_true, main.thread);
+        controller_error_print(main.data->error, F_status_set_fine(status), "controller_rule_copy", F_true, main.thread);
       }
       else if (!process->action) {
 
@@ -2754,7 +2754,7 @@ extern "C" {
           status = f_type_array_lengths_increase(&process->stack);
 
           if (F_status_is_error(status)) {
-            controller_entry_error_print(main.data->error, process->cache.action, F_status_set_fine(status), "f_type_array_lengths_increase", F_true, main.thread);
+            controller_error_print(main.data->error, F_status_set_fine(status), "f_type_array_lengths_increase", F_true, main.thread);
           }
           else {
             f_thread_unlock(&process->lock);
@@ -5398,10 +5398,10 @@ extern "C" {
     f_status_t status_lock = F_none;
 
     if (caller) {
-      controller_lock_read_process(caller, main.thread, &main.thread->lock.process);
+      status_lock = controller_lock_read_process(caller, main.thread, &main.thread->lock.process);
     }
     else {
-      controller_lock_read(is_normal, main.thread, &main.thread->lock.process);
+      status_lock = controller_lock_read(is_normal, main.thread, &main.thread->lock.process);
     }
 
     if (status_lock == F_signal || F_status_is_error(status_lock)) {
@@ -5419,15 +5419,22 @@ extern "C" {
     f_status_t status = F_none;
 
     bool required_not_run = F_false;
+    bool skip = F_false;
 
     f_array_length_t i = 0;
     f_array_length_t j = 0;
 
-    controller_process_t *process = 0;
+    // build a list of what to wait for so that anything new after this point will not be waited for.
+    const f_array_length_t process_total = main.thread->processs.used;
+    controller_process_t *process_list[process_total];
 
-    bool skip = F_false;
+    for (; i < process_total; ++i) {
+      process_list[i] = main.thread->processs.array[i];
+    } // for
+
+    f_thread_unlock(&main.thread->lock.process);
 
-    for (; i < main.thread->processs.used; ++i) {
+    for (i = 0; i < process_total; ++i) {
 
       if (caller) {
         if (!controller_thread_is_enabled_process(caller, main.thread)) break;
@@ -5436,11 +5443,39 @@ extern "C" {
         if (!controller_thread_is_enabled(is_normal, main.thread)) break;
       }
 
-      process = main.thread->processs.array[i];
+      // re-establish main process read lock to wait for or protect from the cleanup thread while checking the read process.
+      if (caller) {
+        status_lock = controller_lock_read_process(caller, main.thread, &main.thread->lock.process);
+      }
+      else {
+        status_lock = controller_lock_read(is_normal, main.thread, &main.thread->lock.process);
+      }
+
+      if (status_lock == F_signal || F_status_is_error(status_lock)) break;
+
+      if (!process_list[i]) {
+        f_thread_unlock(&main.thread->lock.process);
+
+        continue;
+      }
 
       if (caller) {
+        status_lock = controller_lock_read_process(caller, main.thread, &process_list[i]->active);
+      }
+      else {
+        status_lock = controller_lock_read(is_normal, main.thread, &process_list[i]->active);
+      }
+
+      if (status_lock == F_signal || F_status_is_error(status_lock)) {
         f_thread_unlock(&main.thread->lock.process);
 
+        break;
+      }
+
+      // once the active lock is obtained, then the main process read lock can be safely released.
+      f_thread_unlock(&main.thread->lock.process);
+
+      if (caller) {
         if (caller) {
           status_lock = controller_lock_read_process(caller, main.thread, &main.thread->lock.rule);
         }
@@ -5448,10 +5483,15 @@ extern "C" {
           status_lock = controller_lock_read(is_normal, main.thread, &main.thread->lock.rule);
         }
 
-        if (status_lock == F_signal || F_status_is_error(status_lock)) break;
+        if (status_lock == F_signal || F_status_is_error(status_lock)) {
+          f_thread_unlock(&process_list[i]->active);
+
+          break;
+        }
 
-        if (fl_string_dynamic_compare(caller->rule.alias, process->rule.alias) == F_equal_to) {
+        if (fl_string_dynamic_compare(caller->rule.alias, process_list[i]->rule.alias) == F_equal_to) {
           f_thread_unlock(&main.thread->lock.rule);
+          f_thread_unlock(&process_list[i]->active);
 
           continue;
         }
@@ -5467,7 +5507,7 @@ extern "C" {
             if (!controller_thread_is_enabled(is_normal, main.thread)) break;
           }
 
-          if (main.thread->processs.array[caller->stack.array[j]] && fl_string_dynamic_compare(process->rule.alias, main.thread->processs.array[caller->stack.array[j]]->rule.alias) == F_equal_to) {
+          if (main.thread->processs.array[caller->stack.array[j]] && fl_string_dynamic_compare(process_list[i]->rule.alias, main.thread->processs.array[caller->stack.array[j]]->rule.alias) == F_equal_to) {
             skip = F_true;
           }
 
@@ -5476,231 +5516,165 @@ extern "C" {
 
         f_thread_unlock(&main.thread->lock.rule);
 
-        if (caller) {
-          status_lock = controller_lock_read_process(caller, main.thread, &main.thread->lock.process);
-        }
-        else {
-          status_lock = controller_lock_read(is_normal, main.thread, &main.thread->lock.process);
-        }
+        if (skip) {
+          f_thread_unlock(&process_list[i]->active);
 
-        if (status_lock == F_signal || F_status_is_error(status_lock)) break;
-        if (skip) continue;
-      }
-
-      if (caller) {
-        status_lock = controller_lock_read_process(caller, main.thread, &process->active);
-      }
-      else {
-        status_lock = controller_lock_read(is_normal, main.thread, &process->active);
-      }
-
-      if (status_lock == F_signal || F_status_is_error(status_lock)) {
-        f_thread_unlock(&main.thread->lock.process);
-
-        break;
+          continue;
+        }
       }
 
-      f_thread_unlock(&main.thread->lock.process);
-
       if (caller) {
-        status_lock = controller_lock_read_process(caller, main.thread, &process->lock);
+        status_lock = controller_lock_read_process(caller, main.thread, &process_list[i]->lock);
       }
       else {
-        status_lock = controller_lock_read(is_normal, main.thread, &process->lock);
+        status_lock = controller_lock_read(is_normal, main.thread, &process_list[i]->lock);
       }
 
       if (status_lock == F_signal || F_status_is_error(status_lock)) {
-        f_thread_unlock(&process->active);
+        f_thread_unlock(&process_list[i]->active);
 
         break;
       }
 
       if (required) {
-        if (!(process->options & controller_process_option_require)) {
-          f_thread_unlock(&process->lock);
-          f_thread_unlock(&process->active);
-
-          if (caller) {
-            status_lock = controller_lock_read_process(caller, main.thread, &main.thread->lock.process);
-          }
-          else {
-            status_lock = controller_lock_read(is_normal, main.thread, &main.thread->lock.process);
-          }
-
-          if (status_lock == F_signal || F_status_is_error(status_lock)) break;
+        if (!(process_list[i]->options & controller_process_option_require)) {
+          f_thread_unlock(&process_list[i]->lock);
+          f_thread_unlock(&process_list[i]->active);
 
           continue;
         }
       }
 
-      if (!process->state || process->state == controller_process_state_idle || process->state == controller_process_state_done) {
+      if (!process_list[i]->state || process_list[i]->state == controller_process_state_idle || process_list[i]->state == controller_process_state_done) {
 
-        if (process->state == controller_process_state_done) {
-          f_thread_unlock(&process->lock);
+        if (process_list[i]->state == controller_process_state_done) {
+          f_thread_unlock(&process_list[i]->lock);
 
           if (caller) {
-            status_lock = controller_lock_write_process(process, main.thread, &process->lock);
+            status_lock = controller_lock_write_process(process_list[i], main.thread, &process_list[i]->lock);
           }
           else {
-            status_lock = controller_lock_write(is_normal, main.thread, &process->lock);
+            status_lock = controller_lock_write(is_normal, main.thread, &process_list[i]->lock);
           }
 
           if (status_lock == F_signal || F_status_is_error(status_lock)) {
             controller_lock_error_critical_print(main.data->error, F_status_set_fine(status_lock), F_false, main.thread);
 
-            f_thread_unlock(&process->active);
+            f_thread_unlock(&process_list[i]->active);
 
             return status_lock;
           }
 
-          if (process->state == controller_process_state_done) {
-            f_thread_unlock(&process->active);
+          if (process_list[i]->state == controller_process_state_done) {
+            f_thread_unlock(&process_list[i]->active);
 
-            if (f_thread_lock_write_try(&process->active) == F_none) {
+            if (f_thread_lock_write_try(&process_list[i]->active) == F_none) {
 
-              controller_thread_join(&process->id_thread);
+              controller_thread_join(&process_list[i]->id_thread);
 
-              process->state = controller_process_state_idle;
+              process_list[i]->state = controller_process_state_idle;
 
-              f_thread_unlock(&process->active);
+              f_thread_unlock(&process_list[i]->active);
 
-              f_thread_mutex_lock(&process->wait_lock);
-              f_thread_condition_signal_all(&process->wait);
-              f_thread_mutex_unlock(&process->wait_lock);
+              f_thread_mutex_lock(&process_list[i]->wait_lock);
+              f_thread_condition_signal_all(&process_list[i]->wait);
+              f_thread_mutex_unlock(&process_list[i]->wait_lock);
             }
 
             if (caller) {
-              status_lock = controller_lock_read_process(caller, main.thread, &process->active);
+              status_lock = controller_lock_read_process(caller, main.thread, &process_list[i]->active);
             }
             else {
-              status_lock = controller_lock_read(is_normal, main.thread, &process->active);
+              status_lock = controller_lock_read(is_normal, main.thread, &process_list[i]->active);
             }
 
             if (status_lock == F_signal || F_status_is_error(status_lock)) {
-              f_thread_unlock(&process->lock);
+              f_thread_unlock(&process_list[i]->lock);
 
               break;
             }
           }
 
-          f_thread_unlock(&process->lock);
+          f_thread_unlock(&process_list[i]->lock);
 
           if (caller) {
-            status_lock = controller_lock_read_process(caller, main.thread, &process->lock);
+            status_lock = controller_lock_read_process(caller, main.thread, &process_list[i]->lock);
           }
           else {
-            status_lock = controller_lock_read(is_normal, main.thread, &process->lock);
+            status_lock = controller_lock_read(is_normal, main.thread, &process_list[i]->lock);
           }
 
           if (status_lock == F_signal || F_status_is_error(status_lock)) break;
         }
 
-        if (required && (process->options & controller_process_option_require)) {
-          if (controller_rule_status_is_error(process->action, process->rule)) {
+        if (required && (process_list[i]->options & controller_process_option_require)) {
+          if (controller_rule_status_is_error(process_list[i]->action, process_list[i]->rule)) {
             status = F_status_set_error(F_require);
 
-            f_thread_unlock(&process->lock);
-            f_thread_unlock(&process->active);
-
-            if (caller) {
-              status_lock = controller_lock_read_process(caller, main.thread, &main.thread->lock.process);
-            }
-            else {
-              status_lock = controller_lock_read(is_normal, main.thread, &main.thread->lock.process);
-            }
+            f_thread_unlock(&process_list[i]->lock);
+            f_thread_unlock(&process_list[i]->active);
 
             break;
           }
-          else if (controller_rule_status_is_available(process->action, process->rule)) {
+          else if (controller_rule_status_is_available(process_list[i]->action, process_list[i]->rule)) {
             required_not_run = F_true;
           }
         }
 
-        f_thread_unlock(&process->lock);
-        f_thread_unlock(&process->active);
-
-        if (caller) {
-          status_lock = controller_lock_read_process(caller, main.thread, &main.thread->lock.process);
-        }
-        else {
-          status_lock = controller_lock_read(is_normal, main.thread, &main.thread->lock.process);
-        }
+        f_thread_unlock(&process_list[i]->lock);
+        f_thread_unlock(&process_list[i]->active);
 
-        if (status_lock == F_signal || F_status_is_error(status_lock)) break;
         if (F_status_set_fine(status) == F_require) break;
 
         continue;
       }
 
-      if (!controller_rule_status_is_error(process->action, process->rule) && (process->state == controller_process_state_active || process->state == controller_process_state_busy)) {
-        f_thread_unlock(&process->lock);
+      if (!controller_rule_status_is_error(process_list[i]->action, process_list[i]->rule) && (process_list[i]->state == controller_process_state_active || process_list[i]->state == controller_process_state_busy)) {
+        f_thread_unlock(&process_list[i]->lock);
 
-        status = controller_process_wait(main, process);
+        status = controller_process_wait(main, process_list[i]);
 
         if (status == F_signal) {
-          f_thread_unlock(&process->active);
-
-          if (caller) {
-            status_lock = controller_lock_read_process(caller, main.thread, &main.thread->lock.process);
-          }
-          else {
-            status_lock = controller_lock_read(is_normal, main.thread, &main.thread->lock.process);
-          }
+          f_thread_unlock(&process_list[i]->active);
 
           break;
         }
 
         if (required) {
           if (caller) {
-            status_lock = controller_lock_read_process(caller, main.thread, &process->lock);
+            status_lock = controller_lock_read_process(caller, main.thread, &process_list[i]->lock);
           }
           else {
-            status_lock = controller_lock_read(is_normal, main.thread, &process->lock);
+            status_lock = controller_lock_read(is_normal, main.thread, &process_list[i]->lock);
           }
 
           if (status_lock == F_signal || F_status_is_error(status_lock)) {
-            f_thread_unlock(&process->active);
+            f_thread_unlock(&process_list[i]->active);
 
             break;
           }
 
-          if ((process->options & controller_process_option_require)) {
-            f_thread_unlock(&process->lock);
+          if ((process_list[i]->options & controller_process_option_require)) {
+            f_thread_unlock(&process_list[i]->lock);
 
-            if (controller_rule_status_is_error(process->action, process->rule)) {
+            if (controller_rule_status_is_error(process_list[i]->action, process_list[i]->rule)) {
               status = F_status_set_error(F_require);
 
-              f_thread_unlock(&process->active);
-
-              if (caller) {
-                status_lock = controller_lock_read_process(caller, main.thread, &main.thread->lock.process);
-              }
-              else {
-                status_lock = controller_lock_read(is_normal, main.thread, &main.thread->lock.process);
-              }
-
+              f_thread_unlock(&process_list[i]->active);
               break;
             }
           }
           else {
-            f_thread_unlock(&process->lock);
+            f_thread_unlock(&process_list[i]->lock);
           }
         }
       }
       else {
-        f_thread_unlock(&process->lock);
+        f_thread_unlock(&process_list[i]->lock);
       }
 
-      f_thread_unlock(&process->active);
+      f_thread_unlock(&process_list[i]->active);
 
-      if (caller) {
-        status_lock = controller_lock_read_process(caller, main.thread, &main.thread->lock.process);
-      }
-      else {
-        status_lock = controller_lock_read(is_normal, main.thread, &main.thread->lock.process);
-      }
-
-      if (status_lock == F_signal || F_status_is_error(status_lock)) break;
       if (status == F_signal || F_status_set_fine(status) == F_require) break;
     } // for
 
@@ -5710,8 +5684,6 @@ extern "C" {
       return status_lock;
     }
 
-    f_thread_unlock(&main.thread->lock.process);
-
     if (caller) {
       if (!controller_thread_is_enabled_process(caller, main.thread)) {
         return F_signal;
index 8cff5de948f7d8d9c681eed65568d69b65182e5a..62adf6f7780fec884fac57020b3fa9d84241942d 100644 (file)
@@ -349,7 +349,7 @@ extern "C" {
  *   - controller_rule_action_type_start
  *   - controller_rule_action_type_stop
  * @param options
- *   A number using bits to represent specific boolean options.
+ *   Process options to consider when executing.
  *   If bit controller_process_option_simulate, then the rule execution is in simulation mode (printing a message that the rule would be executed but does not execute the rule).
  * @param main
  *   The main data.
@@ -379,7 +379,7 @@ extern "C" {
  * This requires that a read lock be set on process->lock before being called.
  *
  * @param type
- *   The item type code.
+ *   The item type ID.
  * @param action
  *   The action to perform based on the action type codes.
  *
@@ -394,7 +394,7 @@ extern "C" {
  * @param arguments
  *   The arguments to pass to the program.
  * @param options
- *   A number using bits to represent specific boolean options.
+ *   Process options to consider when executing.
  *   If bit controller_process_option_simulate, then the rule execution is in simulation mode (printing a message that the rule would be executed but does not execute the rule).
  * @param main
  *   The main data.
@@ -444,7 +444,7 @@ extern "C" {
  * @param arguments
  *   The arguments to pass to the program.
  * @param options
- *   A number using bits to represent specific boolean options.
+ *   Process options to consider when executing.
  *   If bit controller_process_option_simulate, then the rule execution is in simulation mode (printing a message that the rule would be executed but does not execute the rule).
  * @param with
  *   The "with" option flags.
index 6ebf7f7e42f1929be264a0a766964da802d1ba15..fbfb50db90d9042959d799ebbd124b1ad2b7e367 100644 (file)
@@ -281,7 +281,23 @@ extern "C" {
     }
 
     if (F_status_is_error(status) || status == F_signal || !(data->parameters[controller_parameter_validate].result == f_console_result_none || data->parameters[controller_parameter_test].result == f_console_result_found)) {
-      // do nothing
+
+      if (main.data->parameters[controller_parameter_validate].result == f_console_result_found) {
+        const controller_main_entry_t entry = controller_macro_main_entry_t_initialize(&main, main.setting);
+
+        status = f_thread_create(0, &thread.id_entry, &controller_thread_exit, (void *) &entry);
+
+        if (F_status_is_error(status)) {
+          if (data->error.verbosity != f_console_verbosity_quiet) {
+            controller_error_print(data->error, F_status_set_fine(status), "f_thread_create", F_true, &thread);
+          }
+        }
+        else {
+          controller_thread_join(&thread.id_entry);
+
+          status = thread.status;
+        }
+      }
     }
     else {
       if (data->parameters[controller_parameter_validate].result == f_console_result_none && setting->mode == controller_setting_mode_service) {