]> Kevux Git Server - controller/commitdiff
Progress: Continue migrating the project.
authorKevin Day <Kevin@kevux.org>
Mon, 17 Jun 2024 04:41:42 +0000 (23:41 -0500)
committerKevin Day <Kevin@kevux.org>
Mon, 17 Jun 2024 04:41:42 +0000 (23:41 -0500)
22 files changed:
sources/c/init/init.c
sources/c/init/init.h
sources/c/main/common/enumeration/entry.h
sources/c/main/common/type.c
sources/c/main/common/type.h
sources/c/main/common/type/entry.h
sources/c/main/common/type/process.h
sources/c/main/entry.c
sources/c/main/entry.h
sources/c/main/entry/setting.c
sources/c/main/entry/setting.h
sources/c/main/file.c
sources/c/main/file.h
sources/c/main/perform.c
sources/c/main/perform.h
sources/c/main/print/debug/perform/pid.c
sources/c/main/print/debug/perform/pid.h
sources/c/main/print/error/entry.c
sources/c/main/print/error/entry.h
sources/c/main/print/message/entry/item.c
sources/c/main/print/message/entry/item.h
sources/c/main/thread/entry.c

index 17691ab86516d369aab97848371132e533625412..b9cfa0bf36aa263a2fa9d9cea43230eeedf9191a 100644 (file)
@@ -5,9 +5,9 @@ extern "C" {
 #endif
 
 #ifndef _di_controller_init_process_entry_setup_
-  f_status_t controller_init_process_entry_setup(controller_t * const main, controller_cache_t * const cache, controller_entry_t * const entry, const uint8_t is_entry) {
+  f_status_t controller_init_process_entry_setup(controller_t * const main, controller_entry_t * const entry) {
 
-    if (!main || !entry || !cache) return F_status_set_error(F_parameter);
+    if (!main || !entry) return F_status_set_error(F_parameter);
 
     entry->session = controller_entry_session_new_e;
 
index 15189142f6c1832e56ea033b65b5111f9420df53..99e0930521726fccf6a0c174547ffe63ffd6f274 100644 (file)
@@ -25,10 +25,6 @@ extern "C" {
  *   The main program data.
  *
  *   Must not be NULL.
- * @param cache
- *   The cache.
- *
- *   Must not be NULL.
  * @param entry
  *   The entry data.
  *
@@ -43,7 +39,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  */
 #ifndef _di_controller_init_process_entry_setup_
-  extern f_status_t controller_init_process_entry_setup(controller_t * const main, controller_cache_t * const cache, controller_entry_t * const entry, const uint8_t is_entry);
+  extern f_status_t controller_init_process_entry_setup(controller_t * const main, controller_entry_t * const entry);
 #endif // _di_controller_init_process_entry_setup_
 
 #ifdef __cplusplus
index 5d6925c03ff509041acfa469b6cad9e5d0918f19..8cdb58507e538d0e490781268f2794680b025e16 100644 (file)
@@ -80,19 +80,21 @@ extern "C" {
  * Controller Entry flags.
  *
  * controller_entry_flag_*_e:
- *   - none_e:             No flags are set.
- *   - timeout_exit_no_e:  The exit timeout is disabled.
- *   - timeout_kill_no_e:  The kill timeout is disabled for Rules by default.
- *   - timeout_start_no_e: The start timeout is disabled for Rules by default.
- *   - timeout_stop_no_e:  The stop timeout is disabled for Rules by default.
+ *   - none:             No flags are set.
+ *   - is:               Designate that this is an entry rather than an exit.
+ *   - timeout_exit_no:  The exit timeout is disabled.
+ *   - timeout_kill_no:  The kill timeout is disabled for Rules by default.
+ *   - timeout_start_no: The start timeout is disabled for Rules by default.
+ *   - timeout_stop_no:  The stop timeout is disabled for Rules by default.
  */
 #ifndef _di_controller_entry_flag_e_
   enum {
     controller_entry_flag_none_e             = 0x0,
-    controller_entry_flag_timeout_exit_no_e  = 0x1,
-    controller_entry_flag_timeout_kill_no_e  = 0x2,
-    controller_entry_flag_timeout_start_no_e = 0x4,
-    controller_entry_flag_timeout_stop_no_e  = 0x8,
+    controller_entry_flag_is_e               = 0x1,
+    controller_entry_flag_timeout_exit_no_e  = 0x2,
+    controller_entry_flag_timeout_kill_no_e  = 0x4,
+    controller_entry_flag_timeout_start_no_e = 0x8,
+    controller_entry_flag_timeout_stop_no_e  = 0x10,
   }; // enum
 #endif // _di_controller_entry_flag_e_
 
index ba9d40db9294e0e3f2e616bfa3dae3142b5c9e01..56e53d3b45803bda17b74ba30dad1b4f98621fe2 100644 (file)
@@ -11,7 +11,6 @@ extern "C" {
 
     fll_program_data_delete(&main->program);
 
-    controller_cache_delete(&main->cache);
     controller_process_delete(&main->process);
     controller_setting_delete(&main->setting);
     controller_thread_delete(&main->thread);
index aa085fec40918fba4b261b043476519bb09eebaf..97d75b3a1f5363a302c9181e23aa6d1d7648b134 100644 (file)
@@ -60,7 +60,7 @@ extern "C" {
  */
 #ifndef _di_controller_t_
   typedef struct {
-    f_status_t (*process_entry_setup)(controller_t * const main, controller_cache_t * const cache, controller_entry_t * const entry, const uint8_t is_entry);
+    f_status_t (*process_entry_setup)(controller_t * const main, controller_entry_t * const entry);
   } controller_callback_t;
 
   #define controller_callback_t_initialize \
@@ -77,7 +77,6 @@ extern "C" {
  * Properties:
  *   - program: The main program data.
  *
- *   - cache:    The cache.
  *   - callback: The callbacks.
  *   - process:  The process data.
  *   - setting:  The settings data.
@@ -87,7 +86,6 @@ extern "C" {
   struct controller_t_ {
     fll_program_data_t program;
 
-    controller_cache_t cache;
     controller_callback_t callback;
     controller_process_t process;
     controller_setting_t setting;
@@ -97,7 +95,6 @@ extern "C" {
   #define controller_t_initialize \
     { \
       fll_program_data_t_initialize, \
-      controller_cache_t_initialize, \
       controller_callback_t_initialize, \
       controller_process_t_initialize, \
       controller_setting_t_initialize, \
index 2ae474a8e1cbb01854c9ac0d6103063784306d27..7b9b54a2f9b7c06a981f55b9763ad4dc7a98a7df 100644 (file)
@@ -134,9 +134,11 @@ extern "C" {
  * Entry and Exit files are essentially the same structure with minor differences in settings and behavior.
  * The structure is identical and due to lacking any particularly good name to represent both "entry" or "exit", the name "entry" is being used for both.
  *
+ * A special macro_controller_entry_t_initialize_1() is provided to easily initialize with a specific set of flags.
+ *
  * Properties:
  *   - define:        Any defines (environment variables) made available to all Rules in this entry for IKI substitution or just as environment variables.
- *   - flag:          A set of flags, primarily used to designate that timeouts are disabled.
+ *   - flag:          A set of flags associated with the entry.
  *   - items:         The array of entry items.
  *   - parameter:     Any parameters made available to all Rules in this entry for IKI substitution.
  *   - pid:           The PID file generation setting.
@@ -182,6 +184,21 @@ extern "C" {
     f_string_maps_t_initialize, \
     controller_entry_items_t_initialize, \
   }
+
+  #define macro_controller_entry_t_initialize_1(flag) { \
+    F_known_not, \
+    controller_entry_pid_require_e, \
+    0, \
+    0, \
+    flag, \
+    controller_thread_exit_timeout_d, \
+    0, \
+    0, \
+    0, \
+    f_string_maps_t_initialize, \
+    f_string_maps_t_initialize, \
+    controller_entry_items_t_initialize, \
+  }
 #endif // _di_controller_entry_t_
 
 /**
index 69b1b3355ecaf767055a554d1fd69e5eee98465b..b665bf1da3c270e05819dd3c861730a5e33ab5fe 100644 (file)
@@ -70,7 +70,7 @@ extern "C" {
     f_string_dynamic_t_initialize, \
     f_string_dynamic_t_initialize, \
     controller_control_t_initialize, \
-    controller_entry_t_initialize, \
+    macro_controller_entry_t_initialize_1(controller_entry_flag_is_e), \
     controller_entry_t_initialize, \
     controller_rules_t_initialize, \
   }
index 153c59b7dc2ad8cc6817a54329b71bd7843c541f..92319cd6c8feb06d9d39b5a1b89cb51351b6d939 100644 (file)
@@ -5,105 +5,91 @@ extern "C" {
 #endif
 
 #ifndef _di_controller_entry_read_
-  f_status_t controller_entry_read(controller_t * const main, controller_cache_t * const cache, const uint8_t is_entry) {
+  f_status_t controller_entry_read(controller_t * const main, controller_entry_t * const entry) {
 
-    if (!main || !cache) return F_status_set_error(F_parameter);
+    if (!main) return F_status_set_error(F_parameter);
 
     f_status_t status = F_okay;
-
-    controller_entry_t * const entry = is_entry ? &main->process.entry : &main->process.exit;
+    f_number_unsigned_t i = 0;
 
     entry->status = F_known_not;
     entry->items.used = 0;
     entry->session = controller_entry_session_same_e;
 
     if (main->callback.process_entry_setup) {
-      status = main->callback.process_entry_setup(main, cache, entry, is_entry);
+      status = main->callback.process_entry_setup(main, entry);
     }
 
-    cache->action.line_action = 0;
-    cache->action.line_item = 0;
-
-    cache->timestamp.seconds = 0;
-    cache->timestamp.seconds_nano = 0;
+    main->thread.cache.action.line_action = 0;
+    main->thread.cache.action.line_item = 0;
 
-    cache->comments.used = 0;
-    cache->delimits.used = 0;
+    main->thread.cache.timestamp.seconds = 0;
+    main->thread.cache.timestamp.seconds_nano = 0;
 
-    cache->content_action.used = 0;
+    main->thread.cache.comments.used = 0;
+    main->thread.cache.delimits.used = 0;
 
-    {
-      f_number_unsigned_t i = 0;
+    main->thread.cache.content_action.used = 0;
 
-      for (; i < cache->content_actions.used; ++i) {
-        cache->content_actions.array[i].used = 0;
-      } // for
+    for (; i < main->thread.cache.content_actions.used; ++i) {
+      main->thread.cache.content_actions.array[i].used = 0;
+    } // for
 
-      for (i = 0; i < cache->content_items.used; ++i) {
-        cache->content_items.array[i].used = 0;
-      } // for
-    }
+    for (i = 0; i < main->thread.cache.content_items.used; ++i) {
+      main->thread.cache.content_items.array[i].used = 0;
+    } // for
 
-    cache->content_actions.used = 0;
-    cache->content_items.used = 0;
+    main->thread.cache.content_actions.used = 0;
+    main->thread.cache.content_items.used = 0;
 
-    cache->object_actions.used = 0;
-    cache->object_items.used = 0;
+    main->thread.cache.object_actions.used = 0;
+    main->thread.cache.object_items.used = 0;
 
-    cache->buffer_file.used = 0;
-    cache->buffer_path.used = 0;
+    main->thread.cache.buffer_file.used = 0;
+    main->thread.cache.buffer_path.used = 0;
 
-    cache->action.name_file.used = 0;
-    cache->action.name_action.used = 0;
-    cache->action.name_item.used = 0;
+    main->thread.cache.action.name_file.used = 0;
+    main->thread.cache.action.name_action.used = 0;
+    main->thread.cache.action.name_item.used = 0;
 
     if (F_status_is_error_not(status)) {
-      if (is_entry) {
-        status = controller_file_load(main, cache, F_true, controller_entries_s, main->process.name_entry, controller_entry_s);
+      if (entry->flag & controller_entry_flag_is_e) {
+        status = controller_file_load(main, F_true, controller_entries_s, main->process.name_entry, controller_entry_s);
       }
       else {
-        status = controller_file_load(main, cache, F_false, controller_exits_s, main->process.name_entry, controller_exit_s);
+        status = controller_file_load(main, F_false, controller_exits_s, main->process.name_entry, controller_exit_s);
         if (status == F_file_found_not) return F_file_found_not;
       }
     }
 
     if (F_status_is_error_not(status)) {
-      if (cache->buffer_file.used) {
-        controller_interrupt_t custom = macro_controller_interrupt_t_initialize_1(is_entry, main);
+      if (main->thread.cache.buffer_file.used) {
+        controller_interrupt_t custom = macro_controller_interrupt_t_initialize_1(entry->flag & controller_entry_flag_is_e, main);
         f_state_t state = macro_f_state_t_initialize_1(controller_allocation_large_d, controller_allocation_small_d, F_okay, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
-        f_range_t range = macro_f_range_t_initialize_2(cache->buffer_file.used);
+        f_range_t range = macro_f_range_t_initialize_2(main->thread.cache.buffer_file.used);
 
-        fll_fss_basic_list_read(cache->buffer_file, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments, &state);
+        fll_fss_basic_list_read(main->thread.cache.buffer_file, &range, &main->thread.cache.object_items, &main->thread.cache.content_items, &main->thread.cache.delimits, 0, &main->thread.cache.comments, &state);
 
         if (F_status_is_error(status)) {
           controller_print_error_status(&main->program.error, macro_controller_f(fll_fss_basic_list_read), F_status_set_fine(status));
         }
         else {
-          f_fss_apply_delimit(cache->delimits, &cache->buffer_file, &state);
+          f_fss_apply_delimit(main->thread.cache.delimits, &main->thread.cache.buffer_file, &state);
 
           if (F_status_is_error(status)) {
-            controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_fss_apply_delimit), F_true);
+            controller_print_error_entry(&main->program.error, entry->flag & controller_entry_flag_is_e, F_status_set_fine(status), macro_controller_f(f_fss_apply_delimit), F_true);
           }
         }
       }
       else {
-        if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
-          controller_lock_print(main->program.error.to, &main->thread);
-
-          fll_print_format("%r%[%QThe %r file is empty.%]%r", main->program.error.to, f_string_eol_s, main->program.error.context, main->program.error.prefix, is_entry ? controller_entry_s : is_entry ? controller_entry_s : controller_exit_s, main->program.error.context, f_string_eol_s);
-
-          controller_unlock_print_flush(main->program.error.to, &main->thread);
-        }
-
-        status = F_status_set_error(F_data_not);
-      }
+        controller_print_error_file_status(&main->program.error, macro_controller_f(controller_file_load), (entry->flag & controller_entry_flag_is_e) ? controller_entry_s : controller_exit_s, f_file_operation_read_s, fll_error_file_type_file_e, F_status_set_fine(status));
     }
 
-    if (F_status_is_error_not(status) && cache->object_items.used) {
-      status = f_memory_array_increase_by(cache->object_items.used, sizeof(f_range_t), (void **) &cache->object_items.array, &cache->object_items.used, &cache->object_items.size);
+    if (F_status_is_error_not(status) && main->thread.cache.object_items.used) {
+      status = f_memory_array_increase_by(main->thread.cache.object_items.used, sizeof(f_range_t), (void **) &main->thread.cache.object_items.array, &main->thread.cache.object_items.used, &main->thread.cache.object_items.size);
 
       if (F_status_is_error(status)) {
-        controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_memory_array_increase_by), F_true);
+        controller_print_error_entry(&main->program.error, cache, entry->flag & controller_entry_flag_is_e, F_status_set_fine(status), macro_controller_f(f_memory_array_increase_by), F_true);
       }
       else {
 
@@ -111,75 +97,69 @@ extern "C" {
         uint8_t code = 0;
 
         f_range_t *range = 0;
-
         f_number_unsigned_t at = 0;
-        f_number_unsigned_t i = 0;
         f_number_unsigned_t j = 0;
-
         f_state_t state = f_state_t_initialize;
 
-        for (; i < cache->object_items.used && controller_thread_is_enabled(is_entry, &main->thread); ++i) {
-
-          if (code & 0x2) {
-            code -= 0x2;
-          }
+        for (; i < main->thread.cache.object_items.used && controller_thread_is_enabled(entry->flag & controller_entry_flag_is_e, &main->thread); ++i) {
 
+          code &= ~0x2;
           at = 0;
           range = 0;
 
-          cache->action.line_action = 0;
-          cache->action.line_item = 0;
+          main->thread.cache.action.line_action = 0;
+          main->thread.cache.action.line_item = 0;
 
-          cache->comments.used = 0;
-          cache->delimits.used = 0;
+          main->thread.cache.comments.used = 0;
+          main->thread.cache.delimits.used = 0;
 
-          cache->content_action.used = 0;
-          cache->content_actions.used = 0;
+          main->thread.cache.content_action.used = 0;
+          main->thread.cache.content_actions.used = 0;
 
-          cache->object_actions.used = 0;
+          main->thread.cache.object_actions.used = 0;
 
-          cache->buffer_path.used = 0;
+          main->thread.cache.buffer_path.used = 0;
 
-          cache->action.name_action.used = 0;
-          cache->action.name_item.used = 0;
+          main->thread.cache.action.name_action.used = 0;
+          main->thread.cache.action.name_item.used = 0;
 
           status = f_memory_array_increase(controller_allocation_small_d, sizeof(controller_entry_item_t), (void **) &entry->items.array, &entry->items.used, &entry->items.size);
 
           if (F_status_is_error(status)) {
-            controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true);
+            controller_print_error_entry(&main->program.error, entry->flag & controller_entry_flag_is_e, F_status_set_fine(status), macro_controller_f(f_memory_array_increase), F_true);
 
             break;
           }
 
-          status = f_string_dynamic_partial_append(cache->buffer_file, cache->object_items.array[i], &cache->action.name_item);
+          status = f_string_dynamic_partial_append(main->thread.cache.buffer_file, main->thread.cache.object_items.array[i], &main->thread.cache.action.name_item);
 
           if (F_status_is_error(status)) {
-            controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_string_dynamic_partial_append), F_true);
+            controller_print_error_entry(&main->program.error, entry->flag & controller_entry_flag_is_e, F_status_set_fine(status), macro_controller_f(f_string_dynamic_partial_append), F_true);
 
             break;
           }
 
-          f_fss_count_lines(cache->buffer_file, cache->object_items.array[i].start, &cache->action.line_item, &main->setting.state);
+          f_fss_count_lines(main->thread.cache.buffer_file, main->thread.cache.object_items.array[i].start, &main->thread.cache.action.line_item, &main->setting.state);
 
           if (F_status_is_error(status)) {
-            controller_print_error_entry(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(f_fss_count_lines), F_true);
+            controller_print_error_entry(&main->program.error, entry->flag & controller_entry_flag_is_e, F_status_set_fine(status), macro_controller_f(f_fss_count_lines), F_true);
 
             break;
           }
 
-          ++cache->action.line_item;
+          ++main->thread.cache.action.line_item;
 
           for (j = (code & 0x1) ? 1 : 0; j < entry->items.used; ++j) {
 
-            if (f_compare_dynamic(entry->items.array[j].name, cache->action.name_item) == F_equal_to) {
+            if (f_compare_dynamic(entry->items.array[j].name, main->thread.cache.action.name_item) == F_equal_to) {
               if (main->program.warning.verbosity == f_console_verbosity_debug_e) {
                 controller_lock_print(main->program.warning.to, &main->thread);
 
-                fl_print_format("%r%[%QIgnoring duplicate %r item '%]", main->program.warning.to, f_string_eol_s, main->program.warning.context, main->program.warning.prefix, is_entry ? controller_entry_s : controller_exit_s, main->program.warning.context);
-                fl_print_format(f_string_format_Q_single_s.string, main->program.warning.to, main->program.warning.notable, cache->action.name_file, main->program.warning.notable);
+                fl_print_format("%r%[%QIgnoring duplicate %r item '%]", main->program.warning.to, f_string_eol_s, main->program.warning.context, main->program.warning.prefix, (entry->flag & controller_entry_flag_is_e) ? controller_entry_s : controller_exit_s, main->program.warning.context);
+                fl_print_format(f_string_format_Q_single_s.string, main->program.warning.to, main->program.warning.notable, main->thread.cache.action.name_file, main->program.warning.notable);
                 fl_print_format(f_string_format_sentence_end_quote_s.string, main->program.warning.to, main->program.warning.context, main->program.warning.context, f_string_eol_s);
 
-                controller_print_error_entry_cache(&main->program.warning, &cache->action, is_entry);
+                controller_print_error_entry_cache(&main->program.warning, &main->thread.cache.action, entry->flag & controller_entry_flag_is_e);
 
                 controller_unlock_print_flush(main->program.warning.to, &main->thread);
               }
@@ -192,9 +172,9 @@ extern "C" {
 
           if (code & 0x2) continue;
 
-          range = &cache->content_items.array[i].array[0];
+          range = &main->thread.cache.content_items.array[i].array[0];
 
-          if (f_compare_dynamic(controller_main_s, cache->action.name_item) == F_equal_to) {
+          if (f_compare_dynamic(controller_main_s, main->thread.cache.action.name_item) == F_equal_to) {
             code |= 0x1;
 
             at = 0;
@@ -203,8 +183,8 @@ extern "C" {
               entry->items.used = 1;
             }
           }
-          else if (f_compare_dynamic(controller_settings_s, cache->action.name_item) == F_equal_to) {
-            status = controller_entry_setting_read(main, cache, is_entry, *range);
+          else if (f_compare_dynamic(controller_settings_s, main->thread.cache.action.name_item) == F_equal_to) {
+            status = controller_entry_setting_read(main, cache, entry->flag & controller_entry_flag_is_e, *range);
 
             continue;
           }
@@ -220,23 +200,23 @@ extern "C" {
             entry->items.used = 2;
           }
 
-          entry->items.array[at].line = cache->action.line_item;
+          entry->items.array[at].line = main->thread.cache.action.line_item;
 
-          status = f_string_dynamic_append_nulless(cache->action.name_item, &entry->items.array[at].name);
+          status = f_string_dynamic_append_nulless(main->thread.cache.action.name_item, &entry->items.array[at].name);
 
           if (F_status_is_error(status)) {
-            controller_print_error(main->thread, &main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
+            controller_print_error_status(&main->program.error, macro_controller_f(f_string_dynamic_append_nulless), F_status_set_fine(status));
 
             break;
           }
 
-          status = controller_entry_actions_read(main, cache, is_entry, *range, &entry->items.array[at].actions);
+          status = controller_entry_actions_read(main, cache, entry->flag & controller_entry_flag_is_e, *range, &entry->items.array[at].actions);
 
           if (F_status_is_error(status)) {
             if (F_status_set_fine(status) != F_interrupt) {
               controller_lock_print(main->program.error.to, &main->thread);
 
-              controller_print_error_entry_cache(is_entry, &main->program.error, &cache->action);
+              controller_print_error_entry_cache(entry->flag & controller_entry_flag_is_e, &main->program.error, &main->thread.cache.action);
 
               controller_unlock_print_flush(main->program.error.to, &main->thread);
             }
@@ -245,24 +225,16 @@ extern "C" {
           }
         } // for
 
-        if (is_entry && F_status_set_fine(status) == F_interrupt) return status;
+        if (entry->flag & controller_entry_flag_is_e && F_status_set_fine(status) == F_interrupt) return status;
 
         if (F_status_is_error_not(status)) {
-          cache->action.name_action.used = 0;
-          cache->action.name_item.used = 0;
+          main->thread.cache.action.name_action.used = 0;
+          main->thread.cache.action.name_item.used = 0;
 
           if (!(code & 0x1)) {
-            if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
-              controller_lock_print(main->program.error.to, &main->thread);
-
-              fl_print_format("%r%[%QThe required %r item '%]", main->program.error.to, f_string_eol_s, main->program.error.context, main->program.error.prefix, is_entry ? controller_entry_s : controller_exit_s, main->program.error.context);
-              fl_print_format(f_string_format_r_single_s.string, main->program.error.to, main->program.error.notable, controller_main_s, main->program.error.notable);
-              fl_print_format("%[' is not found.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s);
-
-              controller_unlock_print_flush(main->program.error.to, &main->thread);
-            }
-
             status = F_status_set_error(F_found_not);
+
+            controller_print_message_entry_item_required(&main->program.error, entry->flag & controller_entry_flag_is_e, "is not found");
           }
 
           if (F_status_is_error_not(status)) {
@@ -277,7 +249,7 @@ extern "C" {
 
               for (j = 0; j < entry->items.array[i].actions.used; ++j) {
 
-                if (!controller_thread_is_enabled(is_entry, &main->thread)) {
+                if (!controller_thread_is_enabled(entry->flag & controller_entry_flag_is_e, &main->thread)) {
                   return F_status_set_error(F_interrupt);
                 }
 
@@ -301,34 +273,24 @@ extern "C" {
                   if (missing & 0x1) {
                     missing |= 0x2;
 
-                    cache->action.line_action = action->line;
-                    cache->action.line_item = entry->items.array[i].line;
+                    main->thread.cache.action.line_action = action->line;
+                    main->thread.cache.action.line_item = entry->items.array[i].line;
 
-                    status = f_string_dynamic_append_nulless(entry->items.array[i].name, &cache->action.name_item);
+                    status = f_string_dynamic_append_nulless(entry->items.array[i].name, &main->thread.cache.action.name_item);
 
                     if (F_status_is_error(status)) {
-                      controller_print_error(main->thread, &main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
+                      controller_print_error_status(&main->program.error, macro_controller_f(f_string_dynamic_append_nulless), F_status_set_fine(status));
 
                       break;
                     }
 
-                    if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
-                      controller_lock_print(main->program.error.to, &main->thread);
-
-                      fl_print_format("%r%[%QThe required %r item '%]", main->program.error.to, f_string_eol_s, main->program.error.context, main->program.error.prefix, is_entry ? controller_entry_s : controller_exit_s, main->program.error.context);
-                      fl_print_format(f_string_format_Q_single_s.string, main->program.error.to, main->program.error.notable, action->parameters.array[0], main->program.error.notable);
-                      fl_print_format("%[' does not exist.%]%r", main->program.error.to, main->program.error.context, main->program.error.context, f_string_eol_s);
-
-                      controller_print_error_entry_cache(is_entry, &main->program.error, &cache->action);
-
-                      controller_unlock_print_flush(main->program.error.to, &main->thread);
-                    }
+                    controller_print_message_entry_item_required(&main->program.error, entry->flag & controller_entry_flag_is_e, "does not exist");
 
                     action->number = 0;
                     action->status = controller_status_simplify_error(F_found_not);
 
-                    cache->action.name_action.used = 0;
-                    cache->action.name_item.used = 0;
+                    main->thread.cache.action.name_action.used = 0;
+                    main->thread.cache.action.name_item.used = 0;
                   }
                   else {
                     action->number = k;
@@ -343,7 +305,7 @@ extern "C" {
 
     if (F_status_is_error(status)) {
       if (F_status_set_fine(status) != F_interrupt) {
-        controller_print_error_entry_cache(is_entry, &main->program.error, &cache->action);
+        controller_print_error_entry_cache(entry->flag & controller_entry_flag_is_e, &main->program.error, &main->thread.cache.action);
       }
 
       entry->status = controller_status_simplify_error(F_status_set_fine(status));
index 9899a8a37853013373ab9fbfbe731b70cec8050b..6901da3a98c55ce24fc81fedfd30fc83b00aabaa 100644 (file)
@@ -23,14 +23,10 @@ extern "C" {
  *   The main program data.
  *
  *   Must not be NULL.
- * @param cache
- *   The cache for the specific thread.
- *   This should be the cache global.thread->asynchronouss.array[global.id].cache.
+ * @param entry
+ *   The entry data.
  *
  *   Must not be NULL.
- * @param is_entry
- *   If TRUE, then this loads as an entry.
- *   If FALSE, then this loads as an exit.
  *
  * @return
  *   F_okay on success.
@@ -67,7 +63,7 @@ extern "C" {
  * @see fll_fss_basic_list_read()
  */
 #ifndef _di_controller_entry_read_
-  extern f_status_t controller_entry_read(controller_t * const main, controller_cache_t * const cache, const uint8_t is_entry);
+  extern f_status_t controller_entry_read(controller_t * const main, controller_entry_t * const entry);
 #endif // _di_controller_entry_read_
 
 #ifdef __cplusplus
index af9d89098c6fdb773483c66432d0d52c798a5b47..e6ed71d838c0b6d8ef29ed78d3ed46b1a81a54d9 100644 (file)
@@ -5,7 +5,9 @@ extern "C" {
 #endif
 
 #ifndef _di_controller_entry_setting_read_
-  f_status_t controller_entry_setting_read(controller_t * const main, controller_cache_t * const cache, const uint8_t is_entry, const f_range_t content_range) {
+  f_status_t controller_entry_setting_read(controller_t * const main, const uint8_t is_entry, const f_range_t content_range) {
+
+    if (!main) return F_status_set_error(F_parameter);
 
     f_status_t status = F_okay;
 
@@ -39,7 +41,7 @@ extern "C" {
 
     f_number_unsigned_t i = 0;
 
-    controller_entry_t *entry = is_entry ? &main->setting.entry : &main->setting.exit;
+    controller_entry_t * const entry = is_entry ? &main->setting.entry : &main->setting.exit;
     f_state_t state = f_state_t_initialize;
 
     for (; i < cache->object_actions.used; ++i) {
@@ -102,7 +104,7 @@ extern "C" {
         status = controller_path_canonical_relative(main->setting, cache->action.generic, &main->setting.path_control);
 
         if (F_status_is_error(status)) {
-          controller_print_error_entry_file(&main->program.error, cache, is_entry, F_status_set_fine(status), macro_controller_f(controller_path_canonical_relative), F_true, cache->action.generic, f_file_operation_analyze_s, fll_error_file_type_path_e);
+          controller_print_error_entry_file(&main->program.error, is_entry, F_status_set_fine(status), macro_controller_f(controller_path_canonical_relative), F_true, cache->action.generic, f_file_operation_analyze_s, fll_error_file_type_path_e);
 
           continue;
         }
index f53bbe8bfcd78d899e5024b6aedf388be8dfaa45..680c46c4858dc4874db1cade8bfccb7b6ca9ad75 100644 (file)
@@ -23,10 +23,6 @@ extern "C" {
  *   The main program data.
  *
  *   Must not be NULL.
- * @param cache
- *   A structure for containing and caching relevant data.
- *
- *   Must not be NULL.
  * @param is_entry
  *   If TRUE, then this loads as an entry.
  *   If FALSE, then this loads as an exit.
@@ -35,13 +31,35 @@ extern "C" {
  *
  * @return
  *   F_okay on success.
+ *   F_parameter (with error bit) if a parameter is invalid.
+ *
+ *   Errors (with error bit) from: f_file_mode_from_string().
+ *   Errors (with error bit) from: f_file_mode_to_mode().
+ *   Errors (with error bit) from: f_fss_apply_delimit().
+ *   Errors (with error bit) from: f_fss_count_lines().
+ *   Errors (with error bit) from: f_rip_dynamic_partial_nulless().
+ *   Errors (with error bit) from: fl_conversion_dynamic_partial_to_unsigned_detect().
+ *   Errors (with error bit) from: fll_fss_extended_read().
+ *
+ *   Errors (with error bit) from: controller_convert_group_id().
+ *   Errors (with error bit) from: controller_convert_user_id().
+ *   Errors (with error bit) from: controller_entry_setting_read_map().
+ *   Errors (with error bit) from: controller_path_canonical_relative().
  *
- *   Errors (with error bit) from: controller_print_error_entry_file().
+ * @see f_file_mode_from_string()
+ * @see f_fss_apply_delimit()
+ * @see f_fss_count_lines()
+ * @see f_rip_dynamic_partial_nulless()
+ * @see fl_conversion_dynamic_partial_to_unsigned_detect()
+ * @see fll_fss_extended_read()
  *
- * @see controller_print_error_entry_file()
+ * @see controller_convert_group_id()
+ * @see controller_convert_user_id()
+ * @see controller_entry_setting_read_map()
+ * @see controller_path_canonical_relative()
  */
 #ifndef _di_controller_entry_setting_read_
-  extern f_status_t controller_entry_setting_read(controller_t * const main, controller_cache_t * const cache, const uint8_t is_entry, const f_range_t content_range);
+  extern f_status_t controller_entry_setting_read(controller_t * const main, const uint8_t is_entry, const f_range_t content_range);
 #endif // _di_controller_entry_setting_read_
 
 /**
index 71420f9888622d5535a095695bd6b3de4206921e..5b3121e6b9a9c653a5ef4af6577660a255457a2e 100644 (file)
@@ -5,34 +5,33 @@ extern "C" {
 #endif
 
 #ifndef _di_controller_file_load_
-  f_status_t controller_file_load(controller_t * const main, controller_cache_t * const cache, const bool required, const f_string_static_t path_prefix, const f_string_static_t path_name, const f_string_static_t path_suffix) {
+  f_status_t controller_file_load(controller_t * const main, const bool required, const f_string_static_t path_prefix, const f_string_static_t path_name, const f_string_static_t path_suffix) {
 
-    if (!main || !cache) return F_status_set_error(F_parameter);
+    if (!main) return F_status_set_error(F_parameter);
 
-    f_status_t status = F_okay;
     f_file_t file = f_file_t_initialize;
 
-    cache->action.name_file.used = 0;
-    cache->buffer_file.used = 0;
-    cache->timestamp.seconds = 0;
-    cache->timestamp.seconds_nano = 0;
+    main->thread.cache.action.name_file.used = 0;
+    main->thread.cache.buffer_file.used = 0;
+    main->thread.cache.timestamp.seconds = 0;
+    main->thread.cache.timestamp.seconds_nano = 0;
 
-    status = f_string_dynamic_append(path_prefix, &cache->action.name_file);
+    f_status_t status = f_string_dynamic_append(path_prefix, &main->thread.cache.action.name_file);
 
     if (F_status_is_error_not(status)) {
-      status = f_string_dynamic_append(f_path_separator_s, &cache->action.name_file);
+      status = f_string_dynamic_append(f_path_separator_s, &main->thread.cache.action.name_file);
     }
 
     if (F_status_is_error_not(status)) {
-      status = f_string_dynamic_append(path_name, &cache->action.name_file);
+      status = f_string_dynamic_append(path_name, &main->thread.cache.action.name_file);
     }
 
     if (F_status_is_error_not(status)) {
-      status = f_string_dynamic_append(f_path_extension_separator_s, &cache->action.name_file);
+      status = f_string_dynamic_append(f_path_extension_separator_s, &main->thread.cache.action.name_file);
     }
 
     if (F_status_is_error_not(status)) {
-      status = f_string_dynamic_append(path_suffix, &cache->action.name_file);
+      status = f_string_dynamic_append(path_suffix, &main->thread.cache.action.name_file);
     }
 
     if (F_status_is_error(status)) {
@@ -44,10 +43,10 @@ extern "C" {
     f_string_static_t path = f_string_static_t_initialize;
 
     if (main->setting.path_setting.used) {
-      path.used = main->setting.path_setting.used + F_path_separator_s_length + cache->action.name_file.used;
+      path.used = main->setting.path_setting.used + F_path_separator_s_length + main->thread.cache.action.name_file.used;
     }
     else {
-      path.used = cache->action.name_file.used;
+      path.used = main->thread.cache.action.name_file.used;
     }
 
     f_char_t path_string[path.used + 1];
@@ -55,12 +54,12 @@ extern "C" {
 
     if (main->setting.path_setting.used) {
       memcpy(path_string, main->setting.path_setting.string, sizeof(f_char_t) * main->setting.path_setting.used);
-      memcpy(path_string + main->setting.path_setting.used + F_path_separator_s_length, cache->action.name_file.string, sizeof(f_char_t) * cache->action.name_file.used);
+      memcpy(path_string + main->setting.path_setting.used + F_path_separator_s_length, main->thread.cache.action.name_file.string, sizeof(f_char_t) * main->thread.cache.action.name_file.used);
 
       path_string[main->setting.path_setting.used] = f_path_separator_s.string[0];
     }
     else {
-      memcpy(path_string, cache->action.name_file.string, sizeof(f_char_t) * cache->action.name_file.used);
+      memcpy(path_string, main->thread.cache.action.name_file.string, sizeof(f_char_t) * main->thread.cache.action.name_file.used);
     }
 
     path_string[path.used] = 0;
@@ -81,7 +80,7 @@ extern "C" {
       }
     }
     else {
-      status = f_file_stream_read(file, &cache->buffer_file);
+      status = f_file_stream_read(file, &main->thread.cache.buffer_file);
 
       if (F_status_is_error(status)) {
         controller_print_error_file_status(&main->program.error, macro_controller_f(f_file_stream_read), path, f_file_operation_read_s, fll_error_file_type_file_e, F_status_set_fine(status));
@@ -100,8 +99,8 @@ extern "C" {
         controller_print_error_file_status(&main->program.error, macro_controller_f(f_file_stat), path, f_file_operation_stat_s, fll_error_file_type_file_e, F_status_set_fine(status));
       }
       else {
-        cache->timestamp.seconds = stat_file.st_ctim.tv_sec;
-        cache->timestamp.seconds_nano = stat_file.st_ctim.tv_nsec;
+        main->thread.cache.timestamp.seconds = stat_file.st_ctim.tv_sec;
+        main->thread.cache.timestamp.seconds_nano = stat_file.st_ctim.tv_nsec;
       }
     }
 
index 59ec8f0f91f332ccd8f34bd6458424e5a82d2324..2ad49082f8c6969ba2ff41eb0ab37431d27ce41f 100644 (file)
@@ -22,9 +22,7 @@ extern "C" {
  * @param main
  *   The main program data.
  *
- *   Must not be NULL.
- * @param cache
- *   The following within the cache is updated:
+ *   The following within the main.thread.cache is updated:
  *   - name_file: The partial path of the file is inserted.
  *   - buffer_file: The contents of the file is inserted.
  *   - timestamp: This is updated to reflect the last changed timestamp.
@@ -56,7 +54,7 @@ extern "C" {
  * @see f_string_append()
  */
 #ifndef _di_controller_file_load_
-  extern f_status_t controller_file_load(controller_t * const main, controller_cache_t * const cache, const bool required, const f_string_static_t path_prefix, const f_string_static_t path_name, const f_string_static_t path_suffix);
+  extern f_status_t controller_file_load(controller_t * const main, const bool required, const f_string_static_t path_prefix, const f_string_static_t path_name, const f_string_static_t path_suffix);
 #endif // _di_controller_file_load_
 
 /**
index 0de2de153503614cd22ebebe7bb62765e5543eb4..f81ab7cdeffc741bab89614960de14f9420bd42e 100644 (file)
@@ -40,7 +40,7 @@ extern "C" {
       else {
         main->setting.flag |= controller_setting_flag_pid_created_e;
 
-        controller_print_debug_perform_pid_file_create_success(&main->program.debug, is_entry);
+        controller_print_debug_perform_pid_file_create_success(&main->program.debug);
       }
     }
 
@@ -59,7 +59,7 @@ extern "C" {
 #endif // _di_controller_perform_ready_
 
 #ifndef _di_controller_perform_ready_socket_
-  f_status_t controller_perform_ready_socket(controller_t * const main, const uint8_t is_entry) {
+  f_status_t controller_perform_ready_socket(controller_t * const main) {
 
     f_status_t status = F_okay;
 
index 5672c9545e40002f35721d6ac9127bae04a4053b..0ca3b596d1738b14a153d6b7762bee100e1f4fd7 100644 (file)
@@ -53,9 +53,6 @@ extern "C" {
  *   The main program data.
  *
  *   Must not be NULL.
- * @param is_entry
- *   If TRUE, then this operates as an entry.
- *   If FALSE, then this operates as an exit.
  *
  * @return
  *   F_okay on success.
@@ -76,7 +73,7 @@ extern "C" {
  * @see f_thread_create()
  */
 #ifndef _di_controller_perform_ready_socket_
-  extern f_status_t controller_perform_ready_socket(controller_t * const main, const uint8_t is_entry);
+  extern f_status_t controller_perform_ready_socket(controller_t * const main);
 #endif // _di_controller_perform_ready_socket_
 
 #ifdef __cplusplus
index 8b4efe58bf39ce487da7b0ee8f1900b28dd94d80..9995826f9adda71434496a11e5771bee3fa0989e 100644 (file)
@@ -57,7 +57,7 @@ extern "C" {
 #endif // _di_controller_print_debug_perform_pid_file_create_problem_
 
 #ifndef _di_controller_print_debug_perform_pid_file_create_success_
-  f_status_t controller_print_debug_perform_pid_file_create_success(fl_print_t * const print, const uint8_t is_entry) {
+  f_status_t controller_print_debug_perform_pid_file_create_success(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
     if (print->verbosity < f_console_verbosity_debug_e) return F_output_not;
index e14834241d022b5b4e3cd7e4ae92be9151f00af0..8796cde294407b9ee667505b1e2614b983a6dc0d 100644 (file)
@@ -73,9 +73,6 @@ extern "C" {
  *   This requires print.custom to be controller_t.
  *
  *   This does not alter print.custom.setting.state.status.
- * @param is_entry
- *   If TRUE, then this operates as an entry.
- *   If FALSE, then this operates as an exit.
  *
  * @return
  *   F_okay on success.
@@ -84,7 +81,7 @@ extern "C" {
  *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_controller_print_debug_perform_pid_file_create_success_
-  extern f_status_t controller_print_debug_perform_pid_file_create_success(fl_print_t * const print, const uint8_t is_entry);
+  extern f_status_t controller_print_debug_perform_pid_file_create_success(fl_print_t * const print);
 #endif // _di_controller_print_debug_perform_pid_file_create_success_
 
 #ifdef __cplusplus
index 22e05b6aa86564b789d02b390b009d44b201fb65..f593aaeee36811e15299608b91f19d61cc5d070a 100644 (file)
@@ -5,9 +5,9 @@ extern "C" {
 #endif
 
 #ifndef _di_controller_print_error_entry_
-  f_status_t controller_print_error_entry(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback) {
+  f_status_t controller_print_error_entry(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback) {
 
-    if (!print || !print->custom || !cache) return F_status_set_error(F_output_not);
+    if (!print || !print->custom) return F_status_set_error(F_output_not);
     if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
     if (status == F_interrupt) return F_status_set_error(F_output_not);
 
@@ -20,7 +20,7 @@ extern "C" {
 
     f_file_stream_lock(print->to);
 
-    controller_print_error_entry_cache(print, &cache->action, is_entry);
+    controller_print_error_entry_cache(print, &main->thread.cache.action, is_entry);
 
     controller_unlock_print_flush(print->to, &main->thread);
 
@@ -64,7 +64,7 @@ extern "C" {
 #endif // _di_controller_print_error_entry_cache_
 
 #ifndef _di_controller_print_error_entry_file_
-  f_status_t controller_print_error_entry_file(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
+  f_status_t controller_print_error_entry_file(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
 
     if (!print || !print->custom || !cache) return F_status_set_error(F_output_not);
     if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
@@ -79,7 +79,7 @@ extern "C" {
 
     f_file_stream_lock(print->to);
 
-    controller_print_error_entry_cache(print, &cache->action, is_entry);
+    controller_print_error_entry_cache(print, &main->thread.cache.action, is_entry);
 
     controller_unlock_print_flush(print->to, &main->thread);
 
index 18b28717a6475d2bc103e304a7af77bb6b6b2eb4..b507fd4e55753c6c5ae9bb426026f2c6c10d23e2 100644 (file)
@@ -27,10 +27,6 @@ extern "C" {
  *   This does not alter print.custom.setting.state.status.
  *
  *   Must not be NULL.
- * @param cache
- *   The cache.
- *
- *   Must not be NULL.
  * @param is_entry
  *   If TRUE, then this loads as an entry.
  *   If FALSE, then this loads as an exit.
@@ -55,11 +51,11 @@ extern "C" {
  * @see controller_print_error_entry_cache()
  */
 #ifndef _di_controller_print_error_entry_
-  extern f_status_t controller_print_error_entry(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback);
+  extern f_status_t controller_print_error_entry(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const char * const function, const bool fallback);
 #endif // _di_controller_print_error_entry_
 
 /**
- * Print additional error/warning information in addition to existing error that is found within the cache.
+ * Print additional error/warning information in addition to existing error that is found within the given action cache.
  *
  * This is explicitly intended to be used in addition to the error message.
  *
@@ -105,10 +101,6 @@ extern "C" {
  *   This does not alter print.custom.setting.state.status.
  *
  *   Must not be NULL.
- * @param cache
- *   The cache.
- *
- *   Must not be NULL.
  * @param is_entry
  *   If TRUE, then this loads as an entry.
  *   If FALSE, then this loads as an exit.
@@ -135,10 +127,9 @@ extern "C" {
  *   F_output_not (with error bit) if setting is NULL.
  *
  * @see fll_error_file_print()
- * @see controller_print_error_entry_cache()
  */
 #ifndef _di_controller_print_error_entry_file_
-  extern f_status_t controller_print_error_entry_file(fl_print_t * const print, controller_cache_t * const cache, const uint8_t is_entry, const f_status_t status, const char * const function, const uint8_t fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
+  extern f_status_t controller_print_error_entry_file(fl_print_t * const print, const uint8_t is_entry, const f_status_t status, const char * const function, const uint8_t fallback, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
 #endif // _di_controller_print_error_entry_file_
 
 #ifdef __cplusplus
index 3b34434a9b472dad46b090e11c92a6f47396bf41..07ee7a807ab805295434fdb959efa723b8b8d298 100644 (file)
@@ -4,6 +4,26 @@
 extern "C" {
 #endif
 
+#ifndef _di_controller_print_message_entry_item_done_
+  f_status_t controller_print_message_entry_item_done(fl_print_t * const print, const uint8_t is_entry, const uint8_t failsafe, const f_string_static_t name) {
+
+    if (!print || !print->custom) return F_status_set_error(F_output_not);
+    if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
+
+    controller_t * const main = (controller_t *) print->custom;
+
+    controller_lock_print(print->to, &main->thread);
+
+    fl_print_format("%rDone processing %r item '", print->to, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
+    fl_print_format(f_string_format_Q_single_s.string, print->to, print->set.title, name, print->set.title);
+    fl_print_format("'.%r%r", print->to, f_string_eol_s, failsafe ? f_string_eol_s : f_string_empty_s);
+
+    controller_unlock_print_flush(print->to, &main->thread);
+
+    return F_okay;
+  }
+#endif // _di_controller_print_message_entry_item_done_
+
 #ifndef _di_controller_print_message_entry_item_executing_
   f_status_t controller_print_message_entry_item_executing(fl_print_t * const print, const uint8_t is_entry, f_string_dynamics_t * const parameters) {
 
@@ -57,8 +77,8 @@ extern "C" {
   }
 #endif // _di_controller_print_message_entry_item_process_
 
-#ifndef _di_controller_print_message_entry_item_done_
-  f_status_t controller_print_message_entry_item_done(fl_print_t * const print, const uint8_t is_entry, const uint8_t failsafe, const f_string_static_t name) {
+#ifndef _di_controller_print_message_entry_item_required_
+  f_status_t controller_print_message_entry_item_required(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name, const f_string_t detail) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
     if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
@@ -67,15 +87,17 @@ extern "C" {
 
     controller_lock_print(print->to, &main->thread);
 
-    fl_print_format("%rDone processing %r item '", print->to, f_string_eol_s, is_entry ? controller_entry_s : controller_exit_s);
+    fl_print_format("%r%[%QThe required %r item '%]", print->to, f_string_eol_s, print->context, print->prefix, is_entry ? controller_entry_s : controller_exit_s);
     fl_print_format(f_string_format_Q_single_s.string, print->to, print->set.title, name, print->set.title);
-    fl_print_format("'.%r%r", print->to, f_string_eol_s, failsafe ? f_string_eol_s : f_string_empty_s);
+    fl_print_format("' %Q.", print->to, reason, f_string_eol_s);
+
+    controller_print_error_entry_cache(print, &main->thread.cache.action, is_entry);
 
     controller_unlock_print_flush(print->to, &main->thread);
 
     return F_okay;
   }
-#endif // _di_controller_print_message_entry_item_done_
+#endif // _di_controller_print_message_entry_item_required_
 
 #ifndef _di_controller_print_message_entry_item_rule_
   f_status_t controller_print_message_entry_item_rule(fl_print_t * const print, controller_entry_t * const entry, controller_entry_action_t * const action, const uint8_t is_entry, const f_string_static_t alias_rule) {
index 3447524307600b1874fd8fb63521159deed5b985..8b16abecb3bc0cebb5f82416719463798070cdd0 100644 (file)
@@ -17,6 +17,37 @@ extern "C" {
 #endif
 
 /**
+ * Print message about processing an item.
+ *
+ * @param print
+ *   The output structure to print to.
+ *
+ *   This requires print.custom to be controller_t.
+ *
+ *   This does not alter print.custom.setting.state.status.
+ * @param is_entry
+ *   If TRUE, then this loads as an entry.
+ *   If FALSE, then this loads as an exit.
+ * @param failsafe
+ *   If TRUE, then running in failsafe.
+ *   If FALSE, then running normally.
+ * @param name
+ *   The item name.
+ *
+ * @return
+ *   F_okay on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_error_file_print()
+ * @see controller_print_error_entry_cache()
+ */
+#ifndef _di_controller_print_message_entry_item_done_
+  extern f_status_t controller_print_message_entry_item_done(fl_print_t * const print, const uint8_t is_entry, const uint8_t failsafe, const f_string_static_t name);
+#endif // _di_controller_print_message_entry_item_done_
+
+/**
  * Print message about the entry item executing.
  *
  * @param print
@@ -82,7 +113,7 @@ extern "C" {
 #endif // _di_controller_print_message_entry_item_process_
 
 /**
- * Print message about processing an item.
+ * Print message about a problem with an entry item.
  *
  * @param print
  *   The output structure to print to.
@@ -93,11 +124,10 @@ extern "C" {
  * @param is_entry
  *   If TRUE, then this loads as an entry.
  *   If FALSE, then this loads as an exit.
- * @param failsafe
- *   If TRUE, then running in failsafe.
- *   If FALSE, then running normally.
  * @param name
  *   The item name.
+ * @param detail
+ *   The details regarding the problem with the required entry item.
  *
  * @return
  *   F_okay on success.
@@ -108,9 +138,9 @@ extern "C" {
  * @see fll_error_file_print()
  * @see controller_print_error_entry_cache()
  */
-#ifndef _di_controller_print_message_entry_item_done_
-  extern f_status_t controller_print_message_entry_item_done(fl_print_t * const print, const uint8_t is_entry, const uint8_t failsafe, const f_string_static_t name);
-#endif // _di_controller_print_message_entry_item_done_
+#ifndef _di_controller_print_message_entry_item_required_
+  extern f_status_t controller_print_message_entry_item_required(fl_print_t * const print, const uint8_t is_entry, const f_string_static_t name, const f_string_t detail);
+#endif // _di_controller_print_message_entry_item_required_
 
 /**
  * Print warning message about multiple actions for a specified item.
index 25115842b30e473593367870cf41175b5479a189..286ed3e35ce9495339ca5b28b53d8702c80d0d88 100644 (file)
@@ -17,7 +17,7 @@ extern "C" {
 
     f_status_t * const status = &main->thread.status;
 
-    *status = controller_entry_read(main, F_true);
+    *status = controller_entry_read(main, &main->process.entry);
 
     if (F_status_set_fine(*status) == F_interrupt) {
       main->process.ready = controller_process_ready_abort_e;
@@ -130,10 +130,9 @@ extern "C" {
     f_thread_cancel_state_set(PTHREAD_CANCEL_DEFERRED, 0);
 
     controller_t * const main = (controller_t *) argument;
-    controller_cache_t * const cache = &main->thread.cache;
     f_status_t * const status = &main->thread.status;
 
-    *status = controller_entry_read(main, F_false);
+    *status = controller_entry_read(main, &main->process.exit);
 
     if (F_status_set_fine(*status) == F_interrupt) {
       main->process.ready = controller_process_ready_abort_e;