]> Kevux Git Server - fll/commitdiff
Progress: featureless make
authorKevin Day <thekevinday@gmail.com>
Sat, 30 May 2020 22:36:40 +0000 (17:36 -0500)
committerKevin Day <thekevinday@gmail.com>
Sat, 30 May 2020 22:36:40 +0000 (17:36 -0500)
Move the print functions to their own private files (private-print.c and private-print.h).

Have the build operation create the build directory skeleton.
Have the build operation copy the settings files over, if specified in the build settings.

Update the code to be in sync with recent FLL changes.

13 files changed:
level_3/fake/c/fake.c
level_3/fake/c/fake.h
level_3/fake/c/private-build.c
level_3/fake/c/private-build.h
level_3/fake/c/private-clean.c
level_3/fake/c/private-fake.c
level_3/fake/c/private-fake.h
level_3/fake/c/private-make.c
level_3/fake/c/private-print.c [new file with mode: 0644]
level_3/fake/c/private-print.h [new file with mode: 0644]
level_3/fake/c/private-skeleton.c
level_3/fake/data/build/process_pre.sh
level_3/fake/data/build/settings

index 28a93c695a9fe66b8aaa48c50e814a24ca7c1715..c069e1d948424d7bae1facd32c0136a31db7cf50 100644 (file)
@@ -3,6 +3,7 @@
 #include "private-build.h"
 #include "private-clean.h"
 #include "private-make.h"
+#include "private-print.h"
 #include "private-skeleton.h"
 
 #ifdef __cplusplus
