]> Kevux Git Server - controller/commitdiff
Progress: Continue migrating the project.
authorKevin Day <kevin@kevux.org>
Wed, 8 May 2024 02:52:45 +0000 (21:52 -0500)
committerKevin Day <kevin@kevux.org>
Wed, 8 May 2024 02:52:45 +0000 (21:52 -0500)
22 files changed:
data/build/dependencies
data/build/settings
sources/c/main/common/print.c
sources/c/main/common/print.h
sources/c/main/common/type/cache.c
sources/c/main/common/type/execute.c [new file with mode: 0644]
sources/c/main/common/type/execute.h [new file with mode: 0644]
sources/c/main/common/type/lock.c
sources/c/main/common/type/rule.c
sources/c/main/common/type/rule.h
sources/c/main/controller.h
sources/c/main/print/error.c
sources/c/main/print/error.h
sources/c/main/rule.c
sources/c/main/rule/action.c
sources/c/main/rule/execute.c
sources/c/main/rule/expand.c
sources/c/main/rule/instance.c
sources/c/main/rule/item.c
sources/c/main/rule/parameter.c
sources/c/main/rule/read.c
sources/c/main/rule/setting.c

index 37668f9db3f376ac19ca9a66a54afed788b77202..b436ddd113791dbdc8856d300475a08919d6270d 100644 (file)
@@ -35,6 +35,7 @@ fl_control_group
 fl_conversion
 fl_directory
 fl_environment
+fl_execute
 fl_fss
 fl_iki
 fl_path
index 3157770156845794ce0c1770f8526b53308ac52b..be6b1997800cf34ab9303e1469d7ba2983e7902b 100644 (file)
@@ -34,14 +34,14 @@ build_language c
 build_libraries -lc -lcap
 build_libraries-individual -lfll_control_group -lfll_error -lfll_execute -lfll_fss -lfll_print -lfll_program -lfll_status_string
 build_libraries-individual_thread -lf_thread
-build_libraries-individual -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_iki -lfl_path -lfl_print
+build_libraries-individual -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_execute -lfl_fss -lfl_iki -lfl_path -lfl_print
 build_libraries-individual -lf_account -lf_capability -lf_color -lf_compare -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_execute -lf_file -lf_fss -lf_iki -lf_limit -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_socket -lf_status_string -lf_string -lf_time -lf_type_array -lf_utf
 build_libraries-individual_thread -lf_thread
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 
 build_sources_library main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c
-build_sources_library main/common/type/cache.c main/common/type/control.c main/common/type/entry.c main/common/type/global.c main/common/type/lock.c main/common/type/instance.c main/common/type/program.c main/common/type/rule.c main/common/type/thread.c
+build_sources_library main/common/type/cache.c main/common/type/control.c main/common/type/entry.c main/common/type/execute.c main/common/type/global.c main/common/type/lock.c main/common/type/instance.c main/common/type/program.c main/common/type/rule.c main/common/type/thread.c
 build_sources_library main/common/string/general.c main/common/string/rule.c
 build_sources_library main/instance.c main/path.c
 build_sources_library main/rule.c main/rule/action.c main/rule/execute.c main/rule/expand.c main/rule/instance.c main/rule/is.c main/rule/item.c main/rule/parameter.c main/rule/read.c main/rule/setting.c main/rule/validate.c main/rule/wait.c
@@ -52,7 +52,7 @@ build_sources_headers main/common.h main/controller.h main/common/define.h main/
 build_sources_headers main/common/define/control.h main/common/define/entry.h main/common/define/rule.h main/common/define/thread.h
 build_sources_headers main/common/enumeration/control.h main/common/enumeration/entry.h main/common/enumeration/instance.h main/common/enumeration/program.h main/common/enumeration/rule.h main/common/enumeration/thread.h
 build_sources_headers main/common/string/general.h main/common/string/rule.h
-build_sources_headers main/common/type/cache.h main/common/type/control.h main/common/type/entry.h main/common/type/global.h main/common/type/lock.h main/common/type/instance.h main/common/type/program.h main/common/type/rule.h main/common/type/thread.h
+build_sources_headers main/common/type/cache.h main/common/type/control.h main/common/type/entry.h main/common/type/execute.h main/common/type/global.h main/common/type/lock.h main/common/type/instance.h main/common/type/program.h main/common/type/rule.h main/common/type/thread.h
 build_sources_headers main/instance.h main/path.h
 build_sources_headers main/rule.h main/rule/action.h main/rule/execute.h main/rule/expand.h main/rule/instance.h main/rule/is.h main/rule/item.h main/rule/parameter.h main/rule/read.h main/rule/setting.h main/rule/validate.h main/rule/wait.h
 build_sources_headers main/print/data.h main/print/debug.h main/print/error.h main/print/lock.h main/print/message.h main/print/rule.h main/print/verbose.h main/print/warning.h
