*
* fss_basic_list_read_pipe_*:
* - name: A name used to represent the pipe when printing file names.
- * - content_end: A code used to reprsent the end of Content for use in binary formats.
- * - content_ignore: A code used to reprsent the ignoring Content for use in binary formats.
- * - content_start: A code used to reprsent the start of Content for use in binary formats.
+ * - content_end: A code used to represent the end of Content for use in binary formats.
+ * - content_ignore: A code used to represent the ignoring Content for use in binary formats.
+ * - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_basic_list_read_defines_
#define fss_basic_list_read_signal_check_d 10000
#endif // _di_fss_basic_list_write_program_name_
#ifndef _di_fss_basic_list_write_defines_
+ const f_string_static_t fss_basic_list_write_pipe_name_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_pipe_name_s, 0, FSS_BASIC_LIST_WRITE_pipe_name_s_length);
const f_string_static_t fss_basic_list_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_pipe_content_end_s, 0, FSS_BASIC_LIST_WRITE_pipe_content_end_s_length);
const f_string_static_t fss_basic_list_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_pipe_content_ignore_s, 0, FSS_BASIC_LIST_WRITE_pipe_content_ignore_s_length);
const f_string_static_t fss_basic_list_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_pipe_content_start_s, 0, FSS_BASIC_LIST_WRITE_pipe_content_start_s_length);
/**
* The program defines.
+ *
+ * fss_basic_list_write_pipe_*:
+ * - name: A name used to represent the pipe when printing file names.
+ * - content_end: A code used to represent the end of Content for use in binary formats.
+ * - content_ignore: A code used to represent the ignoring Content for use in binary formats.
+ * - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_basic_list_write_defines_
#define fss_basic_list_write_signal_check_d 10000
+ #define FSS_BASIC_LIST_WRITE_pipe_name_s "(pipe)"
+
#define FSS_BASIC_LIST_WRITE_pipe_content_end_s "\f"
#define FSS_BASIC_LIST_WRITE_pipe_content_ignore_s "\v"
#define FSS_BASIC_LIST_WRITE_pipe_content_start_s "\b"
+ #define FSS_BASIC_LIST_WRITE_pipe_name_s_length 6
+
#define FSS_BASIC_LIST_WRITE_pipe_content_end_s_length 1
#define FSS_BASIC_LIST_WRITE_pipe_content_ignore_s_length 1
#define FSS_BASIC_LIST_WRITE_pipe_content_start_s_length 1
+ extern const f_string_static_t fss_basic_list_write_pipe_name_s;
+
extern const f_string_static_t fss_basic_list_write_pipe_content_end_s;
extern const f_string_static_t fss_basic_list_write_pipe_content_ignore_s;
extern const f_string_static_t fss_basic_list_write_pipe_content_start_s;
if (fss_basic_list_write_signal_received(main)) {
status = F_status_set_error(F_interrupt);
+
break;
}
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+
break;
}
#endif // _di_fss_basic_read_program_name_
#ifndef _di_fss_basic_read_defines_
+ const f_string_static_t fss_basic_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_pipe_name_s, 0, FSS_BASIC_READ_pipe_name_s_length);
const f_string_static_t fss_basic_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_pipe_content_end_s, 0, FSS_BASIC_READ_pipe_content_end_s_length);
const f_string_static_t fss_basic_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_pipe_content_ignore_s, 0, FSS_BASIC_READ_pipe_content_ignore_s_length);
const f_string_static_t fss_basic_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_pipe_content_start_s, 0, FSS_BASIC_READ_pipe_content_start_s_length);
#define FSS_BASIC_READ_program_version_minor_s F_string_ascii_5_s
#define FSS_BASIC_READ_program_version_micro_s F_string_ascii_8_s
- #define FSS_BASIC_READ_program_version_major_s F_string_ascii_0_s_length
- #define FSS_BASIC_READ_program_version_minor_s F_string_ascii_5_s_length
- #define FSS_BASIC_READ_program_version_micro_s F_string_ascii_8_s_length
+ #define FSS_BASIC_READ_program_version_major_s_length F_string_ascii_0_s_length
+ #define FSS_BASIC_READ_program_version_minor_s_length F_string_ascii_5_s_length
+ #define FSS_BASIC_READ_program_version_micro_s_length F_string_ascii_8_s_length
#if !(defined(FSS_BASIC_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_READ_program_version_nano_prefix_s_length))
#define FSS_BASIC_READ_program_version_nano_prefix_s
/**
* The program defines.
+ *
+ * fss_basic_read_pipe_*:
+ * - name: A name used to represent the pipe when printing file names.
+ * - content_end: A code used to represent the end of Content for use in binary formats.
+ * - content_ignore: A code used to represent the ignoring Content for use in binary formats.
+ * - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_basic_read_defines_
#define fss_basic_read_signal_check_d 10000
+ #define FSS_BASIC_READ_pipe_name_s "(pipe)"
+
#define FSS_BASIC_READ_pipe_content_end_s "\f"
#define FSS_BASIC_READ_pipe_content_ignore_s "\v"
#define FSS_BASIC_READ_pipe_content_start_s "\b"
+ #define FSS_BASIC_READ_pipe_name_s_length 6
+
#define FSS_BASIC_READ_pipe_content_end_s_length 1
#define FSS_BASIC_READ_pipe_content_ignore_s_length 1
#define FSS_BASIC_READ_pipe_content_start_s_length 1
+ extern const f_string_static_t fss_basic_read_pipe_name_s;
+
extern const f_string_static_t fss_basic_read_pipe_content_end_s;
extern const f_string_static_t fss_basic_read_pipe_content_ignore_s;
extern const f_string_static_t fss_basic_read_pipe_content_start_s;
data.files.array = files_array;
data.files.used = 1;
data.files.size = main->parameters.remaining.used + 1;
- data.files.array[0].name = "(pipe)";
+ data.files.array[0].name = fss_basic_read_pipe_name_s;
data.files.array[0].range.start = 1;
data.files.array[0].range.stop = 0;
fss_basic_read_parameter_delimit_e,
};
- const f_string_t parameter_name[] = {
+ const f_string_static_t parameter_name[] = {
fss_basic_read_long_at_s,
fss_basic_read_long_depth_s,
fss_basic_read_long_line_s,
fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable);
- fl_print_format("%[' requires a %r.%]%r", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
+ fl_print_format("%[' requires a %s.%]%r", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s);
funlockfile(main->error.to.stream);
fss_basic_read_parameter_total_e,
};
- const f_string_t parameter_name[] = {
+ const f_string_static_t parameter_name[] = {
fss_basic_read_long_depth_s,
fss_basic_read_long_line_s,
fss_basic_read_long_pipe_s,
break;
}
- else if (fl_string_dynamic_compare_string(fss_basic_read_delimit_mode_name_none_s.string, argv[index], fss_basic_read_delimit_mode_name_none_s.used) == F_equal_to) {
+ else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_none_s, argv[index]) == F_equal_to) {
data.delimit_mode = fss_basic_read_delimit_mode_none_e;
}
- else if (fl_string_dynamic_compare_string(fss_basic_read_delimit_mode_name_all_s.string, argv[index], fss_basic_read_delimit_mode_name_all_s.used) == F_equal_to) {
+ else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_all_s, argv[index]) == F_equal_to) {
data.delimit_mode = fss_basic_read_delimit_mode_all_e;
}
- else if (fl_string_dynamic_compare_string(fss_basic_read_delimit_mode_name_object_s.string, argv[index], fss_basic_read_delimit_mode_name_object_s.used) == F_equal_to) {
+ else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_object_s, argv[index]) == F_equal_to) {
switch (data.delimit_mode) {
case 0:
data.delimit_mode = fss_basic_read_delimit_mode_object_e;
data.delimit_mode = fss_basic_read_delimit_mode_content_object_e;
}
- if (argv[index][length - 1] == fss_basic_read_delimit_mode_name_greater_s.string[0]) {
+ if (argv[index].string[length - 1] == fss_basic_read_delimit_mode_name_greater_s.string[0]) {
if (!(data.delimit_mode == fss_basic_read_delimit_mode_none_e || data.delimit_mode == fss_basic_read_delimit_mode_all_e)) {
if (data.delimit_mode == fss_basic_read_delimit_mode_content_object_e) {
data.delimit_mode = fss_basic_read_delimit_mode_content_greater_object_e;
// Shorten the length to better convert the remainder to a number.
--length;
}
- else if (argv[index][length - 1] == fss_basic_read_delimit_mode_name_lesser_s.string[0]) {
+ else if (argv[index].string[length - 1] == fss_basic_read_delimit_mode_name_lesser_s.string[0]) {
if (!(data.delimit_mode == fss_basic_read_delimit_mode_none_e || data.delimit_mode == fss_basic_read_delimit_mode_all_e)) {
if (data.delimit_mode == fss_basic_read_delimit_mode_content_object_e) {
data.delimit_mode = fss_basic_read_delimit_mode_content_lesser_object_e;
f_string_range_t range = macro_f_string_range_t_initialize(length);
// Ignore leading plus sign.
- if (argv[index][0] == '+') {
+ if (argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
++range.start;
}
// This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
// Guarantee that a newline exists at the end of the buffer.
- status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
+ status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer);
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(argv[main->parameters.remaining.array[i]], 0, &file);
+ status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
// This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
// Guarantee that a newline exists at the end of the buffer.
- status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
+ status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer);
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
f_array_length_t position_at = 0;
f_array_length_t position_name = 0;
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (fss_basic_read_signal_received(main)) {
else {
position_depth = main->parameters.array[fss_basic_read_parameter_depth_e].values.array[i];
- const f_string_range_t range = macro_f_string_range_t_initialize(strlen(argv[position_depth]));
+ const f_string_range_t range = macro_f_string_range_t_initialize(argv[position_depth].used);
- status = fl_conversion_string_to_number_unsigned(argv[position_depth], range, &data->depths.array[i].depth);
+ status = fl_conversion_string_to_number_unsigned(argv[position_depth].string, range, &data->depths.array[i].depth);
if (F_status_is_error(status)) {
fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_depth_s, argv[position_depth]);
data->depths.array[i].index_at = main->parameters.array[fss_basic_read_parameter_at_e].values.array[position_at];
- const f_string_range_t range = macro_f_string_range_t_initialize(strlen(argv[data->depths.array[i].index_at]));
+ const f_string_range_t range = macro_f_string_range_t_initialize(argv[data->depths.array[i].index_at].used);
- status = fl_conversion_string_to_number_unsigned(argv[data->depths.array[i].index_at], range, &data->depths.array[i].value_at);
+ status = fl_conversion_string_to_number_unsigned(argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
if (F_status_is_error(status)) {
fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_at_s, argv[data->depths.array[i].index_at]);
data->depths.array[i].index_name = main->parameters.array[fss_basic_read_parameter_name_e].values.array[position_name];
if (main->parameters.array[fss_basic_read_parameter_trim_e].result == f_console_result_found_e) {
- status = fl_string_dynamic_rip(argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
+ status = fl_string_rip(argv[data->depths.array[i].index_name].string, argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
}
else {
status = f_string_dynamic_append(argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
const f_status_t status = fll_fss_basic_read(data->buffer, state, &input, &data->objects, &data->contents, &data->quotes, &data->delimits, 0);
if (F_status_is_error(status)) {
- const f_string_t file_name = fss_basic_read_file_identify(input.start, data->files);
+ const f_string_static_t file_name = fss_basic_read_file_identify(input.start, data->files);
fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_basic_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e);
#endif // _di_fss_basic_read_load_
#ifndef _di_fss_basic_read_load_number_
- f_status_t fss_basic_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
+ f_status_t fss_basic_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(argv[index], F_console_parameter_size_d));
+ const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(argv[index].string, range, number);
+ const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]);
return status;
}
if (main->parameters.array[fss_basic_read_parameter_line_e].result == f_console_result_additional_e) {
data->option |= fss_basic_read_data_option_line_d;
- status = fss_basic_read_load_number(main, fss_basic_read_parameter_line_e, fss_basic_read_long_line_s, arguments, &data->line);
+ status = fss_basic_read_load_number(main, fss_basic_read_parameter_line_e, fss_basic_read_long_line_s, &data->line);
if (F_status_is_error(status)) return status;
}
if (main->parameters.array[fss_basic_read_parameter_select_e].result == f_console_result_additional_e) {
data->option |= fss_basic_read_data_option_select_d;
- status = fss_basic_read_load_number(main, fss_basic_read_parameter_select_e, fss_basic_read_long_select_s, arguments, &data->select);
+ status = fss_basic_read_load_number(main, fss_basic_read_parameter_select_e, fss_basic_read_long_select_s, &data->select);
if (F_status_is_error(status)) return status;
}
* On failure to identify, an empty string is returned.
*/
#ifndef _di_fss_basic_read_file_identify_
- extern f_string_t fss_basic_read_file_identify(const f_array_length_t at, const fss_basic_read_files_t files) F_attribute_visibility_internal_d;
+ extern f_string_static_t fss_basic_read_file_identify(const f_array_length_t at, const fss_basic_read_files_t files) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_file_identify_
/**
* An ID representing the parameter.
* @param name
* The parameter name to print on error.
- * @param arguments
- * The console arguments passed to the program.
* @param number
* The location to store the loaded number.
*
* @see fss_basic_read_depths_resize()
*/
#ifndef _di_fss_basic_read_load_number_
- extern f_status_t fss_basic_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_load_number_
/**
#endif // _di_fss_basic_write_program_name_
#ifndef _di_fss_basic_write_defines_
+ const f_string_static_t fss_basic_write_pipe_name_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_pipe_name_s, 0, FSS_BASIC_WRITE_pipe_name_s_length);
const f_string_static_t fss_basic_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_pipe_content_end_s, 0, FSS_BASIC_WRITE_pipe_content_end_s_length);
const f_string_static_t fss_basic_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_pipe_content_ignore_s, 0, FSS_BASIC_WRITE_pipe_content_ignore_s_length);
const f_string_static_t fss_basic_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_pipe_content_start_s, 0, FSS_BASIC_WRITE_pipe_content_start_s_length);
/**
* The program defines.
+ *
+ * fss_basic_write_pipe_*:
+ * - name: A name used to represent the pipe when printing file names.
+ * - content_end: A code used to represent the end of Content for use in binary formats.
+ * - content_ignore: A code used to represent the ignoring Content for use in binary formats.
+ * - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_basic_write_defines_
#define fss_basic_write_signal_check_d 10000
+ #define FSS_BASIC_WRITE_pipe_name_s "(pipe)"
+
#define FSS_BASIC_WRITE_pipe_content_end_s "\f"
#define FSS_BASIC_WRITE_pipe_content_ignore_s "\v"
#define FSS_BASIC_WRITE_pipe_content_start_s "\b"
+ #define FSS_BASIC_WRITE_pipe_name_s_length 6
+
#define FSS_BASIC_WRITE_pipe_content_end_s_length 1
#define FSS_BASIC_WRITE_pipe_content_ignore_s_length 1
#define FSS_BASIC_WRITE_pipe_content_start_s_length 1
+ extern const f_string_static_t fss_basic_write_pipe_name_s;
+
extern const f_string_static_t fss_basic_write_pipe_content_end_s;
extern const f_string_static_t fss_basic_write_pipe_content_ignore_s;
extern const f_string_static_t fss_basic_write_pipe_content_start_s;
}
}
- f_fss_quote_t quote = F_fss_delimit_quote_double_s;
+ f_fss_quote_t quote = f_fss_quote_type_double_e;
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_basic_write_parameter_double_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_basic_write_parameter_single_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_basic_write_parameter_double_e].location < main->parameters.array[fss_basic_write_parameter_single_e].location) {
- quote = F_fss_delimit_quote_single_s;
+ quote = f_fss_quote_type_single_e;
}
}
}
else if (main->parameters.array[fss_basic_write_parameter_single_e].result == f_console_result_found_e) {
- quote = F_fss_delimit_quote_single_s;
+ quote = f_fss_quote_type_single_e;
}
}
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_basic_write_parameter_partial_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_basic_write_parameter_object_e].result == f_console_result_additional_e) {
- content.used = 0;
-
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_object_e].values.used; ++i) {
if (fss_basic_write_signal_received(main)) {
} // for
}
else {
- object.used = 0;
-
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_content_e].values.used; ++i) {
if (fss_basic_write_signal_received(main)) {
for (; range.start <= range.stop; range.start++) {
- if (block.string[range.start] == fss_basic_write_pipe_content_start_s) {
+ if (block.string[range.start] == fss_basic_write_pipe_content_start_s.string[0]) {
state = 0x2;
++range.start;
break;
}
- if (block.string[range.start] == fss_basic_write_pipe_content_end_s) {
+ if (block.string[range.start] == fss_basic_write_pipe_content_end_s.string[0]) {
state = 0x3;
++range.start;
break;
}
- if (block.string[range.start] == fss_basic_write_pipe_content_ignore_s) {
+ if (block.string[range.start] == fss_basic_write_pipe_content_ignore_s.string[0]) {
// This is not used by objects.
continue;
for (; range.start <= range.stop; ++range.start) {
- if (block.string[range.start] == fss_basic_write_pipe_content_start_s) {
+ if (block.string[range.start] == fss_basic_write_pipe_content_start_s.string[0]) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
fll_print_format("%r%[%QThis standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
break;
}
- if (block.string[range.start] == fss_basic_write_pipe_content_end_s) {
+ if (block.string[range.start] == fss_basic_write_pipe_content_end_s.string[0]) {
state = 0x3;
++range.start;
break;
}
- if (block.string[range.start] == fss_basic_write_pipe_content_ignore_s) {
+ if (block.string[range.start] == fss_basic_write_pipe_content_ignore_s.string[0]) {
// This is not used by this program.
continue;
fss_basic_write_error_parameter_unsupported_eol_print(main);
status = F_status_set_error(F_supported_not);
+
break;
}
const f_string_static_t fss_embedded_list_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_program_name_long_s, 0, FSS_EMBEDDED_LIST_READ_program_name_long_s_length);
#endif // _di_fss_embedded_list_read_program_name_
+#ifndef _di_fss_embedded_list_read_defines_
+ const f_string_static_t fss_embedded_list_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_pipe_name_s, 0, FSS_EMBEDDED_LIST_READ_pipe_name_s_length);
+ const f_string_static_t fss_embedded_list_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_pipe_content_end_s, 0, FSS_EMBEDDED_LIST_READ_pipe_content_end_s_length);
+ const f_string_static_t fss_embedded_list_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_pipe_content_ignore_s, 0, FSS_EMBEDDED_LIST_READ_pipe_content_ignore_s_length);
+ const f_string_static_t fss_embedded_list_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_pipe_content_start_s, 0, FSS_EMBEDDED_LIST_READ_pipe_content_start_s_length);
+#endif // _di_fss_embedded_list_read_defines_
+
#ifndef _di_fss_embedded_list_read_parameters_
const f_string_static_t fss_embedded_list_read_short_at_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_at_s, 0, FSS_EMBEDDED_LIST_READ_short_at_s_length);
const f_string_static_t fss_embedded_list_read_short_content_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_content_s, 0, FSS_EMBEDDED_LIST_READ_short_content_s_length);
#ifndef _di_fss_embedded_list_read_delimit_mode_
const f_string_static_t fss_embedded_list_read_delimit_mode_name_none_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_none_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_none_s_length);
const f_string_static_t fss_embedded_list_read_delimit_mode_name_all_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_all_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_all_s_length);
- const f_string_static_t fss_embedded_list_read_delimit_mode_name_object_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_object_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_object_s_length);
const f_string_static_t fss_embedded_list_read_delimit_mode_name_greater_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_greater_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_greater_s_length);
const f_string_static_t fss_embedded_list_read_delimit_mode_name_lesser_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_lesser_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_lesser_s_length);
#endif // _di_fss_embedded_list_read_delimit_mode_
/**
* The program defines.
+ *
+ * fss_embedded_list_read_pipe_*:
+ * - name: A name used to represent the pipe when printing file names.
+ * - content_end: A code used to represent the end of Content for use in binary formats.
+ * - content_ignore: A code used to represent the ignoring Content for use in binary formats.
+ * - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_embedded_list_read_defines_
#define fss_embedded_list_read_signal_check_d 10000
+ #define FSS_EMBEDDED_LIST_READ_pipe_name_s "(pipe)"
+
#define FSS_EMBEDDED_LIST_READ_pipe_content_end_s "\f"
#define FSS_EMBEDDED_LIST_READ_pipe_content_ignore_s "\v"
#define FSS_EMBEDDED_LIST_READ_pipe_content_start_s "\b"
+ #define FSS_EMBEDDED_LIST_READ_pipe_name_s_length 6
+
#define FSS_EMBEDDED_LIST_READ_pipe_content_end_s_length 1
#define FSS_EMBEDDED_LIST_READ_pipe_content_ignore_s_length 1
#define FSS_EMBEDDED_LIST_READ_pipe_content_start_s_length 1
+ extern const f_string_static_t fss_embedded_list_read_pipe_name_s;
+
extern const f_string_static_t fss_embedded_list_read_pipe_content_end_s;
extern const f_string_static_t fss_embedded_list_read_pipe_content_ignore_s;
extern const f_string_static_t fss_embedded_list_read_pipe_content_start_s;
if (F_status_is_error(status)) {
fss_embedded_list_read_main_delete(main);
+
return F_status_set_error(status);
}
}
else {
main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_e;
- if (argv[index][length - 1] == fss_embedded_list_read_delimit_mode_name_greater_s.string[0]) {
+ if (argv[index].string[length - 1] == fss_embedded_list_read_delimit_mode_name_greater_s.string[0]) {
main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_greater_e;
// Shorten the length to better convert the remainder to a number.
--length;
}
- else if (argv[index][length - 1] == fss_embedded_list_read_delimit_mode_name_lesser_s.string[0]) {
+ else if (argv[index].string[length - 1] == fss_embedded_list_read_delimit_mode_name_lesser_s.string[0]) {
main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_lesser_e;
// Shorten the length to better convert the remainder to a number.
f_string_range_t range = macro_f_string_range_t_initialize(length);
// Ignore leading plus sign.
- if (argv[index][0] == f_string_ascii_plus_s[0]) {
+ if (argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
++range.start;
}
f_fss_delimits_t contents_delimits = f_fss_delimits_t_initialize;
f_fss_comments_t comments = f_fss_comments_t_initialize;
- f_array_length_t original_size = main->quantity.total;
+ const f_array_length_t original_size = main->quantity.total;
if (F_status_is_error_not(status)) {
- status = fss_embedded_list_read_main_preprocess_depth(main, arguments, &depths);
+ status = fss_embedded_list_read_main_preprocess_depth(main, &depths);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fss_embedded_list_read_main_preprocess_depth", F_true);
fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
else {
- status = fss_embedded_list_read_main_process_file(main, arguments, f_string_ascii_minus_s, depths, &objects_delimits, &contents_delimits, &comments);
+ status = fss_embedded_list_read_main_process_file(main, f_string_ascii_minus_s, depths, &objects_delimits, &contents_delimits, &comments);
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), "fss_embedded_list_read_main_process_file", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
f_file_t file = f_file_t_initialize;
- status = f_file_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
+ status = f_file_open(argv[main->parameters.remaining.array[i]], 0, &file);
main->quantity.total = original_size;
break;
}
- status = fss_embedded_list_read_main_process_file(main, arguments, argv[main->parameters.remaining.array[i]], depths, &objects_delimits, &contents_delimits, &comments);
+ status = fss_embedded_list_read_main_process_file(main, argv[main->parameters.remaining.array[i]], depths, &objects_delimits, &contents_delimits, &comments);
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), "fss_embedded_list_read_main_process_file", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
#endif
#ifndef _di_fss_embedded_list_read_main_preprocess_depth_
- f_status_t fss_embedded_list_read_main_preprocess_depth(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_embedded_list_read_depths_t *depths) {
+ f_status_t fss_embedded_list_read_main_preprocess_depth(fss_embedded_list_read_main_t * const main, fss_embedded_list_read_depths_t *depths) {
f_status_t status = F_none;
}
}
- // provide default level-0 depth values.
+ // Provide default level-0 depth values.
depths->array[0].depth = 0;
depths->array[0].index_at = 0;
depths->array[0].index_name = 0;
depths->array[0].value_at = 0;
{
+ f_string_static_t * const argv = main->parameters.arguments.array;
f_number_unsigned_t number = 0;
bool first_depth = F_true;
}
if (values_type[i] == fss_embedded_list_read_parameter_depth_e || values_type[i] == fss_embedded_list_read_parameter_at_e) {
- const f_string_range_t range = macro_f_string_range_t_initialize(strlen(argv[values_order[i]]));
+ const f_string_range_t range = macro_f_string_range_t_initialize(argv[values_order[i]].used);
- status = fl_conversion_string_to_number_unsigned(argv[values_order[i]], range, &number);
+ status = fl_conversion_string_to_number_unsigned(argv[values_order[i]].string, range, &number);
if (F_status_is_error(status)) {
fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_depth_s, argv[values_order[i]]);
depths->array[depths->used].value_name.used = 0;
if (main->parameters.array[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) {
- status = fl_string_rip(argv[values_order[i]], strnlen(argv[values_order[i]], F_console_parameter_size_d), &depths->array[depths->used].value_name);
+ status = fl_string_rip(argv[values_order[i]].string, argv[values_order[i]].used, &depths->array[depths->used].value_name);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fl_string_rip", F_true);
}
}
else {
- status = f_string_append(argv[values_order[i]], strnlen(argv[values_order[i]], F_console_parameter_size_d), &depths->array[depths->used].value_name);
+ status = f_string_append(argv[values_order[i]].string, argv[values_order[i]].used, &depths->array[depths->used].value_name);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true);
#endif // _di_fss_embedded_list_read_main_preprocess_depth_
#ifndef _di_fss_embedded_list_read_main_process_file_
- f_status_t fss_embedded_list_read_main_process_file(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, const f_string_t filename, const fss_embedded_list_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) {
+ f_status_t fss_embedded_list_read_main_process_file(fss_embedded_list_read_main_t * const main, const f_string_static_t filename, const fss_embedded_list_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) {
f_status_t status = F_none;
if (main->parameters.array[fss_embedded_list_read_parameter_select_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[fss_embedded_list_read_parameter_select_e].values.array[main->parameters.array[fss_embedded_list_read_parameter_select_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(argv[index]);
+ const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used);
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &select);
+ status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, &select);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_select_s, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_select_s, main->parameters.arguments.array[index]);
return status;
}
if (main->parameters.array[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[fss_embedded_list_read_parameter_line_e].values.array[main->parameters.array[fss_embedded_list_read_parameter_line_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used);
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &line);
+ status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, &line);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_line_s, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_line_s, main->parameters.arguments.array[index]);
return status;
}
if (main->parameters.array[fss_embedded_list_read_parameter_raw_e].result == f_console_result_found_e) {
f_fss_delimits_t except_none = f_fss_delimits_t_initialize;
- return fss_embedded_list_read_main_process_for_depth(main, arguments, filename, depths, 0, line, parents, &except_none, &except_none);
+ return fss_embedded_list_read_main_process_for_depth(main, filename, depths, 0, line, parents, &except_none, &except_none);
}
- return fss_embedded_list_read_main_process_for_depth(main, arguments, filename, depths, 0, line, parents, objects_delimits, contents_delimits);
+ return fss_embedded_list_read_main_process_for_depth(main, filename, depths, 0, line, parents, objects_delimits, contents_delimits);
}
#endif // _di_fss_embedded_list_read_main_process_file_
#ifndef _di_fss_embedded_list_read_main_process_for_depth_
- f_status_t fss_embedded_list_read_main_process_for_depth(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, const f_string_t filename, const fss_embedded_list_read_depths_t depths, const f_array_length_t depths_index, const f_array_length_t line, const fss_embedded_list_read_skip_t parents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) {
+ f_status_t fss_embedded_list_read_main_process_for_depth(fss_embedded_list_read_main_t * const main, const f_string_static_t filename, const fss_embedded_list_read_depths_t depths, const f_array_length_t depths_index, const f_array_length_t line, const fss_embedded_list_read_skip_t parents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) {
f_fss_items_t *items = &main->nest.depth[depths.array[depths_index].depth];
} // for
}
- return fss_embedded_list_read_main_process_for_depth(main, arguments, filename, depths, depths_index + 1, line, parents_next, objects_delimits, contents_delimits);
+ return fss_embedded_list_read_main_process_for_depth(main, filename, depths, depths_index + 1, line, parents_next, objects_delimits, contents_delimits);
}
// Process objects.
f_print_except_dynamic_partial(main->buffer, items->array[i].content.array[0], *contents_delimits, main->output.to.stream);
if (main->parameters.array[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_embedded_list_read_pipe_content_end_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_embedded_list_read_pipe_content_end_s, main->output.to.stream);
}
} // for
*
* @param main
* The main program data.
- * @param arguments
- * The console arguments to pre-process.
* @param depths
* This stores the pre-processed depth parameters.
*
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fss_embedded_list_read_main_preprocess_depth_
- extern f_status_t fss_embedded_list_read_main_preprocess_depth(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_embedded_list_read_depths_t *depths) F_attribute_visibility_internal_d;
+ extern f_status_t fss_embedded_list_read_main_preprocess_depth(fss_embedded_list_read_main_t * const main, fss_embedded_list_read_depths_t *depths) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_read_main_preprocess_depth_
/**
*
* @param main
* The main program data.
- * @param arguments
- * The console arguments passed to the program.
* @param file_name
* The name of the file being processed.
* @param depths
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fss_embedded_list_read_main_process_file_
- extern f_status_t fss_embedded_list_read_main_process_file(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, const f_string_t file_name, const fss_embedded_list_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) F_attribute_visibility_internal_d;
+ extern f_status_t fss_embedded_list_read_main_process_file(fss_embedded_list_read_main_t * const main, const f_string_static_t file_name, const fss_embedded_list_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_read_main_process_file_
/**
*
* @param main
* The main program data.
- * @param arguments
- * The console arguments passed to the program.
* @param file_name
* The name of the file being processed.
* @param depths
* @see fss_embedded_list_read_main_process_file()
*/
#ifndef _di_fss_embedded_list_read_main_process_for_depth_
- extern f_status_t fss_embedded_list_read_main_process_for_depth(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, const f_string_t filename, const fss_embedded_list_read_depths_t depths, const f_array_length_t depths_index, const f_array_length_t line, const fss_embedded_list_read_skip_t parents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) F_attribute_visibility_internal_d;
+ extern f_status_t fss_embedded_list_read_main_process_for_depth(fss_embedded_list_read_main_t * const main, const f_string_static_t filename, const fss_embedded_list_read_depths_t depths, const f_array_length_t depths_index, const f_array_length_t line, const fss_embedded_list_read_skip_t parents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_read_main_process_for_depth_
/**
#endif // _di_fss_embedded_list_write_program_name_
#ifndef _di_fss_embedded_list_write_defines_
+ const f_string_static_t fss_embedded_list_write_pipe_name_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_pipe_name_s, 0, FSS_EMBEDDED_LIST_WRITE_pipe_name_s_length);
const f_string_static_t fss_embedded_list_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_pipe_content_end_s, 0, FSS_EMBEDDED_LIST_WRITE_pipe_content_end_s_length);
const f_string_static_t fss_embedded_list_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_pipe_content_ignore_s, 0, FSS_EMBEDDED_LIST_WRITE_pipe_content_ignore_s_length);
const f_string_static_t fss_embedded_list_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_pipe_content_start_s, 0, FSS_EMBEDDED_LIST_WRITE_pipe_content_start_s_length);
/**
* The program defines.
+ *
+ * fss_embedded_list_write_pipe_*:
+ * - name: A name used to represent the pipe when printing file names.
+ * - content_end: A code used to represent the end of Content for use in binary formats.
+ * - content_ignore: A code used to represent the ignoring Content for use in binary formats.
+ * - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_embedded_list_write_defines_
#define fss_embedded_list_write_signal_check_d 10000
+ #define FSS_EMBEDDED_LIST_WRITE_pipe_name_s "(pipe)"
+
#define FSS_EMBEDDED_LIST_WRITE_pipe_content_end_s "\f"
#define FSS_EMBEDDED_LIST_WRITE_pipe_content_ignore_s "\v"
#define FSS_EMBEDDED_LIST_WRITE_pipe_content_start_s "\b"
+ #define FSS_EMBEDDED_LIST_WRITE_pipe_name_s_length 6
+
#define FSS_EMBEDDED_LIST_WRITE_pipe_content_end_s_length 1
#define FSS_EMBEDDED_LIST_WRITE_pipe_content_ignore_s_length 1
#define FSS_EMBEDDED_LIST_WRITE_pipe_content_start_s_length 1
+ extern const f_string_static_t fss_embedded_list_write_pipe_name_s;
+
extern const f_string_static_t fss_embedded_list_write_pipe_content_end_s;
extern const f_string_static_t fss_embedded_list_write_pipe_content_ignore_s;
extern const f_string_static_t fss_embedded_list_write_pipe_content_start_s;
}
}
else if (main->parameters.array[fss_embedded_list_write_parameter_file_e].result == f_console_result_found_e) {
- fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string.string, fss_embedded_list_write_long_file_s);
+ fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_embedded_list_write_long_file_s);
status = F_status_set_error(F_parameter);
}
}
for (; range.start < argv[index].used; ++range.start) {
- status = f_fss_is_space(main->parameter->arguments.array[index], range);
+ status = f_fss_is_space(argv[index], range);
if (F_status_is_error(status)) break;
if (status == F_false) {
}
}
- f_fss_quote_t quote = F_fss_delimit_quote_double_s;
+ f_fss_quote_t quote = f_fss_quote_type_double_e;
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_embedded_list_write_parameter_double_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_embedded_list_write_parameter_single_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_embedded_list_write_parameter_double_e].location < main->parameters.array[fss_embedded_list_write_parameter_single_e].location) {
- quote = F_fss_delimit_quote_single_s;
+ quote = f_fss_quote_type_single_e;
}
}
}
else if (main->parameters.array[fss_embedded_list_write_parameter_single_e].result == f_console_result_found_e) {
- quote = F_fss_delimit_quote_single_s;
+ quote = f_fss_quote_type_single_e;
}
}
break;
}
- status = fss_embedded_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore);
+ status = fss_embedded_list_write_process_parameter_ignore(main, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore);
if (F_status_is_error(status)) break;
status = fss_embedded_list_write_process(main, output, quote, 0, &argv[main->parameters.array[fss_embedded_list_write_parameter_content_e].values.array[i]], &ignore, &buffer);
break;
}
- status = fss_embedded_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore);
+ status = fss_embedded_list_write_process_parameter_ignore(main, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore);
if (F_status_is_error(status)) break;
status = fss_embedded_list_write_process(main, output, quote, &argv[main->parameters.array[fss_embedded_list_write_parameter_object_e].values.array[i]], &argv[main->parameters.array[fss_embedded_list_write_parameter_content_e].values.array[i]], &ignore, &buffer);
range.start = 0;
range.stop = content->used - 1;
- status = fl_fss_embedded_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, &main->prepend, ignore, state, &range, buffer);
+ f_string_static_t *prepend = 0;
+
+ if (main->parameters.array[fss_embedded_list_write_parameter_prepend_e].result == f_console_result_additional_e) {
+ const f_array_length_t index = main->parameters.array[fss_embedded_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_embedded_list_write_parameter_prepend_e].values.used - 1];
+
+ prepend = &main->parameters.arguments.array[index];
+ }
+
+
+ status = fl_fss_embedded_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, ignore, state, &range, buffer);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fl_fss_embedded_list_content_write", F_true);
for (; range.start <= range.stop; ++range.start) {
- if (block.string[range.start] == fss_embedded_list_write_pipe_content_start_s) {
+ if (block.string[range.start] == fss_embedded_list_write_pipe_content_start_s.string[0]) {
state = 0x2;
++range.start;
break;
}
- if (block.string[range.start] == fss_embedded_list_write_pipe_content_end_s) {
+ if (block.string[range.start] == fss_embedded_list_write_pipe_content_end_s.string[0]) {
state = 0x3;
++range.start;
break;
}
- if (block.string[range.start] == fss_embedded_list_write_pipe_content_ignore_s) {
- // this is not used by objects.
+ if (block.string[range.start] == fss_embedded_list_write_pipe_content_ignore_s.string[0]) {
+ // This is not used by objects.
continue;
}
for (; range.start <= range.stop; ++range.start) {
- if (block.string[range.start] == fss_embedded_list_write_pipe_content_start_s) {
+ if (block.string[range.start] == fss_embedded_list_write_pipe_content_start_s.string[0]) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
fll_print_format("%r%[%QThis standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
break;
}
- if (block.string[range.start] == fss_embedded_list_write_pipe_content_end_s) {
+ if (block.string[range.start] == fss_embedded_list_write_pipe_content_end_s.string[0]) {
state = 0x3;
++range.start;
break;
}
- if (block.string[range.start] == fss_embedded_list_write_pipe_content_ignore_s) {
+ if (block.string[range.start] == fss_embedded_list_write_pipe_content_ignore_s.string[0]) {
if (ignore) {
if (range_ignore.start > range_ignore.stop) {
range_ignore.start = content.used;
#endif // _di_fss_embedded_list_write_process_pipe_
#ifndef _di_fss_embedded_list_write_process_parameter_ignore_
- f_status_t fss_embedded_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) {
+ f_status_t fss_embedded_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) {
f_status_t status = F_none;
f_number_unsigned_t number = 0;
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
range.start = 0;
for (; i < main->parameters.array[fss_embedded_list_write_parameter_ignore_e].locations.used; ++i) {
range.stop = argv[index].used - 1;
// allow and ignore the positive sign.
- if (range.stop && argv[index][0] == f_string_ascii_plus_s[0]) {
+ if (range.stop && argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
range.start = 1;
}
range.stop = argv[index].used - 1;
// Allow and ignore the positive sign.
- if (range.stop && argv[index][0] == f_string_ascii_plus_s[0]) {
+ if (range.stop && argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
range.start = 1;
}
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param contents
* The console parameter locations array for the content parameter.
* @param location
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_embedded_list_write_process_parameter_ignore_
- extern f_status_t fss_embedded_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
+ extern f_status_t fss_embedded_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_write_process_parameter_ignore_
#ifdef __cplusplus
#endif // _di_fss_extended_list_read_program_name_
#ifndef _di_fss_extended_list_read_defines_
+ const f_string_static_t fss_extended_list_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_pipe_name_s, 0, FSS_EXTENDED_LIST_READ_pipe_name_s_length);
const f_string_static_t fss_extended_list_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_pipe_content_end_s, 0, FSS_EXTENDED_LIST_READ_pipe_content_end_s_length);
const f_string_static_t fss_extended_list_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_pipe_content_ignore_s, 0, FSS_EXTENDED_LIST_READ_pipe_content_ignore_s_length);
const f_string_static_t fss_extended_list_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_pipe_content_start_s, 0, FSS_EXTENDED_LIST_READ_pipe_content_start_s_length);
#define FSS_EXTENDED_LIST_READ_program_version_nano_s_length 0
#endif // !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_s_length))
- #define FSS_EXTENDED_LIST_READ_program_version_s FSS_EXTENDED_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_micro_s FSS_EXTENDED_LIST_READ_version_nano_prefix_s FSS_EXTENDED_LIST_READ_version_nano_s
+ #define FSS_EXTENDED_LIST_READ_program_version_s FSS_EXTENDED_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_micro_s FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s FSS_EXTENDED_LIST_READ_program_version_nano_s
- #define FSS_EXTENDED_LIST_READ_program_version_s_length FSS_EXTENDED_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_micro_s_length + FSS_EXTENDED_LIST_READ_version_nano_prefix_s_length + FSS_EXTENDED_LIST_READ_version_nano_s_length
+ #define FSS_EXTENDED_LIST_READ_program_version_s_length FSS_EXTENDED_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_micro_s_length + FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s_length + FSS_EXTENDED_LIST_READ_program_version_nano_s_length
extern const f_string_static_t fss_extended_list_read_program_version_s;
#endif // _di_fss_extended_list_read_program_version_
/**
* The program name.
+ *
+ * fss_extended_list_read_pipe_*:
+ * - name: A name used to represent the pipe when printing file names.
+ * - content_end: A code used to represent the end of Content for use in binary formats.
+ * - content_ignore: A code used to represent the ignoring Content for use in binary formats.
+ * - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_extended_list_read_program_name_
#define FSS_EXTENDED_LIST_READ_program_name_s "fss_extended_list_read"
#ifndef _di_fss_extended_list_read_defines_
#define fss_extended_list_read_signal_check_d 10000
+ #define FSS_EXTENDED_LIST_READ_pipe_name_s "(pipe)"
+
#define FSS_EXTENDED_LIST_READ_pipe_content_end_s "\f"
#define FSS_EXTENDED_LIST_READ_pipe_content_ignore_s "\v"
#define FSS_EXTENDED_LIST_READ_pipe_content_start_s "\b"
+ #define FSS_EXTENDED_LIST_READ_pipe_name_s_length 6
+
#define FSS_EXTENDED_LIST_READ_pipe_content_end_s_length 1
#define FSS_EXTENDED_LIST_READ_pipe_content_ignore_s_length 1
#define FSS_EXTENDED_LIST_READ_pipe_content_start_s_length 1
+ extern const f_string_static_t fss_extended_list_read_pipe_name_s;
+
extern const f_string_static_t fss_extended_list_read_pipe_content_end_s;
extern const f_string_static_t fss_extended_list_read_pipe_content_ignore_s;
extern const f_string_static_t fss_extended_list_read_pipe_content_start_s;
data.files.array = files_array;
data.files.used = 1;
data.files.size = main->parameters.remaining.used + 1;
- data.files.array[0].name = "(pipe)";
+ data.files.array[0].name = fss_extended_list_read_pipe_name_s;
data.files.array[0].range.start = 1;
data.files.array[0].range.stop = 0;
fss_extended_list_read_parameter_delimit_e,
};
- const f_string_t parameter_name[] = {
+ const f_string_static_t parameter_name[] = {
fss_extended_list_read_long_at_s,
fss_extended_list_read_long_depth_s,
fss_extended_list_read_long_line_s,
data.delimit_mode = fss_extended_list_read_delimit_mode_content_object_e;
}
- if (argv[index][length - 1] == fss_extended_list_read_delimit_mode_name_greater_s.string[0]) {
+ if (argv[index].string[length - 1] == fss_extended_list_read_delimit_mode_name_greater_s.string[0]) {
if (!(data.delimit_mode == fss_extended_list_read_delimit_mode_none_e || data.delimit_mode == fss_extended_list_read_delimit_mode_all_e)) {
if (data.delimit_mode == fss_extended_list_read_delimit_mode_content_object_e) {
data.delimit_mode = fss_extended_list_read_delimit_mode_content_greater_object_e;
// Shorten the length to better convert the remainder to a number.
--length;
}
- else if (argv[index][length - 1] == fss_extended_list_read_delimit_mode_name_lesser_s.string[0]) {
+ else if (argv[index].string[length - 1] == fss_extended_list_read_delimit_mode_name_lesser_s.string[0]) {
if (!(data.delimit_mode == fss_extended_list_read_delimit_mode_none_e || data.delimit_mode == fss_extended_list_read_delimit_mode_all_e)) {
if (data.delimit_mode == fss_extended_list_read_delimit_mode_content_object_e) {
data.delimit_mode = fss_extended_list_read_delimit_mode_content_lesser_object_e;
f_string_range_t range = macro_f_string_range_t_initialize(length);
// Ignore leading plus sign.
- if (argv[index][0] == f_string_ascii_plus_s[0]) {
+ if (argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
++range.start;
}
// This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
// Guarantee that a newline exists at the end of the buffer.
- status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
+ status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer);
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(argv[main->parameters.remaining.array[i]], 0, &file);
+ status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
// This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
// Guarantee that a newline exists at the end of the buffer.
- status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
+ status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
}
void fss_extended_list_read_print_content_ignore(fll_program_data_t * const main) {
if (main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_dynamic_raw(fss_extended_list_read_pipe_content_ignore, main->output.to.stream);
+ f_print_dynamic_raw(fss_extended_list_read_pipe_content_ignore_s, main->output.to.stream);
}
}
#endif // _di_fss_extended_list_read_print_content_ignore_
void fss_extended_list_read_print_object_end(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
if (main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_dynamic_raw(fss_extended_list_read_pipe_content_start, main->output.to.stream);
+ f_print_dynamic_raw(fss_extended_list_read_pipe_content_start_s, main->output.to.stream);
}
else {
if ((data->option & fss_extended_list_read_data_option_object_d) && (data->option & fss_extended_list_read_data_option_content_d)) {
void fss_extended_list_read_print_set_end(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
if (main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_extended_list_read_pipe_content_end, main->output.to.stream);
+ f_print_dynamic_raw(fss_extended_list_read_pipe_content_end_s, main->output.to.stream);
}
else {
if (data->option & fss_extended_list_read_data_option_object_d) {
f_array_length_t position_at = 0;
f_array_length_t position_name = 0;
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (fss_extended_list_read_signal_received(main)) {
data->depths.array[i].index_name = main->parameters.array[fss_extended_list_read_parameter_name_e].values.array[position_name];
if (main->parameters.array[fss_extended_list_read_parameter_trim_e].result == f_console_result_found_e) {
- status = fl_string_dynamic_rip(argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
+ status = fl_string_rip(argv[data->depths.array[i].index_name].string, argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
}
else {
status = f_string_dynamic_append(argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
const f_status_t status = fll_fss_extended_list_read(data->buffer, state, &input, &data->objects, &data->contents, &data->delimits_object, &data->delimits_content, &data->comments);
if (F_status_is_error(status)) {
- const f_string_t file_name = fss_extended_list_read_file_identify(input.start, data->files);
+ const f_string_static_t file_name = fss_extended_list_read_file_identify(input.start, data->files);
fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_list_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e);
#endif // _di_fss_extended_list_read_load_
#ifndef _di_fss_extended_list_read_load_number_
- f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
+ f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(argv[index].string, range, number);
+ const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]);
return status;
}
if (main->parameters.array[fss_extended_list_read_parameter_line_e].result == f_console_result_additional_e) {
data->option |= fss_extended_list_read_data_option_line_d;
- status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_line_e, fss_extended_list_read_long_line_s, arguments, &data->line);
+ status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_line_e, fss_extended_list_read_long_line_s, &data->line);
if (F_status_is_error(status)) return status;
}
if (main->parameters.array[fss_extended_list_read_parameter_select_e].result == f_console_result_additional_e) {
data->option |= fss_extended_list_read_data_option_select_d;
- status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_select_e, fss_extended_list_read_long_select_s, arguments, &data->select);
+ status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_select_e, fss_extended_list_read_long_select_s, &data->select);
if (F_status_is_error(status)) return status;
}
* On failure to identify, an empty string is returned.
*/
#ifndef _di_fss_extended_list_read_file_identify_
- extern f_string_t fss_extended_list_read_file_identify(const f_array_length_t at, const fss_extended_list_read_files_t files) F_attribute_visibility_internal_d;
+ extern f_string_static_t fss_extended_list_read_file_identify(const f_array_length_t at, const fss_extended_list_read_files_t files) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_file_identify_
/**
* An ID representing the parameter.
* @param name
* The parameter name to print on error.
- * @param arguments
- * The console arguments passed to the program.
* @param number
* The location to store the loaded number.
*
* @see fss_extended_list_read_depths_resize()
*/
#ifndef _di_fss_extended_list_read_load_number_
- extern f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_load_number_
/**
#endif // _di_fss_extended_list_write_program_name_
#ifndef _di_fss_extended_list_write_defines_
+ const f_string_static_t fss_extended_list_write_pipe_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_pipe_name_s, 0, FSS_EXTENDED_LIST_WRITE_pipe_name_s_length);
const f_string_static_t fss_extended_list_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_pipe_content_end_s, 0, FSS_EXTENDED_LIST_WRITE_pipe_content_end_s_length);
const f_string_static_t fss_extended_list_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_pipe_content_ignore_s, 0, FSS_EXTENDED_LIST_WRITE_pipe_content_ignore_s_length);
const f_string_static_t fss_extended_list_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_pipe_content_start_s, 0, FSS_EXTENDED_LIST_WRITE_pipe_content_start_s_length);
/**
* The program defines.
+ *
+ * fss_extended_list_write_pipe_*:
+ * - name: A name used to represent the pipe when printing file names.
+ * - content_end: A code used to represent the end of Content for use in binary formats.
+ * - content_ignore: A code used to represent the ignoring Content for use in binary formats.
+ * - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_extended_list_write_defines_
#define fss_extended_list_write_signal_check_d 10000
+ #define FSS_EXTENDED_LIST_READ_pipe_name_s "(pipe)"
+
+ #define FSS_EXTENDED_LIST_READ_pipe_name_s_length 6
+
#define FSS_EXTENDED_LIST_WRITE_pipe_content_end_s "\f"
#define FSS_EXTENDED_LIST_WRITE_pipe_content_ignore_s "\v"
#define FSS_EXTENDED_LIST_WRITE_pipe_content_start_s "\b"
#define FSS_EXTENDED_LIST_WRITE_pipe_content_ignore_s_length 1
#define FSS_EXTENDED_LIST_WRITE_pipe_content_start_s_length 1
+ extern const f_string_static_t fss_extended_list_read_pipe_name_s;
+
extern const f_string_static_t fss_extended_list_write_pipe_content_end_s;
extern const f_string_static_t fss_extended_list_write_pipe_content_ignore_s;
extern const f_string_static_t fss_extended_list_write_pipe_content_start_s;
}
else if (main->parameters.array[fss_extended_list_write_parameter_prepend_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.used - 1];
- const f_array_length_t length = strnlen(argv[index], F_console_parameter_size_d);
if (length) {
f_string_range_t range = macro_f_string_range_t_initialize(length);
}
}
- f_fss_quote_t quote = F_fss_delimit_quote_double_s;
+ f_fss_quote_t quote = f_fss_delimit_quote_double_s;
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_extended_list_write_parameter_double_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_extended_list_write_parameter_single_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_extended_list_write_parameter_double_e].location < main->parameters.array[fss_extended_list_write_parameter_single_e].location) {
- quote = F_fss_delimit_quote_single_s;
+ quote = f_fss_quote_type_single_e;
}
}
}
else if (main->parameters.array[fss_extended_list_write_parameter_single_e].result == f_console_result_found_e) {
- quote = F_fss_delimit_quote_single_s;
+ quote = f_fss_quote_type_single_e;
}
}
break;
}
- status = fss_extended_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore);
+ status = fss_extended_list_write_process_parameter_ignore(main, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore);
if (F_status_is_error(status)) break;
status = fss_extended_list_write_process(main, output, quote, 0, &argv[main->parameters.array[fss_extended_list_write_parameter_content_e].values.array[i]], &ignore, &buffer);
break;
}
- status = fss_extended_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore);
+ status = fss_extended_list_write_process_parameter_ignore(main, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore);
if (F_status_is_error(status)) break;
status = fss_extended_list_write_process(main, output, quote, &argv[main->parameters.array[fss_extended_list_write_parameter_object_e].values.array[i]], &argv[main->parameters.array[fss_extended_list_write_parameter_content_e].values.array[i]], &ignore, &buffer);
for (; range.start <= range.stop; ++range.start) {
- if (block.string[range.start] == fss_extended_list_write_pipe_content_start_s) {
+ if (block.string[range.start] == fss_extended_list_write_pipe_content_start_s.string[0]) {
state = 0x2;
++range.start;
break;
}
- if (block.string[range.start] == fss_extended_list_write_pipe_content_end_s) {
+ if (block.string[range.start] == fss_extended_list_write_pipe_content_end_s.string[0]) {
state = 0x3;
++range.start;
break;
}
- if (block.string[range.start] == fss_extended_list_write_pipe_content_ignore_s) {
+ if (block.string[range.start] == fss_extended_list_write_pipe_content_ignore_s.string[0]) {
// This is not used by objects.
continue;
for (; range.start <= range.stop; ++range.start) {
- if (block.string[range.start] == fss_extended_list_write_pipe_content_start_s) {
+ if (block.string[range.start] == fss_extended_list_write_pipe_content_start_s.string[0]) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
fll_print_format("%r%[%QThis standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
break;
}
- if (block.string[range.start] == fss_extended_list_write_pipe_content_end_s) {
+ if (block.string[range.start] == fss_extended_list_write_pipe_content_end_s.string[0]) {
state = 0x3;
range.start++;
break;
}
- if (block.string[range.start] == fss_extended_list_write_pipe_content_ignore_s) {
+ if (block.string[range.start] == fss_extended_list_write_pipe_content_ignore_s.string[0]) {
if (ignore) {
if (range_ignore.start > range_ignore.stop) {
range_ignore.start = content.used;
#endif // _di_fss_extended_list_write_process_pipe_
#ifndef _di_fss_extended_list_write_process_parameter_ignore_
- f_status_t fss_extended_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) {
+ f_status_t fss_extended_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) {
f_status_t status = F_none;
f_number_unsigned_t number = 0;
+ f_string_static_t * const argv = main->parameters.arguments.array;
+
range.start = 0;
for (; i < main->parameters.array[fss_extended_list_write_parameter_ignore_e].locations.used; ++i) {
range.stop = strnlen(argv[index], F_console_parameter_size_d) - 1;
// allow and ignore the positive sign.
- if (range.stop > 0 && argv[index][0] == '+') {
+ if (range.stop > 0 && argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
range.start = 1;
}
range.stop = strnlen(argv[index], F_console_parameter_size_d) - 1;
// allow and ignore the positive sign.
- if (range.stop > 0 && argv[index][0] == '+') {
+ if (range.stop > 0 && argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
range.start = 1;
}
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param contents
* The console parameter locations array for the content parameter.
* @param location
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_extended_list_write_process_parameter_ignore_
- extern f_status_t fss_extended_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_write_process_parameter_ignore_
#ifdef __cplusplus
#endif // _di_fss_extended_read_program_name_
#ifndef _di_fss_extended_read_defines_
+ const f_string_static_t fss_extended_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_pipe_name_s, 0, FSS_EXTENDED_READ_pipe_name_s_length);
const f_string_static_t fss_extended_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_pipe_content_end_s, 0, FSS_EXTENDED_READ_pipe_content_end_s_length);
const f_string_static_t fss_extended_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_pipe_content_ignore_s, 0, FSS_EXTENDED_READ_pipe_content_ignore_s_length);
const f_string_static_t fss_extended_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_pipe_content_start_s, 0, FSS_EXTENDED_READ_pipe_content_start_s_length);
/**
* The program defines.
+ *
+ * fss_extended_read_pipe_*:
+ * - name: A name used to represent the pipe when printing file names.
+ * - content_end: A code used to represent the end of Content for use in binary formats.
+ * - content_ignore: A code used to represent the ignoring Content for use in binary formats.
+ * - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_extended_read_defines_
#define fss_extended_read_signal_check_d 10000
+ #define FSS_EXTENDED_READ_pipe_name_s "(pipe)"
+
#define FSS_EXTENDED_READ_pipe_content_end_s "\f"
#define FSS_EXTENDED_READ_pipe_content_ignore_s "\v"
#define FSS_EXTENDED_READ_pipe_content_start_s "\b"
+ #define FSS_EXTENDED_READ_pipe_name_s_length 6
+
#define FSS_EXTENDED_READ_pipe_content_end_s_length 1
#define FSS_EXTENDED_READ_pipe_content_ignore_s_length 1
#define FSS_EXTENDED_READ_pipe_content_start_s_length 1
+ extern const f_string_static_t fss_extended_read_pipe_name_s;
+
extern const f_string_static_t fss_extended_read_pipe_content_end_s;
extern const f_string_static_t fss_extended_read_pipe_content_ignore_s;
extern const f_string_static_t fss_extended_read_pipe_content_start_s;
data.files.array = files_array;
data.files.used = 1;
data.files.size = main->parameters.remaining.used + 1;
- data.files.array[0].name = "(pipe)";
+ data.files.array[0].name = fss_extended_read_pipe_name_s;
data.files.array[0].range.start = 1;
data.files.array[0].range.stop = 0;
// This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
// Guarantee that a newline exists at the end of the buffer.
- status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
+ status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
else {
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(argv[main->parameters.remaining.array[i]], 0, &file);
+ status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
// This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
// Guarantee that a newline exists at the end of the buffer.
- status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
+ status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
}
const f_status_t status = fll_fss_extended_read(data->buffer, state, &input, &data->objects, &data->contents, &data->quotes_object, &data->quotes_content, &data->delimits_object, &data->delimits_content);
if (F_status_is_error(status)) {
- const f_string_t file_name = fss_extended_read_file_identify(input.start, data->files);
+ const f_string_static_t file_name = fss_extended_read_file_identify(input.start, data->files);
fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e);
#endif // _di_fss_extended_read_load_
#ifndef _di_fss_extended_read_load_number_
- f_status_t fss_extended_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
+ f_status_t fss_extended_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d));
+ const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number);
+ const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, arguments->argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]);
return status;
}
if (main->parameters.array[fss_extended_read_parameter_line_e].result == f_console_result_additional_e) {
data->option |= fss_extended_read_data_option_line_d;
- status = fss_extended_read_load_number(main, fss_extended_read_parameter_line_e, fss_extended_read_long_line_s, arguments, &data->line);
+ status = fss_extended_read_load_number(main, fss_extended_read_parameter_line_e, fss_extended_read_long_line_s, &data->line);
if (F_status_is_error(status)) return status;
}
if (main->parameters.array[fss_extended_read_parameter_select_e].result == f_console_result_additional_e) {
data->option |= fss_extended_read_data_option_select_d;
- status = fss_extended_read_load_number(main, fss_extended_read_parameter_select_e, fss_extended_read_long_select_s, arguments, &data->select);
+ status = fss_extended_read_load_number(main, fss_extended_read_parameter_select_e, fss_extended_read_long_select_s, &data->select);
if (F_status_is_error(status)) return status;
}
* On failure to identify, an empty string is returned.
*/
#ifndef _di_fss_extended_read_file_identify_
- extern f_string_t fss_extended_read_file_identify(const f_array_length_t at, const fss_extended_read_files_t files) F_attribute_visibility_internal_d;
+ extern f_string_static_t fss_extended_read_file_identify(const f_array_length_t at, const fss_extended_read_files_t files) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_file_identify_
/**
* An ID representing the parameter.
* @param name
* The parameter name to print on error.
- * @param arguments
- * The console arguments passed to the program.
* @param number
* The location to store the loaded number.
*
* @see fss_extended_read_depths_resize()
*/
#ifndef _di_fss_extended_read_load_number_
- extern f_status_t fss_extended_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_load_number_
/**
#endif // _di_fss_extended_write_program_name_
#ifndef _di_fss_extended_write_defines_
+ const f_string_static_t fss_extended_write_pipe_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_pipe_name_s, 0, FSS_EXTENDED_WRITE_pipe_name_s_length);
const f_string_static_t fss_extended_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_pipe_content_end_s, 0, FSS_EXTENDED_WRITE_pipe_content_end_s_length);
const f_string_static_t fss_extended_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_pipe_content_ignore_s, 0, FSS_EXTENDED_WRITE_pipe_content_ignore_s_length);
const f_string_static_t fss_extended_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_pipe_content_start_s, 0, FSS_EXTENDED_WRITE_pipe_content_start_s_length);
/**
* The main program defines.
+ *
+ * fss_extended_write_pipe_*:
+ * - name: A name used to represent the pipe when printing file names.
+ * - content_end: A code used to represent the end of Content for use in binary formats.
+ * - content_ignore: A code used to represent the ignoring Content for use in binary formats.
+ * - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_extended_write_defines_
#define fss_extended_write_signal_check_d 10000
+ #define FSS_EXTENDED_WRITE_pipe_name_s "(pipe)"
+
#define FSS_EXTENDED_WRITE_pipe_content_end_s "\f"
#define FSS_EXTENDED_WRITE_pipe_content_ignore_s "\v"
#define FSS_EXTENDED_WRITE_pipe_content_start_s "\b"
+ #define FSS_EXTENDED_WRITE_pipe_name_s_length 6
+
#define FSS_EXTENDED_WRITE_pipe_content_end_s_length 1
#define FSS_EXTENDED_WRITE_pipe_content_ignore_s_length 1
#define FSS_EXTENDED_WRITE_pipe_content_start_s_length 1
+ extern const f_string_static_t fss_extended_write_pipe_name_s;
+
extern const f_string_static_t fss_extended_write_pipe_content_end_s;
extern const f_string_static_t fss_extended_write_pipe_content_ignore_s;
extern const f_string_static_t fss_extended_write_pipe_content_start_s;
}
}
else if (main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_found_e) {
- fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s,.string fss_extended_write_long_file_s);
+ fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string fss_extended_write_long_file_s);
status = F_status_set_error(F_parameter);
}
}
}
}
- f_fss_quote_t quote = F_fss_delimit_quote_double_s;
+ f_fss_quote_t quote = f_fss_quote_type_double_e;
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_extended_write_parameter_double_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_extended_write_parameter_single_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_extended_write_parameter_double_e].location < main->parameters.array[fss_extended_write_parameter_single_e].location) {
- quote = F_fss_delimit_quote_single_s;
+ quote = f_fss_quote_type_single_e;
}
}
}
else if (main->parameters.array[fss_extended_write_parameter_single_e].result == f_console_result_found_e) {
- quote = F_fss_delimit_quote_single_s;
+ quote = f_fss_quote_type_single_e;
}
}
for (; i < main->parameters.array[fss_extended_write_parameter_content_e].values.used; ++i) {
- contents.array[contents.used].string = argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[i]];
- contents.array[contents.used].used = strnlen(contents.array[contents.used].string, F_console_parameter_size_d);
- contents.array[contents.used].size = contents.array[contents.used].used;
- ++contents.used;
+ contents.array[contents.used++] = argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[i]];
} // for
status = fss_extended_write_process(main, output, quote, 0, &contents, &buffer);
object_next = main->parameters.array[fss_extended_write_parameter_object_e].locations.array[i + 1];
}
- object.string = argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, F_console_parameter_size_d);
- object.size = object.used;
+ object = argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]];
contents.used = 0;
for (; range.start <= range.stop; ++range.start) {
- if (block.string[range.start] == fss_extended_write_pipe_content_start_s) {
+ if (block.string[range.start] == fss_extended_write_pipe_content_start_s.string[0]) {
state = 0x2;
++range.start;
break;
}
- if (block.string[range.start] == fss_extended_write_pipe_content_end_s) {
+ if (block.string[range.start] == fss_extended_write_pipe_content_end_s.string[0]) {
state = 0x4;
++range.start;
break;
}
- if (block.string[range.start] == fss_extended_write_pipe_content_ignore_s) {
+ if (block.string[range.start] == fss_extended_write_pipe_content_ignore_s.string[0]) {
// This is not used by objects.
continue;
if (total) {
for (; range.start <= range.stop; ++range.start) {
- if (block.string[range.start] == fss_extended_write_pipe_content_start_s) {
+ if (block.string[range.start] == fss_extended_write_pipe_content_start_s.string[0]) {
if (contents.used + 1 > contents.size) {
status = f_string_dynamics_increase_by(F_fss_default_allocation_step_d, &contents);
continue;
}
- if (block.string[range.start] == fss_extended_write_pipe_content_end_s) {
+ if (block.string[range.start] == fss_extended_write_pipe_content_end_s.string[0]) {
state = 0x4;
++range.start;
break;
}
- if (block.string[range.start] == fss_extended_write_pipe_content_ignore_s) {
+ if (block.string[range.start] == fss_extended_write_pipe_content_ignore_s.string[0]) {
// This is not used by this program.
continue;
}
else if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[fss_identify_parameter_line_e].values.array[main->parameters.array[fss_identify_parameter_line_e].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d));
+ const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
- status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, &data.line);
+ status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &data.line);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_identify_long_line_s, arguments->argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_identify_long_line_s, argv[index]);
}
}
}
}
else if (main->parameters.array[fss_identify_parameter_name_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[fss_identify_parameter_name_e].values.array[main->parameters.array[fss_identify_parameter_name_e].values.used - 1];
- const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d);
+ const f_array_length_t length = argv[index].used;
const f_string_range_t range = macro_f_string_range_t_initialize(length);
if (length == 0) {
for (f_array_length_t i = range.start; i <= range.stop; ++i) {
- status = f_utf_is_word(arguments->argv[index] + i, length, F_true);
+ status = f_utf_is_word(argv[index].string + i, length, F_true);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_utf_is_word", F_true);
flockfile(main->error.to.stream);
fl_print_format("%r%[%QThe value '%]", main->error.to.stream, f_string_eol_s, 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("%[%Q%]", main->error.to.stream, main->error.notable, argv[index], main->error.notable);
fl_print_format("%[' for the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable);
fl_print_format("%[' may only contain word characters.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
break;
}
- data.name.string[data.name.used++] = arguments->argv[index][i];
+ data.name.string[data.name.used++] = argv[index].string[i];
} // for
}
}
file.size_read = 512;
- status = f_file_stream_open(arguments->argv[main->parameters.remaining.array[i]], 0, &file);
+ status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
}
else {
- status = fss_identify_load_line(main, file, arguments->argv[main->parameters.remaining.array[i]], &buffer, &range);
+ status = fss_identify_load_line(main, file, argv[main->parameters.remaining.array[i]], &buffer, &range);
if (F_status_is_error_not(status)) {
- status = fss_identify_process(main, arguments->argv[main->parameters.remaining.array[i]], buffer, &range, &data);
+ status = fss_identify_process(main, argv[main->parameters.remaining.array[i]], buffer, &range, &data);
}
}
data.files.array = files_array;
data.files.used = 1;
data.files.size = main->parameters.remaining.used + 1;
- data.files.array[0].name = "(pipe)";
+ data.files.array[0].name = fss_payload_read_pipe_name_s;
data.files.array[0].range.start = 1;
data.files.array[0].range.stop = 0;
// This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
// Guarantee that a newline exists at the end of the buffer.
- status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
+ status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
else {
// Guarantee that a newline exists at the end of the buffer.
// This is done as a pre-process on the next file because the "payload" must always be last and must not have a newline appended.
if (buffer_used != data.buffer.used) {
- status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
+ status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
f_status_t status = fll_fss_payload_read(data->buffer, state, &input, &data->objects, &data->contents, &data->delimits_object, &data->delimits_content, &data->comments);
if (F_status_is_error(status)) {
- const f_string_t file_name = fss_payload_read_file_identify(input.start, data->files);
+ const f_string_static_t file_name = fss_payload_read_file_identify(input.start, data->files);
if (F_status_set_fine(status) == F_none || F_status_set_fine(status) == F_none_eos || F_status_set_fine(status) == F_none_stop || F_status_set_fine(status) == F_data_not_eos || F_status_set_fine(status) == F_data_not_stop) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
status = fll_fss_extended_read(data->buffer, state, &input_header, &data->objects_header, &data->contents_header, &data->quotes_object_header, &data->quotes_content_header, &data->delimits_object_header, &data->delimits_content_header);
if (F_status_is_error(status)) {
- const f_string_t file_name = fss_payload_read_file_identify(input.start, data->files);
+ const f_string_static_t file_name = fss_payload_read_file_identify(input.start, data->files);
fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e);
#endif // _di_fss_payload_read_load_
#ifndef _di_fss_payload_read_load_number_
- f_status_t fss_payload_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
+ f_status_t fss_payload_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
- const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d));
+ const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(main->parameters.arguments.array[index], F_console_parameter_size_d));
- const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number);
+ const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, arguments->argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]);
return status;
}
if (main->parameters.array[fss_payload_read_parameter_line_e].result == f_console_result_additional_e) {
data->option |= fss_payload_read_data_option_line_d;
- status = fss_payload_read_load_number(main, fss_payload_read_parameter_line_e, fss_payload_read_long_line_s, arguments, &data->line);
+ status = fss_payload_read_load_number(main, fss_payload_read_parameter_line_e, fss_payload_read_long_line_s, &data->line);
if (F_status_is_error(status)) return status;
}
if (main->parameters.array[fss_payload_read_parameter_select_e].result == f_console_result_additional_e) {
data->option |= fss_payload_read_data_option_select_d;
- status = fss_payload_read_load_number(main, fss_payload_read_parameter_select_e, fss_payload_read_long_select_s, arguments, &data->select);
+ status = fss_payload_read_load_number(main, fss_payload_read_parameter_select_e, fss_payload_read_long_select_s, &data->select);
if (F_status_is_error(status)) return status;
}
* On failure to identify, an empty string is returned.
*/
#ifndef _di_fss_payload_read_file_identify_
- extern f_string_t fss_payload_read_file_identify(const f_array_length_t at, const fss_payload_read_files_t files) F_attribute_visibility_internal_d;
+ extern f_string_static_t fss_payload_read_file_identify(const f_array_length_t at, const fss_payload_read_files_t files) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_file_identify_
/**
* An ID representing the parameter.
* @param name
* The parameter name to print on error.
- * @param arguments
- * The console arguments passed to the program.
* @param number
* The location to store the loaded number.
*
* @see fss_payload_read_depths_resize()
*/
#ifndef _di_fss_payload_read_load_number_
- extern f_status_t fss_payload_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_load_number_
/**
}
}
- f_fss_quote_t quote = F_fss_delimit_quote_double_s;
+ f_fss_quote_t quote = f_fss_quote_type_double_e;
if (F_status_is_error_not(status)) {
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) {
- quote = F_fss_delimit_quote_single_s;
+ quote = f_fss_quote_type_single_e;
}
}
}
else if (main->parameters.array[fss_payload_write_parameter_single_e].result == f_console_result_found_e) {
- quote = F_fss_delimit_quote_single_s;
+ quote = f_fss_quote_type_single_e;
}
}
for (; range.start <= range.stop; ++range.start) {
- if (block.string[range.start] == fss_payload_write_pipe_content_start_s) {
+ if (block.string[range.start] == fss_payload_write_pipe_content_start_s.string[0]) {
state = 0x2;
++range.start;
break;
}
- if (block.string[range.start] == fss_payload_write_pipe_content_end_s) {
+ if (block.string[range.start] == fss_payload_write_pipe_content_end_s.string[0]) {
state = 0x3;
++range.start;
break;
}
- if (block.string[range.start] == fss_payload_write_pipe_content_ignore_s) {
+ if (block.string[range.start] == fss_payload_write_pipe_content_ignore_s.string[0]) {
// This is not used by objects.
continue;
for (; range.start <= range.stop; ++range.start) {
- if (block.string[range.start] == fss_payload_write_pipe_content_start_s) {
+ if (block.string[range.start] == fss_payload_write_pipe_content_start_s.string[0]) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
fll_print_format("%r%[%QThis standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
}
break;
}
- if (block.string[range.start] == fss_payload_write_pipe_content_end_s) {
+ if (block.string[range.start] == fss_payload_write_pipe_content_end_s.string[0]) {
state = 0x3;
++range.start;
break;
}
- if (block.string[range.start] == fss_payload_write_pipe_content_ignore_s) {
+ if (block.string[range.start] == fss_payload_write_pipe_content_ignore_s.string[0]) {
// This is not used by this program.
continue;