Lots of print related changes and improvements.
Primarily working on fss_payload_write changes.
}
#endif // _di_fll_program_print_error_parameter_cannot_use_with_
+#ifndef _di_fll_program_print_error_parameter_cannot_use_with_pipe_
+ f_status_t fll_program_print_error_parameter_cannot_use_with_pipe(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ 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("%[%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_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_fll_program_print_error_parameter_cannot_use_with_pipe_
+
+#ifndef _di_fll_program_print_error_parameter_cannot_use_with_xor_
+ f_status_t fll_program_print_error_parameter_cannot_use_with_xor(const fl_print_t print, const f_string_static_t symbol_first, const f_string_static_t symbol_second, const f_string_static_t symbol_third, const f_string_static_t first, const f_string_static_t second, const f_string_static_t third) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ 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_first, first, 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_second, second, print.set->notable);
+ fl_print_format("%[' parameter or the '%]", print.to, print.set->error, print.set->error);
+ fl_print_format("%[%Q%Q%]", print.to, print.set->notable, symbol_third, third, print.set->notable);
+ fl_print_format("%[' parameter, but not both.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_fll_program_print_error_parameter_cannot_use_with_xor_
+
#ifndef _di_fll_program_print_error_parameter_integer_not_
f_status_t fll_program_print_error_parameter_integer_not(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter, const f_string_static_t value) {
#endif // _di_fll_program_print_error_parameter_cannot_use_with_
/**
+ * Print message about one parameter not being allowed to be used when processing a pipe.
+ *
+ * This is only printed when verbosity is not set to quiet.
+ *
+ * This uses the following:
+ * - print.set->error: For the error context.
+ * - print.set->strong: For the highlighting context
+ * - print.prefix: For the prefixing a string to the message (such as "ERROR:").
+ *
+ * @param print
+ * The output structure.
+ * This locks, uses, and unlocks the file stream.
+ * @param symbol
+ * The symbol string prepended to the first parameter.
+ * This is usually f_console_symbol_long_enable_s.
+ * @param parameter
+ * The parameter name.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fll_program_print_error_parameter_cannot_use_with_pipe_
+ extern f_status_t fll_program_print_error_parameter_cannot_use_with_pipe(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter);
+#endif // _di_fll_program_print_error_parameter_cannot_use_with_pipe_
+
+/**
+ * Print message about two parameters not being allowed to be used together with another specified parameter.
+ *
+ * This is only printed when verbosity is not set to quiet.
+ *
+ * This uses the following:
+ * - print.set->error: For the error context.
+ * - print.set->strong: For the highlighting context
+ * - print.prefix: For the prefixing a string to the message (such as "ERROR:").
+ *
+ * @param print
+ * The output structure.
+ * This locks, uses, and unlocks the file stream.
+ * @param symbol_first
+ * The symbol string prepended to the first parameter.
+ * This is usually f_console_symbol_long_enable_s.
+ * @param symbol_second
+ * The symbol string prepended to the second parameter.
+ * This is usually f_console_symbol_long_enable_s.
+ * @param symbol_third
+ * The symbol string prepended to the third parameter.
+ * This is usually f_console_symbol_long_enable_s.
+ * @param first
+ * The first parameter name.
+ *
+ * This represents the parameter that imposes the exclusive or relation on the second and third parameters.
+ * @param second
+ * The second parameter name.
+ *
+ * This represents the parameter that is an exclusive or with the third parameter.
+ * @param third
+ * The second parameter name.
+ *
+ * This represents the parameter that is an exclusive or with the second parameter.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fll_program_print_error_parameter_allows_either_xor_
+ extern f_status_t fll_program_print_error_parameter_cannot_use_with_xor(const fl_print_t print, const f_string_static_t symbol_first, const f_string_static_t symbol_second, const f_string_static_t symbol_third, const f_string_static_t first, const f_string_static_t second, const f_string_static_t third);
+#endif // _di_fll_program_print_error_parameter_allows_either_xor_
+
+/**
* Print message about parameter not being a valid integer.
*
* This is only printed when verbosity is not set to quiet.
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", F_true);
+ byte_dump_print_line_last_locked(setting, 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", F_true);
+ byte_dump_print_line_last_locked(setting, main->error);
return;
}
// Byte Dump includes.
#include <program/byte_dump/common.h>
+#include <program/byte_dump/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ byte_dump_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ byte_dump_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- byte_dump_print_line_first(setting, main->error, F_true);
+ byte_dump_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ byte_dump_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- byte_dump_print_line_first(setting, main->error, F_true);
+ byte_dump_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ byte_dump_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[byte_dump_parameter_strip_invalid_e].result == f_console_result_found_e) {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ control_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ control_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- control_print_line_first(setting, main->error, F_true);
+ control_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ control_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- control_print_line_first(setting, main->error, F_true);
+ control_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ control_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[control_parameter_strip_invalid_e].result == f_console_result_found_e) {
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", F_true);
+ control_print_line_last_locked(setting, 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", F_true);
+ control_print_line_last_locked(setting, main->error);
return;
}
// Control includes.
#include <program/control/common.h>
+#include <program/control/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ controller_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ controller_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- controller_print_line_first(setting, main->error, F_true);
+ controller_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ controller_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- controller_print_line_first(setting, main->error, F_true);
+ controller_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ controller_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[controller_parameter_strip_invalid_e].result == f_console_result_found_e) {
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", F_true);
+ controller_print_line_last_locked(setting, 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", F_true);
+ controller_print_line_last_locked(setting, main->error);
return;
}
// Controller includes.
#include <program/controller/common.h>
+#include <program/controller/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fake_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fake_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fake_print_line_first(setting, main->error, F_true);
+ fake_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fake_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fake_print_line_first(setting, main->error, F_true);
+ fake_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fake_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fake_parameter_strip_invalid_e].result == f_console_result_found_e) {
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
+ fake_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+ fake_print_line_last_locked(setting, main->error);
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
+ fake_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+ fake_print_line_last_locked(setting, main->error);
return;
}
// Featureless Make includes.
#include <program/fake/common.h>
+#include <program/fake/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ firewall_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ firewall_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- firewall_print_line_first(setting, main->error, F_true);
+ firewall_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ firewall_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- firewall_print_line_first(setting, main->error, F_true);
+ firewall_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ firewall_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[firewall_parameter_strip_invalid_e].result == f_console_result_found_e) {
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", F_true);
+ firewall_print_line_last_locked(setting, 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", F_true);
+ firewall_print_line_last_locked(setting, main->error);
return;
}
// Firewall includes.
#include <program/firewall/common.h>
+#include <program/firewall/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_basic_list_read_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_basic_list_read_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_basic_list_read_print_line_first(setting, main->error, F_true);
+ fss_basic_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_basic_list_read_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_basic_list_read_print_line_first(setting, main->error, F_true);
+ fss_basic_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_basic_list_read_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_basic_list_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
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", F_true);
+ fss_basic_list_read_print_line_last_locked(setting, 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", F_true);
+ fss_basic_list_read_print_line_last_locked(setting, main->error);
return;
}
// FSS Basic List Read includes.
#include <program/fss_basic_list_read/common.h>
+#include <program/fss_basic_list_read/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_basic_list_write_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_basic_list_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_basic_list_write_print_line_first(setting, main->error, F_true);
+ fss_basic_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_basic_list_write_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_basic_list_write_print_line_first(setting, main->error, F_true);
+ fss_basic_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_basic_list_write_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_basic_list_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
+ fss_basic_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+ fss_basic_list_write_print_line_last_locked(setting, main->error);
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
+ fss_basic_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+ fss_basic_list_write_print_line_last_locked(setting, main->error);
return;
}
// FSS Basic List Write includes.
#include <program/fss_basic_list_write/common.h>
+#include <program/fss_basic_list_write/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_basic_read_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_basic_read_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_basic_read_print_line_first(setting, main->error, F_true);
+ fss_basic_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_basic_read_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_basic_read_print_line_first(setting, main->error, F_true);
+ fss_basic_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_basic_read_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_basic_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
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", F_true);
+ fss_basic_read_print_line_last_locked(setting, 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", F_true);
+ fss_basic_read_print_line_last_locked(setting, main->error);
return;
}
// FSS Basic Read includes.
#include <program/fss_basic_read/common.h>
+#include <program/fss_basic_read/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_basic_write_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_basic_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_basic_write_print_line_first(setting, main->error, F_true);
+ fss_basic_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_basic_write_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_basic_write_print_line_first(setting, main->error, F_true);
+ fss_basic_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_basic_write_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_basic_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
+ fss_basic_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+ fss_basic_write_print_line_last_locked(setting, main->error);
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
+ fss_basic_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+ fss_basic_write_print_line_last_locked(setting, main->error);
return;
}
// FSS Basic Write includes.
#include <program/fss_basic_write/common.h>
+#include <program/fss_basic_write/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_embedded_list_read_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_embedded_list_read_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_embedded_list_read_print_line_first(setting, main->error, F_true);
+ fss_embedded_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_embedded_list_read_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_embedded_list_read_print_line_first(setting, main->error, F_true);
+ fss_embedded_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_embedded_list_read_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_embedded_list_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
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", F_true);
+ fss_embedded_list_read_print_line_last_locked(setting, 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", F_true);
+ fss_embedded_list_read_print_line_last_locked(setting, main->error);
return;
}
// FSS Embedded List Read includes.
#include <program/fss_embedded_list_read/common.h>
+#include <program/fss_embedded_list_read/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_embedded_list_write_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_embedded_list_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_embedded_list_write_print_line_first(setting, main->error, F_true);
+ fss_embedded_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_embedded_list_write_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_embedded_list_write_print_line_first(setting, main->error, F_true);
+ fss_embedded_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_embedded_list_write_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_embedded_list_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
+ fss_embedded_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+ fss_embedded_list_write_print_line_last_locked(setting, main->error);
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
+ fss_embedded_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+ fss_embedded_list_write_print_line_last_locked(setting, main->error);
return;
}
// FSS Embedded List Write includes.
#include <program/fss_embedded_list_write/common.h>
+#include <program/fss_embedded_list_write/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_extended_list_read_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_extended_list_read_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_extended_list_read_print_line_first(setting, main->error, F_true);
+ fss_extended_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_extended_list_read_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_extended_list_read_print_line_first(setting, main->error, F_true);
+ fss_extended_list_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_extended_list_read_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_extended_list_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
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", F_true);
+ fss_extended_list_read_print_line_last_locked(setting, 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", F_true);
+ fss_extended_list_read_print_line_last_locked(setting, main->error);
return;
}
// FSS Extended List Read includes.
#include <program/fss_extended_list_read/common.h>
+#include <program/fss_extended_list_read/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_extended_list_write_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_extended_list_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_extended_list_write_print_line_first(setting, main->error, F_true);
+ fss_extended_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_extended_list_write_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_extended_list_write_print_line_first(setting, main->error, F_true);
+ fss_extended_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_extended_list_write_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_extended_list_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(status)) {
+ fss_extended_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+ fss_extended_list_write_print_line_last_locked(setting, main->error);
return;
}
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
+ fss_extended_list_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+ fss_extended_list_write_print_line_last_locked(setting, main->error);
return;
}
// FSS Extended List Write includes.
#include <program/fss_extended_list_write/common.h>
+#include <program/fss_extended_list_write/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_extended_read_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_extended_read_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_extended_read_print_line_first(setting, main->error, F_true);
+ fss_extended_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_extended_read_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_extended_read_print_line_first(setting, main->error, F_true);
+ fss_extended_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_extended_read_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_extended_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
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", F_true);
+ fss_extended_read_print_line_last_locked(setting, 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", F_true);
+ fss_extended_read_print_line_last_locked(setting, main->error);
return;
}
// FSS Extended Read includes.
#include <program/fss_extended_read/common.h>
+#include <program/fss_extended_read/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_extended_write_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_extended_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_extended_write_print_line_first(setting, main->error, F_true);
+ fss_extended_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_extended_write_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_extended_write_print_line_first(setting, main->error, F_true);
+ fss_extended_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_extended_write_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_extended_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(status)) {
+ fss_extended_write_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+ fss_extended_write_print_line_last_locked(setting, main->error);
return;
}
// FSS Extended Write includes.
#include <program/fss_extended_write/common.h>
+#include <program/fss_extended_write/print.h>
#ifdef __cplusplus
extern "C" {
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_identify_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_identify_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_identify_print_line_first(setting, main->error, F_true);
+ fss_identify_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_identify_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_identify_print_line_first(setting, main->error, F_true);
+ fss_identify_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_identify_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_identify_parameter_strip_invalid_e].result == f_console_result_found_e) {
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", F_true);
+ fss_identify_print_line_last_locked(setting, 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", F_true);
+ fss_identify_print_line_last_locked(setting, main->error);
return;
}
// FSS Identify includes.
#include <program/fss_identify/common.h>
+#include <program/fss_identify/print.h>
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
+#ifndef _di_fss_payload_read_program_version_
+ const f_string_static_t fss_payload_read_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_version_s, 0, FSS_PAYLOAD_READ_program_version_s_length);
+#endif // _di_fss_payload_read_program_version_
+
+#ifndef _di_fss_payload_read_program_name_
+ const f_string_static_t fss_payload_read_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_s, 0, FSS_PAYLOAD_READ_program_name_s_length);
+ const f_string_static_t fss_payload_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_long_s, 0, FSS_PAYLOAD_READ_program_name_long_s_length);
+#endif // _di_fss_payload_read_program_name_
+
#ifndef _di_fss_payload_read_defines_
const f_string_static_t fss_payload_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_name_s, 0, FSS_PAYLOAD_READ_pipe_name_s_length);
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_payload_read_print_line_first_locked(setting, main->error);
+ fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
+ fss_payload_read_print_line_last_locked(setting, main->error);
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_payload_read_print_line_first(setting, main->error, F_true);
+ fss_payload_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_payload_read_print_line_last_locked(setting, main->error);
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_payload_read_print_line_first(setting, main->error, F_true);
+ fss_payload_read_print_line_first_locked(setting, main->error);
fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_payload_read_print_line_last_locked(setting, main->error);
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;
+
f_string_static_t * const args = main->parameters.arguments.array;
if (main->parameters.array[fss_payload_read_parameter_strip_invalid_e].result == f_console_result_found_e) {
* Flags used to represent flags passed to the main function.
*
* fss_payload_read_main_flag_*_e:
- * - none: No modes in use.
- * - file_from: Using a specified source file.
- * - file_to: Using a specified destination file.
- * - help: Print help.
- * - header: Enable printing of headers.
- * - separate: Enable printing of separators.
- * - strip_invalid: Using strip invalid character mode.
- * - verify: Using verify mode.
- * - version: Print version.
+ * - none: No modes in use.
+ * - at: Selecting at a specific index.
+ * - content: Print Contents.
+ * - 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.
*/
#ifndef _di_fss_payload_read_main_flag_e_
enum {
- fss_payload_read_main_flag_none_e = 0x0,
- fss_payload_read_main_flag_file_from_e = 0x1,
- fss_payload_read_main_flag_file_to_e = 0x2,
- fss_payload_read_main_flag_header_e = 0x4,
- fss_payload_read_main_flag_help_e = 0x8,
- fss_payload_read_main_flag_separate_e = 0x10,
- fss_payload_read_main_flag_strip_invalid_e = 0x20,
- fss_payload_read_main_flag_verify_e = 0x40,
- fss_payload_read_main_flag_version_e = 0x80,
+ 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_help_e = 0x4,
+ fss_payload_read_main_flag_literal_e = 0x8,
+ fss_payload_read_main_flag_line_e = 0x10,
+ fss_payload_read_main_flag_name_e = 0x20,
+ fss_payload_read_main_flag_object_e = 0x40,
+ fss_payload_read_main_flag_reassign_e = 0x80,
+ fss_payload_read_main_flag_replace_e = 0x100,
+ fss_payload_read_main_flag_substitute_e = 0x200,
+ fss_payload_read_main_flag_total_e = 0x400,
+ fss_payload_read_main_flag_version_e = 0x800,
+ fss_payload_read_main_flag_whole_e = 0x1000,
+ fss_payload_read_main_flag_wrap_e = 0x2000,
};
#endif // _di_fss_payload_read_main_flag_e_
extern "C" {
#endif
-#ifndef _di_fss_payload_read_program_version_
- const f_string_static_t fss_payload_read_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_version_s, 0, FSS_PAYLOAD_READ_program_version_s_length);
-#endif // _di_fss_payload_read_program_version_
-
-#ifndef _di_fss_payload_read_program_name_
- const f_string_static_t fss_payload_read_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_s, 0, FSS_PAYLOAD_READ_program_name_s_length);
- const f_string_static_t fss_payload_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_long_s, 0, FSS_PAYLOAD_READ_program_name_long_s_length);
-#endif // _di_fss_payload_read_program_name_
-
#ifndef _di_fss_payload_read_main_
f_status_t fss_payload_read_main(fll_program_data_t * const main, fss_payload_read_setting_t * const setting) {
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", F_true);
+ fss_payload_read_print_line_last_locked(setting, main->error);
return;
}
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", F_true);
+ fss_payload_read_print_line_last_locked(setting, main->error);
return;
}
// FSS Payload Read includes.
#include <program/fss_payload_read/common.h>
+#include <program/fss_payload_read/print.h>
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
+#ifndef _di_fss_payload_write_program_version_
+ const f_string_static_t fss_payload_write_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_version_s, 0, FSS_PAYLOAD_WRITE_program_version_s_length);
+#endif // _di_fss_payload_write_program_version_
+
+#ifndef _di_fss_payload_write_program_name_
+ const f_string_static_t fss_payload_write_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_s, 0, FSS_PAYLOAD_WRITE_program_name_s_length);
+ const f_string_static_t fss_payload_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_long_s, 0, FSS_PAYLOAD_WRITE_program_name_long_s_length);
+#endif // _di_fss_payload_write_program_name_
+
#ifndef _di_fss_payload_write_defines_
const f_string_static_t fss_payload_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_pipe_content_end_s, 0, FSS_PAYLOAD_WRITE_pipe_content_end_s_length);
const f_string_static_t fss_payload_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_pipe_content_ignore_s, 0, FSS_PAYLOAD_WRITE_pipe_content_ignore_s_length);
if (!setting) return F_status_set_error(F_parameter);
+ f_string_dynamic_resize(0, &setting->escaped);
+ f_string_dynamic_resize(0, &setting->buffer);
+ f_string_dynamic_resize(0, &setting->object);
+ f_string_dynamic_resize(0, &setting->content);
+ f_string_dynamic_resize(0, &setting->prepend);
+
+ f_string_dynamics_resize(0, &setting->objects);
+ f_string_dynamics_resize(0, &setting->contents);
+
return F_none;
}
#endif // _di_fss_payload_write_setting_delete_
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ fss_payload_write_print_error(setting, main->error, "f_console_parameter_process");
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_payload_write_print_line_first(setting, main->error, F_true);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
+ fss_payload_write_print_error(setting, main->error, "fll_program_parameter_process_context");
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- fss_payload_write_print_line_first(setting, main->error, F_true);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
+ fss_payload_write_print_error(setting, main->error, "fll_program_parameter_process_verbosity");
return;
}
}
}
- f_string_static_t * const args = main->parameters.arguments.array;
+ 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;
+
+ if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_additional_e && main->parameters.array[fss_payload_write_parameter_file_e].values.used) {
+ if (main->parameters.array[fss_payload_write_parameter_file_e].values.used > 1) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_file_s);
+ fss_payload_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
+
+ const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_file_e].values.array[0];
+
+ main->output.to.id = -1;
+ main->output.to.stream = 0;
+
+ setting->status = f_file_stream_open(main->parameters.arguments.array[index], f_string_empty_s, &main->output.to);
+
+ if (F_status_is_error(setting->status)) {
+ fss_payload_write_print_error_file(setting, main->error, "f_file_stream_open", main->parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
+
+ return;
+ }
+
+ setting->flag |= fss_payload_write_main_flag_file_to_e;
+ }
+ else if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_found_e) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_file_s);
+ fss_payload_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
+
+ if (main->parameters.array[fss_payload_write_parameter_object_e].result == f_console_result_additional_e && main->parameters.array[fss_payload_write_parameter_object_e].values.used) {
+ f_array_lengths_t * const values = &main->parameters.array[fss_payload_write_parameter_object_e].values;
+
+ setting->objects.used = 0;
+
+ setting->status = f_string_dynamics_resize(values->used, &setting->objects);
+
+ if (F_status_is_error(setting->status)) {
+ fss_payload_write_print_error(setting, main->error, "f_string_dynamics_resize");
+
+ return;
+ }
+
+ // Construct the array without allocating any more memory by setting this as a static string (used > 0, size = 0).
+ for (f_array_length_t index = 0; setting->objects.used < values->used; ) {
+
+ index = values->array[setting->objects.used];
+
+ setting->objects.array[setting->objects.used].string = main->parameters.arguments.array[index].string;
+ setting->objects.array[setting->objects.used].used = main->parameters.arguments.array[index].used;
+ setting->objects.array[setting->objects.used++].size = 0;
+ } // for
+
+ setting->flag |= fss_payload_write_main_flag_object_e;
+ }
+ else if (main->parameters.array[fss_payload_write_parameter_object_e].result == f_console_result_found_e) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_object_s);
+ fss_payload_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
+
+ if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_additional_e && main->parameters.array[fss_payload_write_parameter_content_e].values.used) {
+ f_array_lengths_t * const values = &main->parameters.array[fss_payload_write_parameter_content_e].values;
+
+ setting->contents.used = 0;
+
+ setting->status = f_string_dynamics_resize(values->used, &setting->contents);
+
+ if (F_status_is_error(setting->status)) {
+ fss_payload_write_print_error(setting, main->error, "f_string_dynamics_resize");
+
+ return;
+ }
+
+ // Construct the array without allocating any more memory by setting this as a static string (used > 0, size = 0).
+ for (f_array_length_t index = 0; setting->contents.used < values->used; ) {
+
+ index = values->array[setting->contents.used];
+
+ setting->contents.array[setting->contents.used].string = main->parameters.arguments.array[index].string;
+ setting->contents.array[setting->contents.used].used = main->parameters.arguments.array[index].used;
+ setting->contents.array[setting->contents.used++].size = 0;
+ } // for
+
+ setting->flag |= fss_payload_write_main_flag_content_e;
+ }
+ else if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_found_e) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
+ fss_payload_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
+
+ if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e && main->parameters.array[fss_payload_write_parameter_prepend_e].values.used) {
+ const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1];
+
+ setting->prepend.used = 0;
+
+ setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &setting->prepend);
+
+ if (F_status_is_error(setting->status)) {
+ fss_payload_write_print_error(setting, main->error, "f_string_dynamic_append_nulless");
+
+ return;
+ }
+
+ if (main->parameters.arguments.array[index].used) {
+ f_string_range_t range = macro_f_string_range_t_initialize2(main->parameters.arguments.array[index].used);
+ f_state_t state = f_state_t_initialize;
+
+ for (; range.start < main->parameters.arguments.array[index].used; range.start++) {
+
+ setting->status = f_fss_is_space(state, main->parameters.arguments.array[index], range);
+
+ if (F_status_is_error(setting->status)) {
+ fss_payload_write_print_error(setting, main->error, "f_fss_is_space");
+
+ return;
+ }
+
+ if (status == F_false) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_error_prepend_only_whitespace(setting, main->error);
+
+ return;
+ }
+ } // for
+ }
+
+ setting->flag |= fss_payload_write_main_flag_prepend_e;
+ }
+ else if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_found_e) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s);
+ fss_payload_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
+
+ if (main->parameters.array[fss_payload_write_parameter_partial_e].result == f_console_result_found_e) {
+ setting->flag |= fss_payload_write_main_flag_partial_e;
+ }
+
+ if (setting->flag & (fss_payload_write_main_flag_object_e | fss_payload_write_main_flag_content_e)) {
+ if (setting->flag & fss_payload_write_main_flag_object_e) {
+ if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_object_e].values.used) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_object_s);
+ fss_payload_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
+
+ if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].values.used) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
+ fss_payload_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
+
+ if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].locations.used && !(setting->flag & fss_payload_write_main_flag_partial_e)) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fss_payload_write_error_parameter_same_times_print(main);
+ fss_payload_write_print_line_last_locked(setting, main->error);
- if (main->parameters.array[fss_payload_write_parameter_strip_invalid_e].result == f_console_result_found_e) {
- setting->flag |= fss_payload_write_main_flag_strip_invalid_e;
+ return;
+ }
+
+ if ((setting->flag & fss_payload_write_main_flag_content_e) && (setting->flag & fss_payload_write_main_flag_partial_e)) {
+ if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_additional_e) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fll_program_print_error_parameter_cannot_use_with_xor(main->error, f_console_symbol_long_enable_s, f_console_symbol_long_enable_s, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, fss_payload_write_long_object_s, fss_payload_write_long_content_s);
+ fss_payload_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
+ }
+
+ if (setting->flag & fss_payload_write_main_flag_content_e) {
+ f_array_length_t location_object = 0;
+ f_array_length_t location_content = 0;
+ f_array_length_t location_sub_object = 0;
+ f_array_length_t location_sub_content = 0;
+
+ for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_object_e].locations.used; ++i) {
+
+ location_object = main->parameters.array[fss_payload_write_parameter_object_e].locations.array[i];
+ location_content = main->parameters.array[fss_payload_write_parameter_content_e].locations.array[i];
+ location_sub_object = main->parameters.array[fss_payload_write_parameter_object_e].locations_sub.array[i];
+ location_sub_content = main->parameters.array[fss_payload_write_parameter_content_e].locations_sub.array[i];
+
+ if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fss_payload_write_print_error_object_not_before_content(setting, main->error);
+ fss_payload_write_print_line_last_locked(setting, main->error);
+
+ break;
+ }
+ } // for
+ }
+ }
+ }
+
+ setting->quote = f_iki_syntax_quote_double_s;
+
+ if (main->parameters.array[fss_payload_write_parameter_double_e].result == f_console_result_found_e) {
+ if (main->parameters.array[fss_payload_write_parameter_single_e].result == f_console_result_found_e) {
+ if (main->parameters.array[fss_payload_write_parameter_double_e].location < main->parameters.array[fss_payload_write_parameter_single_e].location) {
+ setting->quote = f_iki_syntax_quote_single_s;
+ }
+ }
+ }
+ else if (main->parameters.array[fss_payload_write_parameter_single_e].result == f_console_result_found_e) {
+ setting->quote = f_iki_syntax_quote_single_s;
+ }
+
+ if (main->parameters.array[fss_payload_write_parameter_trim_e].result == f_console_result_found_e) {
+ setting->flag |= fss_payload_write_main_flag_trim_e;
+ }
+
+ if (main->pipe & fll_program_data_pipe_input_e) {
+ // @fixme why is this not allowed?
+ if (setting->flag & fss_payload_write_main_flag_partial_e) {
+ setting->status = F_status_set_error(F_parameter);
+
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fll_program_print_error_parameter_cannot_use_with_pipe(setting, main->error);
+ fss_payload_write_print_line_last_locked(setting, main->error);
+
+ return;
+ }
+ }
+ else if (!(setting->flag & (fss_payload_write_main_flag_content_e | fss_payload_write_parameter_object_e))) {
+ setting->status = F_data_not;
}
}
#endif // _di_fss_payload_write_setting_load_
* Flags used to represent flags passed to the main function.
*
* fss_payload_write_main_flag_*_e:
- * - none: No modes in use.
- * - file_from: Using a specified source file.
- * - file_to: Using a specified destination file.
- * - help: Print help.
- * - header: Enable printing of headers.
- * - separate: Enable printing of separators.
- * - strip_invalid: Using strip invalid character mode.
- * - verify: Using verify mode.
- * - version: Print version.
+ * - none: No modes in use.
+ * - content: The Content being written is specified.
+ * - double: Operate using double quotes.
+ * - file_to: Using a specified destination file.
+ * - help: Print help.
+ * - ignore: Ignore a given range within a Content.
+ * - object: The Object being written is specified.
+ * - partial: Do not write end of Object/Content character.
+ * - prepend: Prepend the given white space characters to the start of each multi-line Content.
+ * - single: Operate using single quotes.
+ * - trim: Trim Object names.
+ * - version: Print version.
*/
#ifndef _di_fss_payload_write_main_flag_e_
enum {
- fss_payload_write_main_flag_none_e = 0x0,
- fss_payload_write_main_flag_file_from_e = 0x1,
- fss_payload_write_main_flag_file_to_e = 0x2,
- fss_payload_write_main_flag_header_e = 0x4,
- fss_payload_write_main_flag_help_e = 0x8,
- fss_payload_write_main_flag_separate_e = 0x10,
- fss_payload_write_main_flag_strip_invalid_e = 0x20,
- fss_payload_write_main_flag_verify_e = 0x40,
- fss_payload_write_main_flag_version_e = 0x80,
+ fss_payload_write_main_flag_none_e = 0x0,
+ fss_payload_write_main_flag_content_e = 0x1,
+ fss_payload_write_main_flag_double_e = 0x2,
+ fss_payload_write_main_flag_file_to_e = 0x4,
+ fss_payload_write_main_flag_help_e = 0x8,
+ fss_payload_write_main_flag_ignore_e = 0x10,
+ fss_payload_write_main_flag_object_e = 0x20,
+ fss_payload_write_main_flag_partial_e = 0x40,
+ fss_payload_write_main_flag_prepend_e = 0x80,
+ fss_payload_write_main_flag_single_e = 0x100,
+ fss_payload_write_main_flag_trim_e = 0x200,
+ fss_payload_write_main_flag_version_e = 0x400,
};
#endif // _di_fss_payload_write_main_flag_e_
*
* 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.
+ * buffer: A buffer used during processing the file.
+ * object: A buffer used to hold an Object during processing.
+ * content: A buffer used to hold a Content during processing.
+ * prepend: A string to prepend to each multi-line Content.
+ *
+ * objects: An array of objects passed as values to the "--object" parameter.
+ * contents: An array of objects passed as values to the "--content" parameter and must match the length of objects.
*/
#ifndef _di_fss_payload_write_setting_t_
typedef struct {
f_string_static_t line_first;
f_string_static_t line_last;
+
+ f_string_static_t quote;
+
+ f_string_dynamic_t escaped;
+ f_string_dynamic_t buffer;
+ f_string_dynamic_t object;
+ f_string_dynamic_t content;
+ f_string_dynamic_t prepend;
+
+ f_string_dynamics_t objects;
+ f_string_dynamics_t contents;
} fss_payload_write_setting_t;
#define fss_payload_write_setting_t_initialize \
F_none, \
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, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamics_t_initialize, \
+ f_string_dynamics_t_initialize, \
}
#endif // _di_fss_payload_write_setting_t_
*
* This alters setting.status:
* F_none on success.
+ * F_data_not on success but nothing was provided to operate with.
*
* Errors (with error bit) from: f_console_parameter_process().
+ * Errors (with error bit) from: f_file_stream_open().
+ * Errors (with error bit) from: f_string_dynamics_resize().
* Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_verbosity().
*
* @see f_console_parameter_process()
+ * @see f_file_stream_open()
+ * @see f_string_dynamics_resize()
* @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_verbosity()
*/
#ifndef _di_fss_payload_write_setting_load_
extern void fss_payload_write_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_payload_write_setting_t * const setting);
extern "C" {
#endif
-#ifndef _di_fss_payload_write_program_version_
- const f_string_static_t fss_payload_write_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_version_s, 0, FSS_PAYLOAD_WRITE_program_version_s_length);
-#endif // _di_fss_payload_write_program_version_
+#ifndef _di_fss_payload_write_main_
+ void fss_payload_write_main(fll_program_data_t * const main, fss_payload_write_setting_t * const setting) {
-#ifndef _di_fss_payload_write_program_name_
- const f_string_static_t fss_payload_write_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_s, 0, FSS_PAYLOAD_WRITE_program_name_s_length);
- const f_string_static_t fss_payload_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_long_s, 0, FSS_PAYLOAD_WRITE_program_name_long_s_length);
-#endif // _di_fss_payload_write_program_name_
+ if (!main || !setting || F_status_is_error(setting->status)) return;
-#ifndef _di_fss_payload_write_main_
- f_status_t fss_payload_write_main(fll_program_data_t * const main, fss_payload_write_setting_t * const setting) {
+ setting->status = F_none;
- f_status_t status = F_none;
+ if (setting->flag & fss_payload_write_main_flag_help_e) {
+ fss_payload_write_print_help(setting, main->message);
- // Load parameters.
- setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+ return;
+ }
- {
- f_array_length_t choice = 0;
- f_uint16s_t choices = f_uint16s_t_initialize;
+ if (setting->flag & fss_payload_write_main_flag_version_e) {
+ fll_program_print_version(main->message, fss_payload_write_program_version_s);
- // Identify and prioritize "color context" parameters.
- {
- uint16_t choices_array[3] = { fss_payload_write_parameter_no_color_e, fss_payload_write_parameter_light_e, fss_payload_write_parameter_dark_e };
- choices.array = choices_array;
- choices.used = 3;
+ return;
+ }
- const uint8_t modes[3] = { f_color_mode_color_not_e, f_color_mode_light_e, f_color_mode_dark_e };
+ setting->escaped.used = 0;
- status = fll_program_parameter_process_context(choices, modes, F_true, main);
+ if (main->pipe & fll_program_data_pipe_input_e) {
+ bool object_ended = F_false;
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_context", F_true);
+ f_array_length_t previous = 0;
+ f_string_range_t range = f_string_range_t_initialize;
+ f_status_t status = F_none;
+ f_file_t pipe = f_file_t_initialize;
- return;
- }
- }
+ pipe.id = F_type_descriptor_input_d;
+ pipe.size_read = 1;
- // Identify and prioritize "verbosity" parameters.
- {
- uint16_t choices_array[5] = { fss_payload_write_parameter_verbosity_quiet_e, fss_payload_write_parameter_verbosity_error_e, fss_payload_write_parameter_verbosity_verbose_e, fss_payload_write_parameter_verbosity_debug_e, fss_payload_write_parameter_verbosity_normal_e };
- choices.array = choices_array;
- choices.used = 5;
+ setting->buffer.used = 0;
+ setting->object.used = 0;
+ setting->content.used = 0;
- 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 };
+ range.start = 0;
- status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
+ do {
+ if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ setting->status = F_status_set_error(F_interrupt);
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process_verbosity", F_true);
+ return;
+ }
- return;
+ main->signal_check = 0;
}
- }
- }
- f_string_static_t * const argv = main->parameters.arguments.array;
+ if (status != F_none_eof) {
+ status = f_file_read(pipe, &setting->buffer);
- status = F_none;
+ if (F_status_is_error(status)) {
+ setting->status = F_status_set_error(F_pipe);
- if (main->parameters.array[fss_payload_write_parameter_help_e].result == f_console_result_found_e) {
- fss_payload_write_print_help(setting, main->message);
+ fss_payload_write_print_error_file(setting, main->error, "f_file_read", f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
- return status;
- }
+ return;
+ }
- if (main->parameters.array[fss_payload_write_parameter_version_e].result == f_console_result_found_e) {
- fll_program_print_version(main->message, fss_payload_write_program_version_s);
+ if (!setting->buffer.used) {
+ setting->status = F_status_set_error(F_parameter);
- return status;
- }
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fll_program_print_error_pipe_missing_content(main->error);
+ fss_payload_write_print_line_last_locked(setting, main->error);
- f_file_t output = f_file_t_initialize;
+ return;
+ }
- output.id = F_type_descriptor_output_d;
- output.stream = main->output.to;
- output.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
- output.size_read = main->output.to.size_read;
- output.size_write = main->output.to.size_write;
+ range.stop = setting->buffer.used - 1;
+ }
- if (F_status_is_error_not(status)) {
- if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_additional_e) {
- if (main->parameters.array[fss_payload_write_parameter_file_e].values.used > 1) {
- if (main->error.verbosity < f_console_verbosity_normal_e) {
- fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_enable_s, fss_payload_write_long_file_s);
- }
+ previous = range.start;
+ setting->status = f_string_dynamic_seek_to(setting->buffer, f_string_ascii_feed_form_s.string[0], &range);
- status = F_status_set_error(F_parameter);
+ if (setting->status == F_data_not_stop) {
+ setting->status = F_status_set_error(F_parameter);
}
- else {
- const f_array_length_t location = main->parameters.array[fss_payload_write_parameter_file_e].values.array[0];
- output.id = -1;
- output.stream = 0;
- status = f_file_stream_open(argv[location], f_string_empty_s, &output);
+ if (F_status_is_error(setting->status)) {
+ fss_payload_write_print_error(setting, main->error, "f_string_dynamic_seek_to");
- if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, argv[location], f_file_operation_open_s, fll_error_file_type_file_e);
- }
+ return;
}
- }
- else if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_found_e) {
- fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_file_s);
- status = F_status_set_error(F_parameter);
- }
- }
- if (F_status_is_error_not(status)) {
- if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used || main->parameters.array[fss_payload_write_parameter_content_e].locations.used) {
- if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used) {
- if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_object_e].values.used) {
- fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_object_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].values.used) {
- fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_payload_write_parameter_object_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].locations.used && main->parameters.array[fss_payload_write_parameter_partial_e].result == f_console_result_none_e) {
- fss_payload_write_error_parameter_same_times_print(main);
- status = F_status_set_error(F_parameter);
- }
- else if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used && main->parameters.array[fss_payload_write_parameter_partial_e].locations.used) {
- if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_additional_e) {
- if (main->error.verbosity > f_console_verbosity_quiet_e) {
- f_file_stream_lock(main->error.to);
+ if (object_ended && previous == range.start) {
+ setting->status = F_status_set_error(F_parameter);
- fl_print_format("%r%[%QThe '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
- fl_print_format("%[' parameter only allows either the '%]", main->error.to, main->error.context, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
- fl_print_format("%[' parameter or the '%]", main->error.to, main->error.context, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
- fl_print_format("%[' parameter, but not both.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s);
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fll_program_print_error_pipe_invalid_form_feed(main->error);
+ fss_payload_write_print_line_last_locked(setting, main->error);
- f_file_stream_unlock(main->error.to);
- }
+ return;
+ }
- status = F_status_set_error(F_parameter);
- }
- }
+ range.stop = range.start - 1;
+ range.start = previous;
- if (F_status_is_error_not(status)) {
- if (main->parameters.array[fss_payload_write_parameter_content_e].result == f_console_result_additional_e) {
- f_array_length_t location_object = 0;
- f_array_length_t location_content = 0;
- f_array_length_t location_sub_object = 0;
- f_array_length_t location_sub_content = 0;
-
- for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_object_e].locations.used; ++i) {
- location_object = main->parameters.array[fss_payload_write_parameter_object_e].locations.array[i];
- location_content = main->parameters.array[fss_payload_write_parameter_content_e].locations.array[i];
- location_sub_object = main->parameters.array[fss_payload_write_parameter_object_e].locations_sub.array[i];
- location_sub_content = main->parameters.array[fss_payload_write_parameter_content_e].locations_sub.array[i];
-
- if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) {
- if (main->error.verbosity > f_console_verbosity_quiet_e) {
- f_file_stream_lock(main->error.to);
-
- fl_print_format("%r%[%QEach '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
- fl_print_format("%[' parameter must be specified before a '%]", main->error.to, main->error.context, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
- fl_print_format("%[' parameter.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s);
-
- f_file_stream_unlock(main->error.to);
- }
-
- status = F_status_set_error(F_parameter);
- break;
- }
- } // for
+ if (object_ended) {
+ setting->content.used = 0;
+
+ if (setting->buffer.used) {
+ setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->content);
+
+ if (F_status_is_error(setting->status)) {
+ fss_payload_write_print_error(setting, main->error, "f_string_dynamic_partial_append_nulless");
+
+ return;
}
}
+
+ setting->status = fss_payload_write_process(main, setting, setting->object, setting->content);
+ if (F_status_is_error(setting->status)) return;
+
+ fll_print_dynamic_raw(f_string_eol_s, main->output.to);
+
+ object_ended = F_false;
}
- else if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used) {
- if (main->parameters.array[fss_payload_write_parameter_content_e].locations.used != main->parameters.array[fss_payload_write_parameter_content_e].values.used) {
- fss_payload_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_payload_write_long_content_s);
- status = F_status_set_error(F_parameter);
- }
- else if (!main->parameters.array[fss_payload_write_parameter_partial_e].locations.used) {
- fss_payload_write_error_parameter_same_times_print(main);
- status = F_status_set_error(F_parameter);
+ else {
+ setting->object.used = 0;
+
+ setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->object);
+
+ if (F_status_is_error(setting->status)) {
+ fss_payload_write_print_error(setting, main->error, "f_string_dynamic_partial_append_nulless");
+
+ return;
}
+
+ object_ended = F_true;
}
- }
- else if (!(main->pipe & fll_program_data_pipe_input_e)) {
- if (main->error.verbosity > f_console_verbosity_quiet_e) {
- f_file_stream_lock(main->error.to);
- fl_print_format("%r%[%QThis requires either piped data or the use of the '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, main->error.notable);
- fl_print_format("%[' parameter with the '%]", main->error.to, main->error.context, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, main->error.notable);
- fl_print_format("%[' parameter.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s);
+ // Restore the range, positioned after the new line.
+ range.start = range.stop + 2;
+ range.stop = setting->buffer.used - 1;
- f_file_stream_unlock(main->error.to);
+ // Only clear the buffer and reset the start when the entire buffer has been processed.
+ if (range.start > range.stop) {
+ range.start = 0;
+ setting->buffer.used = 0;
}
- status = F_status_set_error(F_parameter);
- }
+ } while (status != F_none_eof || setting->buffer.used || object_ended);
- if (F_status_is_error_not(status) && (main->pipe & fll_program_data_pipe_input_e)) {
- if (main->parameters.array[fss_payload_write_parameter_partial_e].result == f_console_result_found_e) {
- if (main->error.verbosity > f_console_verbosity_quiet_e) {
- f_file_stream_lock(main->error.to);
-
- fl_print_format("%r%[%QThis '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_partial_s, main->error.notable);
- fl_print_format("%[' parameter cannot be used when processing a pipe.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s);
+ if (object_ended) {
+ setting->status = F_status_set_error(F_parameter);
- f_file_stream_unlock(main->error.to);
- }
+ fss_payload_write_print_line_first_locked(setting, main->error);
+ fll_program_print_error_pipe_object_without_content(main->error);
+ fss_payload_write_print_line_last_locked(setting, main->error);
- status = F_status_set_error(F_parameter);
- }
+ return;
}
}
- if (F_status_is_error_not(status)) {
- if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_found_e) {
- if (main->error.verbosity > f_console_verbosity_quiet_e) {
- f_file_stream_lock(main->error.to);
+ for (f_array_length_t i = 0; i < setting->objects.used; ++i) {
- fl_print_format("%r%[%QThe parameter '%]", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to, main->error.notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, main->error.notable);
- fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to, main->error.context, main->error.context, f_string_eol_s);
+ if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ setting->status = F_status_set_error(F_interrupt);
- f_file_stream_unlock(main->error.to);
+ return;
}
- status = F_status_set_error(F_parameter);
+ main->signal_check = 0;
}
- else if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) {
+
+ setting->status = fss_payload_write_process(main, setting, setting->objects.array[i], setting->contents.array[i]);
+ if (F_status_is_error(setting->status)) return;
+
+ fll_print_dynamic_raw(f_string_eol_s, main->output.to);
+ } // for
+
+ // Ensure a new line is always put at the end of the program execution, unless in quiet mode.
+ fss_payload_write_print_line_last_locked(setting, main->message);
+
+
+ // xxxxxxxxxxx
+
+ if (F_status_is_error_not(status)) {
+ if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1];
if (argv[index].used) {
}
status = F_status_set_error(F_parameter);
+
break;
}
} // for
// FSS Payload Write includes.
#include <program/fss_payload_write/common.h>
+#include <program/fss_payload_write/print.h>
#ifdef __cplusplus
extern "C" {
* F_parameter (with error bit) if main is NULL or setting is NULL.
*/
#ifndef _di_fss_payload_write_main_
- extern f_status_t fss_payload_write_main(fll_program_data_t * const main, fss_payload_write_setting_t * const setting);
+ extern void fss_payload_write_main(fll_program_data_t * const main, fss_payload_write_setting_t * const setting);
#endif // _di_fss_payload_write_main_
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_fss_payload_write_print_error_
+ f_status_t fss_payload_write_print_error(fss_payload_write_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ fss_payload_write_print_line_first_locked(setting, print);
+ fll_error_print(print, F_status_set_fine(setting->status), function, F_true);
+ fss_payload_write_print_line_last_locked(setting, print);
+
+ return F_none;
+ }
+#endif // _di_fss_payload_write_print_error_
+
+#ifndef _di_fss_payload_write_print_error_file_
+ f_status_t fss_payload_write_print_error_file(fss_payload_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ fss_payload_write_print_line_first_locked(setting, print);
+ fll_error_file_print(print, F_status_set_fine(setting->status), function, F_true, name, operation, type);
+ fss_payload_write_print_line_last_locked(setting, print);
+
+ return F_none;
+ }
+#endif // _di_fss_payload_write_print_error_file_
+
+#ifndef _di_fss_payload_write_print_error_object_not_before_content_
+ f_status_t fss_payload_write_print_error_object_not_before_content(fss_payload_write_setting_t * const setting, const fl_print_t print) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ fl_print_format("%r%[%QEach '%]", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, fss_payload_write_long_object_s, print.set->notable);
+ fl_print_format("%[' parameter must be specified before a '%]", print.to, print.set->error, print.set->error);
+ fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, fss_payload_write_long_content_s, print.set->notable);
+ fl_print_format("%[' parameter.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_fss_payload_write_print_error_object_not_before_content_
+
+#ifndef _fss_payload_write_print_error_prepend_only_whitespace_
+ f_status_t fss_payload_write_print_error_prepend_only_whitespace(fss_payload_write_setting_t * const setting, const fl_print_t print) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ 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("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, fss_payload_write_long_prepend_s, print.set->notable);
+ fl_print_format("%[' must only contain white space.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _fss_payload_write_print_error_prepend_only_whitespace_
+
#ifndef _di_fss_payload_write_print_help_
f_status_t fss_payload_write_print_help(fss_payload_write_setting_t * const setting, const fl_print_t print) {
#endif
/**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_fss_payload_write_print_error_
+ extern f_status_t fss_payload_write_print_error(fss_payload_write_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_fss_payload_write_print_error_
+
+/**
+ * Print file related error or warning messages.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * Designates how printing is to be performed.
+ * @param function
+ * The name of the function where the error happened.
+ * Set to 0 to disable.
+ * @param name
+ * The name of the file or directory.
+ * @param operation
+ * The operation that fails, such as 'create' or 'access'.
+ * @param type
+ * A valid file type code from the fll_error_file_type enum.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_fss_payload_write_print_error_file_
+ extern f_status_t fss_payload_write_print_error_file(fss_payload_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
+#endif // _di_fss_payload_write_print_error_file_
+
+/**
+ * Print error message about each Object parameter not being specified before a Content parameter.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_fss_payload_write_print_error_object_not_before_content_
+ extern f_status_t fss_payload_write_print_error_object_not_before_content(fss_payload_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_fss_payload_write_print_error_object_not_before_content_
+
+/**
+ * Print error when prepend parameter has something other than white space.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ */
+#ifndef _fss_payload_write_print_error_prepend_only_whitespace_
+ extern f_status_t fss_payload_write_print_error_prepend_only_whitespace(fss_payload_write_setting_t * const setting, const fl_print_t print);
+#endif // _fss_payload_write_print_error_prepend_only_whitespace_
+
+/**
* Print help.
*
* @param setting
#ifndef _di_fss_payload_write_error_parameter_same_times_print_
void fss_payload_write_error_parameter_same_times_print(fll_program_data_t * const main) {
- if (main->error.verbosity == f_console_verbosity_quiet_e) {
- return;
- }
+ if (main->error.verbosity == f_console_verbosity_quiet_e) return;
f_file_stream_lock(main->error.to);
#ifndef _di_fss_payload_write_error_parameter_unsupported_eol_print_
void fss_payload_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) {
- if (main->error.verbosity == f_console_verbosity_quiet_e) {
- return;
- }
+ if (main->error.verbosity == f_console_verbosity_quiet_e) return;
f_file_stream_lock(main->error.to);
#ifndef _di_fss_payload_write_error_parameter_value_missing_print_
void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
- if (main->error.verbosity == f_console_verbosity_quiet_e) {
- return;
- }
+ if (main->error.verbosity == f_console_verbosity_quiet_e) return;
f_file_stream_lock(main->error.to);
}
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fll_fss_payload_write", F_true);
+ fss_payload_write_print_error(setting, main->error, "fll_fss_payload_write");
return status;
}
}
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fl_fss_basic_list_object_write", F_true);
+ fss_payload_write_print_error(setting, main->error, "fl_fss_basic_list_object_write");
return status;
}
status = fl_fss_basic_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, state, &range, buffer);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fl_fss_payload_content_write", F_true);
+ fss_payload_write_print_error(setting, main->error, "fl_fss_payload_content_write");
return status;
}
status = f_string_dynamic_append(f_string_eol_s, buffer);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
+ fss_payload_write_print_error(setting, main->error, "f_string_dynamic_append");
return status;
}
status_pipe = f_file_read_block(input, &block);
if (F_status_is_error(status_pipe)) {
- fll_error_print(main->error, F_status_set_fine(status_pipe), "f_file_read_block", F_true);
+ fss_payload_write_print_error(setting, main->error, "f_file_read_block");
status_pipe = F_status_set_error(F_pipe);
status = f_string_dynamic_increase_by(block.used, &object);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+ fss_payload_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
break;
}
status = f_string_dynamic_increase_by(total, &content);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+ fss_payload_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
break;
}
status = f_string_dynamic_increase_by(total, &content);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+ fss_payload_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
break;
}
status = f_string_dynamic_increase_by(block.used, &content);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+ fss_payload_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
break;
}
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
- if (F_status_is_error(setting->status)) return;
+
+ if (F_status_is_error(setting->status)) {
+ iki_read_print_error(setting, main->error, "f_console_parameter_process");
+
+ return;
+ }
{
f_array_length_t choice = 0;
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "fll_program_parameter_process_context");
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "fll_program_parameter_process_verbosity");
return;
}
setting->status = f_string_dynamics_increase_by(main->parameters.array[iki_read_parameter_name_e].values.used, &setting->names);
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_increase_by", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "f_string_dynamics_increase_by");
return;
}
} // for
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_append", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "f_string_dynamics_append");
return;
}
setting->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->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_maps_increase_by", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "f_string_maps_increase_by");
return;
}
}
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_resize", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "f_string_dynamic_resize");
return;
}
setting->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->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_triples_increase_by", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "f_string_triples_increase_by");
return;
}
}
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_resize", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "f_string_dynamic_resize");
return;
}
setting->status = f_string_dynamics_resize(main->parameters.remaining.used, &setting->files);
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_resize", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "f_string_dynamics_resize");
return;
}
setting->status = f_string_dynamic_resize(0, &setting->files.array[setting->files.used]);
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_resize", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "f_string_dynamic_resize");
return;
}
setting->status = f_string_triples_increase_by(parameter.values.used / 3, triple);
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_triples_increase_by", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "f_string_triples_increase_by");
return F_false;
}
}
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_resize", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "f_string_dynamic_resize");
return F_false;
}
setting->status = f_file_read(file, &setting->buffer);
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_read", F_true, f_string_ascii_minus_s, f_file_operation_process_s, fll_error_file_type_file_e);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error_file(setting, main->error, "f_file_read", f_string_ascii_minus_s, f_file_operation_process_s, fll_error_file_type_file_e);
}
else {
iki_read_process_buffer(main, setting);
setting->status = f_file_stream_open(setting->files.array[i], f_string_empty_s, &file);
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_stream_open", F_true, setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error_file(setting, main->error, "f_file_stream_open", setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
return;
}
setting->status = f_file_descriptor(&file);
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_descriptor", F_true, setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error_file(setting, main->error, "f_file_descriptor", setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
return;
}
setting->status = f_file_size_by_id(file, &size_file);
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_size_by_id", F_true, setting->files.array[i], f_file_operation_analyze_s, fll_error_file_type_file_e);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error_file(setting, main->error, "f_file_size_by_id", setting->files.array[i], f_file_operation_analyze_s, fll_error_file_type_file_e);
break;
}
setting->status = f_string_dynamic_increase_by(size_file + 1, &setting->buffer);
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_increase_by", F_true, setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error_file(setting, main->error, "f_string_dynamic_increase_by", setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
break;
}
if (F_status_is_error(setting->status)) {
if (F_status_set_fine(setting->status) != F_interrupt) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_stream_read_until", F_true, setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error_file(setting, main->error, "f_file_stream_read_until", setting->files.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
}
break;
extern "C" {
#endif
+#ifndef _di_iki_read_print_error_
+ f_status_t iki_read_print_error(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ iki_read_print_line_first_locked(setting, print);
+ fll_error_print(print, F_status_set_fine(setting->status), function, F_true);
+ iki_read_print_line_last_locked(setting, print);
+
+ return F_none;
+ }
+#endif // _di_iki_read_print_error_
+
+#ifndef _di_iki_read_print_error_file_
+ f_status_t iki_read_print_error_file(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ iki_read_print_line_first_locked(setting, print);
+ fll_error_file_print(print, F_status_set_fine(setting->status), function, F_true, name, operation, type);
+ iki_read_print_line_last_locked(setting, print);
+
+ return F_none;
+ }
+#endif // _di_iki_read_print_error_file_
+
#ifndef _di_iki_read_print_help_
f_status_t iki_read_print_help(iki_read_setting_t * const setting, const fl_print_t print) {
#endif
/**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_iki_read_print_error_
+ extern f_status_t iki_read_print_error(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_iki_read_print_error_
+
+/**
+ * Print file related error or warning messages.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * Designates how printing is to be performed.
+ * @param function
+ * The name of the function where the error happened.
+ * Set to 0 to disable.
+ * @param name
+ * The name of the file or directory.
+ * @param operation
+ * The operation that fails, such as 'create' or 'access'.
+ * @param type
+ * A valid file type code from the fll_error_file_type enum.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_iki_read_print_error_file_
+ extern f_status_t iki_read_print_error_file(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
+#endif // _di_iki_read_print_error_file_
+
+/**
* Print help.
*
* @param setting
}
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fl_iki_read", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "fl_iki_read");
return;
}
}
if (F_status_is_error(setting->status)) {
- iki_read_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fl_iki_read", F_true);
- iki_read_print_line_last_locked(setting, main->error);
+ iki_read_print_error(setting, main->error, "fl_iki_read");
return;
}
}
if (F_status_is_error(setting->status)) {
- fll_error_print(main->error, F_status_set_fine(setting->status), "fl_iki_read", F_true);
+ iki_read_print_error(setting, main->error, "fl_iki_read");
return;
}
setting->status = f_string_dynamic_append_nulless(main->parameters.arguments.array[index], &name);
if (F_status_is_error(setting->status)) {
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_append_nulless", F_true);
+ iki_read_print_error(setting, main->error, "f_string_dynamic_append_nulless");
f_string_dynamic_resize(0, &name);
setting->status = f_console_parameter_process(arguments, &main->parameters);
if (F_status_is_error(setting->status)) {
- iki_write_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_error(setting, main->error, "f_console_parameter_process");
return;
}
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- iki_write_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_error(setting, main->error, "fll_program_parameter_process_context");
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- iki_write_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_error(setting, main->error, "fll_program_parameter_process_verbosity");
return;
}
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;
- if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_additional_e) {
+ if (main->parameters.array[iki_write_parameter_file_e].result == f_console_result_additional_e && main->parameters.array[iki_write_parameter_file_e].values.used) {
if (main->parameters.array[iki_write_parameter_file_e].values.used > 1) {
setting->status = F_status_set_error(F_parameter);
setting->status = f_string_dynamics_resize(values->used, &setting->objects);
if (F_status_is_error(setting->status)) {
- iki_write_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_resize", F_true);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_error(setting, main->error, "f_string_dynamics_resize");
return;
}
setting->status = f_string_dynamics_resize(values->used, &setting->contents);
if (F_status_is_error(setting->status)) {
- iki_write_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_resize", F_true);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_error(setting, main->error, "f_string_dynamics_resize");
return;
}
if (F_status_is_error(status)) {
setting->status = F_status_set_error(F_pipe);
- iki_write_print_line_first_locked(setting, main->error);
- fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_error_file(setting, main->error, "f_file_read", f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
return;
}
}
if (F_status_is_error(setting->status)) {
- iki_write_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_seek_to", F_true);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_error(setting, main->error, "f_string_dynamic_seek_to");
return;
}
setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->content);
if (F_status_is_error(setting->status)) {
- iki_write_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_partial_append_nulless", F_true);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_error(setting, main->error, "f_string_dynamic_partial_append_nulless");
return;
}
}
- setting->status = iki_write_process(main, setting, setting->object, setting->content);
+ iki_write_process(main, setting, setting->object, setting->content);
if (F_status_is_error(setting->status)) return;
fll_print_dynamic_raw(f_string_eol_s, main->output.to);
setting->status = f_string_dynamic_partial_append_nulless(setting->buffer, range, &setting->object);
if (F_status_is_error(setting->status)) {
- iki_write_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_partial_append_nulless", F_true);
- iki_write_print_line_last_locked(setting, main->error);
+ iki_write_print_error(setting, main->error, "f_string_dynamic_partial_append_nulless");
return;
}
main->signal_check = 0;
}
- setting->status = iki_write_process(main, setting, setting->objects.array[i], setting->contents.array[i]);
+ iki_write_process(main, setting, setting->objects.array[i], setting->contents.array[i]);
if (F_status_is_error(setting->status)) return;
fll_print_dynamic_raw(f_string_eol_s, main->output.to);
* F_false on success when performing verification and verify failed.
* F_interrupt on (exit) signal received.
*
+ * F_failure (with error bit) on processing failure.
* F_parameter (with error bit) if main is NULL or setting is NULL.
+ *
+ * Errors (with error bit) from: f_iki_object_is().
+ * Errors (with error bit) from: fll_iki_content_escape().
+ *
+ * @see f_iki_object_is()
+ * @see fll_iki_content_escape()
*/
#ifndef _di_iki_write_main_
extern void iki_write_main(fll_program_data_t * const main, iki_write_setting_t * const setting);
extern "C" {
#endif
+#ifndef _di_iki_write_print_error_
+ f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ iki_write_print_line_first_locked(setting, print);
+ fll_error_print(print, F_status_set_fine(setting->status), function, F_true);
+ iki_write_print_line_last_locked(setting, print);
+
+ return F_none;
+ }
+#endif // _di_iki_write_print_error_
+
+#ifndef _di_iki_write_print_error_file_
+ f_status_t iki_write_print_error_file(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ iki_write_print_line_first_locked(setting, print);
+ fll_error_file_print(print, F_status_set_fine(setting->status), function, F_true, name, operation, type);
+ iki_write_print_line_last_locked(setting, print);
+
+ return F_none;
+ }
+#endif // _di_iki_write_print_error_file_
+
+#ifndef _di_iki_write_print_error_main_missing_
+ f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ fl_print_format("%[%QNo main provided, either pipe the main data or use the '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, iki_write_long_object_s, print.set->notable);
+ fl_print_format("%[' and the '%]", print.to, print.set->error, print.set->error);
+ fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, iki_write_long_content_s, print.set->notable);
+ fl_print_format("%[' parameters.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_iki_write_print_error_main_missing_
+
+#ifndef _di_iki_write_print_error_object_not_valid_
+ f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ f_file_stream_lock(print.to);
+
+ iki_write_print_line_first_unlocked(setting, print);
+
+ fl_print_format("%[%QThe object '%]", print.to, print.set->error, print.prefix, print.set->error);
+ fl_print_format("%[%Q%]", print.to, print.set->notable, object, print.set->notable);
+ fl_print_format("%[' is not a valid IKI Object.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+ iki_write_print_line_last_unlocked(setting, print);
+
+ f_file_stream_unlock(print.to);
+
+ return F_none;
+ }
+#endif // _di_iki_write_print_error_object_not_valid_
+
#ifndef _di_iki_write_print_help_
f_status_t iki_write_print_help(iki_write_setting_t * const setting, const fl_print_t print) {
}
#endif // _di_iki_write_print_line_last_unlocked_
-#ifndef _di_iki_write_print_error_main_missing_
- f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print) {
-
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
-
- f_file_stream_lock(print.to);
-
- fl_print_format("%[%QNo main provided, either pipe the main data or use the '%]", print.to, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, iki_write_long_object_s, print.set->notable);
- fl_print_format("%[' and the '%]", print.to, print.set->error, print.set->error);
- fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_enable_s, iki_write_long_content_s, print.set->notable);
- fl_print_format("%[' parameters.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
-
- f_file_stream_unlock(print.to);
-
- return F_none;
- }
-#endif // _di_iki_write_print_error_main_missing_
-
-#ifndef _di_iki_write_print_error_object_not_valid_
- f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object) {
-
- if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
-
- f_file_stream_lock(print.to);
-
- fl_print_format("%[%QThe object '%]", print.to, print.set->error, print.prefix, print.set->error);
- fl_print_format("%[%Q%]", print.to, print.set->notable, object, print.set->notable);
- fl_print_format("%[' is not a valid IKI Object.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
-
- f_file_stream_unlock(print.to);
-
- return F_none;
- }
-#endif // _di_iki_write_print_error_object_not_valid_
-
#ifdef __cplusplus
} // extern "C"
#endif
#endif
/**
- * Print help.
+ * Print generic error message regarding a function failing in some way.
*
* @param setting
* The main program settings.
*
* This does not alter setting.status.
* @param print
- * The output structure to print to.
+ * Designates the how and where to print.
*
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_print()
*/
-#ifndef _di_iki_write_print_help_
- 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_
+#ifndef _di_iki_write_print_error_
+ extern f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_iki_write_print_error_
/**
- * Print first new line, unless verbosity says otherwise.
+ * Print file related error or warning messages.
*
- * This is generally either the first line in the program or the first line printed before an error message.
+ * @param setting
+ * The main program settings.
*
- * This function locks and then unlocks the input stream when printing.
+ * This does not alter setting.status.
+ * @param print
+ * Designates how printing is to be performed.
+ * @param function
+ * The name of the function where the error happened.
+ * Set to 0 to disable.
+ * @param name
+ * The name of the file or directory.
+ * @param operation
+ * The operation that fails, such as 'create' or 'access'.
+ * @param type
+ * A valid file type code from the fll_error_file_type enum.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_iki_write_print_error_file_
+ extern f_status_t iki_write_print_error_file(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
+#endif // _di_iki_write_print_error_file_
+
+/**
+ * Print error message about "main" Object being missing.
*
* @param setting
* The main program settings.
* F_none on success.
* F_output_not on success, but no printing is performed.
*/
-#ifndef _di_iki_write_print_line_first_locked_
- extern f_status_t iki_write_print_line_first_locked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_first_locked_
+#ifndef _di_iki_write_print_error_main_missing_
+ extern f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_error_main_missing_
/**
- * Print first new line, unless verbosity says otherwise.
+ * Print error message about an Object not being valid.
*
- * This is generally either the first line in the program or the first line printed before an error message.
+ * @param setting
+ * The main program settings.
*
- * This function neither locks nor unlocks the input stream.
+ * This does not alter setting.status.
+ * @param print
+ * Designates the how and where to print.
+ * @param object
+ * The a string representing the object that is missing.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ */
+#ifndef _di_iki_write_print_error_object_not_valid_
+ extern f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object);
+#endif // _di_iki_write_print_error_object_not_valid_
+
+/**
+ * Print help.
*
* @param setting
* The main program settings.
*
* This does not alter setting.status.
* @param print
- * Designates the how and where to print.
+ * The output structure to print to.
*
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
*/
-#ifndef _di_iki_write_print_line_first_unlocked_
- extern f_status_t iki_write_print_line_first_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_first_unlocked_
+#ifndef _di_iki_write_print_help_
+ 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 last new line when the main is complete, unless verbosity says otherwise.
+ * Print first new line, unless verbosity says otherwise.
*
- * This is generally the very last line printed in the program.
+ * 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.
*
* F_none on success.
* F_output_not on success, but no printing is performed.
*/
-#ifndef _di_iki_write_print_line_last_locked_
- extern f_status_t iki_write_print_line_last_locked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_last_locked_
+#ifndef _di_iki_write_print_line_first_locked_
+ extern f_status_t iki_write_print_line_first_locked(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_first_locked_
/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
+ * Print first new line, unless verbosity says otherwise.
*
- * This is generally the very last line printed in the program.
+ * 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.
*
* F_none on success.
* F_output_not on success, but no printing is performed.
*/
-#ifndef _di_iki_write_print_line_last_unlocked_
- extern f_status_t iki_write_print_line_last_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_last_unlocked_
+#ifndef _di_iki_write_print_line_first_unlocked_
+ extern f_status_t iki_write_print_line_first_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_first_unlocked_
/**
- * Print error message about "main" Object being missing.
+ * 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.
* F_none on success.
* F_output_not on success, but no printing is performed.
*/
-#ifndef _di_iki_write_print_error_main_missing_
- extern f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_error_main_missing_
+#ifndef _di_iki_write_print_line_last_locked_
+ extern f_status_t iki_write_print_line_last_locked(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_last_locked_
/**
- * Print error message about an Object not being valid.
+ * 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.status.
* @param print
* Designates the how and where to print.
- * @param object
- * The a string representing the object that is missing.
*
* @return
* F_none on success.
* F_output_not on success, but no printing is performed.
*/
-#ifndef _di_iki_write_print_error_object_not_valid_
- extern f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object);
-#endif // _di_iki_write_print_error_object_not_valid_
+#ifndef _di_iki_write_print_line_last_unlocked_
+ extern f_status_t iki_write_print_line_last_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_last_unlocked_
#ifdef __cplusplus
} // extern "C"
#endif
#ifndef _di_iki_write_process_
- f_status_t iki_write_process(fll_program_data_t * const main, iki_write_setting_t * const setting, const f_string_static_t object, const f_string_static_t content) {
+ void iki_write_process(fll_program_data_t * const main, iki_write_setting_t * const setting, const f_string_static_t object, const f_string_static_t content) {
if (!object.used) {
- fll_program_print_error_missing_variable_not_zero(main->error, iki_write_object_s);
+ setting->status = F_status_set_error(F_failure);
- return F_status_set_error(F_failure);
+ if (main->error.verbosity != f_console_verbosity_quiet_e) {
+ iki_write_print_line_first_locked(setting, main->error);
+ fll_program_print_error_missing_variable_not_zero(main->error, iki_write_object_s);
+ iki_write_print_line_last_locked(setting, main->error);
+ }
+
+ return;
}
- f_status_t status = f_iki_object_is(object);
+ setting->status = f_iki_object_is(object);
+
+ if (setting->status == F_false) {
+ setting->status = F_status_set_error(F_failure);
- if (status == F_false) {
iki_write_print_error_object_not_valid(setting, main->error, object);
- return F_status_set_error(F_failure);
+ return;
}
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_iki_object_is", F_true);
+ if (F_status_is_error(setting->status)) {
+ iki_write_print_error(setting, main->error, "f_iki_object_is");
- return F_status_set_error(F_failure);
+ return;
}
setting->escaped.used = 0;
- status = fll_iki_content_escape(content, setting->quote, &setting->escaped);
+ setting->status = fll_iki_content_escape(content, setting->quote, &setting->escaped);
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fll_iki_content_escape", F_true);
+ if (F_status_is_error(setting->status)) {
+ iki_write_print_error(setting, main->error, "fll_iki_content_escape");
- return F_status_set_error(F_failure);
+ return;
}
fl_print_format("%Q%r%r%Q%r", main->output.to, object, f_iki_syntax_separator_s, setting->quote, setting->escaped, setting->quote);
-
- return F_none;
}
#endif // _di_iki_write_process_
* The main program data.
* @param setting
* The main program settings.
+ *
+ * This alters setting.status:
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_iki_object_is().
+ * Errors (with error bit) from: fll_iki_content_escape().
+ *
+ * F_failure (with error bit) for any other failure.
* @param object
* The object to validate and print.
* @param content
* The content to escape and print.
*
- * @return
- * F_none on success.
- *
- * F_failure (with error bit) for any other failure.
+ * @see f_iki_object_is()
+ * @see fll_iki_content_escape()
*/
#ifndef _di_iki_write_process_
- extern f_status_t iki_write_process(fll_program_data_t * const main, iki_write_setting_t * const setting, const f_string_static_t object, const f_string_static_t content) F_attribute_visibility_internal_d;
+ extern void iki_write_process(fll_program_data_t * const main, iki_write_setting_t * const setting, const f_string_static_t object, const f_string_static_t content) F_attribute_visibility_internal_d;
#endif // _di_iki_write_process_
#ifdef __cplusplus
setting->status = f_console_parameter_process(arguments, &main->parameters);
if (F_status_is_error(setting->status)) {
- status_code_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
- status_code_print_line_last_locked(setting, main->error);
+ status_code_print_error(setting, main->error, "f_console_parameter_process");
return;
}
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- status_code_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
- status_code_print_line_last_locked(setting, main->error);
+ status_code_print_error(setting, main->error, "fll_program_parameter_process_context");
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- status_code_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
- status_code_print_line_last_locked(setting, main->error);
+ status_code_print_error(setting, main->error, "fll_program_parameter_process_verbosity");
return;
}
extern "C" {
#endif
+#ifndef _di_status_code_print_error_
+ f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ status_code_print_line_first_locked(setting, print);
+ fll_error_print(print, F_status_set_fine(setting->status), function, F_true);
+ status_code_print_line_last_locked(setting, print);
+
+ return F_none;
+ }
+#endif // _di_status_code_print_error_
+
#ifndef _di_status_code_print_error_cannot_error_warning_number_
f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print) {
#endif
/**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_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);
+#endif // _di_status_code_print_error_
+
+/**
* Print an error message when error parameter and warning parameter are specified without number parameter.
*
* @param setting
setting->status = f_console_parameter_process(arguments, &main->parameters);
if (F_status_is_error(setting->status)) {
- utf8_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_process", F_true);
- utf8_print_line_last_locked(setting, main->error);
+ utf8_print_error(setting, main->error, "f_console_parameter_process");
return;
}
setting->status = fll_program_parameter_process_context(choices, modes, F_true, main);
if (F_status_is_error(setting->status)) {
- utf8_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_context", F_true);
- utf8_print_line_last_locked(setting, main->error);
+ utf8_print_error(setting, main->error, "fll_program_parameter_process_context");
return;
}
setting->status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
if (F_status_is_error(setting->status)) {
- utf8_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "fll_program_parameter_process_verbosity", F_true);
- utf8_print_line_last_locked(setting, main->error);
+ utf8_print_error(setting, main->error, "fll_program_parameter_process_verbosity");
return;
}
setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
if (F_status_is_error(setting->status)) {
- utf8_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
- utf8_print_line_last_locked(setting, main->error);
+ utf8_print_error(setting, main->error, "f_console_parameter_prioritize_right");
return;
}
setting->status = f_console_parameter_prioritize_right(main->parameters, choices, &choice);
if (F_status_is_error(setting->status)) {
- utf8_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_console_parameter_prioritize_right", F_true);
- utf8_print_line_last_locked(setting, main->error);
+ utf8_print_error(setting, main->error, "f_console_parameter_prioritize_right");
return;
}
setting->status = f_string_dynamics_increase_by(1, &setting->path_files_to);
if (F_status_is_error(setting->status)) {
- utf8_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_increase_by", F_true);
- utf8_print_line_last_locked(setting, main->error);
+ utf8_print_error(setting, main->error, "f_string_dynamics_increase_by");
return;
}
setting->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->status)) {
- utf8_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_append_nulless", F_true);
- utf8_print_line_last_locked(setting, main->error);
+ utf8_print_error(setting, main->error, "f_string_dynamic_append_nulless");
return;
}
setting->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->status)) {
- utf8_print_line_first_locked(setting, main->error);
- fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_stream_open", F_true, 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);
- utf8_print_line_last_locked(setting, main->error);
+ utf8_print_error_file(setting, main->error, "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->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->status)) {
- utf8_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamics_increase_by", F_true);
- utf8_print_line_last_locked(setting, main->error);
+ utf8_print_error(setting, main->error, "f_string_dynamics_increase_by");
return;
}
setting->status = f_string_dynamics_resize(main->parameters.remaining.used, &setting->remaining);
if (F_status_is_error(setting->status)) {
- utf8_print_line_first_locked(setting, main->error);
- fll_error_print(main->error, F_status_set_fine(setting->status), "f_string_dynamic_append_nulless", F_true);
- utf8_print_line_last_locked(setting, main->error);
+ utf8_print_error(setting, main->error, "f_string_dynamic_append_nulless");
return;
}
extern "C" {
#endif
+#ifndef _di_utf8_print_error_
+ f_status_t utf8_print_error(utf8_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ utf8_print_line_first_locked(setting, print);
+ fll_error_print(print, F_status_set_fine(setting->status), function, F_true);
+ utf8_print_line_last_locked(setting, print);
+
+ return F_none;
+ }
+#endif // _di_utf8_print_error_
+
+#ifndef _di_utf8_print_error_file_
+ f_status_t utf8_print_error_file(utf8_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
+
+ if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+ utf8_print_line_first_locked(setting, print);
+ fll_error_file_print(print, F_status_set_fine(setting->status), function, F_true, name, operation, type);
+ utf8_print_line_last_locked(setting, print);
+
+ return F_none;
+ }
+#endif // _di_utf8_print_error_file_
+
#ifndef _di_utf8_print_bytesequence_
f_status_t utf8_print_bytesequence(fll_program_data_t * const main, utf8_setting_t * const setting, const f_string_static_t sequence) {
#endif
/**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * Designates the how and where to print.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_utf8_print_error_
+ extern f_status_t utf8_print_error(utf8_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_utf8_print_error_
+
+/**
+ * Print file related error or warning messages.
+ *
+ * @param setting
+ * The main program settings.
+ *
+ * This does not alter setting.status.
+ * @param print
+ * Designates how printing is to be performed.
+ * @param function
+ * The name of the function where the error happened.
+ * Set to 0 to disable.
+ * @param name
+ * The name of the file or directory.
+ * @param operation
+ * The operation that fails, such as 'create' or 'access'.
+ * @param type
+ * A valid file type code from the fll_error_file_type enum.
+ *
+ * @return
+ * F_none on success.
+ * F_output_not on success, but no printing is performed.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_utf8_print_error_file_
+ extern f_status_t utf8_print_error_file(utf8_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
+#endif // _di_utf8_print_error_file_
+
+/**
* Print the byte sequence character (such as '豸').
*
* @param main
}
if (F_status_is_error(setting->status) && F_status_set_fine(setting->status) != F_utf_fragment && F_status_set_fine(setting->status) != F_complete_not_utf) {
- fll_error_file_print(main->error, F_status_set_fine(setting->status), setting->mode & utf8_mode_from_bytesequence_e ? "utf8_process_file_bytesequence" : "utf8_process_file_codepoint", F_true, f_string_empty_s, f_file_operation_process_s, fll_error_file_type_pipe_e);
+ utf8_print_error_file(setting, main->error, setting->mode & utf8_mode_from_bytesequence_e ? "utf8_process_file_bytesequence" : "utf8_process_file_codepoint", f_string_empty_s, f_file_operation_process_s, fll_error_file_type_pipe_e);
}
}
setting->status = f_file_stream_open(setting->path_files_from.array[i], f_string_empty_s, &file);
if (F_status_is_error(setting->status)) {
- fll_error_file_print(main->error, F_status_set_fine(setting->status), "f_file_stream_open", F_true, setting->path_files_from.array[i], f_file_operation_open_s, fll_error_file_type_file_e);
+ utf8_print_error_file(setting, main->error, "f_file_stream_open", setting->path_files_from.array[i], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
}
if (F_status_is_error(setting->status) && F_status_set_fine(setting->status) != F_utf_fragment && F_status_set_fine(setting->status) != F_complete_not_utf) {
- fll_error_file_print(main->error, F_status_set_fine(setting->status), setting->mode & utf8_mode_from_bytesequence_e ? "utf8_process_file_bytesequence" : "utf8_process_file_codepoint", F_true, 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 ? "utf8_process_file_bytesequence" : "utf8_process_file_codepoint", setting->path_files_from.array[i], f_file_operation_process_s, fll_error_file_type_file_e);
break;
}