index 94f9f4f8ea79f993cd9adca1927c69673ea262cb..7ee611b5d49ebc2a518a9db2e1fd1279b32898d5 100644 (file)
@@ -7,21 +7,34 @@ extern "C" {
 #ifndef _di_controller_f_a_
   const f_string_t controller_f_a[] = {
     "controller_rule_actions_increase_by",
+    "controller_rule_copy",
+    "controller_rule_items_increase_by",
     "controller_path_canonical_relative",
+    "controller_pids_increase",
     "f_console_parameter_process",
+    "f_environment_get_all",
     "f_fss_apply_delimit",
     "f_fss_count_lines",
     "f_memory_array_increase",
+    "f_memory_array_increase_by",
     "f_path_current",
     "f_rip_dynamic_partial",
+    "f_rip_dynamic_partial_nulless",
     "f_string_append_assure",
     "f_string_dynamic_append",
+    "f_string_dynamic_append_nulless",
+    "f_string_dynamic_partial_append",
     "f_string_dynamic_partial_append_nulless",
     "f_string_dynamic_partial_mash_nulless",
+    "f_string_maps_append",
     "f_thread_create",
     "fl_conversion_dynamic_partial_to_signed_detect",
+    "fl_environment_load_names",
     "fl_fss_extended_list_content_read",
+    "fl_fss_extended_list_object_read",
     "fl_iki_read",
+    "fll_execute_program",
+    "fll_fss_basic_list_read",
     "fll_fss_extended_read",
     "fll_fss_extended_content_read",
     "fll_fss_extended_list_content_read",
index dd5543dec82168863b37d52e62fc76b0a642ca1e..91c2f55e4c7fc3569cb23d1c23c4686beb8d2a17 100644 (file)
@@ -40,21 +40,34 @@ extern "C" {
 #ifndef _di_controller_f_e_
   enum {
     controller_f_controller_rule_actions_increase_by_e,
+    controller_f_controller_rule_copy_e,
+    controller_f_controller_rule_items_increase_by_e,
     controller_f_controller_path_canonical_relative_e,
+    controller_f_controller_pids_increase_e,
     controller_f_f_console_parameter_process_e,
+    controller_f_f_environment_get_all_e,
     controller_f_f_fss_apply_delimit_e,
     controller_f_f_fss_count_lines_e,
     controller_f_f_memory_array_increase_e,
+    controller_f_f_memory_array_increase_by_e,
     controller_f_f_path_current_e,
     controller_f_f_rip_dynamic_partial_e,
+    controller_f_f_rip_dynamic_partial_nulless_e,
     controller_f_f_string_append_assure_e,
     controller_f_f_string_dynamic_append_e,
+    controller_f_f_string_dynamic_append_nulless_e,
+    controller_f_f_string_dynamic_partial_append_e,
     controller_f_f_string_dynamic_partial_append_nulless_e,
     controller_f_f_string_dynamic_partial_mash_nulless_e,
+    controller_f_f_string_maps_append_e,
     controller_f_f_thread_create_e,
     controller_f_fl_conversion_dynamic_partial_to_signed_detect_e,
+    controller_f_fl_environment_load_names_e,
     controller_f_fl_fss_extended_list_content_read_e,
+    controller_f_fl_fss_extended_list_object_read_e,
     controller_f_fl_iki_read_e,
+    controller_f_fll_execute_program_e,
+    controller_f_fll_fss_basic_list_read_e,
     controller_f_fll_fss_extended_read_e,
     controller_f_fll_fss_extended_content_read_e,
     controller_f_fll_fss_extended_list_content_read_e,
index d495e7d986646487b94fd7b03575ba2ab9051c14..98d3ba552d827b841f931b9d9c76de2f9944a89e 100644 (file)
@@ -28,7 +28,7 @@ extern "C" {
     f_memory_arrays_resize(0, sizeof(f_ranges_t), (void **) &cache->content_actions.array, &cache->content_actions.used, &cache->content_actions.size, &f_rangess_delete_callback);
     f_memory_arrays_resize(0, sizeof(f_ranges_t), (void **) &cache->content_items.array, &cache->content_items.used, &cache->content_items.size, &f_rangess_delete_callback);
 
-    controller_cache_action_delete_simple(&cache->action);
+    controller_cache_action_delete(&cache->action);
   }
 #endif // _di_controller_cache_delete_
 
diff --git a/sources/c/main/common/type/execute.c b/sources/c/main/common/type/execute.c
new file mode 100644 (file)
index 0000000..1362473
--- /dev/null
@@ -0,0 +1,9 @@
+#include "../../controller.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/sources/c/main/common/type/execute.h b/sources/c/main/common/type/execute.h
new file mode 100644 (file)
index 0000000..27720a6
--- /dev/null
@@ -0,0 +1,46 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: Controller
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common execute type structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _controller_main_common_type_execute_h
+#define _controller_main_common_type_execute_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * A structure for passing execution arguments to the execute functions.
+ *
+ * parameter: All parameters sent to the program on execution.
+ * as:        All special properties to apply, such as cpu affinity.
+ */
+#ifndef _di_controller_execute_set_t_
+  typedef struct {
+    fl_execute_parameter_t parameter;
+    fl_execute_as_t as;
+  } controller_execute_set_t;
+
+  #define controller_execute_set_t_initialize_1 { \
+    fl_execute_parameter_t_initialize, \
+    fl_execute_as_t_initialize \
+  }
+
+  #define macro_controller_execute_set_t_initialize_1(option, wait, environment, signals, main, as) { \
+    macro_fl_execute_parameter_t_initialize_1(option, wait, environment, signals, main), \
+    as, \
+  }
+#endif // _di_controller_execute_set_t_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _controller_main_common_type_execute_h
index 40a868c1414a1889d24edb2f4838e222f0d3cbd5..3882982265740bde38e58a3c19fe8894e2e31ebf 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
     f_thread_mutex_delete(&lock->cancel);
     f_thread_mutex_delete(&lock->print);
 
-    f_thread_lock_delete(&lock->process);
+    f_thread_lock_delete(&lock->instance);
     f_thread_lock_delete(&lock->rule);
 
     f_thread_condition_delete(&lock->alert_condition);
@@ -20,7 +20,7 @@ extern "C" {
     memset(&lock->cancel, 0, sizeof(f_thread_mutex_t));
     memset(&lock->print, 0, sizeof(f_thread_mutex_t));
 
-    memset(&lock->process, 0, sizeof(f_thread_lock_t));
+    memset(&lock->instance, 0, sizeof(f_thread_lock_t));
     memset(&lock->rule, 0, sizeof(f_thread_lock_t));
 
     memset(&lock->alert_condition, 0, sizeof(f_thread_condition_t));
index 2516436cf9b72cf34b6a211e183ce1d9ac2db717..0cc50add49cf960f8393cf6e270cb47d7c5fb6c1 100644 (file)
@@ -29,8 +29,8 @@ extern "C" {
       f_capability_delete(&rule->capability);
     }
 
-    controller_rule_ons_delete(&rule->ons);
-    controller_rule_items_delete(&rule->items);
+    f_memory_arrays_resize(0, sizeof(controller_rule_on_t), (void **) &rule->ons.array, &rule->ons.used, &rule->ons.size, &controller_rule_ons_delete_callback);
+    f_memory_arrays_resize(0, sizeof(controller_rule_item_t), (void **) &rule->items.array, &rule->items.used, &rule->items.size, &controller_rule_items_delete_callback);
   }
 #endif // _di_controller_rule_delete_
 
@@ -45,20 +45,20 @@ extern "C" {
   }
 #endif // _di_controller_rule_action_delete_
 
-#ifndef _di_controller_rule_actions_delete_
-  void controller_rule_actions_delete(controller_rule_actions_t * const actions) {
+#ifndef _di_controller_rule_actions_delete_callback_
+  f_status_t controller_rule_actions_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-    if (!actions) return;
+    {
+      controller_rule_action_t * const controller_rule_actions = (controller_rule_action_t *) void_array;
 
-    actions->used = actions->size;
-
-    while (actions->used) {
-      controller_rule_action_delete(&actions->array[--actions->used]);
-    } // while
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+        controller_rule_action_delete(&controller_rule_actions[i]);
+      } // for
+    }
 
-    f_memory_array_resize(0, sizeof(controller_rule_action_t), (void **) &actions->array, &actions->used, &actions->size);
+    return F_okay;
   }
-#endif // _di_controller_rule_actions_delete_
+#endif // _di_controller_rule_actions_delete_callback_
 
 #ifndef _di_controller_rule_item_delete_
   void controller_rule_item_delete(controller_rule_item_t * const item) {
@@ -66,25 +66,24 @@ extern "C" {
     if (!item) return;
 
     f_memory_array_resize(0, sizeof(f_char_t), (void **) &item->pid_file.string, &item->pid_file.used, &item->pid_file.size);
-
-    controller_rule_actions_delete(&item->actions);
+    f_memory_arrays_resize(0, sizeof(controller_rule_action_t), (void **) &item->actions.array, &item->actions.used, &item->actions.size, &controller_rule_actions_delete_callback);
   }
 #endif // _di_controller_rule_item_delete_
 
-#ifndef _di_controller_rule_items_delete_
-  void controller_rule_items_delete(controller_rule_items_t * const items) {
-
-    if (!items) return;
+#ifndef _di_controller_rule_items_delete_callback_
+  f_status_t controller_rule_items_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-    items->used = items->size;
+    {
+      controller_rule_item_t * const controller_rule_items = (controller_rule_item_t *) void_array;
 
-    while (items->used) {
-      controller_rule_item_delete(&items->array[--items->used]);
-    } // while
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+        controller_rule_item_delete(&controller_rule_items[i]);
+      } // for
+    }
 
-    f_memory_array_resize(0, sizeof(controller_rule_item_t), (void **) &items->array, &items->used, &items->size);
+    return F_okay;
   }
-#endif // _di_controller_rule_items_delete_
+#endif // _di_controller_rule_items_delete_callback_
 
 #ifndef _di_controller_rule_on_delete_
   void controller_rule_on_delete(controller_rule_on_t * const on) {
@@ -97,20 +96,20 @@ extern "C" {
   }
 #endif // _di_controller_rule_on_delete_
 
-#ifndef _di_controller_rule_ons_delete_
-  void controller_rule_ons_delete(controller_rule_ons_t * const ons) {
-
-    if (!ons) return;
+#ifndef _di_controller_rule_ons_delete_callback_
+  f_status_t controller_rule_ons_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const void_array) {
 
-    ons->used = ons->size;
+    {
+      controller_rule_on_t * const controller_rule_ons = (controller_rule_on_t *) void_array;
 
-    while (ons->used) {
-      controller_rule_on_delete(&ons->array[--ons->used]);
-    } // while
+      for (f_number_unsigned_t i = start; i < stop; ++i) {
+        controller_rule_on_delete(&controller_rule_ons[i]);
+      } // for
+    }
 
-    f_memory_array_resize(0, sizeof(controller_rule_on_t), (void **) &ons->array, &ons->used, &ons->size);
+    return F_okay;
   }
-#endif // _di_controller_rule_ons_delete_
+#endif // _di_controller_rule_ons_delete_callback_
 
 #ifndef _di_controller_rules_delete_
   void controller_rules_delete(controller_rules_t * const rules) {
index f4ae5a160680aca4e60256c831ed36e02e700190..7ca3b9fae3378fc0b8c4f7cf3e8948367e46406a 100644 (file)
@@ -371,9 +371,6 @@ extern "C" {
  * @param rule
  *   The rule to deallocate.
  *
- * @see controller_rule_items_delete()
- * @see controller_rule_ons_delete()
- *
  * @see f_capability_delete()
  * @see f_memory_array_resize()
  * @see f_memory_arrays_resize()
@@ -396,18 +393,30 @@ extern "C" {
 #endif // _di_controller_rule_action_delete_
 
 /**
- * Delete the Controller Rule Actions data.
+ * A callback intended to be passed to f_memory_arrays_resize() for an controller_rule_actions_t structure.
  *
- * @param actions
- *   The Rule Actions data.
+ * This is only called when shrinking the array and generally should perform de-allocations.
  *
- * @see controller_rule_action_delete()
+ * This does not do parameter checking.
  *
- * @see f_memory_array_resize()
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
+ *
+ * @return
+ *   F_okay on success.
+ *
+ *   F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see controller_rule_action_delete()
  */
-#ifndef _di_controller_rule_actions_delete_
-  extern void controller_rule_actions_delete(controller_rule_actions_t * const actions);
-#endif // _di_controller_rule_actions_delete_
+#ifndef _di_controller_rule_actions_delete_callback_
+  extern f_status_t controller_rule_actions_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_controller_rule_actions_delete_callback_
 
 /**
  * Delete the Controller Rule Item data.
@@ -422,20 +431,31 @@ extern "C" {
 #ifndef _di_controller_rule_item_delete_
   extern void controller_rule_item_delete(controller_rule_item_t * const item);
 #endif // _di_controller_rule_item_delete_
-
 /**
- * Delete the Controller Rule Items data.
+ * A callback intended to be passed to f_memory_arrays_resize() for an controller_rule_items_t structure.
  *
- * @param items
- *   The Rule Items data.
+ * This is only called when shrinking the array and generally should perform de-allocations.
  *
- * @see controller_rule_item_delete()
+ * This does not do parameter checking.
  *
- * @see f_memory_array_resize()
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
+ *
+ * @return
+ *   F_okay on success.
+ *
+ *   F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see controller_rule_item_delete()
  */
-#ifndef _di_controller_rule_items_delete_
-  extern void controller_rule_items_delete(controller_rule_items_t * const items);
-#endif // _di_controller_rule_items_delete_
+#ifndef _di_controller_rule_items_delete_callback_
+  extern f_status_t controller_rule_items_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_controller_rule_items_delete_callback_
 
 /**
  * Delete the Controller Rule "on" data.
@@ -450,18 +470,30 @@ extern "C" {
 #endif // _di_controller_rule_on_delete_
 
 /**
- * Delete the Controller Rule "ons" data.
+ * A callback intended to be passed to f_memory_arrays_resize() for an controller_rule_ons_t structure.
  *
- * @param ons
- *   The Rule "ons" data.
+ * This is only called when shrinking the array and generally should perform de-allocations.
  *
- * @see controller_rule_on_delete()
+ * This does not do parameter checking.
  *
- * @see f_memory_delete()
+ * @param start
+ *   The inclusive start position in the array to start deleting.
+ * @param stop
+ *   The exclusive stop position in the array to stop deleting.
+ * @param array
+ *   The array structure to delete all values of.
+ *   Must not be NULL.
+ *
+ * @return
+ *   F_okay on success.
+ *
+ *   F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see controller_rule_on_delete()
  */
-#ifndef _di_controller_rule_ons_delete_
-  extern void controller_rule_ons_delete(controller_rule_ons_t * const ons);
-#endif // _di_controller_rule_ons_delete_
+#ifndef _di_controller_rule_ons_delete_callback_
+  extern f_status_t controller_rule_ons_delete_callback(const f_number_unsigned_t start, const f_number_unsigned_t stop, void * const array);
+#endif // _di_controller_rule_ons_delete_callback_
 
 /**
  * Delete the Controller Rules data.
index ab28a4cfd8272ac2da04dd6268ed6d01fa6f5d26..776e1baca6bb6d1b217334ba6a6a43905a8e9804 100644 (file)
@@ -52,6 +52,7 @@
 
 // FLL-1 includes.
 #include <fll/level_1/conversion.h>
+#include <fll/level_1/execute.h>
 #include <fll/level_1/path.h>
 #include <fll/level_1/print.h>
 
@@ -80,6 +81,7 @@
 #include <program/controller/main/common/type/cache.h>
 #include <program/controller/main/common/type/control.h>
 #include <program/controller/main/common/type/entry.h>
+#include <program/controller/main/common/type/execute.h>
 #include <program/controller/main/common/type/lock.h>
 #include <program/controller/main/common/type/rule.h>
 #include <program/controller/main/common/type/program.h>
index 5bc6c206a9dddbd5db220ec26e13f6684c18e897..f23c97542b55346d6f1a1421f981977e0ad1d4a7 100644 (file)
@@ -32,6 +32,18 @@ extern "C" {
   }
 #endif // _di_controller_main_print_error_file_
 
+#ifndef _di_controller_main_print_error_file_status_
+  f_status_t controller_main_print_error_file_status(fl_print_t * const print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, const f_status_t status) {
+
+    if (!print) return F_status_set_error(F_output_not);
+    if (print->verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    fll_error_file_print(print, status, function, fll_error_file_flag_fallback_e, name, operation, type);
+
+    return F_okay;
+  }
+#endif // _di_controller_main_print_error_file_status_
+
 #ifndef _di_controller_main_print_error_status_
   f_status_t controller_main_print_error_status(fl_print_t * const print, const f_string_t function, const f_status_t status) {
 
index 71e866532304aa16a0fded80a44e964b039778ff..c4dc0576ea7244ce9aebd2d6c657b617b54e832b 100644 (file)
@@ -72,6 +72,40 @@ extern "C" {
 #endif // _di_controller_main_print_error_file_
 
 /**
+ * Print file related error or warning messages.
+ *
+ * @param print
+ *   The output structure to print to.
+ *   Must not be NULL.
+ *
+ *   The print.custom is expected to be of type fss_read_main_t.
+ *
+ *   This does not alter print.custom.setting.state.status.
+ * @param function
+ *   The name of the function where the error happened.
+ *   Set to 0 to disable.
+ * @param name
+ *   The name of the file or directory.
+ * @param operation
+ *   The operation that fails, such as 'create' or 'access'.
+ * @param type
+ *   A valid file type code from the fll_error_file_type enum.
+ * @param status
+ *   The status code to print an error message about.
+ *
+ * @return
+ *   F_okay on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if a parameter is NULL.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_controller_main_print_error_file_status_
+  extern f_status_t controller_main_print_error_file_status(fl_print_t * const print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type, const f_status_t status);
+#endif // _di_controller_main_print_error_file_status_
+
+/**
  * Print generic error message regarding a function failing in some way.
  *
  * @param print
index a0a7abef68b7fddc7f63ad6b2797a0a415836f83..899b55a35aff8950604bee5b768c30431c9c23a8 100644 (file)
@@ -90,7 +90,7 @@ extern "C" {
 
     if (source.ons.used) {
       if (destination->ons.used < source.ons.used) {
-        status = controller_rule_ons_resize(source.ons.used, &destination->ons);
+        status = f_memory_array_resize(source.ons.used, sizeof(controller_rule_on_t), (void **) &destination->ons.array, &destination->ons.used, &destination->ons.size);
         if (F_status_is_error(status)) return status;
       }
 
@@ -149,7 +149,7 @@ extern "C" {
       controller_rule_action_t *action_destination = 0;
 
       if (source.items.used > destination->items.size) {
-        status = controller_rule_items_increase_by(source.items.used - destination->items.size, &destination->items);
+        status = f_memory_arrays_resize(source.items.used, sizeof(controller_rule_item_t), (void **) &destination->items.array, &destination->items.used, &destination->items.size, &controller_rule_items_delete_callback);
         if (F_status_is_error(status)) return status;
       }
 
@@ -161,7 +161,7 @@ extern "C" {
         item_destination = &destination->items.array[i];
 
         if (item_source->actions.used > item_destination->actions.size) {
-          status = controller_rule_actions_increase_by(item_source->actions.used - item_destination->actions.size, &item_destination->actions);
+          status = f_memory_arrays_resize(item_source->actions.used, sizeof(controller_rule_action_t), (void **) &item_destination->actions.array, &item_destination->actions.used, &item_destination->actions.size, &controller_rule_actions_delete_callback);
           if (F_status_is_error(status)) return status;
         }
 
@@ -237,14 +237,12 @@ extern "C" {
 
     if (!global || !global->main || !global->thread) return F_status_set_error(F_parameter);
 
-    f_status_t status = F_okay;
-
     alias->used = 0;
 
-    status = f_string_dynamic_partial_append_nulless(source, directory, alias);
+    f_status_t status = f_string_dynamic_partial_append_nulless(source, directory, alias);
 
     if (F_status_is_error(status)) {
-      controller_main_print_error(&main->program.error, macro_controller_f(f_string_dynamic_partial_append_nulless));
+      controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_dynamic_partial_append_nulless), F_status_set_fine(status));
 
       return status;
     }
@@ -252,7 +250,7 @@ extern "C" {
     status = f_string_dynamic_append(f_path_separator_s, alias);
 
     if (F_status_is_error(status)) {
-      controller_main_print_error(&main->program.error, macro_controller_f(f_string_dynamic_append));
+      controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_dynamic_append), F_status_set_fine(status));
 
       return status;
     }
@@ -260,7 +258,7 @@ extern "C" {
     status = f_string_dynamic_partial_append_nulless(source, basename, alias);
 
     if (F_status_is_error(status)) {
-      controller_main_print_error(&main->program.error, macro_controller_f(f_string_dynamic_partial_append_nulless));
+      controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_dynamic_partial_append_nulless), F_status_set_fine(status));
 
       return status;
     }
index 52b0d192cd3206cee2c5d36b9feae2b636be8c27..c1b9059afdcd88e46f2e87af5c0777c976e49e35 100644 (file)
@@ -7,8 +7,8 @@ extern "C" {
 #ifndef _di_controller_rule_action_method_name_
   f_string_static_t controller_rule_action_method_name(const uint8_t type) {
 
-    if (type == controller_rule_action_method_extended_e) return controller_rule_action_method_string_extended_s;
-    if (type == controller_rule_action_method_extended_list_e) return controller_rule_action_method_string_extended_list_s;
+    if (type == controller_rule_action_method_extended_e) return controller_rule_action_method_extended_s;
+    if (type == controller_rule_action_method_extended_list_e) return controller_rule_action_method_extended_list_s;
 
     return f_string_empty_s;
   }
@@ -38,8 +38,8 @@ extern "C" {
 
     f_status_t status = F_okay;
 
-    controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize_1(is_normal, global->thread);
-    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_okay, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+    controller_interrupt_t custom = macro_controller_interrupt_t_initialize_1(is_normal, global->thread);
+    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_number_unsigned_t i = 0;
 
@@ -85,7 +85,7 @@ extern "C" {
         if (item->type == controller_rule_item_type_script_e || item->type == controller_rule_item_type_utility_e) {
           actions->array[actions->used].parameters.used = 0;
 
-          status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &actions->array[actions->used].parameters.array, &actions->array[actions->used].parameters.used, &actions->array[actions->used].parameters.size);
+          status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &actions->array[actions->used].parameters.array, &actions->array[actions->used].parameters.used, &actions->array[actions->used].parameters.size);
 
           if (F_status_is_error(status)) {
             controller_main_print_error(&global->main->program.error, macro_controller_f(f_memory_array_increase));
@@ -93,7 +93,7 @@ extern "C" {
             return status;
           }
 
-          status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_iki_data_t), (void **) &actions->array[actions->used].ikis.array, &actions->array[actions->used].ikis.used, &actions->array[actions->used].ikis.size);
+          status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_iki_data_t), (void **) &actions->array[actions->used].ikis.array, &actions->array[actions->used].ikis.used, &actions->array[actions->used].ikis.size);
 
           if (F_status_is_error(status)) {
             controller_main_print_error(&global->main->program.error, macro_controller_f(f_memory_array_increase));
@@ -160,7 +160,7 @@ extern "C" {
 
         for (i = 0; i < cache->object_actions.used; ++i) {
 
-          status = controller_rule_actions_increase_by(controller_common_allocation_small_d, actions);
+          status = controller_rule_actions_increase_by(controller_allocation_small_d, actions);
 
           if (F_status_is_error(status)) {
             controller_main_print_error(&global->main->program.error, macro_controller_f(controller_rule_actions_increase_by));
@@ -321,7 +321,7 @@ extern "C" {
           } // for
         }
         else if (item->type == controller_rule_item_type_script_e || item->type == controller_rule_item_type_utility_e) {
-          status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &actions->array[actions->used].parameters.array, &actions->array[actions->used].parameters.used, &actions->array[actions->used].parameters.size);
+          status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &actions->array[actions->used].parameters.array, &actions->array[actions->used].parameters.used, &actions->array[actions->used].parameters.size);
 
           if (F_status_is_error(status)) {
             controller_main_print_error(&global->main->program.error, macro_controller_f(f_memory_array_increase));
@@ -329,7 +329,7 @@ extern "C" {
             return status;
           }
 
-          status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_iki_data_t), (void **) &actions->array[actions->used].ikis.array, &actions->array[actions->used].ikis.used, &actions->array[actions->used].ikis.size);
+          status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_iki_data_t), (void **) &actions->array[actions->used].ikis.array, &actions->array[actions->used].ikis.used, &actions->array[actions->used].ikis.size);
 
           if (F_status_is_error(status)) {
             controller_main_print_error(&global->main->program.error, macro_controller_f(f_memory_array_increase));
index 0de8ba2b0f5ed077c7d15bf910f81625beaa5191..41b9e82ecdba635eff0d8ac0dd8710bc9c2a12d6 100644 (file)
@@ -41,7 +41,7 @@ extern "C" {
         status = fll_control_group_prepare(process->rule.cgroup);
 
         if (F_status_is_error(status)) {
-          controller_print_error_file(global->thread, &global->main->program.error, F_status_set_fine(status), "fll_control_group_prepare", F_true, process->rule.cgroup.path, controller_rule_print_control_groups_prepare_s, fll_error_file_type_directory_e);
+          controller_main_print_error_file(&main->program.error, macro_controller_f(fll_control_group_prepare), process->rule.cgroup.path, controller_rule_print_control_groups_prepare_s, fll_error_file_type_directory_e);
 
           return status;
         }
@@ -76,7 +76,7 @@ extern "C" {
       status = fl_environment_load_names(process->rule.environment, &environment);
 
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "fl_environment_load_names", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(fl_environment_load_names), F_status_set_fine(status));
 
         return status;
       }
@@ -107,7 +107,7 @@ extern "C" {
                   status = f_string_dynamic_append(entry->define.array[i].value, &environment.array[k].value);
 
                   if (F_status_is_error(status)) {
-                    controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
+                    controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_dynamic_append), F_status_set_fine(status));
 
                     return status;
                   }
@@ -120,7 +120,7 @@ extern "C" {
                 status = f_string_maps_append(entry->define.array[i], &environment);
 
                 if (F_status_is_error(status)) {
-                  controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true);
+                  controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_maps_append), F_status_set_fine(status));
 
                   return status;
                 }
@@ -148,7 +148,7 @@ extern "C" {
                 status = f_string_dynamic_append(process->rule.define.array[i].value, &environment.array[k].value);
 
                 if (F_status_is_error(status)) {
-                  controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
+                  controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_dynamic_append), F_status_set_fine(status));
 
                   return status;
                 }
@@ -161,7 +161,7 @@ extern "C" {
               status = f_string_maps_append(process->rule.define.array[i], &environment);
 
               if (F_status_is_error(status)) {
-                controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true);
+                controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_maps_append), F_status_set_fine(status));
 
                 return status;
               }
@@ -189,7 +189,7 @@ extern "C" {
         status = f_environment_get_all(&environment);
 
         if (F_status_is_error(status)) {
-          controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_environment_get_all", F_true);
+          controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_environment_get_all), F_status_set_fine(status));
 
           return status;
         }
@@ -199,7 +199,7 @@ extern "C" {
           status = f_string_maps_append(entry->define.array[i], &environment);
 
           if (F_status_is_error(status)) {
-            controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true);
+            controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_maps_append), F_status_set_fine(status));
 
             return status;
           }
@@ -210,7 +210,7 @@ extern "C" {
           status = f_string_maps_append(process->rule.define.array[i], &environment);
 
           if (F_status_is_error(status)) {
-            controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_string_maps_append", F_true);
+            controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_maps_append), F_status_set_fine(status));
 
             return status;
           }
@@ -471,7 +471,7 @@ extern "C" {
     status = controller_pids_increase(&process->childs);
 
     if (F_status_is_error(status)) {
-      controller_print_error(thread, &global->main->program.error, F_status_set_fine(status), "controller_pids_increase", F_true);
+      controller_main_print_error_status(&global->main->program.error, macro_controller_f(controller_pids_increase), F_status_set_fine(status));
 
       return status;
     }
@@ -660,7 +660,7 @@ extern "C" {
         controller_rule_item_print_error_execute(type == controller_rule_item_type_script_e, program.used ? program : arguments.array[0], status, process);
       }
       else {
-        controller_print_error(thread, &global->main->program.error, F_status_set_fine(status), "fll_execute_program", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(fll_execute_program), F_status_set_fine(status));
       }
 
       status = F_status_set_error(status);
@@ -686,15 +686,15 @@ extern "C" {
     status = controller_pids_increase(&process->childs);
 
     if (F_status_is_error(status)) {
-      controller_print_error(thread, &global->main->program.error, F_status_set_fine(status), "controller_pids_increase", F_true);
+      controller_main_print_error_status(&global->main->program.error, macro_controller_f(controller_pids_increase), F_status_set_fine(status));
 
       return status;
     }
 
-    status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &process->path_pids.array, &process->path_pids.used, &process->path_pids.size);
+    status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &process->path_pids.array, &process->path_pids.used, &process->path_pids.size);
 
     if (F_status_is_error(status)) {
-      controller_print_error(thread, &global->main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true);
+      controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_memory_array_increase), F_status_set_fine(status));
 
       return status;
     }
@@ -730,22 +730,16 @@ extern "C" {
 
     status = f_file_exists(pid_file, F_true);
 
-    if (F_status_is_error(status)) {
-      controller_print_error_file(thread, &global->main->program.error, F_status_set_fine(status), "f_file_exists", F_true, pid_file, f_file_operation_find_s, fll_error_file_type_file_e);
+    if (F_status_is_error(status) || status == F_true) {
+      controller_main_print_error_file_status(&global->main->program.error, macro_controller_f(f_file_exists), status == F_true ? F_file_found : F_status_set_fine(status), pid_file, f_file_operation_find_s, fll_error_file_type_file_e);
 
       return status;
     }
 
-    if (status == F_true) {
-      controller_print_error_file(thread, &global->main->program.error, F_file_found, "f_file_exists", F_true, pid_file, f_file_operation_find_s, fll_error_file_type_file_e);
-
-      return F_status_set_error(F_file_found);
-    }
-
     status = f_string_dynamic_append_nulless(pid_file, child_pid_file);
 
     if (F_status_is_error(status)) {
-      controller_print_error(thread, &global->main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
+      controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_dynamic_append_nulless), F_status_set_fine(status));
 
       return status;
     }
@@ -919,7 +913,7 @@ extern "C" {
         controller_rule_item_print_error_execute(type == controller_rule_item_type_utility_e, program.used ? program : arguments.array[0], status, process);
       }
       else {
-        controller_print_error(thread, &global->main->program.error, F_status_set_fine(status), "fll_execute_program", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(fll_execute_program), F_status_set_fine(status));
       }
 
       return F_status_set_error(status);
index dbc6ef2392c736688b90c43c3fced45391b5ad3f..e76d144cbbf0e8aac79c647eec4d5a22633c44bb 100644 (file)
@@ -32,7 +32,7 @@ extern "C" {
         iki_data = &action.ikis.array[process->cache.expanded.used];
 
         // Allocate enough room plus an extra buffer to help reduce reallocations.
-        status = f_memory_array_increase_by(action.parameters.array[process->cache.expanded.used].used + controller_common_allocation_large_d, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size);
+        status = f_memory_array_increase_by(action.parameters.array[process->cache.expanded.used].used + controller_allocation_large_d, sizeof(f_char_t), (void **) &buffer->string, &buffer->used, &buffer->size);
 
         // Apply the IKI delimits.
         for (i = 0; i < iki_data->delimits.used; ++i) {
index e39a35c17300b0f20183c5b321b070920cd38b9b..da398d05f56735e828ba472f3008fe6147f02530 100644 (file)
@@ -705,7 +705,7 @@ extern "C" {
       }
 
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_memory_array_resize", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_memory_array_resize), F_status_set_fine(status));
       }
       else {
         for (f_number_unsigned_t i = 0; i < stack.used; ++i) {
@@ -727,7 +727,7 @@ extern "C" {
         status = f_string_dynamic_append(cache.action.name_item, &instance->cache.action.name_item);
       }
       else {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_dynamic_append), F_status_set_fine(status));
       }
     }
 
@@ -743,7 +743,7 @@ extern "C" {
         }
 
         if (F_status_is_error(status)) {
-          controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_thread_create", F_true);
+          controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_thread_create), F_status_set_fine(status));
         }
       }
       else {
@@ -886,7 +886,7 @@ extern "C" {
       f_thread_unlock(&global->thread->lock.rule);
 
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "controller_rule_copy", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(controller_rule_copy), F_status_set_fine(status));
       }
       else if (!instance->action) {
 
@@ -933,10 +933,10 @@ extern "C" {
         }
 
         if (F_status_is_error_not(status)) {
-          status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &instance->stack.array, &instance->stack.used, &instance->stack.size);
+          status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_number_unsigned_t), (void **) &instance->stack.array, &instance->stack.used, &instance->stack.size);
 
           if (F_status_is_error(status)) {
-            controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_memory_array_increase", F_true);
+            controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_memory_array_increase), F_status_set_fine(status));
           }
           else {
             f_thread_unlock(&instance->lock);
index 59bd3c66cae1995934f4c9252de99dc734a9cb01..dbbbe18642b30267c50a6f0f2aa338564f24f8c6 100644 (file)
@@ -10,8 +10,8 @@ extern "C" {
     if (!global || !cache || !item) return F_status_set_error(F_parameter);
 
     f_status_t status = F_okay;
-    controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize_1(is_normal, global->thread);
-    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_okay, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+    controller_interrupt_t custom = macro_controller_interrupt_t_initialize_1(is_normal, global->thread);
+    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_item.used);
     f_number_unsigned_t last = 0;
 
@@ -26,7 +26,7 @@ extern "C" {
       fl_fss_extended_list_object_read(cache->buffer_item, &range, &cache->range_action, &cache->delimits, &state);
 
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "fl_fss_extended_list_object_read", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(fl_fss_extended_list_object_read), F_status_set_fine(status));
 
         break;
       }
@@ -43,7 +43,7 @@ extern "C" {
         fl_fss_extended_object_read(cache->buffer_item, &range, &cache->range_action, 0, &cache->delimits, &state);
 
         if (F_status_is_error(status)) {
-          controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "fl_fss_extended_object_read", F_true);
+          controller_main_print_error_status(&global->main->program.error, macro_controller_f(fl_fss_extended_object_read), F_status_set_fine(status));
 
           break;
         }
@@ -55,7 +55,7 @@ extern "C" {
       f_fss_apply_delimit(cache->delimits, &cache->buffer_item, &state);
 
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_fss_apply_delimit), F_status_set_fine(status));
 
         break;
       }
@@ -63,7 +63,7 @@ extern "C" {
       f_fss_count_lines(cache->buffer_item, cache->range_action.start, &cache->action.line_action, &state);
 
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_fss_count_lines", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_fss_count_lines), F_status_set_fine(status));
 
         break;
       }
@@ -74,7 +74,7 @@ extern "C" {
       status = f_rip_dynamic_partial_nulless(cache->buffer_item, cache->range_action, &cache->action.name_action);
 
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_rip_dynamic_partial_nulless), F_status_set_fine(status));
 
         break;
       }
@@ -160,10 +160,10 @@ extern "C" {
         method = controller_rule_action_method_extended_e;
       }
 
-      status = controller_rule_actions_increase_by(controller_common_allocation_small_d, &item->actions);
+      status = controller_rule_actions_increase_by(controller_allocation_small_d, &item->actions);
 
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "controller_rule_actions_increase_by", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(controller_rule_actions_increase_by), F_status_set_fine(status));
 
         break;
       }
index e7063476f5f8e4629b37e65247e94c02cabc024b..91d056d492985f9f26c1a08e6bc878327942fe70 100644 (file)
@@ -19,24 +19,20 @@ extern "C" {
         status = f_memory_array_increase_by(content->used + 1, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size);
       }
       else {
-        status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size);
+        status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size);
       }
 
-      if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), content ? "f_memory_array_increase_by" : "f_memory_array_increase", F_true);
-
-        return status;
-      }
-
-      if (content) {
-        status = f_memory_array_increase_by(content->used + 1, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size);
-      }
-      else {
-        status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size);
+      if (F_status_is_error_not(status)) {
+        if (content) {
+          status = f_memory_array_increase_by(content->used + 1, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size);
+        }
+        else {
+          status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size);
+        }
       }
 
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), content ? "f_memory_array_increase_by" : "f_memory_array_increase", F_true);
+        controller_main_print_error_status(&global->main->program.error, content ? macro_controller_f(f_memory_array_increase_by) : macro_controller_f(f_memory_array_increase), F_status_set_fine(status));
 
         return status;
       }
@@ -50,7 +46,7 @@ extern "C" {
       status = f_string_dynamic_partial_append_nulless(buffer, *object, &action->parameters.array[0]);
 
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_dynamic_partial_append_nulless), F_status_set_fine(status));
 
         return status;
       }
@@ -62,16 +58,12 @@ extern "C" {
     if (content && content->used) {
       status = f_memory_array_increase_by(content->used, sizeof(f_string_dynamic_t), (void **) &action->parameters.array, &action->parameters.used, &action->parameters.size);
 
-      if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_memory_array_increase_by", F_true);
-
-        return status;
+      if (F_status_is_error_not(status)) {
+        status = f_memory_array_increase_by(content->used, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size);
       }
 
-      status = f_memory_array_increase_by(content->used, sizeof(f_iki_data_t), (void **) &action->ikis.array, &action->ikis.used, &action->ikis.size);
-
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_memory_array_increase_by", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_memory_array_increase_by), F_status_set_fine(status));
 
         return status;
       }
@@ -91,7 +83,7 @@ extern "C" {
         status = f_string_dynamic_partial_append_nulless(buffer, content->array[i], &action->parameters.array[action->parameters.used]);
 
         if (F_status_is_error(status)) {
-          controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true);
+          controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_dynamic_partial_append_nulless), F_status_set_fine(status));
 
           return status;
         }
@@ -103,7 +95,7 @@ extern "C" {
           fl_iki_read(&action->parameters.array[action->parameters.used], &range, &action->ikis.array[action->ikis.used], state);
 
           if (F_status_is_error(status)) {
-            controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "fl_iki_read", F_true);
+            controller_main_print_error_status(&global->main->program.error, macro_controller_f(fl_iki_read), F_status_set_fine(status));
 
             action->parameters.array[action->parameters.used].used = 0;
 
index c90006b249824b758c89e03af3d8ce7d4c17f47e..a233a8dc1c55361adaf548e372f2f99aec2bbc2b 100644 (file)
@@ -168,7 +168,7 @@ extern "C" {
     status = f_string_dynamic_append_nulless(alias, &rule->alias);
 
     if (F_status_is_error(status)) {
-      controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
+      controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_string_dynamic_append_nulless), F_status_set_fine(status));
     }
     else {
       status = controller_file_load(global, F_true, controller_rules_s, rule->alias, controller_rule_s, cache);
@@ -178,30 +178,32 @@ extern "C" {
       rule->timestamp = cache->timestamp;
 
       if (cache->buffer_file.used) {
-        controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize_1(is_normal, global->thread);
-        f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_okay, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+        controller_interrupt_t custom = macro_controller_interrupt_t_initialize_1(is_normal, global->thread);
+        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);
 
         fll_fss_basic_list_read(cache->buffer_file, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments, &state);
 
         if (F_status_is_error(status)) {
-          controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "fll_fss_basic_list_read", F_true);
+          controller_main_print_error_status(&global->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);
 
           if (F_status_is_error(status)) {
-            controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_fss_apply_delimit", F_true);
+            controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_fss_apply_delimit), F_status_set_fine(status));
           }
         }
       }
     }
 
     if (F_status_is_error_not(status) && cache->object_items.used) {
-      status = controller_rule_items_increase_by(cache->object_items.used, &rule->items);
+      if (rule->items.size < cache->object_items.size) {
+        status = f_memory_arrays_resize(cache->object_items.size, sizeof(controller_rule_item_t), (void **) &&rule->items.array, &rule->items.used, &rule->items.size, &controller_rule_items_delete_callback);
+      }
 
       if (F_status_is_error(status)) {
-        controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "controller_rule_items_increase_by", F_true);
+        controller_main_print_error_status(&global->main->program.error, macro_controller_f(controller_rule_items_increase_by), F_status_set_fine(status));
       }
       else {
         f_number_unsigned_t i = 0;
@@ -239,7 +241,7 @@ extern "C" {
           f_fss_count_lines(cache->buffer_file, cache->object_items.array[i].start, &cache->action.line_item, &global->main->setting.state);
 
           if (F_status_is_error(status)) {
-            controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_fss_count_lines", F_true);
+            controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_fss_count_lines), F_status_set_fine(status));
 
             break;
           }
@@ -249,7 +251,7 @@ extern "C" {
           status = f_rip_dynamic_partial_nulless(cache->buffer_file, cache->object_items.array[i], &cache->action.name_item);
 
           if (F_status_is_error(status)) {
-            controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true);
+            controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_rip_dynamic_partial_nulless), F_status_set_fine(status));
 
             break;
           }
@@ -288,7 +290,7 @@ extern "C" {
           status = f_string_dynamic_partial_append(cache->buffer_file, cache->content_items.array[i].array[0], &cache->buffer_item);
 
           if (F_status_is_error(status)) {
-            controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_string_dynamic_partial_append", F_true);
+            controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_rip_dynamic_partial_nulless), F_status_set_fine(status));
 
             break;
           }
index 7802ce31919e379a8c0eec91c1e62690c3993c3d..d7086a083fe78a9d19209bf2d31e7baa9613d6e0 100644 (file)
@@ -15,8 +15,8 @@ extern "C" {
     f_range_t range = macro_f_range_t_initialize_2(cache->buffer_item.used);
     f_range_t range2 = f_range_t_initialize;
 
-    controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize_1(is_normal, global->thread);
-    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_okay, 0, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+    controller_interrupt_t custom = macro_controller_interrupt_t_initialize_1(is_normal, global->thread);
+    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);
 
     fll_fss_extended_read(cache->buffer_item, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0, &state);
 
@@ -223,7 +223,7 @@ extern "C" {
 
         for (j = 0; j < cache->content_actions.array[i].used; ++j, number = 0) {
 
-          status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(int32_t), (void **) &rule->affinity.array, &rule->affinity.used, &rule->affinity.size);
+          status = f_memory_array_increase(controller_allocation_small_d, sizeof(int32_t), (void **) &rule->affinity.array, &rule->affinity.used, &rule->affinity.size);
 
           if (F_status_is_error(status)) {
             controller_rule_print_error(global->thread, &global->main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false);
@@ -301,7 +301,7 @@ extern "C" {
           setting_maps = &rule->parameter;
         }
 
-        status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_map_t), (void **) &setting_maps->array, &setting_maps->used, &setting_maps->size);
+        status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_map_t), (void **) &setting_maps->array, &setting_maps->used, &setting_maps->size);
 
         if (F_status_is_error(status)) {
           controller_rule_print_error(global->thread, &global->main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false);
@@ -427,7 +427,7 @@ extern "C" {
 
           for (j = 1; j < cache->content_actions.array[i].used; ++j) {
 
-            status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &rule->cgroup.groups.array, &rule->cgroup.groups.used, &rule->cgroup.groups.size);
+            status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &rule->cgroup.groups.array, &rule->cgroup.groups.used, &rule->cgroup.groups.size);
 
             if (F_status_is_error(status)) {
               controller_rule_print_error(global->thread, &global->main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false);
@@ -595,7 +595,7 @@ extern "C" {
 
         if (F_status_is_error(status)) continue;
 
-        status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_limit_set_t), (void **) &rule->limits.array, &rule->limits.used, &rule->limits.size);
+        status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_limit_set_t), (void **) &rule->limits.array, &rule->limits.used, &rule->limits.size);
 
         if (F_status_is_error(status)) {
           controller_rule_print_error(global->thread, &global->main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false);
@@ -1070,7 +1070,7 @@ extern "C" {
             status = f_rip_dynamic_partial_nulless(cache->buffer_item, cache->content_actions.array[i].array[1], &cache->action.generic);
 
             if (F_status_is_error(status)) {
-              controller_print_error(global->thread, &global->main->program.error, F_status_set_fine(status), "f_rip_dynamic_partial_nulless", F_true);
+              controller_main_print_error_status(&global->main->program.error, macro_controller_f(f_rip_dynamic_partial_nulless), F_status_set_fine(status));
 
               break;
             }
@@ -1324,7 +1324,7 @@ extern "C" {
 
         for (j = 0; j < cache->content_actions.array[i].used; ++j) {
 
-          status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_int32s_t), (void **) &rule->groups.array, &rule->groups.used, &rule->groups.size);
+          status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_int32s_t), (void **) &rule->groups.array, &rule->groups.used, &rule->groups.size);
 
           if (F_status_is_error(status)) {
             controller_rule_print_error(global->thread, &global->main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false);
@@ -1402,7 +1402,7 @@ extern "C" {
 
         for (j = 0; j < cache->content_actions.array[i].used; ++j) {
 
-          status = f_memory_array_increase(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values->array, &setting_values->used, &setting_values->size);
+          status = f_memory_array_increase(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values->array, &setting_values->used, &setting_values->size);
 
           if (F_status_is_error(status)) {
             controller_rule_print_error(global->thread, &global->main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase", F_true, F_false);
@@ -1639,7 +1639,7 @@ extern "C" {
           continue;
         }
 
-        status = f_memory_array_increase_by(controller_common_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values->array, &setting_values->used, &setting_values->size);
+        status = f_memory_array_increase_by(controller_allocation_small_d, sizeof(f_string_dynamic_t), (void **) &setting_values->array, &setting_values->used, &setting_values->size);
 
         if (F_status_is_error(status)) {
           controller_rule_print_error(global->thread, &global->main->program.error, cache->action, F_status_set_fine(status), "f_memory_array_increase_by", F_true, F_false);