]> Kevux Git Server - fll/commitdiff
Update: Redesign project structure to follow the "main" design used in fss_write.
authorKevin Day <thekevinday@gmail.com>
Sun, 11 Dec 2022 00:00:03 +0000 (18:00 -0600)
committerKevin Day <thekevinday@gmail.com>
Sun, 11 Dec 2022 00:00:03 +0000 (18:00 -0600)
This makes the program structure more consistent.
The structure being followed easily allows for a more object-oriented directory structure and design.
This design is more accurately closer to "progam-oriented" than "object-oriented" due to the structure revolving around a program.

The design of the code itself in fss_write is object-oriented like.
Use this code design for fss_status_code and status_code.
The other programs do not need to do this and have everything under the "main".

69 files changed:
level_3/iki_read/c/main/common-print.c [moved from level_3/iki_read/c/common-print.c with 100% similarity]
level_3/iki_read/c/main/common-print.h [moved from level_3/iki_read/c/common-print.h with 100% similarity]
level_3/iki_read/c/main/common.c [moved from level_3/iki_read/c/common.c with 100% similarity]
level_3/iki_read/c/main/common.h [moved from level_3/iki_read/c/common.h with 100% similarity]
level_3/iki_read/c/main/iki_read.c [moved from level_3/iki_read/c/iki_read.c with 100% similarity]
level_3/iki_read/c/main/iki_read.h [moved from level_3/iki_read/c/iki_read.h with 94% similarity]
level_3/iki_read/c/main/main.c [moved from level_3/iki_read/c/main.c with 100% similarity]
level_3/iki_read/c/main/print.c [moved from level_3/iki_read/c/print.c with 100% similarity]
level_3/iki_read/c/main/print.h [moved from level_3/iki_read/c/print.h with 100% similarity]
level_3/iki_read/c/main/private-common.c [moved from level_3/iki_read/c/private-common.c with 100% similarity]
level_3/iki_read/c/main/private-common.h [moved from level_3/iki_read/c/private-common.h with 100% similarity]
level_3/iki_read/c/main/private-print.c [moved from level_3/iki_read/c/private-print.c with 100% similarity]
level_3/iki_read/c/main/private-print.h [moved from level_3/iki_read/c/private-print.h with 100% similarity]
level_3/iki_read/c/main/private-read.c [moved from level_3/iki_read/c/private-read.c with 100% similarity]
level_3/iki_read/c/main/private-read.h [moved from level_3/iki_read/c/private-read.h with 100% similarity]
level_3/iki_read/data/build/settings
level_3/iki_write/c/main/common-print.c [moved from level_3/iki_write/c/common-print.c with 100% similarity]
level_3/iki_write/c/main/common-print.h [moved from level_3/iki_write/c/common-print.h with 100% similarity]
level_3/iki_write/c/main/common.c [moved from level_3/iki_write/c/common.c with 100% similarity]
level_3/iki_write/c/main/common.h [moved from level_3/iki_write/c/common.h with 100% similarity]
level_3/iki_write/c/main/iki_write.c [moved from level_3/iki_write/c/iki_write.c with 100% similarity]
level_3/iki_write/c/main/iki_write.h [moved from level_3/iki_write/c/iki_write.h with 94% similarity]
level_3/iki_write/c/main/main.c [moved from level_3/iki_write/c/main.c with 100% similarity]
level_3/iki_write/c/main/print.c [moved from level_3/iki_write/c/print.c with 100% similarity]
level_3/iki_write/c/main/print.h [moved from level_3/iki_write/c/print.h with 100% similarity]
level_3/iki_write/c/main/private-common.c [moved from level_3/iki_write/c/private-common.c with 100% similarity]
level_3/iki_write/c/main/private-common.h [moved from level_3/iki_write/c/private-common.h with 100% similarity]
level_3/iki_write/c/main/private-write.c [moved from level_3/iki_write/c/private-write.c with 100% similarity]
level_3/iki_write/c/main/private-write.h [moved from level_3/iki_write/c/private-write.h with 100% similarity]
level_3/iki_write/data/build/settings
level_3/status_code/c/fss/common.c [new file with mode: 0644]
level_3/status_code/c/fss/common.h [new file with mode: 0644]
level_3/status_code/c/fss/main.c [moved from level_3/status_code/c/main-fss_status_code.c with 62% similarity]
level_3/status_code/c/fss/status_code.c [moved from level_3/status_code/c/private-common.c with 79% similarity]
level_3/status_code/c/fss/status_code.h [new file with mode: 0644]
level_3/status_code/c/main/common-print.c [moved from level_3/status_code/c/common-print.c with 100% similarity]
level_3/status_code/c/main/common-print.h [moved from level_3/status_code/c/common-print.h with 100% similarity]
level_3/status_code/c/main/common.c [moved from level_3/status_code/c/common.c with 99% similarity]
level_3/status_code/c/main/common.h [moved from level_3/status_code/c/common.h with 95% similarity]
level_3/status_code/c/main/main.c [moved from level_3/status_code/c/main-status_code.c with 81% similarity]
level_3/status_code/c/main/print.c [moved from level_3/status_code/c/print.c with 94% similarity]
level_3/status_code/c/main/print.h [moved from level_3/status_code/c/print.h with 100% similarity]
level_3/status_code/c/main/private-status_code.c [moved from level_3/status_code/c/private-status_code.c with 99% similarity]
level_3/status_code/c/main/private-status_code.h [moved from level_3/status_code/c/private-status_code.h with 100% similarity]
level_3/status_code/c/main/status_code.c [moved from level_3/status_code/c/status_code.c with 99% similarity]
level_3/status_code/c/main/status_code.h [moved from level_3/status_code/c/status_code.h with 93% similarity]
level_3/status_code/c/private-common.h [deleted file]
level_3/status_code/data/build/fakefile
level_3/status_code/data/build/settings
level_3/status_code/data/build/settings.fss [moved from level_3/status_code/data/build/settings.fss_status_code with 75% similarity]
level_3/status_code/data/build/settings.main [new file with mode: 0644]
level_3/utf8/c/main/common-print.c [moved from level_3/utf8/c/common-print.c with 100% similarity]
level_3/utf8/c/main/common-print.h [moved from level_3/utf8/c/common-print.h with 100% similarity]
level_3/utf8/c/main/common.c [moved from level_3/utf8/c/common.c with 100% similarity]
level_3/utf8/c/main/common.h [moved from level_3/utf8/c/common.h with 100% similarity]
level_3/utf8/c/main/main.c [moved from level_3/utf8/c/main.c with 100% similarity]
level_3/utf8/c/main/print.c [moved from level_3/utf8/c/print.c with 100% similarity]
level_3/utf8/c/main/print.h [moved from level_3/utf8/c/print.h with 100% similarity]
level_3/utf8/c/main/private-common.c [moved from level_3/utf8/c/private-common.c with 100% similarity]
level_3/utf8/c/main/private-common.h [moved from level_3/utf8/c/private-common.h with 100% similarity]
level_3/utf8/c/main/private-utf8.c [moved from level_3/utf8/c/private-utf8.c with 100% similarity]
level_3/utf8/c/main/private-utf8.h [moved from level_3/utf8/c/private-utf8.h with 100% similarity]
level_3/utf8/c/main/private-utf8_bytesequence.c [moved from level_3/utf8/c/private-utf8_bytesequence.c with 100% similarity]
level_3/utf8/c/main/private-utf8_bytesequence.h [moved from level_3/utf8/c/private-utf8_bytesequence.h with 100% similarity]
level_3/utf8/c/main/private-utf8_codepoint.c [moved from level_3/utf8/c/private-utf8_codepoint.c with 100% similarity]
level_3/utf8/c/main/private-utf8_codepoint.h [moved from level_3/utf8/c/private-utf8_codepoint.h with 100% similarity]
level_3/utf8/c/main/utf8.c [moved from level_3/utf8/c/utf8.c with 100% similarity]
level_3/utf8/c/main/utf8.h [moved from level_3/utf8/c/utf8.h with 95% similarity]
level_3/utf8/data/build/settings

