Make the fl_print structure more extensible by adding a flag and a custom object.
The first/last printing is to complex.
Simplify the design to a simpler one.
Fix other problems as observed.
I have observed a memory leak in the recent f_directory_listing_t processing code.
Specifically, the f_directory_recurse_t as called in fake_build_copy().
The appropriate memory deletes appear to be being called.
More investigation is needed.
This is a recursive function, so there is probably a bad pointer assignment somewhere.
*
* to: The file to print to.
* verbosity: The verbosity mode.
+ * flag: A set of flags, bitwise or otherwise, made available for more advanced manipulation.
*
* prefix: An optional prefix string for displaying before any special messages.
- * suffix: An optional suffix string for displaying after any special messages.
+ * suffix: An optional suffix string for displaying after any special messages.
*
* context: The color codes for the entire error message.
* notable: The color codes for a part of the message to make more visible.
* set: An optional pointer to a set of all available color contexts for explicit use.
+ *
+ * custom: A pointer to a data structure determined by some caller for more advanced manipulation.
*/
#ifndef _di_fl_print_t_
typedef struct {
f_file_t to;
uint8_t verbosity;
+ uint64_t flag;
f_string_static_t prefix;
f_string_static_t suffix;
f_color_set_t context;
f_color_set_t notable;
f_color_set_context_t *set;
+
+ void *custom;
} fl_print_t;
#define fl_print_t_initialize { \
macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), \
f_console_verbosity_normal_e, \
+ 0, \
f_string_static_t_initialize, \
f_string_static_t_initialize, \
f_color_set_t_initialize, \
f_color_set_t_initialize, \
0, \
+ 0, \
}
- #define macro_fl_print_t_initialize(to, verbosity, prefix, suffix, context, notable, set) { \
+ #define macro_fl_print_t_initialize(to, verbosity, flag, prefix, suffix, context, notable, set, custom) { \
to, \
verbosity, \
+ flag, \
prefix, \
suffix, \
context, \
notable, \
set, \
+ custom, \
}
- #define macro_fl_print_t_initialize_debug() macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, fl_print_debug_s, f_string_static_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, 0)
- #define macro_fl_print_t_initialize_debug2(suffix, set) macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, fl_print_debug_s, suffix, f_color_set_t_initialize, f_color_set_t_initialize, set)
- #define macro_fl_print_t_initialize_error() macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_error_d, F_type_descriptor_error_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, fl_print_error_s, f_string_static_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, 0)
- #define macro_fl_print_t_initialize_error2(suffix, set) macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_error_d, F_type_descriptor_error_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, fl_print_error_s, suffix, f_color_set_t_initialize, f_color_set_t_initialize, set)
- #define macro_fl_print_t_initialize_warning() macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, fl_print_warning_s, f_string_static_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, 0)
- #define macro_fl_print_t_initialize_warning2(suffix, set) macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, fl_print_warning_s, suffix, f_color_set_t_initialize, f_color_set_t_initialize, set)
+ #define macro_fl_print_t_initialize_debug() macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, 0, fl_print_debug_s, f_string_static_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, 0, 0)
+ #define macro_fl_print_t_initialize_debug2(suffix, set) macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, 0, fl_print_debug_s, suffix, f_color_set_t_initialize, f_color_set_t_initialize, set, 0)
+ #define macro_fl_print_t_initialize_error() macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_error_d, F_type_descriptor_error_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, 0, fl_print_error_s, f_string_static_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, 0, 0)
+ #define macro_fl_print_t_initialize_error2(suffix, set) macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_error_d, F_type_descriptor_error_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, 0, fl_print_error_s, suffix, f_color_set_t_initialize, f_color_set_t_initialize, set, 0)
+ #define macro_fl_print_t_initialize_warning() macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, 0, fl_print_warning_s, f_string_static_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, 0, 0)
+ #define macro_fl_print_t_initialize_warning2(suffix, set) macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, 0, fl_print_warning_s, suffix, f_color_set_t_initialize, f_color_set_t_initialize, set, 0)
#endif // _di_fl_print_t_
#ifdef __cplusplus
#endif
#ifndef _di_fll_program_print_copyright_
- f_status_t fll_program_print_copyright(const fl_print_t print, const uint8_t first_last) {
+ f_status_t fll_program_print_copyright(const fl_print_t print) {
f_file_stream_lock(print.to);
- if (first_last & 0x1) {
- f_print_dynamic_raw(f_string_eol_s, print.to);
- }
-
- fl_print_format("Copyright © 2007-2023 Kevin Day.%r", print.to, f_string_eol_s);
+ fl_print_format("%rCopyright © 2007-2023 Kevin Day.%r", print.to, f_string_eol_s, f_string_eol_s);
#ifndef _di_detailed_copyright_
if (print.verbosity > f_console_verbosity_quiet_e) {
}
#endif // _di_detailed_copyright_
- if (first_last & 0x2) {
- f_print_dynamic_raw(f_string_eol_s, print.to);
- }
+ fl_print_format("%r", print.to, f_string_eol_s);
f_file_stream_unlock(print.to);
f_file_stream_lock(print.to);
- fl_print_format("%[%QNo files are specified.%]%r", print.to, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+ fl_print_format("%r%[%QNo files are specified.%]%r", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error, f_string_eol_s);
f_file_stream_unlock(print.to);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe%] ", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe%] ", print.to, f_string_eol_s, 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("%[0%]", print.to, print.set->notable, print.set->notable);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_1, name_1, print.set->notable);
fl_print_format("%[' parameter and the '%]", print.to, print.set->error, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_2, name_2, print.set->notable);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_1, name_1, print.set->notable);
fl_print_format("%[' parameter and the '%]", print.to, print.set->error, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_2, name_2, print.set->notable);
f_file_stream_lock(print.to);
- fl_print_format("%[%QCannot specify the '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QCannot specify the '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_1, name_1, print.set->notable);
fl_print_format("%[' parameter with the '%]", print.to, print.set->error, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_2, name_2, print.set->notable);
f_file_stream_lock(print.to);
- fl_print_format("%[%QCannot specify the '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QCannot specify the '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_1, name_1, print.set->notable);
fl_print_format("%[' parameter with the '%]", print.to, print.set->error, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_2, name_2, print.set->notable);
f_file_stream_lock(print.to);
- fl_print_format("%[%QCannot specify the '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QCannot specify the '%]", print.to, f_string_eol_s, 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("%[' when processing a pipe.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_1, name_1, print.set->notable);
fl_print_format("%[' parameter only allows either the '%]", print.to, print.set->error, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_2, name_2, print.set->notable);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe value '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe value '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%]", print.to, print.set->notable, value, print.set->notable);
fl_print_format("%[' for the parameter '%]", print.to, print.set->error, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe value '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe value '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%]", print.to, print.set->notable, value, print.set->notable);
fl_print_format("%[' for the parameter '%]", print.to, print.set->error, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe value '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe value '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%]", print.to, print.set->notable, value, print.set->notable);
fl_print_format("%[' for the parameter '%]", print.to, print.set->error, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe parameter%] ", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe parameter%] ", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, 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("%r%[%QThe parameter%] ", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
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);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe parameter '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe parameter '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
fl_print_format("%[' may only be specified once.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe value '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe value '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, value, print.set->notable);
fl_print_format("%[' may only be specified once for the parameter '%]", print.to, print.set->error, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, print.set->notable);
f_file_stream_lock(print.to);
- fl_print_format("%[%QFailure while processing the parameter '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QFailure while processing the parameter '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol, name, 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 start range value '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe start range value '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%]", print.to, print.set->notable, value_start, print.set->notable);
fl_print_format("%[' may not be greater than the stop value '%]", print.to, print.set->error, print.set->error);
fl_print_format("%[%Q%]", print.to, print.set->notable, value_stop, print.set->notable);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe value for the parameter '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe value for the parameter '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol, name, print.notable);
fl_print_format("%[' is too long.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe pipe has incorrectly placed form-feed characters (\\f).%]%r", print.to, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+ fl_print_format("%r%[%QThe pipe has incorrectly placed form-feed characters (\\f).%]%r", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error, f_string_eol_s);
f_file_stream_unlock(print.to);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe pipe has no content.%]%r", print.to, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+ fl_print_format("%r%[%QThe pipe has no content.%]%r", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error, f_string_eol_s);
f_file_stream_unlock(print.to);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe pipe has an Object without Content.%]%r", print.to, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+ fl_print_format("%r%[%QThe pipe has an Object without Content.%]%r", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error, f_string_eol_s);
f_file_stream_unlock(print.to);
#endif // _di_fll_program_print_help_usage_
#ifndef _di_fll_program_print_signal_received_
- f_status_t fll_program_print_signal_received(const fl_print_t print, const f_string_static_t line_first, const uint32_t signal) {
+ f_status_t fll_program_print_signal_received(const fl_print_t print, const uint32_t signal) {
if (print.verbosity != f_console_verbosity_verbose_e && print.verbosity != f_console_verbosity_debug_e) {
return F_output_not;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
f_file_stream_flush(print.to);
- fl_print_format("%]%r%[Received signal code %]", print.to, print.set->reset, line_first, print.set->warning, print.set->warning);
+ fl_print_format("%]%r%[Received signal code %]", print.to, print.set->reset, f_string_eol_s, print.set->warning, print.set->warning);
fl_print_format("%[%u%]", print.to, print.set->notable, signal, print.set->notable);
fl_print_format("%[.%]%r", print.to, print.set->warning, print.set->warning, f_string_eol_s);
#endif // _di_fll_program_print_signal_received_
#ifndef _di_fll_program_print_version_
- f_status_t fll_program_print_version(const fl_print_t print, const uint8_t first_last, const f_string_static_t version) {
+ f_status_t fll_program_print_version(const fl_print_t print, const f_string_static_t version) {
f_file_stream_lock(print.to);
- if (first_last & 0x1) {
- f_print_dynamic_raw(f_string_eol_s, print.to);
- }
-
+ f_print_dynamic_raw(f_string_eol_s, print.to);
f_print_dynamic(version, print.to);
f_print_dynamic_raw(f_string_eol_s, print.to);
-
- if (first_last & 0x2) {
- f_print_dynamic_raw(f_string_eol_s, print.to);
- }
+ f_print_dynamic_raw(f_string_eol_s, print.to);
f_file_stream_unlock(print.to);
* @param print
* The output structure to print to.
* The print.verbosity is used to determine how much detail is printed (except for when _di_detailed_copyright_ is set).
- * @param first_last
- * Bitwise variable representing whether or not to print the first and last new line.
- * Set bit 0x1 to printing first line.
- * Set bit 0x2 to printing last line.
*
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fll_program_print_copyright_
- extern f_status_t fll_program_print_copyright(const fl_print_t print, const uint8_t first_last);
+ extern f_status_t fll_program_print_copyright(const fl_print_t print);
#endif // _di_fll_program_print_copyright_
/**
* The output structure to print to.
* This locks, uses, and unlocks the file stream.
* This requires print.set to be non-NULL.
- * @param line_first
- * The first line character, which is expected to be set to either f_string_eol_s or f_string_empty_s.
* @param signal
* The signal code received.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fll_program_print_signal_received_
- extern f_status_t fll_program_print_signal_received(const fl_print_t print, const f_string_static_t line_first, const uint32_t signal);
+ extern f_status_t fll_program_print_signal_received(const fl_print_t print, const uint32_t signal);
#endif // _di_fll_program_print_signal_received_
/**
* The output structure to print to.
* This uses but does not lock or unlock file stream.
* This requires print.set to be non-NULL.
- * @param first_last
- * Bitwise variable representing whether or not to print the first and last new line.
- * Set bit 0x1 to printing first line.
- * Set bit 0x2 to printing last line.
* @param version
* The version number of the program.
*
* @see fl_print_format()
*/
#ifndef _di_fll_program_print_version_
- extern f_status_t fll_program_print_version(const fl_print_t print, const uint8_t first_last, const f_string_static_t version);
+ extern f_status_t fll_program_print_version(const fl_print_t print, const f_string_static_t version);
#endif // _di_fll_program_print_version_
#ifdef __cplusplus
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
- byte_dump_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- byte_dump_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
- byte_dump_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- byte_dump_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
if (main->parameters.array[byte_dump_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), byte_dump_program_version_s);
+ fll_program_print_version(main->message, byte_dump_program_version_s);
return F_none;
}
if (main->parameters.array[byte_dump_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
return F_none;
}
setting->state.step_small = byte_dump_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[byte_dump_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & byte_dump_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= byte_dump_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[byte_dump_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & byte_dump_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= byte_dump_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- byte_dump_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
- byte_dump_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- byte_dump_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- byte_dump_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
- if (main->parameters.array[byte_dump_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[byte_dump_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { byte_dump_parameter_verbosity_quiet_e, byte_dump_parameter_verbosity_error_e, byte_dump_parameter_verbosity_verbose_e, byte_dump_parameter_verbosity_debug_e, byte_dump_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- byte_dump_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- byte_dump_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
#define byte_dump_console_parameter_t_initialize \
{ \
macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \
macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \
macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \
macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \
* - file_to: Using a specified destination file.
* - help: Print help.
* - header: Enable printing of headers.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - separate: Enable printing of separators.
* - strip_invalid: Using strip invalid character mode.
* - verify: Using verify mode.
byte_dump_main_flag_file_to_e = 0x2,
byte_dump_main_flag_header_e = 0x4,
byte_dump_main_flag_help_e = 0x8,
- byte_dump_main_flag_separate_e = 0x10,
- byte_dump_main_flag_strip_invalid_e = 0x20,
- byte_dump_main_flag_verify_e = 0x40,
- byte_dump_main_flag_version_e = 0x80,
+ byte_dump_main_flag_print_first_e = 0x10,
+ byte_dump_main_flag_print_last_e = 0x20,
+ byte_dump_main_flag_separate_e = 0x40,
+ byte_dump_main_flag_strip_invalid_e = 0x80,
+ byte_dump_main_flag_verify_e = 0x100,
+ byte_dump_main_flag_version_e = 0x200,
}; // enum
#endif // _di_byte_dump_main_flag_e_
* flag: Flags passed to the main function.
*
* state: The state information.
- *
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
*/
#ifndef _di_byte_dump_setting_t_
typedef struct {
uint16_t flag;
f_state_t state;
-
- f_string_static_t line_first;
- f_string_static_t line_last;
} byte_dump_setting_t;
#define byte_dump_setting_t_initialize \
{ \
byte_dump_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
}
#endif // _di_byte_dump_setting_t_
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, byte_dump_program_name_long_s, byte_dump_program_version_s);
fll_program_print_help_option_standard(print);
fll_program_print_help_usage(print, byte_dump_program_name_s, fll_program_parameter_filenames_s);
- //if (!(setting->flag & XXX_main_flag_line_last_no_e)) {
- f_print_dynamic_raw(f_string_eol_s, print.to);
- //}
+ f_print_dynamic_raw(f_string_eol_s, print.to);
fl_print_format(" When using the %[%r%r%] option, some UTF-8 characters may be replaced by your instance and cause display alignment issues.%r%r", print.to, context.set.notable, f_console_symbol_long_normal_s, byte_dump_long_text_s, context.set.notable, f_string_eol_s, f_string_eol_s);
fl_print_format(" When using the %[%r%r%] option, invalid Unicode will fallback to being displayed using one of the other modes.%r", print.to, context.set.notable, f_console_symbol_long_normal_s, byte_dump_long_unicode_s, context.set.notable, f_string_eol_s);
- f_print_dynamic_raw(setting->line_last, print.to);
-
f_file_stream_flush(output);
f_file_stream_unlock(print.to);
}
#endif // _di_byte_dump_print_help_
-#ifndef _di_byte_dump_print_line_first_locked_
- f_status_t byte_dump_print_line_first_locked(byte_dump_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & byte_dump_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & byte_dump_main_flag_file_to_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_byte_dump_print_line_first_locked_
-
-#ifndef _di_byte_dump_print_line_first_unlocked_
- f_status_t byte_dump_print_line_first_unlocked(byte_dump_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & byte_dump_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & byte_dump_main_flag_file_to_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_byte_dump_print_line_first_unlocked_
-
-#ifndef _di_byte_dump_print_line_last_locked_
- f_status_t byte_dump_print_line_last_locked(byte_dump_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & byte_dump_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & byte_dump_main_flag_file_to_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_byte_dump_print_line_last_locked_
-
-#ifndef _di_byte_dump_print_line_last_unlocked_
- f_status_t byte_dump_print_line_last_unlocked(byte_dump_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & byte_dump_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & byte_dump_main_flag_file_to_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_byte_dump_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t byte_dump_print_help(byte_dump_setting_t * const setting, const fl_print_t print);
#endif // _di_byte_dump_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_byte_dump_print_line_first_locked_
- extern f_status_t byte_dump_print_line_first_locked(byte_dump_setting_t * const setting, const fl_print_t print);
-#endif // _di_byte_dump_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_byte_dump_print_line_first_unlocked_
- extern f_status_t byte_dump_print_line_first_unlocked(byte_dump_setting_t * const setting, const fl_print_t print);
-#endif // _di_byte_dump_print_line_first_unlocked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_byte_dump_print_line_last_locked_
- extern f_status_t byte_dump_print_line_last_locked(byte_dump_setting_t * const setting, const fl_print_t print);
-#endif // _di_byte_dump_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_byte_dump_print_line_last_unlocked_
- extern f_status_t byte_dump_print_line_last_unlocked(byte_dump_setting_t * const setting, const fl_print_t print);
-#endif // _di_byte_dump_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
if (!((++data->main->signal_check) % byte_dump_signal_check_d)) {
if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
setting->state.step_small = control_write_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[control_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & control_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= control_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[control_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & control_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= control_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- control_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
- control_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- control_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- control_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
- if (main->parameters.array[control_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[control_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { control_parameter_verbosity_quiet_e, control_parameter_verbosity_error_e, control_parameter_verbosity_verbose_e, control_parameter_verbosity_debug_e, control_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- control_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- control_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
* - file_to: Using a specified destination file.
* - help: Print help.
* - header: Enable printing of headers.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - separate: Enable printing of separators.
* - strip_invalid: Using strip invalid character mode.
* - verify: Using verify mode.
control_main_flag_file_to_e = 0x4,
control_main_flag_header_e = 0x8,
control_main_flag_help_e = 0x10,
- control_main_flag_separate_e = 0x20,
- control_main_flag_strip_invalid_e = 0x40,
- control_main_flag_verify_e = 0x80,
- control_main_flag_version_e = 0x100,
+ control_main_flag_print_first_e = 0x20,
+ control_main_flag_print_last_e = 0x40,
+ control_main_flag_separate_e = 0x80,
+ control_main_flag_strip_invalid_e = 0x100,
+ control_main_flag_verify_e = 0x200,
+ control_main_flag_version_e = 0x400,
}; // enum
#endif // _di_control_main_flag_e_
* flag: Flags passed to the main function.
*
* state: The state information.
- *
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
*/
#ifndef _di_control_setting_t_
typedef struct {
uint16_t flag;
f_state_t state;
-
- f_string_static_t line_first;
- f_string_static_t line_last;
} control_setting_t;
#define control_setting_t_initialize \
{ \
control_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
}
#endif // _di_control_setting_t_
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
- control_print_line_first_locked(setting, main->error)
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- control_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
- control_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- control_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
if (main->parameters.array[control_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), control_program_version_s);
+ fll_program_print_version(main->message, control_program_version_s);
return F_none;
}
if (main->parameters.array[control_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
return F_none;
}
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, control_program_name_long_s, control_program_version_s);
fll_program_print_help_option_standard(main->output.to, context);
fl_print_format(" Be sure to use the %[%r%r%] parameter to suppress output when using this in scripting.%r", print.to, print.set->notable, f_console_symbol_long_inverse_s, f_console_standard_long_quiet_s, print.set->notable, f_string_eol_s);
fl_print_format(" No response is returned on program errors, especially those errors that prevent communicating to the controller.%r", print.to, 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);
}
#endif // _di_control_print_help_
-#ifndef _di_control_print_line_first_locked_
- f_status_t control_print_line_first_locked(control_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & control_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & control_main_flag_file_to_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_control_print_line_first_locked_
-
-#ifndef _di_control_print_line_first_unlocked_
- f_status_t control_print_line_first_unlocked(control_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & control_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & control_main_flag_file_to_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_control_print_line_first_unlocked_
-
-#ifndef _di_control_print_line_last_locked_
- f_status_t control_print_line_last_locked(control_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & control_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & control_main_flag_file_to_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_control_print_line_last_locked_
-
-#ifndef _di_control_print_line_last_unlocked_
- f_status_t control_print_line_last_unlocked(control_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & control_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & control_main_flag_file_to_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_control_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t control_print_help(control_setting_t * const setting, const fl_print_t print);
#endif // _di_control_print_help_control
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_control_print_line_first_locked_
- extern f_status_t control_print_line_first_locked(control_setting_t * const setting, const fl_print_t print);
-#endif // _di_control_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_control_print_line_first_unlocked_
- extern f_status_t control_print_line_first_unlocked(control_setting_t * const setting, const fl_print_t print);
-#endif // _di_control_print_line_first_unlocked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_control_print_line_last_locked_
- extern f_status_t control_print_line_last_locked(control_setting_t * const setting, const fl_print_t print);
-#endif // _di_control_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_control_print_line_last_unlocked_
- extern f_status_t control_print_line_last_unlocked(control_setting_t * const setting, const fl_print_t print);
-#endif // _di_control_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
setting->state.step_small = controller_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[controller_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & controller_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= controller_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[controller_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & controller_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= controller_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- controller_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
- controller_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- controller_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- controller_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
- if (main->parameters.array[controller_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[controller_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { controller_parameter_verbosity_quiet_e, controller_parameter_verbosity_error_e, controller_parameter_verbosity_verbose_e, controller_parameter_verbosity_debug_e, controller_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- controller_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- controller_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
* - file_to: Using a specified destination file.
* - help: Print help.
* - header: Enable printing of headers.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - separate: Enable printing of separators.
* - strip_invalid: Using strip invalid character mode.
* - verify: Using verify mode.
controller_main_flag_file_to_e = 0x4,
controller_main_flag_header_e = 0x8,
controller_main_flag_help_e = 0x10,
- controller_main_flag_separate_e = 0x20,
- controller_main_flag_strip_invalid_e = 0x40,
- controller_main_flag_verify_e = 0x80,
- controller_main_flag_version_e = 0x100,
+ controller_main_flag_print_first_e = 0x20,
+ controller_main_flag_print_last_e = 0x40,
+ controller_main_flag_separate_e = 0x80,
+ controller_main_flag_strip_invalid_e = 0x100,
+ controller_main_flag_verify_e = 0x200,
+ controller_main_flag_version_e = 0x400,
}; // enum
#endif // _di_controller_main_flag_e_
* flag: Flags passed to the main function.
*
* state: The state information.
- *
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
*/
#ifndef _di_controller_setting_t_
typedef struct {
uint16_t flag;
f_state_t state;
-
- f_string_static_t line_first;
- f_string_static_t line_last;
} controller_setting_t;
#define controller_setting_t_initialize \
{ \
controller_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
}
#endif // _di_controller_setting_t_
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
- controller_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- controller_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
- controller_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- controller_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
if (main->parameters.array[controller_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), controller_program_version_s);
+ fll_program_print_version(main->message, controller_program_version_s);
return F_none;
}
if (main->parameters.array[controller_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
return F_none;
}
controller_lock_print(print.to, 0);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, *main->program_name_long, controller_program_version_s);
fll_program_print_help_option_standard(print.to, context);
fl_print_format(" Specify an empty string for the %[%r%r%] parameter to disable pid file creation for this program.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, controller_long_pid_s, print.set->notable, f_string_eol_s);
- f_print_dynamic_raw(setting->line_last, print.to);
-
controller_unlock_print_flush(print.to, 0);
return F_none;
}
#endif // _di_controller_print_help_
-#ifndef _di_controller_print_line_first_locked_
- f_status_t controller_print_line_first_locked(controller_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & controller_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & controller_main_flag_file_to_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_controller_print_line_first_locked_
-
-#ifndef _di_controller_print_line_first_unlocked_
- f_status_t controller_print_line_first_unlocked(controller_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & controller_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & controller_main_flag_file_to_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_controller_print_line_first_unlocked_
-
-#ifndef _di_controller_print_line_last_locked_
- f_status_t controller_print_line_last_locked(controller_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & controller_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & controller_main_flag_file_to_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_controller_print_line_last_locked_
-
-#ifndef _di_controller_print_line_last_unlocked_
- f_status_t controller_print_line_last_unlocked(controller_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & controller_main_flag_verify_e) return;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & controller_main_flag_file_to_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_controller_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
#ifndef _di_controller_print_help_
extern f_status_t controller_print_help(controller_setting_t * const setting, const fl_print_t print);
#endif // _di_controller_print_help_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_controller_print_line_first_locked_
- extern f_status_t controller_print_line_first_locked(controller_setting_t * const setting, const fl_print_t print);
-#endif // _di_controller_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_controller_print_line_first_unlocked_
- extern f_status_t controller_print_line_first_unlocked(controller_setting_t * const setting, const fl_print_t print);
-#endif // _di_controller_print_line_first_unlocked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_controller_print_line_last_locked_
- extern f_status_t controller_print_line_last_locked(controller_setting_t * const setting, const fl_print_t print);
-#endif // _di_controller_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_controller_print_line_last_unlocked_
- extern f_status_t controller_print_line_last_unlocked(controller_setting_t * const setting, const fl_print_t print);
-#endif // _di_controller_print_line_last_unlocked_
#ifdef __cplusplus
} // extern "C"
#endif
}
if (F_status_set_fine(status) == F_interrupt) {
- fll_program_print_signal_received(main->warning, setting->line_first, thread.signal);
+ fll_program_print_signal_received(main->warning, thread.signal);
if (main->output.verbosity != f_console_verbosity_quiet_e) {
fll_print_dynamic_raw(f_string_eol_s, main->output.to);
#ifndef _di_fake_build_arguments_standard_add_
void fake_build_arguments_standard_add(fake_data_t * const data, fake_build_data_t * const data_build, const bool is_shared, const uint8_t type, f_string_dynamics_t *arguments) {
- if (!data || !data->main || !data->setting || !data_build || !arguments) return;
+ if (!data || !data->program || !data->setting || !data_build || !arguments) return;
if (F_status_is_error(data->setting->state.status)) return;
{
#ifndef _di_fake_build_copy_
void fake_build_copy(fake_data_t * const data, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t perserve_offset) {
- if (!data || !data->main || !data->setting) return;
+ if (!data || !data->program || !data->setting) return;
if (data->setting->state.status == F_child) return;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return;
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
f_string_dynamic_t destination_directory = f_string_dynamic_t_initialize;
f_string_static_t buffer = f_string_static_t_initialize;
- if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) {
- fll_print_format("%r%[Copying %Q.%]%r", data->main->message.to, f_string_eol_s, data->main->context.set.important, label, data->main->context.set.important, f_string_eol_s);
+ if (data->program->message.verbosity != f_console_verbosity_quiet_e && data->program->message.verbosity != f_console_verbosity_error_e) {
+ fll_print_format("%r%[Copying %Q.%]%r", data->program->message.to, f_string_eol_s, data->program->context.set.important, label, data->program->context.set.important, f_string_eol_s);
}
data->setting->state.status = f_string_dynamic_resize(source.used, &path_source);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_resize));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_resize));
f_string_dynamic_resize(0, &path_source);
memcpy(path_source.string, source.string, sizeof(f_char_t) * source.used);
- f_directory_recurse_t recurse = f_directory_recurse_t_initialize;
+ f_directory_recurse_t recurse = f_directory_recurse_t_initialize; // @fixme this is memory leaking on recurse.listing.
recurse.verbose = &fake_print_verbose_copy;
//recurse.failures = &failures; // @fixme this now needs to be handled by a callback in recurse (recurse.state.handle)., maybe make this a callback on f_directory_recurse_t?
recurse.mode = mode;
for (f_array_length_t i = 0; i < files.used; ++i) {
- if (!((++data->main->signal_check) % fake_signal_check_short_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_short_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
break;
}
- data->main->signal_check = 0;
+ data->program->signal_check = 0;
}
if (!files.array[i].used) continue;
data->setting->state.status = f_string_dynamic_append_nulless(files.array[i], &path_source);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
data->setting->state.status = f_string_dynamic_append_nulless(destination, &destination_directory);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
data->setting->state.status = f_file_name_base(path_source, &destination_directory);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_base));
+ fake_print_error(&data->program->error, macro_fake_f(f_file_name_base));
break;
}
fl_directory_copy(path_source, destination_directory, &recurse);
if (F_status_is_error(data->setting->state.status)) {
- if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ if (data->program->error.verbosity >= f_console_verbosity_verbose_e) {
/* // @fixme
for (f_array_length_t j = 0; j < failures.used; ++j) {
- fake_print_error_build_operation_file(data->setting, data->main->error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true);
+ fake_print_error_build_operation_file(data->setting, data->program->error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true);
} // for
*/
if (F_status_set_fine(data->setting->state.status) != F_failure) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fl_directory_copy));
+ fake_print_error(&data->program->error, macro_fake_f(fl_directory_copy));
}
}
- else if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
- fake_print_error_build_operation_file(data->setting, data->main->error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true);
+ else if (data->program->error.verbosity > f_console_verbosity_quiet_e) {
+ fake_print_error_build_operation_file(data->setting, data->program->error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true);
}
break;
data->setting->state.status = f_string_dynamic_append_nulless(destination, &destination_file);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
data->setting->state.status = f_string_dynamic_append_nulless(destination, &destination_directory);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
data->setting->state.status = f_file_name_directory(buffer, &destination_directory);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_directory));
+ fake_print_error(&data->program->error, macro_fake_f(f_file_name_directory));
break;
}
data->setting->state.status = fl_directory_create(destination_directory, F_file_mode_all_rwx_d);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(fl_directory_create), destination_directory, f_file_operation_create_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(fl_directory_create), destination_directory, f_file_operation_create_s, fll_error_file_type_directory_e);
break;
}
data->setting->state.status = f_string_append(path_source.string + perserve_offset, path_source.used - perserve_offset, &destination_file);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_append));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_append));
break;
}
data->setting->state.status = f_file_name_base(path_source, &destination_file);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_base));
+ fake_print_error(&data->program->error, macro_fake_f(f_file_name_base));
break;
}
data->setting->state.status = f_file_copy(path_source, destination_file, mode, F_file_default_read_size_d, f_file_stat_flag_reference_e);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_build_operation_file(data->setting, data->main->error, macro_fake_f(f_file_copy), f_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true);
+ fake_print_error_build_operation_file(data->setting, data->program->error, macro_fake_f(f_file_copy), f_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true);
break;
}
- if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("Copied file '%Q' to '%Q'.%r", data->main->message.to, path_source, destination_file, f_string_eol_s);
- }
+ fake_build_print_verbose_copied_file(data->setting, data->program->message, path_source, destination_file);
}
else if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_is), path_source, f_file_operation_create_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_directory_is), path_source, f_file_operation_create_s, fll_error_file_type_file_e);
break;
}
#ifndef _di_fake_build_execute_process_script_
int fake_build_execute_process_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t process_script, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting || !data_build) return 0;
- if (data->setting->state.status == F_child) return data->main->child;
+ if (!data || !data->program || !data->setting || !data_build) return 0;
+ if (data->setting->state.status == F_child) return data->program->child;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
if (!process_script.used) return 0;
data->setting->state.status = fll_execute_arguments_add(fake_other_operation_build_s, &arguments);
// Ensure console color mode is passed to the scripts so that they can also react to color mode.
- if (F_status_is_error_not(data->setting->state.status) && data->main->context.mode != f_color_mode_none_e) {
+ if (F_status_is_error_not(data->setting->state.status) && data->program->context.mode != f_color_mode_none_e) {
f_string_static_t argument = f_string_static_t_initialize;
argument.used = f_console_symbol_short_inverse_s.used + f_console_standard_short_dark_s.used;
memcpy(argument_string, f_console_symbol_short_inverse_s.string, sizeof(f_char_t) * f_console_symbol_short_inverse_s.used);
- if (data->main->context.mode == f_color_mode_dark_e) {
+ if (data->program->context.mode == f_color_mode_dark_e) {
memcpy(argument_string + f_console_symbol_short_inverse_s.used, f_console_standard_short_dark_s.string, sizeof(f_char_t) * f_console_standard_short_dark_s.used);
}
- else if (data->main->context.mode == f_color_mode_light_e) {
+ else if (data->program->context.mode == f_color_mode_light_e) {
memcpy(argument_string + f_console_symbol_short_inverse_s.used, f_console_standard_short_light_s.string, sizeof(f_char_t) * f_console_standard_short_light_s.used);
}
- else if (data->main->context.mode == f_color_mode_not_e) {
+ else if (data->program->context.mode == f_color_mode_not_e) {
memcpy(argument_string + f_console_symbol_short_inverse_s.used, f_console_standard_short_no_color_s.string, sizeof(f_char_t) * f_console_standard_short_no_color_s.used);
}
}
// Ensure verbosity level is passed to the scripts so that they can also react to requested verbosity.
- if (F_status_is_error_not(data->setting->state.status) && data->main->error.verbosity != f_console_verbosity_normal_e) {
+ if (F_status_is_error_not(data->setting->state.status) && data->program->error.verbosity != f_console_verbosity_normal_e) {
f_string_static_t argument = f_string_static_t_initialize;
argument.used = f_console_symbol_short_inverse_s.used + f_console_standard_short_quiet_s.used;
memcpy(argument_string, f_console_symbol_short_inverse_s.string, sizeof(f_char_t) * f_console_symbol_short_inverse_s.used);
- if (data->main->context.mode == f_console_verbosity_quiet_e) {
+ if (data->program->context.mode == f_console_verbosity_quiet_e) {
memcpy(argument_string + f_console_symbol_short_inverse_s.used, f_console_standard_short_quiet_s.string, sizeof(f_char_t) * f_console_standard_short_quiet_s.used);
}
- else if (data->main->context.mode == f_console_verbosity_error_e) {
+ else if (data->program->context.mode == f_console_verbosity_error_e) {
memcpy(argument_string + f_console_symbol_short_inverse_s.used, f_console_standard_short_error_s.string, sizeof(f_char_t) * f_console_standard_short_error_s.used);
}
- else if (data->main->context.mode == f_console_verbosity_verbose_e) {
+ else if (data->program->context.mode == f_console_verbosity_verbose_e) {
memcpy(argument_string + f_console_symbol_short_inverse_s.used, f_console_standard_short_verbose_s.string, sizeof(f_char_t) * f_console_standard_short_verbose_s.used);
}
- else if (data->main->context.mode == f_console_verbosity_debug_e) {
+ else if (data->program->context.mode == f_console_verbosity_debug_e) {
memcpy(argument_string + f_console_symbol_short_inverse_s.used, f_console_standard_short_debug_s.string, sizeof(f_char_t) * f_console_standard_short_debug_s.used);
}
}
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add));
+ fake_print_error(&data->program->error, macro_fake_f(fll_execute_arguments_add));
f_string_dynamics_resize(0, &arguments);
} // for
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_mash));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_mash));
f_string_dynamic_resize(0, &defines);
f_string_dynamics_resize(0, &arguments);
f_string_dynamic_resize(0, &defines);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add_parameter_set));
+ fake_print_error(&data->program->error, macro_fake_f(fll_execute_arguments_add_parameter_set));
f_string_dynamics_resize(0, &arguments);
f_string_dynamic_t path = f_string_dynamic_t_initialize;
- if (process_script.string[0] != '/') {
+ if (process_script.string[0] != f_path_separator_s.string[0]) {
data->setting->state.status = f_string_dynamic_append_nulless(data->path_data_build, &path);
}
}
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
f_string_dynamic_resize(0, &path);
f_string_dynamics_resize(0, &arguments);
f_string_dynamics_resize(0, &arguments);
- if (!((++data->main->signal_check) % fake_signal_check_d) && fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d) && fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
}
else if (data->setting->state.status != F_child) {
if (F_status_is_error(data->setting->state.status)) {
if (F_status_set_fine(data->setting->state.status) == F_failure) {
- fake_print_error_failure_script(data->setting, data->main->error, path);
+ fake_print_error_failure_script(data->setting, data->program->error, path);
}
else {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_program));
+ fake_print_error(&data->program->error, macro_fake_f(fll_execute_program));
}
}
else {
#ifndef _di_fake_build_get_file_name_without_extension_
void fake_build_get_file_name_without_extension(fake_data_t * const data, const f_string_static_t path, f_string_dynamic_t *name) {
- if (!data || !data->main || !data->setting) return;
+ if (!data || !data->program || !data->setting) return;
name->used = 0;
data->setting->state.status = F_none;
data->setting->state.status = f_file_name_base(path, name);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_base));
+ fake_print_error(&data->program->error, macro_fake_f(f_file_name_base));
return;
}
#ifndef _di_fake_build_objects_add_
void fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) {
- if (!data || !data->main || !data->setting || !data_build || !path || !generic || !specific || !arguments) return;
+ if (!data || !data->program || !data->setting || !data_build || !path || !generic || !specific || !arguments) return;
f_array_length_t i = 0;
f_array_length_t j = 0;
#ifndef _di_fake_build_operate_
void fake_build_operate(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe) {
- if (!data || !data->main || !data->setting) return;
+ if (!data || !data->program || !data->setting) return;
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
fake_build_data_t data_build = fake_build_data_t_initialize;
fake_build_stage_t stage = fake_build_stage_t_initialize;
- macro_f_mode_t_set_default_umask(mode, data->main->umask);
+ macro_f_mode_t_set_default_umask(mode, data->program->umask);
fake_build_load_setting(data, build_arguments, process_pipe, &data_build.setting);
if (F_status_is_fine(data->setting->state.status)) {
- if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) {
- f_file_stream_lock(data->main->message.to);
-
- fl_print_format("%[Building%] ", data->main->message.to, data->main->context.set.important, data->main->context.set.important);
- fl_print_format("%[%Q%]", data->main->message.to, data->main->context.set.notable, data_build.setting.build_name, data->main->context.set.notable);
- fl_print_format("%[ using '%]", data->main->message.to, data->main->context.set.important, data->main->context.set.important);
- fl_print_format("%[%Q%]", data->main->message.to, data->main->context.set.notable, data->setting->settings, data->main->context.set.notable);
-
- fl_print_format("%[' with modes '%]", data->main->message.to, data->main->context.set.important, data->main->context.set.important);
-
- f_string_statics_t modes_custom = f_string_statics_t_initialize;
- modes_custom.used = build_arguments && build_arguments->used > 1 ? build_arguments->used - 1 : 0;
- modes_custom.size = 0;
-
- f_string_static_t modes_custom_array[modes_custom.used];
- modes_custom.array = modes_custom_array;
-
- for (f_array_length_t i = 0; i < modes_custom.used; ++i) {
- modes_custom.array[i] = build_arguments->array[i + 1];
- } // for
-
- // Custom modes are always used if provided, otherwise if any mode is specified, the entire defaults is replaced.
- const f_string_statics_t * const modes = modes_custom.used
- ? &modes_custom
- : data->setting->modes.used
- ? &data->setting->modes
- : &data_build.setting.modes_default;
-
- for (f_array_length_t i = 0; i < modes->used; ) {
-
- fl_print_format("%[%Q%]", data->main->message.to, data->main->context.set.notable, modes->array[i], data->main->context.set.notable);
-
- if (++i < modes->used) {
- fl_print_format("%[', '%]", data->main->message.to, data->main->context.set.important, data->main->context.set.important);
- }
- } // for
-
- fl_print_format("%['.%]%r", data->main->message.to, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
-
- f_file_stream_unlock(data->main->message.to);
- }
+ fake_print_building(data->setting, data->program->message, build_arguments, &data_build.setting);
}
fake_build_load_stage(data, build_arguments && build_arguments->array[0].used ? build_arguments->array[0] : f_string_empty_s, &stage);
fake_build_skeleton(data, &data_build, mode.directory, stage.file_skeleton);
- data->main->child = fake_build_execute_process_script(data, &data_build, data_build.setting.process_pre, stage.file_process_pre);
+ data->program->child = fake_build_execute_process_script(data, &data_build, data_build.setting.process_pre, stage.file_process_pre);
fake_build_copy(data, mode, fake_build_documentation_files_s, data->path_data_documentation, data->path_build_documentation, data_build.setting.build_sources_documentation, stage.file_sources_documentation, 0);
}
if (data_build.setting.build_shared) {
- data->main->child = fake_build_object_shared(data, &data_build, mode, stage.file_object_shared);
+ data->program->child = fake_build_object_shared(data, &data_build, mode, stage.file_object_shared);
- data->main->child = fake_build_library_shared(data, &data_build, mode, stage.file_library_shared);
+ data->program->child = fake_build_library_shared(data, &data_build, mode, stage.file_library_shared);
- data->main->child = fake_build_program_shared(data, &data_build, mode, stage.file_program_shared);
+ data->program->child = fake_build_program_shared(data, &data_build, mode, stage.file_program_shared);
}
if (data_build.setting.build_static) {
- data->main->child = fake_build_object_static(data, &data_build, mode, stage.file_object_static);
+ data->program->child = fake_build_object_static(data, &data_build, mode, stage.file_object_static);
- data->main->child = fake_build_objects_static(data, &data_build, mode, stage.file_objects_static);
+ data->program->child = fake_build_objects_static(data, &data_build, mode, stage.file_objects_static);
- data->main->child = fake_build_library_static(data, &data_build, mode, stage.file_library_static);
+ data->program->child = fake_build_library_static(data, &data_build, mode, stage.file_library_static);
- data->main->child = fake_build_program_static(data, &data_build, mode, stage.file_program_static);
+ data->program->child = fake_build_program_static(data, &data_build, mode, stage.file_program_static);
}
if (data_build.setting.build_script) {
#ifndef _di_fake_build_path_source_length_
void fake_build_path_source_length(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) {
- if (!data || !data->main || !data->setting || !data_build || !setting_path_source || !source) return;
+ if (!data || !data->program || !data->setting || !data_build || !setting_path_source || !source) return;
source->used = 0;
#ifndef _di_fake_build_path_source_string_
void fake_build_path_source_string(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) {
- if (!data || !data->main || !data->setting || !data_build || !setting_path_source || !source) return;
+ if (!data || !data->program || !data->setting || !data_build || !setting_path_source || !source) return;
source->used = 0;
#ifndef _di_fake_build_sources_add_
void fake_build_sources_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) {
- if (!data || !data->main || !data->setting || !data_build || !generic || !specific || !arguments) return;
+ if (!data || !data->program || !data->setting || !data_build || !generic || !specific || !arguments) return;
f_array_length_t i = 0;
f_array_length_t j = 0;
#ifndef _di_fake_build_sources_object_add_
void fake_build_sources_object_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *generic, const f_string_static_t *specific, f_string_dynamics_t *arguments) {
- if (!data || !data->main || !data->setting || !data_build || !generic || !specific || !arguments) return;
+ if (!data || !data->program || !data->setting || !data_build || !generic || !specific || !arguments) return;
if (!generic->used && !specific->used) {
data->setting->state.status = F_none;
#ifndef _di_fake_build_touch_
void fake_build_touch(fake_data_t * const data, const f_string_dynamic_t file) {
- if (!data || !data->main || !data->setting) return;
+ if (!data || !data->program || !data->setting) return;
if (F_status_is_error(data->setting->state.status)) return;
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
f_mode_t mode = f_mode_t_initialize;
- macro_f_mode_t_set_default_umask(mode, data->main->umask);
+ macro_f_mode_t_set_default_umask(mode, data->program->umask);
data->setting->state.status = f_file_touch(file, mode.regular, F_false);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_touch), file, f_file_operation_touch_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_touch), file, f_file_operation_touch_s, fll_error_file_type_file_e);
}
else {
data->setting->state.status = F_none;
#ifndef _di_fake_build_library_script_
int fake_build_library_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting) return 0;
- if (data->setting->state.status == F_child) return data->main->child;
+ if (!data || !data->program || !data->setting) return 0;
+ if (data->setting->state.status == F_child) return data->program->child;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
fake_build_touch(data, file_stage);
#ifndef _di_fake_build_library_shared_
int fake_build_library_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting || !data_build) return 0;
- if (data->setting->state.status == F_child) return data->main->child;
+ if (!data || !data->program || !data->setting || !data_build) return 0;
+ if (data->setting->state.status == F_child) return data->program->child;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_shared.used) return 0;
- fake_build_print_compile_library_shared(data->setting, data->main->message);
+ fake_build_print_compile_library_shared(data->setting, data->program->message);
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_shared, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_objects_add));
f_string_dynamics_resize(0, &arguments);
fake_build_sources_add(data, data_build, &data_build->setting.build_sources_library, &data_build->setting.build_sources_library_shared, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_add));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_sources_add));
f_string_dynamics_resize(0, &arguments);
fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_library_e, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add));
+ fake_print_error(&data->program->error, macro_fake_f(fll_execute_arguments_add));
f_string_dynamics_resize(0, &arguments);
data->setting->state.status = f_file_link(parameter_file_name_major, parameter_file_path);
if (F_status_is_error_not(data->setting->state.status)) {
- fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_major);
+ fake_build_print_linked_file(data->setting, data->program->message, parameter_file_path, parameter_file_name_major);
}
else {
if (F_status_set_fine(data->setting->state.status) == F_file_found) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_name_major, f_file_operation_link_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_link), parameter_file_name_major, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
data->setting->state.status = f_file_link(parameter_file_name_minor, parameter_file_path);
if (F_status_is_error_not(data->setting->state.status)) {
- fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_minor);
+ fake_build_print_linked_file(data->setting, data->program->message, parameter_file_path, parameter_file_name_minor);
}
else {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), F_status_set_fine(data->setting->state.status) == F_file_found ? parameter_file_path : parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_link), F_status_set_fine(data->setting->state.status) == F_file_found ? parameter_file_path : parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
data->setting->state.status = f_file_link(parameter_file_name_micro, parameter_file_path);
if (F_status_is_error_not(data->setting->state.status)) {
- fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_micro);
+ fake_build_print_linked_file(data->setting, data->program->message, parameter_file_path, parameter_file_name_micro);
}
else {
if (F_status_set_fine(data->setting->state.status) == F_file_found) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_link), parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
data->setting->state.status = f_file_link(parameter_file_name_nano, parameter_file_path);
if (F_status_is_error_not(data->setting->state.status)) {
- fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_nano);
+ fake_build_print_linked_file(data->setting, data->program->message, parameter_file_path, parameter_file_name_nano);
}
else {
if (F_status_set_fine(data->setting->state.status) == F_file_found) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_name_nano, f_file_operation_link_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_link), parameter_file_name_nano, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
#ifndef _di_fake_build_library_static_
int fake_build_library_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting || !data_build) return 0;
- if (data->setting->state.status == F_child) return data->main->child;
+ if (!data || !data->program || !data->setting || !data_build) return 0;
+ if (data->setting->state.status == F_child) return data->program->child;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_static.used) return 0;
- fake_build_print_compile_library_static(data->setting, data->main->message);
+ fake_build_print_compile_library_static(data->setting, data->program->message);
f_string_dynamic_t file_name = f_string_dynamic_t_initialize;
f_string_dynamic_t source_path = f_string_dynamic_t_initialize;
fake_build_get_file_name_without_extension(data, sources[i]->array[j], &file_name);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_get_file_name_without_extension));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_get_file_name_without_extension));
break;
}
data->setting->state.status = f_file_name_directory(sources[i]->array[j], &source_path);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_directory));
+ fake_print_error(&data->program->error, macro_fake_f(f_file_name_directory));
break;
}
data->setting->state.status = f_string_dynamic_prepend(data->path_build_objects, &source_path);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_prepend));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_prepend));
break;
}
data->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &source_path);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_assure));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_assure));
break;
}
data->setting->state.status = fll_execute_arguments_add(source, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add));
+ fake_print_error(&data->program->error, macro_fake_f(fll_execute_arguments_add));
break;
}
} // for
}
- int result = data->main->child;
+ int result = data->program->child;
if (F_status_is_error_not(data->setting->state.status)) {
result = fake_execute(data, data_build->environment, data_build->setting.build_indexer, arguments);
#ifndef _di_fake_build_load_environment_
void fake_build_load_environment(fake_data_t * const data, fake_build_data_t * const data_build, f_string_maps_t * const environment) {
- if (!data || !data->main || !data->setting || !data_build || !environment) return;
+ if (!data || !data->program || !data->setting || !data_build || !environment) return;
if (F_status_is_error(data->setting->state.status)) return;
// Reset the environment.
data->setting->state.status = fl_environment_load_name(variables[i], environment);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fl_environment_load_name));
+ fake_print_error(&data->program->error, macro_fake_f(fl_environment_load_name));
return;
}
if (environment->used + data_build->setting.environment.used > environment->size) {
if (environment->used + data_build->setting.environment.used > f_environment_max_length_d) {
- if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
- f_file_stream_lock(data->main->error.to);
+ if (data->program->error.verbosity > f_console_verbosity_quiet_e) {
+ f_file_stream_lock(data->program->error.to);
- fl_print_format("%r%[%QThe values for the setting '%]", data->main->error.to, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
- fl_print_format("%[%r%]", data->main->error.to, data->main->error.notable, fake_build_setting_name_environment_s, data->main->error.notable);
- fl_print_format("%[' of setting file '%]", data->main->error.to, data->main->error.context, data->main->error.context);
- fl_print_format("%[%r%]", data->main->error.to, data->main->error.notable, fake_build_setting_name_environment_s, data->main->error.notable);
- fl_print_format("%[' is too large.%]%r", data->main->error.to, data->main->error.context, data->main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe values for the setting '%]", data->program->error.to, f_string_eol_s, data->program->error.context, data->program->error.prefix, data->program->error.context);
+ fl_print_format("%[%r%]", data->program->error.to, data->program->error.notable, fake_build_setting_name_environment_s, data->program->error.notable);
+ fl_print_format("%[' of setting file '%]", data->program->error.to, data->program->error.context, data->program->error.context);
+ fl_print_format("%[%r%]", data->program->error.to, data->program->error.notable, fake_build_setting_name_environment_s, data->program->error.notable);
+ fl_print_format("%[' is too large.%]%r", data->program->error.to, data->program->error.context, data->program->error.context, f_string_eol_s);
- f_file_stream_unlock(data->main->error.to);
+ f_file_stream_unlock(data->program->error.to);
}
data->setting->state.status = F_status_set_error(F_array_too_large);
data->setting->state.status = fl_environment_load_names(data_build->setting.environment, environment);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fl_environment_load_names));
+ fake_print_error(&data->program->error, macro_fake_f(fl_environment_load_names));
}
else {
data->setting->state.status = F_none;
#ifndef _di_fake_build_load_setting_
void fake_build_load_setting(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe, fake_build_setting_t * const setting) {
- if (!data || !data->main || !data->setting || !setting) return;
+ if (!data || !data->program || !data->setting || !setting) return;
if (F_status_is_error(data->setting->state.status)) return;
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
f_string_range_t range = macro_f_string_range_t_initialize2(buffer.used);
f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
- // @todo make sure data->setting->state.custom = (void *) data->main;
- //f_state_t state = macro_f_state_t_initialize_1(fake_allocation_large_d, fake_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data->main, 0);
+ // @todo make sure data->setting->state.custom = (void *) data->program;
+ //f_state_t state = macro_f_state_t_initialize_1(fake_allocation_large_d, fake_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data->program, 0);
fll_fss_extended_read(buffer, &range, &objects, &contents, 0, 0, &delimits, 0, &data->setting->state);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_fss(data->setting, data->main->error, macro_fake_f(fll_fss_extended_read), data->file_data_build_settings, range, F_true);
+ fake_print_error_fss(data->setting, data->program->error, macro_fake_f(fll_fss_extended_read), data->file_data_build_settings, range, F_true);
}
else {
f_fss_apply_delimit(delimits, &buffer, &data->setting->state);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_fss_apply_delimit));
+ fake_print_error(&data->program->error, macro_fake_f(f_fss_apply_delimit));
}
else {
fake_build_load_setting_process(data, F_true, path_file, modes_custom.used ? &modes_custom : 0, buffer, objects, contents, setting);
for (uint8_t i = 0; i < 1; ++i) {
if (!settings[i]->used) {
- fake_build_print_error_missing_required_setting(data->setting, data->main->warning, names[i], path_file);
+ fake_build_print_error_missing_required_setting(data->setting, data->program->warning, names[i], path_file);
failed = F_true;
}
#ifndef _di_fake_build_load_setting_process_
void fake_build_load_setting_process(fake_data_t * const data, const bool checks, const f_string_static_t path_file, const f_string_statics_t * const modes_custom, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t * const setting) {
- if (!data || !data->main || !data->setting || !setting) return;
+ if (!data || !data->program || !data->setting || !setting) return;
if (F_status_is_error(data->setting->state.status) && buffer.used) return;
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
} // for
if (found == F_false) {
- fake_build_print_error_mode_invalid(data->setting, data->main->warning, modes->array[i], path_file);
+ fake_build_print_error_mode_invalid(data->setting, data->program->warning, modes->array[i], path_file);
error_printed = F_true;
data->setting->state.status = F_status_set_error(F_parameter);
if (F_status_is_error(data->setting->state.status)) {
if (data->setting->state.status == F_status_set_error(F_string_too_large)) {
- fake_build_print_error_setting_too_long(data->setting, data->main->warning, path_file);
+ fake_build_print_error_setting_too_long(data->setting, data->program->warning, path_file);
}
else if (!error_printed) {
- fake_print_error(data->setting, data->main->error, function);
+ fake_print_error(&data->program->error, function);
}
}
else {
data->setting->state.status = f_string_dynamic_append(settings_single_string_default[i], settings_single_destination[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append));
break;
}
else {
*settings_single_bool[i] = F_true;
- fake_build_print_warning_setting_boolean_may_only_be(data->setting, data->main->warning, settings_single_name[i], path_file, settings_single_version_default_name[i]);
+ fake_build_print_warning_setting_boolean_may_only_be(data->setting, data->program->warning, settings_single_name[i], path_file, settings_single_version_default_name[i]);
}
}
else if (settings_single_type[i] == 4) {
else {
*settings_single_language[i] = fake_build_language_c_e;
- fake_build_print_warning_setting_language_may_only_be(data->setting, data->main->warning, settings_single_name[i], path_file, fake_build_language_c_s);
+ fake_build_print_warning_setting_language_may_only_be(data->setting, data->program->warning, settings_single_name[i], path_file, fake_build_language_c_s);
}
}
else if (settings_single_type[i] == 5) {
else {
*settings_single_version[i] = settings_single_version_default[i];
- fake_build_print_warning_setting_version_may_only_be(data->setting, data->main->warning, settings_single_name[i], path_file, settings_single_version_default_name[i]);
+ fake_build_print_warning_setting_version_may_only_be(data->setting, data->program->warning, settings_single_name[i], path_file, settings_single_version_default_name[i]);
}
}
else if (settings_single_destination[i]) {
data->setting->state.status = f_path_directory_cleanup(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_path_directory_cleanup));
+ fake_print_error(&data->program->error, macro_fake_f(f_path_directory_cleanup));
break;
}
data->setting->state.status = f_string_dynamic_increase_by(settings_single_source[i]->array[settings_single_source[i]->used - 1].used + 1, settings_single_destination[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_increase_by));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_increase_by));
break;
}
data->setting->state.status = f_string_dynamic_append_nulless(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
if (checks && !setting->version_file) {
setting->version_file = fake_build_version_micro_e;
- fake_build_print_warning_setting_required_default_to(data->setting, data->main->warning, fake_build_setting_name_version_file_s, path_file, fake_build_version_micro_s);
+ fake_build_print_warning_setting_required_default_to(data->setting, data->program->warning, fake_build_setting_name_version_file_s, path_file, fake_build_version_micro_s);
}
if (checks && !setting->version_target) {
setting->version_target = fake_build_version_major_e;
- fake_build_print_warning_setting_required_default_to(data->setting, data->main->warning, fake_build_setting_name_version_target_s, path_file, fake_build_version_major_s);
+ fake_build_print_warning_setting_required_default_to(data->setting, data->program->warning, fake_build_setting_name_version_target_s, path_file, fake_build_version_major_s);
}
}
}
#ifndef _di_fake_build_load_setting_override_
void fake_build_load_setting_override(fake_data_t * const data, fake_build_setting_t * const setting) {
- if (!data || !data->main || !data->setting || !setting) return;
+ if (!data || !data->program || !data->setting || !setting) return;
if (F_status_is_error(data->setting->state.status)) return;
- if (data->main->parameters.array[fake_parameter_sources_e].result & f_console_result_value_e && setting->path_sources.used) {
+ if (data->program->parameters.array[fake_parameter_sources_e].result & f_console_result_value_e && setting->path_sources.used) {
data->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &setting->path_sources);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_assure));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_assure));
return;
}
}
- if (data->main->parameters.array[fake_parameter_shared_disable_e].result & f_console_result_found_e) {
- if (data->main->parameters.array[fake_parameter_shared_enable_e].result & f_console_result_found_e) {
- if (data->main->parameters.array[fake_parameter_shared_enable_e].location > data->main->parameters.array[fake_parameter_shared_disable_e].location) {
+ if (data->program->parameters.array[fake_parameter_shared_disable_e].result & f_console_result_found_e) {
+ if (data->program->parameters.array[fake_parameter_shared_enable_e].result & f_console_result_found_e) {
+ if (data->program->parameters.array[fake_parameter_shared_enable_e].location > data->program->parameters.array[fake_parameter_shared_disable_e].location) {
setting->build_shared = F_true;
setting->search_shared = F_true;
}
setting->search_shared = F_false;
}
- fake_build_print_warning_parameters_contradict(data->setting, data->main->warning, f_console_symbol_long_normal_s, fake_long_shared_disabled_s, f_console_symbol_long_normal_s, fake_long_shared_enabled_s, f_console_symbol_long_normal_s, setting->build_shared ? fake_long_shared_enabled_s : fake_long_shared_disabled_s);
+ fake_build_print_warning_parameters_contradict(data->setting, data->program->warning, f_console_symbol_long_normal_s, fake_long_shared_disabled_s, f_console_symbol_long_normal_s, fake_long_shared_enabled_s, f_console_symbol_long_normal_s, setting->build_shared ? fake_long_shared_enabled_s : fake_long_shared_disabled_s);
}
else {
setting->build_shared = F_false;
setting->search_shared = F_false;
}
}
- else if (data->main->parameters.array[fake_parameter_shared_enable_e].result & f_console_result_found_e) {
+ else if (data->program->parameters.array[fake_parameter_shared_enable_e].result & f_console_result_found_e) {
setting->build_shared = F_true;
setting->search_shared = F_true;
}
- if (data->main->parameters.array[fake_parameter_static_disable_e].result & f_console_result_found_e) {
- if (data->main->parameters.array[fake_parameter_static_enable_e].result & f_console_result_found_e) {
- if (data->main->parameters.array[fake_parameter_static_enable_e].location > data->main->parameters.array[fake_parameter_static_disable_e].location) {
+ if (data->program->parameters.array[fake_parameter_static_disable_e].result & f_console_result_found_e) {
+ if (data->program->parameters.array[fake_parameter_static_enable_e].result & f_console_result_found_e) {
+ if (data->program->parameters.array[fake_parameter_static_enable_e].location > data->program->parameters.array[fake_parameter_static_disable_e].location) {
setting->build_static = F_true;
setting->search_static = F_true;
}
setting->search_static = F_false;
}
- fake_build_print_warning_parameters_contradict(data->setting, data->main->warning, f_console_symbol_long_normal_s, fake_long_static_disabled_s, f_console_symbol_long_normal_s, fake_long_static_enabled_s, f_console_symbol_long_normal_s, setting->build_static ? fake_long_static_enabled_s : fake_long_static_disabled_s);
+ fake_build_print_warning_parameters_contradict(data->setting, data->program->warning, f_console_symbol_long_normal_s, fake_long_static_disabled_s, f_console_symbol_long_normal_s, fake_long_static_enabled_s, f_console_symbol_long_normal_s, setting->build_static ? fake_long_static_enabled_s : fake_long_static_disabled_s);
}
else {
setting->build_static = F_false;
setting->search_static = F_false;
}
}
- else if (data->main->parameters.array[fake_parameter_static_enable_e].result & f_console_result_found_e) {
+ else if (data->program->parameters.array[fake_parameter_static_enable_e].result & f_console_result_found_e) {
setting->build_static = F_true;
setting->search_static = F_true;
}
if (setting->build_language == fake_build_language_c_e || setting->build_language == fake_build_language_cpp_e) {
if (setting->build_shared == F_false && setting->build_static == F_false) {
- fake_build_print_warning_setting_both_cannot_when_language(data->setting, data->main->warning, fake_build_setting_name_build_shared_s, fake_build_setting_name_build_static_s, setting->build_language == fake_build_language_c_e ? fake_build_language_c_s : fake_build_language_cpp_s);
+ fake_build_print_warning_setting_both_cannot_when_language(data->setting, data->program->warning, fake_build_setting_name_build_shared_s, fake_build_setting_name_build_static_s, setting->build_language == fake_build_language_c_e ? fake_build_language_c_s : fake_build_language_cpp_s);
data->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_build_load_stage_
void fake_build_load_stage(fake_data_t * const data, const f_string_static_t settings_file, fake_build_stage_t * const stage) {
- if (!data || !data->main || !data->setting || !stage) return;
+ if (!data || !data->program || !data->setting || !stage) return;
if (F_status_is_error(data->setting->state.status)) return;
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
}
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_base));
+ fake_print_error(&data->program->error, macro_fake_f(f_file_name_base));
return;
}
}
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
#ifndef _di_fake_build_object_script_
int fake_build_object_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting || !data_build) return 0;
- if (data->setting->state.status == F_child) return data->main->child;
+ if (!data || !data->program || !data->setting || !data_build) return 0;
+ if (data->setting->state.status == F_child) return data->program->child;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
fake_build_touch(data, file_stage);
#ifndef _di_fake_build_object_shared_
int fake_build_object_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting || !data_build) return 0;
- if (data->setting->state.status == F_child) return data->main->child;
+ if (!data || !data->program || !data->setting || !data_build) return 0;
+ if (data->setting->state.status == F_child) return data->program->child;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_shared.used) return 0;
- fake_build_print_compile_object_shared(data->setting, data->main->message);
+ fake_build_print_compile_object_shared(data->setting, data->program->message);
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_shared, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_object_add));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_sources_object_add));
f_string_dynamics_resize(0, &arguments);
fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_object_e, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_arguments_standard_add));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_arguments_standard_add));
macro_f_string_dynamics_t_delete_simple(arguments);
#ifndef _di_fake_build_object_static_
int fake_build_object_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting || !data_build) return 0;
- if (data->setting->state.status == F_child) return data->main->child;
+ if (!data || !data->program || !data->setting || !data_build) return 0;
+ if (data->setting->state.status == F_child) return data->program->child;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_static.used) return 0;
- fake_build_print_compile_object_static(data->setting, data->main->message);
+ fake_build_print_compile_object_static(data->setting, data->program->message);
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_static, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_object_add));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_sources_object_add));
f_string_dynamics_resize(0, &arguments);
fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_object_e, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_arguments_standard_add));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_arguments_standard_add));
macro_f_string_dynamics_t_delete_simple(arguments);
#ifndef _di_fake_build_objects_static_
int fake_build_objects_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting) return 0;
- if (data->setting->state.status == F_child) return data->main->child;
+ if (!data || !data->program || !data->setting) return 0;
+ if (data->setting->state.status == F_child) return data->program->child;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
if (!data_build->setting.build_sources_library.used) return 0;
- fake_build_print_compile_object_static_library(data->setting, data->main->message);
+ fake_build_print_compile_object_static_library(data->setting, data->program->message);
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_static, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_objects_add));
f_string_dynamics_resize(0, &arguments);
f_string_static_t destination = f_string_static_t_initialize;
f_string_static_t source = f_string_static_t_initialize;
- int result = data->main->child;
+ int result = data->program->child;
const f_string_dynamics_t *sources[2] = {
&data_build->setting.build_sources_library,
fake_build_get_file_name_without_extension(data, sources[i]->array[j], &file_name);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_get_file_name_without_extension));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_get_file_name_without_extension));
break;
}
data->setting->state.status = f_file_name_directory(sources[i]->array[j], &destination_path);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_directory));
+ fake_print_error(&data->program->error, macro_fake_f(f_file_name_directory));
break;
}
data->setting->state.status = f_string_dynamic_prepend(data->path_build_objects, &destination_path);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_prepend));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_prepend));
break;
}
data->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &destination_path);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_assure));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_assure));
break;
}
data->setting->state.status = f_directory_exists(destination_path);
if (data->setting->state.status == F_false) {
- fake_build_print_error_exist_not_directory(data->setting, data->main->message, destination_path);
+ fake_build_print_error_exist_not_directory(data->setting, data->program->message, destination_path);
data->setting->state.status = F_status_set_error(F_failure);
if (F_status_is_error(data->setting->state.status)) {
if (F_status_set_fine(data->setting->state.status) == F_file_found_not) {
- fake_build_print_error_cannot_create_due_to_parent(data->setting, data->main->message, destination_path);
+ fake_build_print_error_cannot_create_due_to_parent(data->setting, data->program->message, destination_path);
}
else {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_create), destination_path, f_file_operation_create_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_directory_create), destination_path, f_file_operation_create_s, fll_error_file_type_directory_e);
}
break;
}
- fake_build_print_verbose_create_directory(data->setting, data->main->message, destination_path);
+ fake_build_print_verbose_create_directory(data->setting, data->program->message, destination_path);
}
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_exists), destination_path, f_file_operation_create_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_directory_exists), destination_path, f_file_operation_create_s, fll_error_file_type_directory_e);
break;
}
fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_library_e, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add));
+ fake_print_error(&data->program->error, macro_fake_f(fll_execute_arguments_add));
break;
}
f_status_t fake_build_print_linked_file(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t from, const f_string_static_t to) {
if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+ if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; // @fixme this function needs to be a "verbose" function rather than a "normal" print function.
fake_print_wrapped_variables(setting, print, "Linked file ", from, " to ", to, 0);
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+ fll_print_dynamic_raw(f_string_eol_s, print.to);
fake_print_context_important_simple(setting, print, "Creating base build directories");
return F_none;
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+ fll_print_dynamic_raw(f_string_eol_s, print.to);
fake_print_context_important_simple(setting, print, "Compiling shared library");
return F_none;
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+ fll_print_dynamic_raw(f_string_eol_s, print.to);
fake_print_context_important_simple(setting, print, "Compiling static library");
return F_none;
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+ fll_print_dynamic_raw(f_string_eol_s, print.to);
fake_print_context_important_simple(setting, print, "Compiling shared object");
return F_none;
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+ fll_print_dynamic_raw(f_string_eol_s, print.to);
fake_print_context_important_simple(setting, print, "Compiling static object");
return F_none;
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+ fll_print_dynamic_raw(f_string_eol_s, print.to);
fake_print_context_important_simple(setting, print, "Compiling objects for static library");
return F_none;
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+ fll_print_dynamic_raw(f_string_eol_s, print.to);
fake_print_context_important_simple(setting, print, "Compiling shared program");
return F_none;
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+ fll_print_dynamic_raw(f_string_eol_s, print.to);
fake_print_context_important_simple(setting, print, "Compiling static program");
return F_none;
extern "C" {
#endif
+#ifndef _di_fake_build_print_verbose_copied_file_
+ f_status_t fake_build_print_verbose_copied_file(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not;
+
+ fake_print_wrapped_variables(setting, print, "Copied file ", source, " to ", destination, f_string_empty_s.string);
+
+ return F_none;
+ }
+#endif // _di_fake_build_print_verbose_copied_file_
+
#ifndef _di_fake_build_print_verbose_create_directory_
f_status_t fake_build_print_verbose_create_directory(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t directory) {
#endif
/**
- * Print verbose message about creating a directory.
+ * Print verbose message about copying a file.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ * @param source
+ * The source file path.
+ * @param destination
+ * The destination file path.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fake_print_wrapped_variables()
+ */
+#ifndef _di_fake_build_print_verbose_copied_file_
+ extern f_status_t fake_build_print_verbose_copied_file(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination);
+#endif // _di_fake_build_print_verbose_create_directory_
+
+/**
+ * Print verbose message about _di_fake_build_print_verbose_copied_file_ a directory.
*
* @param setting
* The main program settings.
#ifndef _di_fake_build_program_script_
int fake_build_program_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting || !data_build) return 0;
- if (data->setting->state.status == F_child) return data->main->child;
+ if (!data || !data->program || !data->setting || !data_build) return 0;
+ if (data->setting->state.status == F_child) return data->program->child;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
fake_build_touch(data, file_stage);
#ifndef _di_fake_build_program_shared_
int fake_build_program_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting || !data_build) return 0;
- if (data->setting->state.status == F_child) return data->main->child;
+ if (!data || !data->program || !data->setting || !data_build) return 0;
+ if (data->setting->state.status == F_child) return data->program->child;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_shared.used) return 0;
- fake_build_print_compile_program_shared(data->setting, data->main->message);
+ fake_build_print_compile_program_shared(data->setting, data->program->message);
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_shared, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_objects_add));
f_string_dynamics_resize(0, &arguments);
fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_shared, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_add));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_sources_add));
f_string_dynamics_resize(0, &arguments);
fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_program_e, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add));
+ fake_print_error(&data->program->error, macro_fake_f(fll_execute_arguments_add));
macro_f_string_dynamics_t_delete_simple(arguments);
#ifndef _di_fake_build_program_static_
int fake_build_program_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting || !data_build) return 0;
- if (data->setting->state.status == F_child) return data->main->child;
+ if (!data || !data->program || !data->setting || !data_build) return 0;
+ if (data->setting->state.status == F_child) return data->program->child;
if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true) return 0;
if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_static.used) return 0;
- fake_build_print_compile_program_static(data->setting, data->main->message);
+ fake_build_print_compile_program_static(data->setting, data->program->message);
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_static, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_objects_add));
f_string_dynamics_resize(0, &arguments);
fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_static, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_add));
+ fake_print_error(&data->program->error, macro_fake_f(fake_build_sources_add));
f_string_dynamics_resize(0, &arguments);
fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_program_e, &arguments);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add));
+ fake_print_error(&data->program->error, macro_fake_f(fll_execute_arguments_add));
macro_f_string_dynamics_t_delete_simple(arguments);
#ifndef _di_fake_build_skeleton_
void fake_build_skeleton(fake_data_t * const data, fake_build_data_t * const data_build, const mode_t mode, const f_string_static_t file_stage) {
- if (!data || !data->main || !data->setting || !data_build) return;
+ if (!data || !data->program || !data->setting || !data_build) return;
if (F_status_is_error(data->setting->state.status) || data->setting->state.status == F_child) return;
if (f_file_exists(file_stage, F_true) == F_true) return;
path_headers,
};
- fake_build_print_skeleton_build_base(data->setting, data->main->message);
+ fake_build_print_skeleton_build_base(data->setting, data->program->message);
bool created = F_false;
f_array_length_t j = 0;
if (f_path_separator_s.used && directorys[i].string[j] != f_path_separator_s.string[0]) continue;
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
continue;
}
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_create), directorys[i], f_file_operation_create_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_directory_create), directorys[i], f_file_operation_create_s, fll_error_file_type_directory_e);
return;
}
if (created) {
- fake_build_print_verbose_create_directory(data->setting, data->main->message, directorys[i]);
+ fake_build_print_verbose_create_directory(data->setting, data->program->message, directorys[i]);
}
} // for
#ifndef _di_fake_clean_operate_
void fake_clean_operate(fake_data_t * const data) {
- if (!data || !data->main || !data->setting) return;
+ if (!data || !data->program || !data->setting) return;
- if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) {
- f_file_stream_lock(data->main->message.to);
+ if (data->program->message.verbosity != f_console_verbosity_quiet_e && data->program->message.verbosity != f_console_verbosity_error_e) {
+ f_file_stream_lock(data->program->message.to);
- fl_print_format("%[Deleting all files within build directory '%]", data->main->message.to, data->main->context.set.important, data->main->context.set.important);
- fl_print_format("%[%Q%]", data->main->message.to, data->main->context.set.notable, data->setting->build, data->main->context.set.notable);
- fl_print_format("%['.%]%r", data->main->message.to, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
+ fl_print_format("%[Deleting all files within build directory '%]", data->program->message.to, data->program->context.set.important, data->program->context.set.important);
+ fl_print_format("%[%Q%]", data->program->message.to, data->program->context.set.notable, data->setting->build, data->program->context.set.notable);
+ fl_print_format("%['.%]%r", data->program->message.to, data->program->context.set.important, data->program->context.set.important, f_string_eol_s);
- f_file_stream_unlock(data->main->message.to);
+ f_file_stream_unlock(data->program->message.to);
}
data->setting->state.status = F_none;
- if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ if (data->program->error.verbosity >= f_console_verbosity_verbose_e) {
data->setting->state.status = f_directory_remove_custom(data->setting->build, F_directory_max_descriptors_d, F_true, fake_clean_remove_recursively_verbosely);
}
else {
}
if (F_status_set_fine(data->setting->state.status) == F_file_found_not || F_status_set_fine(data->setting->state.status) == F_directory) {
- if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("The build directory '%[%Q%]' does not exist.%r", data->main->warning.to, data->main->context.set.notable, data->setting->build, data->main->context.set.notable, f_string_eol_s);
+ if (data->program->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("The build directory '%[%Q%]' does not exist.%r", data->program->warning.to, data->program->context.set.notable, data->setting->build, data->program->context.set.notable, f_string_eol_s);
}
data->setting->state.status = F_none;
}
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_remove), data->setting->build, f_file_operation_delete_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_directory_remove), data->setting->build, f_file_operation_delete_s, fll_error_file_type_directory_e);
}
else {
data->setting->state.status = F_none;
#endif
#ifndef _di_fake_setting_load_
- void fake_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fake_setting_t * const setting) {
+ void fake_setting_load(const f_console_arguments_t arguments, fake_main_t * const main) {
- if (!main || !setting) return;
+ if (!main) return;
- main->output.to.id = F_type_descriptor_output_d;
- main->output.to.stream = F_type_output_d;
- main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
+ main->program.output.to.id = F_type_descriptor_output_d;
+ main->program.output.to.stream = F_type_output_d;
+ main->program.output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
{
- const uint16_t step_original = setting->state.step_small;
+ const uint16_t step_original = main->setting.state.step_small;
fake_data_t data = fake_data_t_initialize;
- data.main = main;
- data.setting = setting;
+ data.program = &main->program;
+ data.setting = &main->setting;
- setting->state.step_small = 4;
+ main->setting.state.step_small = 4;
- f_console_parameter_process(arguments, &main->parameters, &setting->state, (void *) &data);
+ f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, (void *) &data);
- setting->state.step_small = step_original;
+ main->setting.state.step_small = step_original;
}
- if (F_status_is_error(setting->state.status)) {
- fake_print_line_first(setting, main->message);
+ // Identify and pocess first/last parameters.
+ if (main->program.parameters.array[fake_parameter_line_first_no_e].result & f_console_result_found_e) {
+ main->setting.flag -= main->setting.flag & fake_main_flag_print_first_e;
+ }
+ else {
+ main->setting.flag |= fake_main_flag_print_first_e;
+ }
+
+ if (main->program.parameters.array[fake_parameter_line_last_no_e].result & f_console_result_found_e) {
+ main->setting.flag -= main->setting.flag & fake_main_flag_print_last_e;
+ }
+ else {
+ main->setting.flag |= fake_main_flag_print_last_e;
+ }
- fake_print_error(setting, main->error, macro_fake_f(f_console_parameter_process));
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
+
+ fake_print_error(&main->program.error, macro_fake_f(f_console_parameter_process));
return;
}
const uint8_t modes[3] = { f_color_mode_not_e, f_color_mode_light_e, f_color_mode_dark_e };
- setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
- if (F_status_is_error(setting->state.status)) {
- fake_print_line_first(setting, main->message);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
- fake_print_error(setting, main->error, macro_fake_f(fll_program_parameter_process_context));
+ fake_print_error(&main->program.error, macro_fake_f(fll_program_parameter_process_context));
return;
}
}
- if (main->parameters.array[fake_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[fake_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { fake_parameter_verbosity_quiet_e, fake_parameter_verbosity_error_e, fake_parameter_verbosity_verbose_e, fake_parameter_verbosity_debug_e, fake_parameter_verbosity_normal_e };
const uint8_t verbosity[5] = { f_console_verbosity_quiet_e, f_console_verbosity_error_e, f_console_verbosity_verbose_e, f_console_verbosity_debug_e, f_console_verbosity_normal_e };
- setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
- if (F_status_is_error(setting->state.status)) {
- fake_print_line_first(setting, main->message);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
- fake_print_error(setting, main->error, macro_fake_f(fll_program_parameter_process_verbosity));
+ fake_print_error(&main->program.error, macro_fake_f(fll_program_parameter_process_verbosity));
return;
}
}
}
- if (main->parameters.array[fake_parameter_help_e].result & f_console_result_found_e) {
- setting->flag |= fake_main_flag_help_e;
+ if (main->program.parameters.array[fake_parameter_help_e].result & f_console_result_found_e) {
+ main->setting.flag |= fake_main_flag_help_e;
return;
}
- if (main->parameters.array[fake_parameter_version_e].result & f_console_result_found_e) {
- setting->flag |= fake_main_flag_version_e;
+ if (main->program.parameters.array[fake_parameter_version_e].result & f_console_result_found_e) {
+ main->setting.flag |= fake_main_flag_version_e;
return;
}
- if (main->parameters.array[fake_parameter_copyright_e].result & f_console_result_found_e) {
- setting->flag |= fake_main_flag_copyright_e;
+ if (main->program.parameters.array[fake_parameter_copyright_e].result & f_console_result_found_e) {
+ main->setting.flag |= fake_main_flag_copyright_e;
return;
}
for (; i < 3; ++i) {
- if (main->parameters.array[enables[i]].result & f_console_result_found_e) {
- if (main->parameters.array[disables[i]].result & f_console_result_found_e) {
- if (main->parameters.array[enables[i]].location < main->parameters.array[disables[i]].location) {
- setting->flag -= setting->flag & flags[i];
+ if (main->program.parameters.array[enables[i]].result & f_console_result_found_e) {
+ if (main->program.parameters.array[disables[i]].result & f_console_result_found_e) {
+ if (main->program.parameters.array[enables[i]].location < main->program.parameters.array[disables[i]].location) {
+ main->setting.flag -= main->setting.flag & flags[i];
}
else {
- setting->flag |= flags[i];
+ main->setting.flag |= flags[i];
}
}
else {
- setting->flag |= flags[i];
+ main->setting.flag |= flags[i];
}
}
- else if (main->parameters.array[disables[i]].result & f_console_result_found_e) {
- setting->flag -= setting->flag & flags[i];
+ else if (main->program.parameters.array[disables[i]].result & f_console_result_found_e) {
+ main->setting.flag -= main->setting.flag & flags[i];
}
} // for
}
};
f_string_dynamic_t * const variable[] = {
- &setting->build,
- &setting->data,
- &setting->documents,
- &setting->fakefile,
- &setting->licenses,
- &setting->process,
- &setting->settings,
- &setting->sources,
- &setting->work,
+ &main->setting.build,
+ &main->setting.data,
+ &main->setting.documents,
+ &main->setting.fakefile,
+ &main->setting.licenses,
+ &main->setting.process,
+ &main->setting.settings,
+ &main->setting.sources,
+ &main->setting.work,
};
- setting->build.used = 0;
- setting->data.used = 0;
- setting->documents.used = 0;
- setting->fakefile.used = 0;
- setting->licenses.used = 0;
- setting->process.used = 0;
- setting->settings.used = 0;
- setting->sources.used = 0;
- setting->work.used = 0;
+ main->setting.build.used = 0;
+ main->setting.data.used = 0;
+ main->setting.documents.used = 0;
+ main->setting.fakefile.used = 0;
+ main->setting.licenses.used = 0;
+ main->setting.process.used = 0;
+ main->setting.settings.used = 0;
+ main->setting.sources.used = 0;
+ main->setting.work.used = 0;
const f_string_static_t defaults[] = {
fake_default_build_s,
for (i = 0; i < 9; ++i) {
- if ((main->parameters.array[parameters[i]].result & f_console_result_found_e) && !(main->parameters.array[parameters[i]].result & f_console_result_value_e)) {
- setting->state.status = F_status_set_error(F_parameter);
+ if ((main->program.parameters.array[parameters[i]].result & f_console_result_found_e) && !(main->program.parameters.array[parameters[i]].result & f_console_result_value_e)) {
+ main->setting.state.status = F_status_set_error(F_parameter);
- if (main->error.verbosity > f_console_verbosity_quiet_e) {
- fake_print_line_first(setting, main->message);
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, names[i]);
+ if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
+ fll_program_print_error_parameter_missing_value(main->program.error, f_console_symbol_long_normal_s, names[i]);
}
return;
}
- if (main->parameters.array[parameters[i]].result & f_console_result_value_e) {
- index = main->parameters.array[parameters[i]].values.array[main->parameters.array[parameters[i]].values.used - 1];
+ if (main->program.parameters.array[parameters[i]].result & f_console_result_value_e) {
+ index = main->program.parameters.array[parameters[i]].values.array[main->program.parameters.array[parameters[i]].values.used - 1];
- if (main->parameters.arguments.array[index].used) {
+ if (main->program.parameters.arguments.array[index].used) {
if (parameters[i] == fake_parameter_process_e) {
- for (j = 0; j < main->parameters.arguments.array[index].used; ++j) {
+ for (j = 0; j < main->program.parameters.arguments.array[index].used; ++j) {
- setting->state.status = f_utf_is_word_dash_plus(main->parameters.arguments.array[index].string + j, main->parameters.arguments.array[index].used - j, F_false);
+ main->setting.state.status = f_utf_is_word_dash_plus(main->program.parameters.arguments.array[index].string + j, main->program.parameters.arguments.array[index].used - j, F_false);
// @todo fix this to print an error about the actual invalid character so that it can be investigated.
- if (F_status_is_error(setting->state.status)) {
- fake_print_line_first(setting, main->message);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
- if (fake_print_error_fallback(setting, main->error, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) {
- fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]);
+ if (fake_print_error_fallback(&main->setting, main->program.error, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) {
+ fll_program_print_error_parameter_process(main->program.error, f_console_symbol_long_normal_s, names[i]);
}
return;
}
- if (setting->state.status == F_false) {
- setting->state.status = F_status_set_error(F_parameter);
+ if (main->setting.state.status == F_false) {
+ main->setting.state.status = F_status_set_error(F_parameter);
- fake_print_error_parameter_not_word(setting, main->error, f_console_symbol_long_normal_s, names[i], main->parameters.arguments.array[index]);
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
+
+ fake_print_error_parameter_not_word(&main->setting, main->program.error, f_console_symbol_long_normal_s, names[i], main->program.parameters.arguments.array[index]);
return;
}
}
if (cleanups[i]) {
- setting->state.status = f_path_directory_cleanup(main->parameters.arguments.array[index], variable[i]);
-
- if (F_status_is_error(setting->state.status)) {
- fake_print_line_first(setting, main->message);
+ main->setting.state.status = f_path_directory_cleanup(main->program.parameters.arguments.array[index], variable[i]);
- if (main->error.verbosity > f_console_verbosity_quiet_e) {
- fake_print_line_first(setting, main->message);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
- /*if (fake_print_error_fallback(setting, main->error, macro_fake_f(f_path_directory_cleanup)) == F_false) {
- fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]);
- }*/
+ if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
+ if (fake_print_error_fallback(&main->setting, main->program.error, macro_fake_f(f_path_directory_cleanup)) == F_false) {
+ fll_program_print_error_parameter_process(main->program.error, f_console_symbol_long_normal_s, names[i]);
+ }
}
return;
// De-allocate memory before replacing it with a statically allocated string.
if (variable[i]->size) {
- setting->state.status = f_string_dynamic_resize(0, variable[i]);
+ main->setting.state.status = f_string_dynamic_resize(0, variable[i]);
- if (F_status_is_error(setting->state.status)) {
- fake_print_line_first(setting, main->message);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
- fake_print_error(setting, main->error, macro_fake_f(f_string_dynamic_resize));
+ fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_resize));
return;
}
}
- variable[i]->string = main->parameters.arguments.array[index].string;
- variable[i]->used = main->parameters.arguments.array[index].used;
+ variable[i]->string = main->program.parameters.arguments.array[index].string;
+ variable[i]->used = main->program.parameters.arguments.array[index].used;
variable[i]->size = 0;
}
if (!variable[i]->used) {
- setting->state.status = F_status_set_error(F_parameter);
+ main->setting.state.status = F_status_set_error(F_parameter);
+
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
- fake_print_error_parameter_not_empty(setting, main->error, f_console_symbol_long_normal_s, names[i], main->parameters.arguments.array[index]);
+ fake_print_error_parameter_not_empty(&main->setting, main->program.error, f_console_symbol_long_normal_s, names[i], main->program.parameters.arguments.array[index]);
return;
}
- setting->state.status = F_none;
+ main->setting.state.status = F_none;
}
}
else {
// De-allocate memory before replacing it with a statically allocated string.
if (variable[i]->size) {
- setting->state.status = f_string_dynamic_resize(0, variable[i]);
+ main->setting.state.status = f_string_dynamic_resize(0, variable[i]);
- if (F_status_is_error(setting->state.status)) {
- fake_print_line_first(setting, main->message);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
- fake_print_error(setting, main->error, macro_fake_f(f_string_dynamic_resize));
+ fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_resize));
return;
}
};
f_string_dynamics_t * const variable[] = {
- &setting->defines,
- &setting->modes,
+ &main->setting.defines,
+ &main->setting.modes,
};
f_array_length_t width_max = 0;
for (i = 0; i < 2; ++i) {
- if ((main->parameters.array[parameters[i]].result & f_console_result_found_e) && !(main->parameters.array[parameters[i]].result & f_console_result_value_e)) {
- setting->state.status = F_status_set_error(F_parameter);
+ if ((main->program.parameters.array[parameters[i]].result & f_console_result_found_e) && !(main->program.parameters.array[parameters[i]].result & f_console_result_value_e)) {
+ main->setting.state.status = F_status_set_error(F_parameter);
- if (main->error.verbosity > f_console_verbosity_quiet_e) {
- fake_print_line_first(setting, main->message);
+ if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
- fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, names[i]);
+ fll_program_print_error_parameter_missing_value(main->program.error, f_console_symbol_long_normal_s, names[i]);
}
return;
}
- if (main->parameters.array[parameters[i]].result & f_console_result_value_e) {
- setting->state.status = fll_program_parameter_additional_rip(main->parameters.arguments.array, main->parameters.array[parameters[i]].values, variable[i]);
+ if (main->program.parameters.array[parameters[i]].result & f_console_result_value_e) {
+ main->setting.state.status = fll_program_parameter_additional_rip(main->program.parameters.arguments.array, main->program.parameters.array[parameters[i]].values, variable[i]);
- if (F_status_is_error(setting->state.status)) {
- if (main->error.verbosity > f_console_verbosity_quiet_e) {
- fake_print_line_first(setting, main->message);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
- /*if (fake_print_error_fallback(setting, main->error, macro_fake_f(fll_program_parameter_additional_rip)) == F_false) {
- fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]);
- }*/
+ if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
+ if (fake_print_error_fallback(&main->setting, main->program.error, macro_fake_f(fll_program_parameter_additional_rip)) == F_false) {
+ fll_program_print_error_parameter_process(main->program.error, f_console_symbol_long_normal_s, names[i]);
+ }
}
return;
}
if (parameters[i] == fake_parameter_mode_e) {
- for (j = 0; j < main->parameters.arguments.array[i].used; ++j) {
+ for (j = 0; j < main->program.parameters.arguments.array[i].used; ++j) {
- width_max = main->parameters.arguments.array[i].used - j;
+ width_max = main->program.parameters.arguments.array[i].used - j;
- setting->state.status = f_utf_is_word_dash_plus(main->parameters.arguments.array[i].string + j, width_max, F_false);
+ main->setting.state.status = f_utf_is_word_dash_plus(main->program.parameters.arguments.array[i].string + j, width_max, F_false);
- if (F_status_is_error(setting->state.status)) {
- fake_print_line_first(setting, main->message);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
// @todo fix this to print an error about the actual invalid character so that it can be investigated.
- /*if (fake_print_error_fallback(setting, main->error, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) {
- fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]);
- }*/
+ if (fake_print_error_fallback(&main->setting, main->program.error, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) {
+ fll_program_print_error_parameter_process(main->program.error, f_console_symbol_long_normal_s, names[i]);
+ }
return;
}
- if (setting->state.status == F_false) {
- setting->state.status = F_status_set_error(F_parameter);
+ if (main->setting.state.status == F_false) {
+ main->setting.state.status = F_status_set_error(F_parameter);
- fake_print_error_parameter_not_word(setting, main->error, f_console_symbol_long_normal_s, names[i], main->parameters.arguments.array[i]);
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
+
+ fake_print_error_parameter_not_word(&main->setting, main->program.error, f_console_symbol_long_normal_s, names[i], main->program.parameters.arguments.array[i]);
return;
}
}
}
- if (setting->operations.used) {
- setting->flag |= fake_main_flag_operation_e;
+ if (main->setting.operations.used) {
+ main->setting.flag |= fake_main_flag_operation_e;
}
else {
- setting->flag |= fake_main_flag_operation_make_e;
- setting->flag -= setting->flag & fake_main_flag_operation_e;
+ main->setting.flag |= fake_main_flag_operation_make_e;
+ main->setting.flag -= main->setting.flag & fake_main_flag_operation_e;
- setting->state.status = f_uint8s_increase_by(1, &setting->operations);
+ main->setting.state.status = f_uint8s_increase_by(1, &main->setting.operations);
- if (F_status_is_error(setting->state.status)) {
- fake_print_line_first(setting, main->message);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
- fake_print_error(setting, main->error, macro_fake_f(f_uint8s_increase_by));
+ fake_print_error(&main->program.error, macro_fake_f(f_uint8s_increase_by));
return;
}
- setting->operations.array[setting->operations.used++] = fake_operation_make_e;
+ main->setting.operations.array[main->setting.operations.used++] = fake_operation_make_e;
}
}
#endif // _di_fake_setting_load_
parameter_state->state->status = f_uint8s_increase(parameter_state->state->step_small, &data->setting->operations);
if (F_status_is_error(parameter_state->state->status)) {
- fake_print_line_first(data->setting, data->main->message);
-
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_uint8s_increase));
+ fake_print_error(&data->program->error, macro_fake_f(f_uint8s_increase));
return;
}
#endif // _di_fake_setting_load_parameter_callback_
#ifndef _di_fake_setting_unload_
- f_status_t fake_setting_unload(fll_program_data_t * const main, fake_setting_t * const setting) {
+ f_status_t fake_setting_unload(fake_main_t * const main) {
- if (!main || !setting) return F_status_set_error(F_parameter);
+ if (!main) return F_status_set_error(F_parameter);
- fake_setting_delete(setting);
+ fake_setting_delete(&main->setting);
return F_none;
}
*
* This prints error messages as appropriate.
*
- * If either main or setting is NULL, then this immediately returns 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.
+ * The main program and setting data.
*
- * This alters setting.state.status:
+ * This alters main.setting.state.status:
* F_none on success.
*
* Errors (with error bit) from: f_console_parameter_process().
* @see fll_program_parameter_process_verbosity()
*/
#ifndef _di_fake_setting_load_
- extern void fake_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fake_setting_t * const setting);
+ extern void fake_setting_load(const f_console_arguments_t arguments, fake_main_t * const main);
#endif // _di_fake_setting_load_
/**
*
* This prints error messages as appropriate.
*
- * If either main or setting is NULL, then this immediately returns without doing anything.
- *
* @param arguments
* The parameters passed to the process (often referred to as command line arguments).
* @param parameters
* F_process on success, designating that processing should be performed (see f_console_parameter_process()).
*
* Errors (with error bit) from: f_uint8s_increase().
- * @param data
- * This must be of the type fake_setting_t.
+ * @param main
+ * This must be of the type fake_main_t.
*
* @see f_console_parameter_process()
* @see f_uint8s_increase()
*/
#ifndef _di_fake_setting_load_parameter_callback_
- extern void fake_setting_load_parameter_callback(const f_console_arguments_t arguments, void * const parameters, f_console_parameter_state_t * const parameter_state, void * const data);
+ extern void fake_setting_load_parameter_callback(const f_console_arguments_t arguments, void * const parameters, f_console_parameter_state_t * const parameter_state, void * const main);
#endif // _di_fake_setting_load_parameter_callback_
/**
* Perform the standard program setting unload process.
*
* @param main
- * The main program data.
- * @param setting
- * The main program settings.
+ * The main program and setting data.
* All buffers are deallocated.
*
- * This does not alter setting.state.status.
+ * This does not alter main.setting.state.status.
*
* @return
* F_none on success.
* @see utf8_setting_delete()
*/
#ifndef _di_fake_setting_unload_
- extern f_status_t fake_setting_unload(fll_program_data_t * const main, fake_setting_t * const setting);
+ extern f_status_t fake_setting_unload(fake_main_t * const main);
#endif // _di_fake_setting_unload_
#ifdef __cplusplus
macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \
macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \
\
- macro_f_console_parameter_t_initialize_3(fake_short_build_s, fake_long_build_s, 1, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(fake_short_data_s, fake_long_data_s, 1, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(fake_short_define_s, fake_long_define_s, 1, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(fake_short_documents_s, fake_long_documents_s, 1, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(fake_short_fakefile_s, fake_long_fakefile_s, 1, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(fake_short_licenses_s, fake_long_licenses_s, 1, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(fake_short_mode_s, fake_long_mode_s, 1, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(fake_short_process_s, fake_long_process_s, 1, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(fake_short_settings_s, fake_long_settings_s, 1, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(fake_short_sources_s, fake_long_sources_s, 1, f_console_flag_normal_e), \
- macro_f_console_parameter_t_initialize_3(fake_short_work_s, fake_long_work_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(fake_short_build_s, fake_long_build_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(fake_short_data_s, fake_long_data_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(fake_short_define_s, fake_long_define_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(fake_short_documents_s, fake_long_documents_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(fake_short_fakefile_s, fake_long_fakefile_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(fake_short_licenses_s, fake_long_licenses_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(fake_short_mode_s, fake_long_mode_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(fake_short_process_s, fake_long_process_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(fake_short_settings_s, fake_long_settings_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(fake_short_sources_s, fake_long_sources_s, 1, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(fake_short_work_s, fake_long_work_s, 1, f_console_flag_normal_e), \
\
macro_f_console_parameter_t_initialize_5(fake_long_documents_disabled_s, 0, f_console_flag_normal_e), \
macro_f_console_parameter_t_initialize_5(fake_long_documents_enabled_s, 0, f_console_flag_normal_e), \
* - enable_documents: Enable documents, as in --enable-doc (not specifying means --disable-doc).
* - enable_shared: Enable shared, as in --enable-shared (not specifying means --disable-shared).
* - enable_static: Enable static, as in --enable-static (not specifying means --disable-static).
- * - file_from: Using a specified source file.
- * - file_to: Using a specified destination file.
* - header: Enable printing of headers.
* - help: Print help.
* - operation: Designate that an operation is explicitly passed.
* - operation_clean: The clean operation is designated.
* - operation_make: The make operation is designated (or enabled as default).
* - operation_skeleton: The skeleton operation is designated.
- * - print_first: When set, the first character printing logic is to be processed (this is usually automatic).
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - separate: Enable printing of separators.
* - strip_invalid: Using strip invalid character mode.
* - verify: Using verify mode.
fake_main_flag_enable_documents_e = 0x2,
fake_main_flag_enable_shared_e = 0x4,
fake_main_flag_enable_static_e = 0x8,
- fake_main_flag_file_from_e = 0x10,
- fake_main_flag_file_to_e = 0x20,
- fake_main_flag_header_e = 0x40,
- fake_main_flag_help_e = 0x80,
- fake_main_flag_operation_e = 0x100,
- fake_main_flag_operation_build_e = 0x200,
- fake_main_flag_operation_clean_e = 0x400,
- fake_main_flag_operation_make_e = 0x800,
- fake_main_flag_operation_skeleton_e = 0x1000,
- fake_main_flag_print_first_e = 0x2000,
- fake_main_flag_separate_e = 0x4000,
- fake_main_flag_strip_invalid_e = 0x8000,
- fake_main_flag_verify_e = 0x10000,
- fake_main_flag_version_e = 0x20000,
+ fake_main_flag_header_e = 0x10,
+ fake_main_flag_help_e = 0x20,
+ fake_main_flag_operation_e = 0x40,
+ fake_main_flag_operation_build_e = 0x80,
+ fake_main_flag_operation_clean_e = 0x100,
+ fake_main_flag_operation_make_e = 0x200,
+ fake_main_flag_operation_skeleton_e = 0x400,
+ fake_main_flag_print_first_e = 0x800,
+ fake_main_flag_print_last_e = 0x1000,
+ fake_main_flag_separate_e = 0x2000,
+ fake_main_flag_strip_invalid_e = 0x4000,
+ fake_main_flag_verify_e = 0x8000,
+ fake_main_flag_version_e = 0x10000,
}; // enum
#endif // _di_fake_main_flag_e_
}; // enum
#endif // _di_fake_condition_result_e_
+/**
+ * Flags for fine-tuned print control.
+ *
+ * fake_print_flag_*_e:
+ * - none: No flags set.
+ * - debug: Stream is for debug printing.
+ * - error: Stream is for error printing.
+ * - message: Stream is for message printing.
+ * - warning: Stream is for warning printing.
+ * - file_to: Stream is a destination file.
+ * - file_from: Stream is a source file.
+ */
+#ifndef _di_fake_print_flag_e_
+ enum {
+ fake_print_flag_none_e = 0x0,
+ fake_print_flag_debug_e = 0x1,
+ fake_print_flag_error_e = 0x2,
+ fake_print_flag_message_e = 0x4,
+ fake_print_flag_warning_e = 0x8,
+ fake_print_flag_file_to_e = 0x10,
+ fake_print_flag_file_from_e = 0x20,
+ }; // enum
+#endif // _di_fake_print_flag_e_
+
#ifdef __cplusplus
} // extern "C"
#endif
--- /dev/null
+#include "../fake.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fake_p_a_
+ const f_string_t fake_p_a[] = {
+ "",
+ };
+#endif // _di_fake_p_a_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Featureless Make
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides common print functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fake_common_print_h
+#define _fake_common_print_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * A special array of strings intended for being used in print functions.
+ *
+ * These serve two primary purposes:
+ * 1) Reduce repition of strings, saving space.
+ * 2) Provide a central location for changing strings to another langauge.
+ *
+ * The macro macro_fake_p() is used to reference the array index by the enum name.
+ *
+ * macro_fake_p():
+ * - name: A name or alias representing the string.
+ */
+#ifndef _di_fake_p_a_
+ extern const f_string_t fake_p_a[];
+
+ #define macro_fake_p(name) fake_p_a[fake_p_##name##_e]
+#endif // _di_fake_f_p_
+
+/**
+ * An enum representing specific indexes within the above array.
+ *
+ * This is a convenience enum used to make code slightly more readable.
+ */
+#ifndef _di_fake_p_e_
+ enum {
+ fake_p__e,
+ }; // enum
+#endif // _di_fake_p_e_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fake_common_print_string_h
*
* state: The state data used when processing the FSS data.
*
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
- *
* build: The build directory.
* data: The data directory.
* fakefile: The fakefile file path.
f_state_t state;
- f_string_static_t line_first;
- f_string_static_t line_last;
-
f_string_dynamic_t build;
f_string_dynamic_t data;
f_string_dynamic_t documents;
#define fake_setting_t_initialize \
{ \
- fake_main_flag_print_first_e, \
+ 0, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
#endif // _di_fake_setting_t_
/**
+ * The main program data as a single structure.
+ *
+ * program: The main program data.
+ * setting: The settings data.
+ */
+#ifndef _di_fake_main_t_
+ typedef struct {
+ fll_program_data_t program;
+ fake_setting_t setting;
+ } fake_main_t;
+
+ #define fake_main_t_initialize \
+ { \
+ fll_program_data_t_initialize, \
+ fake_setting_t_initialize, \
+ }
+#endif // _di_fake_main_t_
+
+/**
* The program data.
*
* operation: A code representing the currrent operation.
*
- * main: The main program data.
+ * program: The main program data.
* setting: The settings data.
*
* path_build: The build path.
typedef struct {
uint8_t operation;
- fll_program_data_t *main;
+ fll_program_data_t *program;
fake_setting_t *setting;
f_string_dynamic_t path_build;
f_array_length_t id_main;
- fll_program_data_t *main;
+ fll_program_data_t *program;
fake_data_t *data;
fake_setting_t *setting;
} fake_make_data_t;
#endif
#ifndef _di_fake_main_
- void fake_main(fll_program_data_t * const main, fake_setting_t * const setting) {
+ void fake_main(fake_main_t * const main) {
- if (!main || !setting) return;
+ if (!main) return;
- if (F_status_is_error(setting->state.status)) {
- fake_print_line_last(setting, main->message);
+ if (F_status_is_error(main->setting.state.status)) {
+ if ((main->setting.flag & fake_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
return;
}
- setting->state.status = F_none;
+ if ((main->setting.flag & fake_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
+
+ main->setting.state.status = F_none;
- if (setting->flag & fake_main_flag_help_e) {
- fake_print_help(setting, main->message);
+ if (main->setting.flag & fake_main_flag_help_e) {
+ fake_print_help(&main->setting, main->program.message);
+
+ if ((main->setting.flag & fake_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
return;
}
- if (setting->flag & fake_main_flag_version_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), fake_program_version_s);
+ if (main->setting.flag & fake_main_flag_version_e) {
+ fll_program_print_version(main->program.message, fake_program_version_s);
+
+ if ((main->setting.flag & fake_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
return;
}
- if (setting->flag & fake_main_flag_copyright_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ if (main->setting.flag & fake_main_flag_copyright_e) {
+ fll_program_print_copyright(main->program.message);
+
+ if ((main->setting.flag & fake_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
return;
}
- if ((setting->flag & fake_main_flag_operation_build_e) && (setting->flag & fake_main_flag_operation_make_e)) {
- setting->state.status = F_status_set_error(F_parameter);
+ if ((main->setting.flag & fake_main_flag_operation_build_e) && (main->setting.flag & fake_main_flag_operation_make_e)) {
+ main->setting.state.status = F_status_set_error(F_parameter);
- fake_print_error_parameter_operation_not_with(setting, main->error, fake_other_operation_build_s, fake_other_operation_make_s);
+ fake_print_error_parameter_operation_not_with(&main->setting, main->program.error, fake_other_operation_build_s, fake_other_operation_make_s);
+
+ if ((main->setting.flag & fake_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
return;
}
fake_data_t data = fake_data_t_initialize;
- data.main = main;
- data.setting = setting;
+ data.program = &main->program;
+ data.setting = &main->setting;
fake_path_generate(&data);
- if (F_status_is_error(setting->state.status)) {
+ if (F_status_is_error(main->setting.state.status)) {
fake_data_delete(&data);
- fake_print_line_last(setting, main->message);
+ if ((main->setting.flag & fake_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
return;
}
- if ((main->pipe & fll_program_data_pipe_input_e) && !(data.setting->flag & fake_main_flag_operation_e)) {
+ if ((main->program.pipe & fll_program_data_pipe_input_e) && !(main->setting.flag & fake_main_flag_operation_e)) {
data.file_data_build_fakefile.used = 0;
- setting->state.status = f_string_dynamic_append(f_string_ascii_minus_s, &data.file_data_build_fakefile);
+ main->setting.state.status = f_string_dynamic_append(f_string_ascii_minus_s, &data.file_data_build_fakefile);
- if (F_status_is_error_not(setting->state.status)) {
- setting->fakefile.used = 0;
+ if (F_status_is_error_not(main->setting.state.status)) {
+ main->setting.fakefile.used = 0;
- setting->state.status = f_string_dynamic_append(f_string_ascii_minus_s, &setting->fakefile);
+ main->setting.state.status = f_string_dynamic_append(f_string_ascii_minus_s, &main->setting.fakefile);
}
- if (F_status_is_error(setting->state.status)) {
- fake_print_error(setting, main->error, macro_fake_f(f_string_dynamic_append));
+ if (F_status_is_error(main->setting.state.status)) {
+ fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append));
}
}
- if (F_status_is_error_not(setting->state.status)) {
+ if (F_status_is_error_not(main->setting.state.status)) {
f_array_length_t i = 0;
// Pre-process and perform validation when "clean" is before a "build" or "make" command as a safety check.
{
uint8_t has_clean = F_false;
- for (; i < setting->operations.used; ++i) {
+ for (; i < main->setting.operations.used; ++i) {
- if (setting->operations.array[i] == fake_operation_clean_e) {
+ if (main->setting.operations.array[i] == fake_operation_clean_e) {
has_clean = F_true;
}
- else if (setting->operations.array[i] == fake_operation_build_e || setting->operations.array[i] == fake_operation_make_e) {
+ else if (main->setting.operations.array[i] == fake_operation_build_e || main->setting.operations.array[i] == fake_operation_make_e) {
// If the first operation is clean and a make or build operation exists, then the clean operation requires the appropriate settings file or fakefile file.
if (has_clean) {
- data.operation = setting->operations.array[i];
+ data.operation = main->setting.operations.array[i];
fake_validate_parameter_paths(&data);
- if (F_status_is_error_not(setting->state.status) && !(main->pipe & fll_program_data_pipe_input_e)) {
- setting->state.status = f_file_is(
- setting->operations.array[i] == fake_operation_build_e
+ if (F_status_is_error_not(main->setting.state.status) && !(main->program.pipe & fll_program_data_pipe_input_e)) {
+ main->setting.state.status = f_file_is(
+ (main->setting.operations.array[i] == fake_operation_build_e)
? data.file_data_build_settings
: data.file_data_build_fakefile,
F_file_type_regular_d, F_false
);
- if (setting->state.status == F_false) {
- setting->state.status = F_status_set_error(F_file_not);
+ if (main->setting.state.status == F_false) {
+ main->setting.state.status = F_status_set_error(F_file_not);
}
- if (F_status_is_error(setting->state.status)) {
+ if (F_status_is_error(main->setting.state.status)) {
fake_print_error_file(
- setting,
- main->error,
+ &main->setting,
+ main->program.error,
macro_fake_f(f_file_is),
- setting->operations.array[i] == fake_operation_build_e
+ (main->setting.operations.array[i] == fake_operation_build_e)
? data.file_data_build_settings
: data.file_data_build_fakefile,
fake_common_file_path_access_s,
break;
}
- if (!((++main->signal_check) % fake_signal_check_short_d)) {
- if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ if (!((++main->program.signal_check) % fake_signal_check_short_d)) {
+ if (fll_program_standard_signal_received(&main->program)) {
+ fll_program_print_signal_received(main->program.warning, main->program.signal_received);
- setting->state.status = F_status_set_error(F_interrupt);
+ main->setting.state.status = F_status_set_error(F_interrupt);
break;
}
- main->signal_check = 0;
+ main->program.signal_check = 0;
}
} // for
}
{
bool check_paths = F_true;
- for (i = 0; i < setting->operations.used; ++i) {
+ for (i = 0; i < main->setting.operations.used; ++i) {
- data.operation = setting->operations.array[i];
+ data.operation = main->setting.operations.array[i];
if (data.operation == fake_operation_build_e) {
if (check_paths) {
check_paths = F_false;
}
- if (F_status_is_error_not(setting->state.status)) {
- fake_build_operate(&data, 0, main->pipe & fll_program_data_pipe_input_e);
+ if (F_status_is_error_not(main->setting.state.status)) {
+ if (i && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
+
+ fake_build_operate(&data, 0, main->program.pipe & fll_program_data_pipe_input_e);
}
}
else if (data.operation == fake_operation_clean_e) {
+ if (i && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
+
fake_clean_operate(&data);
// Reset in case next operation needs files.
check_paths = F_false;
}
- if (F_status_is_error_not(setting->state.status)) {
+ if (F_status_is_error_not(main->setting.state.status)) {
+ if (i && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
+
fake_make_operate(&data);
- if (setting->state.status == F_child) break;
+ if (main->setting.state.status == F_child) break;
}
}
else if (data.operation == fake_operation_skeleton_e) {
+ if (i && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
+ }
+
fake_skeleton_operate(&data);
// Skeleton is supposed to guarantee these.
check_paths = F_false;
}
- if (setting->state.status == F_child) break;
+ if (main->setting.state.status == F_child) break;
- if (!((++main->signal_check) % fake_signal_check_short_d)) {
- if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ if (!((++main->program.signal_check) % fake_signal_check_short_d)) {
+ if (fll_program_standard_signal_received(&main->program)) {
+ fll_program_print_signal_received(main->program.warning, main->program.signal_received);
- setting->state.status = F_status_set_error(F_interrupt);
+ main->setting.state.status = F_status_set_error(F_interrupt);
break;
}
- main->signal_check = 0;
+ main->program.signal_check = 0;
}
- if (F_status_is_error(setting->state.status)) break;
+ if (F_status_is_error(main->setting.state.status)) break;
} // for
}
}
- if (F_status_is_error(setting->state.status)) {
- if (F_status_set_fine(setting->state.status) == F_interrupt) {
- fake_print_operation_cancelled(setting, main->message, data.operation);
+ if (F_status_is_error(main->setting.state.status)) {
+ if (F_status_set_fine(main->setting.state.status) == F_interrupt) {
+ fake_print_operation_cancelled(&main->setting, main->program.message, data.operation);
}
else {
- fake_print_error_failure_operation(setting, main->error, data.operation);
+ fake_print_error_failure_operation(&main->setting, main->program.error, data.operation);
}
-
- fake_print_line_last(setting, main->message);
}
- else if (setting->state.status != F_child) {
- if (F_status_is_error_not(setting->state.status)) {
- setting->state.status = F_none;
+ else if (main->setting.state.status != F_child) {
+ if (F_status_is_error_not(main->setting.state.status)) {
+ main->setting.state.status = F_none;
- fake_print_operation_all_complete(setting, main->message);
+ fake_print_operation_all_complete(&main->setting, main->program.message);
}
+ }
- if (setting->state.status != F_interrupt) {
- fake_print_line_last(setting, main->message);
- }
+ if ((main->setting.flag & fake_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
fake_data_delete(&data);
#ifndef _di_fake_execute_
int fake_execute(fake_data_t * const data, const f_string_maps_t environment, const f_string_static_t program, const f_string_statics_t arguments) {
- if (!data || !data->main || !data->setting) return 1;
+ if (!data || !data->program || !data->setting) return 1;
if (F_status_is_error(data->setting->state.status)) return 1;
- if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
- f_file_stream_lock(data->main->message.to);
+ if (data->program->error.verbosity >= f_console_verbosity_verbose_e) {
+ f_file_stream_lock(data->program->message.to);
- f_print_dynamic(program, data->main->message.to);
+ f_print_dynamic(program, data->program->message.to);
for (f_array_length_t i = 0; i < arguments.used; ++i) {
if (!arguments.array[i].used) continue;
- fl_print_format(" %Q", data->main->message.to, arguments.array[i]);
+ fl_print_format(" %Q", data->program->message.to, arguments.array[i]);
} // for
- f_print_dynamic_raw(f_string_eol_s, data->main->message.to);
+ f_print_dynamic_raw(f_string_eol_s, data->program->message.to);
- f_file_stream_flush(data->main->message.to);
- f_file_stream_unlock(data->main->message.to);
+ f_file_stream_flush(data->program->message.to);
+ f_file_stream_unlock(data->program->message.to);
}
int return_code = 0;
data->setting->state.status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code);
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
return_code = 1;
if (F_status_set_fine(data->setting->state.status) == F_file_found_not) {
- if (data->main->error.verbosity > f_console_verbosity_quiet_e) {
- f_file_stream_lock(data->main->error.to);
-
- fl_print_format("%[%QFailed to find program '%]", data->main->error.to, data->main->error.context, data->main->error.prefix, data->main->error.context);
- fl_print_format("%[%Q%]", data->main->error.to, data->main->error.notable, program, data->main->error.notable);
- fl_print_format("%[' for executing.%]%r", data->main->error.to, data->main->error.context, data->main->error.context, f_string_eol_s);
-
- f_file_stream_unlock(data->main->error.to);
- }
+ fake_print_error_execute_program_not_found(data->setting, data->program->error, program);
}
else {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_program));
+ fake_print_error(&data->program->error, macro_fake_f(fll_execute_program));
}
}
#ifndef _di_fake_file_buffer_
void fake_file_buffer(fake_data_t * const data, const f_string_static_t path_file, const bool required, f_string_dynamic_t * const buffer) {
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
data->setting->state.status = f_file_exists(path_file, F_true);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e);
return;
}
data->setting->state.status = f_file_size(path_file, F_true, &size_file);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_size), path_file, f_file_operation_read_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_size), path_file, f_file_operation_read_s, fll_error_file_type_file_e);
return;
}
if (F_status_is_error(data->setting->state.status)) {
const f_string_static_t message = macro_f_string_static_t_initialize("allocate buffer size for", 0, 24);
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_string_dynamic_increase_by), path_file, message, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_string_dynamic_increase_by), path_file, message, fll_error_file_type_file_e);
return;
}
data->setting->state.status = f_file_stream_open(path_file, f_string_empty_s, &file);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_stream_open), path_file, f_file_operation_open_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_stream_open), path_file, f_file_operation_open_s, fll_error_file_type_file_e);
return;
}
f_file_stream_close(&file);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_read), path_file, f_file_operation_read_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_read), path_file, f_file_operation_read_s, fll_error_file_type_file_e);
}
else {
data->setting->state.status = F_none;
if (required) {
data->setting->state.status = F_status_set_error(F_file_found_not);
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e);
}
}
}
#ifndef _di_fake_pipe_buffer_
void fake_pipe_buffer(fake_data_t * const data, f_string_dynamic_t * const buffer) {
- if (!data || !data->main || !data->setting || !buffer) return;
+ if (!data || !data->program || !data->setting || !buffer) return;
f_file_t file = f_file_t_initialize;
if (F_status_is_error(data->setting->state.status)) {
const f_string_static_t message = macro_f_string_static_t_initialize("allocate buffer size for", 0, 24);
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_string_dynamic_increase_by), f_string_ascii_minus_s, message, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_string_dynamic_increase_by), f_string_ascii_minus_s, message, fll_error_file_type_file_e);
return;
}
clearerr(F_type_input_d);
do {
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
} while (F_status_is_fine(data->setting->state.status) && data->setting->state.status != F_interrupt && data->setting->state.status != F_none_eof);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_stream_read_block), f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_stream_read_block), f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_file_e);
}
else {
data->setting->state.status = F_none;
#ifndef _di_fake_validate_parameter_paths_
void fake_validate_parameter_paths(fake_data_t * const data) {
- if (!data || !data->main || !data->setting) return;
+ if (!data || !data->program || !data->setting) return;
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
uint8_t requireds[] = {
F_false, // fake_long_build_s
- (data->main->pipe & fll_program_data_pipe_input_e) ? F_false : F_true, // fake_long_data_s
+ (data->program->pipe & fll_program_data_pipe_input_e) ? F_false : F_true, // fake_long_data_s
F_false, // fake_long_documents_s
F_false, // fake_long_licenses_s
F_false, // fake_long_sources_s
// Check only expected operations (fake_operation_clean_e and fake_operation_skeleton_e should not call this function).
if (data->operation == fake_operation_make_e) {
- if (data->main->parameters.array[fake_parameter_fakefile_e].result == f_console_result_none_e) {
+ if (data->program->parameters.array[fake_parameter_fakefile_e].result == f_console_result_none_e) {
if (data->setting->build.used && f_file_exists(data->setting->build, F_false) != F_true) {
if (f_file_exists(fake_default_fakefile_s, F_false) == F_true) {
requireds[1] = F_false; // fake_long_data_s
// If a custom --data or a custom --fakefile parameter is passed and uses an absolute or relative to current path, then do not check.
if (data->operation == fake_operation_make_e || data->operation == fake_operation_build_e) {
- f_console_parameter_t * const parameter = &data->main->parameters.array[
+ f_console_parameter_t * const parameter = &data->program->parameters.array[
data->operation == fake_operation_make_e
? fake_parameter_fakefile_e
: fake_parameter_settings_e
if (parameter->result & f_console_result_value_e) {
const f_array_length_t index = parameter->values.array[parameter->values.used - 1];
- if (f_path_is_absolute(data->main->parameters.arguments.array[index]) == F_true || f_path_is_relative_current(data->main->parameters.arguments.array[index]) == F_true) {
+ if (f_path_is_absolute(data->program->parameters.arguments.array[index]) == F_true || f_path_is_relative_current(data->program->parameters.arguments.array[index]) == F_true) {
requireds[1] = F_none; // fake_long_data_s
}
else {
- data->setting->state.status = f_file_exists(data->main->parameters.arguments.array[index], F_true);
+ data->setting->state.status = f_file_exists(data->program->parameters.arguments.array[index], F_true);
if (F_status_is_error_not(data->setting->state.status) && data->setting->state.status == F_true) {
requireds[1] = F_none; // fake_long_data_s
if (F_status_is_error(data->setting->state.status)) {
if (F_status_set_fine(data->setting->state.status) != F_directory_found_not || requireds[i]) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_stat), values[i], f_file_operation_access_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_stat), values[i], f_file_operation_access_s, fll_error_file_type_directory_e);
return;
}
}
}
else if (requireds[i] == F_true) {
- f_file_stream_lock(data->main->error.to);
-
- fl_print_format("%[%QNo valid path for the (required) directory parameter '%]", data->main->error.to, data->main->error.context, data->main->error.prefix, data->main->error.context);
- fl_print_format("%[%r%r%]", data->main->error.to, data->main->error.notable, f_console_symbol_long_normal_s, names[i], data->main->error.notable);
- fl_print_format("%[' was found.%]%r", data->main->error.to, data->main->error.context, data->main->error.context, f_string_eol_s);
-
- f_file_stream_unlock(data->main->error.to);
+ fake_print_error_parameter_directory_not_found_path(data->setting, data->program->error, f_console_symbol_long_normal_s, names[i], values[i]);
data->setting->state.status = F_status_set_error(F_directory_found_not);
* Execute main program.
*
* @param main
- * The main program data.
- * @param setting
- * The main program settings.
+ * The main program and setting data.
*
- * This alters setting.state.status:
+ * This alters main.setting.state.status:
* F_none on success.
* F_child if this is a child process returning.
*
* @see fake_validate_parameter_paths()
*/
#ifndef _di_fake_main_
- extern void fake_main(fll_program_data_t * const main, fake_setting_t * const setting);
+ extern void fake_main(fake_main_t * const main);
#endif // _di_fake_main_
/**
#ifndef _di_fake_path_generate_
void fake_path_generate(fake_data_t * const data) {
- if (!data || !data->main || !data->setting) return;
+ if (!data || !data->program || !data->setting) return;
data->setting->state.status = F_none;
uint8_t i = 0;
fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_path_generate_string_dynamic));
+ fake_print_error(&data->program->error, macro_fake_f(fake_path_generate_string_dynamic));
return;
}
data->setting->state.status = f_string_dynamic_append_nulless(sources[i], values[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
return;
}
fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_path_generate_string_dynamic));
+ fake_print_error(&data->program->error, macro_fake_f(fake_path_generate_string_dynamic));
return;
}
data->setting->state.status = f_string_dynamic_append_nulless(sources[i], values[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
return;
}
data->setting->state.status = f_string_dynamic_append_nulless(data->setting->work, values[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
return;
}
data->setting->state.status = f_string_dynamic_append_nulless(sources[i], values[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
return;
}
fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_path_generate_string_dynamic));
+ fake_print_error(&data->program->error, macro_fake_f(fake_path_generate_string_dynamic));
return;
}
data->setting->state.status = f_string_dynamic_append_nulless(sources[i], values[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data->program->error, macro_fake_f(f_string_dynamic_append_nulless));
return;
}
#ifndef _di_fake_path_generate_string_dynamic_
void fake_path_generate_string_dynamic(fake_data_t * const data, const f_string_dynamic_t source, f_string_dynamic_t *destination[], const uint8_t length) {
- if (!data || !data->main || !data->setting || !destination) return;
+ if (!data || !data->program || !data->setting || !destination) return;
data->setting->state.status = F_none;
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
- fll_program_data_t data = fll_program_data_t_initialize;
- fake_setting_t setting = fake_setting_t_initialize;
- setting.flag |= fake_main_flag_enable_documents_e;
- setting.flag |= fake_main_flag_enable_shared_e;
- setting.flag |= fake_main_flag_enable_static_e;
- setting.state.step_large = fake_allocation_large_d;
- setting.state.step_small = fake_allocation_small_d;
- setting.state.custom = (void *) &data;
+ fake_main_t data = fake_main_t_initialize;
+
+ data.program.debug.flag |= fake_print_flag_debug_e;
+ data.program.error.flag |= fake_print_flag_error_e;
+ data.program.message.flag |= fake_print_flag_message_e;
+ data.program.warning.flag |= fake_print_flag_warning_e;
+ data.program.message.custom = (void *) &data;
+ data.program.output.custom = (void *) &data;
+ data.program.error.custom = (void *) &data;
+ data.program.warning.custom = (void *) &data;
+ data.program.debug.custom = (void *) &data;
+
+ data.setting.flag |= fake_main_flag_enable_documents_e;
+ data.setting.flag |= fake_main_flag_enable_shared_e;
+ data.setting.flag |= fake_main_flag_enable_static_e;
+ data.setting.state.step_large = fake_allocation_large_d;
+ data.setting.state.step_small = fake_allocation_small_d;
+ data.setting.state.custom = (void *) &data.program;
f_console_parameter_t parameters[] = fake_console_parameter_t_initialize;
- data.parameters.array = parameters;
- data.parameters.used = fake_total_parameters_d;
- data.parameters.callback = &fake_setting_load_parameter_callback;
- data.environment = envp;
+ data.program.parameters.array = parameters;
+ data.program.parameters.used = fake_total_parameters_d;
+ data.program.parameters.callback = &fake_setting_load_parameter_callback;
+ data.program.environment = envp;
if (f_pipe_input_exists()) {
- data.pipe = fll_program_data_pipe_input_e;
+ data.program.pipe = fll_program_data_pipe_input_e;
}
- fll_program_standard_set_up(&data);
+ fll_program_standard_set_up(&data.program);
- f_file_umask_get(&data.umask);
+ f_file_umask_get(&data.program.umask);
{
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
- fake_setting_load(arguments, &data, &setting);
+ fake_setting_load(arguments, &data);
}
- fake_main(&data, &setting);
+ fake_main(&data);
- fake_setting_unload(&data, &setting);
+ fake_setting_unload(&data);
- fll_program_data_delete(&data);
+ fll_program_data_delete(&data.program);
- fll_program_standard_set_down(&data);
+ fll_program_standard_set_down(&data.program);
- if (setting.state.status == F_child) {
- exit(data.child);
+ if (data.setting.state.status == F_child) {
+ exit(data.program.child);
}
- return F_status_is_error(setting.state.status) ? 1 : 0;
+ return F_status_is_error(data.setting.state.status) ? 1 : 0;
}
#ifndef _di_fake_make_assure_inside_project_
void fake_make_assure_inside_project(fake_make_data_t * const data_make, const f_string_static_t path) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
data_make->cache_path.used = 0;
#ifndef _di_fake_make_get_id_
f_number_unsigned_t fake_make_get_id(fake_make_data_t * const data_make, const bool is_owner, const f_string_static_t buffer) {
- if (!data_make || !data_make->main || !data_make->setting) return 0;
+ if (!data_make || !data_make->program || !data_make->setting) return 0;
if (!buffer.used) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_get_id));
data_make->setting->state.status = F_status_set_error(F_parameter);
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(
- data_make->setting,
- data_make->main->error,
- is_owner
- ? macro_fake_f(f_account_id_by_name)
- : macro_fake_f(f_account_group_id_by_name)
- );
+ fake_print_error(&data_make->program->error, is_owner ? macro_fake_f(f_account_id_by_name) : macro_fake_f(f_account_group_id_by_name));
}
else {
if (data_make->setting->state.status == F_exist_not) {
- fake_print_error_group_not_found(data_make->setting, data_make->main->error, buffer);
+ fake_print_error_group_not_found(data_make->setting, data_make->program->error, buffer);
data_make->setting->state.status = F_status_set_error(F_exist_not);
}
}
}
else {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_conversion_dynamic_to_unsigned_detect));
+ fake_print_error(&data_make->program->error, macro_fake_f(fl_conversion_dynamic_to_unsigned_detect));
}
return 0;
}
if (number > F_type_size_32_unsigned_d) {
- fake_print_error_number_too_large(data_make->setting, data_make->main->error, buffer);
+ fake_print_error_number_too_large(data_make->setting, data_make->program->error, buffer);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_get_id_mode_
void fake_make_get_id_mode(fake_make_data_t * const data_make, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) {
- if (!data_make || !data_make->main || !data_make->setting || !mode || !replace) return;
+ if (!data_make || !data_make->program || !data_make->setting || !mode || !replace) return;
if (!buffer.used) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id_mode));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_get_id_mode));
data_make->setting->state.status = F_status_set_error(F_parameter);
return;
}
- data_make->setting->state.status = f_file_mode_from_string(buffer, data_make->main->umask, mode, replace);
+ data_make->setting->state.status = f_file_mode_from_string(buffer, data_make->program->umask, mode, replace);
if (F_status_is_error(data_make->setting->state.status)) {
if (F_status_set_fine(data_make->setting->state.status) == F_syntax) {
- fake_print_error_mode_invalid(data_make->setting, data_make->main->error, buffer);
+ fake_print_error_mode_invalid(data_make->setting, data_make->program->error, buffer);
}
else {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id_mode));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_get_id_mode));
}
}
else {
#ifndef _di_fake_make_path_relative_
void fake_make_path_relative(fake_make_data_t * const data_make, const f_string_static_t path) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
data_make->cache_path.used = 0;
#ifndef _di_fake_make_load_fakefile_
void fake_make_load_fakefile(fake_make_data_t * const data_make, const bool process_pipe) {
- if (!data_make || !data_make->data || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->data || !data_make->program || !data_make->setting) return;
if (F_status_is_error(data_make->setting->state.status)) return;
- if (fll_program_standard_signal_received(data_make->main)) {
- fll_program_print_signal_received(data_make->main->warning, data_make->setting->line_first, data_make->main->signal_received);
+ if (fll_program_standard_signal_received(data_make->program)) {
+ fll_program_print_signal_received(data_make->program->warning, data_make->program->signal_received);
data_make->setting->state.status = F_status_set_error(F_interrupt);
if (F_status_is_error(data_make->setting->state.status)) return;
if (!data_make->buffer.used) {
- fake_make_print_warning_fakefile_empty(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile);
+ fake_make_print_warning_fakefile_empty(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile);
return;
}
fll_fss_basic_list_read(data_make->buffer, &range, &list_objects, &list_contents, &delimits, 0, &comments, &data_make->setting->state);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_fss(data_make->setting, data_make->main->error, macro_fake_f(fll_fss_basic_list_read), data_make->data->file_data_build_fakefile, range, F_true);
+ fake_print_error_fss(data_make->setting, data_make->program->error, macro_fake_f(fll_fss_basic_list_read), data_make->data->file_data_build_fakefile, range, F_true);
}
else {
f_fss_apply_delimit(delimits, &data_make->buffer, &data_make->setting->state);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_fss_apply_delimit));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_fss_apply_delimit));
}
delimits.used = 0;
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_fss_nameds_resize));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_fss_nameds_resize));
f_fss_set_resize(0, &settings);
f_string_ranges_resize(0, &list_objects);
for (f_array_length_t i = 0; i < list_objects.used; ++i) {
if (!(i % fake_signal_check_short_d)) {
- if (fll_program_standard_signal_received(data_make->main)) {
- fll_program_print_signal_received(data_make->main->warning, data_make->setting->line_first, data_make->main->signal_received);
+ if (fll_program_standard_signal_received(data_make->program)) {
+ fll_program_print_signal_received(data_make->program->warning, data_make->program->signal_received);
data_make->setting->state.status = F_status_set_error(F_interrupt);
break;
}
- data_make->main->signal_check = 0;
+ data_make->program->signal_check = 0;
}
if (fl_string_dynamic_partial_compare_string(fake_make_item_settings_s.string, data_make->buffer, fake_make_item_settings_s.used, list_objects.array[i]) == F_equal_to) {
if (!missing_settings) {
- fake_make_print_warning_setting_object_multiple(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, fake_make_item_settings_s);
+ fake_make_print_warning_setting_object_multiple(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, fake_make_item_settings_s);
continue;
}
fll_fss_extended_read(data_make->buffer, &content_range, &settings.objects, &settings.contents, 0, 0, &delimits, 0, &data_make->setting->state);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_fss(data_make->setting, data_make->main->error, macro_fake_f(fll_fss_extended_read), data_make->data->file_data_build_fakefile, content_range, F_true);
+ fake_print_error_fss(data_make->setting, data_make->program->error, macro_fake_f(fll_fss_extended_read), data_make->data->file_data_build_fakefile, content_range, F_true);
break;
}
f_fss_apply_delimit(delimits, &data_make->buffer, &data_make->setting->state);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_fss_apply_delimit));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_fss_apply_delimit));
break;
}
if (fl_string_dynamic_partial_compare_string(fake_make_item_main_s.string, data_make->buffer, fake_make_item_main_s.used, list_objects.array[i]) == F_equal_to) {
if (!missing_main) {
- fake_make_print_warning_setting_object_multiple(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, fake_make_item_main_s);
+ fake_make_print_warning_setting_object_multiple(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, fake_make_item_main_s);
continue;
}
fll_fss_extended_read(data_make->buffer, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0, &data_make->setting->state);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_fss(data_make->setting, data_make->main->error, macro_fake_f(fll_fss_extended_read), data_make->data->file_data_build_fakefile, content_range, F_true);
+ fake_print_error_fss(data_make->setting, data_make->program->error, macro_fake_f(fll_fss_extended_read), data_make->data->file_data_build_fakefile, content_range, F_true);
break;
}
f_fss_apply_delimit(delimits, &data_make->buffer, &data_make->setting->state);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_fss_apply_delimit));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_fss_apply_delimit));
break;
}
}
if (missing_main) {
- fake_make_print_error_fakefile_section_missing(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, fake_make_item_main_s);
+ fake_make_print_error_fakefile_section_missing(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, fake_make_item_main_s);
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, function_name);
+ fake_print_error(&data_make->program->error, function_name);
f_fss_set_resize(0, &settings);
fake_build_load_setting(data_make->data, 0, F_false, &data_make->setting_build);
if (F_status_is_error(data_make->setting->state.status) && data_make->setting->state.status != F_status_set_error(F_interrupt)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_build_load_setting));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_build_load_setting));
}
}
if (F_status_is_error(data_make->setting->state.status)) {
if (F_status_set_fine(data_make->setting->state.status) != F_interrupt) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_partial_append));
}
f_fss_set_resize(0, &settings);
#ifndef _di_fake_make_load_fakefile_setting_build_
void fake_make_load_fakefile_setting_build(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content) {
- if (!data_make || !data_make->data || !data_make->main || !data_make->setting || !object || !content) return;
+ if (!data_make || !data_make->data || !data_make->program || !data_make->setting || !object || !content) return;
if (content->used) {
if (fl_string_dynamic_partial_compare_string(fake_common_setting_bool_yes_s.string, data_make->buffer, fake_common_setting_bool_yes_s.used, content->array[0]) == F_equal_to) {
data_make->setting_make.load_build = F_false;
}
else {
- fake_make_print_warning_setting_content_invalid(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, content->array[0], fake_make_item_settings_s);
+ fake_make_print_warning_setting_content_invalid(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, content->array[0], fake_make_item_settings_s);
}
if (content->used > 1) {
- fake_make_print_warning_setting_content_multiple(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, fake_make_setting_load_build_s);
+ fake_make_print_warning_setting_content_multiple(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, fake_make_setting_load_build_s);
}
}
else {
- fake_make_print_warning_setting_content_empty(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_load_build_s);
+ fake_make_print_warning_setting_content_empty(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_load_build_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_build_
#ifndef _di_fake_make_load_fakefile_setting_compiler_
void fake_make_load_fakefile_setting_compiler(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content, f_string_range_t **range_compiler) {
- if (!data_make || !data_make->data || !data_make->main || !data_make->setting || !object || !content || !range_compiler) return;
+ if (!data_make || !data_make->data || !data_make->program || !data_make->setting || !object || !content || !range_compiler) return;
if (content->used) {
*range_compiler = &content->array[content->used - 1];
if (content->used > 1) {
- fake_make_print_warning_setting_content_multiple(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, fake_make_setting_compiler_s);
+ fake_make_print_warning_setting_content_multiple(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, fake_make_setting_compiler_s);
}
}
else {
- fake_make_print_warning_setting_content_empty(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_compiler_s);
+ fake_make_print_warning_setting_content_empty(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_compiler_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_compiler_
#ifndef _di_fake_make_load_fakefile_setting_define_and_parameter_
void fake_make_load_fakefile_setting_define_and_parameter(fake_make_data_t * const data_make, f_fss_set_t * const settings) {
- if (!data_make || !data_make->data || !data_make->data || !data_make->main || !data_make->setting || !settings) return;
+ if (!data_make || !data_make->data || !data_make->data || !data_make->program || !data_make->setting || !settings) return;
;
f_string_map_multis_t define = f_string_map_multis_t_initialize;
data_make->setting->state.status = fll_fss_snatch_map_apart(data_make->buffer, settings->objects, settings->contents, settings_name, 2, settings_value, 0, 0);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fll_fss_snatch_map_apart));
+ fake_print_error(&data_make->program->error, macro_fake_f(fll_fss_snatch_map_apart));
f_string_map_multis_resize(0, &define);
data_make->setting->state.status = f_string_dynamic_mash(f_string_space_s, define.array[i].value.array[j], &combined);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_mash));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_mash));
break;
}
data_make->setting->state.status = f_environment_set(define.array[i].name, combined, F_true);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_environment_set));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_environment_set));
break;
}
}
else {
- fake_make_print_error_define_invalid_character(data_make->setting, data_make->main->error, define.array[i].name);
+ fake_make_print_error_define_invalid_character(data_make->setting, data_make->program->error, define.array[i].name);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_load_fakefile_setting_environment_
void fake_make_load_fakefile_setting_environment(fake_make_data_t * const data_make, f_fss_content_t * const content) {
- if (!data_make || !data_make->data || !data_make->data || !data_make->main || !data_make->setting || !content) return;
+ if (!data_make || !data_make->data || !data_make->data || !data_make->program || !data_make->setting || !content) return;
f_string_dynamic_t name_define = f_string_dynamic_t_initialize;
data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content->array[i], &name_define);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
break;
}
data_make->setting->state.status = f_string_dynamics_increase(fake_allocation_small_d, &data_make->setting_build.environment);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase));
break;
}
data_make->setting->state.status = f_string_dynamic_increase_by(name_define.used + 1, &data_make->setting_build.environment.array[j]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_increase_by));
break;
}
data_make->setting->state.status = f_string_dynamic_append_nulless(name_define, &data_make->setting_build.environment.array[j]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
++data_make->setting_build.environment.used;
}
else if (j < data_make->setting_build.environment.used) {
- fake_make_print_warning_environment_name_already_added(data_make->setting, data_make->main->warning, name_define);
+ fake_make_print_warning_environment_name_already_added(data_make->setting, data_make->program->warning, name_define);
data_make->setting_build.environment.array[j].used = 0;
data_make->setting->state.status = f_string_dynamic_append_nulless(name_define, &data_make->setting_build.environment.array[j]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
}
}
- else if (data_make->main->warning.verbosity >= f_console_verbosity_verbose_e) {
- fake_make_print_warning_environment_name_invalid(data_make->setting, data_make->main->warning, name_define);
+ else if (data_make->program->warning.verbosity >= f_console_verbosity_verbose_e) {
+ fake_make_print_warning_environment_name_invalid(data_make->setting, data_make->program->warning, name_define);
}
name_define.used = 0;
#ifndef _di_fake_make_load_fakefile_setting_fail_
void fake_make_load_fakefile_setting_fail(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content) {
- if (!data_make || !data_make->data || !data_make->data || !data_make->main || !data_make->setting || !object || !content) return;
+ if (!data_make || !data_make->data || !data_make->data || !data_make->program || !data_make->setting || !object || !content) return;
if (content->used) {
if (fl_string_dynamic_partial_compare_string(fake_make_operation_argument_exit_s.string, data_make->buffer, fake_make_operation_argument_exit_s.used, content->array[content->used - 1]) == F_equal_to) {
data_make->setting_make.fail = fake_make_operation_fail_ignore_e;
}
else {
- fake_make_print_warning_setting_content_invalid(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, content->array[content->used - 1], fake_make_item_settings_s);
+ fake_make_print_warning_setting_content_invalid(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, content->array[content->used - 1], fake_make_item_settings_s);
}
if (content->used > 1) {
- fake_make_print_warning_setting_content_multiple(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, fake_make_setting_fail_s);
+ fake_make_print_warning_setting_content_multiple(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, fake_make_setting_fail_s);
}
}
else {
- fake_make_print_warning_setting_content_empty(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_fail_s);
+ fake_make_print_warning_setting_content_empty(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_fail_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_fail_
#ifndef _di_fake_make_load_fakefile_setting_indexer_
void fake_make_load_fakefile_setting_indexer(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content, f_string_range_t **range_indexer) {
- if (!data_make || !data_make->data || !data_make->data || !data_make->main || !data_make->setting || !object || !content || !range_indexer) return;
+ if (!data_make || !data_make->data || !data_make->data || !data_make->program || !data_make->setting || !object || !content || !range_indexer) return;
if (content->used) {
*range_indexer = &content->array[content->used - 1];
if (content->used > 1) {
- fake_make_print_warning_setting_content_multiple(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, fake_make_setting_indexer_s);
+ fake_make_print_warning_setting_content_multiple(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, fake_make_setting_indexer_s);
}
}
else {
- fake_make_print_warning_setting_content_empty(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_indexer_s);
+ fake_make_print_warning_setting_content_empty(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_indexer_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_indexer_
#ifndef _di_fake_make_load_fakefile_setting_parameter_
void fake_make_load_fakefile_setting_parameter(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content) {
- if (!data_make || !data_make->data || !data_make->data || !data_make->main || !data_make->setting || !object || !content) return;
+ if (!data_make || !data_make->data || !data_make->data || !data_make->program || !data_make->setting || !object || !content) return;
if (content->used) {
if (fl_string_dynamic_partial_compare_string(fake_make_setting_return_s.string, data_make->buffer, fake_make_setting_return_s.used, content->array[0]) == F_equal_to) {
data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content->array[i], &data_make->setting_make.parameter.array[0].value.array[0]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
break;
}
data_make->setting->state.status = f_string_dynamic_append_assure(f_string_space_s, &data_make->setting_make.parameter.array[0].value.array[0]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_assure));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_assure));
break;
}
}
}
else {
- fake_make_print_warning_setting_content_empty(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_return_s);
+ fake_make_print_warning_setting_content_empty(data_make->setting, data_make->program->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_return_s);
}
data_make->setting->state.status = F_none;
#ifndef _di_fake_make_load_parameters_
void fake_make_load_parameters(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (F_status_is_error(data_make->setting->state.status)) return;
- if (data_make->main->context.mode != f_color_mode_none_e) {
+ if (data_make->program->context.mode != f_color_mode_none_e) {
data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.color);
if (F_status_is_error_not(data_make->setting->state.status)) {
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase_by));
return;
}
- if (data_make->main->context.mode == f_color_mode_not_e) {
- if (data_make->main->parameters.array[fake_parameter_no_color_e].flag & f_console_flag_normal_e) {
+ if (data_make->program->context.mode == f_color_mode_not_e) {
+ if (data_make->program->parameters.array[fake_parameter_no_color_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.color.array[data_make->parameter.color.used]);
}
- else if (data_make->main->parameters.array[fake_parameter_no_color_e].flag & f_console_flag_normal_e) {
+ else if (data_make->program->parameters.array[fake_parameter_no_color_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]);
}
data_make->setting->state.status = f_string_dynamic_append(f_console_standard_short_no_color_s, &data_make->parameter.color.array[data_make->parameter.color.used]);
}
}
- else if (data_make->main->context.mode == f_color_mode_dark_e) {
- if (data_make->main->parameters.array[fake_parameter_dark_e].flag & f_console_flag_normal_e) {
+ else if (data_make->program->context.mode == f_color_mode_dark_e) {
+ if (data_make->program->parameters.array[fake_parameter_dark_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.color.array[data_make->parameter.color.used]);
}
- else if (data_make->main->parameters.array[fake_parameter_dark_e].flag & f_console_flag_normal_e) {
+ else if (data_make->program->parameters.array[fake_parameter_dark_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]);
}
}
}
else {
- if (data_make->main->parameters.array[fake_parameter_light_e].flag & f_console_flag_normal_e) {
+ if (data_make->program->parameters.array[fake_parameter_light_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.color.array[data_make->parameter.color.used]);
}
- else if (data_make->main->parameters.array[fake_parameter_light_e].flag & f_console_flag_normal_e) {
+ else if (data_make->program->parameters.array[fake_parameter_light_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]);
}
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append));
return;
}
++data_make->parameter_option.color.used;
}
- if (data_make->main->error.verbosity != f_console_verbosity_normal_e) {
+ if (data_make->program->error.verbosity != f_console_verbosity_normal_e) {
data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.verbosity);
if (F_status_is_error_not(data_make->setting->state.status)) {
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase_by));
return;
}
- if (data_make->main->error.verbosity == f_console_verbosity_quiet_e) {
- if (data_make->main->parameters.array[fake_parameter_verbosity_quiet_e].flag & f_console_flag_normal_e) {
+ if (data_make->program->error.verbosity == f_console_verbosity_quiet_e) {
+ if (data_make->program->parameters.array[fake_parameter_verbosity_quiet_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]);
}
- else if (data_make->main->parameters.array[fake_parameter_verbosity_quiet_e].flag & f_console_flag_normal_e) {
+ else if (data_make->program->parameters.array[fake_parameter_verbosity_quiet_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]);
}
data_make->setting->state.status = f_string_dynamic_append(f_console_standard_short_quiet_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]);
}
}
- else if (data_make->main->error.verbosity == f_console_verbosity_error_e) {
- if (data_make->main->parameters.array[fake_parameter_verbosity_error_e].flag & f_console_flag_normal_e) {
+ else if (data_make->program->error.verbosity == f_console_verbosity_error_e) {
+ if (data_make->program->parameters.array[fake_parameter_verbosity_error_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]);
}
- else if (data_make->main->parameters.array[fake_parameter_verbosity_error_e].flag & f_console_flag_normal_e) {
+ else if (data_make->program->parameters.array[fake_parameter_verbosity_error_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]);
}
data_make->setting->state.status = f_string_dynamic_append(f_console_standard_short_error_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]);
}
}
- else if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) {
- if (data_make->main->parameters.array[fake_parameter_verbosity_verbose_e].flag & f_console_flag_normal_e) {
+ else if (data_make->program->error.verbosity >= f_console_verbosity_verbose_e) {
+ if (data_make->program->parameters.array[fake_parameter_verbosity_verbose_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]);
}
- else if (data_make->main->parameters.array[fake_parameter_verbosity_verbose_e].flag & f_console_flag_normal_e) {
+ else if (data_make->program->parameters.array[fake_parameter_verbosity_verbose_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]);
}
}
}
else {
- if (data_make->main->parameters.array[fake_parameter_verbosity_debug_e].flag & f_console_flag_normal_e) {
+ if (data_make->program->parameters.array[fake_parameter_verbosity_debug_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]);
}
- else if (data_make->main->parameters.array[fake_parameter_verbosity_debug_e].flag & f_console_flag_normal_e) {
+ else if (data_make->program->parameters.array[fake_parameter_verbosity_debug_e].flag & f_console_flag_normal_e) {
data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]);
}
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append));
return;
}
};
const f_console_parameter_t *console[] = {
- &data_make->main->parameters.array[fake_parameter_define_e],
- &data_make->main->parameters.array[fake_parameter_mode_e],
+ &data_make->program->parameters.array[fake_parameter_define_e],
+ &data_make->program->parameters.array[fake_parameter_mode_e],
};
const f_string_dynamics_t source[] = {
data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase_by));
return;
}
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase));
return;
}
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
return;
}
data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase_by));
return;
}
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
return;
}
};
const f_console_parameter_t *console[] = {
- &data_make->main->parameters.array[fake_parameter_build_e],
- &data_make->main->parameters.array[fake_parameter_data_e],
- &data_make->main->parameters.array[fake_parameter_documents_e],
- &data_make->main->parameters.array[fake_parameter_fakefile_e],
- &data_make->main->parameters.array[fake_parameter_licenses_e],
- &data_make->main->parameters.array[fake_parameter_process_e],
- &data_make->main->parameters.array[fake_parameter_settings_e],
- &data_make->main->parameters.array[fake_parameter_sources_e],
- &data_make->main->parameters.array[fake_parameter_work_e],
+ &data_make->program->parameters.array[fake_parameter_build_e],
+ &data_make->program->parameters.array[fake_parameter_data_e],
+ &data_make->program->parameters.array[fake_parameter_documents_e],
+ &data_make->program->parameters.array[fake_parameter_fakefile_e],
+ &data_make->program->parameters.array[fake_parameter_licenses_e],
+ &data_make->program->parameters.array[fake_parameter_process_e],
+ &data_make->program->parameters.array[fake_parameter_settings_e],
+ &data_make->program->parameters.array[fake_parameter_sources_e],
+ &data_make->program->parameters.array[fake_parameter_work_e],
};
const f_string_dynamic_t source[] = {
data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase_by));
return;
}
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase));
return;
}
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
return;
}
data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase_by));
return;
}
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
return;
}
#ifndef _di_fake_make_operate_
void fake_make_operate(fake_data_t * const data) {
- if (!data || !data->main || !data->setting) return;
+ if (!data || !data->program || !data->setting) return;
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received);
+ if (!((++data->program->signal_check) % fake_signal_check_d)) {
+ if (fll_program_standard_signal_received(data->program)) {
+ fll_program_print_signal_received(data->program->warning, data->program->signal_received);
data->setting->state.status = F_status_set_error(F_interrupt);
}
}
- fake_make_print_now_making(data->setting, data->main->message, data->setting->fakefile);
+ fake_make_print_now_making(data->setting, data->program->message, data->setting->fakefile);
f_array_lengths_t section_stack = f_array_lengths_t_initialize;
fake_make_data_t data_make = fake_make_data_t_initialize;
data_make.data = data;
- data_make.main = data->main;
+ data_make.program = data->program;
data_make.setting = data->setting;
data->setting->state.status = f_string_dynamics_increase(data->setting->state.step_small, &data_make.path.stack);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data_make.setting, data_make.main->error, macro_fake_f(f_string_dynamics_increase));
+ fake_print_error(&data_make.program->error, macro_fake_f(f_string_dynamics_increase));
return;
}
data->setting->state.status = f_path_current(F_true, &data_make.path.stack.array[0]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data_make.setting, data_make.main->error, macro_fake_f(f_path_current));
+ fake_print_error(&data_make.program->error, macro_fake_f(f_path_current));
fake_make_data_delete(&data_make);
data->setting->state.status = f_directory_open(data_make.path.stack.array[0], F_false, &data_make.path.top.id);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data_make.setting, data_make.main->error, macro_fake_f(f_directory_open));
+ fake_print_error(&data_make.program->error, macro_fake_f(f_directory_open));
fake_make_data_delete(&data_make);
fake_make_load_parameters(&data_make);
- fake_make_load_fakefile(&data_make, data->main->pipe & fll_program_data_pipe_input_e);
+ fake_make_load_fakefile(&data_make, data->program->pipe & fll_program_data_pipe_input_e);
if (F_status_is_error(data->setting->state.status)) {
fake_make_data_delete(&data_make);
if (data_make.setting_make.fail == fake_make_operation_fail_exit_e) {
data_make.error.prefix = fl_print_error_s;
data_make.error.suffix = f_string_empty_s;
- data_make.error.context = data->main->context.set.error;
- data_make.error.notable = data->main->context.set.notable;
+ data_make.error.context = data->program->context.set.error;
+ data_make.error.notable = data->program->context.set.notable;
data_make.error.to.stream = F_type_error_d;
data_make.error.to.id = F_type_descriptor_error_d;
- data_make.error.set = &data->main->context.set;
+ data_make.error.set = &data->program->context.set;
}
else if (data_make.setting_make.fail == fake_make_operation_fail_warn_e) {
data_make.error.prefix = fl_print_warning_s;
data_make.error.suffix = f_string_empty_s;
- data_make.error.context = data->main->context.set.warning;
- data_make.error.notable = data->main->context.set.notable;
+ data_make.error.context = data->program->context.set.warning;
+ data_make.error.notable = data->program->context.set.notable;
data_make.error.to.stream = F_type_output_d;
data_make.error.to.id = F_type_descriptor_output_d;
- data_make.error.set = &data->main->context.set;
+ data_make.error.set = &data->program->context.set;
}
else {
data_make.error.to.stream = 0;
data_make.error.prefix = f_string_empty_s;
data_make.error.suffix = f_string_empty_s;
data_make.error.to.id = -1;
- data_make.error.set = &data->main->context.set;
+ data_make.error.set = &data->program->context.set;
}
- data_make.error.verbosity = data->main->message.verbosity;
+ data_make.error.verbosity = data->program->message.verbosity;
- if (data->main->parameters.remaining.used) {
+ if (data->program->parameters.remaining.used) {
f_array_length_t i = 0;
f_array_length_t j = 0;
f_string_range_t range = f_string_range_t_initialize;
data->setting->state.status = F_none;
// Validate the remaining parameters.
- for (i = 0; i < data->main->parameters.remaining.used; ++i) {
+ for (i = 0; i < data->program->parameters.remaining.used; ++i) {
- index = data->main->parameters.remaining.array[i];
+ index = data->program->parameters.remaining.array[i];
- if (!data->main->parameters.arguments.array[index].used) {
+ if (!data->program->parameters.arguments.array[index].used) {
data->setting->state.status = F_status_set_error(F_parameter);
break;
}
range.start = 0;
- range.stop = data->main->parameters.arguments.array[index].used - 1;
+ range.stop = data->program->parameters.arguments.array[index].used - 1;
for (j = 0; j < data_make.fakefile.used; ++j) {
- if (fl_string_dynamic_partial_compare(data->main->parameters.arguments.array[index], data_make.buffer, range, data_make.fakefile.array[j].name) == F_equal_to) break;
+ if (fl_string_dynamic_partial_compare(data->program->parameters.arguments.array[index], data_make.buffer, range, data_make.fakefile.array[j].name) == F_equal_to) break;
} // for
if (j == data_make.fakefile.used) {
} // for
if (F_status_is_error(data->setting->state.status)) {
- fake_make_print_error_argument_invalid_section(data->setting, data->main->error, data->main->parameters.arguments.array[data->main->parameters.remaining.array[i]]);
+ fake_make_print_error_argument_invalid_section(data->setting, data->program->error, data->program->parameters.arguments.array[data->program->parameters.remaining.array[i]]);
}
else {
int result = 0;
- for (i = 0; i < data->main->parameters.remaining.used; ++i) {
+ for (i = 0; i < data->program->parameters.remaining.used; ++i) {
- index = data->main->parameters.remaining.array[i];
+ index = data->program->parameters.remaining.array[i];
range.start = 0;
- range.stop = data->main->parameters.arguments.array[index].used - 1;
+ range.stop = data->program->parameters.arguments.array[index].used - 1;
for (j = 0; j < data_make.fakefile.used; ++j) {
- if (fl_string_dynamic_partial_compare(data->main->parameters.arguments.array[index], data_make.buffer, range, data_make.fakefile.array[j].name) == F_equal_to) {
+ if (fl_string_dynamic_partial_compare(data->program->parameters.arguments.array[index], data_make.buffer, range, data_make.fakefile.array[j].name) == F_equal_to) {
{
int result = fake_make_operate_section(&data_make, j, §ion_stack);
if (data->setting->state.status == F_child) {
- data->main->child = result;
+ data->program->child = result;
break;
}
data->setting->state.status = f_path_change_at(data_make.path.top.id);
if (F_status_is_error(data->setting->state.status)) {
- fake_make_print_warning_cannot_change_back(data->setting, data->main->warning, data_make.path.stack.array[0]);
+ fake_make_print_warning_cannot_change_back(data->setting, data->program->warning, data_make.path.stack.array[0]);
}
data->setting->state.status = status;
const int result = fake_make_operate_section(&data_make, data_make.id_main, §ion_stack);
if (data->setting->state.status == F_child) {
- data->main->child = result;
+ data->program->child = result;
}
}
data->setting->state.status = f_path_change_at(data_make.path.top.id);
if (F_status_is_error(data->setting->state.status)) {
- fake_make_print_warning_cannot_change_back(data->setting, data->main->warning, data_make.path.stack.array[0]);
+ fake_make_print_warning_cannot_change_back(data->setting, data->program->warning, data_make.path.stack.array[0]);
}
data->setting->state.status = status;
#ifndef _di_fake_make_operate_expand_
void fake_make_operate_expand(fake_make_data_t * const data_make, const f_string_range_t section_name, const f_fss_content_t content, const f_uint8s_t quotes) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (F_status_is_error(data_make->setting->state.status)) return;
if (!content.used) return;
data_make->setting->state.status = f_string_dynamics_increase_by(content.used, &data_make->cache_arguments);
if (F_status_is_error(data_make->setting->state.status) || data_make->setting->state.status == F_string_too_large) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase_by));
return;
}
data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase));
return;
}
data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase));
break;
}
if (F_status_is_error(data_make->setting->state.status)) {
if (F_status_set_fine(data_make->setting->state.status) != F_interrupt) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_iki_read));
+ fake_print_error(&data_make->program->error, macro_fake_f(fl_iki_read));
}
break;
data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
break;
}
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_string_dynamic_partial_compare));
+ fake_print_error(&data_make->program->error, macro_fake_f(fl_string_dynamic_partial_compare));
break;
}
data_make->setting->state.status = f_string_dynamic_append_nulless(data_make->setting_make.parameter.array[0].value.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
data_make->setting->state.status = f_string_dynamic_append(f_string_ascii_0_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append));
break;
}
data_make->setting->state.status = f_string_dynamic_increase_by(data_make->path.stack.array[0].used + f_path_separator_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_increase_by));
break;
}
data_make->setting->state.status = f_string_dynamic_append(data_make->path.stack.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append));
break;
}
data_make->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_assure));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_assure));
break;
}
data_make->setting->state.status = f_string_dynamic_increase_by(data_make->path.stack.array[data_make->path.stack.used - 1].used + f_path_separator_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_increase_by));
break;
}
data_make->setting->state.status = f_string_dynamic_append(data_make->path.stack.array[data_make->path.stack.used - 1], &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append));
break;
}
data_make->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_assure));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_assure));
break;
}
data_make->setting->state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_increase_by));
break;
}
data_make->setting->state.status = f_string_dynamic_append(f_string_space_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append));
break;
}
data_make->setting->state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase));
break;
}
data_make->setting->state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
data_make->setting->state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_increase_by));
break;
}
data_make->setting->state.status = f_string_dynamic_append(f_string_space_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append));
break;
}
data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase));
break;
}
data_make->setting->state.status = f_string_dynamic_append_nulless(parameter->array[k].value.array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
break;
}
fake_make_operate_expand_build(data_make, quotes.array[i], iki_data->content.array[j]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_expand_build));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_operate_expand_build));
break;
}
fake_make_operate_expand_environment(data_make, quotes.array[i], iki_data->content.array[j]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_expand_environment));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_operate_expand_environment));
break;
}
fake_make_operate_expand_context(data_make, quotes.array[i], iki_data->content.array[j]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_expand_context));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_operate_expand_context));
break;
}
data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
break;
}
data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
break;
}
data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase));
break;
}
data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content.array[i], &data_make->cache_arguments.array[data_make->cache_arguments.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_partial_append_nulless));
break;
}
data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase));
break;
}
#ifndef _di_fake_make_operate_expand_context_
void fake_make_operate_expand_context(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
const f_string_static_t *context = 0;
};
const f_color_set_t context_value[] = {
- data_make->main->context.set.error,
- data_make->main->context.set.important,
- data_make->main->context.set.normal,
- data_make->main->context.set.notable,
- data_make->main->context.set.reset,
- data_make->main->context.set.standout,
- data_make->main->context.set.success,
- data_make->main->context.set.title,
- data_make->main->context.set.warning,
+ data_make->program->context.set.error,
+ data_make->program->context.set.important,
+ data_make->program->context.set.normal,
+ data_make->program->context.set.notable,
+ data_make->program->context.set.reset,
+ data_make->program->context.set.standout,
+ data_make->program->context.set.success,
+ data_make->program->context.set.title,
+ data_make->program->context.set.warning,
};
for (f_array_length_t i = 0; i < 9; ++i) {
#ifndef _di_fake_make_operate_expand_environment_
void fake_make_operate_expand_environment(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
data_make->setting->state.status = F_none;
#ifndef _di_fake_make_operate_section_
int fake_make_operate_section(fake_make_data_t * const data_make, const f_array_length_t id_section, f_array_lengths_t * const section_stack) {
- if (!data_make || !data_make->main || !data_make->setting || !section_stack) return 0;
- if (F_status_is_error(data_make->setting->state.status) || data_make->setting->state.status == F_child) return data_make->main->child;
+ if (!data_make || !data_make->program || !data_make->setting || !section_stack) return 0;
+ if (F_status_is_error(data_make->setting->state.status) || data_make->setting->state.status == F_child) return data_make->program->child;
if (id_section >= data_make->fakefile.used) {
data_make->setting->state.status = F_status_set_error(F_parameter);
- fake_print_error(data_make->setting, data_make->error, macro_fake_f(fake_make_operate_section));
+ fake_print_error(&data_make->error, macro_fake_f(fake_make_operate_section));
return 0;
}
data_make->setting->state.status = f_array_lengths_increase(data_make->setting->state.step_small, section_stack);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->error, macro_fake_f(f_array_lengths_increase));
+ fake_print_error(&data_make->error, macro_fake_f(f_array_lengths_increase));
return 0;
}
const f_fss_named_t *section = &data_make->fakefile.array[id_section];
- fake_make_print_processing_section(data_make->setting, data_make->main->message, data_make->buffer, *section);
+ fake_make_print_processing_section(data_make->setting, data_make->program->message, data_make->buffer, *section);
if (!section->objects.used) {
--section_stack->used;
state_process.operation_previous = state_process.operation;
state_process.operation = 0;
- if (!((++data_make->main->signal_check) % fake_signal_check_short_d)) {
- if (fll_program_standard_signal_received(data_make->main)) {
- fll_program_print_signal_received(data_make->main->warning, data_make->setting->line_first, data_make->main->signal_received);
+ if (!((++data_make->program->signal_check) % fake_signal_check_short_d)) {
+ if (fll_program_standard_signal_received(data_make->program)) {
+ fll_program_print_signal_received(data_make->program->warning, data_make->program->signal_received);
data_make->setting->state.status = F_status_set_error(F_interrupt);
break;
}
- data_make->main->signal_check = 0;
+ data_make->program->signal_check = 0;
}
for (j = 0; j < fake_max_operation_d; ++j) {
data_make->setting_make.fail = fake_make_operation_fail_exit_e;
data_make->error.prefix = fl_print_error_s;
data_make->error.suffix = f_string_empty_s;
- data_make->error.context = data_make->main->context.set.error;
- data_make->error.notable = data_make->main->context.set.notable;
- data_make->main->error.to.stream = F_type_error_d;
- data_make->main->error.to.id = F_type_descriptor_error_d;
- data_make->error.set = &data_make->main->context.set;
+ data_make->error.context = data_make->program->context.set.error;
+ data_make->error.notable = data_make->program->context.set.notable;
+ data_make->program->error.to.stream = F_type_error_d;
+ data_make->program->error.to.id = F_type_descriptor_error_d;
+ data_make->error.set = &data_make->program->context.set;
}
fake_print_error_operation_failed(data_make->setting, data_make->error, data_make->buffer, section->name, section->objects.array[i]);
if (F_status_set_error(data_make->setting->state.status) == F_interrupt) return 0;
if (i == section->objects.used && F_status_is_error_not(data_make->setting->state.status) && (state_process.operation == fake_make_operation_type_and_e || state_process.operation == fake_make_operation_type_else_e || state_process.operation == fake_make_operation_type_if_e || state_process.operation == fake_make_operation_type_or_e)) {
- fake_make_print_error_operation_incomplete(data_make->setting, data_make->main->error, state_process.operation);
+ fake_make_print_error_operation_incomplete(data_make->setting, data_make->program->error, state_process.operation);
fake_print_error_operation_failed(data_make->setting, data_make->error, data_make->buffer, section->name, section->objects.array[section->objects.used - 1]);
#ifndef _di_fake_make_operate_block_postprocess_
void fake_make_operate_block_postprocess(fake_make_data_t * const data_make, const bool last, fake_state_process_t * const state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
if (F_status_is_error(data_make->setting->state.status)) {
state_process->block_result = fake_condition_result_error_e;
#ifndef _di_fake_make_operate_process_
int fake_make_operate_process(fake_make_data_t * const data_make, const f_string_range_t section_name, fake_state_process_t * const state_process, f_array_lengths_t * const section_stack) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process || !section_stack) return 0;
- if (data_make->setting->state.status == F_child) return data_make->data->main->child;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process || !section_stack) return 0;
+ if (data_make->setting->state.status == F_child) return data_make->program->child;
if (state_process->operation == fake_make_operation_type_break_e) {
fake_make_operate_process_type_break(data_make);
#ifndef _di_fake_make_operate_process_buffer_escape_
void fake_make_operate_process_buffer_escape(fake_make_data_t * const data_make, const f_string_static_t source, f_string_dynamic_t * const destination) {
- if (!data_make || !data_make->main || !data_make->setting || !destination) return;
+ if (!data_make || !data_make->program || !data_make->setting || !destination) return;
if (!source.used) {
data_make->setting->state.status = F_data_not;
#ifndef _di_fake_make_operate_process_execute_
void fake_make_operate_process_execute(fake_make_data_t * const data_make, const f_string_static_t program, const f_string_statics_t arguments, const bool as_shell) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (!program.used && !arguments.used) {
data_make->setting->state.status = F_data_not;
return;
}
- if (fll_program_standard_signal_received(data_make->main)) {
- fll_program_print_signal_received(data_make->main->warning, data_make->data->setting->line_first, data_make->main->signal_received);
+ if (fll_program_standard_signal_received(data_make->program)) {
+ fll_program_print_signal_received(data_make->program->warning, data_make->program->signal_received);
data_make->setting->state.status = F_status_set_error(F_interrupt);
data_make->setting->state.status = fl_environment_load_names(data_make->setting_build.environment, &data_make->environment);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_environment_load_names));
+ fake_print_error(&data_make->program->error, macro_fake_f(fl_environment_load_names));
return;
}
data_make->setting->state.status = f_environment_get_all(&data_make->environment);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_environment_get_all));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_environment_get_all));
return;
}
}
- fake_make_print_verbose_operate_program(data_make->setting, data_make->main->message, program, arguments);
+ fake_make_print_verbose_operate_program(data_make->setting, data_make->program->message, program, arguments);
// Child processes should receive all signals, without blocking.
f_signal_how_t signals = f_signal_how_t_initialize;
data_make->setting->state.status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code);
- if (fll_program_standard_signal_received(data_make->main)) {
- fll_program_print_signal_received(data_make->main->warning, data_make->data->setting->line_first, data_make->main->signal_received);
+ if (fll_program_standard_signal_received(data_make->program)) {
+ fll_program_print_signal_received(data_make->program->warning, data_make->program->signal_received);
data_make->setting->state.status = F_status_set_error(F_interrupt);
if (F_status_set_fine(data_make->setting->state.status) == F_interrupt) return;
if (F_status_set_fine(data_make->setting->state.status) == F_file_found_not) {
- fake_make_print_error_program_not_found(data_make->setting, data_make->main->error, program);
+ fake_make_print_error_program_not_found(data_make->setting, data_make->program->error, program);
}
else if (F_status_set_fine(data_make->setting->state.status) != F_failure) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fll_execute_program));
+ fake_print_error(&data_make->program->error, macro_fake_f(fll_execute_program));
}
}
#ifndef _di_fake_make_operate_process_return_
void fake_make_operate_process_return(fake_make_data_t * const data_make, const int return_code) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
const f_status_t status_original = data_make->setting->state.status;
data_make->setting->state.status = f_conversion_number_signed_to_string(WEXITSTATUS(return_code), f_conversion_data_base_10_c, &number);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_conversion_number_signed_to_string));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_conversion_number_signed_to_string));
f_string_dynamic_resize(0, &number);
f_string_dynamic_resize(0, &number);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append));
return;
}
- fake_make_print_error_program_failed(data_make->setting, data_make->main->error, return_code);
+ fake_make_print_error_program_failed(data_make->setting, data_make->program->error, return_code);
data_make->setting->state.status = (data_make->setting_make.fail == fake_make_operation_fail_exit_e) ? F_status_set_error(F_failure) : F_failure;
#ifndef _di_fake_make_operate_process_run_
void fake_make_operate_process_run(fake_make_data_t * const data_make, const bool as_shell) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (!data_make->cache_arguments.used) {
data_make->setting->state.status = F_data_not;
#ifndef _di_fake_make_operate_process_type_break_
void fake_make_operate_process_type_break(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
data_make->setting->state.status = F_none;
return;
}
- fake_make_print_verbose_operate_break(data_make->setting, data_make->main->message, data_make->cache_arguments);
+ fake_make_print_verbose_operate_break(data_make->setting, data_make->program->message, data_make->cache_arguments);
}
#endif // _di_fake_make_operate_process_type_break_
#ifndef _di_fake_make_operate_process_type_build_
void fake_make_operate_process_type_build(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
fake_build_operate(data_make->data, data_make->cache_arguments.used ? &data_make->cache_arguments : 0, F_false);
if (F_status_set_fine(data_make->setting->state.status) == F_interrupt) return;
#ifndef _di_fake_make_operate_process_type_clean_
void fake_make_operate_process_type_clean(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
fake_clean_operate(data_make->data);
if (F_status_set_fine(data_make->setting->state.status) == F_interrupt) return;
const int result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_compiler, data_make->cache_arguments);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_execute));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_execute));
}
else if (data_make->setting->state.status == F_child) {
return result;
#ifndef _di_fake_make_operate_process_type_condition_
void fake_make_operate_process_type_condition(fake_make_data_t * const data_make, fake_state_process_t * const state_process) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
data_make->setting->state.status = F_none;
#ifndef _di_fake_make_operate_process_type_copy_
void fake_make_operate_process_type_copy(fake_make_data_t * const data_make, const bool clone) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
const f_array_length_t total = data_make->cache_arguments.used - 1;
f_string_static_t destination = f_string_static_t_initialize;
}
else {
recurse.verbose = fake_print_verbose_copy;
- macro_f_mode_t_set_default_umask(recurse.mode, data_make->main->umask);
+ macro_f_mode_t_set_default_umask(recurse.mode, data_make->program->umask);
}
bool existing = F_true;
data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[1]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_path_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_path_e);
data_make->setting->state.status = F_status_set_error(F_failure);
+ f_directory_recurse_delete(&recurse);
+
return;
}
data_make->setting->state.status = f_file_name_base(data_make->cache_arguments.array[i], &data_make->cache_path);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_name_base), data_make->cache_arguments.array[i], f_file_operation_process_s, fll_error_file_type_path_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_name_base), data_make->cache_arguments.array[i], f_file_operation_process_s, fll_error_file_type_path_e);
data_make->setting->state.status = F_status_set_error(F_failure);
+ f_directory_recurse_delete(&recurse);
+
return;
}
if (F_status_is_error(recurse.state.status)) {
data_make->setting->state.status = recurse.state.status;
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(fl_directory_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(fl_directory_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e);
data_make->setting->state.status = F_status_set_error(F_failure);
}
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, clone ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, clone ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
break;
}
- fake_make_print_verbose_operate_copy(data_make->setting, data_make->main->message, clone, data_make->cache_arguments.array[i], destination);
+ fake_make_print_verbose_operate_copy(data_make->setting, data_make->program->message, clone, data_make->cache_arguments.array[i], destination);
}
else if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[i], f_file_operation_identify_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[i], f_file_operation_identify_s, fll_error_file_type_directory_e);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_process_type_define_
void fake_make_operate_process_type_define(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used > 1) {
data_make->setting->state.status = f_environment_set(data_make->cache_arguments.array[0], data_make->cache_arguments.array[1], F_true);
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_environment_set));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_environment_set));
}
else {
- fake_make_print_verbose_operate_define(data_make->setting, data_make->main->message, data_make->cache_arguments.array[0]);
+ fake_make_print_verbose_operate_define(data_make->setting, data_make->program->message, data_make->cache_arguments.array[0]);
data_make->setting->state.status = F_none;
}
#ifndef _di_fake_make_operate_process_type_deletes_
void fake_make_operate_process_type_deletes(fake_make_data_t * const data_make, const bool all) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
const int recursion_max = all ? F_directory_max_descriptors_d : 0;
struct stat file_stat;
if (F_status_is_error(data_make->setting->state.status)) {
if (F_status_set_fine(data_make->setting->state.status) == F_file_found_not) {
- fake_make_print_warning_file_not_found(data_make->setting, data_make->main->warning, data_make->cache_arguments.array[i]);
+ fake_make_print_warning_file_not_found(data_make->setting, data_make->program->warning, data_make->cache_arguments.array[i]);
data_make->setting->state.status = F_none;
}
else {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stat), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_stat), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
}
}
else if (macro_f_file_type_is_directory(file_stat.st_mode)) {
- if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ if (data_make->program->error.verbosity >= f_console_verbosity_verbose_e) {
data_make->setting->state.status = f_directory_remove_custom(data_make->cache_arguments.array[i], recursion_max, F_false, fake_clean_remove_recursively_verbosely);
}
else {
}
if (F_status_set_fine(data_make->setting->state.status) == F_file_found_not) {
- fake_make_print_verbose_operate_file_not_found(data_make->setting, data_make->main->message, F_true, data_make->cache_arguments.array[i]);
+ fake_make_print_verbose_operate_file_not_found(data_make->setting, data_make->program->message, F_true, data_make->cache_arguments.array[i]);
data_make->setting->state.status = F_none;
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_remove), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_directory_remove), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_directory_e);
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_file_remove(data_make->cache_arguments.array[i]);
if (F_status_set_fine(data_make->setting->state.status) == F_file_found_not) {
- if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) {
- fake_make_print_verbose_operate_file_not_found(data_make->setting, data_make->main->message, F_false, data_make->cache_arguments.array[i]);
+ if (data_make->program->error.verbosity >= f_console_verbosity_verbose_e) {
+ fake_make_print_verbose_operate_file_not_found(data_make->setting, data_make->program->message, F_false, data_make->cache_arguments.array[i]);
}
data_make->setting->state.status = F_none;
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_remove), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_remove), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
}
}
- fake_make_print_verbose_operate_delete(data_make->setting, data_make->main->message, data_make->cache_arguments.array[i]);
+ fake_make_print_verbose_operate_delete(data_make->setting, data_make->program->message, data_make->cache_arguments.array[i]);
} // for
data_make->setting->state.status = F_none;
#ifndef _di_fake_make_operate_process_type_exit_
void fake_make_operate_process_type_exit(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
data_make->setting->state.status = F_none;
data_make->setting_make.fail = fake_make_operation_fail_exit_e;
data_make->error.prefix = fl_print_error_s;
data_make->error.suffix = f_string_empty_s;
- data_make->error.context = data_make->main->context.set.error;
- data_make->error.notable = data_make->main->context.set.notable;
- data_make->main->error.to.stream = F_type_error_d;
- data_make->main->error.to.id = F_type_descriptor_error_d;
- data_make->error.set = &data_make->main->context.set;
+ data_make->error.context = data_make->program->context.set.error;
+ data_make->error.notable = data_make->program->context.set.notable;
+ data_make->program->error.to.stream = F_type_error_d;
+ data_make->program->error.to.id = F_type_descriptor_error_d;
+ data_make->error.set = &data_make->program->context.set;
}
else {
data_make->setting->state.status = F_none;
return;
}
- fake_make_print_verbose_operate_exiting_as(data_make->setting, data_make->main->message, data_make->cache_arguments);
+ fake_make_print_verbose_operate_exiting_as(data_make->setting, data_make->program->message, data_make->cache_arguments);
}
#endif // _di_fake_make_operate_process_type_exit_
#ifndef _di_fake_make_operate_process_type_fail_
void fake_make_operate_process_type_fail(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (fl_string_dynamic_compare(fake_make_operation_argument_exit_s, data_make->cache_arguments.array[0]) == F_equal_to) {
data_make->setting_make.fail = fake_make_operation_fail_exit_e;
data_make->error.prefix = fl_print_error_s;
data_make->error.suffix = f_string_empty_s;
- data_make->error.context = data_make->main->context.set.error;
- data_make->error.notable = data_make->main->context.set.notable;
- data_make->main->error.to.stream = F_type_error_d;
- data_make->main->error.to.id = F_type_descriptor_error_d;
- data_make->error.set = &data_make->main->context.set;
+ data_make->error.context = data_make->program->context.set.error;
+ data_make->error.notable = data_make->program->context.set.notable;
+ data_make->program->error.to.stream = F_type_error_d;
+ data_make->program->error.to.id = F_type_descriptor_error_d;
+ data_make->error.set = &data_make->program->context.set;
}
else if (fl_string_dynamic_compare(fake_make_operation_argument_warn_s, data_make->cache_arguments.array[0]) == F_equal_to) {
data_make->setting_make.fail = fake_make_operation_fail_warn_e;
data_make->error.prefix = fl_print_warning_s;
data_make->error.suffix = f_string_empty_s;
- data_make->error.context = data_make->main->context.set.warning;
- data_make->error.notable = data_make->main->context.set.notable;
- data_make->main->error.to.stream = F_type_output_d;
- data_make->main->error.to.id = F_type_descriptor_output_d;
- data_make->error.set = &data_make->main->context.set;
+ data_make->error.context = data_make->program->context.set.warning;
+ data_make->error.notable = data_make->program->context.set.notable;
+ data_make->program->error.to.stream = F_type_output_d;
+ data_make->program->error.to.id = F_type_descriptor_output_d;
+ data_make->error.set = &data_make->program->context.set;
}
else {
data_make->setting_make.fail = fake_make_operation_fail_ignore_e;
- data_make->main->error.to.stream = 0;
- data_make->main->error.to.id = -1;
+ data_make->program->error.to.stream = 0;
+ data_make->program->error.to.id = -1;
}
- fake_make_print_verbose_operate_set_failure_state(data_make->setting, data_make->main->message, data_make->setting_make.fail);
+ fake_make_print_verbose_operate_set_failure_state(data_make->setting, data_make->program->message, data_make->setting_make.fail);
}
#endif // _di_fake_make_operate_process_type_fail_
#ifndef _di_fake_make_operate_process_type_groups_
void fake_make_operate_process_type_groups(fake_make_data_t * const data_make, const bool all) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
gid_t id = 0;
bool dereference = F_true;
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, all ? macro_fake_f(fll_file_role_change_all) : macro_fake_f(f_file_role_change), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, all ? macro_fake_f(fll_file_role_change_all) : macro_fake_f(f_file_role_change), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
return;
}
- fake_make_print_verbose_operate_set_role(data_make->setting, data_make->main->message, all ? 0x1 : 0x0, data_make->cache_arguments.array[i], (f_number_unsigned_t) id);
+ fake_make_print_verbose_operate_set_role(data_make->setting, data_make->program->message, all ? 0x1 : 0x0, data_make->cache_arguments.array[i], (f_number_unsigned_t) id);
} // for
data_make->setting->state.status = F_none;
#ifndef _di_fake_make_operate_process_type_if_define_
void fake_make_operate_process_type_if_define(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
state_process->condition_result = fake_condition_result_true_e;
#ifndef _di_fake_make_operate_process_type_if_exist_
void fake_make_operate_process_type_if_exist(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
f_array_length_t i = if_not ? 2 : 1;
bool dereference = F_true;
if (F_status_is_error(data_make->setting->state.status)) {
state_process->condition_result = fake_condition_result_error_e;
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_exists), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_exists), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_process_type_if_is_
void fake_make_operate_process_type_if_is(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
// block = 0x1 (0000 0001) link = 0x10 (0001 0000)
// character = 0x2 (0000 0010) regular = 0x20 (0010 0000)
if (F_status_is_error(data_make->setting->state.status)) {
state_process->condition_result = fake_condition_result_error_e;
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_get_type_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_get_type_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_process_type_if_greater_if_lesser_
void fake_make_operate_process_type_if_greater_if_lesser(fake_make_data_t * const data_make, fake_state_process_t *state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
f_string_range_t range = f_string_range_t_initialize;
f_number_unsigned_t number_left = 0;
state_process->condition_result = fake_condition_result_error_e;
if ((i == 1 && number_left > F_number_t_size_unsigned_d) || (i > 1 && number_right > F_number_t_size_unsigned_d)) {
- fake_make_print_error_out_of_range_number(data_make->setting, data_make->main->error, data_make->cache_arguments.array[i], F_number_t_size_unsigned_d, F_number_t_size_unsigned_d);
+ fake_make_print_error_out_of_range_number(data_make->setting, data_make->program->error, data_make->cache_arguments.array[i], F_number_t_size_unsigned_d, F_number_t_size_unsigned_d);
}
else {
- fake_make_print_error_unsupported_number(data_make->setting, data_make->main->error, data_make->cache_arguments.array[i]);
+ fake_make_print_error_unsupported_number(data_make->setting, data_make->program->error, data_make->cache_arguments.array[i]);
}
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_process_type_if_group_
void fake_make_operate_process_type_if_group(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
uid_t id = 0;
f_array_length_t i = if_not ? 2 : 1;
if (F_status_is_error(data_make->setting->state.status)) {
state_process->condition_result = fake_condition_result_error_e;
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_get_id));
data_make->setting->state.status = F_status_set_error(F_failure);
if (F_status_is_error(data_make->setting->state.status)) {
state_process->condition_result = fake_condition_result_error_e;
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_group_read), data_make->cache_arguments.array[i], f_file_operation_get_group_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_group_read), data_make->cache_arguments.array[i], f_file_operation_get_group_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_process_type_if_mode_
void fake_make_operate_process_type_if_mode(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
f_file_mode_t mode_rule = 0;
mode_t mode_match = 0;
if (F_status_is_error(data_make->setting->state.status)) {
state_process->condition_result = fake_condition_result_error_e;
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id_mode));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_get_id_mode));
data_make->setting->state.status = F_status_set_error(F_failure);
if (F_status_is_error(data_make->setting->state.status)) {
state_process->condition_result = fake_condition_result_error_e;
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_to_mode));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_file_mode_to_mode));
data_make->setting->state.status = F_status_set_error(F_failure);
if (F_status_is_error(data_make->setting->state.status)) {
state_process->condition_result = fake_condition_result_error_e;
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_get_mode_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_get_mode_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_process_type_if_owner_
void fake_make_operate_process_type_if_owner(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
uid_t id = 0;
f_array_length_t i = if_not ? 2 : 1;
if (F_status_is_error(data_make->setting->state.status)) {
state_process->condition_result = fake_condition_result_error_e;
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_get_id));
data_make->setting->state.status = F_status_set_error(F_failure);
if (F_status_is_error(data_make->setting->state.status)) {
state_process->condition_result = fake_condition_result_error_e;
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_owner_read), data_make->cache_arguments.array[i], f_file_operation_get_owner_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_owner_read), data_make->cache_arguments.array[i], f_file_operation_get_owner_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_process_type_if_parameter_
void fake_make_operate_process_type_if_parameter(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
const f_string_static_t reserved_name[] = {
fake_make_parameter_variable_build_s,
data_make->setting->sources.used,
F_true,
data_make->setting->work.used,
- data_make->main->parameters.array[fake_parameter_build_e].result & f_console_result_value_e,
- (data_make->main->parameters.array[fake_parameter_light_e].result & f_console_result_found_e) || (data_make->main->parameters.array[fake_parameter_dark_e].result & f_console_result_found_e) || (data_make->main->parameters.array[fake_parameter_no_color_e].result & f_console_result_found_e),
- data_make->main->parameters.array[fake_parameter_data_e].result & f_console_result_value_e,
- data_make->main->parameters.array[fake_parameter_define_e].result & f_console_result_value_e,
- data_make->main->parameters.array[fake_parameter_fakefile_e].result & f_console_result_value_e,
- data_make->main->parameters.array[fake_parameter_mode_e].result & f_console_result_value_e,
- data_make->main->parameters.array[fake_parameter_process_e].result & f_console_result_value_e,
- data_make->main->parameters.array[fake_parameter_settings_e].result & f_console_result_value_e,
- data_make->main->parameters.array[fake_parameter_sources_e].result & f_console_result_value_e,
- (data_make->main->parameters.array[fake_parameter_verbosity_quiet_e].result & f_console_result_found_e) || (data_make->main->parameters.array[fake_parameter_verbosity_normal_e].result & f_console_result_found_e) || (data_make->main->parameters.array[fake_parameter_verbosity_verbose_e].result & f_console_result_found_e) || (data_make->main->parameters.array[fake_parameter_verbosity_debug_e].result & f_console_result_found_e),
- data_make->main->parameters.array[fake_parameter_work_e].result & f_console_result_value_e,
+ data_make->program->parameters.array[fake_parameter_build_e].result & f_console_result_value_e,
+ (data_make->program->parameters.array[fake_parameter_light_e].result & f_console_result_found_e) || (data_make->program->parameters.array[fake_parameter_dark_e].result & f_console_result_found_e) || (data_make->program->parameters.array[fake_parameter_no_color_e].result & f_console_result_found_e),
+ data_make->program->parameters.array[fake_parameter_data_e].result & f_console_result_value_e,
+ data_make->program->parameters.array[fake_parameter_define_e].result & f_console_result_value_e,
+ data_make->program->parameters.array[fake_parameter_fakefile_e].result & f_console_result_value_e,
+ data_make->program->parameters.array[fake_parameter_mode_e].result & f_console_result_value_e,
+ data_make->program->parameters.array[fake_parameter_process_e].result & f_console_result_value_e,
+ data_make->program->parameters.array[fake_parameter_settings_e].result & f_console_result_value_e,
+ data_make->program->parameters.array[fake_parameter_sources_e].result & f_console_result_value_e,
+ (data_make->program->parameters.array[fake_parameter_verbosity_quiet_e].result & f_console_result_found_e) || (data_make->program->parameters.array[fake_parameter_verbosity_normal_e].result & f_console_result_found_e) || (data_make->program->parameters.array[fake_parameter_verbosity_verbose_e].result & f_console_result_found_e) || (data_make->program->parameters.array[fake_parameter_verbosity_debug_e].result & f_console_result_found_e),
+ data_make->program->parameters.array[fake_parameter_work_e].result & f_console_result_value_e,
data_make->parameter_value.build.used,
data_make->parameter_value.color.used,
data_make->parameter_value.data.used,
const int result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_indexer, data_make->cache_arguments);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_execute));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_execute));
}
if (data_make->setting->state.status == F_child) return result;
#ifndef _di_fake_make_operate_process_type_link_
void fake_make_operate_process_type_link(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
// 0x1 = force, 0x2 = strict.
uint8_t flag = 0;
data_make->setting->state.status = f_directory_remove(data_make->cache_arguments.array[data_make->cache_arguments.used - 1], F_directory_max_descriptors_d, F_false);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_remove), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_directory_remove), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_directory_e);
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_file_remove(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_remove), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_remove), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_file_link(data_make->cache_arguments.array[0], data_make->cache_arguments.array[data_make->cache_arguments.used - 1]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_link), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_link_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_link), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_link_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
return;
}
- fake_make_print_verbose_operate_symbolic_link(data_make->setting, data_make->main->message, data_make->cache_arguments.array[data_make->cache_arguments.used - 1], data_make->cache_arguments.array[0]);
+ fake_make_print_verbose_operate_symbolic_link(data_make->setting, data_make->program->message, data_make->cache_arguments.array[data_make->cache_arguments.used - 1], data_make->cache_arguments.array[0]);
data_make->setting->state.status = F_none;
}
#ifndef _di_fake_make_operate_process_type_modes_
void fake_make_operate_process_type_modes(fake_make_data_t * const data_make, const bool all) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
data_make->setting->state.status = F_none;
fake_make_get_id_mode(data_make, data_make->cache_arguments.array[0], &mode_rule, &replace);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id_mode));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_get_id_mode));
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_file_mode_read(data_make->cache_arguments.array[i], F_true, &mode_file);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_file_mode_determine(mode_file, mode_rule, replace, macro_f_file_type_is_directory(mode_file), &mode);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_determine), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_mode_determine), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, all ? macro_fake_f(fll_file_mode_set_all) : macro_fake_f(f_file_mode_set), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, all ? macro_fake_f(fll_file_mode_set_all) : macro_fake_f(f_file_mode_set), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
return;
}
- fake_make_print_verbose_operate_set_mode(data_make->setting, data_make->main->message, data_make->cache_arguments.array[i], mode);
+ fake_make_print_verbose_operate_set_mode(data_make->setting, data_make->program->message, data_make->cache_arguments.array[i], mode);
} // for
data_make->setting->state.status = F_none;
#ifndef _di_fake_make_operate_process_type_move_
void fake_make_operate_process_type_move(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
const f_array_length_t total = data_make->cache_arguments.used -1;
f_directory_recurse_t recurse = f_directory_recurse_t_initialize;
f_string_static_t destination = f_string_static_t_initialize;
- if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ if (data_make->program->error.verbosity >= f_console_verbosity_verbose_e) {
recurse.verbose = fake_print_verbose_move;
}
data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[1]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_directory_e);
data_make->setting->state.status = F_status_set_error(F_failure);
+ f_directory_recurse_delete(&recurse);
+
return;
}
data_make->setting->state.status = f_file_name_base(data_make->cache_arguments.array[i], &data_make->cache_path);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_name_base), data_make->cache_arguments.array[i], f_file_operation_process_s, fll_error_file_type_path_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_name_base), data_make->cache_arguments.array[i], f_file_operation_process_s, fll_error_file_type_path_e);
data_make->setting->state.status = F_status_set_error(F_failure);
+ f_directory_recurse_delete(&recurse);
+
return;
}
if (F_status_is_error(recurse.state.status)) {
data_make->setting->state.status = recurse.state.status;
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(fll_file_move), data_make->cache_arguments.array[i], f_file_operation_move_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(fll_file_move), data_make->cache_arguments.array[i], f_file_operation_move_s, fll_error_file_type_directory_e);
data_make->setting->state.status = F_status_set_error(F_failure);
+ f_directory_recurse_delete(&recurse);
+
return;
}
} // for
+ f_directory_recurse_delete(&recurse);
+
data_make->setting->state.status = F_none;
}
#endif // _di_fake_make_operate_process_type_move_
#ifndef _di_fake_make_operate_process_type_owners_
void fake_make_operate_process_type_owners(fake_make_data_t * const data_make, const bool all) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
uid_t id = 0;
bool dereference = F_true;
id = (uid_t) fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[i++]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_get_id));
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, all ? macro_fake_f(fll_file_role_change_all) : macro_fake_f(f_file_role_change), data_make->cache_arguments.array[i], f_file_operation_change_owner_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, all ? macro_fake_f(fll_file_role_change_all) : macro_fake_f(f_file_role_change), data_make->cache_arguments.array[i], f_file_operation_change_owner_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
return;
}
- fake_make_print_verbose_operate_set_role(data_make->setting, data_make->main->message, all ? 0x3 : 0x2, data_make->cache_arguments.array[i], (f_number_unsigned_t) id);
+ fake_make_print_verbose_operate_set_role(data_make->setting, data_make->program->message, all ? 0x3 : 0x2, data_make->cache_arguments.array[i], (f_number_unsigned_t) id);
} // for
data_make->setting->state.status = F_none;
#ifndef _di_fake_make_operate_process_type_parameter_
void fake_make_operate_process_type_parameter(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
bool found = F_false;
f_array_length_t i = 0;
data_make->setting->state.status = f_string_dynamic_resize(0, &data_make->setting_make.parameter.array[i].value.array[j]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_resize));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_resize));
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_string_dynamics_resize(0, &data_make->setting_make.parameter.array[i].value);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_resize));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_resize));
data_make->setting->state.status = F_status_set_error(F_failure);
}
data_make->setting->state.status = f_string_map_multis_resize(fake_allocation_small_d, &data_make->setting_make.parameter);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_map_multis_resize));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_map_multis_resize));
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_string_dynamic_append_nulless(data_make->cache_arguments.array[0], &data_make->setting_make.parameter.array[data_make->setting_make.parameter.used].name);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_string_dynamics_resize(data_make->cache_arguments.used - 1, &data_make->setting_make.parameter.array[i].value);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_resize));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_resize));
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_string_dynamic_append_nulless(data_make->cache_arguments.array[j + 1], &data_make->setting_make.parameter.array[i].value.array[j]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_process_type_pop_
void fake_make_operate_process_type_pop(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
f_string_dynamic_t *argument = &data_make->path.stack.array[data_make->path.stack.used - 1];
return;
}
- if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ if (data_make->program->error.verbosity >= f_console_verbosity_verbose_e) {
fake_make_path_relative(data_make, *argument);
// The created relative path is for verbosity purposes and as such its failure to be processed should not be treated as a failure of the function.
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_path_relative));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_path_relative));
- fake_make_print_verbose_operate_set_path(data_make->setting, data_make->main->message, *argument);
+ fake_make_print_verbose_operate_set_path(data_make->setting, data_make->program->message, *argument);
data_make->setting->state.status = F_status_set_error(F_failure);
return;
}
- fake_make_print_verbose_operate_set_path(data_make->setting, data_make->main->message, data_make->cache_path);
+ fake_make_print_verbose_operate_set_path(data_make->setting, data_make->program->message, data_make->cache_path);
}
data_make->setting->state.status = F_none;
#ifndef _di_fake_make_operate_process_type_print_
void fake_make_operate_process_type_print(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
data_make->cache_1.used = 0;
data_make->setting->state.status = f_string_dynamic_increase_by(total, &data_make->cache_1);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_file_stream_open));
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_string_dynamic_append(f_string_space_s, &data_make->cache_1);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append));
data_make->setting->state.status = F_status_set_error(F_failure);
fake_make_operate_process_buffer_escape(data_make, data_make->cache_arguments.array[i], &data_make->cache_1);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_file_stream_open));
data_make->setting->state.status = F_status_set_error(F_failure);
} // for
}
- f_file_stream_lock(data_make->main->message.to);
+ f_file_stream_lock(data_make->program->message.to);
- fll_print_dynamic_raw(data_make->cache_1, data_make->main->message.to);
- fll_print_dynamic_raw(f_string_eol_s, data_make->main->message.to);
+ fll_print_dynamic_raw(data_make->cache_1, data_make->program->message.to);
+ fll_print_dynamic_raw(f_string_eol_s, data_make->program->message.to);
- f_file_stream_unlock(data_make->main->message.to);
+ f_file_stream_unlock(data_make->program->message.to);
data_make->setting->state.status = F_none;
}
#ifndef _di_fake_make_operate_process_type_skeleton_
void fake_make_operate_process_type_skeleton(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
fake_skeleton_operate(data_make->data);
if (F_status_set_fine(data_make->setting->state.status) == F_interrupt) return;
#ifndef _di_fake_make_operate_process_type_to_
void fake_make_operate_process_type_to(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[0]);
return;
}
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamics_increase_by));
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_string_dynamic_append_nulless(data_make->cache_path, &data_make->path.stack.array[data_make->path.stack.used]);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_nulless));
data_make->setting->state.status = F_status_set_error(F_failure);
return;
}
- if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ if (data_make->program->error.verbosity >= f_console_verbosity_verbose_e) {
fake_make_path_relative(data_make, data_make->path.stack.array[data_make->path.stack.used]);
// The created relative path is for verbosity purposes and as such its failure to be processed should not be treated as a failure of the function.
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_path_relative));
+ fake_print_error(&data_make->program->error, macro_fake_f(fake_make_path_relative));
- fake_make_print_verbose_operate_set_path(data_make->setting, data_make->main->message, data_make->path.stack.array[data_make->path.stack.used]);
+ fake_make_print_verbose_operate_set_path(data_make->setting, data_make->program->message, data_make->path.stack.array[data_make->path.stack.used]);
}
else {
- fake_make_print_verbose_operate_set_path(data_make->setting, data_make->main->message, data_make->cache_path);
+ fake_make_print_verbose_operate_set_path(data_make->setting, data_make->program->message, data_make->cache_path);
}
}
#ifndef _di_fake_make_operate_process_type_top_
void fake_make_operate_process_type_top(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
{
data_make->setting->state.status = f_path_change_at(data_make->path.top.id);
}
}
- fake_make_print_verbose_operate_set_path(data_make->setting, data_make->main->message, f_string_empty_s);
+ fake_make_print_verbose_operate_set_path(data_make->setting, data_make->program->message, f_string_empty_s);
// Clear stack, except for the project root.
for (f_array_length_t i = 1; i < data_make->path.stack.used; ++i) {
#ifndef _di_fake_make_operate_process_type_touch_
void fake_make_operate_process_type_touch(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
f_mode_t mode = f_mode_t_initialize;
- macro_f_mode_t_set_default_umask(mode, data_make->main->umask);
+ macro_f_mode_t_set_default_umask(mode, data_make->program->umask);
for (f_array_length_t i = 1; i < data_make->cache_arguments.used; ++i) {
if (F_status_is_error(data_make->setting->state.status)) {
if (F_status_is_error_not(fl_path_canonical(data_make->cache_arguments.array[i], &data_make->cache_path))) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_touch), data_make->cache_path, f_file_operation_touch_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_touch), data_make->cache_path, f_file_operation_touch_s, fll_error_file_type_file_e);
}
else {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_touch), data_make->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_touch), data_make->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_file_e);
}
data_make->setting->state.status = F_status_set_error(F_failure);
if (F_status_is_error(data_make->setting->state.status)) {
if (F_status_is_error_not(fl_path_canonical(data_make->cache_arguments.array[i], &data_make->cache_path))) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_touch), data_make->cache_path, f_file_operation_touch_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_directory_touch), data_make->cache_path, f_file_operation_touch_s, fll_error_file_type_directory_e);
}
else {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_touch), data_make->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_directory_touch), data_make->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_directory_e);
}
data_make->setting->state.status = F_status_set_error(F_failure);
}
}
- fake_make_print_verbose_operate_touch(data_make->setting, data_make->main->message, data_make->cache_arguments.array[i]);
+ fake_make_print_verbose_operate_touch(data_make->setting, data_make->program->message, data_make->cache_arguments.array[i]);
} // for
data_make->setting->state.status = F_none;
#ifndef _di_fake_make_operate_process_type_write_
void fake_make_operate_process_type_write(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
f_file_t file = f_file_t_initialize;
if (F_status_is_error(data_make->setting->state.status)) {
if (F_status_is_error_not(fl_path_canonical(data_make->cache_arguments.array[0], &data_make->cache_path))) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open), data_make->cache_path, f_file_operation_open_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_stream_open), data_make->cache_path, f_file_operation_open_s, fll_error_file_type_file_e);
}
else {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open), data_make->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_stream_open), data_make->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e);
}
data_make->setting->state.status = F_status_set_error(F_failure);
if (F_status_is_error(data_make->setting->state.status)) {
if (F_status_is_error_not(fl_path_canonical(data_make->cache_arguments.array[0], &data_make->cache_path))) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open), data_make->cache_path, f_file_operation_open_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_stream_open), data_make->cache_path, f_file_operation_open_s, fll_error_file_type_file_e);
}
else {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open), data_make->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_stream_open), data_make->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e);
}
}
}
if (F_status_is_error(data_make->setting->state.status)) {
if (F_status_is_error_not(fl_path_canonical(data_make->cache_arguments.array[0], &data_make->cache_path))) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_process_buffer_escape), data_make->cache_path, f_file_operation_write_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(fake_make_operate_process_buffer_escape), data_make->cache_path, f_file_operation_write_s, fll_error_file_type_file_e);
}
else {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_process_buffer_escape), data_make->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(fake_make_operate_process_buffer_escape), data_make->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e);
}
break;
if (F_status_is_error(data_make->setting->state.status)) {
if (F_status_is_error_not(fl_path_canonical(data_make->cache_arguments.array[0], &data_make->cache_path))) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_write), data_make->cache_path, f_file_operation_write_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_stream_write), data_make->cache_path, f_file_operation_write_s, fll_error_file_type_file_e);
}
else {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_write), data_make->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_stream_write), data_make->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e);
}
break;
data_make->setting->state.status = f_file_stream_write(file, f_string_ascii_space_s, 0);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_write));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_file_stream_write));
break;
}
#ifndef _di_fake_make_operate_validate_
void fake_make_operate_validate(fake_make_data_t * const data_make, const f_string_range_t section_name, fake_state_process_t * const state_process, f_array_lengths_t * const section_stack) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (F_status_is_error(data_make->setting->state.status)) return;
if (!section_stack) {
#ifndef _di_fake_make_operate_validate_type_break_
void fake_make_operate_validate_type_break(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used > 1) {
- fake_print_error_too_many_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_too_many_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
if (data_make->cache_arguments.used) {
if (fl_string_dynamic_compare(fake_make_operation_argument_success_s, data_make->cache_arguments.array[0]) == F_equal_to_not) {
if (fl_string_dynamic_compare(fake_make_operation_argument_failure_s, data_make->cache_arguments.array[0]) == F_equal_to_not) {
- fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, fake_make_operation_break_s, data_make->cache_arguments.array[0]);
+ fake_make_print_error_unsupported_type(data_make->setting, data_make->program->error, fake_make_operation_break_s, data_make->cache_arguments.array[0]);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_validate_type_build_
void fake_make_operate_validate_type_build(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used) {
if (data_make->cache_arguments.array[0].used) {
data_make->setting->state.status = f_file_is(path_file, F_file_type_regular_d, F_false);
if (data_make->setting->state.status == F_file_found_not || F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file_simple(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), path_file, f_file_operation_find_s, fll_error_file_type_file_e);
+ fake_print_error_file_simple(data_make->setting, data_make->program->error, macro_fake_f(f_file_is), path_file, f_file_operation_find_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (!data_make->setting->state.status) {
- fake_make_print_error_file_type(data_make->setting, data_make->main->message, f_file_type_name_regular_s, path_file);
+ fake_make_print_error_file_type(data_make->setting, data_make->program->message, f_file_type_name_regular_s, path_file);
data_make->setting->state.status = F_status_set_error(F_failure);
}
}
else {
- fake_make_print_error_file_name_empty(data_make->setting, data_make->main->error);
+ fake_make_print_error_file_name_empty(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_validate_type_clean_top_skeleton_
void fake_make_operate_validate_type_clean_top_skeleton(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used) {
- fake_print_error_too_many_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_too_many_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_clone_
void fake_make_operate_validate_type_clone(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used > 1) {
f_status_t status = F_none;
for (f_array_length_t i = 0; i < data_make->cache_arguments.used - 1; ++i) {
if (f_file_exists(data_make->cache_arguments.array[i], F_true) != F_true) {
- fake_print_error_file_simple(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
+ fake_print_error_file_simple(data_make->setting, data_make->program->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
status = F_status_set_error(F_failure);
}
data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]);
if (data_make->setting->state.status == F_false || data_make->setting->state.status == F_file_found_not) {
- fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "last", data_make->cache_arguments.array[data_make->cache_arguments.used - 1]);
+ fake_make_print_error_content_not_directory(data_make->setting, data_make->program->error, "last", data_make->cache_arguments.array[data_make->cache_arguments.used - 1]);
status = F_status_set_error(F_failure);
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_find_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_find_s, fll_error_file_type_directory_e);
status = F_status_set_error(F_failure);
}
data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[1]);
if (data_make->setting->state.status == F_false) {
- fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "second", data_make->cache_arguments.array[1]);
+ fake_make_print_error_content_not_directory(data_make->setting, data_make->program->error, "second", data_make->cache_arguments.array[1]);
status = F_status_set_error(F_failure);
}
return;
}
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_compile_
void fake_make_operate_validate_type_compile(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (!data_make->cache_arguments.used) {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
else if (data_make->setting_build.build_compiler.used) {
- fake_make_print_error_compiler_not_specified(data_make->setting, data_make->main->error, fake_make_operation_compile_s);
+ fake_make_print_error_compiler_not_specified(data_make->setting, data_make->program->error, fake_make_operation_compile_s);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_condition_
void fake_make_operate_validate_type_condition(fake_make_data_t * const data_make, fake_state_process_t * const state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
if (state_process->operation == fake_make_operation_type_if_e) {
if (state_process->operation_previous == fake_make_operation_type_if_e) {
- fake_make_print_error_after_condition_must_not(data_make->setting, data_make->main->error);
+ fake_make_print_error_after_condition_must_not(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
else {
if (!(state_process->operation_previous == fake_make_operation_type_if_e || state_process->operation_previous == fake_make_operation_type_and_e || state_process->operation_previous == fake_make_operation_type_or_e)) {
- fake_make_print_error_after_condition_may_only(data_make->setting, data_make->main->error);
+ fake_make_print_error_after_condition_may_only(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
} // for
if (i == 23) {
- fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, if_and_or, data_make->cache_arguments.array[k]);
+ fake_make_print_error_unsupported_type(data_make->setting, data_make->program->error, if_and_or, data_make->cache_arguments.array[k]);
data_make->setting->state.status = F_status_set_error(F_failure);
// Identify and convert to the appropriate if not condition.
if (state_process->condition == fake_make_operation_if_type_if_not_e) {
if (data_make->cache_arguments.used < 1 + k) {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
} // for
if (j == 7) {
- fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, if_and_or, data_make->cache_arguments.array[k]);
+ fake_make_print_error_unsupported_type(data_make->setting, data_make->program->error, if_and_or, data_make->cache_arguments.array[k]);
data_make->setting->state.status = F_status_set_error(F_failure);
// The success and failure operations minimum is also the maximum.
if (data_make->cache_arguments.used > if_type_minimum[i]) {
- fake_print_error_too_many_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_too_many_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (state_process->condition == fake_make_operation_if_type_if_equal_e || state_process->condition == fake_make_operation_if_type_if_equal_not_e) {
if (data_make->cache_arguments.used < 2 + k) {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (fl_string_dynamic_compare(fake_make_operation_argument_has_s, data_make->cache_arguments.array[k]) == F_equal_to_not) {
if (j == 6) {
- fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, fake_make_operation_mode_s, data_make->cache_arguments.array[k]);
+ fake_make_print_error_unsupported_type(data_make->setting, data_make->program->error, fake_make_operation_mode_s, data_make->cache_arguments.array[k]);
}
else {
f_char_t message[4 + fake_make_operation_mode_s.used + 1];
f_string_static_t message_s = macro_f_string_static_t_initialize(message, 0, 4 + fake_make_operation_mode_s.used);
- fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, message_s, data_make->cache_arguments.array[k]);
+ fake_make_print_error_unsupported_type(data_make->setting, data_make->program->error, message_s, data_make->cache_arguments.array[k]);
}
data_make->setting->state.status = F_status_set_error(F_failure);
type_file |= 0x40;
}
else {
- fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, f_file_type_name_file_s, data_make->cache_arguments.array[i]);
+ fake_make_print_error_unsupported_type(data_make->setting, data_make->program->error, f_file_type_name_file_s, data_make->cache_arguments.array[i]);
type_file |= 0x80;
}
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_exists), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_exists), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
status = F_status_set_error(F_failure);
}
if (state_process->condition == fake_make_operation_if_type_if_greater_e || state_process->condition == fake_make_operation_if_type_if_greater_equal_e || state_process->condition == fake_make_operation_if_type_if_less_e || state_process->condition == fake_make_operation_if_type_if_less_equal_e) {
if (data_make->cache_arguments.used < 2 + k) {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
status = F_status_set_error(F_failure);
if (number > F_number_t_size_unsigned_d) {
- fake_make_print_error_out_of_range_number(data_make->setting, data_make->main->error, data_make->cache_arguments.array[i], F_number_t_size_unsigned_d, F_number_t_size_unsigned_d);
+ fake_make_print_error_out_of_range_number(data_make->setting, data_make->program->error, data_make->cache_arguments.array[i], F_number_t_size_unsigned_d, F_number_t_size_unsigned_d);
}
else {
- fake_make_print_error_unsupported_number(data_make->setting, data_make->main->error, data_make->cache_arguments.array[i]);
+ fake_make_print_error_unsupported_number(data_make->setting, data_make->program->error, data_make->cache_arguments.array[i]);
}
}
} // for
}
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_copy_
void fake_make_operate_validate_type_copy(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used > 1) {
f_status_t status = F_none;
for (i = 0; i < data_make->cache_arguments.used - 1; ++i) {
if (f_file_exists(data_make->cache_arguments.array[i], F_true) != F_true) {
- fake_print_error_file_simple(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
+ fake_print_error_file_simple(data_make->setting, data_make->program->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
status = F_status_set_error(F_failure);
}
data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]);
if (data_make->setting->state.status == F_false || data_make->setting->state.status == F_file_found_not) {
- fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "last", data_make->cache_arguments.array[data_make->cache_arguments.used - 1]);
+ fake_make_print_error_content_not_directory(data_make->setting, data_make->program->error, "last", data_make->cache_arguments.array[data_make->cache_arguments.used - 1]);
status = F_status_set_error(F_failure);
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e);
status = F_status_set_error(F_failure);
}
data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[1]);
if (data_make->setting->state.status == F_false) {
- fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "second", data_make->cache_arguments.array[1]);
+ fake_make_print_error_content_not_directory(data_make->setting, data_make->program->error, "second", data_make->cache_arguments.array[1]);
status = F_status_set_error(F_failure);
}
data_make->setting->state.status = status;
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_define_
void fake_make_operate_validate_type_define(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used) {
fake_make_operate_validate_define_name(data_make->cache_arguments.array[0]);
}
if (data_make->setting->state.status == F_none) {
- fake_make_print_error_define_name_empty(data_make->setting, data_make->main->error);
+ fake_make_print_error_define_name_empty(data_make->setting, data_make->program->error);
}
else {
- fake_make_print_error_define_invalid_character(data_make->setting, data_make->main->error, data_make->cache_arguments.array[0]);
+ fake_make_print_error_define_invalid_character(data_make->setting, data_make->program->error, data_make->cache_arguments.array[0]);
}
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
}
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_validate_type_delete_
void fake_make_operate_validate_type_delete(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used) {
f_status_t status = F_none;
data_make->setting->state.status = status;
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_else_
void fake_make_operate_validate_type_else(fake_make_data_t * const data_make, fake_state_process_t * const state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
if (state_process->operation_previous == fake_make_operation_type_else_e) {
- fake_make_print_error_after_condition_must_not(data_make->setting, data_make->main->error);
+ fake_make_print_error_after_condition_must_not(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (state_process->operation_previous == fake_make_operation_type_if_e || state_process->operation_previous == fake_make_operation_type_and_e || state_process->operation_previous == fake_make_operation_type_or_e) {
- fake_make_print_error_after_condition_must_not(data_make->setting, data_make->main->error);
+ fake_make_print_error_after_condition_must_not(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (!state_process->block) {
- fake_make_print_error_after_condition_no_preceding(data_make->setting, data_make->main->error);
+ fake_make_print_error_after_condition_no_preceding(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (data_make->cache_arguments.used) {
- fake_print_error_too_many_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_too_many_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_validate_type_exit_
void fake_make_operate_validate_type_exit(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used > 1) {
- fake_print_error_too_many_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_too_many_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
if (data_make->cache_arguments.used) {
if (fl_string_dynamic_compare(fake_make_operation_argument_success_s, data_make->cache_arguments.array[0]) == F_equal_to_not) {
if (fl_string_dynamic_compare(fake_make_operation_argument_failure_s, data_make->cache_arguments.array[0]) == F_equal_to_not) {
- fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, fake_make_operation_exit_s, data_make->cache_arguments.array[0]);
+ fake_make_print_error_unsupported_type(data_make->setting, data_make->program->error, fake_make_operation_exit_s, data_make->cache_arguments.array[0]);
data_make->setting->state.status = F_status_set_error(F_failure);
#ifndef _di_fake_make_operate_validate_type_fail_
void fake_make_operate_validate_type_fail(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used) {
if (fl_string_dynamic_compare(fake_make_operation_argument_exit_s, data_make->cache_arguments.array[0]) == F_equal_to_not) {
if (fl_string_dynamic_compare(fake_make_operation_argument_warn_s, data_make->cache_arguments.array[0]) == F_equal_to_not) {
if (fl_string_dynamic_compare(fake_make_operation_argument_ignore_s, data_make->cache_arguments.array[0]) == F_equal_to_not) {
- fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, fake_make_operation_fail_s, data_make->cache_arguments.array[0]);
+ fake_make_print_error_unsupported_type(data_make->setting, data_make->program->error, fake_make_operation_fail_s, data_make->cache_arguments.array[0]);
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = F_none;
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_index_
void fake_make_operate_validate_type_index(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (!data_make->cache_arguments.used) {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
else if (!data_make->setting_build.build_indexer.used) {
- fake_make_print_error_indexer_not_specified(data_make->setting, data_make->main->error, fake_make_operation_index_s);
+ fake_make_print_error_indexer_not_specified(data_make->setting, data_make->program->error, fake_make_operation_index_s);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_link_
void fake_make_operate_validate_type_link(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used > 4) {
- fake_print_error_too_many_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_too_many_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_file_name_directory(full, &data_make->cache_path);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_name_directory), full, f_file_operation_analyze_s, fll_error_file_type_path_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_name_directory), full, f_file_operation_analyze_s, fll_error_file_type_path_e);
status = F_status_set_error(F_failure);
}
data_make->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_path);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_assure));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append_assure));
status = F_status_set_error(F_failure);
}
data_make->setting->state.status = f_string_dynamic_append(data_make->cache_arguments.array[data_make->cache_arguments.used - 2], &data_make->cache_path);
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append));
+ fake_print_error(&data_make->program->error, macro_fake_f(f_string_dynamic_append));
status = F_status_set_error(F_failure);
}
}
}
else {
- fake_make_print_error_target_file_name_empty(data_make->setting, data_make->main->error);
+ fake_make_print_error_target_file_name_empty(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
data_make->setting->state.status = status;
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_move_
void fake_make_operate_validate_type_move(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used > 1) {
{
for (f_array_length_t i = 0; i < data_make->cache_arguments.used - 1; ++i) {
if (f_file_exists(data_make->cache_arguments.array[i], F_true) != F_true) {
- fake_print_error_file_simple(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
+ fake_print_error_file_simple(data_make->setting, data_make->program->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
status = F_status_set_error(F_failure);
}
data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]);
if (data_make->setting->state.status == F_false || data_make->setting->state.status == F_file_found_not) {
- fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "last", data_make->cache_arguments.array[data_make->cache_arguments.used - 1]);
+ fake_make_print_error_content_not_directory(data_make->setting, data_make->program->error, "last", data_make->cache_arguments.array[data_make->cache_arguments.used - 1]);
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (F_status_is_error(data_make->setting->state.status)) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e);
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[1]);
if (data_make->setting->state.status == F_false) {
- fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "second", data_make->cache_arguments.array[1]);
+ fake_make_print_error_content_not_directory(data_make->setting, data_make->program->error, "second", data_make->cache_arguments.array[1]);
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = F_none;
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_operate_
void fake_make_operate_validate_type_operate(fake_make_data_t * const data_make, f_array_lengths_t * const section_stack) {
- if (!data_make || !data_make->main || !data_make->setting || !section_stack) return;
+ if (!data_make || !data_make->program || !data_make->setting || !section_stack) return;
if (data_make->cache_arguments.used > 1) {
- fake_print_error_too_many_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_too_many_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
} // for
if (id_section == data_make->fakefile.used) {
- fake_make_print_error_operation_section_not_found(data_make->setting, data_make->main->error, data_make->cache_arguments.array[0]);
+ fake_make_print_error_operation_section_not_found(data_make->setting, data_make->program->error, data_make->cache_arguments.array[0]);
data_make->setting->state.status = F_status_set_error(F_failure);
for (f_array_length_t i = 0; i < section_stack->used; ++i) {
if (section_stack->array[i] == id_section) {
- fake_make_print_error_operation_recursion(data_make->setting, data_make->main->error, data_make->buffer, data_make->fakefile.array[id_section].name);
+ fake_make_print_error_operation_recursion(data_make->setting, data_make->program->error, data_make->buffer, data_make->fakefile.array[id_section].name);
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = F_none;
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_parameter_
void fake_make_operate_validate_type_parameter(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used) {
const f_string_static_t reserved_name[] = {
for (f_array_length_t i = 0; i < 33; ++i) {
if (fl_string_dynamic_compare(reserved_name[i], data_make->cache_arguments.array[0]) == F_equal_to) {
- fake_make_print_error_reserved_parameter_name(data_make->setting, data_make->main->error, reserved_name[i]);
+ fake_make_print_error_reserved_parameter_name(data_make->setting, data_make->program->error, reserved_name[i]);
status = F_status_set_error(F_failure);
}
data_make->setting->state.status = status;
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_permission_
void fake_make_operate_validate_type_permission(fake_make_data_t * const data_make, fake_state_process_t * const state_process) {
- if (!data_make || !data_make->main || !data_make->setting || !state_process) return;
+ if (!data_make || !data_make->program || !data_make->setting || !state_process) return;
if (data_make->cache_arguments.used) {
f_array_length_t i = 1;
data_make->setting->state.status = f_file_is(data_make->cache_arguments.array[i], F_file_type_regular_d, F_false);
if (data_make->setting->state.status == F_file_found_not) {
- fake_print_error_file_simple(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
+ fake_print_error_file_simple(data_make->setting, data_make->program->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
status = F_status_set_error(F_failure);
}
if (F_status_is_error(data_make->setting->state.status)) {
- if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->main->error.to.stream) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_directory_e);
+ if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->program->error.to.stream) {
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_directory_e);
}
status = F_status_set_error(F_failure);
}
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_pop_
void fake_make_operate_validate_type_pop(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used) {
- fake_print_error_too_many_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_too_many_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (data_make->path.stack.used == 1) {
- fake_make_print_error_pop_last_path(data_make->setting, data_make->main->error);
+ fake_make_print_error_pop_last_path(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_run_
void fake_make_operate_validate_type_run(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (!data_make->cache_arguments.used) {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_to_
void fake_make_operate_validate_type_to(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used > 1) {
- fake_print_error_too_many_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_too_many_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = f_file_is(data_make->cache_arguments.array[0], F_file_type_directory_d, F_false);
if (data_make->setting->state.status == F_file_found_not) {
- fake_print_error_file_simple(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[0], f_file_operation_find_s, fll_error_file_type_file_e);
+ fake_print_error_file_simple(data_make->setting, data_make->program->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[0], f_file_operation_find_s, fll_error_file_type_file_e);
data_make->setting->state.status = F_status_set_error(F_failure);
}
if (F_status_is_error(data_make->setting->state.status)) {
- if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->main->error.to.stream) {
- fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->data->file_data_build_fakefile, f_file_operation_find_s, fll_error_file_type_file_e);
+ if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->program->error.to.stream) {
+ fake_print_error_file(data_make->setting, data_make->program->error, macro_fake_f(f_file_is), data_make->data->file_data_build_fakefile, f_file_operation_find_s, fll_error_file_type_file_e);
}
data_make->setting->state.status = F_status_set_error(F_failure);
data_make->setting->state.status = F_none;
}
else {
- fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, 0, data_make->cache_arguments.array[0]);
+ fake_make_print_error_content_not_directory(data_make->setting, data_make->program->error, 0, data_make->cache_arguments.array[0]);
data_make->setting->state.status = F_status_set_error(F_failure);
}
}
else {
- fake_make_print_error_file_name_empty(data_make->setting, data_make->main->error);
+ fake_make_print_error_file_name_empty(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
#ifndef _di_fake_make_operate_validate_type_touch_
void fake_make_operate_validate_type_touch(fake_make_data_t * const data_make) {
- if (!data_make || !data_make->main || !data_make->setting) return;
+ if (!data_make || !data_make->program || !data_make->setting) return;
if (data_make->cache_arguments.used > 1) {
if (fl_string_dynamic_compare(fake_make_operation_argument_file_s, data_make->cache_arguments.array[0]) == F_equal_to_not) {
if (fl_string_dynamic_compare(fake_make_operation_argument_directory_s, data_make->cache_arguments.array[0]) == F_equal_to_not) {
- fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, f_file_type_name_file_s, data_make->cache_arguments.array[0]);
+ fake_make_print_error_unsupported_type(data_make->setting, data_make->program->error, f_file_type_name_file_s, data_make->cache_arguments.array[0]);
data_make->setting->state.status = F_status_set_error(F_failure);
}
data_make->setting->state.status = status;
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
}
}
else {
- fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error);
+ fake_print_error_requires_more_arguments(data_make->setting, data_make->program->error);
data_make->setting->state.status = F_status_set_error(F_failure);
}
f_file_stream_lock(print.to);
- fl_print_format("%[Processing Section '%]", print.to, print.set->important, print.set->important);
+ fl_print_format("%r%[Processing Section '%]", print.to, f_string_eol_s, print.set->important, print.set->important);
fl_print_format("%[%/Q%]", print.to, print.set->notable, buffer, section.name, print.set->notable);
fl_print_format("%['.%]%r", print.to, print.set->important, print.set->important, f_string_eol_s);
extern "C" {
#endif
+#ifndef _di_fake_print_building_
+ f_status_t fake_print_building(fake_setting_t * const setting, const fl_print_t print, const f_string_statics_t * const build_arguments, fake_build_setting_t * const setting_build) {
+
+ if (!setting || !setting_build) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ fl_print_format("%r%[Building%] ", print.to, f_string_eol_s, print.set->important, print.set->important);
+ fl_print_format("%[%Q%]", print.to, print.set->notable, setting_build->build_name, print.set->notable);
+ fl_print_format("%[ using '%]", print.to, print.set->important, print.set->important);
+ fl_print_format("%[%Q%]", print.to, print.set->notable, setting->settings, print.set->notable);
+
+ fl_print_format("%[' with modes '%]", print.to, print.set->important, print.set->important);
+
+ f_string_statics_t modes_custom = f_string_statics_t_initialize;
+ modes_custom.used = build_arguments && build_arguments->used > 1 ? build_arguments->used - 1 : 0;
+ modes_custom.size = 0;
+
+ f_string_static_t modes_custom_array[modes_custom.used];
+ modes_custom.array = modes_custom_array;
+
+ for (f_array_length_t i = 0; i < modes_custom.used; ++i) {
+ modes_custom.array[i] = build_arguments->array[i + 1];
+ } // for
+
+ // Custom modes are always used if provided, otherwise if any mode is specified, the entire defaults is replaced.
+ const f_string_statics_t * const modes = modes_custom.used
+ ? &modes_custom
+ : setting->modes.used
+ ? &setting->modes
+ : &setting_build->modes_default;
+
+ for (f_array_length_t i = 0; i < modes->used; ) {
+
+ fl_print_format("%[%Q%]", print.to, print.set->notable, modes->array[i], print.set->notable);
+
+ if (++i < modes->used) {
+ fl_print_format("%[', '%]", print.to, print.set->important, print.set->important);
+ }
+ } // for
+
+ fl_print_format("%['.%]%r", print.to, print.set->important, print.set->important, f_string_eol_s);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_fake_print_building_
+
#ifndef _di_fake_print_generating_skeleton_
f_status_t fake_print_generating_skeleton(fake_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, fake_program_name_long_s, fake_program_version_s);
fll_program_print_help_option_standard(print);
fl_print_format(" A section name from the fakefile that does not conflict with an operation name may be specified when performing the %[%r%] operation.%r", print.to, print.set->notable, fake_other_operation_make_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);
}
#endif // _di_fake_print_help_
-#ifndef _di_fake_print_line_first_
- f_status_t fake_print_line_first(fake_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & fake_main_flag_file_to_e) return F_output_not;
- }
-
- if (setting->flag & fake_main_flag_print_first_e) {
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- setting->flag -= fake_main_flag_print_first_e;
- }
-
- return F_none;
- }
-#endif // _di_fake_print_line_first_
-
-#ifndef _di_fake_print_line_last_
- f_status_t fake_print_line_last(fake_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & fake_main_flag_file_to_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fake_print_line_last_
-
#ifndef _di_fake_print_simple_
void fake_print_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t message) {
#endif
/**
+ * Print a message about building.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * The output structure to print to.
+ * @param build_arguments
+ * (optional) The build arguments.
+ * @param setting_build
+ * The build setting data.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see fl_print_format()
+ */
+#ifndef _di_fake_print_building_
+ extern f_status_t fake_print_building(fake_setting_t * const setting, const fl_print_t print, const f_string_statics_t * const build_arguments, fake_build_setting_t * const setting_build);
+#endif // _di_fake_print_building_
+
+/**
* Print a message about generating skeleton.
*
* @param setting
* The main program settings.
- * (Must be of type fake_setting_t.)
*
* This does not alter setting.state.status.
* @param print
#endif // _di_fake_print_help_
/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * Once the first line is processed (printed or not), then this will print new lines normally.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_dynamic_raw()
- */
-#ifndef _di_fake_print_line_first_
- extern f_status_t fake_print_line_first(fake_setting_t * const setting, const fl_print_t print);
-#endif // _di_fake_print_line_first_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_dynamic_raw()
- */
-#ifndef _di_fake_print_line_last_
- extern f_status_t fake_print_line_last(fake_setting_t * const setting, const fl_print_t print);
-#endif // _di_fake_print_line_last_
-
-/**
* Print simple message.
*
* This is primarily used by numerous print functions to reduce code.
#ifndef _di_fake_print_context_important_simple_
void fake_print_context_important_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t message) {
- const fl_print_t custom = macro_fl_print_t_initialize(print.to, print.verbosity, f_string_empty_s, f_string_empty_s, print.set->important, print.set->notable, print.set);
+ const fl_print_t custom = macro_fl_print_t_initialize(print.to, print.verbosity, 0, f_string_empty_s, f_string_empty_s, print.set->important, print.set->notable, print.set, 0);
fake_print_context_simple(setting, custom, message);
}
}
#endif // _di_fake_print_context_wrapped_parameter_
+#ifndef _di_fake_print_context_wrapped_parameter_value_
+ void fake_print_context_wrapped_parameter_value(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t symbol, const f_string_static_t name, const f_string_t between, const f_string_static_t value, const f_string_t after) {
+
+ if (!setting) return;
+
+ f_file_stream_lock(print.to);
+
+ fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context);
+ fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol, name, print.notable);
+ fl_print_format("%['%S'%]%r", print.to, print.context, between, print.context);
+ fl_print_format("%[%Q%]", print.to, print.notable, value, print.notable);
+ fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s);
+
+ f_file_stream_unlock(print.to);
+ }
+#endif // _di_fake_print_context_wrapped_parameter_value_
+
#ifndef _di_fake_print_context_wrapped_parameters_
void fake_print_context_wrapped_parameters(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t symbol_1, const f_string_static_t name_1, const f_string_t between_1, const f_string_static_t symbol_2, const f_string_static_t name_2, const f_string_t between_2, const f_string_static_t symbol_3, const f_string_static_t name_3, const f_string_t after) {
#endif // _di_fake_print_context_wrapped_parameter_
/**
+ * Print a parameter context message with a before string, a middle string, an after string, a string symbol, a parameter name, and the parameter value.
+ *
+ * This is primarily used by numerous print functions to reduce code.
+ * This is not used for any print functions that has complex format structures.
+ *
+ * @param setting
+ * The main program settings.
+ * (Must be of type fake_setting_t.)
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * The output structure to print to.
+ * @param before
+ * The string being printed before the variable.
+ * Likely should have a space added at the end of the string.
+ * Set to NULL to disable.
+ * @param symbol
+ * The string representing the symbol for the parameter.
+ * Set to f_string_empty_s to disable.
+ * @param name
+ * The string representing the parameter name.
+ * @param between
+ * The string being printed after the parameter name and before the parameter value.
+ * @param value
+ * The value associated with the given parameter name.
+ * @param after
+ * The string being printed after the variable.
+ * Likely should have a space added at the start of the string.
+ * Set to NULL to disable.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see fl_print_format()
+ */
+#ifndef _di_fake_print_context_wrapped_parameter_value_
+ extern void fake_print_context_wrapped_parameter_value(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t symbol, const f_string_static_t name, const f_string_t between, const f_string_static_t value, const f_string_t after);
+#endif // _di_fake_print_context_wrapped_parameter_value_
+
+/**
* Print a parameter context message with a there parameters, with symbols, and wrapping strings.
*
* This is primarily used by numerous print functions to reduce code.
#endif
#ifndef _di_fake_print_error_
- f_status_t fake_print_error(fake_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+ f_status_t fake_print_error(fl_print_t * const print, const f_string_t function) {
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+ if (!print) return F_status_set_error(F_output_not);
+ if (print->verbosity < f_console_verbosity_error_e) return F_output_not;
- fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
+ fake_setting_t * const setting = (fake_setting_t *) print->custom;
+
+ if (setting) {
+ fll_error_print(*print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
+ }
return F_none;
}
}
#endif // _di_fake_print_error_directory_create_parent_missing_
+#ifndef _di_fake_print_error_execute_program_not_found_
+ f_status_t fake_print_error_execute_program_not_found(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t program) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+ fake_print_context_simple_variable(setting, print, "Failed to find program ", program, " for executing");
+
+ return F_none;
+ }
+#endif // _di_fake_print_error_execute_program_not_found_
+
#ifndef _di_fake_print_error_failure_operation_
f_status_t fake_print_error_failure_operation(fake_setting_t * const setting, const fl_print_t print, const uint8_t operation) {
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
- fake_print_context_wrapped_parameter(setting, print, "The ", f_console_symbol_long_normal_s, name, " parameter must not be empty and must not contain only white space");
+ fake_print_context_wrapped_parameter(setting, print, "The ", symbol, name, " parameter must not be empty and must not contain only white space");
return F_none;
}
#endif // _di_fake_print_error_parameter_not_empty_
+#ifndef _di_fake_print_error_parameter_directory_not_found_path_
+ f_status_t fake_print_error_parameter_directory_not_found_path(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
+
+ if (!setting) return F_status_set_error(F_output_not);
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ fake_print_context_wrapped_parameter_value(setting, print, "The value of the directory parameter ", symbol, name, " has a path of ", value, " that is not found.");
+
+ return F_none;
+ }
+#endif // _di_fake_print_error_parameter_directory_not_found_path_
+
#ifndef _di_fake_print_error_parameter_not_word_
f_status_t fake_print_error_parameter_not_word(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
#endif // _di_fake_print_error_parameter_operation_not_with_
#ifndef _di_fake_print_error_parameter_too_many_
- f_status_t fake_print_error_parameter_too_many(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t parameter) {
+ f_status_t fake_print_error_parameter_too_many(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter) {
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
- fake_print_context_wrapped_parameter(setting, print, "The parameter ", f_console_symbol_long_normal_s, parameter, " is specified too many times");
+ fake_print_context_wrapped_parameter(setting, print, "The parameter ", symbol, parameter, " is specified too many times");
return F_none;
}
/**
* Print generic error message regarding a function failing in some way.
*
- * @param setting
- * The main program settings.
+ * This does not print a leading first line, better allowing it to be used while loading settings or before the normal first line is printed.
*
- * This does not alter setting.state.status.
* @param print
* Designates the how and where to print.
+ *
+ * This expects print.custom to be fake_setting_t.
+ *
+ * This does not alter print.custom.state.status.
* @param function
* The function name.
*
* @see fl_print_format()
*/
#ifndef _di_fake_print_error_
- extern f_status_t fake_print_error(fake_setting_t * const setting, const fl_print_t print, const f_string_t function);
+ extern f_status_t fake_print_error(fl_print_t * const print, const f_string_t function);
#endif // _di_fake_print_error_
/**
#endif // _di_fake_print_error_directory_create_parent_missing_
/**
+ * Print error message regarding program needed for execution is not found.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ * @param program
+ * The name of the not found program.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fake_print_context_simple_variable()
+ */
+#ifndef _di_fake_print_error_execute_program_not_found_
+ extern f_status_t fake_print_error_execute_program_not_found(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t program);
+#endif // _di_fake_print_error_execute_program_not_found_
+
+/**
* Print file related error message regarding a function failing in some way.
*
* This prints a simple message to avoid "Unable to find file..., because file cannot be found." type of messages.
#endif // _di_fake_print_error_parameter_not_empty_
/**
+ * Print error message for when the directory parameter value is not found.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.state.status.
+ * @param print
+ * Designates the how and where to print.
+ * @param symbol
+ * The symbol of the parameter.
+ * @param name
+ * The name of the parameter.
+ * @param value
+ * The value that is not found.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fake_print_context_wrapped_parameter_value()
+ */
+#ifndef _di_fake_print_error_parameter_directory_not_found_path_
+ extern f_status_t fake_print_error_parameter_directory_not_found_path(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value);
+#endif // _di_fake_print_error_parameter_directory_not_found_path_
+
+/**
* Print error message for when the parameter value contains a non-word, non-minus, and non-plus character.
*
* @param setting
* @see fake_print_context_wrapped_parameter()
*/
#ifndef _di_fake_print_error_parameter_too_many_
- extern f_status_t fake_print_error_parameter_too_many(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t parameter);
+ extern f_status_t fake_print_error_parameter_too_many(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter);
#endif // _di_fake_print_error_parameter_too_many_
/**
f_file_stream_lock(print.to);
- fl_print_format("All operations complete.%r", print.to, f_string_eol_s, f_string_eol_s);
+ fl_print_format("%rAll operations complete.%r", print.to, f_string_eol_s, f_string_eol_s);
f_file_stream_flush(print.to);
f_file_stream_unlock(print.to);
fake_data_t * const data = (fake_data_t *) recurse->state.custom;
- if (data->main->message.verbosity < f_console_verbosity_verbose_e) {
+ if (data->program->message.verbosity < f_console_verbosity_verbose_e) {
recurse->state.status = F_output_not;
return;
}
- fake_print_wrapped_variables(data->setting, data->main->message, "Cloned ", source, " to ", destination, 0);
+ fake_print_wrapped_variables(data->setting, data->program->message, "Cloned ", source, " to ", destination, 0);
}
#endif // _di_fake_print_verbose_clone_
fake_data_t * const data = (fake_data_t *) recurse->state.custom;
- if (data->main->message.verbosity < f_console_verbosity_verbose_e) {
+ if (data->program->message.verbosity < f_console_verbosity_verbose_e) {
recurse->state.status = F_output_not;
return;
}
- fake_print_wrapped_variables(data->setting, data->main->message, "Copied ", source, " to ", destination, 0);
+ fake_print_wrapped_variables(data->setting, data->program->message, "Copied ", source, " to ", destination, 0);
}
#endif // _di_fake_print_verbose_copy_
fake_data_t * const data = (fake_data_t *) recurse->state.custom;
- if (data->main->message.verbosity < f_console_verbosity_verbose_e) {
+ if (data->program->message.verbosity < f_console_verbosity_verbose_e) {
recurse->state.status = F_output_not;
return;
}
- fake_print_wrapped_variables(data->setting, data->main->message, "Moved ", source, " to ", destination, 0);
+ fake_print_wrapped_variables(data->setting, data->program->message, "Moved ", source, " to ", destination, 0);
}
#endif // _di_fake_print_verbose_move_
#ifndef _di_fake_skeleton_operate_
void fake_skeleton_operate(fake_data_t * const data) {
- if (!data || !data->main || !data->setting) return;
+ if (!data || !data->program || !data->setting) return;
- if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) {
- fake_print_generating_skeleton(data->setting, data->main->message);
+ if (data->program->message.verbosity != f_console_verbosity_quiet_e && data->program->message.verbosity != f_console_verbosity_error_e) {
+ fake_print_generating_skeleton(data->setting, data->program->message);
- if (data->main->message.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_dynamic(f_string_eol_s, data->main->message.to);
+ if (data->program->message.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_dynamic(f_string_eol_s, data->program->message.to);
}
}
fake_skeleton_operate_directory_create(data, path[i]);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error(data->setting, data->main->error, macro_fake_f(fake_skeleton_operate_directory_create));
+ fake_print_error(&data->program->error, macro_fake_f(fake_skeleton_operate_directory_create));
return;
}
} // for
- if (data->main->message.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_dynamic(f_string_eol_s, data->main->message.to);
+ if (data->program->message.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_dynamic(f_string_eol_s, data->program->message.to);
}
}
#ifndef _di_fake_skeleton_operate_directory_create_
void fake_skeleton_operate_directory_create(fake_data_t * const data, const f_string_static_t path) {
- if (!data || !data->main || !data->setting || !path.used) return;
+ if (!data || !data->program || !data->setting || !path.used) return;
data->setting->state.status = f_directory_exists(path);
if (data->setting->state.status == F_true) {
- fake_print_verbose_directory_exists(data->setting, data->main->message, path);
+ fake_print_verbose_directory_exists(data->setting, data->program->message, path);
data->setting->state.status = F_none;
}
if (data->setting->state.status == F_false) {
- fake_print_warning_path_exists_not_directory(data->setting, data->main->warning, path);
+ fake_print_warning_path_exists_not_directory(data->setting, data->program->warning, path);
data->setting->state.status = F_status_set_warning(F_failure);
if (F_status_is_error(data->setting->state.status)) {
if (F_status_set_fine(data->setting->state.status) == F_file_found_not) {
- fake_print_error_directory_create_parent_missing(data->setting, data->main->error, path);
+ fake_print_error_directory_create_parent_missing(data->setting, data->program->error, path);
}
else {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_create), path, f_file_operation_create_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_directory_create), path, f_file_operation_create_s, fll_error_file_type_directory_e);
}
return;
}
- fake_print_verbose_create_directory(data->setting, data->main->message, path);
+ fake_print_verbose_create_directory(data->setting, data->program->message, path);
}
else if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_exists), path, f_file_operation_create_s, fll_error_file_type_directory_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_directory_exists), path, f_file_operation_create_s, fll_error_file_type_directory_e);
return;
}
#ifndef _di_fake_skeleton_operate_file_create_
void fake_skeleton_operate_file_create(fake_data_t * const data, const f_string_static_t path, const bool executable, const f_string_static_t content) {
- if (!data || !data->main || !data->setting || !path.used) return;
+ if (!data || !data->program || !data->setting || !path.used) return;
data->setting->state.status = f_file_is(path, F_file_type_regular_d, F_false);
if (data->setting->state.status == F_true) {
- fake_print_verbose_file_exists(data->setting, data->main->message, path);
+ fake_print_verbose_file_exists(data->setting, data->program->message, path);
data->setting->state.status = F_none;
data->setting->state.status = f_file_is(path, F_file_type_link_d, F_false);
if (data->setting->state.status == F_true) {
- fake_print_verbose_file_exists_as_link(data->setting, data->main->message, path);
+ fake_print_verbose_file_exists_as_link(data->setting, data->program->message, path);
data->setting->state.status = F_none;
}
if (data->setting->state.status == F_false) {
- fake_print_verbose_file_exists_not_regular_or_link(data->setting, data->main->message, path);
+ fake_print_verbose_file_exists_not_regular_or_link(data->setting, data->program->message, path);
data->setting->state.status = F_status_set_warning(F_none);
if (F_status_is_error(data->setting->state.status)) {
if (F_status_set_fine(data->setting->state.status) == F_file_found_not) {
- fake_print_error_file_create_parent_missing(data->setting, data->main->error, path);
+ fake_print_error_file_create_parent_missing(data->setting, data->program->error, path);
}
else {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_create), path, f_file_operation_create_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_create), path, f_file_operation_create_s, fll_error_file_type_file_e);
}
return;
}
- fake_print_verbose_create_file(data->setting, data->main->message, path);
+ fake_print_verbose_create_file(data->setting, data->program->message, path);
if (content.used) {
f_file_t file = f_file_t_initialize;
data->setting->state.status = f_file_open(path, 0, &file);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_open), path, fake_common_file_populate_pre_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_open), path, fake_common_file_populate_pre_s, fll_error_file_type_file_e);
return;
}
data->setting->state.status = f_file_write(file, content, 0);
if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_write), path, fake_common_file_populate_pre_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_write), path, fake_common_file_populate_pre_s, fll_error_file_type_file_e);
f_file_stream_flush(file);
f_file_stream_close(&file);
return;
}
- fake_print_verbose_file_pre_populated(data->setting, data->main->message, path);
+ fake_print_verbose_file_pre_populated(data->setting, data->program->message, path);
f_file_stream_flush(file);
f_file_stream_close(&file);
}
}
else if (F_status_is_error(data->setting->state.status)) {
- fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_is), path, f_file_operation_create_s, fll_error_file_type_file_e);
+ fake_print_error_file(data->setting, data->program->error, macro_fake_f(f_file_is), path, f_file_operation_create_s, fll_error_file_type_file_e);
return;
}
setting->state.status = f_console_parameter_process(state, arguments, &main->parameters, &setting->state, 0);
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[firewall_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & firewall_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= firewall_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[firewall_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & firewall_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= firewall_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- firewall_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
- firewall_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- firewall_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- firewall_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
- if (main->parameters.array[firewall_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[firewall_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { firewall_parameter_verbosity_quiet_e, firewall_parameter_verbosity_error_e, firewall_parameter_verbosity_verbose_e, firewall_parameter_verbosity_debug_e, firewall_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- firewall_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- firewall_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
firewall_parameter_verbosity_verbose_e,
firewall_parameter_verbosity_debug_e,
firewall_parameter_version_e,
- firewall_parameter_line_first_no_e,
- firewall_parameter_line_last_no_e,
firewall_parameter_command_start_e,
firewall_parameter_command_stop_e,
#define firewall_console_parameter_t_initialize \
{ \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e, 0), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \
- macro_f_console_parameter_t_initialize_3(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_error_s, f_console_standard_long_error_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_normal_s, f_console_standard_long_normal_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_debug_s, f_console_standard_long_debug_s, 0, f_console_flag_inverse_e), \
+ macro_f_console_parameter_t_initialize_3(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, f_console_flag_inverse_e), \
\
macro_f_console_parameter_t_initialize_6(firewall_command_start_s, 0, f_console_flag_simple_e), \
macro_f_console_parameter_t_initialize_6(firewall_command_stop_s, 0, f_console_flag_simple_e), \
macro_f_console_parameter_t_initialize_6(firewall_command_show_s, 0, f_console_flag_simple_e), \
}
- #define firewall_total_parameters_d 17
+ #define firewall_total_parameters_d 15
#endif // _di_firewall_parameter_d_
/**
* - file_to: Using a specified destination file.
* - help: Print help.
* - header: Enable printing of headers.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - separate: Enable printing of separators.
* - strip_invalid: Using strip invalid character mode.
* - verify: Using verify mode.
firewall_main_flag_file_to_e = 0x2,
firewall_main_flag_header_e = 0x4,
firewall_main_flag_help_e = 0x8,
- firewall_main_flag_separate_e = 0x10,
- firewall_main_flag_strip_invalid_e = 0x20,
- firewall_main_flag_verify_e = 0x40,
- firewall_main_flag_version_e = 0x80,
+ firewall_main_flag_print_first_e = 0x20,
+ firewall_main_flag_print_last_e = 0x40,
+ firewall_main_flag_separate_e = 0x80,
+ firewall_main_flag_strip_invalid_e = 0x100,
+ firewall_main_flag_verify_e = 0x200,
+ firewall_main_flag_version_e = 0x400,
}; // enum
#endif // _di_firewall_main_flag_e_
* flag: Flags passed to the main function.
*
* state: The state information.
- *
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
*/
#ifndef _di_firewall_setting_t_
typedef struct {
uint16_t flag;
f_state_t state;
-
- f_string_static_t line_first;
- f_string_static_t line_last;
} firewall_setting_t;
#define firewall_setting_t_initialize \
{ \
firewall_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
}
#endif // _di_firewall_setting_t_
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
- firewall_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- firewall_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
- firewall_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- firewall_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
if (main->parameters.array[firewall_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), firewall_program_version_s);
+ fll_program_print_version(main->message, firewall_program_version_s);
return F_none;
}
if (main->parameters.array[firewall_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
return F_none;
}
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, firewall_program_name_long_s, firewall_program_version_s);
fll_program_print_help_option_standard(print);
fll_program_print_help_usage(print, firewall_program_name_s, firewall_program_help_parameters_s);
- f_print_dynamic_raw(setting->line_last, print.to);
-
f_file_stream_flush(print.to);
f_file_stream_unlock(print.to);
}
#endif // _di_firewall_print_help_
-#ifndef _di_firewall_print_line_first_locked_
- f_status_t firewall_print_line_first_locked(firewall_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_firewall_print_line_first_locked_
-
-#ifndef _di_firewall_print_line_first_unlocked_
- f_status_t firewall_print_line_first_unlocked(firewall_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_firewall_print_line_first_unlocked_
-
-#ifndef _di_firewall_print_line_last_locked_
- f_status_t firewall_print_line_last_locked(firewall_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_firewall_print_line_last_locked_
-
-#ifndef _di_firewall_print_line_last_unlocked_
- f_status_t firewall_print_line_last_unlocked(firewall_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_firewall_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t firewall_print_help(firewall_setting_t * const setting, const fl_print_t print);
#endif // _di_firewall_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_firewall_print_line_first_locked_
- extern f_status_t firewall_print_line_first_locked(firewall_setting_t * const setting, const fl_print_t print);
-#endif // _di_firewall_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_firewall_print_line_first_unlocked_
- extern f_status_t firewall_print_line_first_unlocked(firewall_setting_t * const setting, const fl_print_t print);
-#endif // _di_firewall_print_line_first_unlocked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_firewall_print_line_last_locked_
- extern f_status_t firewall_print_line_last_locked(firewall_setting_t * const setting, const fl_print_t print);
-#endif // _di_firewall_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_firewall_print_line_last_unlocked_
- extern f_status_t firewall_print_line_last_unlocked(firewall_setting_t * const setting, const fl_print_t print);
-#endif // _di_firewall_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
setting->state.step_small = fss_basic_list_read_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[fss_basic_list_read_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_basic_list_read_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= fss_basic_list_read_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[fss_basic_list_read_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_basic_list_read_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= fss_basic_list_read_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- fss_basic_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
- fss_basic_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_basic_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_basic_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
- if (main->parameters.array[fss_basic_list_read_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[fss_basic_list_read_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { fss_basic_list_read_parameter_verbosity_quiet_e, fss_basic_list_read_parameter_verbosity_error_e, fss_basic_list_read_parameter_verbosity_verbose_e, fss_basic_list_read_parameter_verbosity_debug_e, fss_basic_list_read_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_basic_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_basic_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
* - file_to: Using a specified destination file.
* - help: Print help.
* - header: Enable printing of headers.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - separate: Enable printing of separators.
* - strip_invalid: Using strip invalid character mode.
* - verify: Using verify mode.
fss_basic_list_read_main_flag_file_to_e = 0x4,
fss_basic_list_read_main_flag_header_e = 0x8,
fss_basic_list_read_main_flag_help_e = 0x10,
- fss_basic_list_read_main_flag_separate_e = 0x20,
- fss_basic_list_read_main_flag_strip_invalid_e = 0x40,
- fss_basic_list_read_main_flag_verify_e = 0x80,
- fss_basic_list_read_main_flag_version_e = 0x100,
+ fss_basic_list_read_main_flag_print_first_e = 0x20,
+ fss_basic_list_read_main_flag_print_last_e = 0x40,
+ fss_basic_list_read_main_flag_separate_e = 0x80,
+ fss_basic_list_read_main_flag_strip_invalid_e = 0x100,
+ fss_basic_list_read_main_flag_verify_e = 0x200,
+ fss_basic_list_read_main_flag_version_e = 0x400,
}; // enum
#endif // _di_fss_basic_list_read_main_flag_e_
* flag: Flags passed to the main function.
*
* state: The state information.
- *
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
*/
#ifndef _di_fss_basic_list_read_setting_t_
typedef struct {
uint16_t flag;
f_state_t state;
-
- f_string_static_t line_first;
- f_string_static_t line_last;
} fss_basic_list_read_setting_t;
#define fss_basic_list_read_setting_t_initialize \
{ \
fss_basic_list_read_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
}
#endif // _di_fss_basic_list_read_setting_t_
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
- fss_basic_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_basic_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
- fss_basic_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_basic_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
if (main->parameters.array[fss_basic_list_read_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), fss_basic_list_read_program_version_s);
+ fll_program_print_version(main->message, fss_basic_list_read_program_version_s);
return F_none;
}
if (main->parameters.array[fss_basic_list_read_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
return F_none;
}
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
// The signal check is always performed on each pass.
if (size_file > fss_basic_list_read_block_max && fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_basic_list_read_program_name_long_s, fss_basic_list_read_program_version_s);
fll_program_print_help_option_standard(print);
fl_print_format(" The word 'column' is being loosely defined to refer to a specific Content.%r", print.to, f_string_eol_s);
fl_print_format(" This is not to be confused with a depth.%r", print.to, 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);
}
#endif // _di_fss_basic_list_read_print_help_
-#ifndef _di_fss_basic_list_read_print_line_first_locked_
- f_status_t fss_basic_list_read_print_line_first_locked(fss_basic_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_basic_list_read_print_line_first_locked_
-
-#ifndef _di_fss_basic_list_read_print_line_first_unlocked_
- f_status_t fss_basic_list_read_print_line_first_unlocked(fss_basic_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_basic_list_read_print_line_first_unlocked_
-
-#ifndef _di_fss_basic_list_read_print_line_last_locked_
- f_status_t fss_basic_list_read_print_line_last_locked(fss_basic_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_basic_list_read_print_line_last_locked_
-
-#ifndef _di_fss_basic_list_read_print_line_last_unlocked_
- f_status_t fss_basic_list_read_print_line_last_unlocked(fss_basic_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_basic_list_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t fss_basic_list_read_print_help(fss_basic_list_read_setting_t * const setting, const fl_print_t print);
#endif // _di_fss_basic_list_read_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_basic_list_read_print_line_first_locked_
- extern f_status_t fss_basic_list_read_print_line_first_locked(fss_basic_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_basic_list_read_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_basic_list_read_print_line_first_unlocked_
- extern f_status_t fss_basic_list_read_print_line_first_unlocked(fss_basic_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_basic_list_read_print_line_first_unlocked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_basic_list_read_print_line_last_locked_
- extern f_status_t fss_basic_list_read_print_line_last_locked(fss_basic_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_basic_list_read_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_basic_list_read_print_line_last_unlocked_
- extern f_status_t fss_basic_list_read_print_line_last_unlocked(fss_basic_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_basic_list_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
setting->state.step_small = fss_basic_read_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[fss_basic_read_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_basic_read_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= fss_basic_read_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[fss_basic_read_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_basic_read_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= fss_basic_read_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- fss_basic_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
- fss_basic_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_basic_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_basic_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
- if (main->parameters.array[fss_basic_read_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[fss_basic_read_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { fss_basic_read_parameter_verbosity_quiet_e, fss_basic_read_parameter_verbosity_error_e, fss_basic_read_parameter_verbosity_verbose_e, fss_basic_read_parameter_verbosity_debug_e, fss_basic_read_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_basic_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_basic_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
* - file_to: Using a specified destination file.
* - help: Print help.
* - header: Enable printing of headers.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - separate: Enable printing of separators.
* - strip_invalid: Using strip invalid character mode.
* - verify: Using verify mode.
fss_basic_read_main_flag_file_to_e = 0x4,
fss_basic_read_main_flag_header_e = 0x8,
fss_basic_read_main_flag_help_e = 0x10,
- fss_basic_read_main_flag_separate_e = 0x20,
- fss_basic_read_main_flag_strip_invalid_e = 0x40,
- fss_basic_read_main_flag_verify_e = 0x80,
- fss_basic_read_main_flag_version_e = 0x100,
+ fss_basic_read_main_flag_print_first_e = 0x20,
+ fss_basic_read_main_flag_print_last_e = 0x40,
+ fss_basic_read_main_flag_separate_e = 0x80,
+ fss_basic_read_main_flag_strip_invalid_e = 0x100,
+ fss_basic_read_main_flag_verify_e = 0x200,
+ fss_basic_read_main_flag_version_e = 0x400,
}; // enum
#endif // _di_fss_basic_read_main_flag_e_
* flag: Flags passed to the main function.
*
* state: The state information.
- *
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
*/
#ifndef _di_fss_basic_read_setting_t_
typedef struct {
uint16_t flag;
f_state_t state;
-
- f_string_static_t line_first;
- f_string_static_t line_last;
} fss_basic_read_setting_t;
#define fss_basic_read_setting_t_initialize \
{ \
fss_basic_read_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
}
#endif // _di_fss_basic_read_setting_t_
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
- fss_basic_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_basic_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
- fss_basic_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_basic_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
if (main->parameters.array[fss_basic_read_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), fss_basic_read_program_version_s);
+ fll_program_print_version(main->message, fss_basic_read_program_version_s);
return F_none;
}
if (main->parameters.array[fss_basic_read_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
return F_none;
}
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_signal);
// The signal check is always performed on each pass.
if (size_file > fss_basic_read_block_max && fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_basic_read_program_name_long_s, fss_basic_read_program_version_s);
fll_program_print_help_option_standard(print);
fl_print_format(" The word 'column' is being loosely defined to refer to a specific Content.%r", print.to, f_string_eol_s);
fl_print_format(" This is not to be confused with a depth.%r", print.to, 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);
}
#endif // _di_fss_basic_read_print_help_
-#ifndef _di_fss_basic_read_print_line_first_locked_
- f_status_t fss_basic_read_print_line_first_locked(fss_basic_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_basic_read_print_line_first_locked_
-
-#ifndef _di_fss_basic_read_print_line_first_unlocked_
- f_status_t fss_basic_read_print_line_first_unlocked(fss_basic_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_basic_read_print_line_first_unlocked_
-
-#ifndef _di_fss_basic_read_print_line_last_locked_
- f_status_t fss_basic_read_print_line_last_locked(fss_basic_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_basic_read_print_line_last_locked_
-
-#ifndef _di_fss_basic_read_print_line_last_unlocked_
- f_status_t fss_basic_read_print_line_last_unlocked(fss_basic_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_basic_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t fss_basic_read_print_help(fss_basic_read_setting_t * const setting, const fl_print_t print);
#endif // _di_fss_basic_read_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_basic_read_print_line_first_locked_
- extern f_status_t fss_basic_read_print_line_first_locked(fss_basic_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_basic_read_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_basic_read_print_line_first_unlocked_
- extern f_status_t fss_basic_read_print_line_first_unlocked(fss_basic_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_basic_read_print_line_first_unlocked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_basic_read_print_line_last_locked_
- extern f_status_t fss_basic_read_print_line_last_locked(fss_basic_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_basic_read_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_basic_read_print_line_last_unlocked_
- extern f_status_t fss_basic_read_print_line_last_unlocked(fss_basic_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_basic_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_interrupt) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return status;
}
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
setting->state.step_small = fss_embedded_list_read_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[fss_embedded_list_read_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_embedded_list_read_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= fss_embedded_list_read_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[fss_embedded_list_read_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_embedded_list_read_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= fss_embedded_list_read_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- fss_embedded_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
- fss_embedded_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_embedded_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_embedded_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
- if (main->parameters.array[fss_embedded_list_read_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[fss_embedded_list_read_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { fss_embedded_list_read_parameter_verbosity_quiet_e, fss_embedded_list_read_parameter_verbosity_error_e, fss_embedded_list_read_parameter_verbosity_verbose_e, fss_embedded_list_read_parameter_verbosity_debug_e, fss_embedded_list_read_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_embedded_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_embedded_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
* - file_to: Using a specified destination file.
* - help: Print help.
* - header: Enable printing of headers.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - separate: Enable printing of separators.
* - strip_invalid: Using strip invalid character mode.
* - verify: Using verify mode.
fss_embedded_list_read_main_flag_file_to_e = 0x4,
fss_embedded_list_read_main_flag_header_e = 0x8,
fss_embedded_list_read_main_flag_help_e = 0x10,
- fss_embedded_list_read_main_flag_separate_e = 0x20,
- fss_embedded_list_read_main_flag_strip_invalid_e = 0x40,
- fss_embedded_list_read_main_flag_verify_e = 0x80,
- fss_embedded_list_read_main_flag_version_e = 0x100,
+ fss_embedded_list_read_main_flag_print_first_e = 0x20,
+ fss_embedded_list_read_main_flag_print_last_e = 0x40,
+ fss_embedded_list_read_main_flag_separate_e = 0x80,
+ fss_embedded_list_read_main_flag_strip_invalid_e = 0x100,
+ fss_embedded_list_read_main_flag_verify_e = 0x200,
+ fss_embedded_list_read_main_flag_version_e = 0x400,
}; // enum
#endif // _di_fss_embedded_list_read_main_flag_e_
* flag: Flags passed to the main function.
*
* state: The state information.
- *
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
*/
#ifndef _di_fss_embedded_list_read_setting_t_
typedef struct {
uint16_t flag;
f_state_t state;
-
- f_string_static_t line_first;
- f_string_static_t line_last;
} fss_embedded_list_read_setting_t;
#define fss_embedded_list_read_setting_t_initialize \
{ \
fss_embedded_list_read_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
}
#endif // _di_fss_embedded_list_read_setting_t_
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
- fss_embedded_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_embedded_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
- fss_embedded_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_embedded_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
if (main->parameters.array[fss_embedded_list_read_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), fss_embedded_list_read_program_version_s);
+ fll_program_print_version(main->message, fss_embedded_list_read_program_version_s);
return F_none;
}
if (main->parameters.array[fss_embedded_list_read_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
return F_none;
}
if (!((++main->signal_check) % fss_embedded_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
// The signal check is always performed on each pass.
if (size_file > fss_embedded_list_read_block_max && fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_embedded_list_read_program_name_long_s, fss_embedded_list_read_program_version_s);
fll_program_print_help_option_standard(print);
fl_print_format(" The word 'column' is being loosely defined to refer to a specific Content.%r", print.to, f_string_eol_s);
fl_print_format(" This is not to be confused with a depth.%r", print.to, 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);
}
#endif // _di_fss_embedded_list_read_print_help_
-#ifndef _di_fss_embedded_list_read_print_line_first_locked_
- f_status_t fss_embedded_list_read_print_line_first_locked(fss_embedded_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_embedded_list_read_print_line_first_locked_
-
-#ifndef _di_fss_embedded_list_read_print_line_first_unlocked_
- f_status_t fss_embedded_list_read_print_line_first_unlocked(fss_embedded_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_embedded_list_read_print_line_first_unlocked_
-
-#ifndef _di_fss_embedded_list_read_print_line_last_locked_
- f_status_t fss_embedded_list_read_print_line_last_locked(fss_embedded_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_embedded_list_read_print_line_last_locked_
-
-#ifndef _di_fss_embedded_list_read_print_line_last_unlocked_
- f_status_t fss_embedded_list_read_print_line_last_unlocked(fss_embedded_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_embedded_list_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t fss_embedded_list_read_print_help(fss_embedded_list_read_setting_t * const setting, const fl_print_t print);
#endif // _di_fss_embedded_list_read_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_embedded_list_read_print_line_first_locked_
- extern f_status_t fss_embedded_list_read_print_line_first_locked(fss_embedded_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_embedded_list_read_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_embedded_list_read_print_line_first_unlocked_
- extern f_status_t fss_embedded_list_read_print_line_first_unlocked(fss_embedded_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_embedded_list_read_print_line_first_unlocked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_embedded_list_read_print_line_last_locked_
- extern f_status_t fss_embedded_list_read_print_line_last_locked(fss_embedded_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_embedded_list_read_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_embedded_list_read_print_line_last_unlocked_
- extern f_status_t fss_embedded_list_read_print_line_last_unlocked(fss_embedded_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_embedded_list_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
if (!((++data->main->signal_check) % fss_embedded_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++data->main->signal_check) % fss_embedded_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(data->main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
setting->state.step_small = fss_extended_list_read_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[fss_extended_list_read_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_extended_list_read_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= fss_extended_list_read_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[fss_extended_list_read_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_extended_list_read_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= fss_extended_list_read_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- fss_extended_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
- fss_extended_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_extended_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_extended_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
- if (main->parameters.array[fss_extended_list_read_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[fss_extended_list_read_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { fss_extended_list_read_parameter_verbosity_quiet_e, fss_extended_list_read_parameter_verbosity_error_e, fss_extended_list_read_parameter_verbosity_verbose_e, fss_extended_list_read_parameter_verbosity_debug_e, fss_extended_list_read_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_extended_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_extended_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
* - file_to: Using a specified destination file.
* - help: Print help.
* - header: Enable printing of headers.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - separate: Enable printing of separators.
* - strip_invalid: Using strip invalid character mode.
* - verify: Using verify mode.
fss_extended_list_read_main_flag_file_to_e = 0x4,
fss_extended_list_read_main_flag_header_e = 0x8,
fss_extended_list_read_main_flag_help_e = 0x10,
- fss_extended_list_read_main_flag_separate_e = 0x20,
- fss_extended_list_read_main_flag_strip_invalid_e = 0x40,
- fss_extended_list_read_main_flag_verify_e = 0x80,
- fss_extended_list_read_main_flag_version_e = 0x100,
+ fss_extended_list_read_main_flag_print_first_e = 0x20,
+ fss_extended_list_read_main_flag_print_last_e = 0x40,
+ fss_extended_list_read_main_flag_separate_e = 0x80,
+ fss_extended_list_read_main_flag_strip_invalid_e = 0x100,
+ fss_extended_list_read_main_flag_verify_e = 0x200,
+ fss_extended_list_read_main_flag_version_e = 0x400,
}; // enum
#endif // _di_fss_extended_list_read_main_flag_e_
* flag: Flags passed to the main function.
*
* state: The state information.
- *
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
*/
#ifndef _di_fss_extended_list_read_setting_t_
typedef struct {
uint16_t flag;
f_state_t state;
-
- f_string_static_t line_first;
- f_string_static_t line_last;
} fss_extended_list_read_setting_t;
#define fss_extended_list_read_setting_t_initialize \
{ \
fss_extended_list_read_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
}
#endif // _di_fss_extended_list_read_setting_t_
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
- fss_extended_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_extended_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
- fss_extended_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_extended_list_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
if (main->parameters.array[fss_extended_list_read_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), fss_extended_list_read_program_version_s);
+ fll_program_print_version(main->message, fss_extended_list_read_program_version_s);
return status;
}
if (main->parameters.array[fss_extended_list_read_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
return status;
}
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
// The signal check is always performed on each pass.
if (size_file > fss_extended_list_read_block_max && fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_extended_list_read_program_name_long_s, fss_extended_list_read_program_version_s);
fll_program_print_help_option_standard(print);
fl_print_format(" The word 'column' is being loosely defined to refer to a specific Content.%r", print.to, f_string_eol_s);
fl_print_format(" This is not to be confused with a depth.%r", print.to, 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);
}
#endif // _di_fss_extended_list_read_print_help_
-#ifndef _di_fss_extended_list_read_print_line_first_locked_
- f_status_t fss_extended_list_read_print_line_first_locked(fss_extended_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_extended_list_read_print_line_first_locked_
-
-#ifndef _di_fss_extended_list_read_print_line_first_unlocked_
- f_status_t fss_extended_list_read_print_line_first_unlocked(fss_extended_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_extended_list_read_print_line_first_unlocked_
-
-#ifndef _di_fss_extended_list_read_print_line_last_locked_
- f_status_t fss_extended_list_read_print_line_last_locked(fss_extended_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
-
- if (!F_status_is_error(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & (fss_extended_list_read_main_flag_verify_e | fss_extended_list_read_main_flag_file_to_e)) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_extended_list_read_print_line_last_locked_
-
-#ifndef _di_fss_extended_list_read_print_line_last_unlocked_
- f_status_t fss_extended_list_read_print_line_last_unlocked(fss_extended_list_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
-
- if (!F_status_is_error(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
- if (setting->flag & (fss_extended_list_read_main_flag_verify_e | fss_extended_list_read_main_flag_file_to_e)) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_extended_list_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t fss_extended_list_read_print_help(fss_extended_list_read_setting_t * const setting, const fl_print_t print);
#endif // _di_fss_extended_list_read_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_extended_list_read_print_line_first_locked_
- extern f_status_t fss_extended_list_read_print_line_first_locked(fss_extended_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_extended_list_read_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_extended_list_read_print_line_first_unlocked_
- extern f_status_t fss_extended_list_read_print_line_first_unlocked(fss_extended_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_extended_list_read_print_line_first_unlocked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_extended_list_read_print_line_last_locked_
- extern f_status_t fss_extended_list_read_print_line_last_locked(fss_extended_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_extended_list_read_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_extended_list_read_print_line_last_unlocked_
- extern f_status_t fss_extended_list_read_print_line_last_unlocked(fss_extended_list_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_extended_list_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
setting->state.step_small = fss_extended_read_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[fss_extended_read_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_extended_read_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= fss_extended_read_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[fss_extended_read_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_extended_read_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= fss_extended_read_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- fss_extended_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
- fss_extended_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_extended_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_extended_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
- if (main->parameters.array[fss_extended_read_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[fss_extended_read_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { fss_extended_read_parameter_verbosity_quiet_e, fss_extended_read_parameter_verbosity_error_e, fss_extended_read_parameter_verbosity_verbose_e, fss_extended_read_parameter_verbosity_debug_e, fss_extended_read_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_extended_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_extended_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
* - file_to: Using a specified destination file.
* - help: Print help.
* - header: Enable printing of headers.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - separate: Enable printing of separators.
* - strip_invalid: Using strip invalid character mode.
* - verify: Using verify mode.
fss_extended_read_main_flag_file_to_e = 0x4,
fss_extended_read_main_flag_header_e = 0x8,
fss_extended_read_main_flag_help_e = 0x10,
- fss_extended_read_main_flag_separate_e = 0x20,
- fss_extended_read_main_flag_strip_invalid_e = 0x40,
- fss_extended_read_main_flag_verify_e = 0x80,
- fss_extended_read_main_flag_version_e = 0x100,
+ fss_extended_read_main_flag_print_first_e = 0x20,
+ fss_extended_read_main_flag_print_last_e = 0x40,
+ fss_extended_read_main_flag_separate_e = 0x80,
+ fss_extended_read_main_flag_strip_invalid_e = 0x100,
+ fss_extended_read_main_flag_verify_e = 0x200,
+ fss_extended_read_main_flag_version_e = 0x400,
}; // enum
#endif // _di_fss_extended_read_main_flag_e_
* flag: Flags passed to the main function.
*
* state: The state information.
- *
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
*/
#ifndef _di_fss_extended_read_setting_t_
typedef struct {
uint16_t flag;
f_state_t state;
-
- f_string_static_t line_first;
- f_string_static_t line_last;
} fss_extended_read_setting_t;
#define fss_extended_read_setting_t_initialize \
{ \
fss_extended_read_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
}
#endif // _di_fss_extended_read_setting_t_
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
- fss_extended_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_extended_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
- fss_extended_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_extended_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
if (main->parameters.array[fss_extended_read_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), fss_extended_read_program_version_s);
+ fll_program_print_version(main->message, fss_extended_read_program_version_s);
return status;
}
if (main->parameters.array[fss_extended_read_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
return status;
}
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_signal);
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_signal);
// The signal check is always performed on each pass.
if (size_file > fss_extended_read_block_max && fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_extended_read_program_name_long_s, fss_extended_read_program_version_s);
fll_program_print_help_option_standard(print);
fl_print_format(" The word 'column' is being loosely defined to refer to a specific Content.%r", print.to, f_string_eol_s);
fl_print_format(" This is not to be confused with a depth.%r", print.to, 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);
}
#endif // _di_fss_extended_read_print_help_
-#ifndef _di_fss_extended_read_print_line_first_locked_
- f_status_t fss_extended_read_print_line_first_locked(fss_extended_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_extended_read_print_line_first_locked_
-
-#ifndef _di_fss_extended_read_print_line_first_unlocked_
- f_status_t fss_extended_read_print_line_first_unlocked(fss_extended_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_extended_read_print_line_first_unlocked_
-
-#ifndef _di_fss_extended_read_print_line_last_locked_
- f_status_t fss_extended_read_print_line_last_locked(fss_extended_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & (fss_extended_read_main_flag_verify_e | fss_extended_read_main_flag_file_to_e)) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_extended_read_print_line_last_locked_
-
-#ifndef _di_fss_extended_read_print_line_last_unlocked_
- f_status_t fss_extended_read_print_line_last_unlocked(fss_extended_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & (fss_extended_read_main_flag_verify_e | fss_extended_read_main_flag_file_to_e)) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_extended_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t fss_extended_read_print_help(fss_extended_read_setting_t * const setting, const fl_print_t print);
#endif // _di_fss_extended_read_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_extended_read_print_line_first_locked_
- extern f_status_t fss_extended_read_print_line_first_locked(fss_extended_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_extended_read_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_extended_read_print_line_first_unlocked_
- extern f_status_t fss_extended_read_print_line_first_unlocked(fss_extended_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_extended_read_print_line_first_unlocked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_extended_read_print_line_last_locked_
- extern f_status_t fss_extended_read_print_line_last_locked(fss_extended_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_extended_read_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_extended_read_print_line_last_unlocked_
- extern f_status_t fss_extended_read_print_line_last_unlocked(fss_extended_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_extended_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
setting->state.step_small = fss_identify_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[fss_identify_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_identify_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= fss_identify_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[fss_identify_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_identify_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= fss_identify_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- fss_identify_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
- fss_identify_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_identify_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_identify_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
- if (main->parameters.array[fss_identify_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[fss_identify_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { fss_identify_parameter_verbosity_quiet_e, fss_identify_parameter_verbosity_error_e, fss_identify_parameter_verbosity_verbose_e, fss_identify_parameter_verbosity_debug_e, fss_identify_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_identify_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_identify_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
* - file_to: Using a specified destination file.
* - help: Print help.
* - header: Enable printing of headers.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - separate: Enable printing of separators.
* - strip_invalid: Using strip invalid character mode.
* - verify: Using verify mode.
fss_identify_main_flag_file_to_e = 0x4,
fss_identify_main_flag_header_e = 0x8,
fss_identify_main_flag_help_e = 0x10,
- fss_identify_main_flag_separate_e = 0x20,
- fss_identify_main_flag_strip_invalid_e = 0x40,
- fss_identify_main_flag_verify_e = 0x80,
- fss_identify_main_flag_version_e = 0x100,
+ fss_identify_main_flag_print_first_e = 0x20,
+ fss_identify_main_flag_print_last_e = 0x40,
+ fss_identify_main_flag_separate_e = 0x80,
+ fss_identify_main_flag_strip_invalid_e = 0x100,
+ fss_identify_main_flag_verify_e = 0x200,
+ fss_identify_main_flag_version_e = 0x400,
}; // enum
#endif // _di_fss_identify_main_flag_e_
* flag: Flags passed to the main function.
*
* state: The state information.
- *
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
*/
#ifndef _di_fss_identify_setting_t_
typedef struct {
uint16_t flag;
f_state_t state;
-
- f_string_static_t line_first;
- f_string_static_t line_last;
} fss_identify_setting_t;
#define fss_identify_setting_t_initialize \
{ \
fss_identify_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
}
#endif // _di_fss_identify_setting_t_
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
- fss_identify_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_identify_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
- fss_identify_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_identify_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
if (main->parameters.array[fss_identify_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), fss_identify_program_version_s);
+ fll_program_print_version(main->message, fss_identify_program_version_s);
return F_none;
}
if (main->parameters.array[fss_identify_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
return F_none;
}
if (!((++main->signal_check) % fss_identify_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_identify_program_name_long_s, fss_identify_program_version_s);
fll_program_print_help_option_standard(print);
fl_print_format(" Whitespace must follow this pound character.%r", print.to, f_string_eol_s);
fl_print_format(" There may be multiple Object and Content pairs, separated by white space, such as: '# fss-0002 fss-0000 iki-0002'.%r", print.to, 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);
}
#endif // _di_fss_identify_print_help_
-#ifndef _di_fss_identify_print_line_first_locked_
- f_status_t fss_identify_print_line_first_locked(fss_identify_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_identify_print_line_first_locked_
-
-#ifndef _di_fss_identify_print_line_first_unlocked_
- f_status_t fss_identify_print_line_first_unlocked(fss_identify_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_identify_print_line_first_unlocked_
-
-#ifndef _di_fss_identify_print_line_last_locked_
- f_status_t fss_identify_print_line_last_locked(fss_identify_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & (fss_identify_main_flag_verify_e | fss_identify_main_flag_file_to_e)) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_identify_print_line_last_locked_
-
-#ifndef _di_fss_identify_print_line_last_unlocked_
- f_status_t fss_identify_print_line_last_unlocked(fss_identify_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & (fss_identify_main_flag_verify_e | fss_identify_main_flag_file_to_e)) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_identify_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t fss_identify_print_help(fss_identify_setting_t * const setting, const fl_print_t print);
#endif // _di_fss_identify_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_identify_print_line_first_locked_
- extern f_status_t fss_identify_print_line_first_locked(fss_identify_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_identify_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_identify_print_line_first_unlocked_
- extern f_status_t fss_identify_print_line_first_unlocked(fss_identify_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_identify_print_line_first_unlocked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_identify_print_line_last_locked_
- extern f_status_t fss_identify_print_line_last_locked(fss_identify_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_identify_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_identify_print_line_last_unlocked_
- extern f_status_t fss_identify_print_line_last_unlocked(fss_identify_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_identify_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
do {
if (!((++main->signal_check) % fss_identify_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
setting->state.step_small = fss_payload_read_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[payload_read_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & payload_read_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= payload_read_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[payload_read_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & payload_read_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= payload_read_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- fss_payload_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
- fss_payload_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_payload_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_payload_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
- if (main->parameters.array[fss_payload_read_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[fss_payload_read_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { fss_payload_read_parameter_verbosity_quiet_e, fss_payload_read_parameter_verbosity_error_e, fss_payload_read_parameter_verbosity_verbose_e, fss_payload_read_parameter_verbosity_debug_e, fss_payload_read_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- fss_payload_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->state.status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_payload_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
* Flags passed to the main function or program.
*
* fss_payload_read_main_flag_*_e:
- * - none: No flags set.
- * - at: Selecting at a specific index.
- * - content: Print Contents.
- * - copyright: Print copyright.
- * - help: Print help.
- * - literal: Print as literal data (printing entire variable).
- * - line: Selecting at a specific line.
- * - name: Selecting using a specific Vocabulary name.
- * - object: Print Objects.
- * - replace: Using re-assignments.
- * - replace: Using replacements.
- * - substitute: Using substitutions.
- * - total: Enable printing of "total" count.
- * - version: Print version.
- * - whole: Print all data.
- * - wrap: Using wrapping.
+ * - none: No flags set.
+ * - at: Selecting at a specific index.
+ * - content: Print Contents.
+ * - copyright: Print copyright.
+ * - help: Print help.
+ * - literal: Print as literal data (printing entire variable).
+ * - line: Selecting at a specific line.
+ * - name: Selecting using a specific Vocabulary name.
+ * - object: Print Objects.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
+ * - replace: Using re-assignments.
+ * - replace: Using replacements.
+ * - substitute: Using substitutions.
+ * - total: Enable printing of "total" count.
+ * - version: Print version.
+ * - whole: Print all data.
+ * - wrap: Using wrapping.
*/
#ifndef _di_fss_payload_read_main_flag_e_
enum {
- fss_payload_read_main_flag_none_e = 0x0,
- fss_payload_read_main_flag_at_e = 0x1,
- fss_payload_read_main_flag_content_e = 0x2,
- fss_payload_read_main_flag_copyright_e = 0x4,
- fss_payload_read_main_flag_help_e = 0x8,
- fss_payload_read_main_flag_literal_e = 0x10,
- fss_payload_read_main_flag_line_e = 0x20,
- fss_payload_read_main_flag_name_e = 0x40,
- fss_payload_read_main_flag_object_e = 0x80,
- fss_payload_read_main_flag_reassign_e = 0x100,
- fss_payload_read_main_flag_replace_e = 0x200,
- fss_payload_read_main_flag_substitute_e = 0x400,
- fss_payload_read_main_flag_total_e = 0x800,
- fss_payload_read_main_flag_version_e = 0x1000,
- fss_payload_read_main_flag_whole_e = 0x2000,
- fss_payload_read_main_flag_wrap_e = 0x4000,
+ fss_payload_read_main_flag_none_e = 0x0,
+ fss_payload_read_main_flag_at_e = 0x1,
+ fss_payload_read_main_flag_content_e = 0x2,
+ fss_payload_read_main_flag_copyright_e = 0x4,
+ fss_payload_read_main_flag_help_e = 0x8,
+ fss_payload_read_main_flag_literal_e = 0x10,
+ fss_payload_read_main_flag_line_e = 0x20,
+ fss_payload_read_main_flag_name_e = 0x40,
+ fss_payload_read_main_flag_object_e = 0x80,
+ fss_payload_read_main_flag_print_first_e = 0x100,
+ fss_payload_read_main_flag_print_last_e = 0x200,
+ fss_payload_read_main_flag_reassign_e = 0x400,
+ fss_payload_read_main_flag_replace_e = 0x800,
+ fss_payload_read_main_flag_substitute_e = 0x1000,
+ fss_payload_read_main_flag_total_e = 0x2000,
+ fss_payload_read_main_flag_version_e = 0x4000,
+ fss_payload_read_main_flag_whole_e = 0x8000,
+ fss_payload_read_main_flag_wrap_e = 0x10000,
}; // enum
#endif // _di_fss_payload_read_main_flag_e_
* flag: Flags passed to the main function.
*
* state: The state information.
- *
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
*/
#ifndef _di_fss_payload_read_setting_t_
typedef struct {
uint16_t flag;
f_state_t state;
-
- f_string_static_t line_first;
- f_string_static_t line_last;
} fss_payload_read_setting_t;
#define fss_payload_read_setting_t_initialize \
{ \
fss_payload_read_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
}
#endif // _di_fss_payload_read_setting_t_
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
- fss_payload_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", fll_error_file_flag_fallback_e);
- fss_payload_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[fss_payload_read_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_payload_read_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= fss_payload_read_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[fss_payload_read_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_payload_read_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= fss_payload_read_main_flag_print_last_e;
+ }
+
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { fss_payload_read_parameter_verbosity_quiet_e, fss_payload_read_parameter_verbosity_error_e, fss_payload_read_parameter_verbosity_verbose_e, fss_payload_read_parameter_verbosity_debug_e, fss_payload_read_parameter_verbosity_normal_e };
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
- fss_payload_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", fll_error_file_flag_fallback_e);
- fss_payload_read_print_line_last_locked(setting, main->error);
+
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error);
+ }
return;
}
}
if (main->parameters.array[fss_payload_read_parameter_version_e].result & f_console_result_found_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), fss_payload_read_program_version_s);
+ fll_program_print_version(main->message, fss_payload_read_program_version_s);
return status;
}
if (main->parameters.array[fss_payload_read_parameter_copyright_e].result & f_console_result_found_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
return status;
}
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
// The signal check is always performed on each pass.
if (size_file > fss_payload_read_block_max && fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
status = F_status_set_error(F_interrupt);
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_payload_read_program_name_long_s, fss_payload_read_program_version_s);
fll_program_print_help_option_standard(print);
fl_print_format(" will not contain any Content close pipe control codes when using", print.to);
fl_print_format(" %[%r%r%].%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_payload_read_long_pipe_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);
}
#endif // _di_fss_payload_read_print_help_
-#ifndef _di_fss_payload_read_print_line_first_locked_
- f_status_t fss_payload_read_print_line_first_locked(fss_payload_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_payload_read_print_line_first_locked_
-
-#ifndef _di_fss_payload_read_print_line_first_unlocked_
- f_status_t fss_payload_read_print_line_first_unlocked(fss_payload_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- return F_none;
- }
-#endif // _di_fss_payload_read_print_line_first_unlocked_
-
-#ifndef _di_fss_payload_read_print_line_last_locked_
- f_status_t fss_payload_read_print_line_last_locked(fss_payload_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & (fss_payload_read_main_flag_verify_e | fss_payload_read_main_flag_file_to_e)) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_payload_read_print_line_last_locked_
-
-#ifndef _di_fss_payload_read_print_line_last_unlocked_
- f_status_t fss_payload_read_print_line_last_unlocked(fss_payload_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
-
- if (F_status_is_error(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & (fss_payload_read_main_flag_verify_e | fss_payload_read_main_flag_file_to_e)) return F_output_not;
- }
-
- f_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_payload_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t fss_payload_read_print_help(fss_payload_read_setting_t * const setting, const fl_print_t print);
#endif // _di_fss_payload_read_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_payload_read_print_line_first_locked_
- extern f_status_t fss_payload_read_print_line_first_locked(fss_payload_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_payload_read_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_payload_read_print_line_first_unlocked_
- extern f_status_t fss_payload_read_print_line_first_unlocked(fss_payload_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_payload_read_print_line_first_unlocked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_payload_read_print_line_last_locked_
- extern f_status_t fss_payload_read_print_line_last_locked(fss_payload_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_payload_read_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_payload_read_print_line_last_unlocked_
- extern f_status_t fss_payload_read_print_line_last_unlocked(fss_payload_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_payload_read_print_line_last_unlocked_
-
#ifdef __cplusplus
} // extern "C"
#endif
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (data->depths.array[i].depth == data->depths.array[j].depth) {
if (main->error.verbosity < f_console_verbosity_normal_e) {
- fss_payload_read_print_line_first(setting, main->error, F_true);
-
fll_program_print_error_parameter_must_specify_once_value(main->error, f_console_symbol_long_normal_s, fss_payload_read_long_depth_s, data->depths.array[i].depth);
}
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
return F_status_set_error(F_interrupt);
}
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
- if (main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_first(setting, main->message);
- }
-
if (setting->content) {
fl_fss_basic_content_write(
*setting->content,
}
}
}
-
- if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_last(setting, main->message);
- }
}
#endif // _di_fss_write_basic_process_content_
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_write_basic_program_name_long_s, fss_write_program_version_s);
fss_write_print_help(setting, print);
fl_print_format(" This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_ignore_s, print.set->notable, f_string_eol_s);
fl_print_format(" This parameter requires two values.%r", print.to, 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);
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
- if (main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_first(setting, main->message);
- }
-
if (setting->content) {
fl_fss_basic_list_content_write(
*setting->content,
}
}
}
-
- if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_last(setting, main->message);
- }
}
#endif // _di_fss_write_basic_list_process_content_
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_write_basic_list_program_name_long_s, fss_write_program_version_s);
fss_write_print_help(setting, print);
fl_print_format(" This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_ignore_s, print.set->notable, f_string_eol_s);
fl_print_format(" This parameter requires two values.%r", print.to, 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);
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
- if (main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_first(setting, main->message);
- }
-
if (setting->content) {
fl_fss_embedded_list_content_write(
*setting->content,
}
}
}
-
- if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_last(setting, main->message);
- }
}
#endif // _di_fss_write_embedded_list_process_content_
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_write_embedded_list_program_name_long_s, fss_write_program_version_s);
fss_write_print_help(setting, print);
fl_print_format(" This parameter must be specified after a '%[%r%r%]'", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.set->notable);
fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%r%r%]' parameter.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_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);
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
- if (main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_first(setting, main->message);
- }
-
if (setting->content) {
fl_fss_extended_content_write(
*setting->content,
}
}
}
-
- if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_last(setting, main->message);
- }
}
#endif // _di_fss_write_extended_process_content_
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_write_extended_program_name_long_s, fss_write_program_version_s);
fss_write_print_help(setting, print);
fl_print_format(" This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_ignore_s, print.set->notable, f_string_eol_s);
fl_print_format(" This parameter requires two values.%r", print.to, 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);
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
- if (main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_first(setting, main->message);
- }
-
if (setting->content) {
fl_fss_extended_list_content_write(
*setting->content,
}
}
}
-
- if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_last(setting, main->message);
- }
}
#endif // _di_fss_write_extended_list_process_content_
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_write_extended_list_program_name_long_s, fss_write_program_version_s);
fss_write_print_help(setting, print);
fl_print_format(" This parameter must be specified after a '%[%r%r%]'", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.set->notable);
fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%r%r%]' parameter.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_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);
* - object: The Object being written is specified.
* - object_open: The Object open characters are to be printed.
* - partial: Do not write end of Object/Content character.
- * - print_first: When set, the first character printing logic is to be processed (this is usually automatic).
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - trim: Trim Object names.
* - version: Print version.
*/
fss_write_main_flag_partial_e = 0x400,
fss_write_main_flag_prepend_e = 0x800,
fss_write_main_flag_print_first_e = 0x1000,
- fss_write_main_flag_trim_e = 0x2000,
- fss_write_main_flag_version_e = 0x4000,
+ fss_write_main_flag_print_last_e = 0x2000,
+ fss_write_main_flag_trim_e = 0x4000,
+ fss_write_main_flag_version_e = 0x8000,
}; // enum
#endif // _di_fss_write_main_flag_e_
* state: The state data used when processing the FSS data.
* range: A range used as a buffer during processing.
*
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
- *
* quote: This holds the quote used during processing.
* standard: A human-friendly string describing the standard in use, such as "FSS-0000 (Basic)".
*
f_state_t state;
f_string_range_t range;
- f_string_static_t line_first;
- f_string_static_t line_last;
-
f_string_static_t quote;
f_string_static_t standard;
f_string_range_t_initialize, \
f_string_static_t_initialize, \
f_string_static_t_initialize, \
- f_string_static_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
setting->state.step_small = fss_write_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[fss_write_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_write_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= fss_write_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[fss_write_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & fss_write_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= fss_write_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error(setting, main->error, macro_fss_write_f(f_console_parameter_process));
return;
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error(setting, main->error, macro_fss_write_f(fll_program_parameter_process_context));
return;
}
}
- if (main->parameters.array[fss_write_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[fss_write_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { fss_write_parameter_verbosity_quiet_e, fss_write_parameter_verbosity_error_e, fss_write_parameter_verbosity_verbose_e, fss_write_parameter_verbosity_debug_e, fss_write_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error(setting, main->error, macro_fss_write_f(fll_program_parameter_process_verbosity));
return;
if (main->parameters.array[fss_write_parameter_file_e].values.used > 1) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
return;
setting->state.status = f_file_stream_open(main->parameters.arguments.array[index], f_string_empty_s, &main->output.to);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error_file(setting, main->error, macro_fss_write_f(f_file_stream_open), main->parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
return;
else if (main->parameters.array[fss_write_parameter_file_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
return;
setting->state.status = f_string_dynamics_resize(values->used, &setting->objects);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamics_resize));
return;
else if (main->parameters.array[fss_write_parameter_object_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_object_s);
return;
if (main->parameters.array[fss_write_parameter_content_e].values.used > main->parameters.array[fss_write_parameter_object_e].values.used) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error_one_content_only(setting, main->error);
return;
setting->state.status = f_string_dynamicss_increase_by(values_object->used, &setting->contentss);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamicss_increase_by));
return;
setting->state.status = f_string_dynamics_increase_by(total, &setting->contentss.array[j]);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamics_increase_by));
return;
else if (main->parameters.array[fss_write_parameter_content_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_content_s);
return;
setting->state.status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->prepend);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append_nulless));
return;
for (; range.start < main->parameters.arguments.array[index].used; range.start++) {
if (f_fss_is_space(main->parameters.arguments.array[index], range, &setting->state) == F_false) {
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
if (F_status_is_error(setting->state.status)) {
fss_write_print_error(setting, main->error, macro_fss_write_f(f_fss_is_space));
}
else if (main->parameters.array[fss_write_parameter_prepend_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_prepend_s);
return;
if (main->parameters.array[fss_write_parameter_ignore_e].values.used % 2 != 0) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, fss_write_string_two_s);
return;
setting->state.status = f_string_rangess_increase_by(values_data->used, &setting->ignoress);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_rangess_increase_by));
return;
setting->state.status = f_string_ranges_increase_by(total, &setting->ignoress.array[j]);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_ranges_increase_by));
return;
setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].start);
if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
return;
setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].stop);
if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
return;
if (setting->ignoress.array[j].array[setting->ignoress.array[j].used].stop > setting->ignoress.array[j].array[setting->ignoress.array[j].used].start) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_range_start_before_stop(
main->error,
f_console_symbol_long_normal_s,
setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.start);
if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
return;
setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.stop);
if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
return;
if (number.start > number.stop) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_range_start_before_stop(
main->error,
f_console_symbol_long_normal_s,
else if (main->parameters.array[fss_write_parameter_ignore_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s);
return;
if (!(setting->flag & fss_write_main_flag_partial_e)) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error.to);
+ }
fll_program_print_error_parameter_cannot_use_with_without(
main->error,
if (main->parameters.array[has_cannots[i][0]].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][0]);
return;
if (main->parameters.array[has_cannots[i][1]].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][1]);
return;
if (main->parameters.array[fss_write_parameter_object_e].locations_sub.used > main->parameters.array[fss_write_parameter_content_e].locations_sub.used && !(setting->flag & fss_write_main_flag_partial_e)) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fss_write_print_error_parameter_same_times_at_least(setting, main->error);
return;
if (main->parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_cannot_use_with_xor(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_write_long_partial_s, fss_write_long_object_s, fss_write_long_content_s);
return;
if (!main || !setting) return;
if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_last(setting, main->error);
+ if ((setting->flag & fss_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
+ if ((setting->flag & fss_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
setting->state.status = F_none;
if (setting->flag & fss_write_main_flag_help_e) {
setting->process_help(main, (void *) setting);
}
+ if ((setting->flag & fss_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
return;
}
if (setting->flag & fss_write_main_flag_version_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), fss_write_program_version_s);
+ fll_program_print_version(main->message, fss_write_program_version_s);
+
+ if ((setting->flag & fss_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
if (setting->flag & fss_write_main_flag_copyright_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
+
+ if ((setting->flag & fss_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
}
}
}
+
+ if ((setting->flag & fss_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
}
#endif // _di_fss_write_main_
if (!setting->process_set) return;
if (main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_first(setting, main->message);
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
const f_array_length_t used_objects = setting->objects.used;
if (!((++main->signal_check) % fss_write_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
setting->state.status = F_status_set_error(F_interrupt);
if (F_status_is_error_not(setting->state.status)) {
setting->state.status = (flag & 0x1) ? F_none : F_data_not;
}
-
- if (F_status_is_error(setting->state.status)) {
- fss_write_print_line_last(setting, main->message);
- }
- else if (!(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e | fss_write_main_flag_object_open_e | fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e))) {
- if (main->message.verbosity > f_console_verbosity_error_e) {
- fss_write_print_line_last(setting, main->message);
- }
- }
}
#endif // _di_fss_write_process_pipe_
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe format '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QThe format '%]", print.to, f_string_eol_s, 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);
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);
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);
break;
}
- if (setting->state.status != F_status_set_error(F_parameter)) {
- fss_write_print_line_first(setting, main->message);
- }
-
setting->state.status = F_status_set_error(F_parameter);
fss_write_main_print_error_format_unknown(main->error, argv[index]);
return;
}
- fss_write_print_line_first(setting, main->message);
+ if (main->error.verbosity > f_console_verbosity_quiet_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->error.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_as_s);
return;
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe%] ", print.to, print.context, print.prefix, print.context);
+ fl_print_format("%r%[%QThe%] ", print.to, f_string_eol_s, print.context, print.prefix, print.context);
fl_print_format("%[%r%]", print.to, print.notable, setting->standard, print.notable);
fl_print_format(" %[standard only supports one Content per Object.%]%r", print.to, print.context, print.context, f_string_eol_s);
f_file_stream_lock(print.to);
- fl_print_format("%[%QThe%] ", print.to, print.context, print.prefix, print.context);
+ fl_print_format("%r%[%QThe%] ", print.to, f_string_eol_s, print.context, print.prefix, print.context);
fl_print_format("%[%r%]", print.to, print.notable, setting->standard, print.notable);
fl_print_format(" %[standard does not support end of line character '%]", print.to, print.context, print.context);
fl_print_format("%[\\n%]", print.to, print.set->notable, print.set->notable);
}
#endif // _di_fss_write_print_help_pipe_
-#ifndef _di_fss_write_print_line_first_
- f_status_t fss_write_print_line_first(fss_write_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & fss_write_main_flag_file_to_e) return F_output_not;
- }
-
- if (setting->flag & fss_write_main_flag_print_first_e) {
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- setting->flag -= fss_write_main_flag_print_first_e;
- }
-
- return F_none;
- }
-#endif // _di_fss_write_print_line_first_
-
-#ifndef _di_fss_write_print_line_last_
- f_status_t fss_write_print_line_last(fss_write_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & fss_write_main_flag_file_to_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_fss_write_print_line_last_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern void fss_write_print_help_pipe(fss_write_setting_t * const setting, const fl_print_t print);
#endif // _di_fss_write_print_help_pipe_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_write_print_line_first_
- extern f_status_t fss_write_print_line_first(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_line_first_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- */
-#ifndef _di_fss_write_print_line_last_
- extern f_status_t fss_write_print_line_last(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_line_last_
-
#ifdef __cplusplus
} // extern "C"
#endif
if (!((++main->signal_check) % fss_write_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
setting->state.status = F_status_set_error(F_interrupt);
if (!(setting->flag & fss_write_main_flag_content_multiple_e)) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first(setting, main->message);
fss_write_print_error_one_content_only(setting, main->error);
break;
if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first(setting, main->message);
fss_write_print_error_one_content_only(setting, main->error);
break;
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first(setting, main->message);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
if (F_status_set_fine(setting->state.status) == F_none_eol) {
setting->state.status = F_status_set_error(F_support_not);
- fss_write_print_line_first(setting, main->message);
fss_write_print_error_unsupported_eol(setting, main->error);
return;
if (fl_string_dynamic_compare(argv[values->array[i]], fss_write_payload_s) == F_equal_to && i + 1 < values->used) {
setting->state.status = F_status_set_error(F_parameter);
- fss_write_print_line_first(setting, main->message);
fss_write_payload_print_error_payload_not_last(setting, main->error);
return;
f_file_stream_lock(print.to);
- 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);
+ fl_print_format("%r%[%QThe payload may only be specified last.%]%r", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error, f_string_eol_s);
f_file_stream_unlock(print.to);
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, fss_write_payload_program_name_long_s, fss_write_program_version_s);
fss_write_print_help(setting, print);
fl_print_format(" This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_ignore_s, print.set->notable, f_string_eol_s);
fl_print_format(" This parameter requires two values.%r", print.to, 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);
setting->state.step_small = iki_read_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[iki_read_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & iki_read_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= iki_read_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[iki_read_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & iki_read_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= iki_read_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(f_console_parameter_process));
return;
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(fll_program_parameter_process_context));
return;
}
}
- if (main->parameters.array[iki_read_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[iki_read_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { iki_read_parameter_verbosity_quiet_e, iki_read_parameter_verbosity_error_e, iki_read_parameter_verbosity_verbose_e, iki_read_parameter_verbosity_debug_e, iki_read_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(fll_program_parameter_process_verbosity));
return;
if (!(main->parameters.remaining.used || (main->pipe & fll_program_data_pipe_input_e))) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_missing_file(main->error);
return;
if (main->parameters.array[iki_read_parameter_whole_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_at_s, iki_read_long_whole_s);
return;
if (F_status_is_error(setting->state.status)) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, iki_read_long_at_s, main->parameters.arguments.array[index]);
return;
else if (main->parameters.array[iki_read_parameter_at_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_at_s);
return;
if (F_status_is_error(setting->state.status)) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, iki_read_long_line_s, main->parameters.arguments.array[index]);
return;
else if (main->parameters.array[iki_read_parameter_line_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_line_s);
return;
setting->state.status = f_string_dynamics_increase_by(main->parameters.array[iki_read_parameter_name_e].values.used, &setting->names);
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamics_increase_by));
return;
} // for
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamics_append));
return;
else if (main->parameters.array[iki_read_parameter_name_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_name_s);
return;
if ((main->parameters.array[iki_read_parameter_replace_e].result & f_console_result_found_e) || main->parameters.array[iki_read_parameter_replace_e].values.used % 2 != 0) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, iki_read_long_replace_s, iki_read_string_two_s);
return;
setting->state.status = f_string_maps_increase_by(main->parameters.array[iki_read_parameter_replace_e].values.used / 2, &setting->replace);
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_maps_increase_by));
return;
}
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize));
return;
if ((main->parameters.array[iki_read_parameter_wrap_e].result & f_console_result_found_e) || main->parameters.array[iki_read_parameter_wrap_e].values.used % 3 != 0) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, iki_read_long_wrap_s, iki_read_string_three_s);
return;
setting->state.status = f_string_triples_increase_by(main->parameters.array[iki_read_parameter_wrap_e].values.used / 3, &setting->wrap);
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_triples_increase_by));
return;
}
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize));
return;
if (main->parameters.array[ids[i]].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_literal_s, names[i]);
return;
if (main->parameters.array[ids[i]].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_object_s, names[i]);
return;
if (main->parameters.array[iki_read_parameter_total_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_content_s, iki_read_long_total_s);
return;
if (main->parameters.array[iki_read_parameter_whole_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_total_s, iki_read_long_wrap_s);
return;
setting->state.status = f_string_dynamics_resize(main->parameters.remaining.used, &setting->files);
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamics_resize));
return;
setting->state.status = f_string_dynamic_resize(0, &setting->files.array[setting->files.used]);
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize));
return;
setting->state.status = f_file_exists(setting->files.array[setting->files.used], F_true);
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->error);
- fll_error_file_print(main->error, F_status_set_fine(setting->state.status), "f_file_exists", fll_error_file_flag_fallback_e, setting->files.array[setting->files.used], f_file_operation_verify_s, fll_error_file_type_file_e);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
+ fll_error_file_print(main->error, F_status_set_fine(setting->state.status), macro_iki_read_f(f_file_exists), fll_error_file_flag_fallback_e, setting->files.array[setting->files.used], f_file_operation_verify_s, fll_error_file_type_file_e);
return;
}
if ((parameter.result & f_console_result_found_e) || parameter.values.used % 3 != 0) {
setting->state.status = F_status_set_error(F_parameter);
- iki_read_print_line_first(setting, main->error);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, name, iki_read_string_three_s);
return F_false;
setting->state.status = f_string_triples_increase_by(parameter.values.used / 3, triple);
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_triples_increase_by));
return F_false;
}
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_first(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize));
return F_false;
const f_string_t iki_read_f_a[] = {
"f_console_parameter_process",
"f_file_descriptor",
+ "f_file_exists",
"f_file_read",
"f_file_size_by_id",
"f_file_stream_open",
enum {
iki_read_f_f_console_parameter_process_e,
iki_read_f_f_file_descriptor_e,
+ iki_read_f_f_file_exists_e,
iki_read_f_f_file_read_e,
iki_read_f_f_file_size_by_id_e,
iki_read_f_f_file_stream_open_e,
* - line: Selecting at a specific line.
* - name: Selecting using a specific Vocabulary name.
* - object: Print Objects.
- * - print_first: When set, the first character printing logic is to be processed (this is usually automatic).
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - replace: Using re-assignments.
* - replace: Using replacements.
* - substitute: Using substitutions.
iki_read_main_flag_name_e = 0x40,
iki_read_main_flag_object_e = 0x80,
iki_read_main_flag_print_first_e = 0x100,
- iki_read_main_flag_reassign_e = 0x200,
- iki_read_main_flag_replace_e = 0x400,
- iki_read_main_flag_substitute_e = 0x800,
- iki_read_main_flag_total_e = 0x1000,
- iki_read_main_flag_version_e = 0x2000,
- iki_read_main_flag_whole_e = 0x4000,
- iki_read_main_flag_wrap_e = 0x8000,
+ iki_read_main_flag_print_last_e = 0x200,
+ iki_read_main_flag_reassign_e = 0x400,
+ iki_read_main_flag_replace_e = 0x800,
+ iki_read_main_flag_substitute_e = 0x1000,
+ iki_read_main_flag_total_e = 0x2000,
+ iki_read_main_flag_version_e = 0x4000,
+ iki_read_main_flag_whole_e = 0x8000,
+ iki_read_main_flag_wrap_e = 0x10000,
}; // enum
#endif // _di_iki_read_main_flag_e_
* at: The position representing the "at" index.
* line: The position representing the "line" index.
*
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
- *
* buffer: A buffer used for loading the files and other miscellaneous tasks.
* name: A string representing the IKI vocabulary name being selected.
* files: An array of all files to process (except for the input pipe).
f_array_length_t at;
f_array_length_t line;
- f_string_static_t line_first;
- f_string_static_t line_last;
-
f_string_dynamic_t buffer;
f_string_dynamics_t names;
f_string_dynamics_t files;
#define iki_read_setting_t_initialize \
{ \
- iki_read_main_flag_print_first_e, \
+ iki_read_main_flag_none_e, \
macro_f_state_t_initialize_1(iki_read_allocation_large_d, iki_read_allocation_small_d, F_none, 0, 0, 0, 0, 0, 0), \
0, \
0, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamics_t_initialize, \
if (!main || !setting) return;
if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_last(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
+ if ((setting->flag & iki_read_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
setting->state.status = F_none;
if (setting->flag & iki_read_main_flag_help_e) {
iki_read_print_help(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
return;
}
if (setting->flag & iki_read_main_flag_version_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), iki_read_program_version_s);
+ fll_program_print_version(main->message, iki_read_program_version_s);
+
+ if ((setting->flag & iki_read_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
if (setting->flag & iki_read_main_flag_copyright_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
+
+ if ((setting->flag & iki_read_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
- iki_read_print_line_first(setting, main->message);
-
if (main->pipe & fll_program_data_pipe_input_e) {
f_file_t file = f_file_t_initialize;
if (!((++main->signal_check) % iki_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
setting->state.status = F_status_set_error(F_interrupt);
// The signal check is always performed on each pass.
if (size_file > iki_read_block_max && fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
setting->state.status = F_status_set_error(F_interrupt);
}
}
- if (F_status_is_error(setting->state.status)) {
- iki_read_print_line_last(setting, main->message);
+ if ((setting->flag & iki_read_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
}
#endif // _di_iki_read_main_
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, iki_read_program_name_long_s, iki_read_program_version_s);
fll_program_print_help_option_standard(print);
fl_print_format(" The default behavior is to only display Content portion of the IKI Variable.%r", print.to, 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);
}
#endif // _di_iki_read_print_help_
-#ifndef _di_iki_read_print_line_first_
- f_status_t iki_read_print_line_first(iki_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- if (setting->flag & iki_read_main_flag_print_first_e) {
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- setting->flag -= iki_read_main_flag_print_first_e;
- }
-
- return F_none;
- }
-#endif // _di_iki_read_print_line_first_
-
-#ifndef _di_iki_read_print_line_last_
- f_status_t iki_read_print_line_last(iki_read_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_iki_read_print_line_last_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t iki_read_print_help(iki_read_setting_t * const setting, const fl_print_t print);
#endif // _di_iki_read_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- *
- * F_output_not (with error bit) if setting is NULL.
- */
-#ifndef _di_iki_read_print_line_first_
- extern f_status_t iki_read_print_line_first(iki_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_read_print_line_first_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- *
- * F_output_not (with error bit) if setting is NULL.
- */
-#ifndef _di_iki_read_print_line_last_
- extern f_status_t iki_read_print_line_last(iki_read_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_read_print_line_last_
-
#ifdef __cplusplus
} // extern "C"
#endif
if (!((++main->signal_check) % iki_read_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
f_string_dynamic_resize(0, &name);
setting->state.step_small = iki_write_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[iki_write_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & iki_write_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= iki_write_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[iki_write_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & iki_write_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= iki_write_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_first(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_write_print_error(setting, main->error, macro_iki_write_f(f_console_parameter_process));
return;
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_first(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_write_print_error(setting, main->error, macro_iki_write_f(fll_program_parameter_process_context));
return;
}
}
- if (main->parameters.array[iki_write_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[iki_write_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { iki_write_parameter_verbosity_quiet_e, iki_write_parameter_verbosity_error_e, iki_write_parameter_verbosity_verbose_e, iki_write_parameter_verbosity_debug_e, iki_write_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_first(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_write_print_error(setting, main->error, macro_iki_write_f(fll_program_parameter_process_verbosity));
return;
if (main->parameters.array[iki_write_parameter_file_e].values.used > 1) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
return;
setting->state.status = f_file_stream_open(main->parameters.arguments.array[index], f_string_empty_s, &main->output.to);
if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_first(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_error_file_print(main->error, F_status_set_fine(setting->state.status), "f_file_stream_open", fll_error_file_flag_fallback_e, main->parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
return;
else if (main->parameters.array[iki_write_parameter_file_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
return;
setting->state.status = f_string_dynamics_resize(values->used, &setting->objects);
if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_first(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamics_resize));
return;
else if (main->parameters.array[iki_write_parameter_object_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_object_s);
return;
setting->state.status = f_string_dynamics_resize(values->used, &setting->contents);
if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_first(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamics_resize));
return;
else if (main->parameters.array[iki_write_parameter_content_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_content_s);
return;
if (!(main->pipe & fll_program_data_pipe_input_e) && !(setting->flag & (iki_write_main_flag_content_e | iki_write_parameter_object_e))) {
setting->state.status = F_status_set_error(F_parameter);
- iki_write_print_line_first(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
iki_write_print_error_main_missing(setting, main->error);
return;
* - file_to: Using a specified destination file.
* - help: Print help.
* - object: The Object being written is specified.
- * - print_first: When set, the first character printing logic is to be processed (this is usually automatic).
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
+ * - print_last: The Object being written is specified.
* - version: Print version.
* - wrap: Wrap the vocabulary.
*/
iki_write_main_flag_help_e = 0x8,
iki_write_main_flag_object_e = 0x10,
iki_write_main_flag_print_first_e = 0x20,
- iki_write_main_flag_version_e = 0x40,
- iki_write_main_flag_wrap_e = 0x80,
+ iki_write_main_flag_print_last_e = 0x40,
+ iki_write_main_flag_version_e = 0x80,
+ iki_write_main_flag_wrap_e = 0x100,
}; // enum
#endif // _di_iki_write_main_flag_e_
*
* state: The state information.
*
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
- *
* quote: This holds the quote used during processing.
*
* escaped: A buffer used for escaping strings during processing.
f_state_t state;
- f_string_static_t line_first;
- f_string_static_t line_last;
-
f_string_static_t quote;
f_string_dynamic_t escaped;
#define iki_write_setting_t_initialize \
{ \
- iki_write_main_flag_print_first_e, \
+ iki_write_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
if (!main || !setting) return;
if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_last(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
+ if ((setting->flag & iki_write_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
setting->state.status = F_none;
if (setting->flag & iki_write_main_flag_help_e) {
iki_write_print_help(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
return;
}
if (setting->flag & iki_write_main_flag_version_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), iki_write_program_version_s);
+ fll_program_print_version(main->message, iki_write_program_version_s);
+
+ if ((setting->flag & iki_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
if (setting->flag & iki_write_main_flag_copyright_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
- return;
- }
+ if ((setting->flag & iki_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
- if (main->message.verbosity > f_console_verbosity_error_e) {
- iki_write_print_line_first(setting, main->message);
+ return;
}
setting->escaped.used = 0;
if (fll_program_standard_signal_received(main)) {
setting->state.status = F_status_set_error(F_interrupt);
- return;
+ object_ended = F_false;
+
+ break;
}
main->signal_check = 0;
setting->state.status = F_status_set_error(F_pipe);
iki_write_print_error_file(setting, main->error, macro_iki_write_f(f_file_read), f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
- iki_write_print_line_last(setting, main->message);
- return;
+ object_ended = F_false;
+
+ break;
}
if (!setting->buffer.used) {
setting->state.status = F_status_set_error(F_parameter);
fll_program_print_error_pipe_missing_content(main->error);
- iki_write_print_line_last(setting, main->message);
- return;
+ object_ended = F_false;
+
+ break;
}
range.stop = setting->buffer.used - 1;
if (F_status_is_error(setting->state.status)) {
iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamic_seek_to));
- return;
+ object_ended = F_false;
+
+ break;
}
if (object_ended && previous == range.start) {
setting->state.status = F_status_set_error(F_parameter);
fll_program_print_error_pipe_invalid_form_feed(main->error);
- iki_write_print_line_last(setting, main->message);
- return;
+ object_ended = F_false;
+
+ break;
}
range.stop = range.start - 1;
if (F_status_is_error(setting->state.status)) {
iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamic_partial_append_nulless));
- return;
+ object_ended = F_false;
+
+ break;
}
}
iki_write_process(main, setting, setting->object, setting->content);
- if (F_status_is_error(setting->state.status)) return;
+
+ if (F_status_is_error(setting->state.status)) {
+ object_ended = F_false;
+
+ break;
+ }
fll_print_dynamic_raw(f_string_eol_s, main->output.to);
if (F_status_is_error(setting->state.status)) {
iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamic_partial_append_nulless));
- return;
+ object_ended = F_false;
+
+ break;
}
object_ended = F_true;
setting->state.status = F_status_set_error(F_parameter);
fll_program_print_error_pipe_object_without_content(main->error);
- iki_write_print_line_last(setting, main->message);
-
- return;
}
}
- for (f_array_length_t i = 0; i < setting->objects.used; ++i) {
+ if (F_status_is_error_not(setting->state.status) && F_status_set_fine(setting->state.status) != F_interrupt) {
+ for (f_array_length_t i = 0; i < setting->objects.used; ++i) {
+
+ if (!((++main->signal_check) % iki_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ setting->state.status = F_status_set_error(F_interrupt);
- if (!((++main->signal_check) % iki_write_signal_check_d)) {
- if (fll_program_standard_signal_received(main)) {
- setting->state.status = F_status_set_error(F_interrupt);
+ break;
+ }
- break;
+ main->signal_check = 0;
}
- main->signal_check = 0;
- }
-
- iki_write_process(main, setting, setting->objects.array[i], setting->contents.array[i]);
- if (F_status_is_error(setting->state.status)) break;
+ iki_write_process(main, setting, setting->objects.array[i], setting->contents.array[i]);
+ if (F_status_is_error(setting->state.status)) break;
- fll_print_dynamic_raw(f_string_eol_s, main->output.to);
- } // for
+ fll_print_dynamic_raw(f_string_eol_s, main->output.to);
+ } // for
+ }
- if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
- iki_write_print_line_last(setting, main->message);
+ if ((setting->flag & iki_write_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
}
#endif // _di_iki_write_main_
#include <program/iki_write/main/common/type.h>
#include <program/iki_write/main/common.h>
#include <program/iki_write/main/print.h>
-#include <program/iki_write/main/print-error.h>
+#include <program/iki_write/main/print/error.h>
#include <program/iki_write/main/process.h>
#ifdef __cplusplus
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, iki_write_program_name_long_s, iki_write_program_version_s);
fll_program_print_help_option(print, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Print this help message.");
fl_print_format(" When piping main to this program, a single form-feed character (\\f) (U+000C) must be used to separate each Object from each Content.%r", print.to, f_string_eol_s);
fl_print_format(" Furthermore, each Object must be followed by a Content.%r", print.to, 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);
}
#endif // _di_iki_write_print_help_
-#ifndef _di_iki_write_print_line_first_
- f_status_t iki_write_print_line_first(iki_write_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- if (setting->flag & iki_write_main_flag_print_first_e) {
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- setting->flag -= iki_write_main_flag_print_first_e;
- }
-
- return F_none;
- }
-#endif // _di_iki_write_print_line_first_
-
-#ifndef _di_iki_write_print_line_last_
- f_status_t iki_write_print_line_last(iki_write_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_iki_write_print_line_last_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t iki_write_print_help(iki_write_setting_t * const setting, const fl_print_t print);
#endif // _di_iki_write_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- *
- * F_output_not (with error bit) if setting is NULL.
- */
-#ifndef _di_iki_write_print_line_first_
- extern f_status_t iki_write_print_line_first(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_first_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- *
- * F_output_not (with error bit) if setting is NULL.
- */
-#ifndef _di_iki_write_print_line_last_
- extern f_status_t iki_write_print_line_last(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_last_
-
#ifdef __cplusplus
} // extern "C"
#endif
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
- iki_write_print_line_first(setting, print);
fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
return F_none;
if (setting->state.status == F_false) {
setting->state.status = F_status_set_error(F_failure);
- iki_write_print_line_first(setting, main->message);
iki_write_print_error_object_not_valid(setting, main->error, object);
return;
}
if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_first(setting, main->message);
iki_write_print_error(setting, main->error, macro_iki_write_f(f_iki_object_is));
return;
setting->state.status = fll_iki_content_escape(content, setting->quote, &setting->escaped);
if (F_status_is_error(setting->state.status)) {
- iki_write_print_line_first(setting, main->message);
iki_write_print_error(setting, main->error, macro_iki_write_f(fll_iki_content_escape));
return;
#include <program/status_code/fss/common.h>
#include <program/status_code/main/convert.h>
#include <program/status_code/main/print.h>
-#include <program/status_code/main/print-data.h>
-#include <program/status_code/main/print-error.h>
+#include <program/status_code/main/print/data.h>
+#include <program/status_code/main/print/error.h>
#include <program/status_code/main/process.h>
#ifdef __cplusplus
setting->state.step_small = status_code_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[status_code_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & status_code_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= status_code_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[status_code_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & status_code_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= status_code_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
status_code_print_error(setting, main->error, macro_status_code_f(f_console_parameter_process));
return;
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
status_code_print_error(setting, main->error, macro_status_code_f(fll_program_parameter_process_context));
return;
}
}
- if (main->parameters.array[status_code_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[status_code_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { status_code_parameter_verbosity_quiet_e, status_code_parameter_verbosity_error_e, status_code_parameter_verbosity_verbose_e, status_code_parameter_verbosity_debug_e, status_code_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
status_code_print_error(setting, main->error, macro_status_code_f(fll_program_parameter_process_verbosity));
return;
if (!(setting->flag & status_code_main_flag_number_e)) {
setting->state.status = F_status_set_error(F_parameter);
- status_code_print_line_first(setting, main->message);
+ if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
status_code_print_error_cannot_error_warning_number(setting, main->error);
return;
if (setting->flag & status_code_main_flag_fine_e) {
setting->state.status = F_status_set_error(F_parameter);
- status_code_print_line_first(setting, main->message);
+ if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, status_code_long_error_s, status_code_long_fine_s);
return;
else if (setting->flag & status_code_main_flag_warning_e && setting->flag & status_code_main_flag_fine_e) {
setting->state.status = F_status_set_error(F_parameter);
- status_code_print_line_first(setting, main->message);
+ if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, status_code_long_warning_s, status_code_long_fine_s);
return;
if (main->parameters.remaining.used == 0 && !(main->pipe & fll_program_data_pipe_input_e)) {
setting->state.status = F_status_set_error(F_parameter);
- status_code_print_line_first(setting, main->message);
+ if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
status_code_print_error_no_status_codes(setting, main->error);
return;
* - fine: Check if status is "fine".
* - help: Print help.
* - number: Operate in number mode.
- * - print_first: When set, the first character printing logic is to be processed (this is usually automatic).
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
* - version: Print version.
* - warning: Check if status is "warning".
*/
status_code_main_flag_help_e = 0x8,
status_code_main_flag_number_e = 0x10,
status_code_main_flag_print_first_e = 0x20,
- status_code_main_flag_version_e = 0x40,
- status_code_main_flag_warning_e = 0x80,
+ status_code_main_flag_print_last_e = 0x40,
+ status_code_main_flag_version_e = 0x80,
+ status_code_main_flag_warning_e = 0x100,
}; // enum
#endif // _di_status_code_main_flag_e_
*
* state: The state information.
*
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
- *
* status_string_from: A pointer to the status string function (usually either fll_status_string_from() or fll_fss_status_string_from()).
* status_string_to: A pointer to the status string function (usually either f_status_string_to() or fll_fss_status_string_to()).
* status_string_help_detail: Print additional, more detailed help, in the help page (The setting paramete must be of type status_code_setting_t).
f_state_t state;
- f_string_static_t line_first;
- f_string_static_t line_last;
-
const f_string_static_t *program_name;
const f_string_static_t *program_name_long;
#define status_code_setting_t_initialize \
{ \
- status_code_main_flag_print_first_e, \
+ status_code_main_flag_none_e, \
f_state_t_initialize, \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
0, \
0, \
0, \
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(
print,
setting->program_name_long
setting->status_string_help_detail(setting, print);
}
- f_print_dynamic_raw(setting->line_last, print.to);
-
f_file_stream_flush(print.to);
f_file_stream_unlock(print.to);
}
#endif // _di_status_code_print_help_detail_
-#ifndef _di_status_code_print_line_first_
- f_status_t status_code_print_line_first(status_code_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- if (setting->flag & status_code_main_flag_print_first_e) {
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- setting->flag -= status_code_main_flag_print_first_e;
- }
-
- return F_none;
- }
-#endif // _di_status_code_print_line_first_
-
-#ifndef _di_status_code_print_line_last_
- f_status_t status_code_print_line_last(status_code_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_status_code_print_line_last_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t status_code_print_help_detail(void * const setting, const fl_print_t print);
#endif // _di_status_code_print_help_detail_
-/**
- * Print first new line, if applicable, otherwise nothing.
- *
- * This is generally intended to be used before data prints.
- *
- * This ensures a first line is printed if the data is the first output to be performed.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_dynamic_raw()
- */
-#ifndef _di_status_code_print_line_first_
- extern f_status_t status_code_print_line_first(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_first_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_dynamic_raw()
- */
-#ifndef _di_status_code_print_line_last_
- extern f_status_t status_code_print_line_last(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_last_
-
#ifdef __cplusplus
} // extern "C"
#endif
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
- status_code_print_line_first(setting, print);
fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
return F_none;
* F_output_not (with error bit) if setting is NULL.
*
* @see fll_error_print()
- *
- * @see status_code_print_line_first()
*/
#ifndef _di_status_code_print_error_
extern f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function);
if (!main || !setting) return;
if (F_status_is_error(setting->state.status)) {
- status_code_print_line_last(setting, main->message);
+ if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
- if (!setting->status_string_from || !setting->status_string_to) {
+ if ((setting->flag & status_code_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+ if (!setting->status_string_from || !setting->status_string_to) {
if (!setting->status_string_from) {
status_code_print_error_invalid_callback(setting, main->error, macro_status_code_f(status_string_from));
}
status_code_print_error_invalid_callback(setting, main->error, macro_status_code_f(status_string_to));
}
+ if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
setting->state.status = F_status_set_error(F_parameter);
return;
if (setting->flag & status_code_main_flag_help_e) {
status_code_print_help(setting, main->message);
+ if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
return;
}
if (setting->flag & status_code_main_flag_version_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), status_code_program_version_s);
+ fll_program_print_version(main->message, status_code_program_version_s);
+
+ if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
if (setting->flag & status_code_main_flag_copyright_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
- return;
- }
+ if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
- if (main->message.verbosity > f_console_verbosity_error_e) {
- status_code_print_line_first(setting, main->message);
+ return;
}
f_status_t status = F_none;
if (!((++main->signal_check) % status_code_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- f_file_stream_unlock(main->output.to);
-
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
-
setting->state.status = F_status_set_error(F_interrupt);
- return;
+ break;
}
main->signal_check = 0;
if (!((++main->signal_check) % status_code_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- f_file_stream_unlock(main->output.to);
-
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
-
setting->state.status = F_status_set_error(F_interrupt);
- return;
+ break;
}
main->signal_check = 0;
if (!((++main->signal_check) % status_code_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- f_file_stream_unlock(main->output.to);
-
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
-
setting->state.status = F_status_set_error(F_interrupt);
- return;
+ break;
}
main->signal_check = 0;
}
}
- if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
- status_code_print_line_last(setting, main->message);
+ if (setting->state.status == F_status_set_error(F_interrupt)) {
+ fll_program_print_signal_received(main->warning, main->signal_received);
+ }
+
+ if ((setting->flag & status_code_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
}
}
#endif // _di_status_code_main_
#include <program/status_code/main/common.h>
#include <program/status_code/main/convert.h>
#include <program/status_code/main/print.h>
-#include <program/status_code/main/print-data.h>
-#include <program/status_code/main/print-error.h>
+#include <program/status_code/main/print/data.h>
+#include <program/status_code/main/print/error.h>
#include <program/status_code/main/process.h>
#ifdef __cplusplus
if (!((++main->signal_check) % utf8_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
setting->state.status = F_interrupt;
if (!((++main->signal_check) % utf8_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
setting->state.status = F_status_set_error(F_interrupt);
setting->state.step_small = utf8_allocation_small_d;
+ // Identify and pocess first/last parameters.
+ if (main->parameters.array[utf8_parameter_line_first_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & utf8_main_flag_print_first_e;
+ }
+ else {
+ setting->flag |= utf8_main_flag_print_first_e;
+ }
+
+ if (main->parameters.array[utf8_parameter_line_last_no_e].result & f_console_result_found_e) {
+ setting->flag -= setting->flag & utf8_main_flag_print_last_e;
+ }
+ else {
+ setting->flag |= utf8_main_flag_print_last_e;
+ }
+
if (F_status_is_error(setting->state.status)) {
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error(setting, main->error, macro_utf8_f(f_console_parameter_process));
return;
setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->state.status)) {
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error(setting, main->error, macro_utf8_f(fll_program_parameter_process_context));
return;
}
}
- if (main->parameters.array[utf8_parameter_line_first_no_e].result & f_console_result_found_e) {
- setting->line_first = f_string_empty_s;
- }
- else {
- setting->line_first = f_string_eol_s;
- }
-
- if (main->parameters.array[utf8_parameter_line_last_no_e].result & f_console_result_found_e) {
- setting->line_last = f_string_empty_s;
- }
- else {
- setting->line_last = f_string_eol_s;
- }
-
// Identify and prioritize "verbosity" parameters.
{
uint16_t choices_array[5] = { utf8_parameter_verbosity_quiet_e, utf8_parameter_verbosity_error_e, utf8_parameter_verbosity_verbose_e, utf8_parameter_verbosity_debug_e, utf8_parameter_verbosity_normal_e };
setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->state.status)) {
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error(setting, main->error, macro_utf8_f(fll_program_parameter_process_verbosity));
return;
setting->state.status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
if (F_status_is_error(setting->state.status)) {
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error(setting, main->error, macro_utf8_f(f_console_parameter_prioritize_right));
return;
setting->state.status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
if (F_status_is_error(setting->state.status)) {
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error(setting, main->error, macro_utf8_f(f_console_parameter_prioritize_right));
return;
if (main->parameters.array[utf8_parameter_to_file_e].values.used > 1) {
setting->state.status = F_status_set_error(F_parameter);
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error_parameter_file_to_too_many(setting, main->error);
return;
setting->state.status = f_string_dynamics_increase_by(1, &setting->path_files_to);
if (F_status_is_error(setting->state.status)) {
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error(setting, main->error, macro_utf8_f(f_string_dynamics_increase_by));
return;
setting->state.status = f_string_dynamic_append_nulless(main->parameters.arguments.array[main->parameters.array[utf8_parameter_to_file_e].values.array[0]], &setting->path_files_to.array[0]);
if (F_status_is_error(setting->state.status)) {
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error(setting, main->error, macro_utf8_f(f_string_dynamic_append_nulless));
return;
setting->state.status = f_file_stream_open(main->parameters.arguments.array[main->parameters.array[utf8_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &main->output.to);
if (F_status_is_error(setting->state.status)) {
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error_file(setting, main->error, macro_utf8_f(f_file_stream_open), main->parameters.arguments.array[main->parameters.array[utf8_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
return;
setting->flag |= utf8_main_flag_file_to_e;
}
else {
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error_parameter_file_name_empty(setting, main->error, main->parameters.array[utf8_parameter_to_file_e].values.array[0]);
setting->state.status = F_status_set_error(F_parameter);
else if (main->parameters.array[utf8_parameter_to_file_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, utf8_long_to_file_s);
return;
setting->state.status = f_string_dynamics_increase_by(main->parameters.array[utf8_parameter_from_file_e].values.used, &setting->path_files_from);
if (F_status_is_error(setting->state.status)) {
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error(setting, main->error, macro_utf8_f(f_string_dynamics_increase_by));
return;
setting->state.status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->path_files_from.array[i]);
if (F_status_is_error(setting->state.status)) {
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_error_print(main->error, F_status_set_fine(setting->state.status), macro_utf8_f(f_string_dynamic_append_nulless), fll_error_file_flag_fallback_e);
break;
}
}
else {
+ if (F_status_is_error_not(setting->state.status)) {
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+ }
+
utf8_print_error_parameter_file_name_empty(setting, main->error, index);
if (F_status_is_error_not(setting->state.status)) {
else if (main->parameters.array[utf8_parameter_from_file_e].result & f_console_result_found_e) {
setting->state.status = F_status_set_error(F_parameter);
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, utf8_long_from_file_s);
return;
setting->state.status = f_string_dynamics_increase_by(main->parameters.remaining.used, &setting->remaining);
if (F_status_is_error(setting->state.status)) {
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error(setting, main->error, macro_utf8_f(f_string_dynamics_increase_by));
return;
if (!(main->parameters.array[utf8_parameter_from_file_e].result & f_console_result_found_e) && !((main->pipe & fll_program_data_pipe_input_e) || main->parameters.remaining.used)) {
setting->state.status = F_status_set_error(F_parameter);
- utf8_print_line_first(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
utf8_print_error_no_from(setting, main->error);
return;
* Flags passed to the main function or program.
*
* utf8_main_flag_*_e:
- * - none: No flags set.
- * - copyright: Print the copyright.
- * - file_from: Using a specified source file.
- * - file_to: Using a specified destination file.
- * - header: Enable printing of headers.
- * - help: Print help.
- * - pipe: Use the input pipe.
- * - print_first: When set, the first character printing logic is to be processed (this is usually automatic).
- * - separate: Enable printing of separators.
- * - strip_invalid: Using strip invalid character mode.
- * - verify: Using verify mode.
- * - version: Print version.
+ * - none: No flags set.
+ * - copyright: Print the copyright.
+ * - file_from: Using a specified source file.
+ * - file_to: Using a specified destination file.
+ * - header: Enable printing of headers.
+ * - help: Print help.
+ * - pipe: Use the input pipe.
+ * - print_first: When set, print new line to message output on program begin after loading settings.
+ * - print_last: When set, print new line to message output on program end.
+ * - separate: Enable printing of separators.
+ * - strip_invalid: Using strip invalid character mode.
+ * - verify: Using verify mode.
+ * - version: Print version.
*/
#ifndef _di_utf8_main_flag_e_
enum {
utf8_main_flag_help_e = 0x10,
utf8_main_flag_pipe_e = 0x20,
utf8_main_flag_print_first_e = 0x40,
- utf8_main_flag_separate_e = 0x80,
- utf8_main_flag_strip_invalid_e = 0x100,
- utf8_main_flag_verify_e = 0x200,
- utf8_main_flag_version_e = 0x400,
+ utf8_main_flag_print_last_e = 0x80,
+ utf8_main_flag_separate_e = 0x100,
+ utf8_main_flag_strip_invalid_e = 0x200,
+ utf8_main_flag_verify_e = 0x400,
+ utf8_main_flag_version_e = 0x800,
}; // enum
#endif // _di_utf8_main_flag_e_
* append: A string to append. A value of NULL results in not appending.
* prepend: A string to prepend. A value of NULL results in not prepending.
*
- * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
- * line_last: A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
- *
* buffer: A buffer to use for printing output (generally for storing a block of input from an input file).
* text: A buffer for storing a series of characters for processing (generally for code point processing).
*
f_string_static_t append;
f_string_static_t prepend;
- f_string_static_t line_first;
- f_string_static_t line_last;
-
f_string_dynamic_t buffer;
f_string_dynamic_t text;
#define utf8_setting_t_initialize \
{ \
utf8_mode_from_bytesequence_e | utf8_mode_to_codepoint_e, \
- utf8_main_flag_print_first_e, \
+ utf8_main_flag_none_e, \
f_state_t_initialize, \
f_color_set_t_initialize, \
f_color_set_t_initialize, \
f_string_static_t_initialize, \
f_string_static_t_initialize, \
- f_string_eol_s, \
- f_string_eol_s, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamics_t_initialize, \
f_file_stream_lock(print.to);
- f_print_dynamic_raw(setting->line_first, print.to);
-
fll_program_print_help_header(print, utf8_program_name_long_s, utf8_program_version_s);
fll_program_print_help_option_standard(print);
fl_print_format("'%[%r%]' character is printed to represent the combining and the digits are used to represent widths.%r", print.to, print.set->notable, utf8_string_combining_is_s, print.set->notable, f_string_eol_s);
fl_print_format(" The combining characters should be considered 1-width by themselves or 0-width when combined.%r", print.to, 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);
}
#endif // _di_utf8_print_help_
-#ifndef _di_utf8_print_line_first_
- f_status_t utf8_print_line_first(utf8_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- }
-
- if (setting->flag & utf8_main_flag_print_first_e) {
- fll_print_dynamic_raw(setting->line_first, print.to);
-
- setting->flag -= utf8_main_flag_print_first_e;
- }
-
- return F_none;
- }
-#endif // _di_utf8_print_line_first_
-
-#ifndef _di_utf8_print_line_last_
- f_status_t utf8_print_line_last(utf8_setting_t * const setting, const fl_print_t print) {
-
- if (!setting) return F_status_set_error(F_output_not);
- if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
- if (F_status_is_error_not(setting->state.status)) {
- if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
- if (setting->flag & (utf8_main_flag_verify_e | utf8_main_flag_file_to_e)) return F_output_not;
- }
-
- fll_print_dynamic_raw(setting->line_last, print.to);
-
- return F_none;
- }
-#endif // _di_utf8_print_line_last_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t utf8_print_help(utf8_setting_t * const setting, const fl_print_t print);
#endif // _di_utf8_print_help_
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_dynamic_raw()
- */
-#ifndef _di_utf8_print_line_first_
- extern f_status_t utf8_print_line_first(utf8_setting_t * const setting, const fl_print_t print);
-#endif // _di_utf8_print_line_first_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- * The main program settings.
- *
- * This does not alter setting.state.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.
- *
- * F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_dynamic_raw()
- */
-#ifndef _di_utf8_print_line_last_
- extern f_status_t utf8_print_line_last(utf8_setting_t * const setting, const fl_print_t print);
-#endif // _di_utf8_print_line_last_
-
#ifdef __cplusplus
} // extern "C"
#endif
f_file_stream_lock(print.to);
- if (!setting->line_first.used || index) {
- f_print_dynamic_raw(f_string_eol_s, print.to);
- }
-
if (setting->flag & utf8_main_flag_header_e) {
+ if (index) {
+ f_print_dynamic_raw(f_string_eol_s, print.to);
+ }
+
fl_print_format("%[File%] ", print.to, print.set->title, print.set->title);
if (setting->flag & utf8_main_flag_file_to_e) {
if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
- fl_print_format("%[%QFailed to decode character code '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QFailed to decode character code '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
if (invalid.used) {
fl_print_format("%[0x", print.to, print.set->notable);
if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
- fl_print_format("%[%QFailed to encode Unicode codepoint '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%r%[%QFailed to encode Unicode codepoint '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
fl_print_format("%[U+%_U%]", print.to, print.set->notable, codepoint, print.set->notable);
if (F_status_set_fine(setting->state.status) == F_utf_not) {
if (!setting) return F_status_set_error(F_output_not);
if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
- fll_print_format("%[%QNo from sources are specified, please pipe data, designate a file, or add parameters.%]%r", print.to, print.set->error, print.prefix, print.set->error, f_string_eol_s);
+ fll_print_format("%r%[%QNo from sources are specified, please pipe data, designate a file, or add parameters.%]%r", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error, f_string_eol_s);
return F_none;
}
if (!((++main->signal_check) % utf8_signal_check_d)) {
if (fll_program_standard_signal_received(main)) {
- fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+ fll_program_print_signal_received(main->warning, main->signal_received);
setting->state.status = F_status_set_error(F_interrupt);
if (!main || !setting) return;
if (F_status_is_error(setting->state.status)) {
- utf8_print_line_last(setting, main->message);
+ if ((setting->flag & utf8_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
+ if ((setting->flag & utf8_main_flag_print_first_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+
setting->state.status = F_none;
if (setting->flag & utf8_main_flag_help_e) {
}
if (setting->flag & utf8_main_flag_version_e) {
- fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), utf8_program_version_s);
+ fll_program_print_version(main->message, utf8_program_version_s);
+
+ if ((setting->flag & utf8_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
return;
}
if (setting->flag & utf8_main_flag_copyright_e) {
- fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
+ fll_program_print_copyright(main->message);
- return;
- }
+ if ((setting->flag & utf8_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
- if (main->message.verbosity > f_console_verbosity_error_e) {
- utf8_print_line_first(setting, main->message);
+ return;
}
f_status_t valid = F_true;
}
}
else {
- if (!(setting->flag & (utf8_main_flag_file_to_e | utf8_main_flag_header_e | utf8_main_flag_verify_e))) {
- if (!(setting->flag & utf8_main_flag_separate_e)) {
- fll_print_dynamic_raw(f_string_eol_s, main->output.to);
- }
+ if (!(setting->flag & (utf8_main_flag_file_to_e | utf8_main_flag_header_e | utf8_main_flag_verify_e | utf8_main_flag_separate_e))) {
+ fll_print_dynamic_raw(f_string_eol_s, main->output.to);
}
}
}
if (F_status_is_error(setting->state.status) && F_status_set_fine(setting->state.status) != F_utf_fragment && F_status_set_fine(setting->state.status) != F_complete_not_utf) {
- utf8_print_error_file(setting, main->error, setting->mode & utf8_mode_from_bytesequence_e ? macro_utf8_f(utf8_process_file_bytesequence) : macro_utf8_f(utf8_process_file_codepoint), setting->path_files_from.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
+ utf8_print_error_file(
+ setting,
+ main->error,
+ (setting->mode & utf8_mode_from_bytesequence_e)
+ ? macro_utf8_f(utf8_process_file_bytesequence)
+ : macro_utf8_f(utf8_process_file_codepoint),
+ setting->path_files_from.array[i],
+ f_file_operation_process_s,
+ fll_error_file_type_file_e
+ );
break;
}
} // for
}
- if (F_status_set_fine(setting->state.status) == F_interrupt) return;
-
- // Two lines are printed because the normal final end of line is never printed by design.
- // If this is an error or the header flag is set, then the normal end of line is printed by design so do not print this second new line.
- if (F_status_is_error_not(setting->state.status) && main->message.verbosity > f_console_verbosity_error_e && !(setting->flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) {
+ if ((setting->flag & utf8_main_flag_print_last_e) && main->message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->message.to);
- }
- utf8_print_line_last(setting, main->message);
+ // The last line for data is not printed under certain circumstances, but when last line is printed to screen, print an extra last line.
+ if (F_status_is_error_not(setting->state.status) && F_status_set_fine(setting->state.status) != F_interrupt) {
+ if (!(setting->flag & (utf8_main_flag_file_to_e | utf8_main_flag_header_e | utf8_main_flag_separate_e))) {
+ fll_print_dynamic_raw(f_string_eol_s, main->message.to);
+ }
+ }
+ }
+ if (F_status_set_fine(setting->state.status) == F_interrupt) return;
if (F_status_is_error(setting->state.status)) return;
if (setting->flag & utf8_main_flag_verify_e) {
#include <program/utf8/main/bytesequence.h>
#include <program/utf8/main/codepoint.h>
#include <program/utf8/main/print.h>
-#include <program/utf8/main/print-data.h>
-#include <program/utf8/main/print-error.h>
+#include <program/utf8/main/print/data.h>
+#include <program/utf8/main/print/error.h>
#include <program/utf8/main/process.h>
#ifdef __cplusplus