@@ -383,6 +384,8 @@ extern "C" {
     f_macro_string_dynamic_delete_simple(data->path_data);
     f_macro_string_dynamic_delete_simple(data->path_data_build);
 
+    f_macro_string_dynamic_delete_simple(data->path_data_settings);
+
     f_macro_string_dynamic_delete_simple(data->path_documents);
 
     f_macro_string_dynamic_delete_simple(data->path_licenses);
@@ -406,6 +409,7 @@ extern "C" {
     f_macro_string_dynamic_delete_simple(data->file_data_build_defines);
     f_macro_string_dynamic_delete_simple(data->file_data_build_dependencies);
     f_macro_string_dynamic_delete_simple(data->file_data_build_settings);
+
     f_macro_string_dynamic_delete_simple(data->file_documents_readme);
 
     fl_macro_color_context_delete_simple(data->context);
index 6ddef5e085c4c4797b4d77e2517c77e533d277bf..7194b4579789bdd3914239ac5f798e7e6130c6f3 100644 (file)
@@ -31,7 +31,7 @@
  *   - settings/
  *
  * The "data/" directory contains all file data, such as firmware or files commonly found under /usr/share in a standard GNU Linux system.
- * The "data/" direcory may also contain build-time data.
+ * The "data/" directory may also contain build-time data.
  * The "documents/" directory contains all documentation after any build-time processing.
  * The "libraries/" and "programs/" directories contains the sub-directories "script/", "shared/", and "static/".
  * The "libraries/" directory will contain compiled libraries or library-like scripts in their respective sub-directories.
  *
  * @todo this will eventually support fakefile, which is akin to makefile.
  *       All of the setting data will be loaded and available for a fakefile.
- *
- * @todo update the below documentation and clean it up (this is the build settings documentation).
- *
- * "build_compiler"
- *
- * "build_libraries"
- *
- * "build_linker"
- *
- * "build_shared"
- *
- * "build_sources_headers"
- * "build_sources_library"
- * "build_sources_program"
- * "build_sources_setting"
- * "build_sources_shell"
- *
- * "build_static"
- *
- * "path_headers"
- * "path_library_shared"
- * "path_library_static"
- * "path_program_shared"
- * "path_program_static"
- *
- * "defines_all"
- * "defines_shared"
- * "defines_static"
- *
- * "flags_all"
- * "flags_library"
- * "flags_program"
- * "flags_shared"
- * "flags_static"
- *
- * "path_language"
- *
- * "process_pre"
- * - This represents the name of a script to run (either a path to the script by prepending '/' or './', or the name a script found via PATH environment variable).
- * - This script will receive three types of parameters, if relevant (1: the operation name, will always be present) (2: -m mode, such that "mode" is the mode value) (3: -d defines, such that "defines" is the combine defines).
- * - This script is run before the operation, for each operation.
- * - This script also accepts the color mode parameters as "+n" for no color and "+l" for light color.
- * - The path of the script, when using './' is relative to the 'data/build/settings/' directory.
- *
- * "process_post"
- * - Identical to "pre_process", except that this script is run after the operation, for each operation.
- * - Also (always) receives a parameter: "-r result, such that "result" is the numeric value representing the return status of the operation.
- *
- * "project_level" This needs to be changed (maybe "build_includes_path"), such that the value is "level_1" instead of "1', for example. There needs to be additional include sub-directory support for header directories.
- * "project_name"
- *
- * "version_major"
- * "version_micro"
- * "version_minor"
- *
- * The data/ is intended to contain additional data, the following are special use or reserved:
- *   "data/build/": The build related settings are stored here, such as process_pre.sh or the settings configuration "data/build/settings".
- *   "data/settings/": Any configuration settings files, like those found under "/etc/".
- *   "data/common/": Any common data files, like those found under "/usr/share/".
- *   "data/documents/": Any documentation data files, like those found under "/usr/share/man/".
  */
 #ifndef _fake_h
 
@@ -443,6 +383,7 @@ extern "C" {
 
     f_string_dynamic path_data;
     f_string_dynamic path_data_build;
+    f_string_dynamic path_data_settings;
 
     f_string_dynamic path_documents;
 
@@ -520,6 +461,7 @@ extern "C" {
       f_string_dynamic_initialize, \
       f_string_dynamic_initialize, \
       f_string_dynamic_initialize, \
+      f_string_dynamic_initialize, \
       fl_color_context_initialize, \
     }
 #endif // _di_fake_data_
index db77d0dd3cf2cd72369011a4e37a9bf5f78fb3a9..749133453f33ad588ca2888a9156a17e51abfddd 100644 (file)
 #include <level_3/fake.h>
 #include "private-fake.h"
 #include "private-build.h"
+#include "private-print.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+#ifndef _di_fake_build_copy_data_settings_
+  f_return_status fake_build_copy_data_settings(const fake_data data, const fake_build_settings settings, const f_mode mode) {
+    f_status status = F_none;
+    f_directory_statuss failures = f_directory_statuss_initialize;
+    f_string_dynamic path_source = f_string_dynamic_initialize;
+
+    if (data.verbosity != fake_verbosity_quiet) {
+      printf("%cCopying source settings.%c", f_string_eol, f_string_eol);
+    }
+
+    f_macro_string_dynamic_new(status, path_source, data.path_data_settings.used);
+    if (F_status_is_error(status)) {
+      fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "f_macro_string_dynamic_new", F_true);
+
+      f_macro_string_dynamic_delete_simple(path_source);
+      return status;
+    }
+
+    memcpy(path_source.string, data.path_data_settings.string, data.path_data_settings.used);
+
+    for (f_array_length i = 0; i < settings.build_sources_setting.used; i++) {
+      if (settings.build_sources_setting.array[i].used == 0) continue;
+
+      if (data.path_data_settings.used == 0) {
+        path_source.used = 0;
+      }
+      else {
+        path_source.used = data.path_data_settings.used - 1;
+      }
+
+      status = fl_string_dynamic_append_nulless(settings.build_sources_setting.array[i], &path_source);
+      if (F_status_is_error(status)) {
+        fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true);
+        break;
+      }
+
+      status = fl_string_dynamic_terminate(&path_source);
+      if (F_status_is_error(status)) {
+        fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_terminate", F_true);
+        break;
+      }
+
+      if ((status = f_directory_is(path_source.string)) == F_true) {
+        status = fl_directory_copy_content(path_source.string, data.path_build_settings.string, path_source.used, data.path_build_settings.used, mode, f_file_default_read_size, F_false, (data.verbosity == fake_verbosity_verbose) ? f_type_output : 0, &failures);
+
+        if (F_status_is_error(status)) {
+          if (data.verbosity == fake_verbosity_verbose) {
+            for (f_string_length j = 0; j < failures.used; j++) {
+              fake_print_error_operation(data.context, data.verbosity, F_status_set_fine(status), "fl_directory_copy_content", "copy contents of", "to", path_source.string, data.path_data_settings.string, F_true);
+            } // for
+
+            if (F_status_set_fine(status) != F_failure) {
+              fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_directory_copy_content", F_true);
+            }
+
+            break;
+          }
+          else if (data.verbosity != fake_verbosity_quiet) {
+            fake_print_error_operation(data.context, data.verbosity, F_status_set_fine(status), "fl_directory_copy_content", "copy contents of", "to", path_source.string, data.path_data_settings.string, F_true);
+          }
+
+          break;
+        }
+      }
+      else if (status == F_false) {
+        status = f_file_copy(path_source.string, data.path_build_settings.string, mode, f_file_default_read_size, F_false);
+
+        if (F_status_is_error(status)) {
+          fake_print_error_operation(data.context, data.verbosity, F_status_set_fine(status), "f_file_copy", "copy", "to", path_source.string, data.path_data_settings.string, F_true);
+          break;
+        }
+      }
+      else if (F_status_is_error(status)) {
+        fake_print_error_file(data.context, data.verbosity, F_status_set_fine(status), "f_directory_is", path_source.string, "create", F_false, F_true);
+        break;
+      }
+    } // for
+
+    f_macro_directory_statuss_delete_simple(failures);
+    f_macro_string_dynamic_delete_simple(path_source);
+
+    return F_none;
+  }
+#endif // _di_fake_build_copy_data_settings_
+
+#ifndef _di_fake_build_skeleton_
+  f_return_status fake_build_skeleton(const fake_data data, const fake_build_settings settings, const mode_t mode) {
+    f_status status = F_none;
+
+    const f_string_static *directorys[] = {
+      &data.path_build,
+      &data.path_build_documents,
+      &data.path_build_includes,
+      &data.path_build_libraries,
+      &data.path_build_libraries_script,
+      &data.path_build_libraries_shared,
+      &data.path_build_libraries_static,
+      &data.path_build_objects,
+      &data.path_build_process,
+      &data.path_build_programs,
+      &data.path_build_programs_script,
+      &data.path_build_programs_shared,
+      &data.path_build_programs_static,
+      &data.path_build_settings,
+    };
+
+    if (data.verbosity != fake_verbosity_quiet) {
+      printf("%cCreating base build directories.%c", f_string_eol, f_string_eol);
+    }
+
+    for (uint8_t i = 0; i < 14; i++) {
+      if (directorys[i]->used == 0) continue;
+
+      status = f_directory_create(directorys[i]->string, mode);
+
+      if (F_status_is_error(status)) {
+        if (F_status_set_fine(status) == F_file_found) continue;
+
+        fake_print_error_file(data.context, data.verbosity, F_status_set_fine(status), "f_directory_create", directorys[i]->string, "create", F_false, F_true);
+        return status;
+      }
+
+      if (data.verbosity == fake_verbosity_verbose) {
+        printf("Created directory '%s'%c", directorys[i]->string, f_string_eol);
+      }
+    } // for
+
+    return F_none;
+  }
+#endif // _di_fake_build_skeleton_
+
 #ifndef _di_fake_build_execute_process_script_
   f_return_status fake_build_execute_process_script(const fake_data data, const fake_build_settings settings, const f_string_static process_script) {
     if (process_script.used == 0) return F_none;
@@ -366,10 +498,21 @@ extern "C" {
       return status;
     }
 
-    f_directory_statuss failures = f_directory_statuss_initialize;
-    f_directory_mode mode = f_directory_mode_initialize;
+    f_mode mode = f_mode_initialize;
+
+    f_macro_mode_set_default_umask(mode, data.umask);
 
-    f_macro_directory_mode_set_default_umask(mode, data.umask);
+    status = fake_build_skeleton(data, settings, mode.directory);
+    if (F_status_is_error(status)) {
+      fake_macro_build_settings_delete_simple(settings);
+      return status;
+    }
+
+    status = fake_build_copy_data_settings(data, settings, mode);
+    if (F_status_is_error(status)) {
+      fake_macro_build_settings_delete_simple(settings);
+      return status;
+    }
 
     // @todo: may have to process all data intended to be used in parameters, exploding them into console parameters.
     // Steps:
index b8b49058b009b9e15ec0bf38a0ceda3a4fff8531..b4e176114eb09b6ffd15231f8ce520f8d675859f 100644 (file)
@@ -203,6 +203,42 @@ extern "C" {
 #endif // _di_fake_build_settings_
 
 /**
+ * Copy over the data settings files.
+ *
+ * @param data
+ *   The program data.
+ * @param settings
+ *   All build related settings data from the build settings file.
+ * @param mode
+ *   The modes for each file type.
+ *
+ * @return
+ *   F_none on success.
+ *   Status codes (with error bit) are returned on any problem.
+ */
+#ifndef _di_fake_build_copy_data_settings_
+  extern f_return_status fake_build_copy_data_settings(const fake_data data, const fake_build_settings settings, const f_mode mode) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_build_copy_data_settings_
+
+/**
+ * Create all of the base directories inside the build directory.
+ *
+ * @param data
+ *   The program data.
+ * @param settings
+ *   All build related settings data from the build settings file.
+ * @param mode
+ *   The directory mode.
+ *
+ * @return
+ *   F_none on success.
+ *   Status codes (with error bit) are returned on any problem.
+ */
+#ifndef _di_fake_build_skeleton_
+  extern f_return_status fake_build_skeleton(const fake_data data, const fake_build_settings settings, const mode_t mode) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_build_skeleton_
+
+/**
  * Execute the Pre-Process or Post-pocess build script.
  *
  * @param data
index 27da46a92e88fe6f3d22bc3b47dbcef2c71ca796..fd0f7a538e063b43caf3015e84987c82a1917425 100644 (file)
@@ -1,6 +1,7 @@
 #include <level_3/fake.h>
 #include "private-fake.h"
 #include "private-clean.h"
+#include "private-print.h"
 
 #ifdef __cplusplus
 extern "C" {
index 84949f25e6c0533f15aa1694de76463cec78c082..6aac31a7dfbeeaefc229f544bc361fd1f028ebcc 100644 (file)
@@ -1,5 +1,6 @@
 #include <level_3/fake.h>
 #include "private-fake.h"
+#include "private-print.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -19,7 +20,7 @@ extern "C" {
 
       const uint8_t parameters_length[] = {
         7,
-        1,
+        2,
         3,
       };
 
@@ -35,6 +36,7 @@ extern "C" {
 
       f_string_dynamic *parameters_value_1[] = {
         &data->path_data_build,
+        &data->path_data_settings,
       };
 
       f_string_dynamic *parameters_value_2[] = {
@@ -69,6 +71,7 @@ extern "C" {
         fake_path_part_programs,
         fake_path_part_settings,
         fake_path_part_build,
+        fake_path_part_settings,
         fake_path_part_documents,
         fake_path_part_licenses,
         fake_path_part_bash,
@@ -85,6 +88,7 @@ extern "C" {
         fake_path_part_programs_length,
         fake_path_part_settings_length,
         fake_path_part_build_length,
+        fake_path_part_settings_length,
         fake_path_part_documents_length,
         fake_path_part_licenses_length,
         fake_path_part_bash_length,
@@ -101,6 +105,7 @@ extern "C" {
         &data->path_build_programs,
         &data->path_build_settings,
         &data->path_data_build,
+        &data->path_data_settings,
         &data->path_documents,
         &data->path_licenses,
         &data->path_sources_bash,
@@ -108,7 +113,7 @@ extern "C" {
         &data->path_sources_cpp,
       };
 
-      for (i = 0; i < 13; i++) {
+      for (i = 0; i < 14; i++) {
         status = fl_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]);
 
         if (F_status_is_error(status)) {
@@ -362,6 +367,7 @@ extern "C" {
         &data->path_build_programs_static,
         &data->path_build_settings,
         &data->path_data_build,
+        &data->path_data_settings,
         &data->path_licenses,
         &data->path_sources_bash,
         &data->path_sources_c,
@@ -381,7 +387,7 @@ extern "C" {
         &data->file_documents_readme,
       };
 
-      for (i = 0; i < 31; i++) {
+      for (i = 0; i < 32; i++) {
         if (parameters_value[i]->used == 0) continue;
 
         status = fl_string_dynamic_terminate(parameters_value[i]);
@@ -410,212 +416,6 @@ extern "C" {
   }
 #endif // _di_fake_path_generate_string_dynamic_
 
-#ifndef _di_fake_print_error_
-  f_return_status fake_print_error(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const bool fallback) {
-
-    if (status == F_parameter) {
-      if (verbosity != fake_verbosity_quiet) {
-        fprintf(f_type_error, "%c", f_string_eol);
-        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid parameter when calling function ");
-        fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
-        fl_color_print_line(f_type_error, context.error, context.reset, "().");
-      }
-
-      return F_none;
-    }
-
-    if (status == F_memory_allocation || status == F_memory_reallocation) {
-      if (verbosity != fake_verbosity_quiet) {
-        fprintf(f_type_error, "%c", f_string_eol);
-        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Unable to allocate memory in function ");
-        fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
-        fl_color_print_line(f_type_error, context.error, context.reset, "().");
-      }
-
-      return F_none;
-    }
-
-    if (fallback && verbosity != fake_verbosity_quiet) {
-      fprintf(f_type_error, "%c", f_string_eol);
-      fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: (");
-      fl_color_print(f_type_error, context.notable, context.reset, "%d", status);
-      fl_color_print(f_type_error, context.error, context.reset, ") in function ");
-      fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
-      fl_color_print_line(f_type_error, context.error, context.reset, "().");
-    }
-
-    return F_unknown;
-  }
-#endif // _di_fake_print_error_
-
-#ifndef _di_fake_print_error_file_
-  f_return_status fake_print_error_file(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const f_string name, const f_string operation, const bool is_file, const bool fallback) {
-    f_string file_or_directory = 0;
-
-    if (is_file) file_or_directory = "file";
-    else file_or_directory = "directory";
-
-    if (status == F_file_found_not) {
-      if (verbosity != fake_verbosity_quiet) {
-        fprintf(f_type_error, "%c", f_string_eol);
-        fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to find %s '", file_or_directory);
-        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
-      }
-
-      return F_none;
-    }
-
-    if (status == F_parameter) {
-      if (verbosity != fake_verbosity_quiet) {
-        fprintf(f_type_error, "%c", f_string_eol);
-        fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
-        fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
-        fl_color_print(f_type_error, context.error, context.reset, "() for the %s '", file_or_directory);
-        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
-      }
-
-      return F_none;
-    }
-
-    if (status == F_name) {
-      if (verbosity != fake_verbosity_quiet) {
-        fprintf(f_type_error, "%c", f_string_eol);
-        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid %s name '", file_or_directory);
-        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
-      }
-
-      return F_none;
-    }
-
-    if (status == F_memory_out) {
-      if (verbosity != fake_verbosity_quiet) {
-        fprintf(f_type_error, "%c", f_string_eol);
-        fl_color_print(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, file_or_directory);
-        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
-      }
-
-      return F_none;
-    }
-
-    if (status == F_number_overflow) {
-      if (verbosity != fake_verbosity_quiet) {
-        fprintf(f_type_error, "%c", f_string_eol);
-        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Overflow while trying to %s %s '", operation, file_or_directory);
-        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
-      }
-
-      return F_none;
-    }
-
-    if (status == F_directory) {
-      if (verbosity != fake_verbosity_quiet) {
-        fprintf(f_type_error, "%c", f_string_eol);
-        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid directory while trying to %s %s '", operation, file_or_directory);
-        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
-      }
-
-      return F_none;
-    }
-
-    if (status == F_access_denied) {
-      if (verbosity != fake_verbosity_quiet) {
-        fprintf(f_type_error, "%c", f_string_eol);
-        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Access denied while trying to %s %s '", operation, file_or_directory);
-        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
-      }
-
-      return F_none;
-    }
-
-    if (status == F_loop) {
-      if (verbosity != fake_verbosity_quiet) {
-        fprintf(f_type_error, "%c", f_string_eol);
-        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Loop while trying to %s %s '", operation, file_or_directory);
-        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
-      }
-
-      return F_none;
-    }
-
-    if (is_file) {
-      if (status == F_directory_found_not) {
-        if (verbosity != fake_verbosity_quiet) {
-          fprintf(f_type_error, "%c", f_string_eol);
-          fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
-          fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-          fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path.");
-        }
-
-        return F_none;
-      }
-    }
-    else {
-      if (status == F_directory_found_not) {
-        if (verbosity != fake_verbosity_quiet) {
-          fprintf(f_type_error, "%c", f_string_eol);
-          fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
-          fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-          fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path.");
-        }
-
-        return F_none;
-      }
-
-      if (status == F_failure) {
-        if (verbosity != fake_verbosity_quiet) {
-          fprintf(f_type_error, "%c", f_string_eol);
-          fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
-          fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-          fl_color_print_line(f_type_error, context.error, context.reset, "'.");
-        }
-
-        return F_none;
-      }
-    }
-
-    if (fake_print_error(context, verbosity, status, function, F_false) == F_unknown && fallback && verbosity != fake_verbosity_quiet) {
-      fprintf(f_type_error, "%c", f_string_eol);
-      fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: (");
-      fl_color_print(f_type_error, context.notable, context.reset, "%d", status);
-      fl_color_print(f_type_error, context.error, context.reset, ") occurred while trying to %s %s '", operation, file_or_directory);
-      fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
-      fl_color_print_line(f_type_error, context.error, context.reset, "'.");
-    }
-
-    return F_unknown;
-  }
-#endif // _di_fake_print_error_file_
-
-#ifndef _di_fake_print_error_parameter_missing_value_
-  void fake_print_error_parameter_missing_value(const fl_color_context context, const uint8_t verbosity, const f_string parameter) {
-    if (verbosity != fake_verbosity_quiet) {
-      fprintf(f_type_error, "%c", f_string_eol);
-      fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '");
-      fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter);
-      fl_color_print_line(f_type_error, context.error, context.reset, "' was specified, but no value was given.");
-    }
-  }
-#endif // _di_fake_print_error_parameter_missing_value_
-
-#ifndef _di_fake_print_error_parameter_too_many_
-  void fake_print_error_parameter_too_many(const fl_color_context context, const uint8_t verbosity, const f_string parameter) {
-    if (verbosity != fake_verbosity_quiet) {
-      fprintf(f_type_error, "%c", f_string_eol);
-      fl_color_print(f_type_error, context.error, context.reset, "ERROR: the parameter '");
-      fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter);
-      fl_color_print_line(f_type_error, context.error, context.reset, "' specified too many times.");
-    }
-  }
-#endif // _di_fake_print_error_parameter_too_many_
-
 #ifndef _di_fake_process_console_parameters_
   f_return_status fake_process_console_parameters(const f_console_arguments arguments, fake_data *data) {
     f_status status = F_none;
index f325be9b4c043f8039d1699d148cce4c91c84380..77419b6bc16969bc44cf1abfcec3b2f7fa27923c 100644 (file)
@@ -47,56 +47,6 @@ extern "C" {
 #endif // _di_fake_path_generate_string_dynamic_
 
 /**
- * Print generic error messages.
- *
- * @param context
- *   The color context.
- * @param verbosity
- *   The verbosity level, which determines if and what should be printed.
- * @param status
- *   The status code representing an error.
- * @param function
- *   The name of the function where the error happened.
- * @param fallback
- *   Set to F_true to print the fallback error message for unknown errors.
- *
- * @return
- *   F_none is returned on successful print of known errors.
- *   F_unknown is returned if the status code has no print message.
- */
-#ifndef _di_fake_print_error_
-  extern f_return_status fake_print_error(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const bool fallback) f_gcc_attribute_visibility_internal;
-#endif // _di_fake_print_error_
-
-/**
- * Print file/directory error messages.
- *
- * @param context
- *   The color context.
- * @param verbosity
- *   The verbosity level, which determines if and what should be printed.
- * @param status
- *   The error status code to report on.
- * @param function
- *   The function call that returned the error.
- * @param name
- *   The name of the file or directory.
- * @param operation
- *   The operation that failes, such as 'create' or 'access'.
- * @param is_file
- *   Set to TRUE if this is a file and FALSE if this is a directory.
- * @param fallback
- *   Set to F_true to print the fallback error message for unknown errors.
- *
- * @return
- *   F_none is returned on successful print of known errors.
- *   F_unknown is returned if the status code has no print message.
- */
-#ifndef _di_fake_print_error_file_
-  extern f_return_status fake_print_error_file(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const f_string name, const f_string operation, const bool is_file, const bool fallback) f_gcc_attribute_visibility_internal;
-#endif // _di_fake_print_error_file_
-
-/**
  * Print an error message for when the parameter is missing its accompanying value.
  *
  * @param context
index cc70223da20ce48199badb47aa716af356446abe..c934666e9be1f17dfa8ff1170986be784f144f73 100644 (file)
@@ -1,6 +1,7 @@
 #include <level_3/fake.h>
 #include "private-fake.h"
 #include "private-make.h"
+#include "private-print.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/level_3/fake/c/private-print.c b/level_3/fake/c/private-print.c
new file mode 100644 (file)
index 0000000..923ed6c
--- /dev/null
@@ -0,0 +1,449 @@
+#include <level_3/fake.h>
+#include "private-fake.h"
+#include "private-print.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fake_print_error_
+  f_return_status fake_print_error(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const bool fallback) {
+
+    if (status == F_parameter) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid parameter when calling function ");
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
+        fl_color_print_line(f_type_error, context.error, context.reset, "().");
+      }
+
+      return F_none;
+    }
+
+    if (status == F_memory_allocation || status == F_memory_reallocation) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Unable to allocate memory in function ");
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
+        fl_color_print_line(f_type_error, context.error, context.reset, "().");
+      }
+
+      return F_none;
+    }
+
+    if (fallback && verbosity != fake_verbosity_quiet) {
+      fprintf(f_type_error, "%c", f_string_eol);
+      fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: (");
+      fl_color_print(f_type_error, context.notable, context.reset, "%d", status);
+      fl_color_print(f_type_error, context.error, context.reset, ") in function ");
+      fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
+      fl_color_print_line(f_type_error, context.error, context.reset, "().");
+    }
+
+    return F_unknown;
+  }
+#endif // _di_fake_print_error_
+
+#ifndef _di_fake_print_error_file_
+  bool fake_print_error_file(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const f_string name, const f_string operation, const bool is_file, const bool fallback) {
+    f_string file_or_directory = 0;
+
+    if (is_file) file_or_directory = "file";
+    else file_or_directory = "directory";
+
+    if (status == F_file_found_not) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to find %s '", file_or_directory);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_parameter) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
+        fl_color_print(f_type_error, context.error, context.reset, "() for the %s '", file_or_directory);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_name) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid %s name '", file_or_directory);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_memory_out) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, file_or_directory);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_number_overflow) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Overflow while trying to %s %s '", operation, file_or_directory);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_directory) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid directory while trying to %s %s '", operation, file_or_directory);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_access_denied) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Access denied while trying to %s %s '", operation, file_or_directory);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_loop) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Loop while trying to %s %s '", operation, file_or_directory);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_prohibited) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Prohibited by system while trying to %s %s '", operation, file_or_directory);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (is_file) {
+      if (status == F_directory_found_not) {
+        if (verbosity != fake_verbosity_quiet) {
+          fprintf(f_type_error, "%c", f_string_eol);
+          fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+          fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path.");
+        }
+
+        return F_false;
+      }
+    }
+    else {
+      if (status == F_directory_found_not) {
+        if (verbosity != fake_verbosity_quiet) {
+          fprintf(f_type_error, "%c", f_string_eol);
+          fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+          fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path.");
+        }
+
+        return F_false;
+      }
+
+      if (status == F_failure) {
+        if (verbosity != fake_verbosity_quiet) {
+          fprintf(f_type_error, "%c", f_string_eol);
+          fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+          fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+        }
+
+        return F_false;
+      }
+    }
+
+    if (fake_print_error(context, verbosity, status, function, F_false) == F_unknown && fallback && verbosity != fake_verbosity_quiet) {
+      fprintf(f_type_error, "%c", f_string_eol);
+      fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: (");
+      fl_color_print(f_type_error, context.notable, context.reset, "%d", status);
+      fl_color_print(f_type_error, context.error, context.reset, ") occurred while trying to %s %s '", operation, file_or_directory);
+      fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+      fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+    }
+
+    return F_true;
+  }
+#endif // _di_fake_print_error_file_
+
+#ifndef _di_fake_print_error_operation_
+  bool fake_print_error_operation(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const f_string operation, const f_string how, const f_string source, const f_string destination, const bool fallback) {
+
+    if (status == F_file_found_not) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to find '");
+
+        if (f_file_exists(source) == F_true) {
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+        else {
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+        }
+
+        fl_color_print(f_type_error, context.error, context.reset, "' while trying to %s '", operation);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+        if (destination) {
+          fl_color_print(f_type_error, context.error, context.reset, "' %s '", how);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_parameter) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
+        fl_color_print(f_type_error, context.error, context.reset, "() to %s '", operation);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+        if (destination) {
+          fl_color_print(f_type_error, context.error, context.reset, "' %s '", how);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_name) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid name for '");
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+        if (destination) {
+          fl_color_print(f_type_error, context.error, context.reset, "' or '");
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_memory_out) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to %s '", operation);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+        if (destination) {
+          fl_color_print(f_type_error, context.error, context.reset, "' %s '", how);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_number_overflow) {
+      if (verbosity != fake_verbosity_quiet) {
+
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Overflow while trying to %s '", operation);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+        if (destination) {
+          fl_color_print(f_type_error, context.error, context.reset, "' %s '", how);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_directory) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid directory while trying to %s '", operation);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+        if (destination) {
+          fl_color_print(f_type_error, context.error, context.reset, "' %s '", how);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_access_denied) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Access denied while trying to %s '", operation);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+        if (destination) {
+          fl_color_print(f_type_error, context.error, context.reset, "' %s '", how);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_loop) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Loop while trying to %s '", operation);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+        if (destination) {
+          fl_color_print(f_type_error, context.error, context.reset, "' %s '", how);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_prohibited) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Prohibited by system while trying to %s '", operation);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+        if (destination) {
+          fl_color_print(f_type_error, context.error, context.reset, "' %s '", how);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_directory_found_not) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to %s '", operation);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+        if (destination) {
+          fl_color_print(f_type_error, context.error, context.reset, "' %s '", how);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+
+        fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path.");
+      }
+
+      return F_false;
+    }
+
+    if (status == F_failure) {
+      if (verbosity != fake_verbosity_quiet) {
+        fprintf(f_type_error, "%c", f_string_eol);
+        fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to %s '", operation);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+        if (destination) {
+          fl_color_print(f_type_error, context.error, context.reset, "' %s '", how);
+          fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+        }
+
+        fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+      }
+
+      return F_false;
+    }
+
+    if (fake_print_error(context, verbosity, status, function, F_false) == F_unknown && fallback && verbosity != fake_verbosity_quiet) {
+      fprintf(f_type_error, "%c", f_string_eol);
+      fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: (");
+      fl_color_print(f_type_error, context.notable, context.reset, "%d", status);
+      fl_color_print(f_type_error, context.error, context.reset, ") occurred while trying to %s '", operation);
+      fl_color_print(f_type_error, context.notable, context.reset, "%s", source);
+
+      if (destination) {
+        fl_color_print(f_type_error, context.error, context.reset, "' %s '", how);
+        fl_color_print(f_type_error, context.notable, context.reset, "%s", destination);
+      }
+
+      fl_color_print_line(f_type_error, context.error, context.reset, "'.");
+    }
+
+    return F_true;
+  }
+#endif // _di_fake_print_error_operation_
+
+#ifndef _di_fake_print_error_parameter_missing_value_
+  void fake_print_error_parameter_missing_value(const fl_color_context context, const uint8_t verbosity, const f_string parameter) {
+    if (verbosity != fake_verbosity_quiet) {
+      fprintf(f_type_error, "%c", f_string_eol);
+      fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '");
+      fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter);
+      fl_color_print_line(f_type_error, context.error, context.reset, "' was specified, but no value was given.");
+    }
+  }
+#endif // _di_fake_print_error_parameter_missing_value_
+
+#ifndef _di_fake_print_error_parameter_too_many_
+  void fake_print_error_parameter_too_many(const fl_color_context context, const uint8_t verbosity, const f_string parameter) {
+    if (verbosity != fake_verbosity_quiet) {
+      fprintf(f_type_error, "%c", f_string_eol);
+      fl_color_print(f_type_error, context.error, context.reset, "ERROR: the parameter '");
+      fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter);
+      fl_color_print_line(f_type_error, context.error, context.reset, "' specified too many times.");
+    }
+  }
+#endif // _di_fake_print_error_parameter_too_many_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fake/c/private-print.h b/level_3/fake/c/private-print.h
new file mode 100644 (file)
index 0000000..459b6f5
--- /dev/null
@@ -0,0 +1,128 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: Featureless Make
+ * API Version: 0.5
+ * Licenses: lgplv2.1
+ */
+#ifndef _PRIVATE_fake_print_h
+#define _PRIVATE_fake_print_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print generic error messages.
+ *
+ * @param context
+ *   The color context.
+ * @param verbosity
+ *   The verbosity level, which determines if and what should be printed.
+ * @param status
+ *   The status code representing an error.
+ * @param function
+ *   The name of the function where the error happened.
+ * @param fallback
+ *   Set to F_true to print the fallback error message for unknown errors.
+ *
+ * @return
+ *   F_none is returned on successful print of known errors.
+ *   F_unknown is returned if the status code has no print message.
+ */
+#ifndef _di_fake_print_error_
+  extern f_return_status fake_print_error(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const bool fallback) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_print_error_
+
+/**
+ * Print file/directory error messages.
+ *
+ * @param context
+ *   The color context.
+ * @param verbosity
+ *   The verbosity level, which determines if and what should be printed.
+ * @param status
+ *   The error status code to report on.
+ * @param function
+ *   The function call that returned the error.
+ * @param name
+ *   The name of the file or directory.
+ * @param operation
+ *   The operation that failes, such as 'create' or 'access'.
+ * @param is_file
+ *   Set to TRUE if this is a file and FALSE if this is a directory.
+ * @param fallback
+ *   Set to F_true to print the fallback error message for unknown errors.
+ *
+ * @return
+ *   F_false is returned on successful print of known errors.
+ *   F_true is returned if the status code has no print message.
+ */
+#ifndef _di_fake_print_error_file_
+  extern bool fake_print_error_file(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const f_string name, const f_string operation, const bool is_file, const bool fallback) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_print_error_file_
+
+/**
+ * Print operation error messages.
+ *
+ * @param context
+ *   The color context.
+ * @param verbosity
+ *   The verbosity level, which determines if and what should be printed.
+ * @param status
+ *   The error status code to report on.
+ * @param function
+ *   The name of the function where the error happened.
+ * @param operation
+ *   The operation performed.
+ * @param how
+ *   The how the operation is perform, such as "to" in "copy" source "to" destination.
+ * @param source
+ *   The operation source.
+ * @param destination
+ *   The operation destination, if applicable.
+ *   Set to 0 to disable.
+ * @param fallback
+ *   Set to F_true to print the fallback error message for unknown errors.
+ *
+ * @return
+ *   F_false is returned on successful print of known errors.
+ *   F_true is returned if the status code has no print message.
+ */
+#ifndef _di_fake_print_error_operation_
+  extern bool fake_print_error_operation(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const f_string operation, const f_string how, const f_string source, const f_string destination, const bool fallback) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_print_error_operation_
+
+/**
+ * Print an error message for when the parameter is missing its accompanying value.
+ *
+ * @param context
+ *   The color context.
+ * @param verbosity
+ *   The verbosity level, which determines if and what should be printed.
+ * @param parameter
+ *   The parameter name.
+ */
+#ifndef _di_fake_print_error_parameter_missing_value_
+  extern void fake_print_error_parameter_missing_value(const fl_color_context context, const uint8_t verbosity, const f_string parameter) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_print_error_parameter_missing_value_
+
+/**
+ * Print an error message for when the parameter is specified too many times.
+ *
+ * @param context
+ *   The color context.
+ * @param verbosity
+ *   The verbosity level, which determines if and what should be printed.
+ * @param parameter
+ *   The parameter name.
+ */
+#ifndef _di_fake_print_error_parameter_too_many_
+  extern void fake_print_error_parameter_too_many(const fl_color_context context, const uint8_t verbosity, const f_string parameter) f_gcc_attribute_visibility_internal;
+#endif // _di_fake_print_error_parameter_too_many_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _PRIVATE_fake_print_h
index 0804aed390a5c09a125f41e0c795d9d1873d654c..144738f22dcae8eb019d69dceabedcfb1b0aa919 100644 (file)
@@ -1,5 +1,6 @@
 #include <level_3/fake.h>
 #include "private-fake.h"
+#include "private-print.h"
 #include "private-skeleton.h"
 
 #ifdef __cplusplus
@@ -20,6 +21,7 @@ extern "C" {
         &data.path_build,
         &data.path_data,
         &data.path_data_build,
+        &data.path_data_settings,
         &data.path_documents,
         &data.path_licenses,
         &data.path_sources,
@@ -38,7 +40,7 @@ extern "C" {
         &data.path_work_programs_static,
       };
 
-      for (uint8_t i = 0; i < 19; i++) {
+      for (uint8_t i = 0; i < 20; i++) {
         status = fake_skeleton_operate_directory_create(data, *parameters_value[i]);
 
         if (F_status_is_error(status)) {
index caba0448117b2552a490df1b93e6d30439f92c83..2a9c92dfc1a363456a0ba3d9ad6745adab6eb7b8 100755 (executable)
@@ -235,8 +235,6 @@ process_pre_main(){
     if [[ $defines != "" ]] ; then
       echo -e "  Defines: $c_reset$c_notice$defines$c_reset"
     fi
-
-    echo
   fi
 
   # cleanup and return.
index f6c63be9d86e4f9452765a95cfe3ab95b9c6cfa8..12a81c30853c94ec5b9eebcf9c6810c0a2d61f3c 100644 (file)
@@ -24,7 +24,7 @@ build_libraries_fll-monolithic -lfll
 build_libraries-individual -lfll_execute -lfll_fss -lfll_program -lfl_color -lfl_console -lfl_file -lfl_fss -lfl_status -lfl_string -lfl_utf -lf_environment -lf_file -lf_console -lf_conversion -lf_directory -lf_path -lf_print -lf_utf -lf_memory
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
-build_sources_library fake.c private-fake.c private-clean.c private-build.c private-make.c private-skeleton.c
+build_sources_library fake.c private-fake.c private-clean.c private-build.c private-make.c private-print.c private-skeleton.c
 build_sources_program main.c
 build_sources_headers fake.h
 build_sources_setting