similarity index 94%
rename from level_3/iki_read/c/iki_read.h
rename to level_3/iki_read/c/main/iki_read.h
index 45f60062148f01169f0ddfd2575cffd0327e911a..d425d338a6df4b2030eebc333e883dccca7d7009 100644 (file)
@@ -51,9 +51,9 @@
 #include <fll/level_2/program.h>
 
 // IKI Read includes.
-#include <program/iki_read/common.h>
-#include <program/iki_read/common-print.h>
-#include <program/iki_read/print.h>
+#include <program/iki_read/main/common.h>
+#include <program/iki_read/main/common-print.h>
+#include <program/iki_read/main/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 4babf3b2a514f8c0c48c5fe23cd61a383f96b048..57cf7507d97d0df04b09c66d47317e43482dd32a 100644 (file)
@@ -22,11 +22,11 @@ build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 
-build_sources_library iki_read.c common.c common-print.c print.c private-common.c private-print.c private-read.c
+build_sources_library main/iki_read.c main/common.c main/common-print.c main/print.c main/private-common.c main/private-print.c main/private-read.c
 
-build_sources_program main.c
+build_sources_program main/main.c
 
-build_sources_headers iki_read.h common.h common-print.h print.h
+build_sources_headers main/iki_read.h main/common.h main/common-print.h main/print.h
 
 build_script yes
 build_shared yes
