Finish changing the fss_status_code and status_code, fixing mistakes identified.
Change fss_identify.
Change iki_write.
#ifndef _di_fss_identify_print_help_
f_status_t fss_identify_print_help(const f_file_t output, const f_color_context_t context) {
+ flockfile(output.stream);
+
fll_program_print_help_header(output, context, fss_identify_name_long, fss_identify_version);
fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output.");
fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
- fprintf(output.stream, "%c", f_string_eol_s[0]);
+ f_print_character(f_string_eol_s[0], output.stream);
fll_program_print_help_option(output, context, fss_identify_short_content, fss_identify_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the Identifier content (the 4-digit hexidecimal type code).");
fll_program_print_help_option(output, context, fss_identify_short_object, fss_identify_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Identifier object (the name).");
- fprintf(output.stream, "%c", f_string_eol_s[0]);
+ f_print_character(f_string_eol_s[0], output.stream);
fll_program_print_help_option(output, context, fss_identify_short_line, fss_identify_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Identifier at the given line.");
fll_program_print_help_option(output, context, fss_identify_short_name, fss_identify_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name.");
fll_program_print_help_usage(output, context, fss_identify_name, "filename(s)");
- fprintf(output.stream, " The ");
- f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_line);
- fprintf(output.stream, " parameter refers to the output lines and not the lines in a given file.%c", f_string_eol_s[0]);
-
- fprintf(output.stream, "%c", f_string_eol_s[0]);
-
- fprintf(output.stream, " If neither the ");
- f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_object);
- fprintf(output.stream, " nor ", f_string_eol_s[0]);
- f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_content);
- fprintf(output.stream, " are specified, then the default behavior is to print both.%c", f_string_eol_s[0]);
-
- fprintf(output.stream, "%c", f_string_eol_s[0]);
+ fl_print_format(" The %[%s%s%] parameter refers to the output lines and not the lines in a given file.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_line, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]);
- fprintf(output.stream, " When specifying the ");
- f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_total);
- fprintf(output.stream, " parameter, neither the ");
- f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_object);
- fprintf(output.stream, " nor the ");
- f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_content);
- fprintf(output.stream, " parameter may be specified.%c", f_string_eol_s[0]);
+ fl_print_format(" If neither the %[%s%s%] nor", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_object, context.set.notable);
+ fl_print_format(" %[%s%s%] are specified, then the default behavior is to print both.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_content, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]);
- fprintf(output.stream, "%c", f_string_eol_s[0]);
+ fl_print_format(" When specifying the %[%s%s%] parameter, neither the", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_total, context.set.notable);
+ fl_print_format(" %[%s%s%] nor the", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_object, context.set.notable);
+ fl_print_format(" %[%s%s%] parameter may be specified.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_content, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]);
- fprintf(output.stream, " An FSS file is identified by the following format: '");
- f_color_print(output.stream, context.set.notable, "# Object-Content");
- fprintf(output.stream, "' where the Object, is a machine-name representing the name and may only consist of \"word\" characters and the Content is a 4-digit hexidecimal number representing a particular variant of the Object.%c", f_string_eol_s[0]);
- fprintf(output.stream, " This identifier, if provided, must exist on the first line in a file and must begin with the pound character: '#'.%c", f_string_eol_s[0]);
- fprintf(output.stream, " Whitespace must follow this pound character.%c", f_string_eol_s[0]);
- fprintf(output.stream, " There may be multiple Object and Content pairs, separated by whitspace, such as: \"# fss-0002 fss-0000 iki-0002\".%c", f_string_eol_s[0]);
+ fl_print_format(" An FSS file is identified by the following format: '%[# Object-Content%]'", output.stream, context.set.notable, context.set.notable);
+ fl_print_format(" where the Object, is a machine-name representing the name and may only consist of \"word\" characters and the Content is a 4-digit hexidecimal number representing a particular variant of the Object.%c", output.stream, f_string_eol_s[0]);
+ fl_print_format(" This identifier, if provided, must exist on the first line in a file and must begin with the pound character: '#'.%c", output.stream, f_string_eol_s[0]);
+ fl_print_format(" Whitespace must follow this pound character.%c", output.stream, f_string_eol_s[0]);
+ fl_print_format(" There may be multiple Object and Content pairs, separated by whitspace, such as: \"# fss-0002 fss-0000 iki-0002\".%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]);
- fprintf(output.stream, "%c", f_string_eol_s[0]);
+ funlockfile(output.stream);
return F_none;
}
if (F_status_is_error(status)) {
if (main->error.verbosity != f_console_verbosity_quiet) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true);
- fprintf(main->error.to.stream, "%c", f_string_eol_s[0]);
+ fll_print_character(f_string_eol_s[0], main->error.to.stream);
}
fss_identify_main_delete(main);
if (choice == fss_identify_parameter_verbosity_quiet) {
main->error.verbosity = f_console_verbosity_quiet;
+ main->warning.verbosity = f_console_verbosity_quiet;
}
else if (choice == fss_identify_parameter_verbosity_normal) {
main->error.verbosity = f_console_verbosity_normal;
+ main->warning.verbosity = f_console_verbosity_normal;
}
else if (choice == fss_identify_parameter_verbosity_verbose) {
main->error.verbosity = f_console_verbosity_verbose;
+ main->warning.verbosity = f_console_verbosity_verbose;
}
else if (choice == fss_identify_parameter_verbosity_debug) {
main->error.verbosity = f_console_verbosity_debug;
+ main->warning.verbosity = f_console_verbosity_debug;
}
}
if (F_status_is_error_not(status)) {
if (main->parameters[fss_identify_parameter_line].result == f_console_result_found) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe parameter ", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_line);
- f_color_print(main->error.to.stream, main->context.set.error, " requires a positive number.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_line, main->error.notable);
+ fl_print_format("%[' requires a positive number.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
status = F_status_set_error(F_parameter);
}
if (F_status_is_error_not(status) && main->parameters[fss_identify_parameter_total].result == f_console_result_found) {
if (main->parameters[fss_identify_parameter_object].result == f_console_result_found) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the ", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_object);
- f_color_print(main->error.to.stream, main->context.set.error, " parameter with the ");
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_total);
- f_color_print(main->error.to.stream, main->context.set.error, " parameter.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_object, main->error.notable);
+ fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_total, main->error.notable);
+ fl_print_format("%[' parameter.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
status = F_status_set_error(F_parameter);
}
else if (main->parameters[fss_identify_parameter_content].result == f_console_result_found) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the ", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_content);
- f_color_print(main->error.to.stream, main->context.set.error, " parameter with the ");
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_total);
- f_color_print(main->error.to.stream, main->context.set.error, " parameter.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_content, main->error.notable);
+ fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_total, main->error.notable);
+ fl_print_format("%[' parameter.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
status = F_status_set_error(F_parameter);
}
if (F_status_is_error_not(status)) {
if (main->parameters[fss_identify_parameter_name].result == f_console_result_found) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe parameter ", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_name);
- f_color_print(main->error.to.stream, main->context.set.error, " requires a string.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name, main->error.notable);
+ fl_print_format("%[' requires a string.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
status = F_status_set_error(F_parameter);
}
const f_string_range_t range = macro_f_string_range_t_initialize(length);
if (length == 0) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe parameter ", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_name);
- f_color_print(main->error.to.stream, main->context.set.error, " does not allow zero length strings.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name, main->error.notable);
+ fl_print_format("%[' does not allow zero length strings.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
status = F_status_set_error(F_parameter);
}
break;
}
else if (status == F_false) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe value '", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s", arguments.argv[index]);
- f_color_print(main->error.to.stream, main->context.set.error, "' for the parameter ", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_identify_long_name);
- f_color_print(main->error.to.stream, main->context.set.error, " may only contain word characters.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sThe value '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, arguments.argv[index], main->error.notable);
+ fl_print_format("%[' for the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name, main->error.notable);
+ fl_print_format("%[' may only contain word characters.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
status = F_status_set_error(F_parameter);
if (F_status_is_error_not(status)) {
if (main->parameters[fss_identify_parameter_total].result == f_console_result_found) {
- fprintf(main->output.stream, "%llu%c", data.total, f_string_eol_s[0]);
+ fll_print_format("%ul%c", main->output.stream, data.total, f_string_eol_s[0]);
}
}
// ensure a newline is always put at the end of the program execution, unless in quiet mode.
if (main->error.verbosity != f_console_verbosity_quiet) {
if (F_status_is_error(status)) {
- fprintf(main->error.to.stream, "%c", f_string_eol_s[0]);
+ fll_print_character(f_string_eol_s[0], main->error.to.stream);
}
}
#include <fll/level_1/console.h>
#include <fll/level_1/conversion.h>
#include <fll/level_1/fss.h>
+#include <fll/level_1/print.h>
#include <fll/level_1/string.h>
// fll-2 includes
#include <fll/level_2/error.h>
#include <fll/level_2/fss.h>
+#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
#ifdef __cplusplus
#ifndef _di_fss_identify_print_
void fss_identify_print(const fss_identify_main_t main, f_fll_id_t id) {
- if (main.parameters[fss_identify_parameter_object].result == f_console_result_found || main.parameters[fss_identify_parameter_content].result != f_console_result_found) {
- f_string_static_t part = f_string_static_t_initialize;
-
- part.string = id.name;
- part.used = id.used;
- part.size = part.used;
+ flockfile(main.output.stream);
- f_print_dynamic(main.output.stream, part);
+ if (main.parameters[fss_identify_parameter_object].result == f_console_result_found || main.parameters[fss_identify_parameter_content].result != f_console_result_found) {
+ f_print(id.name, id.used, main.output.stream);
if (main.parameters[fss_identify_parameter_object].result != f_console_result_found || main.parameters[fss_identify_parameter_content].result == f_console_result_found) {
- fprintf(main.output.stream, "%c", f_fss_type_header_part5);
+ f_print_character(f_fss_type_header_part5, main.output.stream);
}
}
if (main.parameters[fss_identify_parameter_object].result != f_console_result_found || main.parameters[fss_identify_parameter_content].result == f_console_result_found) {
- fprintf(main.output.stream, "%04x", id.type);
+ fl_print_format("%04_ui", main.output.stream, id.type);
}
- fprintf(main.output.stream, "%c", f_string_eol_s[0]);
+ f_print_character(f_string_eol_s[0], main.output.stream);
+
+ funlockfile(main.output.stream);
}
#endif // _di_fss_identify_print_
fl_console
fl_conversion
fl_fss
+fl_print
+fl_string
fll_error
fll_fss
+fll_print
fll_program
build_indexer ar
build_language c
build_libraries -lc
-build_libraries-individual -lfll_error -lfll_fss -lfll_program -lfl_console -lfl_conversion -lfl_fss -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf
+build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program -lfl_console -lfl_conversion -lfl_fss -lfl_print -lfl_status -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
build_sources_library fss_identify.c private-common.c private-fss_identify.c
defines_static
defines_shared
-flags_all -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-logical-op-parentheses -Wno-parentheses
+flags_all -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-logical-op-parentheses -Wno-parentheses
flags_shared
flags_static
flags_library -fPIC
if (main->parameters[fss_status_code_parameter_is_error].result == f_console_result_found) {
if (main->parameters[fss_status_code_parameter_is_warning].result == f_console_result_found) {
- flockfile(main->output.stream);
+ flockfile(main->error.to.stream);
fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_error, main->error.notable);
- fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_warning, main->error.notable);
fl_print_format("%['.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
- funlockfile(main->output.stream);
+ funlockfile(main->error.to.stream);
fss_status_code_main_delete(main);
return F_status_set_error(status);
}
else if (main->parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) {
- flockfile(main->output.stream);
+ flockfile(main->error.to.stream);
fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_error, main->error.notable);
- fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_fine, main->error.notable);
fl_print_format("%['.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
- funlockfile(main->output.stream);
+ funlockfile(main->error.to.stream);
fss_status_code_main_delete(main);
return F_status_set_error(status);
}
}
else if (main->parameters[fss_status_code_parameter_is_warning].result == f_console_result_found && main->parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) {
- flockfile(main->output.stream);
+ flockfile(main->error.to.stream);
fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_warning, main->error.notable);
- fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_status_code_long_is_fine, main->error.notable);
fl_print_format("%['.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
- funlockfile(main->output.stream);
+ funlockfile(main->error.to.stream);
fss_status_code_main_delete(main);
return F_status_set_error(status);
}
if (main->remaining.used > 0) {
+ flockfile(main->output.stream);
+
for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
status2 = fss_status_code_process_check(*main, arguments.argv[main->remaining.array[i]]);
status = status2;
}
} // for
+
+ funlockfile(main->output.stream);
}
}
else if (main->parameters[fss_status_code_parameter_number].result == f_console_result_found) {
}
if (main->remaining.used > 0) {
+ flockfile(main->output.stream);
+
for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
status2 = fss_status_code_process_number(*main, arguments.argv[main->remaining.array[i]]);
status = status2;
}
} // for
+
+ funlockfile(main->output.stream);
}
}
else {
}
if (main->remaining.used > 0) {
+ flockfile(main->output.stream);
+
for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
status2 = fss_status_code_process_normal(*main, arguments.argv[main->remaining.array[i]]);
status = status2;
}
} // for
+
+ funlockfile(main->output.stream);
}
}
status = fl_conversion_string_to_number_unsigned(value, range, &number);
if (status == F_none) {
- fll_print_format("%[invalid name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[invalid name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
return F_status_set_error(F_parameter);
}
if (status == F_data_not || F_status_set_fine(status) == F_parameter) {
- fll_print_format("%[invalid main%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[invalid main%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
return status;
}
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_data) {
- fll_print_format("%[unknown name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[unknown name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
else {
- fll_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
return status;
}
if (status == F_data) {
- fll_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
return F_none;
}
- fll_print_format("%ui%c", main.output.stream, code, f_string_eol_s[0]);
+ fl_print_format("%ui%c", main.output.stream, code, f_string_eol_s[0]);
return F_none;
}
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_data) {
- fll_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
else {
- fll_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
return status;
}
- fll_print_format("%S%c", main.output.stream, string, f_string_eol_s[0]);
+ fl_print_format("%S%c", main.output.stream, string, f_string_eol_s[0]);
return F_none;
}
f_status_t status = fl_conversion_string_to_number_unsigned(value, range, number);
if (*number > F_status_size_max_with_signal) {
- fll_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
return status;
}
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_number_negative) {
- fll_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
else {
- fll_print_format("%[invalid number%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[invalid number%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
return status;
#ifndef _di_iki_write_print_help_
f_status_t iki_write_print_help(const f_file_t output, const f_color_context_t context) {
+ flockfile(output.stream);
+
fll_program_print_help_header(output, context, iki_write_name_long, iki_write_version);
fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output.");
fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number.");
- fprintf(output.stream, "%c", f_string_eol_s[0]);
+ f_print_character(f_string_eol_s[0], output.stream);
fll_program_print_help_option(output, context, iki_write_short_file, iki_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send output to.");
fll_program_print_help_option(output, context, iki_write_short_content, iki_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The content to output.");
fll_program_print_help_usage(output, context, iki_write_name, f_string_empty_s);
- f_color_print(output.stream, context.set.important, " Notes:");
-
- fprintf(output.stream, "%c", f_string_eol_s[0]);
-
- fprintf(output.stream, " This program will accept object and content strings to generate an IKI string, such as: ");
- f_color_print(output.stream, context.set.notable, "object:\"content\"");
- fprintf(output.stream, ".%c", f_string_eol_s[0]);
+ fl_print_format(" %[Notes:%]%c", output.stream, context.set.important, context.set.important, f_string_eol_s[0]);
+ fl_print_format(" This program will accept object and content strings to generate an IKI string, such as %[object:\"content\"%].%c", output.stream, context.set.notable, context.set.notable, f_string_eol_s[0]);
- fprintf(output.stream, " Each object must have a content (and each content must have an object).%c", f_string_eol_s[0]);
+ fl_print_format(" Each object must have a content (and each content must have an object).%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]);
- fprintf(output.stream, "%c", f_string_eol_s[0]);
+ fl_print_format(" When piping main to this program, a single end of line (\\n) must be used to separate each object from each content.%c", output.stream, f_string_eol_s[0]);
+ fl_print_format(" Furthermore, each object must be followed by a content.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]);
- fprintf(output.stream, " When piping main to this program, a single end of line (\\n) must be used to separate each object from each content.%c", f_string_eol_s[0]);
- fprintf(output.stream, " Furthermore, each object must be followed by a content.%c", f_string_eol_s[0]);
-
- fprintf(output.stream, "%c", f_string_eol_s[0]);
+ funlockfile(output.stream);
return F_none;
}
if (main->context.set.error.before) {
main->error.context = main->context.set.error;
main->error.notable = main->context.set.notable;
+
+ main->warning.context = main->context.set.warning;
+ main->warning.notable = main->context.set.notable;
}
else {
- f_color_set_t *sets[] = { &main->error.context, &main->error.notable, 0 };
+ f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 };
fll_program_parameter_process_empty(&main->context, sets);
}
if (F_status_is_error(status)) {
if (main->error.verbosity != f_console_verbosity_quiet) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true);
- fprintf(main->error.to.stream, "%c", f_string_eol_s[0]);
+ f_print_character(f_string_eol_s[0], main->error.to.stream);
}
iki_write_main_delete(main);
if (choice == iki_write_parameter_verbosity_quiet) {
main->error.verbosity = f_console_verbosity_quiet;
+ main->warning.verbosity = f_console_verbosity_quiet;
}
else if (choice == iki_write_parameter_verbosity_normal) {
main->error.verbosity = f_console_verbosity_normal;
+ main->warning.verbosity = f_console_verbosity_normal;
}
else if (choice == iki_write_parameter_verbosity_verbose) {
main->error.verbosity = f_console_verbosity_verbose;
+ main->warning.verbosity = f_console_verbosity_verbose;
}
else if (choice == iki_write_parameter_verbosity_debug) {
main->error.verbosity = f_console_verbosity_debug;
+ main->warning.verbosity = f_console_verbosity_debug;
}
}
if (main->parameters[iki_write_parameter_file].result == f_console_result_additional) {
if (main->parameters[iki_write_parameter_file].values.used > 1) {
if (main->error.verbosity != f_console_verbosity_quiet) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe parameter '", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, iki_write_long_file);
- f_color_print(main->error.to.stream, main->context.set.error, "' may only be specified once.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_file, main->error.notable);
+ fl_print_format("%[' may only be specified once.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
}
status = F_status_set_error(F_parameter);
}
else if (main->parameters[iki_write_parameter_file].result == f_console_result_found) {
if (main->error.verbosity != f_console_verbosity_quiet) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe parameter '", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, iki_write_long_file);
- f_color_print(main->error.to.stream, main->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_file, main->error.notable);
+ fl_print_format("%[' was specified, but no value was given.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
}
status = F_status_set_error(F_parameter);
if (F_status_is_error_not(status) && main->parameters[iki_write_parameter_object].result == f_console_result_found) {
if (main->error.verbosity != f_console_verbosity_quiet) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe parameter '", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, iki_write_long_object);
- f_color_print(main->error.to.stream, main->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object, main->error.notable);
+ fl_print_format("%[' was specified, but no value was given.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
}
status = F_status_set_error(F_parameter);
if (F_status_is_error_not(status) && main->parameters[iki_write_parameter_content].result == f_console_result_found) {
if (main->error.verbosity != f_console_verbosity_quiet) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe parameter '", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, iki_write_long_content);
- f_color_print(main->error.to.stream, main->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content, main->error.notable);
+ fl_print_format("%[' was specified, but no value was given.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
}
status = F_status_set_error(F_parameter);
if (F_status_is_error_not(status) && !main->process_pipe) {
if (main->parameters[iki_write_parameter_object].result != f_console_result_additional && main->parameters[iki_write_parameter_content].result != f_console_result_additional) {
if (main->error.verbosity != f_console_verbosity_quiet) {
- fprintf(main->error.to.stream, "%c", f_string_eol_s[0]);
- f_color_print(main->error.to.stream, main->context.set.error, "%sNo main provided, either pipe the main or use the '", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, iki_write_long_object);
- f_color_print(main->error.to.stream, main->context.set.error, "' and the '");
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, iki_write_long_content);
- f_color_print(main->error.to.stream, main->context.set.error, "' parameters.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sNo main provided, either pipe the main or use the '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object, main->error.notable);
+ fl_print_format("%[' and the '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content, main->error.notable);
+ fl_print_format("%[' parameters.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
}
status = F_status_set_error(F_parameter);
if (F_status_is_error_not(status)) {
if (main->parameters[iki_write_parameter_object].values.used != main->parameters[iki_write_parameter_content].values.used) {
if (main->error.verbosity != f_console_verbosity_quiet) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe parameters '", fll_error_print_error);
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, iki_write_long_content);
- f_color_print(main->error.to.stream, main->context.set.error, "' and '");
- f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, iki_write_long_object);
- f_color_print(main->error.to.stream, main->context.set.error, "' must be specified the same number of times.%c", f_string_eol_s[0]);
+ flockfile(main->error.to.stream);
+
+ fl_print_format("%c%[%sThe parameters '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_content, main->error.notable);
+ fl_print_format("%[' and '%]", main->error.to.stream, main->error.context, main->error.context);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_write_long_object, main->error.notable);
+ fl_print_format("%[' must be specified the same number of times.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
+
+ funlockfile(main->error.to.stream);
}
status = F_status_set_error(F_parameter);
if (!buffer.used) {
if (main->error.verbosity != f_console_verbosity_quiet) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe pipe has no main.%c", fll_error_print_error, f_string_eol_s[0]);
+ fll_print_format("%c%[%sThe pipe has no main.%]%c", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context, f_string_eol_s[0]);
}
status = F_status_set_error(F_parameter);
if (object_ended && previous == range.start) {
if (main->error.verbosity != f_console_verbosity_quiet) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe pipe has incorrectly placed newlines.%c", fll_error_print_error, f_string_eol_s[0]);
+ fll_print_format("%c%[%sThe pipe has incorrectly placed newlines.%]%c", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context, f_string_eol_s[0]);
}
status = F_status_set_error(F_parameter);
status = iki_write_process(*main, output, object, content, quote, &escaped);
if (F_status_is_error(status)) break;
- fprintf(output.stream, "%c", f_string_eol_s[0]);
+ fll_print_character(f_string_eol_s[0], output.stream);
object_ended = F_false;
}
if (F_status_is_error_not(status) && object_ended) {
if (main->error.verbosity != f_console_verbosity_quiet) {
- f_color_print(main->error.to.stream, main->context.set.error, "%sThe pipe has an object without content.%c", fll_error_print_error, f_string_eol_s[0]);
+ fll_print_format("%c%[%sThe pipe has an object without content.%]%c", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context, f_string_eol_s[0]);
}
status = F_status_set_error(F_parameter);
status = iki_write_process(*main, output, object, content, quote, &escaped);
if (F_status_is_error(status)) break;
- fprintf(output.stream, "%c", f_string_eol_s[0]);
+ fll_print_character(f_string_eol_s[0], output.stream);
} // for
// ensure there is always a newline at the end, unless in quiet mode.
if (F_status_is_error_not(status) && main->error.verbosity != f_console_verbosity_quiet && main->parameters[iki_write_parameter_file].result == f_console_result_none) {
- fprintf(main->output.stream, "%c", f_string_eol_s[0]);
+ fll_print_character(f_string_eol_s[0], output.stream);
}
}
// ensure a newline is always put at the end of the program execution, unless in quiet mode.
if (main->error.verbosity != f_console_verbosity_quiet) {
if (F_status_is_error(status)) {
- fprintf(main->error.to.stream, "%c", f_string_eol_s[0]);
+ fll_print_character(f_string_eol_s[0], main->error.to.stream);
}
}
#include <fll/level_2/error.h>
#include <fll/level_2/file.h>
#include <fll/level_2/iki.h>
+#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
#ifdef __cplusplus
f_file_t output;
fll_error_print_t error;
+ fll_error_print_t warning;
f_string_dynamic_t buffer;
F_false, \
macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
+ macro_fll_error_print_t_initialize_warning(), \
f_string_dynamic_t_initialize, \
f_color_context_t_initialize, \
}
if (!object.used) {
if (main.error.verbosity != f_console_verbosity_quiet) {
- fprintf(main.error.to.stream, "%c", f_string_eol_s[0]);
- f_color_print(main.error.to.stream, main.context.set.error, "%sThe object is missing, it must not have a length of ", fll_error_print_error);
- f_color_print(main.error.to.stream, main.context.set.notable, "0");
- f_color_print(main.error.to.stream, main.context.set.error, ".%c", f_string_eol_s[0]);
+ flockfile(main.error.to.stream);
+
+ fl_print_format("%c%[%sThe object is missing, it must not have a length of %]", main.error.to.stream, f_string_eol_s[0], main.error.context, main.error.prefix, main.error.context);
+ fl_print_format("%[0%]", main.error.to.stream, main.error.notable, main.error.notable);
+ fl_print_format("%[.%]%c", main.error.to.stream, main.error.context, main.error.context, f_string_eol_s[0]);
+
+ funlockfile(main.error.to.stream);
}
return F_status_set_error(F_failure);
if (status == F_false) {
if (main.error.verbosity != f_console_verbosity_quiet) {
- fprintf(main.error.to.stream, "%c", f_string_eol_s[0]);
- f_color_print(main.error.to.stream, main.context.set.error, "%sThe object '", fll_error_print_error);
+ flockfile(main.error.to.stream);
- f_color_print_code(main.error.to.stream, main.context.notable);
- f_print_dynamic(main.error.to.stream, object);
- f_color_print_code(main.error.to.stream, main.context.reset);
+ fl_print_format("%c%[%sThe object '%]", main.error.to.stream, f_string_eol_s[0], main.error.context, main.error.prefix, main.error.context);
+ fl_print_format("%[%Q%]", main.error.to.stream, main.error.notable, object, main.error.notable);
+ fl_print_format("%[' is not a valid IKI object.%]%c", main.error.to.stream, main.error.context, main.error.context, f_string_eol_s[0]);
- f_color_print(main.error.to.stream, main.context.set.error, "' is not a valid IKI object.%c", f_string_eol_s[0]);
+ funlockfile(main.error.to.stream);
}
return F_status_set_error(F_failure);
return F_status_set_error(F_failure);
}
- fprintf(output.stream, "%s%c%c%s%c", object.string, f_iki_syntax_separator, quote, escaped->string, quote);
+ fl_print_format("%Q%c%c%Q%c", output.stream, object, f_iki_syntax_separator, quote, *escaped, quote);
return F_none;
}
f_print
fl_console
fl_iki
+fl_print
+fl_string
fll_iki
fll_error
+fll_print
fll_program
build_indexer ar
build_language c
build_libraries -lc
-build_libraries-individual -lfll_error -lfll_iki -lfll_program -lfl_console -lfl_iki -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf
+build_libraries-individual -lfll_error -lfll_iki -lfll_print -lfll_program -lfl_console -lfl_iki -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_path -lf_pipe -lf_print -lf_string -lf_type_array -lf_utf
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
build_sources_library iki_write.c private-common.c private-iki_write.c
defines_static
defines_shared
-flags_all -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-logical-op-parentheses -Wno-parentheses
+flags_all -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-logical-op-parentheses -Wno-parentheses
flags_shared
flags_static
flags_library -fPIC
status = fl_conversion_string_to_number_unsigned(value, range, &number);
if (status == F_none) {
- fll_print_format("%[invalid name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[invalid name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
return F_status_set_error(F_parameter);
}
if (status == F_data_not || F_status_set_fine(status) == F_parameter) {
- fll_print_format("%[invalid main%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[invalid main%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
return status;
}
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_data) {
- fll_print_format("%[unknown name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[unknown name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
else {
- fll_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
return status;
}
if (status == F_data) {
- fll_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
return F_none;
}
- fll_print_format("%ui%c", main.output.stream, code, f_string_eol_s[0]);
+ fl_print_format("%ui%c", main.output.stream, code, f_string_eol_s[0]);
return F_none;
}
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_data) {
- fll_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
else {
- fll_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
return status;
}
- fll_print_format("%S%c", main.output.stream, string, f_string_eol_s[0]);
+ fl_print_format("%S%c", main.output.stream, string, f_string_eol_s[0]);
return F_none;
}
f_status_t status = fl_conversion_string_to_number_unsigned(value, range, number);
if (*number > F_status_size_max_with_signal) {
- fll_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
return status;
}
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_number_negative) {
- fll_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
else {
- fll_print_format("%[invalid number%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
+ fl_print_format("%[invalid number%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]);
}
return status;
if (main->parameters[status_code_parameter_is_error].result == f_console_result_found) {
if (main->parameters[status_code_parameter_is_warning].result == f_console_result_found) {
- flockfile(main->output.stream);
+ flockfile(main->error.to.stream);
fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_error, main->error.notable);
- fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_warning, main->error.notable);
fl_print_format("%['.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
- funlockfile(main->output.stream);
+ funlockfile(main->error.to.stream);
status_code_main_delete(main);
return F_status_set_error(status);
}
else if (main->parameters[status_code_parameter_is_fine].result == f_console_result_found) {
- flockfile(main->output.stream);
+ flockfile(main->error.to.stream);
fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_error, main->error.notable);
- fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_fine, main->error.notable);
fl_print_format("%['.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
- funlockfile(main->output.stream);
+ funlockfile(main->error.to.stream);
status_code_main_delete(main);
return F_status_set_error(status);
}
}
else if (main->parameters[status_code_parameter_is_warning].result == f_console_result_found && main->parameters[status_code_parameter_is_fine].result == f_console_result_found) {
- flockfile(main->output.stream);
+ flockfile(main->error.to.stream);
fl_print_format("%c%[%sThe parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_warning, main->error.notable);
- fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%[' cannot be used with the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, status_code_long_is_fine, main->error.notable);
fl_print_format("%['.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
- funlockfile(main->output.stream);
+ funlockfile(main->error.to.stream);
status_code_main_delete(main);
return F_status_set_error(status);
}
if (main->remaining.used > 0) {
+ flockfile(main->output.stream);
+
for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
status2 = status_code_process_number(*main, arguments.argv[main->remaining.array[i]]);
status = status2;
}
} // for
+
+ funlockfile(main->output.stream);
}
}
else {
}
if (main->remaining.used > 0) {
+ flockfile(main->output.stream);
+
for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
status2 = status_code_process_normal(*main, arguments.argv[main->remaining.array[i]]);
status = status2;
}
} // for
+
+ funlockfile(main->output.stream);
}
}