Provide copyright printing that can be slighty fine tuned using verbosity.
Provide a define (_di_detailed_copyright_) for reducing some of the string printed.
#endif
#ifndef _di_f_console_standard_s_
+ const f_string_static_t f_console_standard_short_copyright_s = macro_f_string_static_t_initialize((f_string_t) F_console_standard_short_copyright_s, 0, F_console_standard_short_copyright_s_length);
const f_string_static_t f_console_standard_short_dark_s = macro_f_string_static_t_initialize((f_string_t) F_console_standard_short_dark_s, 0, F_console_standard_short_dark_s_length);
const f_string_static_t f_console_standard_short_debug_s = macro_f_string_static_t_initialize((f_string_t) F_console_standard_short_debug_s, 0, F_console_standard_short_debug_s_length);
const f_string_static_t f_console_standard_short_error_s = macro_f_string_static_t_initialize((f_string_t) F_console_standard_short_error_s, 0, F_console_standard_short_error_s_length);
const f_string_static_t f_console_standard_short_verbose_s = macro_f_string_static_t_initialize((f_string_t) F_console_standard_short_verbose_s, 0, F_console_standard_short_verbose_s_length);
const f_string_static_t f_console_standard_short_version_s = macro_f_string_static_t_initialize((f_string_t) F_console_standard_short_version_s, 0, F_console_standard_short_version_s_length);
+ const f_string_static_t f_console_standard_long_copyright_s = macro_f_string_static_t_initialize((f_string_t) F_console_standard_long_copyright_s, 0, F_console_standard_long_copyright_s_length);
const f_string_static_t f_console_standard_long_dark_s = macro_f_string_static_t_initialize((f_string_t) F_console_standard_long_dark_s, 0, F_console_standard_long_dark_s_length);
const f_string_static_t f_console_standard_long_debug_s = macro_f_string_static_t_initialize((f_string_t) F_console_standard_long_debug_s, 0, F_console_standard_long_debug_s_length);
const f_string_static_t f_console_standard_long_error_s = macro_f_string_static_t_initialize((f_string_t) F_console_standard_long_error_s, 0, F_console_standard_long_error_s_length);
* - verbose: Increase verbosity, print more, in some use cases this could mean printing just about everything.
*
* The following are less subjective in interpretation but do allow some flexibility.
- * - dark: Do display color intended for dark backgrounds (often the default behavior) when printing to the console. Other contexts may be acceptable (such as voice inflections, or lack-thereof) for audio.)
- * - help: Display the help text. This does not define how the text is displayed only that the text is displayed.
- * - light: Do display color intended for light backgrounds when printing to the console. Other contexts may be acceptable (such as voice inflections, or lack-thereof) for audio.)
- * - no_color: Do not display color when printing to the console. Other contexts may be acceptable (such as voice inflections, or lack-thereof) for audio.)
- * - version: Should always print only the version number, no colors, but what represents the version number is undefined by this project.
+ * - copyright: Display copyright, if compiled in (consider combining with quiet, verbose, and normal).
+ * - dark: Do display color intended for dark backgrounds (often the default behavior) when printing to the console. Other contexts may be acceptable (such as voice inflections, or lack-thereof) for audio.)
+ * - help: Display the help text. This does not define how the text is displayed only that the text is displayed.
+ * - light: Do display color intended for light backgrounds when printing to the console. Other contexts may be acceptable (such as voice inflections, or lack-thereof) for audio.)
+ * - no_color: Do not display color when printing to the console. Other contexts may be acceptable (such as voice inflections, or lack-thereof) for audio.)
+ * - version: Should always print only the version number, no colors, but what represents the version number is undefined by this project.
*
* The following options are for special purposes:
* - status_in: Is intended to accept the name of an environment variable in which to read the status from.
* - To avoid problems with the status code after a program is forcibly killed, the status_out environment variable should be cleared at program start.
*/
#ifndef _di_f_console_standard_s_
+ #define F_console_standard_short_copyright_s "C"
#define F_console_standard_short_dark_s "d"
#define F_console_standard_short_debug_s "D"
#define F_console_standard_short_error_s "E"
#define F_console_standard_short_verbose_s "V"
#define F_console_standard_short_version_s "v"
+ #define F_console_standard_short_copyright_s_length 1
#define F_console_standard_short_dark_s_length 1
#define F_console_standard_short_debug_s_length 1
#define F_console_standard_short_error_s_length 1
#define F_console_standard_short_verbose_s_length 1
#define F_console_standard_short_version_s_length 1
+ #define F_console_standard_long_copyright_s "copyright"
#define F_console_standard_long_dark_s "dark"
#define F_console_standard_long_debug_s "debug"
#define F_console_standard_long_error_s "error"
#define F_console_standard_long_verbose_s "verbose"
#define F_console_standard_long_version_s "version"
+ #define F_console_standard_long_copyright_s_length 9
#define F_console_standard_long_dark_s_length 4
#define F_console_standard_long_debug_s_length 5
#define F_console_standard_long_error_s_length 5
#define F_console_standard_long_verbose_s_length 7
#define F_console_standard_long_version_s_length 7
+ extern const f_string_static_t f_console_standard_short_copyright_s;
extern const f_string_static_t f_console_standard_short_dark_s;
extern const f_string_static_t f_console_standard_short_debug_s;
extern const f_string_static_t f_console_standard_short_error_s;
extern const f_string_static_t f_console_standard_short_verbose_s;
extern const f_string_static_t f_console_standard_short_version_s;
+ extern const f_string_static_t f_console_standard_long_copyright_s;
extern const f_string_static_t f_console_standard_long_dark_s;
extern const f_string_static_t f_console_standard_long_debug_s;
extern const f_string_static_t f_console_standard_long_error_s;
extern "C" {
#endif
+#ifndef _di_byte_dump_print_copyright_
+ f_status_t byte_dump_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_byte_dump_print_copyright_
+
#ifndef _di_byte_dump_print_help_
f_status_t byte_dump_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, byte_dump_program_name_long_s, byte_dump_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- status = F_none;
-
if (main->parameters.array[byte_dump_parameter_help_e].result == f_console_result_found_e) {
byte_dump_print_help(main->output.to, main->context);
return F_none;
}
+ if (main->parameters.array[byte_dump_parameter_copyright_e].result == f_console_result_found_e) {
+ byte_dump_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
if (main->parameters.remaining.used || main->process_pipe) {
if (main->parameters.array[byte_dump_parameter_width_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_byte_dump_print_copyright_
+ extern f_status_t byte_dump_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_byte_dump_print_copyright_
+
+/**
* Print help.
*
* @param file
enum {
byte_dump_parameter_help_e,
+ byte_dump_parameter_copyright_e,
byte_dump_parameter_light_e,
byte_dump_parameter_dark_e,
byte_dump_parameter_no_color_e,
#define byte_dump_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(0, byte_dump_long_classic_s.string, 0, 0, f_console_type_normal_e), \
}
- #define byte_dump_total_parameters_d 26
+ #define byte_dump_total_parameters_d 27
#endif // _di_byte_dump_parameters_
#ifdef __cplusplus
# fss-0000
+_di_byte_dump_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
control_parameter_help_e = 0,
+ control_parameter_copyright_e,
control_parameter_light_e,
control_parameter_dark_e,
control_parameter_no_color_e,
#define control_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(control_short_socket_s.string, control_long_socket_s.string, 0, 1, f_console_type_normal_e), \
}
- #define control_total_parameters_d 14
+ #define control_total_parameters_d 15
#endif // _di_control_parameters_
/**
extern "C" {
#endif
+#ifndef _di_control_print_copyright_
+ f_status_t control_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_control_print_copyright_
+
#ifndef _di_control_print_help_
f_status_t control_print_help(const fll_program_data_t * const main) {
}
}
- status = F_none;
-
if (main->parameters.array[control_parameter_help_e].result == f_console_result_found_e) {
control_print_help(main);
return F_none;
}
+ if (main->parameters.array[control_parameter_copyright_e].result == f_console_result_found_e) {
+ control_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
{
uint8_t ids[] = {
control_parameter_name_e,
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_control_print_copyright_
+ extern f_status_t control_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_control_print_copyright_
+
+/**
* Print help.
*
* @param main
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
+
_controller_as_init_ The controller program is compiled as an init replacement and this control program should treat it as such.
_override_controller_name_socket_ Use this as the default custom file name representing the controller program socket.
_override_controller_name_socket_length_ The number of bytes representing the string in _override_controller_name_socket_ (not including the terminating NULL).
enum {
controller_parameter_help_e,
+ controller_parameter_copyright_e,
controller_parameter_light_e,
controller_parameter_dark_e,
controller_parameter_no_color_e,
#define controller_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(controller_short_validate_s.string, controller_long_validate_s.string, 0, 0, f_console_type_normal_e), \
}
- #define controller_total_parameters_d 20
+ #define controller_total_parameters_d 21
#endif // _di_controller_parameters_
/**
extern "C" {
#endif
+#ifndef _di_controller_print_copyright_
+ f_status_t controller_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_controller_print_copyright_
+
#ifndef _di_controller_print_help_
f_status_t controller_print_help(controller_main_t * const main) {
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[controller_parameter_help_e].result == f_console_result_found_e) {
controller_print_help(main);
return F_none;
}
+ if (main->parameters.array[controller_parameter_copyright_e].result == f_console_result_found_e) {
+ controller_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
controller_setting_t setting = controller_setting_t_initialize;
setting.control.server.address = (struct sockaddr *) &setting.control.address;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_controller_print_copyright_
+ extern f_status_t controller_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_controller_print_copyright_
+
+/**
* Print help.
*
* @param main
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
_di_libcap_ Disable libcap support, allow for compiling and linking without libcap (-lcap).
+
_libcap_legacy_only_ Disable functionality provided by later versions of libcap (2.43 and later).
_controller_as_init_ Build the program to run as if it were "init" by default, including displaying the program name as "Init Program" or "Init". This changes the main.c file only, leaving the library shareable between both "controller" and "init".
_override_controller_default_engine_ Provide a custom scripting engine name string to execute (such as php).
enum {
fake_parameter_help_e,
+ fake_parameter_copyright_e,
fake_parameter_light_e,
fake_parameter_dark_e,
fake_parameter_no_color_e,
#define fake_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(0, 0, fake_other_operation_skeleton_s.string, 0, f_console_type_other_e), \
}
- #define fake_total_parameters_d 29
+ #define fake_total_parameters_d 30
#endif // _di_fake_parameters_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_fake_print_copyright_
+ f_status_t fake_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fake_print_copyright_
+
#ifndef _di_fake_print_help_
f_status_t fake_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fake_program_name_long_s, fake_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
return F_none;
}
+ if (main->parameters.array[fake_parameter_copyright_e].result == f_console_result_found_e) {
+ fake_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
status = F_none;
fake_data_t data = fake_data_t_initialize;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fake_print_copyright_
+ extern f_status_t fake_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fake_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
_di_libcap_ Disable libcap support, allow for compiling and linking without libcap (-lcap).
+
_libcap_legacy_only_ Disable functionality provided by later versions of libcap (2.43 and later).
_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr.
_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue().
enum {
firewall_parameter_help_e,
+ firewall_parameter_copyright_e,
firewall_parameter_light_e,
firewall_parameter_dark_e,
firewall_parameter_no_color_e,
#define firewall_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(0, 0, firewall_command_show_s.string, 0, f_console_type_other_e), \
}
- #define firewall_total_parameters_d 15
+ #define firewall_total_parameters_d 16
#endif // _di_firewall_defines_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_firewall_print_copyright_
+ f_status_t firewall_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_firewall_print_copyright_
+
#ifndef _di_firewall_print_help_
f_status_t firewall_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, firewall_program_name_long_s, firewall_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
fl_print_format("%r%r %[Commands:%] ", file.stream, f_string_eol_s, f_string_eol_s, context.set.important, context.set.important);
fl_print_format("%r %[%r%] Turn on the firewall.", file.stream, f_string_eol_s, context.set.standout, firewall_command_start_s, context.set.standout);
}
}
- firewall_data_t data = firewall_data_t_initialize;
- data.main = main;
- data.argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[firewall_parameter_help_e].result == f_console_result_found_e) {
firewall_print_help(main->output.to, main->context);
return F_none;
}
- // now determine which command was placed first
+ if (main->parameters.array[firewall_parameter_copyright_e].result == f_console_result_found_e) {
+ firewall_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
+ firewall_data_t data = firewall_data_t_initialize;
+ data.main = main;
+ data.argv = main->parameters.arguments.array;
+
+ // Now determine which command was placed first
bool found_command = F_false;
unsigned int command = 0;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_firewall_print_copyright_
+ extern f_status_t firewall_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_firewall_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
_di_libcap_ Disable libcap support, allow for compiling and linking without libcap (-lcap).
+
_libcap_legacy_only_ Disable functionality provided by later versions of libcap (2.43 and later).
_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr.
_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue().
enum {
fss_basic_list_read_parameter_help_e,
+ fss_basic_list_read_parameter_copyright_e,
fss_basic_list_read_parameter_light_e,
fss_basic_list_read_parameter_dark_e,
fss_basic_list_read_parameter_no_color_e,
#define fss_basic_list_read_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_basic_list_read_short_trim_s.string, fss_basic_list_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_basic_list_read_total_parameters_d 24
+ #define fss_basic_list_read_total_parameters_d 25
#endif // _di_fss_basic_list_read_parameters_
/**
extern "C" {
#endif
+#ifndef _di_fss_basic_list_read_print_copyright_
+ f_status_t fss_basic_list_read_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_basic_list_read_print_copyright_
+
#ifndef _di_fss_basic_list_read_print_help_
f_status_t fss_basic_list_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_basic_list_read_program_name_long_s, fss_basic_list_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- status = F_none;
-
if (main->parameters.array[fss_basic_list_read_parameter_help_e].result == f_console_result_found_e) {
fss_basic_list_read_print_help(main->output.to, main->context);
- return status;
+ return F_none;
}
if (main->parameters.array[fss_basic_list_read_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_basic_list_read_program_version_s);
- return status;
+ return F_none;
}
+ if (main->parameters.array[fss_basic_list_read_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_basic_list_read_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
// Provide a range designating where within the buffer a particular file exists, using a statically allocated array.
fss_basic_list_read_file_t files_array[main->parameters.remaining.used + 1];
fss_basic_list_read_data_t data = fss_basic_list_read_data_t_initialize;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_basic_list_read_print_copyright_
+ extern f_status_t fss_basic_list_read_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_basic_list_read_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_basic_list_write_parameter_help_e,
+ fss_basic_list_write_parameter_copyright_e,
fss_basic_list_write_parameter_light_e,
fss_basic_list_write_parameter_dark_e,
fss_basic_list_write_parameter_no_color_e,
#define fss_basic_list_write_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_basic_list_write_short_trim_s.string, fss_basic_list_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_basic_list_write_total_parameters_d 19
+ #define fss_basic_list_write_total_parameters_d 20
#endif // _di_fss_basic_list_write_parameters_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_fss_basic_list_write_print_copyright_
+ f_status_t fss_basic_list_write_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_basic_list_write_print_copyright_
+
#ifndef _di_fss_basic_list_write_print_help_
f_status_t fss_basic_list_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_basic_list_write_program_name_long_s, fss_basic_list_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[fss_basic_list_write_parameter_help_e].result == f_console_result_found_e) {
fss_basic_list_write_print_help(main->output.to, main->context);
- return status;
+ return F_none;
}
if (main->parameters.array[fss_basic_list_write_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_basic_list_write_program_version_s);
- return status;
+ return F_none;
}
+ if (main->parameters.array[fss_basic_list_write_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_basic_list_write_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
+ status = F_none;
+
f_file_t output = f_file_t_initialize;
output.id = F_type_descriptor_output_d;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_basic_list_write_print_copyright_
+ extern f_status_t fss_basic_list_write_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_basic_list_write_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_basic_read_parameter_help_e,
+ fss_basic_read_parameter_copyright_e,
fss_basic_read_parameter_light_e,
fss_basic_read_parameter_dark_e,
fss_basic_read_parameter_no_color_e,
#define fss_basic_read_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
extern "C" {
#endif
+#ifndef _di_fss_basic_read_print_copyright_
+ f_status_t fss_basic_read_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_basic_read_print_copyright_
+
#ifndef _di_fss_basic_read_print_help_
f_status_t fss_basic_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_basic_read_program_name_long_s, fss_basic_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- status = F_none;
-
if (main->parameters.array[fss_basic_read_parameter_help_e].result == f_console_result_found_e) {
fss_basic_read_print_help(main->output.to, main->context);
- return status;
+ return F_none;
}
if (main->parameters.array[fss_basic_read_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_basic_read_program_version_s);
- return status;
+ return F_none;
}
+ if (main->parameters.array[fss_basic_read_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_basic_read_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
// Provide a range designating where within the buffer a particular file exists, using a statically allocated array.
fss_basic_read_file_t files_array[main->parameters.remaining.used + 1];
fss_basic_read_data_t data = fss_basic_read_data_t_initialize;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_basic_read_print_copyright_
+ extern f_status_t fss_basic_read_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_basic_read_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_basic_write_parameter_help_e,
+ fss_basic_write_parameter_copyright_e,
fss_basic_write_parameter_light_e,
fss_basic_write_parameter_dark_e,
fss_basic_write_parameter_no_color_e,
#define fss_basic_write_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_basic_write_short_trim_s.string, fss_basic_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_basic_write_total_parameters_d 18
+ #define fss_basic_write_total_parameters_d 19
#endif // _di_fss_basic_write_parameters_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_fss_basic_write_print_copyright_
+ f_status_t fss_basic_write_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_basic_write_print_copyright_
+
#ifndef _di_fss_basic_write_print_help_
f_status_t fss_basic_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_basic_write_program_name_long_s, fss_basic_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[fss_basic_write_parameter_help_e].result == f_console_result_found_e) {
fss_basic_write_print_help(main->output.to, main->context);
- return status;
+ return F_none;
}
if (main->parameters.array[fss_basic_write_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_basic_write_program_version_s);
- return status;
+ return F_none;
}
+ if (main->parameters.array[fss_basic_write_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_basic_write_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
f_file_t output = f_file_t_initialize;
output.id = F_type_descriptor_output_d;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_basic_write_print_copyright_
+ extern f_status_t fss_basic_write_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_basic_write_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_embedded_list_read_parameter_help_e,
+ fss_embedded_list_read_parameter_copyright_e,
fss_embedded_list_read_parameter_light_e,
fss_embedded_list_read_parameter_dark_e,
fss_embedded_list_read_parameter_no_color_e,
#define fss_embedded_list_read_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_trim_s.string, fss_embedded_list_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_embedded_list_read_total_parameters_d 24
+ #define fss_embedded_list_read_total_parameters_d 25
#endif // _di_fss_embedded_list_read_parameters_
/**
extern "C" {
#endif
+#ifndef _di_fss_embedded_list_read_print_copyright_
+ f_status_t fss_embedded_list_read_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_embedded_list_read_print_copyright_
+
#ifndef _di_fss_embedded_list_read_print_help_
f_status_t fss_embedded_list_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_embedded_list_read_program_name_long_s, fss_embedded_list_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- fss_embedded_list_read_data_t data = fss_embedded_list_read_data_t_initialize;
- data.main = main;
- data.argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[fss_embedded_list_read_parameter_help_e].result == f_console_result_found_e) {
fss_embedded_list_read_print_help(main->output.to, main->context);
- fss_embedded_list_read_data_delete(&data);
-
return F_none;
}
if (main->parameters.array[fss_embedded_list_read_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_embedded_list_read_program_version_s);
- fss_embedded_list_read_data_delete(&data);
+ return F_none;
+ }
+
+ if (main->parameters.array[fss_embedded_list_read_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_embedded_list_read_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
return F_none;
}
+ status = F_none;
+
+ fss_embedded_list_read_data_t data = fss_embedded_list_read_data_t_initialize;
+ data.main = main;
+ data.argv = main->parameters.arguments.array;
+
if (F_status_is_error_not(status) && main->parameters.array[fss_embedded_list_read_parameter_total_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_embedded_list_read_parameter_columns_e].result == f_console_result_found_e) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_embedded_list_read_print_copyright_
+ extern f_status_t fss_embedded_list_read_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_embedded_list_read_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_embedded_list_write_parameter_help_e,
+ fss_embedded_list_write_parameter_copyright_e,
fss_embedded_list_write_parameter_light_e,
fss_embedded_list_write_parameter_dark_e,
fss_embedded_list_write_parameter_no_color_e,
#define fss_embedded_list_write_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_trim_s.string, fss_embedded_list_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_embedded_list_write_total_parameters_d 19
+ #define fss_embedded_list_write_total_parameters_d 20
#endif // _di_fss_embedded_list_write_parameters_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_fss_embedded_list_write_print_copyright_
+ f_status_t fss_embedded_list_write_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_embedded_list_write_print_copyright_
+
#ifndef _di_fss_embedded_list_write_print_help_
f_status_t fss_embedded_list_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_embedded_list_write_program_name_long_s, fss_embedded_list_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[fss_embedded_list_write_parameter_help_e].result == f_console_result_found_e) {
fss_embedded_list_write_print_help(main->output.to, main->context);
- return status;
+ return F_none;
}
if (main->parameters.array[fss_embedded_list_write_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_embedded_list_write_program_version_s);
- return status;
+ return F_none;
}
+ if (main->parameters.array[fss_embedded_list_write_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_embedded_list_write_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
f_file_t output = f_file_t_initialize;
output.id = F_type_descriptor_output_d;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_embedded_list_write_print_copyright_
+ extern f_status_t fss_embedded_list_write_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_embedded_list_write_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_extended_list_read_parameter_help_e,
+ fss_extended_list_read_parameter_copyright_e,
fss_extended_list_read_parameter_light_e,
fss_extended_list_read_parameter_dark_e,
fss_extended_list_read_parameter_no_color_e,
#define fss_extended_list_read_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_extended_list_read_short_trim_s.string, fss_extended_list_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_extended_list_read_total_parameters_d 24
+ #define fss_extended_list_read_total_parameters_d 25
#endif // _di_fss_extended_list_read_parameters_
/**
extern "C" {
#endif
+#ifndef _di_fss_extended_list_read_print_copyright_
+ f_status_t fss_extended_list_read_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_extended_list_read_print_copyright_
+
#ifndef _di_fss_extended_list_read_print_help_
f_status_t fss_extended_list_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_extended_list_read_program_name_long_s, fss_extended_list_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- status = F_none;
-
if (main->parameters.array[fss_extended_list_read_parameter_help_e].result == f_console_result_found_e) {
fss_extended_list_read_print_help(main->output.to, main->context);
- return status;
+ return F_none;
}
if (main->parameters.array[fss_extended_list_read_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_extended_list_read_program_version_s);
- return status;
+ return F_none;
}
+ if (main->parameters.array[fss_extended_list_read_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_extended_list_read_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
// Provide a range designating where within the buffer a particular file exists, using a statically allocated array.
fss_extended_list_read_file_t files_array[main->parameters.remaining.used + 1];
fss_extended_list_read_data_t data = fss_extended_list_read_data_t_initialize;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_extended_list_read_print_copyright_
+ extern f_status_t fss_extended_list_read_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_extended_list_read_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_extended_list_write_parameter_help_e,
+ fss_extended_list_write_parameter_copyright_e,
fss_extended_list_write_parameter_light_e,
fss_extended_list_write_parameter_dark_e,
fss_extended_list_write_parameter_no_color_e,
#define fss_extended_list_write_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_extended_list_write_short_trim_s.string, fss_extended_list_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_extended_list_write_total_parameters_d 19
+ #define fss_extended_list_write_total_parameters_d 20
#endif // _di_fss_extended_list_write_parameters_
/**
extern "C" {
#endif
+#ifndef _di_fss_extended_list_write_print_copyright_
+ f_status_t fss_extended_list_write_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_extended_list_write_print_copyright_
+
#ifndef _di_fss_extended_list_write_print_help_
f_status_t fss_extended_list_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_extended_list_write_program_name_long_s, fss_extended_list_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[fss_extended_list_write_parameter_help_e].result == f_console_result_found_e) {
fss_extended_list_write_print_help(main->output.to, main->context);
- return status;
+ return F_none;
}
if (main->parameters.array[fss_extended_list_write_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_extended_list_write_program_version_s);
- return status;
+ return F_none;
}
+ if (main->parameters.array[fss_extended_list_write_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_extended_list_write_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
f_file_t output = f_file_t_initialize;
output.id = F_type_descriptor_output_d;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_extended_list_write_print_copyright_
+ extern f_status_t fss_extended_list_write_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_extended_list_write_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_extended_read_parameter_help_e,
+ fss_extended_read_parameter_copyright_e,
fss_extended_read_parameter_light_e,
fss_extended_read_parameter_dark_e,
fss_extended_read_parameter_no_color_e,
#define fss_extended_read_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_extended_read_short_trim_s.string, fss_extended_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_extended_read_total_parameters_d 24
+ #define fss_extended_read_total_parameters_d 25
#endif // _di_fss_extended_read_parameters_
/**
extern "C" {
#endif
+#ifndef _di_fss_extended_read_print_copyright_
+ f_status_t fss_extended_read_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_extended_read_print_copyright_
+
#ifndef _di_fss_extended_read_print_help_
f_status_t fss_extended_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_extended_read_program_name_long_s, fss_extended_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- status = F_none;
-
if (main->parameters.array[fss_extended_read_parameter_help_e].result == f_console_result_found_e) {
fss_extended_read_print_help(main->output.to, main->context);
- return status;
+ return F_none;
}
if (main->parameters.array[fss_extended_read_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_extended_read_program_version_s);
- return status;
+ return F_none;
}
+ if (main->parameters.array[fss_extended_read_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_extended_read_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
// Provide a range designating where within the buffer a particular file exists, using a statically allocated array.
fss_extended_read_file_t files_array[main->parameters.remaining.used + 1];
fss_extended_read_data_t data = fss_extended_read_data_t_initialize;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_extended_read_print_copyright_
+ extern f_status_t fss_extended_read_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_extended_read_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_extended_write_parameter_help_e,
+ fss_extended_write_parameter_copyright_e,
fss_extended_write_parameter_light_e,
fss_extended_write_parameter_dark_e,
fss_extended_write_parameter_no_color_e,
#define fss_extended_write_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_extended_write_short_trim_s.string, fss_extended_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_extended_write_total_parameters_d 18
+ #define fss_extended_write_total_parameters_d 19
#endif // _di_fss_extended_write_parameters_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_fss_extended_write_print_copyright_
+ f_status_t fss_extended_write_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_extended_write_print_copyright_
+
#ifndef _di_fss_extended_write_print_help_
f_status_t fss_extended_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_extended_write_program_name_long_s, fss_extended_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[fss_extended_write_parameter_help_e].result == f_console_result_found_e) {
fss_extended_write_print_help(main->output.to, main->context);
- return status;
+ return F_none;
}
if (main->parameters.array[fss_extended_write_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_extended_write_program_version_s);
- return status;
+ return F_none;
}
+ if (main->parameters.array[fss_extended_write_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_extended_write_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
f_file_t output = f_file_t_initialize;
output.id = F_type_descriptor_output_d;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_extended_write_print_copyright_
+ extern f_status_t fss_extended_write_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_extended_write_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_identify_parameter_help_e,
+ fss_identify_parameter_copyright_e,
fss_identify_parameter_light_e,
fss_identify_parameter_dark_e,
fss_identify_parameter_no_color_e,
#define fss_identify_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_identify_short_total_s.string, fss_identify_long_total_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_identify_total_parameters_d 15
+ #define fss_identify_total_parameters_d 16
#endif // _di_fss_identify_parameters_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_fss_identify_print_copyright_
+ f_status_t fss_identify_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_identify_print_copyright_
+
#ifndef _di_fss_identify_print_help_
f_status_t fss_identify_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_identify_program_name_long_s, fss_identify_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- status = F_none;
-
if (main->parameters.array[fss_identify_parameter_help_e].result == f_console_result_found_e) {
fss_identify_print_help(main->output.to, main->context);
return F_none;
}
+ if (main->parameters.array[fss_identify_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_identify_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
fss_identify_data_t data = fss_identify_data_t_initialize;
data.argv = main->parameters.arguments.array;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_identify_print_copyright_
+ extern f_status_t fss_identify_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_identify_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_payload_read_parameter_help_e,
+ fss_payload_read_parameter_copyright_e,
fss_payload_read_parameter_light_e,
fss_payload_read_parameter_dark_e,
fss_payload_read_parameter_no_color_e,
#define fss_payload_read_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_payload_read_short_trim_s.string, fss_payload_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_payload_read_total_parameters_d 24
+ #define fss_payload_read_total_parameters_d 25
#endif // _di_fss_payload_read_parameters_
/**
const f_string_static_t fss_payload_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_long_s, 0, FSS_PAYLOAD_READ_program_name_long_s_length);
#endif // _di_fss_payload_read_program_name_
+#ifndef _di_fss_payload_read_print_copyright_
+ f_status_t fss_payload_read_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_payload_read_print_copyright_
+
#ifndef _di_fss_payload_read_print_help_
f_status_t fss_payload_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_payload_read_program_name_long_s, fss_payload_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- status = F_none;
-
if (main->parameters.array[fss_payload_read_parameter_help_e].result == f_console_result_found_e) {
fss_payload_read_print_help(main->output.to, main->context);
- return status;
+ return F_none;
}
if (main->parameters.array[fss_payload_read_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_payload_read_program_version_s);
- return status;
+ return F_none;
}
+ if (main->parameters.array[fss_payload_read_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_payload_read_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
// Provide a range designating where within the buffer a particular file exists, using a statically allocated array.
fss_payload_read_file_t files_array[main->parameters.remaining.used + 1];
fss_payload_read_data_t data = fss_payload_read_data_t_initialize;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_payload_read_print_copyright_
+ extern f_status_t fss_payload_read_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_payload_read_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_payload_write_parameter_help_e,
+ fss_payload_write_parameter_copyright_e,
fss_payload_write_parameter_light_e,
fss_payload_write_parameter_dark_e,
fss_payload_write_parameter_no_color_e,
#define fss_payload_write_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_payload_write_short_trim_s.string, fss_payload_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_payload_write_total_parameters_d 19
+ #define fss_payload_write_total_parameters_d 20
#endif // _di_fss_payload_write_parameters_
#ifdef __cplusplus
const f_string_static_t fss_payload_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_long_s, 0, FSS_PAYLOAD_WRITE_program_name_long_s_length);
#endif // _di_fss_payload_write_program_name_
+#ifndef _di_fss_payload_write_print_copyright_
+ f_status_t fss_payload_write_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_payload_write_print_copyright_
+
#ifndef _di_fss_payload_write_print_help_
f_status_t fss_payload_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_payload_write_program_name_long_s, fss_payload_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[fss_payload_write_parameter_help_e].result == f_console_result_found_e) {
fss_payload_write_print_help(main->output.to, main->context);
- return status;
+ return F_none;
}
if (main->parameters.array[fss_payload_write_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fss_payload_write_program_version_s);
- return status;
+ return F_none;
}
+ if (main->parameters.array[fss_payload_write_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_payload_write_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
f_file_t output = f_file_t_initialize;
output.id = F_type_descriptor_output_d;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_payload_write_print_copyright_
+ extern f_status_t fss_payload_write_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_payload_write_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
fss_status_code_parameter_help_e,
+ fss_status_code_parameter_copyright_e,
fss_status_code_parameter_light_e,
fss_status_code_parameter_dark_e,
fss_status_code_parameter_no_color_e,
#define fss_status_code_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(fss_status_code_short_number_s.string, fss_status_code_long_number_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_status_code_total_parameters_d 14
+ #define fss_status_code_total_parameters_d 15
#endif // _di_fss_status_code_defines_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_fss_status_code_print_copyright_
+ f_status_t fss_status_code_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_fss_status_code_print_copyright_
+
#ifndef _di_fss_status_code_print_help_
f_status_t fss_status_code_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, fss_status_code_program_name_long_s, fss_status_code_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[fss_status_code_parameter_help_e].result == f_console_result_found_e) {
fss_status_code_print_help(main->output.to, main->context);
return F_none;
}
+ if (main->parameters.array[fss_status_code_parameter_copyright_e].result == f_console_result_found_e) {
+ fss_status_code_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ status = F_none;
+
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
if (main->parameters.array[fss_status_code_parameter_error_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_status_code_parameter_warning_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_status_code_parameter_number_e].result == f_console_result_none_e) {
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_status_code_print_copyright_
+ extern f_status_t fss_status_code_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_fss_status_code_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
iki_read_parameter_help_e,
+ iki_read_parameter_copyright_e,
iki_read_parameter_light_e,
iki_read_parameter_dark_e,
iki_read_parameter_no_color_e,
#define iki_read_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(iki_read_short_wrap_s.string, iki_read_long_wrap_s.string, 0, 3, f_console_type_normal_e), \
}
- #define iki_read_total_parameters_d 22
+ #define iki_read_total_parameters_d 23
#endif // _di_iki_read_parameters_
#ifndef _di_iki_read_substitution_t_
extern "C" {
#endif
+#ifndef _di_iki_read_print_copyright_
+ f_status_t iki_read_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_iki_read_print_copyright_
+
#ifndef _di_iki_read_print_help_
f_status_t iki_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, iki_read_program_name_long_s, iki_read_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- iki_read_data_t data = iki_read_data_t_initialize;
- data.main = main;
- data.argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[iki_read_parameter_help_e].result == f_console_result_found_e) {
iki_read_print_help(main->output.to, main->context);
- iki_read_data_delete(&data);
-
return F_none;
}
if (main->parameters.array[iki_read_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, iki_read_program_version_s);
- iki_read_data_delete(&data);
+ return F_none;
+ }
+
+ if (main->parameters.array[iki_read_parameter_copyright_e].result == f_console_result_found_e) {
+ iki_read_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
return F_none;
}
+ iki_read_data_t data = iki_read_data_t_initialize;
+ data.main = main;
+ data.argv = main->parameters.arguments.array;
+
+ status = F_none;
+
if (main->parameters.remaining.used > 0 || main->process_pipe) {
if (main->parameters.array[iki_read_parameter_at_e].result == f_console_result_found_e) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_iki_read_print_copyright_
+ extern f_status_t iki_read_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_iki_read_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
iki_write_parameter_help_e,
+ iki_write_parameter_copyright_e,
iki_write_parameter_light_e,
iki_write_parameter_dark_e,
iki_write_parameter_no_color_e,
#define iki_write_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(iki_write_short_single_s.string, iki_write_long_single_s.string, 0, 0, f_console_type_normal_e), \
}
- #define iki_write_total_parameters_d 15
+ #define iki_write_total_parameters_d 16
#endif // _di_iki_write_parameters_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_iki_write_print_copyright_
+ f_status_t iki_write_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_iki_write_print_copyright_
+
#ifndef _di_iki_write_print_help_
f_status_t iki_write_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, iki_write_program_name_long_s, iki_write_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- iki_write_data_t data = iki_write_data_t_initialize;
- data.main = main;
- data.argv = main->parameters.arguments.array;
-
- status = F_none;
-
if (main->parameters.array[iki_write_parameter_help_e].result == f_console_result_found_e) {
iki_write_print_help(main->output.to, main->context);
- iki_write_data_delete(&data);
-
return F_none;
}
if (main->parameters.array[iki_write_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, iki_write_program_version_s);
- iki_write_data_delete(&data);
+ return F_none;
+ }
+
+ if (main->parameters.array[iki_write_parameter_copyright_e].result == f_console_result_found_e) {
+ iki_write_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
return F_none;
}
+ status = F_none;
+
+ iki_write_data_t data = iki_write_data_t_initialize;
+ data.main = main;
+ data.argv = main->parameters.arguments.array;
+
f_file_t file = f_file_t_initialize;
file.id = F_type_descriptor_output_d;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_iki_write_print_copyright_
+ extern f_status_t iki_write_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_iki_write_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
status_code_parameter_help_e,
+ status_code_parameter_copyright_e,
status_code_parameter_light_e,
status_code_parameter_dark_e,
status_code_parameter_no_color_e,
#define status_code_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(status_code_short_number_s.string, status_code_long_number_s.string, 0, 0, f_console_type_normal_e), \
}
- #define status_code_total_parameters_d 14
+ #define status_code_total_parameters_d 15
#endif // _di_status_code_parameters_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_status_code_print_copyright_
+ f_status_t status_code_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_status_code_print_copyright_
+
#ifndef _di_status_code_print_help_
f_status_t status_code_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, status_code_program_name_long_s, status_code_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
status = F_none;
if (main->parameters.array[status_code_parameter_help_e].result == f_console_result_found_e) {
return F_none;
}
+ if (main->parameters.array[status_code_parameter_copyright_e].result == f_console_result_found_e) {
+ status_code_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ return F_none;
+ }
+
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
if (main->parameters.array[status_code_parameter_error_e].result == f_console_result_found_e) {
if (main->parameters.array[status_code_parameter_warning_e].result == f_console_result_found_e) {
if (main->parameters.array[status_code_parameter_number_e].result == f_console_result_none_e) {
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).
enum {
utf8_parameter_help_e,
+ utf8_parameter_copyright_e,
utf8_parameter_light_e,
utf8_parameter_dark_e,
utf8_parameter_no_color_e,
#define utf8_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(f_console_standard_short_copyright_s.string, f_console_standard_long_copyright_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(utf8_short_verify_s.string, utf8_long_verify_s.string, 0, 0, f_console_type_normal_e), \
}
- #define utf8_total_parameters_d 22
+ #define utf8_total_parameters_d 23
#endif // _di_utf8_parameters_
/**
extern "C" {
#endif
+#ifndef _di_utf8_print_copyright_
+ f_status_t utf8_print_copyright(const f_file_t file, const bool full) {
+
+ flockfile(file.stream);
+
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ #ifndef _di_detailed_copyright_
+ if (full) {
+ fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", file.stream, f_string_eol_s);
+ }
+ #endif // _di_detailed_copyright_
+
+ fl_print_format("%rSource code license lgpl-2.1-or-later.%r", file.stream, f_string_eol_s, f_string_eol_s);
+ fl_print_format("Standard and specification license open-standard-license-1.0.%r", file.stream, f_string_eol_s);
+ fl_print_format("Documentation license cc-by-sa-4.0.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
+
+ funlockfile(file.stream);
+
+ return F_none;
+ }
+#endif // _di_utf8_print_copyright_
+
#ifndef _di_utf8_print_help_
f_status_t utf8_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_header(file, context, utf8_program_name_long_s, utf8_program_version_s);
- fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
- fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not print using color.");
- fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
- fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
- fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
- fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
- fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Print the copyright.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Do not print using color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, silencing most output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_error_s, f_console_standard_long_error_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity, using only error output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, significantly increasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
f_print_dynamic_raw(f_string_eol_s, file.stream);
}
}
- data.argv = main->parameters.arguments.array;
- status = F_none;
-
if (main->parameters.array[utf8_parameter_help_e].result == f_console_result_found_e) {
utf8_print_help(main->output.to, main->context);
return F_none;
}
+ if (main->parameters.array[utf8_parameter_copyright_e].result == f_console_result_found_e) {
+ utf8_print_copyright(main->output.to, main->output.verbosity > f_console_verbosity_error_e);
+
+ utf8_data_delete(&data);
+
+ return F_none;
+ }
+
+ status = F_none;
+ data.argv = main->parameters.arguments.array;
+
if (F_status_is_error_not(status)) {
if (main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_additional_e) {
f_array_length_t i = 0;
#endif
/**
+ * Print copyright.
+ *
+ * @param file
+ * The file to print to.
+ * @param detail
+ * If TRUE, then the detailed copyright is printed (unless _di_detailed_copyright_ is set).
+ * If FALSE, then the short copyright is printed.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_utf8_print_copyright_
+ extern f_status_t utf8_print_copyright(const f_file_t file, const bool detail);
+#endif // _di_utf8_print_copyright_
+
+/**
* Print help.
*
* @param file
# fss-0000
+_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space).