similarity index 94%
rename from level_3/iki_write/c/iki_write.h
rename to level_3/iki_write/c/main/iki_write.h
index 35d96f20348bdf55c629d47cf5f47ecaf52dfce5..721f413ec36debc9a9a57595eb23ae999cee9694 100644 (file)
@@ -51,9 +51,9 @@
 #include <fll/level_2/program.h>
 
 // IKI Write includes.
-#include <program/iki_write/common.h>
-#include <program/iki_write/common-print.h>
-#include <program/iki_write/print.h>
+#include <program/iki_write/main/common.h>
+#include <program/iki_write/main/common-print.h>
+#include <program/iki_write/main/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 9d29ba52d0ce0f0d348f8db9197f1a5127a123c9..da5f7541e00995510ed891aa63760f7fc26c33ee 100644 (file)
@@ -21,11 +21,11 @@ build_libraries-individual -lfll_error -lfll_iki -lfll_print -lfll_program -lfl_
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 
-build_sources_library iki_write.c common.c common-print.c print.c private-common.c private-write.c
+build_sources_library main/iki_write.c main/common.c main/common-print.c main/print.c main/private-common.c main/private-write.c
 
-build_sources_program main.c
+build_sources_program main/main.c
 
-build_sources_headers iki_write.h common.h common-print.h print.h
+build_sources_headers main/iki_write.h main/common.h main/common-print.h main/print.h
 
 build_script yes
 build_shared yes
diff --git a/level_3/status_code/c/fss/common.c b/level_3/status_code/c/fss/common.c
new file mode 100644 (file)
index 0000000..5587146
--- /dev/null
@@ -0,0 +1,14 @@
+#include "status_code.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_status_code_fss_program_name_s_
+  const f_string_static_t status_code_fss_program_name_s = macro_f_string_static_t_initialize(STATUS_CODE_fss_program_name_s, 0, STATUS_CODE_fss_program_name_s_length);
+  const f_string_static_t status_code_fss_program_name_long_s = macro_f_string_static_t_initialize(STATUS_CODE_fss_program_name_long_s, 0, STATUS_CODE_fss_program_name_long_s_length);
+#endif // _di_status_code_fss_program_name_s_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/status_code/c/fss/common.h b/level_3/status_code/c/fss/common.h
new file mode 100644 (file)
index 0000000..4faec02
--- /dev/null
@@ -0,0 +1,37 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: Status Code
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _status_code_fss_common_h
+#define _status_code_fss_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The program name.
+ */
+#ifndef _di_status_code_fss_program_name_s_
+  #define STATUS_CODE_fss_program_name_s      "fss_status_code"
+  #define STATUS_CODE_fss_program_name_long_s "FSS Status Code"
+
+  #define STATUS_CODE_fss_program_name_s_length      15
+  #define STATUS_CODE_fss_program_name_long_s_length 15
+
+  extern const f_string_static_t status_code_fss_program_name_s;
+  extern const f_string_static_t status_code_fss_program_name_long_s;
+#endif // _di_status_code_program_name_s_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _status_code_fss_common_h
similarity index 62%
rename from level_3/status_code/c/main-fss_status_code.c
rename to level_3/status_code/c/fss/main.c
index afdfd5f75354d74edff05ac30f37d123b7f41c60..baf7772ab58c78acfbb0f76c16eb090ab8ec6ea1 100644 (file)
@@ -1,17 +1,14 @@
 #include "status_code.h"
