]> Kevux Git Server - fll/commitdiff
Feature: The fake program should support the "top" parameter.
authorKevin Day <thekevinday@gmail.com>
Sun, 17 Jul 2022 15:28:46 +0000 (10:28 -0500)
committerKevin Day <thekevinday@gmail.com>
Sun, 17 Jul 2022 15:28:46 +0000 (10:28 -0500)
The "top" is already available but it is not exposed through IKI variable parameter replacement.

Update the documentation, including adding missing documentation about "return".

Remove unused "return:option" and "return:value" parameter (this is not used because it is not valid).

level_3/fake/c/private-common.c
level_3/fake/c/private-common.h
level_3/fake/c/private-make-operate.c
level_3/fake/documents/fakefile.txt
level_3/fake/specifications/fakefile.txt

index bfc5b3d6b0b7257a89ef8172392442c10acdec79..012b53b76ceb0151779d324b38f970a8d84deb79 100644 (file)
@@ -259,6 +259,7 @@ extern "C" {
   const f_string_static_t fake_make_parameter_variable_return_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_return_s, 0, FAKE_make_parameter_variable_return_s_length);
   const f_string_static_t fake_make_parameter_variable_settings_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_settings_s, 0, FAKE_make_parameter_variable_settings_s_length);
   const f_string_static_t fake_make_parameter_variable_sources_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_sources_s, 0, FAKE_make_parameter_variable_sources_s_length);
+  const f_string_static_t fake_make_parameter_variable_top_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_top_s, 0, FAKE_make_parameter_variable_top_s_length);
   const f_string_static_t fake_make_parameter_variable_verbosity_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_verbosity_s, 0, FAKE_make_parameter_variable_verbosity_s_length);
   const f_string_static_t fake_make_parameter_variable_work_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_work_s, 0, FAKE_make_parameter_variable_work_s_length);
 
@@ -269,7 +270,6 @@ extern "C" {
   const f_string_static_t fake_make_parameter_variable_option_fakefile_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_fakefile_s, 0, FAKE_make_parameter_variable_option_fakefile_s_length);
   const f_string_static_t fake_make_parameter_variable_option_mode_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_mode_s, 0, FAKE_make_parameter_variable_option_mode_s_length);
   const f_string_static_t fake_make_parameter_variable_option_process_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_process_s, 0, FAKE_make_parameter_variable_option_process_s_length);
-  const f_string_static_t fake_make_parameter_variable_option_return_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_return_s, 0, FAKE_make_parameter_variable_option_return_s_length);
   const f_string_static_t fake_make_parameter_variable_option_settings_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_settings_s, 0, FAKE_make_parameter_variable_option_settings_s_length);
   const f_string_static_t fake_make_parameter_variable_option_sources_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_sources_s, 0, FAKE_make_parameter_variable_option_sources_s_length);
   const f_string_static_t fake_make_parameter_variable_option_verbosity_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_verbosity_s, 0, FAKE_make_parameter_variable_option_verbosity_s_length);
@@ -282,7 +282,6 @@ extern "C" {
   const f_string_static_t fake_make_parameter_variable_value_fakefile_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_fakefile_s, 0, FAKE_make_parameter_variable_value_fakefile_s_length);
   const f_string_static_t fake_make_parameter_variable_value_mode_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_mode_s, 0, FAKE_make_parameter_variable_value_mode_s_length);
   const f_string_static_t fake_make_parameter_variable_value_process_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_process_s, 0, FAKE_make_parameter_variable_value_process_s_length);
-  const f_string_static_t fake_make_parameter_variable_value_return_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_return_s, 0, FAKE_make_parameter_variable_value_return_s_length);
   const f_string_static_t fake_make_parameter_variable_value_settings_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_settings_s, 0, FAKE_make_parameter_variable_value_settings_s_length);
   const f_string_static_t fake_make_parameter_variable_value_sources_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_sources_s, 0, FAKE_make_parameter_variable_value_sources_s_length);
   const f_string_static_t fake_make_parameter_variable_value_verbosity_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_verbosity_s, 0, FAKE_make_parameter_variable_value_verbosity_s_length);
