Fix minor spacing problem where the color context should be closed near non-whitespace whenever possible.
Add missing word "error" in some comments.
Continue working in fss_write.
This gets the fss_payload_write program compiling.
The installer by default doesn't handle all of the programs.
Where before './install.sh -w /tmp/fll/' used to work now the following are all needed:
- ./install.sh -w /tmp/fll/
- ./install.sh -w /tmp/fll/ -s data/build/settings.main
- ./install.sh -w /tmp/fll/ -s data/build/settings.payload
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe %]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%[%QThe%] ", print.to, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%]", print.to, print.set->notable, variable, print.set->notable);
- fl_print_format("%[ is missing or has a length of %]", print.to, print.set->error, print.set->error);
+ fl_print_format("%[ is missing or has a length of%] ", print.to, print.set->error, print.set->error);
fl_print_format("%[0%]", print.to, print.set->notable, print.set->notable);
fl_print_format("%[.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe parameter %]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%[%QThe parameter%] ", print.to, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, parameter, print.set->notable);
fl_print_format(" %[is specified, but no value is given.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe parameter %]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%[%QThe parameter%] ", print.to, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, parameter, print.set->notable);
- fl_print_format("%[ is specified, but %]", print.to, print.set->error, print.set->error);
+ fl_print_format("%[ is specified, but%] ", print.to, print.set->error, print.set->error);
fl_print_format("%[%Q%]", print.to, print.set->notable, amount, print.set->notable);
fl_print_format(" %[values are not given.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
#endif // _di_fss_basic_list_write_error_parameter_same_times_print_
/**
- * Print an message about a parameter a New Line character '\n' (U+000A) being unsupported.
+ * Print an error message about a parameter a New Line character '\n' (U+000A) being unsupported.
*
* @param main
* The main program data.
#endif // _di_fss_basic_list_write_error_parameter_unsupported_eol_print_
/**
- * Print an message about a parameter missing a value.
+ * Print an error message about a parameter missing a value.
*
* @param main
* The main program data.
#endif // _di_fss_basic_write_error_parameter_same_times_print_
/**
- * Print an message about a parameter missing a value.
+ * Print an error message about a parameter missing a value.
*
* @param main
* The main program data.
#endif // _di_fss_basic_write_error_parameter_value_missing_print_
/**
- * Print an message about a parameter a New Line character '\n' (U+000A) being unsupported.
+ * Print an error message about a parameter a New Line character '\n' (U+000A) being unsupported.
*
* @param main
* The main program data.
#endif // _di_fss_embedded_list_write_error_parameter_same_times_print_
/**
- * Print an message about a parameter a New Line character '\n' (U+000A) being unsupported.
+ * Print an error message about a parameter a New Line character '\n' (U+000A) being unsupported.
*
* @param main
* The main program data.
#endif // _di_fss_embedded_list_write_error_parameter_unsupported_eol_print_
/**
- * Print an message about a parameter missing a value.
+ * Print an error message about a parameter missing a value.
*
* @param main
* The main program data.
#endif // _di_fss_extended_list_write_error_parameter_same_times_print_
/**
- * Print an message about a parameter New Line character '\n' (U+000A) being unsupported.
+ * Print an error message about a parameter New Line character '\n' (U+000A) being unsupported.
*
* @param main
* The main program data.
#endif // _di_fss_extended_list_write_error_parameter_unsupported_eol_print_
/**
- * Print an message about a parameter missing a value.
+ * Print an error message about a parameter missing a value.
*
* @param main
* The main program data.
#endif // _di_fss_extended_write_error_parameter_at_least_once_print_
/**
- * Print an message about a parameter missing a value.
+ * Print an error message about a parameter missing a value.
*
* @param main
* The main program data.
#endif // _di_fss_extended_write_error_parameter_value_missing_print_
/**
- * Print an message about a parameter a New Line character '\n' (U+000A) being unsupported.
+ * Print an error message about a parameter a New Line character '\n' (U+000A) being unsupported.
*
* @param main
* The main program data.
#endif // _fss_payload_write_print_error_prepend_only_whitespace_
/**
- * Print an message about a parameter New Line character '\n' (U+000A) being unsupported.
+ * Print an error message about a parameter New Line character '\n' (U+000A) being unsupported.
*
* @param setting
* The main program settings.
#include <fll/level_2/program.h>
// FSS Write includes.
-#include <program/fss_write/basic/common.h>
#include <program/fss_write/main/common.h>
-#include <program/fss_write/basic/print.h>
+#include <program/fss_write/basic/common.h>
#include <program/fss_write/main/print.h>
+#include <program/fss_write/basic/print.h>
#ifdef __cplusplus
extern "C" {
#include <fll/level_2/program.h>
// FSS Write includes.
-#include <program/fss_write/basic_list/common.h>
#include <program/fss_write/main/common.h>
-#include <program/fss_write/basic_list/print.h>
+#include <program/fss_write/basic_list/common.h>
#include <program/fss_write/main/print.h>
+#include <program/fss_write/basic_list/print.h>
#ifdef __cplusplus
extern "C" {
#include <fll/level_2/program.h>
// FSS Write includes.
-#include <program/fss_write/embedded_list/common.h>
#include <program/fss_write/main/common.h>
-#include <program/fss_write/embedded_list/print.h>
+#include <program/fss_write/embedded_list/common.h>
#include <program/fss_write/main/print.h>
+#include <program/fss_write/embedded_list/print.h>
#ifdef __cplusplus
extern "C" {
#include <fll/level_2/program.h>
// FSS Write includes.
-#include <program/fss_write/extended/common.h>
#include <program/fss_write/main/common.h>
-#include <program/fss_write/extended/print.h>
+#include <program/fss_write/extended/common.h>
#include <program/fss_write/main/print.h>
+#include <program/fss_write/extended/print.h>
#ifdef __cplusplus
extern "C" {
#include <fll/level_2/program.h>
// FSS Write includes.
-#include <program/fss_write/extended_list/common.h>
#include <program/fss_write/main/common.h>
-#include <program/fss_write/extended_list/print.h>
+#include <program/fss_write/extended_list/common.h>
#include <program/fss_write/main/print.h>
+#include <program/fss_write/extended_list/print.h>
#ifdef __cplusplus
extern "C" {
return;
}
- if (main->parameters.array[fss_write_parameter_object_e].result & f_console_result_value_e && main->parameters.array[fss_write_parameter_object_e].values.used) {
+ if ((main->parameters.array[fss_write_parameter_object_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_object_e].values.used) {
f_array_lengths_t * const values = &main->parameters.array[fss_write_parameter_object_e].values;
setting->objects.used = 0;
* F_none on success.
* F_data_not on success but nothing was provided to operate with.
*
+ * F_parameter (with error bit) on parameter error.
+ *
* Errors (with error bit) from: f_console_parameter_process().
* Errors (with error bit) from: f_file_stream_open().
* Errors (with error bit) from: f_string_dynamics_resize().
--- /dev/null
+#include "fss_write.h"
+#include "main-print.h"
+#include "../basic/fss_write.h"
+#include "../basic_list/fss_write.h"
+#include "../extended/fss_write.h"
+#include "../extended_list/fss_write.h"
+#include "../embedded_list/fss_write.h"
+#include "../payload/fss_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_write_main_print_error_format_unknown_
+ f_status_t fss_write_main_print_error_format_unknown(const fl_print_t print, const f_string_static_t value) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ fl_print_format("%[%QThe format '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%[%Q%]", print.to, print.set->notable, value, print.set->notable);
+ fl_print_format("%[' is not known for the parameter%] ", print.to, print.set->error, print.set->error);
+ fl_print_format("%[%Q%Q%]", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_as_s, print.set->notable);
+ fl_print_format("%[.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_fss_write_main_print_error_format_unknown_
+
+#ifndef _di_fss_write_main_print_help_
+ f_status_t fss_write_main_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
+
+ f_file_stream_lock(print.to);
+
+ f_print_dynamic_raw(setting->line_first, print.to);
+
+ fll_program_print_help_header(print, fss_write_program_name_long_s, fss_write_program_version_s);
+
+ fss_write_print_help(setting, print);
+
+ fll_program_print_help_option(print, fss_write_short_as_s, fss_write_long_as_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Designate the supported format to write as.");
+
+ f_print_dynamic_raw(f_string_eol_s, print.to);
+ f_print_dynamic_raw(f_string_eol_s, print.to);
+
+ fll_program_print_help_usage(print, fss_write_program_name_s, f_string_empty_s);
+
+ fss_write_print_help_pipe(setting, print);
+
+ f_print_dynamic_raw(f_string_eol_s, print.to);
+
+ fl_print_format(" The '%[%r%r%]' parameter supports the following standards with the specified possible case-sensitive values:%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_as_s, print.set->notable, f_string_eol_s);
+
+ // FSS-0000 (Basic)
+ fl_print_format(" - As %[%r%] format: ", print.to, print.set->notable, fss_write_basic_standard_s, print.set->notable);
+ fl_print_format("'%[%r%]', ", print.to, print.set->notable, fss_write_format_code_short_0000_s, print.set->notable);
+ fl_print_format("'%[%r%]', or ", print.to, print.set->notable, fss_write_format_code_long_0000_s, print.set->notable);
+ fl_print_format("'%[%r%]'.%r", print.to, print.set->notable, fss_write_format_code_human_0000_s, print.set->notable, f_string_eol_s);
+
+ // FSS-0001 (Extended)
+ fl_print_format(" - As %[%r%] format: ", print.to, print.set->notable, fss_write_extended_standard_s, print.set->notable);
+ fl_print_format("'%[%r%]', ", print.to, print.set->notable, fss_write_format_code_short_0001_s, print.set->notable);
+ fl_print_format("'%[%r%]', or ", print.to, print.set->notable, fss_write_format_code_long_0001_s, print.set->notable);
+ fl_print_format("'%[%r%]'.%r", print.to, print.set->notable, fss_write_format_code_human_0001_s, print.set->notable, f_string_eol_s);
+
+ // FSS-0002 (Basic List)
+ fl_print_format(" - As %[%r%] format: ", print.to, print.set->notable, fss_write_basic_list_standard_s, print.set->notable);
+ fl_print_format("'%[%r%]', ", print.to, print.set->notable, fss_write_format_code_short_0002_s, print.set->notable);
+ fl_print_format("'%[%r%]', or ", print.to, print.set->notable, fss_write_format_code_long_0002_s, print.set->notable);
+ fl_print_format("'%[%r%]'.%r", print.to, print.set->notable, fss_write_format_code_human_0002_s, print.set->notable, f_string_eol_s);
+
+ // FSS-0003 (Extended List)
+ fl_print_format(" - As %[%r%] format: ", print.to, print.set->notable, fss_write_extended_list_standard_s, print.set->notable);
+ fl_print_format("'%[%r%]', ", print.to, print.set->notable, fss_write_format_code_short_0003_s, print.set->notable);
+ fl_print_format("'%[%r%]', or ", print.to, print.set->notable, fss_write_format_code_long_0003_s, print.set->notable);
+ fl_print_format("'%[%r%]'.%r", print.to, print.set->notable, fss_write_format_code_human_0003_s, print.set->notable, f_string_eol_s);
+
+ // FSS-0008 (Embedded List)
+ fl_print_format(" - As %[%r%] format: ", print.to, print.set->notable, fss_write_embedded_list_standard_s, print.set->notable);
+ fl_print_format("'%[%r%]', ", print.to, print.set->notable, fss_write_format_code_short_0008_s, print.set->notable);
+ fl_print_format("'%[%r%]', or ", print.to, print.set->notable, fss_write_format_code_long_0008_s, print.set->notable);
+ fl_print_format("'%[%r%]'.%r", print.to, print.set->notable, fss_write_format_code_human_0008_s, print.set->notable, f_string_eol_s);
+
+ // FSS-000E (Payload)
+ fl_print_format(" - As %[%r%] format: ", print.to, print.set->notable, fss_write_payload_standard_s, print.set->notable);
+ fl_print_format("'%[%r%]', ", print.to, print.set->notable, fss_write_format_code_short_000e_s, print.set->notable);
+ fl_print_format("'%[%r%]', or ", print.to, print.set->notable, fss_write_format_code_long_000e_s, print.set->notable);
+ fl_print_format("'%[%r%]'.%r", print.to, print.set->notable, fss_write_format_code_human_000e_s, print.set->notable, f_string_eol_s);
+
+ f_print_dynamic_raw(f_string_eol_s, print.to);
+
+ fl_print_format(" The %[%r%] format is the default when no ", print.to, print.set->notable, fss_write_basic_standard_s, print.set->notable);
+ fl_print_format("'%[%r%r%]' is specified.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_as_s, print.set->notable, f_string_eol_s);
+
+ f_print_dynamic_raw(setting->line_last, print.to);
+
+ f_file_stream_flush(print.to);
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_fss_write_main_print_help_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Write
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ */
+#ifndef _fss_write_main_print_h
+#define _fss_write_main_print_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print an error message about a value given to the --as parameter being unknown.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * Designates the how and where to print.
+ * @param value
+ * A string representing the value that is of an unknown format.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fss_write_main_print_error_format_unknown_
+ extern f_status_t fss_write_main_print_error_format_unknown(const fl_print_t print, const f_string_static_t value);
+#endif // _di_fss_write_main_print_error_format_unknown_
+
+/**
+ * Print help for "main" fss_write.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * The output structure to print to.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fss_write_print_main_help_
+ extern f_status_t fss_write_main_print_help(fss_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_fss_write_print_main_help_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_write_main_print_h
#include "fss_write.h"
#include "main.h"
+#include "main-print.h"
#include "../basic/fss_write.h"
#include "../basic_list/fss_write.h"
#include "../extended/fss_write.h"
}
#ifndef _di_fss_write_main_process_help_
- void fss_write_main_process_help(fll_program_data_t * const main, void * const void_setting) {
+ void fss_write_main_process_help(fll_program_data_t * const main, void * const setting) {
- fss_write_setting_t * const setting = (fss_write_setting_t *) void_setting;
-
- f_file_stream_lock(main->message.to);
-
- f_print_dynamic_raw(setting->line_first, main->message.to);
-
- fll_program_print_help_header(main->message, fss_write_program_name_long_s, fss_write_program_version_s);
-
- fss_write_print_help(setting, main->message);
-
- fll_program_print_help_option(main->message, fss_write_short_as_s, fss_write_long_as_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Designate the supported format to write as.");
-
- f_print_dynamic_raw(f_string_eol_s, main->message.to);
- f_print_dynamic_raw(f_string_eol_s, main->message.to);
-
- fll_program_print_help_usage(main->message, fss_write_program_name_s, f_string_empty_s);
-
- fss_write_print_help_pipe(setting, main->message);
-
- f_print_dynamic_raw(f_string_eol_s, main->message.to);
-
- fl_print_format(" The '%[%r%r%]' parameter supports the following standards with the specified possible case-sensitive values:%r", main->message.to, main->message.set->notable, f_console_symbol_long_normal_s, fss_write_long_as_s, main->message.set->notable, f_string_eol_s);
-
- // FSS-0000 (Basic)
- fl_print_format(" - As %[%r%] format: ", main->message.to, main->message.set->notable, fss_write_basic_standard_s, main->message.set->notable);
- fl_print_format("'%[%r%]', ", main->message.to, main->message.set->notable, fss_write_format_code_short_0000_s, main->message.set->notable);
- fl_print_format("'%[%r%]', or ", main->message.to, main->message.set->notable, fss_write_format_code_long_0000_s, main->message.set->notable);
- fl_print_format("'%[%r%]'.%r", main->message.to, main->message.set->notable, fss_write_format_code_human_0000_s, main->message.set->notable, f_string_eol_s);
-
- // FSS-0001 (Extended)
- fl_print_format(" - As %[%r%] format: ", main->message.to, main->message.set->notable, fss_write_extended_standard_s, main->message.set->notable);
- fl_print_format("'%[%r%]', ", main->message.to, main->message.set->notable, fss_write_format_code_short_0001_s, main->message.set->notable);
- fl_print_format("'%[%r%]', or ", main->message.to, main->message.set->notable, fss_write_format_code_long_0001_s, main->message.set->notable);
- fl_print_format("'%[%r%]'.%r", main->message.to, main->message.set->notable, fss_write_format_code_human_0001_s, main->message.set->notable, f_string_eol_s);
-
- // FSS-0002 (Basic List)
- fl_print_format(" - As %[%r%] format: ", main->message.to, main->message.set->notable, fss_write_basic_list_standard_s, main->message.set->notable);
- fl_print_format("'%[%r%]', ", main->message.to, main->message.set->notable, fss_write_format_code_short_0002_s, main->message.set->notable);
- fl_print_format("'%[%r%]', or ", main->message.to, main->message.set->notable, fss_write_format_code_long_0002_s, main->message.set->notable);
- fl_print_format("'%[%r%]'.%r", main->message.to, main->message.set->notable, fss_write_format_code_human_0002_s, main->message.set->notable, f_string_eol_s);
-
- // FSS-0003 (Extended List)
- fl_print_format(" - As %[%r%] format: ", main->message.to, main->message.set->notable, fss_write_extended_list_standard_s, main->message.set->notable);
- fl_print_format("'%[%r%]', ", main->message.to, main->message.set->notable, fss_write_format_code_short_0003_s, main->message.set->notable);
- fl_print_format("'%[%r%]', or ", main->message.to, main->message.set->notable, fss_write_format_code_long_0003_s, main->message.set->notable);
- fl_print_format("'%[%r%]'.%r", main->message.to, main->message.set->notable, fss_write_format_code_human_0003_s, main->message.set->notable, f_string_eol_s);
-
- // FSS-0008 (Embedded List)
- fl_print_format(" - As %[%r%] format: ", main->message.to, main->message.set->notable, fss_write_embedded_list_standard_s, main->message.set->notable);
- fl_print_format("'%[%r%]', ", main->message.to, main->message.set->notable, fss_write_format_code_short_0008_s, main->message.set->notable);
- fl_print_format("'%[%r%]', or ", main->message.to, main->message.set->notable, fss_write_format_code_long_0008_s, main->message.set->notable);
- fl_print_format("'%[%r%]'.%r", main->message.to, main->message.set->notable, fss_write_format_code_human_0008_s, main->message.set->notable, f_string_eol_s);
-
- // FSS-000E (Payload)
- fl_print_format(" - As %[%r%] format: ", main->message.to, main->message.set->notable, fss_write_payload_standard_s, main->message.set->notable);
- fl_print_format("'%[%r%]', ", main->message.to, main->message.set->notable, fss_write_format_code_short_000e_s, main->message.set->notable);
- fl_print_format("'%[%r%]', or ", main->message.to, main->message.set->notable, fss_write_format_code_long_000e_s, main->message.set->notable);
- fl_print_format("'%[%r%]'.%r", main->message.to, main->message.set->notable, fss_write_format_code_human_000e_s, main->message.set->notable, f_string_eol_s);
-
- f_print_dynamic_raw(f_string_eol_s, main->message.to);
-
- fl_print_format(" The %[%r%] format is the default when no ", main->message.to, main->message.set->notable, fss_write_basic_standard_s, main->message.set->notable);
- fl_print_format("'%[%r%r%]' is specified.%r", main->message.to, main->message.set->notable, f_console_symbol_long_normal_s, fss_write_long_as_s, main->message.set->notable, f_string_eol_s);
-
- f_print_dynamic_raw(setting->line_last, main->message.to);
-
- f_file_stream_flush(main->message.to);
- f_file_stream_unlock(main->message.to);
+ fss_write_main_print_help((fss_write_setting_t *) setting, main->message);
}
#endif // _di_fss_write_main_process_help_
setting->process_normal = &fss_write_basic_process_normal;
}
else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0001_s) == F_equal_to ||
- fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0001_s) == F_equal_to ||
- fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0001_s) == F_equal_to) {
+ fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0001_s) == F_equal_to ||
+ fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0001_s) == F_equal_to) {
setting->program_name = &fss_write_extended_program_name_s;
setting->program_name_long = &fss_write_extended_program_name_long_s;
setting->process_normal = &fss_write_extended_process_normal;
}
else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0002_s) == F_equal_to ||
- fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0002_s) == F_equal_to ||
- fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0002_s) == F_equal_to) {
+ fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0002_s) == F_equal_to ||
+ fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0002_s) == F_equal_to) {
setting->program_name = &fss_write_basic_list_program_name_s;
setting->program_name_long = &fss_write_basic_list_program_name_long_s;
setting->process_normal = &fss_write_basic_list_process_normal;
}
else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0003_s) == F_equal_to ||
- fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0003_s) == F_equal_to ||
- fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0003_s) == F_equal_to) {
+ fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0003_s) == F_equal_to ||
+ fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0003_s) == F_equal_to) {
setting->program_name = &fss_write_extended_list_program_name_s;
setting->program_name_long = &fss_write_extended_list_program_name_long_s;
setting->process_normal = &fss_write_extended_list_process_normal;
}
else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0008_s) == F_equal_to ||
- fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0008_s) == F_equal_to ||
- fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0008_s) == F_equal_to) {
+ fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0008_s) == F_equal_to ||
+ fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0008_s) == F_equal_to) {
setting->program_name = &fss_write_embedded_list_program_name_s;
setting->program_name_long = &fss_write_embedded_list_program_name_long_s;
setting->process_normal = &fss_write_embedded_list_process_normal;
}
else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_000e_s) == F_equal_to ||
- fl_string_dynamic_compare(argv[index], fss_write_format_code_long_000e_s) == F_equal_to ||
- fl_string_dynamic_compare(argv[index], fss_write_format_code_human_000e_s) == F_equal_to) {
+ fl_string_dynamic_compare(argv[index], fss_write_format_code_long_000e_s) == F_equal_to ||
+ fl_string_dynamic_compare(argv[index], fss_write_format_code_human_000e_s) == F_equal_to) {
setting->program_name = &fss_write_payload_program_name_s;
setting->program_name_long = &fss_write_payload_program_name_long_s;
}
else {
- // @todo print error
+ if (setting->flag & fss_write_main_flag_help_e) {
+ setting->status = F_status_set_error(F_parameter);
+
+ break;
+ }
+
+ if (setting->status != F_status_set_error(F_parameter)) {
+ fss_write_print_line_first_locked(setting, main->error);
+ }
setting->status = F_status_set_error(F_parameter);
+
+ fss_write_main_print_error_format_unknown(main->error, argv[index]);
}
} // for
if (setting->flag & fss_write_main_flag_help_e) {
fss_write_main_process_help(main, setting);
}
+ else {
+ fss_write_print_line_last_locked(setting, main->error);
+ }
return;
}
* Licenses: lgpl-2.1-or-later
*
* This file is only ever included by main/main.c and should not normally be included anywhere else.
- * Anything that wants to include this should be providing the "main" program functionality in some manner.
- * Any program utilizing this should link to the "main" program library.
+ * Anything that wants to include this should be providing the "fss_write" program functionality in some manner.
*/
#ifndef _fss_write_main_h
#define _fss_write_main_h
/**
* Perform the standard program setting load process for the "--as" parameter.
*
- * This should be called before fss_write_setting_load() is called to ensure "--as" gets processed before "--help".
- *
* This prints error messages as appropriate.
*
* If either main or setting is NULL, then this immediately retuns without doing anything.
#endif // _fss_write_print_error_prepend_only_whitespace_
/**
- * Print an message about a parameter New Line character '\n' (U+000A) being unsupported.
+ * Print an error message about a parameter New Line character '\n' (U+000A) being unsupported.
*
* @param setting
* The main program settings.
#endif
#ifndef _di_fss_write_payload_strings_
+ const f_string_static_t fss_write_payload_s = macro_f_string_static_t_initialize(FSS_WRITE_payload_s, 0, FSS_WRITE_payload_s_length);
+
const f_string_static_t fss_write_payload_standard_s = macro_f_string_static_t_initialize(FSS_WRITE_payload_standard_s, 0, FSS_WRITE_payload_standard_s_length);
const f_string_static_t fss_write_payload_program_name_s = macro_f_string_static_t_initialize(FSS_WRITE_payload_program_name_s, 0, FSS_WRITE_payload_program_name_s_length);
const f_string_static_t fss_write_format_code_human_000e_s = macro_f_string_static_t_initialize(FSS_WRITE_format_code_human_000e_s, 0, FSS_WRITE_format_code_human_000e_s_length);
#endif // _di_fss_write_payload_strings_
+#ifndef _di_fss_write_payload_setting_load_
+ void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting) {
+
+ if (!main || !setting) return;
+
+ f_array_lengths_t * const values = &main->parameters.array[fss_write_parameter_object_e].values;
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
+ if ((main->parameters.array[fss_write_parameter_object_e].result & f_console_result_value_e) && values->used) {
+
+ for (f_array_length_t i = 0; i < values->used; ++i) {
+
+ if (fl_string_dynamic_compare(argv[values->array[i]], fss_write_payload_s) == F_equal_to && i + 1 < values->used) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_write_payload_print_error_payload_not_last(setting, main->error);
+
+ return;
+ }
+ } // for
+ }
+ }
+#endif // _di_fss_write_payload_setting_load_
+
#ifdef __cplusplus
} // extern "C"
#endif
* The FSS-000E (Payload) specific strings.
*/
#ifndef _di_fss_write_payload_strings_
+ #define FSS_WRITE_payload_s "payload"
+
#define FSS_WRITE_payload_standard_s "FSS-000E (Payload)"
#define FSS_WRITE_payload_program_name_s "fss_payload_write"
#define FSS_WRITE_format_code_long_000e_s "fss-000e"
#define FSS_WRITE_format_code_human_000e_s "payload"
+ #define FSS_WRITE_payload_s_length 7
+
#define FSS_WRITE_payload_standard_s_length 18
#define FSS_WRITE_payload_program_name_s_length 17
#define FSS_WRITE_format_code_long_000e_s_length 8
#define FSS_WRITE_format_code_human_000e_s_length 7
+ extern const f_string_static_t fss_write_payload_s;
+
extern const f_string_static_t fss_write_payload_standard_s;
extern const f_string_static_t fss_write_payload_program_name_s;
extern const f_string_static_t fss_write_format_code_human_000e_s;
#endif // _di_fss_write_payload_strings_
+/**
+ * Perform the payload-specific program setting load process.
+ *
+ * This prints error messages as appropriate.
+ *
+ * If either main or setting is NULL, then this immediately retuns without doing anything.
+ *
+ * @param arguments
+ * The parameters passed to the process (often referred to as command line arguments).
+ * @param main
+ * The main program data.
+ * @param setting
+ * The main program settings.
+ *
+ * This alters setting.process_help, setting.process_normal, and setting.process_pipe.
+ *
+ * This alters setting.status:
+ * F_none on success.
+ * F_interrupt on (exit) signal received.
+ *
+ * F_parameter (with error bit) if main is NULL or setting is NULL.
+ * F_parameter (with error bit) on parameter error.
+ *
+ * This alters setting.status:
+ * F_none on success.
+ * F_data_not on success but nothing was provided to operate with.
+ *
+ * @see fss_write_setting_load()
+ */
+#ifndef _di_fss_write_payload_setting_load_
+ extern void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting);
+#endif // _di_fss_write_payload_setting_load_
+
#ifdef __cplusplus
} // extern "C"
#endif
#include "fss_write.h"
+#include "../main/fss_write.h"
#include "private-common.h"
#include "private-write.h"
-#include "../main/fss_write.h"
#ifdef __cplusplus
extern "C" {
#include <fll/level_2/program.h>
// FSS Write includes.
-#include <program/fss_write/payload/common.h>
#include <program/fss_write/main/common.h>
-#include <program/fss_write/payload/print.h>
+#include <program/fss_write/payload/common.h>
#include <program/fss_write/main/print.h>
+#include <program/fss_write/payload/print.h>
#ifdef __cplusplus
extern "C" {
#include "fss_write.h"
+#include "../main/fss_write.h"
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
- fss_write_setting_load(arguments, &data, &setting, 0);
+ fss_write_setting_load(arguments, &data, &setting, &fss_write_payload_setting_load);
}
fss_write_main(&data, &setting);
extern "C" {
#endif
+#ifndef _di_fss_write_payload_print_error_payload_not_last_
+ f_status_t fss_write_payload_print_error_payload_not_last(fss_write_setting_t * const setting, const fl_print_t print) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ fss_write_print_line_first_unlocked(setting, print);
+ fl_print_format("%[%QThe payload may only be specified last.%]%r", print.to, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+ fss_write_print_line_last_unlocked(setting, print);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_fss_write_payload_print_error_payload_not_last_
+
#ifndef _di_fss_write_payload_print_help_
f_status_t fss_write_payload_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
#endif
/**
+ * Print error message about the "payload" not being specified last (when it is specified at all).
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_fss_write_payload_print_error_payload_not_last_
+ extern f_status_t fss_write_payload_print_error_payload_not_last(fss_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_fss_write_payload_print_error_payload_not_last_
+
+/**
* Print help for FSS-000E (Payload).
*
* @param setting
using_default:
build settings
- build settings.fss_write
+ build settings.main
+ #build settings.basic
+ #build settings.basic_list
+ #build settings.extended
+ #build settings.extended_list
+ #build settings.embedded_list
+ build settings.payload
using_mode:
build settings parameter:'mode:value'
- build settings.fss_status_code parameter:'mode:value'
+ build settings.main parameter:'mode:value'
+ #build settings.basic parameter:'mode:value'
+ #build settings.basic_list parameter:'mode:value'
+ #build settings.extended parameter:'mode:value'
+ #build settings.extended_list parameter:'mode:value'
+ #build settings.embedded_list parameter:'mode:value'
+ build settings.payload parameter:'mode:value'
# fss-0001
+#
+# Builds the main library of the project with all parts except "main" program related.
+#
build_name fss_write
build_sources_library extended_list/fss_write.c extended_list/common.c extended_list/print.c extended_list/private-common.c extended_list/private-write.c extended_list/private-print.c
build_sources_library payload/fss_write.c payload/common.c payload/print.c payload/private-common.c payload/private-write.c payload/private-print.c
-build_sources_program main/main.c
-
-build_sources_headers main/main.h main/fss_write.h main/common.h main/print.h main/private-common.h main/private-write.h
+build_sources_headers main/fss_write.h main/common.h main/print.h main/private-common.h main/private-write.h
build_sources_headers basic/fss_write.h basic/common.h basic/print.h basic/private-common.h basic/private-write.h basic/private-print.h
build_sources_headers basic_list/fss_write.h basic_list/common.h basic_list/print.h basic_list/private-common.h basic_list/private-write.h basic_list/private-print.h
build_sources_headers embedded_list/fss_write.h embedded_list/common.h embedded_list/print.h embedded_list/private-common.h embedded_list/private-write.h embedded_list/private-print.h
--- /dev/null
+# fss-0001
+#
+# Builds the "main" program (fss_write).
+# This must be called after the "setting".
+#
+
+build_name fss_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program main/main.c main/main-print.c
+
+build_sources_headers main/main.h main/main-print.h
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE
--- /dev/null
+# fss-0001
+#
+# Builds the "payload" program (fss_payload_write).
+# This must be called after the "setting".
+#
+
+build_name fss_payload_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program payload/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE
utf8_print_line_first_unlocked(setting, print);
- fl_print_format("%[%QNo file specified at parameter index %]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%[%QNo file specified at parameter index%] ", print.to, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%ul%]", print.to, print.set->notable, index, print.set->notable);
fl_print_format("%[.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);