-
-// FLL-2 includes.
-#include <fll/level_2/fss_status_string.h>
-
-#ifndef _di_status_code_program_name_s_
-  const f_string_static_t status_code_program_name_s = macro_f_string_static_t_initialize(STATUS_CODE_program_name_s, 0, STATUS_CODE_program_name_s_length);
-  const f_string_static_t status_code_program_name_long_s = macro_f_string_static_t_initialize(STATUS_CODE_program_name_long_s, 0, STATUS_CODE_program_name_long_s_length);
-#endif // _di_status_code_program_name_s_
+#include "../main/status_code.h"
 
 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;
   status_code_setting_t setting = status_code_setting_t_initialize;
+  setting.program_name = &status_code_fss_program_name_s;
+  setting.program_name_long = &status_code_fss_program_name_long_s;
+  setting.status_string_from = &fll_fss_status_string_from;
+  setting.status_string_to = &fll_fss_status_string_to;
 
   f_console_parameter_t parameters[] = status_code_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -28,9 +25,6 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
     status_code_setting_load(arguments, &data, &setting);
-
-    setting.status_string_from = &fll_fss_status_string_from;
-    setting.status_string_to = &fll_fss_status_string_to;
   }
 
   status_code_main(&data, &setting);
similarity index 79%
rename from level_3/status_code/c/private-common.c
rename to level_3/status_code/c/fss/status_code.c
index 7540b79d0cb01c1393604db98794a1b6cf6d449d..474020105b81469a6dfdea539abba029d82886fc 100644 (file)
@@ -1,5 +1,4 @@
 #include "status_code.h"
-#include "private-common.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/level_3/status_code/c/fss/status_code.h b/level_3/status_code/c/fss/status_code.h
new file mode 100644 (file)
index 0000000..1c70154
--- /dev/null
@@ -0,0 +1,58 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: Status Code
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * This program provides status code to/from string translation.
+ */
+#ifndef _status_code_fss_h
+#define _status_code_fss_h
+
+// Libc includes.
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+// FLL-0 includes.
+#include <fll/level_0/type.h>
+#include <fll/level_0/status.h>
+#include <fll/level_0/memory.h>
+#include <fll/level_0/string.h>
+#include <fll/level_0/utf.h>
+#include <fll/level_0/color.h>
+#include <fll/level_0/conversion.h>
+#include <fll/level_0/console.h>
+#include <fll/level_0/pipe.h>
+#include <fll/level_0/print.h>
+#include <fll/level_0/signal.h>
+#include <fll/level_0/status_string.h>
+
+// FLL-1 includes.
+#include <fll/level_1/conversion.h>
+#include <fll/level_1/print.h>
+#include <fll/level_1/string.h>
+
+// FLL-2 includes.
+#include <fll/level_2/error.h>
+#include <fll/level_2/fss_status_string.h>
+#include <fll/level_2/print.h>
+#include <fll/level_2/program.h>
+
+// Status Code includes.
+#include <program/status_code/main/common.h>
+#include <program/status_code/main/common-print.h>
+#include <program/status_code/fss/common.h>
+#include <program/status_code/print.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _status_code_fss_h
similarity index 99%
rename from level_3/status_code/c/common.c
rename to level_3/status_code/c/main/common.c
index 1ba6c324bebe39d3e5e6ef84a37d2750898bed4d..a7a7529a3c9c738a8694ad86c0a8fe642e439736 100644 (file)
@@ -53,8 +53,6 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
-
     // Load parameters.
     setting->status = f_console_parameter_process(arguments, &main->parameters);
 
similarity index 95%
rename from level_3/status_code/c/common.h
rename to level_3/status_code/c/main/common.h
index 15f310f3ff8b22819f0a9e7ec1eaa0402a9c0062..ce0b1199e682f620a922bc78e72c3c080a97f790 100644 (file)
@@ -49,19 +49,11 @@ extern "C" {
  * The program name.
  */
 #ifndef _di_status_code_program_name_s_
-  #ifdef _status_code_as_fss_status_code
-    #define STATUS_CODE_program_name_s      "fss_status_code"
-    #define STATUS_CODE_program_name_long_s "FSS Status Code"
+  #define STATUS_CODE_program_name_s      "status_code"
+  #define STATUS_CODE_program_name_long_s "Status Code"
 
-    #define STATUS_CODE_program_name_s_length      15
-    #define STATUS_CODE_program_name_long_s_length 15
-  #else
-    #define STATUS_CODE_program_name_s      "status_code"
-    #define STATUS_CODE_program_name_long_s "Status Code"
-
-    #define STATUS_CODE_program_name_s_length      11
-    #define STATUS_CODE_program_name_long_s_length 11
-  #endif // _status_code_as_fss_status_code
+  #define STATUS_CODE_program_name_s_length      11
+  #define STATUS_CODE_program_name_long_s_length 11
 
   extern const f_string_static_t status_code_program_name_s;
   extern const f_string_static_t status_code_program_name_long_s;
@@ -230,7 +222,7 @@ extern "C" {
  * 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.
  * line_last:  A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
  *
- * status_string_from: A pointer to the status string function (usually either f_status_string_from() or fll_fss_status_string_from()).
+ * status_string_from: A pointer to the status string function (usually either fll_status_string_from() or fll_fss_status_string_from()).
  * status_string_to:   A pointer to the status string function (usually either f_status_string_to() or fll_fss_status_string_to()).
  */
 #ifndef _di_status_code_setting_t_
@@ -242,6 +234,9 @@ extern "C" {
     f_string_static_t line_first;
     f_string_static_t line_last;
 
+    const f_string_static_t *program_name;
+    const f_string_static_t *program_name_long;
+
     f_status_t (*status_string_from)(const f_string_static_t name, f_status_t * const code);
     f_status_t (*status_string_to)(const f_status_t code, f_string_static_t * const name);
   } status_code_setting_t;
@@ -252,8 +247,10 @@ extern "C" {
       F_none, \
       f_string_static_t_initialize, \
       f_string_static_t_initialize, \
-      &fll_status_string_from, \
-      &f_status_string_to, \
+      0, \
+      0, \
+      0, \
+      0, \
     }
 #endif // _di_status_code_setting_t_
 
similarity index 81%
rename from level_3/status_code/c/main-status_code.c
rename to level_3/status_code/c/main/main.c
index 5c7ac19ffd0fbecf756e5625b3274b39cbe06a5e..1771c6716fcdaab604e68345c741fff2fd596b5e 100644 (file)
@@ -4,6 +4,10 @@ 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;
   status_code_setting_t setting = status_code_setting_t_initialize;
+  setting.program_name = &status_code_program_name_s;
+  setting.program_name_long = &status_code_program_name_long_s;
+  setting.status_string_from = &fll_status_string_from;
+  setting.status_string_to = &f_status_string_to;
 
   f_console_parameter_t parameters[] = status_code_console_parameter_t_initialize;
   data.parameters.array = parameters;
similarity index 94%
rename from level_3/status_code/c/print.c
rename to level_3/status_code/c/main/print.c
index 4b1c47451b842d1dd07913773c68a40bef077734..2792eb88273ea959e456fc1c79c4fd1effc63d59 100644 (file)
@@ -1,5 +1,4 @@
 #include "status_code.h"
-#include "private-common.h"
 #include "print.h"
 
 #ifdef __cplusplus
@@ -91,7 +90,13 @@ extern "C" {
 
     f_print_dynamic_raw(setting->line_first, print.to);
 
-    fll_program_print_help_header(print, status_code_program_name_long_s, status_code_program_version_s);
+    fll_program_print_help_header(
+      print,
+      setting->program_name_long
+        ? *setting->program_name_long
+        : status_code_program_name_long_s,
+      status_code_program_version_s
+    );
 
     fll_program_print_help_option_standard(print);
 
@@ -105,7 +110,13 @@ extern "C" {
     f_print_dynamic_raw(f_string_eol_s, print.to);
     f_print_dynamic_raw(f_string_eol_s, print.to);
 
-    fll_program_print_help_usage(print, status_code_program_name_s, status_code_program_help_parameters_s);
+    fll_program_print_help_usage(
+      print,
+      setting->program_name
+        ? *setting->program_name
+        : status_code_program_name_s,
+      status_code_program_help_parameters_s
+    );
 
     f_print_dynamic_raw(setting->line_last, print.to);
 
similarity index 99%
rename from level_3/status_code/c/private-status_code.c
rename to level_3/status_code/c/main/private-status_code.c
index 2eb0c0e02163d8b807e6ed035c13856d3b8d6b41..86136105c7078f90721c7cce7485b98f27a2434e 100644 (file)
@@ -1,5 +1,4 @@
 #include "status_code.h"
-#include "private-common.h"
 #include "private-status_code.h"
 
 #ifdef __cplusplus
similarity index 99%
rename from level_3/status_code/c/status_code.c
rename to level_3/status_code/c/main/status_code.c
index bedbeb1dca29818b17f9a672eeb47eb95abf4348..2b420449cb93f7cb4f0897caa4f9a3ff66440dfb 100644 (file)
@@ -1,5 +1,4 @@
 #include "status_code.h"
-#include "private-common.h"
 #include "private-status_code.h"
 
 #ifdef __cplusplus
similarity index 93%
rename from level_3/status_code/c/status_code.h
rename to level_3/status_code/c/main/status_code.h
index 7baab5f5c89af927a08ba13c08c5053b457c70e4..a71082366f92628f2eaf4b61f53f56104a0c2ceb 100644 (file)
@@ -42,9 +42,9 @@
 #include <fll/level_2/status_string.h>
 
 // Status Code includes.
-#include <program/status_code/common.h>
-#include <program/status_code/common-print.h>
-#include <program/status_code/print.h>
+#include <program/status_code/main/common.h>
+#include <program/status_code/main/common-print.h>
+#include <program/status_code/main/print.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/level_3/status_code/c/private-common.h b/level_3/status_code/c/private-common.h
deleted file mode 100644 (file)
index dc1d6a4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: Status Code
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_common_h
-#define _PRIVATE_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_common_h
index 218debe1f7c877f73b0ea210bcc04f82b57b13c2..72b7d6afd3774525c7a6892945f2084545fc8818 100644 (file)
@@ -14,8 +14,15 @@ main:
 
 using_default:
   build settings
-  build settings.fss_status_code
+  build settings.main
+  build settings.fss
 
 using_mode:
   build settings parameter:'mode:value'
-  build settings.fss_status_code parameter:'mode:value'
+  build settings.main parameter:'mode:value'
+  build settings.fss parameter:'mode:value'
+
+install:
+  shell ./install.sh parameter:'work'
+  shell ./install.sh parameter:'work' -s data/build/settings.main
+  shell ./install.sh parameter:'work' -s data/build/settings.fss
index 3889dfbf0476691294a26fd79f26f7475af8a170..ee7116c35647046fd4f92462927f5b67fcfcadcf 100644 (file)
@@ -1,6 +1,6 @@
 # fss-0001
 #
-# Settings for the "status_code" program.
+# Builds the main library of the project with all parts except "main" program related.
 #
 
 build_name status_code
@@ -25,11 +25,11 @@ build_libraries-individual -lfll_error -lfll_print -lfll_program -lfll_status_st
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 
-build_sources_library status_code.c common.c common-print.c print.c private-common.c private-status_code.c
+build_sources_library main/status_code.c main/common.c main/common-print.c main/print.c main/private-status_code.c
+build_sources_library fss/status_code.c fss/common.c
 
-build_sources_program main-status_code.c
-
-build_sources_headers status_code.h common.h common-print.h print.h
+build_sources_headers main/status_code.h main/common.h main/common-print.h main/print.h
+build_sources_headers fss/status_code.h fss/common.h
 
 build_script yes
 build_shared yes
similarity index 75%
rename from level_3/status_code/data/build/settings.fss_status_code
rename to level_3/status_code/data/build/settings.fss
index dedfadb4887edfe0133c477b08279b5354cc5cc1..8031b3580565fe7c03e287f8e011ca6b72e70d46 100644 (file)
@@ -1,6 +1,7 @@
 # fss-0001
 #
-# Settings for the "fss_status_code" program.
+# Builds the "fss" program (fss_status_code).
+# This must be called after the "setting".
 #
 
 build_name fss_status_code
@@ -21,11 +22,11 @@ build_indexer_arguments rcs
 build_language c
 
 build_libraries -lc -lstatus_code
-build_libraries-individual -lfll_error -lfll_fss_status_string -lfll_print -lfll_program -lfll_status_string -lfl_conversion -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-individual -lfll_error -lfll_print -lfll_program -lfll_status_string -lfl_conversion -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 
-build_sources_program main-fss_status_code.c
+build_sources_program fss/main.c
 
 build_script yes
 build_shared yes
@@ -51,8 +52,6 @@ search_static yes
 
 environment PATH LD_LIBRARY_PATH
 
-defines -D_status_code_as_fss_status_code
-
 #defines -D_di_libcap_ -D_di_thread_support_
 defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
 
diff --git a/level_3/status_code/data/build/settings.main b/level_3/status_code/data/build/settings.main
new file mode 100644 (file)
index 0000000..5e3991e
--- /dev/null
@@ -0,0 +1,65 @@
+# fss-0001
+#
+# Builds the "main" program (status_code).
+# This must be called after the "setting".
+#
+
+build_name status_code
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lstatus_code
+build_libraries-individual -lfll_error -lfll_print -lfll_program -lfll_status_string -lfl_conversion -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program main/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/status_code
+path_library_script script
+path_library_shared shared
+path_library_static static
+path_object_script script
+path_object_shared shared
+path_object_static static
+path_program_script script
+path_program_shared shared
+path_program_static static
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE
similarity index 95%
rename from level_3/utf8/c/utf8.h
rename to level_3/utf8/c/main/utf8.h
index 668cbcdaee7319fb4b12292b4e75c09bcdf54c7c..4347b81215104cf78147207a3fea52f6f912b47d 100644 (file)
@@ -55,9 +55,9 @@
 #include <fll/level_2/program.h>
 
 // UTF-8 includes.
-#include <program/utf8/common.h>
-#include <program/utf8/common-print.h>
-#include <program/utf8/print.h>
+#include <program/utf8/main/common.h>
+#include <program/utf8/main/common-print.h>
+#include <program/utf8/main/print.h>
 
 #ifdef __cplusplus
 extern "C" {
index 210338f7b7e1163fa246987ca1a8b8f9de348205..f1838f7e6c440b8df92eebb61302c31aad1d2331 100644 (file)
@@ -22,12 +22,12 @@ build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 
-build_sources_library common.c common-print.c print.c utf8.c
-build_sources_library private-common.c private-utf8.c private-utf8_bytesequence.c private-utf8_codepoint.c
+build_sources_library main/common.c main/common-print.c main/print.c main/utf8.c
+build_sources_library main/private-common.c main/private-utf8.c main/private-utf8_bytesequence.c main/private-utf8_codepoint.c
 
-build_sources_program main.c
+build_sources_program main/main.c
 
-build_sources_headers common.h common-print.h print.h utf8.h
+build_sources_headers main/common.h main/common-print.h main/print.h main/utf8.h
 
 build_script yes
 build_shared yes