index 93a314df6e0cb4552c8ce511f8db979aae4dc334..446b6057a5976e0774d050d1d215a6c2403848d0 100644 (file)
@@ -1480,6 +1480,7 @@ extern "C" {
   #define FAKE_make_parameter_variable_return_s    "return"
   #define FAKE_make_parameter_variable_settings_s  "settings"
   #define FAKE_make_parameter_variable_sources_s   "sources"
+  #define FAKE_make_parameter_variable_top_s       "top"
   #define FAKE_make_parameter_variable_verbosity_s "verbosity"
   #define FAKE_make_parameter_variable_work_s      "work"
 
@@ -1490,7 +1491,6 @@ extern "C" {
   #define FAKE_make_parameter_variable_option_fakefile_s  FAKE_make_parameter_variable_fakefile_s FAKE_make_parameter_iki_option_s
   #define FAKE_make_parameter_variable_option_mode_s      FAKE_make_parameter_variable_mode_s FAKE_make_parameter_iki_option_s
   #define FAKE_make_parameter_variable_option_process_s   FAKE_make_parameter_variable_process_s FAKE_make_parameter_iki_option_s
-  #define FAKE_make_parameter_variable_option_return_s    FAKE_make_parameter_variable_return_s FAKE_make_parameter_iki_option_s
   #define FAKE_make_parameter_variable_option_settings_s  FAKE_make_parameter_variable_settings_s FAKE_make_parameter_iki_option_s
   #define FAKE_make_parameter_variable_option_sources_s   FAKE_make_parameter_variable_sources_s FAKE_make_parameter_iki_option_s
   #define FAKE_make_parameter_variable_option_verbosity_s FAKE_make_parameter_variable_verbosity_s FAKE_make_parameter_iki_option_s
@@ -1503,7 +1503,6 @@ extern "C" {
   #define FAKE_make_parameter_variable_value_fakefile_s  FAKE_make_parameter_variable_fakefile_s FAKE_make_parameter_iki_value_s
   #define FAKE_make_parameter_variable_value_mode_s      FAKE_make_parameter_variable_mode_s FAKE_make_parameter_iki_value_s
   #define FAKE_make_parameter_variable_value_process_s   FAKE_make_parameter_variable_process_s FAKE_make_parameter_iki_value_s
-  #define FAKE_make_parameter_variable_value_return_s    FAKE_make_parameter_variable_return_s FAKE_make_parameter_iki_value_s
   #define FAKE_make_parameter_variable_value_settings_s  FAKE_make_parameter_variable_settings_s FAKE_make_parameter_iki_value_s
   #define FAKE_make_parameter_variable_value_sources_s   FAKE_make_parameter_variable_sources_s FAKE_make_parameter_iki_value_s
   #define FAKE_make_parameter_variable_value_verbosity_s FAKE_make_parameter_variable_verbosity_s FAKE_make_parameter_iki_value_s
@@ -1522,6 +1521,7 @@ extern "C" {
   #define FAKE_make_parameter_variable_return_s_length    6
   #define FAKE_make_parameter_variable_settings_s_length  8
   #define FAKE_make_parameter_variable_sources_s_length   7
+  #define FAKE_make_parameter_variable_top_s_length       3
   #define FAKE_make_parameter_variable_verbosity_s_length 9
   #define FAKE_make_parameter_variable_work_s_length      4
 
@@ -1532,7 +1532,6 @@ extern "C" {
   #define FAKE_make_parameter_variable_option_fakefile_s_length  FAKE_make_parameter_variable_fakefile_s_length + FAKE_make_parameter_iki_option_s_length
   #define FAKE_make_parameter_variable_option_mode_s_length      FAKE_make_parameter_variable_mode_s_length + FAKE_make_parameter_iki_option_s_length
   #define FAKE_make_parameter_variable_option_process_s_length   FAKE_make_parameter_variable_process_s_length + FAKE_make_parameter_iki_option_s_length
-  #define FAKE_make_parameter_variable_option_return_s_length    FAKE_make_parameter_variable_return_s_length + FAKE_make_parameter_iki_option_s_length
   #define FAKE_make_parameter_variable_option_settings_s_length  FAKE_make_parameter_variable_settings_s_length + FAKE_make_parameter_iki_option_s_length
   #define FAKE_make_parameter_variable_option_sources_s_length   FAKE_make_parameter_variable_sources_s_length + FAKE_make_parameter_iki_option_s_length
   #define FAKE_make_parameter_variable_option_verbosity_s_length FAKE_make_parameter_variable_verbosity_s_length + FAKE_make_parameter_iki_option_s_length
@@ -1545,7 +1544,6 @@ extern "C" {
   #define FAKE_make_parameter_variable_value_fakefile_s_length  FAKE_make_parameter_variable_fakefile_s_length + FAKE_make_parameter_iki_value_s_length
   #define FAKE_make_parameter_variable_value_mode_s_length      FAKE_make_parameter_variable_mode_s_length + FAKE_make_parameter_iki_value_s_length
   #define FAKE_make_parameter_variable_value_process_s_length   FAKE_make_parameter_variable_process_s_length + FAKE_make_parameter_iki_value_s_length
-  #define FAKE_make_parameter_variable_value_return_s_length    FAKE_make_parameter_variable_return_s_length + FAKE_make_parameter_iki_value_s_length
   #define FAKE_make_parameter_variable_value_settings_s_length  FAKE_make_parameter_variable_settings_s_length + FAKE_make_parameter_iki_value_s_length
   #define FAKE_make_parameter_variable_value_sources_s_length   FAKE_make_parameter_variable_sources_s_length + FAKE_make_parameter_iki_value_s_length
   #define FAKE_make_parameter_variable_value_verbosity_s_length FAKE_make_parameter_variable_verbosity_s_length + FAKE_make_parameter_iki_value_s_length
@@ -1564,6 +1562,7 @@ extern "C" {
   extern const f_string_static_t fake_make_parameter_variable_return_s;
   extern const f_string_static_t fake_make_parameter_variable_settings_s;
   extern const f_string_static_t fake_make_parameter_variable_sources_s;
+  extern const f_string_static_t fake_make_parameter_variable_top_s;
   extern const f_string_static_t fake_make_parameter_variable_verbosity_s;
   extern const f_string_static_t fake_make_parameter_variable_work_s;
 
@@ -1574,7 +1573,6 @@ extern "C" {
   extern const f_string_static_t fake_make_parameter_variable_option_fakefile_s;
   extern const f_string_static_t fake_make_parameter_variable_option_mode_s;
   extern const f_string_static_t fake_make_parameter_variable_option_process_s;
-  extern const f_string_static_t fake_make_parameter_variable_option_return_s;
   extern const f_string_static_t fake_make_parameter_variable_option_settings_s;
   extern const f_string_static_t fake_make_parameter_variable_option_sources_s;
   extern const f_string_static_t fake_make_parameter_variable_option_verbosity_s;
@@ -1587,7 +1585,6 @@ extern "C" {
   extern const f_string_static_t fake_make_parameter_variable_value_fakefile_s;
   extern const f_string_static_t fake_make_parameter_variable_value_mode_s;
   extern const f_string_static_t fake_make_parameter_variable_value_process_s;
-  extern const f_string_static_t fake_make_parameter_variable_value_return_s;
   extern const f_string_static_t fake_make_parameter_variable_value_settings_s;
   extern const f_string_static_t fake_make_parameter_variable_value_sources_s;
   extern const f_string_static_t fake_make_parameter_variable_value_verbosity_s;
index 08abb01412e6b2917f94558018de3646a5d52c4d..edbbf995523f226254f578b2986789bb857de02d 100644 (file)
@@ -364,6 +364,21 @@ extern "C" {
 
               unmatched = F_false;
             }
+            else if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_top_s.string, data_make->buffer, fake_make_parameter_variable_top_s.used, iki_data->content.array[j]) == F_equal_to) {
+              data_make->cache_arguments.array[data_make->cache_arguments.used].used = 0;
+
+              if (data_make->path.stack.used) {
+                *status = f_string_dynamic_append(data_make->path.stack.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]);
+
+                if (F_status_is_error(*status)) {
+                  fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true);
+
+                  break;
+                }
+              }
+
+              unmatched = F_false;
+            }
             else {
               for (k = 0; k < 33; ++k) {
 
index df94521f39ef02509e69e8dd89ecc3a37b5ef957..7096a8fd0c9ccc09fe0c85e41610c839bdb15733 100644 (file)
@@ -318,8 +318,10 @@ Fakefile Documentation:
           - fakefile: Associated with -f/--fakefile parameter.
           - mode: Associated with -m/--mode parameter and possibly with the build settings default mode "modes_default".
           - process: Associated with -p/--process parameter.
+          - return: Contains the return value of a previous operation that produces a return code.
           - settings: Associated with -s/--settings parameter.
           - sources: Associated with -S/--sources parameter.
+          - top: The absolute path to the "top" directory, which is the base project directory.
           - verbosity: Associated with +Q/++quiet, +E/++error, +N/++normal, +V/++verbose, and +D/++debug parameters.
           - work: Associated with -w/--work parameter.
 
index 40d06aee69812ad79c1e061b8adfe1cf08003654..9a75a19849ac7671fee83a185ca3a26a35a54b42 100644 (file)
@@ -116,5 +116,5 @@ Fakefile Specification:
     - <=
 
   The "if" Section Operation condition "parameter"\:
-    The following reserved words are available for parameter names: build, color, data, define, fakefile, mode, process, settings, sources, verbosity, and work.
+    The following reserved words are available for parameter names: build, color, data, define, fakefile, mode, process, return, settings, sources, top, verbosity, and work.
     Each of the reserved words supports having ":option" and ":value" appended, such as: "work:value".