]> Kevux Git Server - fll/commitdiff
Progress: Begin working on Featureless Make.
authorKevin Day <thekevinday@gmail.com>
Tue, 13 Dec 2022 04:45:42 +0000 (22:45 -0600)
committerKevin Day <thekevinday@gmail.com>
Tue, 13 Dec 2022 04:45:42 +0000 (22:45 -0600)
These are the initial changes I made while looking at what I am going to need to do.

level_3/fake/c/common.c
level_3/fake/c/common.h
level_3/fake/c/fake.h
level_3/fake/c/main.c
level_3/fake/c/private-make-operate_process.h
level_3/fake/c/private-skeleton.c

index 52ce637b2c024fe129d95edcc51eb6e6ea465a8e..84b220bb8d017cbc44073a1143b369b9280eef3b 100644 (file)
@@ -17,12 +17,7 @@ extern "C" {
   const f_string_static_t fake_program_help_parameters_s = macro_f_string_static_t_initialize(FAKE_program_help_parameters_s, 0, FAKE_program_help_parameters_s_length);
 #endif // _di_fake_program_help_parameter_s_
 
-/**
- * The build operation utilizes pre-defined path structures.
- * These structures are hard-coded by their individual pieces to be constructed later on.
- */
 #ifndef _di_fake_path_s_
-  const f_string_static_t fake_path_part_bash_s = macro_f_string_static_t_initialize(FAKE_path_part_bash_s, 0, FAKE_path_part_bash_s_length);
   const f_string_static_t fake_path_part_build_s = macro_f_string_static_t_initialize(FAKE_path_part_build_s, 0, FAKE_path_part_build_s_length);
   const f_string_static_t fake_path_part_c_s = macro_f_string_static_t_initialize(FAKE_path_part_c_s, 0, FAKE_path_part_c_s_length);
   const f_string_static_t fake_path_part_cpp_s = macro_f_string_static_t_initialize(FAKE_path_part_cpp_s, 0, FAKE_path_part_cpp_s_length);
@@ -37,6 +32,7 @@ extern "C" {
   const f_string_static_t fake_path_part_script_s = macro_f_string_static_t_initialize(FAKE_path_part_script_s, 0, FAKE_path_part_script_s_length);
   const f_string_static_t fake_path_part_settings_s = macro_f_string_static_t_initialize(FAKE_path_part_settings_s, 0, FAKE_path_part_settings_s_length);
   const f_string_static_t fake_path_part_shared_s = macro_f_string_static_t_initialize(FAKE_path_part_shared_s, 0, FAKE_path_part_shared_s_length);
+  const f_string_static_t fake_path_part_shell_s = macro_f_string_static_t_initialize(FAKE_path_part_shell_s, 0, FAKE_path_part_shell_s_length);
   const f_string_static_t fake_path_part_specifications_s = macro_f_string_static_t_initialize(FAKE_path_part_specifications_s, 0, FAKE_path_part_specifications_s_length);
   const f_string_static_t fake_path_part_stage_s = macro_f_string_static_t_initialize(FAKE_path_part_stage_s, 0, FAKE_path_part_stage_s_length);
   const f_string_static_t fake_path_part_static_s = macro_f_string_static_t_initialize(FAKE_path_part_static_s, 0, FAKE_path_part_static_s_length);
@@ -70,6 +66,7 @@ extern "C" {
   const f_string_static_t fake_build_language_bash_s = macro_f_string_static_t_initialize(FAKE_build_language_bash_s, 0, FAKE_build_language_bash_s_length);
   const f_string_static_t fake_build_language_c_s = macro_f_string_static_t_initialize(FAKE_build_language_c_s, 0, FAKE_build_language_c_s_length);
   const f_string_static_t fake_build_language_cpp_s = macro_f_string_static_t_initialize(FAKE_build_language_cpp_s, 0, FAKE_build_language_cpp_s_length);
+  const f_string_static_t fake_build_language_zsh_s = macro_f_string_static_t_initialize(FAKE_build_language_zsh_s, 0, FAKE_build_language_zsh_s_length);
 #endif // _di_fake_build_language_s_
 
 #ifndef _di_fake_build_version_s_
index 344153f051f3ef795bafa7d09d0de36190ed553a..bda8931b3ef7fc637b8a053bc3196b7e43de8c51 100644 (file)
@@ -64,6 +64,7 @@ extern "C" {
  */
 #ifndef _di_fake_program_help_parameter_s_
   #define FAKE_program_help_parameters_s "operation"
+
   #define FAKE_program_help_parameters_s_length 9
 
   extern const f_string_static_t fake_program_help_parameters_s;
@@ -74,7 +75,6 @@ extern "C" {
  * These structures are hard-coded by their individual pieces to be constructed later on.
  */
 #ifndef _di_fake_path_s_
-  #define FAKE_path_part_bash_s           "bash"           F_path_separator_s
   #define FAKE_path_part_build_s          "build"          F_path_separator_s
   #define FAKE_path_part_c_s              "c"              F_path_separator_s
   #define FAKE_path_part_cpp_s            "c++"            F_path_separator_s
@@ -89,11 +89,11 @@ extern "C" {
   #define FAKE_path_part_script_s         "script"         F_path_separator_s
   #define FAKE_path_part_settings_s       "settings"       F_path_separator_s
   #define FAKE_path_part_shared_s         "shared"         F_path_separator_s
+  #define FAKE_path_part_shell_s          "shell"          F_path_separator_s
   #define FAKE_path_part_specifications_s "specifications" F_path_separator_s
   #define FAKE_path_part_stage_s          "stage"          F_path_separator_s
   #define FAKE_path_part_static_s         "static"         F_path_separator_s
 
-  #define FAKE_path_part_bash_s_length           4 + F_path_separator_s_length
   #define FAKE_path_part_build_s_length          5 + F_path_separator_s_length
   #define FAKE_path_part_c_s_length              1 + F_path_separator_s_length
   #define FAKE_path_part_cpp_s_length            3 + F_path_separator_s_length
@@ -108,11 +108,11 @@ extern "C" {
   #define FAKE_path_part_script_s_length         6 + F_path_separator_s_length
   #define FAKE_path_part_settings_s_length       8 + F_path_separator_s_length
   #define FAKE_path_part_shared_s_length         6 + F_path_separator_s_length
+  #define FAKE_path_part_shell_s_length          5 + F_path_separator_s_length
   #define FAKE_path_part_specifications_s_length 14 + F_path_separator_s_length
   #define FAKE_path_part_stage_s_length          5 + F_path_separator_s_length
   #define FAKE_path_part_static_s_length         6 + F_path_separator_s_length
 
-  extern const f_string_static_t fake_path_part_bash_s;
   extern const f_string_static_t fake_path_part_build_s;
   extern const f_string_static_t fake_path_part_c_s;
   extern const f_string_static_t fake_path_part_cpp_s;
@@ -127,6 +127,7 @@ extern "C" {
   extern const f_string_static_t fake_path_part_script_s;
   extern const f_string_static_t fake_path_part_settings_s;
   extern const f_string_static_t fake_path_part_shared_s;
+  extern const f_string_static_t fake_path_part_shell_s;
   extern const f_string_static_t fake_path_part_specifications_s;
   extern const f_string_static_t fake_path_part_stage_s;
   extern const f_string_static_t fake_path_part_static_s;
@@ -140,13 +141,13 @@ extern "C" {
   #define FAKE_file_dependencies_s "dependencies"
   #define FAKE_file_process_pre_s  "process_pre.sh"
   #define FAKE_file_process_post_s "process_post.sh"
-  #define FAKE_file_readme_s       "readme"
+  #define FAKE_file_readme_s       "readme.txt"
 
   #define FAKE_file_defines_s_length      7
   #define FAKE_file_dependencies_s_length 12
   #define FAKE_file_process_pre_s_length  14
   #define FAKE_file_process_post_s_length 15
-  #define FAKE_file_readme_s_length       6
+  #define FAKE_file_readme_s_length       10
 
   extern const f_string_static_t fake_file_defines_s;
   extern const f_string_static_t fake_file_dependencies_s;
@@ -159,10 +160,15 @@ extern "C" {
  * Default allocations.
  *
  * Set to at least 4 to provide a UTF-8 friendly allocation step.
+ *
+ * fake_default_allocation_*_d:
+ *   - large: A buffer size used for large allocations.
+ *   - pipe:  A buffer size used for processing piped data.
+ *   - small: A buffer size used for small allocations.
  */
 #ifndef _di_fake_default_d_
-  #define fake_default_allocation_pipe_d  16384
   #define fake_default_allocation_large_d 64
+  #define fake_default_allocation_pipe_d  16384
   #define fake_default_allocation_small_d 8
 #endif // _di_fake_default_d_
 
@@ -206,30 +212,46 @@ extern "C" {
 
 /**
  * The build language enumerations.
+ *
+ * fake_build_language_type_*_e:
+ *   - bash: The GNU Bash language.
+ *   - c:    The C language.
+ *   - cpp:  The C++ language.
+ *   - zsh:  The ZSH language (Similar to and somewhat compatible with GNU Bash).
  */
 #ifndef _di_fake_build_language_e_
   enum {
     fake_build_language_type_bash_e = 1,
     fake_build_language_type_c_e,
     fake_build_language_type_cpp_e,
+    fake_build_language_type_zsh_e,
   }; // enum
 #endif // _di_fake_build_language_e_
 
 /**
  * The build language strings.
+ *
+ * fake_build_language_*_s:
+ *   - bash: The GNU Bash language.
+ *   - c:    The C language.
+ *   - cpp:  The C++ language.
+ *   - zsh:  The ZSH language (Similar to and somewhat compatible with GNU Bash).
  */
 #ifndef _di_fake_build_language_s_
   #define FAKE_build_language_bash_s "bash"
   #define FAKE_build_language_c_s    "c"
   #define FAKE_build_language_cpp_s  "c++"
+  #define FAKE_build_language_zsh_s  "zsh"
 
   #define FAKE_build_language_bash_s_length 4
   #define FAKE_build_language_c_s_length    1
   #define FAKE_build_language_cpp_s_length  3
+  #define FAKE_build_language_zsh_s_length  3
 
   extern const f_string_static_t fake_build_language_bash_s;
   extern const f_string_static_t fake_build_language_c_s;
   extern const f_string_static_t fake_build_language_cpp_s;
+  extern const f_string_static_t fake_build_language_zsh_s;
 #endif // _di_fake_build_language_s_
 
 /**
@@ -266,6 +288,12 @@ extern "C" {
 
 /**
  * The program operation enumerations.
+ *
+ * fake_operation_*_e:
+ *   - build:    The build operation.
+ *   - clean:    The clean operation.
+ *   - make:     The make operation.
+ *   - skeleton: The skeleton operation.
  */
 #ifndef _di_fake_operation_e_
   enum {
@@ -278,12 +306,17 @@ extern "C" {
 
 /**
  * The program defines.
+ *
+ * fake_signal_*_d:
+ *   - check:       The normal signal check (@fixme is needed anymore as-is?).
+ *   - check_tiny:  The tiny check (@fixme is needed anymore as-is?).
+ *   - check_short: The short signal check (@fixme this is used everywhere).
  */
-#ifndef _di_fake_d_
+#ifndef _di_fake_signal_d_
   #define fake_signal_check_d       500000
   #define fake_signal_check_tiny_d  4
   #define fake_signal_check_short_d 16
-#endif // _di_fake_d_
+#endif // _di_fake_signal_d_
 
 /**
  * The main program parameters.
@@ -505,6 +538,7 @@ extern "C" {
  *
  * flag: Flags passed to the main function.
  *
+ * state: The state data used when processing the FSS data.
  * status: The main status code, generally used by the load settings and main functions.
  *
  * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
@@ -514,6 +548,7 @@ extern "C" {
   typedef struct {
     uint16_t flag;
 
+    f_state_t state;
     f_status_t status;
 
     f_string_static_t line_first;
@@ -524,6 +559,7 @@ extern "C" {
     { \
       fake_main_flag_none_e, \
       F_none, \
+      f_state_t_initialize, \
       f_string_static_t_initialize, \
       f_string_static_t_initialize, \
     }
index 254ce0a1305e38d0a63c56a6526ae9aa0764cbcf..9657aa12d7fd29d231ba774fa93e1a129b871e1d 100644 (file)
@@ -125,23 +125,6 @@ extern "C" {
   extern f_status_t fake_main(fll_program_data_t * const main, fake_setting_t * const setting);
 #endif // _di_fake_main_
 
-/**
- * Deallocate main.
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fake_main()
- */
-#ifndef _di_fake_main_delete_
-  extern f_status_t fake_main_delete(fll_program_data_t * const main);
-#endif // _di_fake_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 1a1da04d4927e9c7ece9843f448b62775d2fa9fa..dfba70a7702b6408defabf1a30ccb8913131b72f 100644 (file)
@@ -1,19 +1,5 @@
 #include "fake.h"
 
-/**
- * Standard entry point for fake program.
- *
- * @param argc
- *   The number of arguments.
- * @param argv
- *   The array of arguments.
- *
- * @return
- *   0 on success.
- *   1 on error.
- *
- * @see exit()
- */
 int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_data_t data = fll_program_data_t_initialize;
index de7751705ec7184fb7d344aac50840b508325d97..55b6e552adb44b3b4c9ca57f66ba1a362cef5f06 100644 (file)
@@ -50,7 +50,7 @@ extern "C" {
  *   - "\v": Vertical Tab.
  *   - "\\": Backslash Character (may require additional slashes in certain circumstances.)
  *   - "\0": NULL Character.
- *   - "\U+": Unicode Sequence (followed by a valid Unicode sequence with a minimum 4 hexidecimal digits and a maximum of 6 hexidecimal digits).
+ *   - "\U+": Unicode Sequence (followed by a valid Unicode sequence with a minimum 4 hexadecimal digits and a maximum of 6 hexadecimal digits).
  *   - "\!": Non-printing separator, allowing for "\U+000A\ 5" to be equivalent to "\n5".
  *
  * If the Unicode is invalid, then nothing is copied for that character (the invalid character is skipped when printing).
@@ -58,7 +58,7 @@ extern "C" {
  *   - "\U+000A": Prints a new line, equivalent to "\n".
  *   - "\U+2E19": Prints the Unicode feather-like character "βΈ™".
  *
- * Only ASCII alpha-numeric hexidecimal digits are allowed in the Unicode sequence (upper or lower case).
+ * Only ASCII alpha-numeric hexadecimal digits are allowed in the Unicode sequence (upper or lower case).
  *
  * Invalid or unknown escape sequences are not copied.
  *
index 4a54032704c72985a9bc10b9f53fd084f5078757..c99a9b27c525c78622d352dc08a41b70ee704782 100644 (file)
@@ -27,10 +27,10 @@ extern "C" {
       f_string_static_t sources_script = f_string_static_t_initialize;
 
       fake_skeleton_path_source_length(data, &f_string_empty_s, &sources);
-      fake_skeleton_path_source_length(data, &fake_path_part_bash_s, &sources_bash);
       fake_skeleton_path_source_length(data, &fake_path_part_c_s, &sources_c);
       fake_skeleton_path_source_length(data, &fake_path_part_cpp_s, &sources_cpp);
       fake_skeleton_path_source_length(data, &fake_path_part_script_s, &sources_script);
+      fake_skeleton_path_source_length(data, &fake_path_part_shell_s, &sources_bash);
 
       f_char_t sources_string[sources.used + 1];
       f_char_t sources_bash_string[sources_bash.used + 1];
@@ -45,10 +45,10 @@ extern "C" {
       sources_script.string = sources_script_string;
 
       fake_skeleton_path_source_string(data, &f_string_empty_s, &sources);
-      fake_skeleton_path_source_string(data, &fake_path_part_bash_s, &sources_bash);
       fake_skeleton_path_source_string(data, &fake_path_part_c_s, &sources_c);
       fake_skeleton_path_source_string(data, &fake_path_part_cpp_s, &sources_cpp);
       fake_skeleton_path_source_string(data, &fake_path_part_script_s, &sources_script);
+      fake_skeleton_path_source_string(data, &fake_path_part_shell_s, &sources_bash);
 
       const f_string_static_t *parameters_value[] = {
         &data->path_build,