]> Kevux Git Server - fll/commitdiff
Update: Have fll_program_print_copyright() use year and author as a parameter.
authorKevin Day <kevin@kevux.org>
Wed, 10 Apr 2024 02:48:15 +0000 (21:48 -0500)
committerKevin Day <kevin@kevux.org>
Wed, 10 Apr 2024 02:48:15 +0000 (21:48 -0500)
The year and author may be more subject to change.
Relocate this into a global static string and provide this is a parameter to fll_program_print_copyright().
The fll_program_print_copyright() is only intended for FLL projects.

Additional programs that I write, like controller, may also depend on this.
These may be operated on at a different time and thus may require the year or author to be updated.

Any more changes than this and it is probably a better idea to just implement ones own copyright print function.

17 files changed:
level_2/fll_program/c/program/common.c
level_2/fll_program/c/program/common.h
level_2/fll_program/c/program/print.c
level_2/fll_program/c/program/print.h
level_3/byte_dump/c/main/byte_dump.c
level_3/control/c/main/control.c
level_3/controller/c/controller.c
level_3/example/c/main/example.c
level_3/fake/c/main/fake.c
level_3/firewall/c/main/firewall.c
level_3/fss_identify/c/main/fss_identify.c
level_3/fss_read/c/main/fss_read.c
level_3/fss_write/c/main/fss_write.c
level_3/iki_read/c/main/iki_read.c
level_3/iki_write/c/main/iki_write.c
level_3/status_code/c/main/status_code.c
level_3/utf8/c/main/utf8.c

index b1c83ab675364316f76b3a69608681746bb9bd34..6da3e49730877698f7ceecb9c899eb377c801749 100644 (file)
@@ -14,6 +14,12 @@ extern "C" {
   #endif // _di_fll_program_parameter_filenames_s_
 #endif // _di_fll_program_parameter_s_
 
+#ifndef _di_fll_program_copyright_s_
+  #ifndef _di_fll_program_copyright_year_author_s_
+    const f_string_static_t fll_program_copyright_year_author_s = macro_f_string_static_t_initialize_1(FLL_program_copyright_year_author_s, 0, FLL_program_copyright_year_author_s_length);
+  #endif // _di_fll_program_copyright_year_author_s_
+#endif // _di_fll_program_copyright_s_
+
 #ifndef _di_fll_program_data_delete_
   f_status_t fll_program_data_delete(fll_program_data_t * const data) {
     #ifndef _di_level_2_parameter_checking_
index 37666bc561697a80f9919fd9ba0d684e30b85b07..04a8c022f86d4ce0a0c461cdf460ee8098dae2e5 100644 (file)
 extern "C" {
 #endif
 
+/**
+ * Program parameter strings.
+ *
+ * fll_program_parameter_*_s:
+ *   - filename:  The file name parameter string.
+ *   - filenames: The file name(s) parameter string.
+ */
 #ifndef _di_fll_program_parameter_s_
   #define FLL_program_parameter_filename_s  "filename"
   #define FLL_program_parameter_filenames_s "filename(s)"
@@ -33,6 +40,22 @@ extern "C" {
 #endif // _di_fll_program_parameter_s_
 
 /**
+ * Copyright relating strings.
+ *
+ * fll_program_copyright_*_s:
+ *   - year_author: The year and author used by the FLL project.
+ */
+#ifndef _di_fll_program_copyright_s_
+  #define FLL_program_copyright_year_author_s  "2007-2024 Kevin Day"
+
+  #define FLL_program_copyright_year_author_s_length 19
+
+  #ifndef _di_fll_program_copyright_year_author_s_
+    extern const f_string_static_t fll_program_copyright_year_author_s;
+  #endif // _di_fll_program_copyright_year_author_s_
+#endif // _di_fll_program_copyright_s_
+
+/**
  * Program data pipe codes.
  *
  * These are bit-wise codes used to designate that a particular pipe exists and is to be used.
index d693556fe250c9619f0b564879f0acd0a8937325..6f6d30dd8092d0709641730e95a4fed2fa7ff79c 100644 (file)
@@ -6,14 +6,14 @@ extern "C" {
 #endif
 
 #ifndef _di_fll_program_print_copyright_
-  f_status_t fll_program_print_copyright(fl_print_t * const print) {
+  f_status_t fll_program_print_copyright(fl_print_t * const print, const f_string_static_t year_author) {
     #ifndef _di_level_2_parameter_checking_
       if (!print) return F_status_set_error(F_parameter);
     #endif // _di_level_2_parameter_checking_
 
     f_file_stream_lock(print->to);
 
-    fl_print_format("Copyright © 2007-2024 Kevin Day.%r", print->to, f_string_eol_s);
+    fl_print_format("Copyright © %Q.%r", print->to, year_author, f_string_eol_s);
 
     #ifndef _di_detailed_copyright_
       if (print->verbosity > f_console_verbosity_quiet_e) {
index 41cbdefe25f750c30a0daa5ab168fd722ca72e02..1b2b9c27d89cd548bc5df55786a3b8a4c676fff5 100644 (file)
@@ -22,6 +22,8 @@ extern "C" {
  * @param print
  *   The output structure to print to.
  *   The print.verbosity is used to determine how much detail is printed (except for when _di_detailed_copyright_ is set).
+ * @param year_author
+ *   The year and author to be printed with the copyright symbol line.
  *
  * @return
  *   F_okay on success.
@@ -30,7 +32,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  */
 #ifndef _di_fll_program_print_copyright_
-  extern f_status_t fll_program_print_copyright(fl_print_t * const print);
+  extern f_status_t fll_program_print_copyright(fl_print_t * const print, const f_string_static_t year_author);
 #endif // _di_fll_program_print_copyright_
 
 /**
index ce24620bb59fb0cc3ee2ba07d7c1c892c46f27c0..d4e610bd4742376e010b6990b0bb87b91f9f2d65 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, byte_dump_program_version_s);
       }
       else if (main->setting.flag & byte_dump_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & byte_dump_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index 7914da078209d14df7b5585e4253a7ccb03c2473..69699c82b5d0626b6ea164232c8652c1e17eead4 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, control_program_version_s);
       }
       else if (main->setting.flag & control_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & control_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index cfe5ab9ffef67c7eb07657a8974d602f81ba55a3..d5b7abe8405098c091592810f4a3793746c70480 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, controller_program_version_s);
       }
       else if (main->setting.flag & controller_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & controller_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index d86c4005072fed4c3eb2b579bfe35d345501f911..9f006ce07ecb6b928740dbd657aa7479157ff4c0 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, example_program_version_s);
       }
       else if (main->setting.flag & example_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & example_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index aae7120a6a70ee296ded5a58fddb9b4b52772f62..4606f739198e42c789a7a601f889fc19d6eb5e6f 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, fake_program_version_s);
       }
       else if (main->setting.flag & fake_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & fake_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index 14fe05bd0225a5eb66bb491f9638e659cf78026d..9dd4bc396336520d992382e94154f162439bf818 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, firewall_program_version_s);
       }
       else if (main->setting.flag & firewall_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & firewall_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index c15ad1d952daabb7e061dca545e01edac8b6abdb..3a86aa875fdb5a847705a4227e0926a48a952ee8 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, fss_identify_program_version_s);
       }
       else if (main->setting.flag & fss_identify_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & fss_identify_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index 9a6ec49be7182f55023377a31a917dd4b418ec0e..d76b3b7dcfd043497b80d0d95cac1b5eb29b73fd 100644 (file)
@@ -79,7 +79,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, fss_read_program_version_s);
       }
       else if (main->setting.flag & fss_read_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & fss_read_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index 710bb8a4b874df4c57daf5b07c64e8247b3580ce..e95b4bcf4ba81d5db7c8b177a9c66bda20ea5350 100644 (file)
@@ -38,7 +38,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, fss_write_program_version_s);
       }
       else if (main->setting.flag & fss_write_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & fss_write_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index 790602fa9f05dc3b0d0cda263f0bbe1c4fb6ea89..39ba8b5929c84d422eda615699907419a04ff3d2 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, iki_read_program_version_s);
       }
       else if (main->setting.flag & iki_read_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & iki_read_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index 17deee2e220138812785321cf64b849c53b0c603..28e1e98525b179c21067e7e8c9874dfb5c57fda6 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, iki_write_program_version_s);
       }
       else if (main->setting.flag & iki_write_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & iki_write_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index 77a794a077f25f95c252a927b97f05374d4c4809..886ab6269ff302b3355d143d6c9ffdeb302ba807 100644 (file)
@@ -49,7 +49,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, status_code_program_version_s);
       }
       else if (main->setting.flag & status_code_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & status_code_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
index 67de3a35edcc1f9c3716fea84005218c9a9f1799..2fb3c88a9c4c7ae591d1e2af7d31d7918cf3cd04 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
         fll_program_print_version(&main->program.message, utf8_program_version_s);
       }
       else if (main->setting.flag & utf8_main_flag_copyright_e) {
-        fll_program_print_copyright(&main->program.message);
+        fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
       }
 
       if ((main->setting.flag & utf8_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {