This should get all of the programs compiling again.
There is still more work to do with switching to f_string_static_t, but the current pass is considered complete.
Another pass will follow up shortly.
char format[32];
char buffer[128];
- format[f++] = '%';
+ format[f++] = f_string_ascii_percent_s.string[0];
if (flag & F_print_format_flag_sign_always_d) {
- format[f++] = '+';
+ format[f++] = f_string_ascii_plus_s.string[0];
}
else if (flag & F_print_format_flag_sign_pad_d) {
- format[f++] = ' ';
+ format[f++] = f_string_ascii_space_s.string[0];
}
if (flag & F_print_format_flag_align_left_d) {
- format[f++] = '-';
+ format[f++] = f_string_ascii_minus_s.string[0];
}
if (flag & F_print_format_flag_zeros_leading_d) {
- format[f++] = '0';
+ format[f++] = f_string_ascii_0_s.string[0];
}
if (flag & F_print_format_flag_width_d) {
- format[f++] = '*';
+ format[f++] = f_string_ascii_asterisk_s.string[0];
}
if (flag & F_print_format_flag_precision_d) {
- format[f++] = '.';
- format[f++] = '*';
+ format[f++] = f_string_ascii_period_s.string[0];
+ format[f++] = f_string_ascii_asterisk_s.string[0];
}
if (flag & F_print_format_flag_exponent_d) {
if (flag & F_print_format_flag_exponent_upper_d) {
- format[f++] = 'E';
+ format[f++] = f_string_ascii_E_s.string[0];
}
else {
- format[f++] = 'e';
+ format[f++] = f_string_ascii_e_s.string[0];
}
}
else if (flag & F_print_format_flag_exponent_either_d) {
if (flag & F_print_format_flag_exponent_upper_d) {
- format[f++] = 'G';
+ format[f++] = f_string_ascii_G_s.string[0];
}
else {
- format[f++] = 'g';
+ format[f++] = f_string_ascii_g_s.string[0];
}
}
else {
- format[f++] = 'f';
+ format[f++] = f_string_ascii_f_s.string[0];
}
format[f] = 0;
status = f_utf_is_whitespace(string + i, (length - i) + 1);
- // consider invalid data not-whitespace.
+ // Consider invalid data not-whitespace.
if (F_status_is_error(status) || status == F_false) break;
i += macro_f_utf_byte_width(string[i]);
status = f_utf_is_whitespace(string + i, (length - i) + 1);
- // determine if this is an end of string whitespace that needs to be trimmed.
+ // Determine if this is an end of string whitespace that needs to be trimmed.
if (status == F_true || !string[i]) {
j = i + macro_f_utf_byte_width(string[i]);
status = F_none;
#endif // _di_fl_string_dynamic_seek_to_utf_character_
#ifndef _di_fl_string_fll_identify_
- f_status_t fl_string_fll_identify(const f_string_t buffer, f_string_range_t *range, f_fll_id_t *id) {
+ f_status_t fl_string_fll_identify(const f_string_static_t buffer, f_string_range_t *range, f_fll_id_t *id) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
// Skip past all leading NULLs.
for (; range->start <= range->stop; ++range->start) {
- if (buffer[range->start]) break;
+ if (buffer.string[range->start]) break;
} // for
if (range->start > range->stop) {
// Increment until stop, while taking into consideration UTF-8 character widths.
for (; range->start <= range->stop; ) {
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
break;
}
- range->start += macro_f_utf_byte_width(buffer[range->start]);
+ range->start += macro_f_utf_byte_width(buffer.string[range->start]);
} // for
return F_found_not;
for (; range->start <= range->stop; ) {
- status = f_utf_is_whitespace(buffer + range->start, (range->stop - range->start) + 1);
+ status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
}
if (status == F_false) {
- if (!buffer[range->start]) {
+ if (!buffer.string[range->start]) {
++range->start;
continue;
break;
}
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
return F_found_not;
}
- range->start += macro_f_utf_byte_width(buffer[range->start]);
+ range->start += macro_f_utf_byte_width(buffer.string[range->start]);
} // for
if (range->start > range->stop) {
// Increment until stop, while taking into consideration UTF-8 character widths.
for (; range->start <= range->stop; ) {
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
break;
}
- range->start += macro_f_utf_byte_width(buffer[range->start]);
+ range->start += macro_f_utf_byte_width(buffer.string[range->start]);
} // for
return F_found_not;
for (; range->start <= range->stop; ) {
- status = f_utf_is_word(buffer + range->start, (range->stop - range->start) + 1, F_true);
+ status = f_utf_is_word(buffer.string + range->start, (range->stop - range->start) + 1, F_true);
if (F_status_is_error(status)) return status;
if (status == F_false) {
- if (!buffer[range->start]) {
+ if (!buffer.string[range->start]) {
++range->start;
continue;
break;
}
- range->start += macro_f_utf_byte_width(buffer[range->start]);
+ range->start += macro_f_utf_byte_width(buffer.string[range->start]);
} // for
- if (range->start > range->stop || buffer[range->start] != f_string_ascii_minus_s.string[0]) {
+ if (range->start > range->stop || buffer.string[range->start] != f_string_ascii_minus_s.string[0]) {
// Increment until stop, while taking into consideration UTF-8 character widths.
for (; range->start <= range->stop; ) {
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
break;
}
- range->start += macro_f_utf_byte_width(buffer[range->start]);
+ range->start += macro_f_utf_byte_width(buffer.string[range->start]);
} // for
return F_found_not;
for (++range->start; range->start <= range->stop && j < 4; ++range->start, ++j) {
// The hexidecimal representing the number may only be ASCII.
- if (macro_f_utf_byte_width_is(buffer[range->start])) {
+ if (macro_f_utf_byte_width_is(buffer.string[range->start])) {
// Increment until stop, while taking into consideration UTF-8 character widths.
for (; range->start <= range->stop; ) {
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
break;
}
- range->start += macro_f_utf_byte_width(buffer[range->start]);
+ range->start += macro_f_utf_byte_width(buffer.string[range->start]);
} // for
if (id) {
return F_found_not;
}
- if (isxdigit(buffer[range->start])) {
- number[j] = buffer[range->start];
+ if (isxdigit(buffer.string[range->start])) {
+ number[j] = buffer.string[range->start];
}
else {
- if (!buffer[range->start]) continue;
+ if (!buffer.string[range->start]) continue;
break;
}
// Increment until stop, while taking into consideration UTF-8 character widths.
for (; range->start <= range->stop; ) {
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
break;
}
- range->start += macro_f_utf_byte_width(buffer[range->start]);
+ range->start += macro_f_utf_byte_width(buffer.string[range->start]);
} // for
if (id) {
}
}
- // skip past all NULLs.
+ // Skip past all NULLs.
for (; range->start <= range->stop; ++range->start) {
- if (buffer[range->start]) break;
+ if (buffer.string[range->start]) break;
} // for
// The end of line, whitespace, or range stop point are the only valid stop points.
if (range->start <= range->stop) {
- status = f_utf_is_whitespace(buffer + range->start, (range->stop - range->start) + 1);
+ status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1);
if (F_status_is_error(status)) {
if (id) {
// Increment until stop, while taking into consideration UTF-8 character widths.
for (; range->start <= range->stop; ) {
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
break;
}
- range->start += macro_f_utf_byte_width(buffer[range->start]);
+ range->start += macro_f_utf_byte_width(buffer.string[range->start]);
} // for
if (id) {
}
}
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
}
if (id) {
for (f_array_length_t j = i, i = 0; j <= range->stop; ++j) {
- if (!buffer[j]) continue;
- if (buffer[j] == f_string_ascii_minus_s.string[0]) break;
+ if (!buffer.string[j]) continue;
+ if (buffer.string[j] == f_string_ascii_minus_s.string[0]) break;
- id->name[i] = buffer[j];
+ id->name[i] = buffer.string[j];
++i;
} // for
* @see f_utf_is_word()
*/
#ifndef _di_fl_string_fll_identify_
- extern f_status_t fl_string_fll_identify(const f_string_t buffer, f_string_range_t *range, f_fll_id_t *id);
+ extern f_status_t fl_string_fll_identify(const f_string_static_t buffer, f_string_range_t *range, f_fll_id_t *id);
#endif // _di_fl_string_fll_identify_
/**
#endif
#ifndef _di_fll_fss_identify_
- f_status_t fll_fss_identify(const f_string_t buffer, f_string_range_t *range, f_fll_ids_t *ids) {
+ f_status_t fll_fss_identify(const f_string_static_t buffer, f_string_range_t *range, f_fll_ids_t *ids) {
#ifndef _di_level_2_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
// Skip past all NULLs.
for (; range->start <= range->stop; ++range->start) {
- if (buffer[range->start]) break;
+ if (buffer.string[range->start]) break;
}
if (range->start > range->stop) {
}
// The first character must be a '#'.
- if (buffer[range->start] != f_fss_pound_s.string[0]) {
+ if (buffer.string[range->start] != f_fss_pound_s.string[0]) {
// Increment until stop, while taking into consideration UTF-8 character widths.
for (; range->start <= range->stop; ) {
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
break;
}
- range->start += macro_f_utf_byte_width(buffer[range->start]);
+ range->start += macro_f_utf_byte_width(buffer.string[range->start]);
} // for
if (ids) {
// skip past all NULLs after the '#'.
for (++range->start; range->start <= range->stop; ++range->start) {
- if (buffer[range->start]) break;
+ if (buffer.string[range->start]) break;
}
if (range->start > range->stop) {
// Increment until stop, while taking into consideration UTF-8 character widths.
for (; range->start <= range->stop; ) {
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
break;
}
- range->start += macro_f_utf_byte_width(buffer[range->start]);
+ range->start += macro_f_utf_byte_width(buffer.string[range->start]);
} // for
if (ids) {
return F_found_not;
}
- f_status_t status = f_utf_is_whitespace(buffer + range->start, (range->stop - range->start) + 1);
+ f_status_t status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
// Increment until stop, while taking into consideration UTF-8 character widths.
for (; range->start <= range->stop; ) {
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
break;
}
- range->start += macro_f_utf_byte_width(buffer[range->start]);
+ range->start += macro_f_utf_byte_width(buffer.string[range->start]);
} // for
return F_found_not;
}
- if (buffer[range->start] == f_string_eol_s.string[0]) {
+ if (buffer.string[range->start] == f_string_eol_s.string[0]) {
++range->start;
if (ids) {
* @see fl_string_fll_identify()
*/
#ifndef _di_fll_fss_identify_
- extern f_status_t fll_fss_identify(const f_string_t buffer, f_string_range_t *range, f_fll_ids_t *ids);
+ extern f_status_t fll_fss_identify(const f_string_static_t buffer, f_string_range_t *range, f_fll_ids_t *ids);
#endif // _di_fll_fss_identify_
/**
#include <fll/level_0/directory.h>
#include <fll/level_0/file.h>
#include <fll/level_0/fss.h>
+#include <fll/level_0/path.h>
#include <fll/level_0/pipe.h>
#include <fll/level_0/print.h>
#include <fll/level_0/signal.h>
/**
* The control data.
*
+ * argv: The argument structure in the progam data parameters for simplifying syntax.
* command: The command type code.
* cache: A cache.
* socket: A socket used to connect to the controller.
- * argv: The argument structure in fll_program_data_t.parameters for simplifying syntax.
*/
#ifndef _di_control_data_t_
typedef struct {
f_console
f_file
f_fss
+f_path
f_pipe
f_print
f_signal
build_indexer_arguments rcs
build_language c
build_libraries -lc
-build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_pipe -lf_print -lf_signal -lf_socket -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_socket -lf_status_string -lf_string -lf_type_array -lf_utf
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
build_libraries_shared
// @todo process the data.
- fll_print_format("\nDEBUG: received packet: '%Q'\n", stdout, control->input);
-
// @todo send any responses.
f_socket_disconnect(&client, f_socket_close_fast_e);
if (!buffer.string[result.start]) continue;
- if (buffer.string[result.start] == '-' || buffer.string[result.start] == '+') {
+ if (buffer.string[result.start] == f_string_ascii_minus_s.string[0] || buffer.string[result.start] == f_string_ascii_plus_s.string[0]) {
++result.start;
}
range.start = 0;
range.stop = arguments.array[i].used - 1;
- if (arguments.array[i].string[0] == '+') {
+ if (arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) {
range.start = 1;
}
- else if (arguments.array[i].string[0] == '-') {
+ else if (arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) {
range.start = 1;
is_negative_left = F_true;
}
is_negative_right = F_false;
- if (arguments.array[i].string[0] == '+') {
+ if (arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) {
range.start = 1;
}
- else if (arguments.array[i].string[0] == '-') {
+ else if (arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) {
range.start = 1;
is_negative_right = F_true;
}
range.start = 0;
range.stop = arguments.array[i].used - 1;
- if (arguments.array[i].string[0] == '+') {
+ if (arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) {
range.start = 1;
}
- else if (arguments.array[i].string[0] == '-') {
+ else if (arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) {
range.start = 1;
is_negative = F_true;
}
* - total: The total lines found and selected is printed instead of the Content.
* - trim: Empty space before and after Objects and Content will not be printed (They will be trimmed).
*
+ * argv: The argument structure in the progam data parameters for simplifying syntax.
* options: Bitwise flags representing parameters.
* delimit_mode: The delimit mode.
* delimit_depth: The delimit depth.
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
status = F_none;
if (main->parameters.array[fss_basic_read_parameter_help_e].result == f_console_result_found_e) {
fss_basic_read_file_t files_array[main->parameters.remaining.used + 1];
fss_basic_read_data_t data = fss_basic_read_data_t_initialize;
+ data.argv = main->parameters.arguments.array;
data.files.array = files_array;
data.files.used = 1;
data.files.size = main->parameters.remaining.used + 1;
}
index = main->parameters.array[fss_basic_read_parameter_delimit_e].values.array[i];
- length = argv[index].used;
+ length = data.argv[index].used;
if (!length) {
flockfile(main->error.to.stream);
break;
}
- else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_none_s, argv[index]) == F_equal_to) {
+ else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_none_s, data.argv[index]) == F_equal_to) {
data.delimit_mode = fss_basic_read_delimit_mode_none_e;
}
- else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_all_s, argv[index]) == F_equal_to) {
+ else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_all_s, data.argv[index]) == F_equal_to) {
data.delimit_mode = fss_basic_read_delimit_mode_all_e;
}
- else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_object_s, argv[index]) == F_equal_to) {
+ else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_object_s, data.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].string[length - 1] == fss_basic_read_delimit_mode_name_greater_s.string[0]) {
+ if (data.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].string[length - 1] == fss_basic_read_delimit_mode_name_lesser_s.string[0]) {
+ else if (data.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].string[0] == f_string_ascii_plus_s.string[0]) {
+ if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
++range.start;
}
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &data.delimit_depth);
+ status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_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_delimit_s, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_delimit_s, data.argv[index]);
break;
}
}
if (F_status_is_error_not(status)) {
- status = fss_basic_read_depth_process(main, arguments, &data);
+ status = fss_basic_read_depth_process(main, &data);
}
// This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file.
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
+ status = f_file_stream_open(data.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);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
if (data.buffer.used > data.files.array[data.files.used].range.start) {
- data.files.array[data.files.used].name = argv[main->parameters.remaining.array[i]];
+ data.files.array[data.files.used].name = data.argv[main->parameters.remaining.array[i]];
data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
// 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.
}
if (F_status_is_error_not(status)) {
- status = fss_basic_read_process(main, arguments, &data);
+ status = fss_basic_read_process(main, &data);
}
fss_basic_read_data_delete_simple(&data);
* - total: The total lines found and selected is printed instead of the Content.
* - trim: Empty space before and after Objects and Content will not be printed (They will be trimmed).
*
+ * argv: The argument structure in the progam data parameters for simplifying syntax.
* options: Bitwise flags representing parameters.
* delimit_mode: The delimit mode.
* delimit_depth: The delimit depth.
f_number_unsigned_t select;
f_number_unsigned_t line;
+ f_string_static_t *argv;
+
fss_basic_read_files_t files;
fss_basic_read_depths_t depths;
0, \
0, \
0, \
+ 0, \
fss_basic_read_files_t_initialize, \
fss_basic_read_depths_t_initialize, \
f_string_dynamic_t_initialize, \
#endif
#ifndef _di_fss_basic_read_delimit_object_is_
- f_status_t fss_basic_read_delimit_object_is(const f_array_length_t depth, fss_basic_read_data_t * const data) {
+ f_status_t fss_basic_read_delimit_object_is(fss_basic_read_data_t * const data, const f_array_length_t depth) {
switch (data->delimit_mode) {
case fss_basic_read_delimit_mode_none_e:
#endif // _di_fss_basic_read_delimit_object_is_
#ifndef _di_fss_basic_read_depth_process_
- f_status_t fss_basic_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
+ f_status_t fss_basic_read_depth_process(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
f_status_t status = F_none;
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(argv[position_depth].used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
- status = fl_conversion_string_to_number_unsigned(argv[position_depth].string, range, &data->depths.array[i].depth);
+ status = fl_conversion_string_to_number_unsigned(data->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]);
+ 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, data->argv[position_depth]);
return status;
}
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(argv[data->depths.array[i].index_at].used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
- status = fl_conversion_string_to_number_unsigned(argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
+ status = fl_conversion_string_to_number_unsigned(data->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]);
+ 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, data->argv[data->depths.array[i].index_at]);
return status;
}
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_rip(argv[data->depths.array[i].index_name].string, argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
+ status = fl_string_rip(data->argv[data->depths.array[i].index_name].string, data->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);
+ status = f_string_dynamic_append(data->argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
}
if (F_status_is_error(status)) {
#endif // _di_fss_basic_read_file_identify_
#ifndef _di_fss_basic_read_load_
- f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t *data) {
+ f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
f_state_t state = macro_f_state_t_initialize(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, 0, 0, 0, 0);
f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
#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_static_t name, f_number_unsigned_t *number) {
+ f_status_t fss_basic_read_load_number(fll_program_data_t * const main, fss_basic_read_data_t * const data, 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(main->parameters.arguments.array[index].used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
+ const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[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, main->parameters.arguments.array[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
return status;
}
#endif // _di_fss_basic_read_load_number_
#ifndef _di_fss_basic_read_process_
- f_status_t fss_basic_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
+ f_status_t fss_basic_read_process(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
- f_status_t status = fss_basic_read_process_option(main, arguments, data);
+ f_status_t status = fss_basic_read_process_option(main, data);
if (F_status_is_error(status)) return status;
// This standard does not support multiple content groups.
}
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(0, data) ? &data->delimits : &except_none;
+ f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(data, 0) ? &data->delimits : &except_none;
for (f_array_length_t i = 0; i < data->contents.used; ++i) {
#endif // _di_fss_basic_read_process_
#ifndef _di_fss_basic_read_process_at_
- f_status_t fss_basic_read_process_at(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_read_process_at(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
if (data->option & (fss_basic_read_data_option_columns_d | fss_basic_read_data_option_total_d)) {
}
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(0, data) ? &data->delimits : &except_none;
+ f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(data, 0) ? &data->delimits : &except_none;
f_array_length_t at = 0;
#endif // _di_fss_basic_read_process_at_
#ifndef _di_fss_basic_read_process_columns_
- f_status_t fss_basic_read_process_columns(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_read_process_columns(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) {
if (!(data->option & fss_basic_read_data_option_content_d)) {
flockfile(main->output.to.stream);
#endif // _di_fss_basic_read_process_columns_
#ifndef _di_fss_basic_read_process_line_
- f_status_t fss_basic_read_process_line(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_read_process_line(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(0, data) ? &data->delimits : &except_none;
+ f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(data, 0) ? &data->delimits : &except_none;
f_array_length_t line = 0;
#endif // _di_fss_basic_read_process_line_
#ifndef _di_fss_basic_read_process_name_
- f_status_t fss_basic_read_process_name(fss_basic_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_read_process_name(fss_basic_read_data_t * const data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
#endif // _di_fss_basic_read_process_name_
#ifndef _di_fss_basic_read_process_option_
- f_status_t fss_basic_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
+ f_status_t fss_basic_read_process_option(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
f_status_t status = F_none;
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, &data->line);
+ status = fss_basic_read_load_number(main, data, 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, &data->select);
+ status = fss_basic_read_load_number(main, data, fss_basic_read_parameter_select_e, fss_basic_read_long_select_s, &data->select);
if (F_status_is_error(status)) return status;
}
#endif // _di_fss_basic_read_process_option_
#ifndef _di_fss_basic_read_process_total_
- f_status_t fss_basic_read_process_total(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_read_process_total(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) {
f_array_length_t total = 0;
/**
* Determine if the given depth is to be delimited or not for an Object.
*
- * @param depth
- * The depth to check.
* @param data
* The program data.
+ * @param depth
+ * The depth to check.
*
* @return
* F_true if to apply delimits.
* F_false if to not apply delimits.
*/
#ifndef _di_fss_basic_read_delimit_object_is_
- extern f_status_t fss_basic_read_delimit_object_is(const f_array_length_t depth, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_delimit_object_is(fss_basic_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_delimit_object_is_
/**
* @see fss_basic_read_depths_resize()
*/
#ifndef _di_fss_basic_read_depth_process_
- extern f_status_t fss_basic_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_depth_process(fll_program_data_t * const main, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_depth_process_
/**
* @see fss_basic_read_process_option()
*/
#ifndef _di_fss_basic_read_load_
- extern f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_load_
/**
*
* @param main
* The main program data.
+ * @param data
+ * The program data.
* @param parameter
* An ID representing the parameter.
* @param name
* @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_static_t name, 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, fss_basic_read_data_t * const data, 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_
/**
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param data
* The program data.
*
* @see fss_basic_read_process_option()
*/
#ifndef _di_fss_basic_read_process_
- extern f_status_t fss_basic_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process(fll_program_data_t * const main, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_read_process_at_
- extern f_status_t fss_basic_read_process_at(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process_at(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_at_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_read_process_columns_
- extern f_status_t fss_basic_read_process_columns(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process_columns(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_columns_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_read_process_line_
- extern f_status_t fss_basic_read_process_line(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process_line(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_line_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_read_process_name_
- extern f_status_t fss_basic_read_process_name(fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process_name(fss_basic_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_name_
/**
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param data
* The program data.
*
* @see fss_basic_read_load_setting()
*/
#ifndef _di_fss_basic_read_process_option_
- extern f_status_t fss_basic_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process_option(fll_program_data_t * const main, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_option_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_read_process_total_
- extern f_status_t fss_basic_read_process_total(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process_total(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_total_
#ifdef __cplusplus
}
}
else {
- status = f_string_append(argv[values_order[i]].string, argv[values_order[i]].used, &depths->array[depths->used].value_name);
+ status = f_string_dynamic_append(argv[values_order[i]], &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);
+ fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
return status;
}
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)) {
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
status = F_none;
if (main->parameters.array[fss_extended_list_read_parameter_help_e].result == f_console_result_found_e) {
fss_extended_list_read_file_t files_array[main->parameters.remaining.used + 1];
fss_extended_list_read_data_t data = fss_extended_list_read_data_t_initialize;
+ data.argv = main->parameters.arguments.array;
data.files.array = files_array;
data.files.used = 1;
data.files.size = main->parameters.remaining.used + 1;
}
index = main->parameters.array[fss_extended_list_read_parameter_delimit_e].values.array[i];
- length = argv[index].used;
+ length = data.argv[index].used;
if (!length) {
flockfile(main->error.to.stream);
break;
}
- else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_none_s.string, argv[index], fss_extended_list_read_delimit_mode_name_none_s.used) == F_equal_to) {
+ else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_none_s.string, data.argv[index], fss_extended_list_read_delimit_mode_name_none_s.used) == F_equal_to) {
data.delimit_mode = fss_extended_list_read_delimit_mode_none_e;
}
- else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_all_s.string, argv[index], fss_extended_list_read_delimit_mode_name_all_s.used) == F_equal_to) {
+ else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_all_s.string, data.argv[index], fss_extended_list_read_delimit_mode_name_all_s.used) == F_equal_to) {
data.delimit_mode = fss_extended_list_read_delimit_mode_all_e;
}
- else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_object_s.string, argv[index], fss_extended_list_read_delimit_mode_name_object_s.used) == F_equal_to) {
+ else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_object_s.string, data.argv[index], fss_extended_list_read_delimit_mode_name_object_s.used) == F_equal_to) {
switch (data.delimit_mode) {
case 0:
data.delimit_mode = fss_extended_list_read_delimit_mode_object_e;
data.delimit_mode = fss_extended_list_read_delimit_mode_content_object_e;
}
- if (argv[index].string[length - 1] == fss_extended_list_read_delimit_mode_name_greater_s.string[0]) {
+ if (data.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].string[length - 1] == fss_extended_list_read_delimit_mode_name_lesser_s.string[0]) {
+ else if (data.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].string[0] == f_string_ascii_plus_s.string[0]) {
+ if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
++range.start;
}
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &data.delimit_depth);
+ status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_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_extended_list_read_long_delimit_s, argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_delimit_s, data.argv[index]);
break;
}
}
if (F_status_is_error_not(status)) {
- status = fss_extended_list_read_depth_process(main, arguments, &data);
+ status = fss_extended_list_read_depth_process(main, &data);
}
// This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file.
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
+ status = f_file_stream_open(data.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);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
else if (data.buffer.used > data.files.array[data.files.used].range.start) {
- data.files.array[data.files.used].name = argv[main->parameters.remaining.array[i]];
+ data.files.array[data.files.used].name = data.argv[main->parameters.remaining.array[i]];
data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
// 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.
}
if (F_status_is_error_not(status)) {
- status = fss_extended_list_read_process(main, arguments, &data);
+ status = fss_extended_list_read_process(main, &data);
}
fss_extended_list_read_data_delete_simple(&data);
* - total: The total lines found and selected is printed instead of the Content.
* - trim: Empty space before and after Objects and Content will not be printed (They will be trimmed).
*
+ * argv: The argument structure in the progam data parameters for simplifying syntax.
* options: Bitwise flags representing parameters.
* delimit_mode: The delimit mode.
* delimit_depth: The delimit depth.
f_number_unsigned_t select;
f_number_unsigned_t line;
+ f_string_static_t *argv;
+
fss_extended_list_read_files_t files;
fss_extended_list_read_depths_t depths;
0, \
0, \
0, \
+ 0, \
fss_extended_list_read_files_t_initialize, \
fss_extended_list_read_depths_t_initialize, \
f_string_dynamic_t_initialize, \
#endif
#ifndef _di_fss_extended_list_read_delimit_content_is_
- f_status_t fss_extended_list_read_delimit_content_is(const f_array_length_t depth, fss_extended_list_read_data_t * const data) {
+ f_status_t fss_extended_list_read_delimit_content_is(fss_extended_list_read_data_t * const data, const f_array_length_t depth) {
if (data->delimit_mode == fss_extended_list_read_delimit_mode_none_e) {
return F_false;
#endif // _di_fss_extended_list_read_delimit_content_is_
#ifndef _di_fss_extended_list_read_delimit_object_is_
- f_status_t fss_extended_list_read_delimit_object_is(const f_array_length_t depth, fss_extended_list_read_data_t * const data) {
+ f_status_t fss_extended_list_read_delimit_object_is(fss_extended_list_read_data_t * const data, const f_array_length_t depth) {
switch (data->delimit_mode) {
case fss_extended_list_read_delimit_mode_none_e:
#endif // _di_fss_extended_list_read_delimit_object_is_
#ifndef _di_fss_extended_list_read_depth_process_
- f_status_t fss_extended_list_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
+ f_status_t fss_extended_list_read_depth_process(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
f_status_t status = F_none;
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)) {
else {
position_depth = main->parameters.array[fss_extended_list_read_parameter_depth_e].values.array[i];
- const f_string_range_t range = macro_f_string_range_t_initialize(argv[position_depth].used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
- status = fl_conversion_string_to_number_unsigned(argv[position_depth].string, range, &data->depths.array[i].depth);
+ status = fl_conversion_string_to_number_unsigned(data->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_extended_list_read_long_depth_s, argv[position_depth]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_depth_s, data->argv[position_depth]);
return status;
}
data->depths.array[i].index_at = main->parameters.array[fss_extended_list_read_parameter_at_e].values.array[position_at];
- const f_string_range_t range = macro_f_string_range_t_initialize(argv[data->depths.array[i].index_at].used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
- status = fl_conversion_string_to_number_unsigned(argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
+ status = fl_conversion_string_to_number_unsigned(data->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_extended_list_read_long_at_s, argv[data->depths.array[i].index_at]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_at_s, data->argv[data->depths.array[i].index_at]);
return status;
}
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_rip(argv[data->depths.array[i].index_name].string, argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
+ status = fl_string_rip(data->argv[data->depths.array[i].index_name].string, data->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);
+ status = f_string_dynamic_append(data->argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
}
if (F_status_is_error(status)) {
#endif // _di_fss_extended_list_read_file_identify_
#ifndef _di_fss_extended_list_read_load_
- f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t *data) {
+ f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
f_state_t state = macro_f_state_t_initialize(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
#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_static_t name, f_number_unsigned_t *number) {
+ f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, 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(main->parameters.arguments.array[index].used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
+ const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[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, main->parameters.arguments.array[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
return status;
}
#endif // _di_fss_extended_list_read_load_number_
#ifndef _di_fss_extended_list_read_process_
- f_status_t fss_extended_list_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
+ f_status_t fss_extended_list_read_process(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
- f_status_t status = fss_extended_list_read_process_option(main, arguments, data);
+ f_status_t status = fss_extended_list_read_process_option(main, data);
if (F_status_is_error(status)) return status;
// This standard does not support multiple content groups.
}
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
- f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+ f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+ f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
if (data->option & fss_extended_list_read_data_option_raw_d) {
delimits_object = &except_none;
#endif // _di_fss_extended_list_read_process_
#ifndef _di_fss_extended_list_read_process_at_
- f_status_t fss_extended_list_read_process_at(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_list_read_process_at(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
if (data->option & (fss_extended_list_read_data_option_columns_d | fss_extended_list_read_data_option_total_d)) {
}
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
- f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+ f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+ f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
if (data->option & fss_extended_list_read_data_option_raw_d) {
delimits_object = &except_none;
if (data->option & fss_extended_list_read_data_option_line_d) {
f_array_length_t line = 0;
- status = fss_extended_list_read_process_at_line(main, i, *delimits_object, *delimits_content, data, &line);
+ status = fss_extended_list_read_process_at_line(main, data, i, *delimits_object, *delimits_content, &line);
if (status == F_success) return F_none;
}
else if (data->option & fss_extended_list_read_data_option_columns_d) {
#endif // _di_fss_extended_list_read_process_at_
#ifndef _di_fss_extended_list_read_process_at_line_
- f_status_t fss_extended_list_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_extended_list_read_data_t *data, f_array_length_t *line) {
+ f_status_t fss_extended_list_read_process_at_line(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, f_array_length_t *line) {
if (data->option & fss_extended_list_read_data_option_object_d) {
#endif // _di_fss_extended_list_read_process_at_line_
#ifndef _di_fss_extended_list_read_process_columns_
- f_status_t fss_extended_list_read_process_columns(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_list_read_process_columns(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) {
if (!(data->option & fss_extended_list_read_data_option_content_d)) {
flockfile(main->output.to.stream);
#endif // _di_fss_extended_list_read_process_columns_
#ifndef _di_fss_extended_list_read_process_line_
- f_status_t fss_extended_list_read_process_line(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_list_read_process_line(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
- f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+ f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+ f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
if (data->option & fss_extended_list_read_data_option_raw_d) {
delimits_object = &except_none;
if (!names[i]) continue;
- status = fss_extended_list_read_process_at_line(main, i, *delimits_object, *delimits_content, data, &line);
+ status = fss_extended_list_read_process_at_line(main, data, i, *delimits_object, *delimits_content, &line);
if (status == F_success) break;
} // for
#endif // _di_fss_extended_list_read_process_line_
#ifndef _di_fss_extended_list_read_process_name_
- f_status_t fss_extended_list_read_process_name(fss_extended_list_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_list_read_process_name(fss_extended_list_read_data_t * const data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
#endif // _di_fss_extended_list_read_process_name_
#ifndef _di_fss_extended_list_read_process_option_
- f_status_t fss_extended_list_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
+ f_status_t fss_extended_list_read_process_option(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
f_status_t status = F_none;
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, &data->line);
+ status = fss_extended_list_read_load_number(main, data, 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, &data->select);
+ status = fss_extended_list_read_load_number(main, data, fss_extended_list_read_parameter_select_e, fss_extended_list_read_long_select_s, &data->select);
if (F_status_is_error(status)) return status;
}
#endif // _di_fss_extended_list_read_process_option_
#ifndef _di_fss_extended_list_read_process_total_
- f_status_t fss_extended_list_read_process_total(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_list_read_process_total(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) {
f_array_length_t total = 0;
f_string_range_t range = f_string_range_t_initialize;
/**
* Determine if the given depth is to be delimited or not for Content.
*
- * @param depth
- * The depth to check.
* @param data
* The program data.
+ * @param depth
+ * The depth to check.
*
* @return
* F_true if to apply delimits.
* F_false if to not apply delimits.
*/
#ifndef _di_fss_extended_list_read_delimit_content_is_
- extern f_status_t fss_extended_list_read_delimit_content_is(const f_array_length_t depth, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_delimit_content_is(fss_extended_list_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_delimit_content_is_
/**
* Determine if the given depth is to be delimited or not for an Object.
*
- * @param depth
- * The depth to check.
* @param data
* The program data.
+ * @param depth
+ * The depth to check.
*
* @return
* F_true if to apply delimits.
* F_false if to not apply delimits.
*/
#ifndef _di_fss_extended_list_read_delimit_object_is_
- extern f_status_t fss_extended_list_read_delimit_object_is(const f_array_length_t depth, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_delimit_object_is(fss_extended_list_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_delimit_object_is_
/**
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param data
* The program data.
*
* @see fss_extended_list_read_depths_resize()
*/
#ifndef _di_fss_extended_list_read_depth_process_
- extern f_status_t fss_extended_list_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_depth_process(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_depth_process_
/**
* @see fss_extended_list_read_process_option()
*/
#ifndef _di_fss_extended_list_read_load_
- extern f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_load_
/**
*
* @param main
* The main program data.
+ * @param data
+ * The program data.
* @param parameter
* An ID representing the parameter.
* @param name
* @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_static_t name, 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, fss_extended_list_read_data_t * const data, 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_
/**
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param data
* The program data.
*
* @see fss_extended_list_read_process_option()
*/
#ifndef _di_fss_extended_list_read_process_
- extern f_status_t fss_extended_list_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_
/**
* @see fss_extended_list_read_process_at_line()
*/
#ifndef _di_fss_extended_list_read_process_at_
- extern f_status_t fss_extended_list_read_process_at(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_at(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_at_
/**
*
* @param main
* The main program data.
+ * @param data
+ * The program data.
* @param delimits_object
* The delimits to be applied to an Object.
* @param delimits_content
* The delimits to be applied to Content.
- * @param data
- * The program data.
* @param line
* The current line being processed.
* This will be incremented as necessary.
* F_success on success and the line was matched (and possibly printed).
*/
#ifndef _di_fss_extended_list_read_process_at_line_
- extern f_status_t fss_extended_list_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_extended_list_read_data_t *data, f_array_length_t *line) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_at_line(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, f_array_length_t *line) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_at_line_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_list_read_process_columns_
- extern f_status_t fss_extended_list_read_process_columns(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_columns(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_columns_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_list_read_process_line_
- extern f_status_t fss_extended_list_read_process_line(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_line(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_line_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_list_read_process_name_
- extern f_status_t fss_extended_list_read_process_name(fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_name(fss_extended_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_name_
/**
* Process the parameters, populating the option property of the program data.
*
- * @param arguments
- * The parameters passed to the process.
* @param main
* The main program data.
* @param data
* @see fss_extended_list_read_load_setting()
*/
#ifndef _di_fss_extended_list_read_process_option_
- extern f_status_t fss_extended_list_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_option(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_option_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_list_read_process_total_
- extern f_status_t fss_extended_list_read_process_total(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_total(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_total_
#ifdef __cplusplus
#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_WRITE_pipe_name_s "(pipe)"
- #define FSS_EXTENDED_LIST_READ_pipe_name_s_length 6
+ #define FSS_EXTENDED_LIST_WRITE_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_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_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;
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];
- if (length) {
- f_string_range_t range = macro_f_string_range_t_initialize(length);
+ if (argv[index].used) {
+ f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
- main->prepend.string = argv[index];
- main->prepend.used = length;
- main->prepend.size = length;
+ for (; range.start < argv[index].used; ++range.start) {
- for (; range.start < length; ++range.start) {
-
- status = f_fss_is_space(main->prepend, 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_extended_list_write_parameter_double_e].result == f_console_result_found_e) {
range.start = 0;
range.stop = content->used - 1;
- status = fl_fss_extended_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, &main->prepend, ignore, state, &range, buffer);
+ const f_string_static_t *prepend = 0;
+
+ 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];
+
+ prepend = &main->parameters.arguments.array[index];
+ }
+
+ status = fl_fss_extended_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_extended_list_content_write", F_true);
index = main->parameters.array[fss_extended_list_write_parameter_ignore_e].values.array[i * 2];
range.start = 0;
- range.stop = strnlen(argv[index], F_console_parameter_size_d) - 1;
+ range.stop = argv[index].used - 1;
// allow and ignore the positive sign.
if (range.stop > 0 && argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
index = main->parameters.array[fss_extended_list_write_parameter_ignore_e].values.array[(i * 2) + 1];
range.start = 0;
- range.stop = strnlen(argv[index], F_console_parameter_size_d) - 1;
+ range.stop = argv[index].used - 1;
// allow and ignore the positive sign.
if (range.stop > 0 && argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
* - object: Objects arre to have delimits applied.
*/
#ifndef _di_fss_extended_read_delimit_mode_
- #define FSS_EXTENDED_READ_delimit_mode_name_none "none"
- #define FSS_EXTENDED_READ_delimit_mode_name_all "all"
- #define FSS_EXTENDED_READ_delimit_mode_name_object "object"
- #define FSS_EXTENDED_READ_delimit_mode_name_greater "+"
- #define FSS_EXTENDED_READ_delimit_mode_name_lesser "-"
-
- #define FSS_EXTENDED_READ_delimit_mode_name_none_length 4
- #define FSS_EXTENDED_READ_delimit_mode_name_all_length 3
- #define FSS_EXTENDED_READ_delimit_mode_name_object_length 6
- #define FSS_EXTENDED_READ_delimit_mode_name_greater_length 1
- #define FSS_EXTENDED_READ_delimit_mode_name_lesser_length 1
+ #define FSS_EXTENDED_READ_delimit_mode_name_none_s "none"
+ #define FSS_EXTENDED_READ_delimit_mode_name_all_s "all"
+ #define FSS_EXTENDED_READ_delimit_mode_name_object_s "object"
+ #define FSS_EXTENDED_READ_delimit_mode_name_greater_s "+"
+ #define FSS_EXTENDED_READ_delimit_mode_name_lesser_s "-"
+
+ #define FSS_EXTENDED_READ_delimit_mode_name_none_s_length 4
+ #define FSS_EXTENDED_READ_delimit_mode_name_all_s_length 3
+ #define FSS_EXTENDED_READ_delimit_mode_name_object_s_length 6
+ #define FSS_EXTENDED_READ_delimit_mode_name_greater_s_length 1
+ #define FSS_EXTENDED_READ_delimit_mode_name_lesser_s_length 1
extern const f_string_static_t fss_extended_read_delimit_mode_name_none_s;
extern const f_string_static_t fss_extended_read_delimit_mode_name_all_s;
fl_print_format(" Both the Object and Content are separated by a space.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
fl_print_format(" The parameter %[%r%r%] accepts the following:%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%r%]: Do not apply delimits.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_none, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%r%]: (default) Apply all delimits.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_all, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%r%]: Apply delimits for Objects.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_object, context.set.notable, f_string_eol_s);
+ fl_print_format(" - %[%r%]: Do not apply delimits.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_none_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" - %[%r%]: (default) Apply all delimits.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_all_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" - %[%r%]: Apply delimits for Objects.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_object_s, context.set.notable, f_string_eol_s);
fl_print_format(" - A number, 0 or greater: apply delimits for Content at the specified depth.%r", file.stream, f_string_eol_s);
- fl_print_format(" - A number, 0 or greater, followed by a %[%r%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" - A number, 0 or lesser, followed by a %[%r%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%r%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" - A number, 0 or greater, followed by a %[%r%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_greater_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" - A number, 0 or lesser, followed by a %[%r%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%r%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_lesser_s, context.set.notable, f_string_eol_s, f_string_eol_s);
fl_print_format(" The %[%r%r%] parameter may be specified multiple times to customize the delimit behavior.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit_s, context.set.notable, f_string_eol_s);
fl_print_format(" The %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit_s, context.set.notable);
- fl_print_format(" values %[%r%]", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_none, context.set.notable);
- fl_print_format(" and %[%r%],", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_all, context.set.notable);
+ fl_print_format(" values %[%r%]", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_none_s, context.set.notable);
+ fl_print_format(" and %[%r%],", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_all_s, context.set.notable);
fl_print_format(" overrule all other delimit values.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
fl_print_format(" The parameters %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_columns_s, context.set.notable);
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
status = F_none;
if (main->parameters.array[fss_extended_read_parameter_help_e].result == f_console_result_found_e) {
fss_extended_read_file_t files_array[main->parameters.remaining.used + 1];
fss_extended_read_data_t data = fss_extended_read_data_t_initialize;
+ data.argv = main->parameters.arguments.array;
data.files.array = files_array;
data.files.used = 1;
data.files.size = main->parameters.remaining.used + 1;
fss_extended_read_parameter_total_e,
};
- const f_string_t parameter_name[] = {
+ const f_string_static_t parameter_name[] = {
fss_extended_read_long_depth_s,
fss_extended_read_long_line_s,
fss_extended_read_long_pipe_s,
}
if (F_status_is_error_not(status) && main->parameters.array[fss_extended_read_parameter_delimit_e].result == f_console_result_additional_e) {
- f_array_length_t location = 0;
+ f_array_length_t index = 0;
f_array_length_t length = 0;
uint16_t signal_check = 0;
if (!((++signal_check) % fss_extended_read_signal_check_d)) {
if (fss_extended_read_signal_received(main)) {
status = F_status_set_error(F_signal);
+
break;
}
signal_check = 0;
}
- location = main->parameters.array[fss_extended_read_parameter_delimit_e].values.array[i];
- length = strnlen(argv[location], F_console_parameter_size_d);
+ index = main->parameters.array[fss_extended_read_parameter_delimit_e].values.array[i];
+ length = data.argv[index].used;
if (!length) {
flockfile(main->error.to.stream);
break;
}
- else if (fl_string_compare(argv[location], fss_extended_read_delimit_mode_name_none, length, fss_extended_read_delimit_mode_name_none_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(data.argv[index], fss_extended_read_delimit_mode_name_none_s) == F_equal_to) {
data.delimit_mode = fss_extended_read_delimit_mode_none_e;
}
- else if (fl_string_compare(argv[location], fss_extended_read_delimit_mode_name_all, length, fss_extended_read_delimit_mode_name_all_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(data.argv[index], fss_extended_read_delimit_mode_name_all_s) == F_equal_to) {
data.delimit_mode = fss_extended_read_delimit_mode_all_e;
}
- else if (fl_string_compare(argv[location], fss_extended_read_delimit_mode_name_object, length, fss_extended_read_delimit_mode_name_object_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(data.argv[index], fss_extended_read_delimit_mode_name_object_s) == F_equal_to) {
switch (data.delimit_mode) {
case 0:
data.delimit_mode = fss_extended_read_delimit_mode_object_e;
data.delimit_mode = fss_extended_read_delimit_mode_content_object_e;
}
- if (argv[location][length - 1] == fss_extended_read_delimit_mode_name_greater[0]) {
+ if (data.argv[index].string[length - 1] == fss_extended_read_delimit_mode_name_greater_s.string[0]) {
if (!(data.delimit_mode == fss_extended_read_delimit_mode_none_e || data.delimit_mode == fss_extended_read_delimit_mode_all_e)) {
if (data.delimit_mode == fss_extended_read_delimit_mode_content_object_e) {
data.delimit_mode = fss_extended_read_delimit_mode_content_greater_object_e;
// Shorten the length to better convert the remainder to a number.
--length;
}
- else if (argv[location][length - 1] == fss_extended_read_delimit_mode_name_lesser[0]) {
+ else if (data.argv[index].string[length - 1] == fss_extended_read_delimit_mode_name_lesser_s.string[0]) {
if (!(data.delimit_mode == fss_extended_read_delimit_mode_none_e || data.delimit_mode == fss_extended_read_delimit_mode_all_e)) {
if (data.delimit_mode == fss_extended_read_delimit_mode_content_object_e) {
data.delimit_mode = fss_extended_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[location][0] == '+') {
+ if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
++range.start;
}
- status = fl_conversion_string_to_number_unsigned(argv[location], range, &data.delimit_depth);
+ status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_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_extended_read_long_delimit_s, argv[location]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_delimit_s, data.argv[index]);
break;
}
}
if (F_status_is_error_not(status)) {
- status = fss_extended_read_depth_process(main, arguments, &data);
+ status = fss_extended_read_depth_process(main, &data);
}
// This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file.
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", 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_file_stream_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
else if (data.buffer.used) {
data.files.array[0].range.stop = data.buffer.used - 1;
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
+ status = f_file_stream_open(data.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);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
if (data.buffer.used > data.files.array[data.files.used].range.start) {
- data.files.array[data.files.used].name = argv[main->parameters.remaining.array[i]];
+ data.files.array[data.files.used].name = data.argv[main->parameters.remaining.array[i]];
data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
// 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.
}
if (F_status_is_error_not(status)) {
- status = fss_extended_read_process(main, arguments, &data);
+ status = fss_extended_read_process(main, &data);
}
fss_extended_read_data_delete_simple(&data);
* - total: The total lines found and selected is printed instead of the Content.
* - trim: Empty space before and after Objects and Content will not be printed (They will be trimmed).
*
+ * argv: The argument structure in the progam data parameters for simplifying syntax.
* options: Bitwise flags representing parameters.
* delimit_mode: The delimit mode.
* delimit_depth: The delimit depth.
f_number_unsigned_t select;
f_number_unsigned_t line;
+ f_string_static_t *argv;
+
fss_extended_read_files_t files;
fss_extended_read_depths_t depths;
0, \
0, \
0, \
+ 0, \
fss_extended_read_files_t_initialize, \
fss_extended_read_depths_t_initialize, \
f_string_dynamic_t_initialize, \
#endif // _di_fss_extended_read_delimit_content_is_
#ifndef _di_fss_extended_read_depth_process_
- f_status_t fss_extended_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
+ f_status_t fss_extended_read_depth_process(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
f_status_t status = F_none;
else {
position_depth = main->parameters.array[fss_extended_read_parameter_depth_e].values.array[i];
- const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[position_depth]));
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
- status = fl_conversion_string_to_number_unsigned(arguments->argv[position_depth], range, &data->depths.array[i].depth);
+ status = fl_conversion_string_to_number_unsigned(data->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_extended_read_long_depth_s, arguments->argv[position_depth]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_depth_s, data->argv[position_depth]);
return status;
}
data->depths.array[i].index_at = main->parameters.array[fss_extended_read_parameter_at_e].values.array[position_at];
- const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[data->depths.array[i].index_at]));
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
- status = fl_conversion_string_to_number_unsigned(arguments->argv[data->depths.array[i].index_at], range, &data->depths.array[i].value_at);
+ status = fl_conversion_string_to_number_unsigned(data->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_extended_read_long_at_s, arguments->argv[data->depths.array[i].index_at]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_at_s, data->argv[data->depths.array[i].index_at]);
return status;
}
data->depths.array[i].index_name = main->parameters.array[fss_extended_read_parameter_name_e].values.array[position_name];
if (main->parameters.array[fss_extended_read_parameter_trim_e].result == f_console_result_found_e) {
- status = fl_string_rip(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name);
+ status = fl_string_rip(data->argv[data->depths.array[i].index_name].string, data->argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
}
else {
- status = f_string_append(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name);
+ status = f_string_dynamic_append(data->argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
}
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_extended_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_extended_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_dynamic_append", F_true);
return status;
}
#endif // _di_fss_extended_read_file_identify_
#ifndef _di_fss_extended_read_load_
- f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t *data) {
+ f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
f_state_t state = macro_f_state_t_initialize(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, 0, 0, 0);
f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
#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_static_t name, f_number_unsigned_t *number) {
+ f_status_t fss_extended_read_load_number(fll_program_data_t * const main, fss_extended_read_data_t * const data, 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(main->parameters.arguments.array[index].used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
+ const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[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, main->parameters.arguments.array[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
return status;
}
#endif // _di_fss_extended_read_load_number_
#ifndef _di_fss_extended_read_process_
- f_status_t fss_extended_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
+ f_status_t fss_extended_read_process(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
- f_status_t status = fss_extended_read_process_option(main, arguments, data);
+ f_status_t status = fss_extended_read_process_option(main, data);
if (F_status_is_error(status)) return status;
status = fss_extended_read_load(main, data);
#endif // _di_fss_extended_read_process_
#ifndef _di_fss_extended_read_process_at_
- f_status_t fss_extended_read_process_at(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_read_process_at(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
if (data->option & (fss_extended_read_data_option_columns_d | fss_extended_read_data_option_total_d)) {
#endif // _di_fss_extended_read_process_at_
#ifndef _di_fss_extended_read_process_columns_
- f_status_t fss_extended_read_process_columns(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_read_process_columns(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) {
if (!(data->option & fss_extended_read_data_option_content_d)) {
flockfile(main->output.to.stream);
#endif // _di_fss_extended_read_process_columns_
#ifndef _di_fss_extended_read_process_line_
- f_status_t fss_extended_read_process_line(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_read_process_line(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
f_array_lengths_t *delimits_object = fss_extended_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
#endif // _di_fss_extended_read_process_line_
#ifndef _di_fss_extended_read_process_name_
- f_status_t fss_extended_read_process_name(fss_extended_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_read_process_name(fss_extended_read_data_t * const data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
#endif // _di_fss_extended_read_process_name_
#ifndef _di_fss_extended_read_process_option_
- f_status_t fss_extended_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
+ f_status_t fss_extended_read_process_option(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
f_status_t status = F_none;
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, &data->line);
+ status = fss_extended_read_load_number(main, data, 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, &data->select);
+ status = fss_extended_read_load_number(main, data, fss_extended_read_parameter_select_e, fss_extended_read_long_select_s, &data->select);
if (F_status_is_error(status)) return status;
}
#endif // _di_fss_extended_read_process_option_
#ifndef _di_fss_extended_read_process_total_
- f_status_t fss_extended_read_process_total(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_read_process_total(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) {
f_array_length_t total = 0;
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param data
* The program data.
*
* @see fss_extended_read_depths_resize()
*/
#ifndef _di_fss_extended_read_depth_process_
- extern f_status_t fss_extended_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_depth_process(fll_program_data_t * const main, fss_extended_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_depth_process_
/**
* @see fss_extended_read_process_option()
*/
#ifndef _di_fss_extended_read_load_
- extern f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_load_
/**
*
* @param main
* The main program data.
+ * @param data
+ * The program data.
* @param parameter
* An ID representing the parameter.
* @param name
* @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_static_t name, 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, fss_extended_read_data_t * const data, 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_
/**
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param data
* The program data.
*
* @see fss_extended_read_process_option()
*/
#ifndef _di_fss_extended_read_process_
- extern f_status_t fss_extended_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process(fll_program_data_t * const main, fss_extended_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_read_process_at_
- extern f_status_t fss_extended_read_process_at(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process_at(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_at_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_read_process_columns_
- extern f_status_t fss_extended_read_process_columns(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process_columns(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_columns_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_read_process_line_
- extern f_status_t fss_extended_read_process_line(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process_line(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_line_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_read_process_name_
- extern f_status_t fss_extended_read_process_name(fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process_name(fss_extended_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_name_
/**
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param data
* The program data.
*
* @see fss_extended_read_load_setting()
*/
#ifndef _di_fss_extended_read_process_option_
- extern f_status_t fss_extended_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process_option(fll_program_data_t * const main, fss_extended_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_option_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_read_process_total_
- extern f_status_t fss_extended_read_process_total(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process_total(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_total_
-/**
- * Determine if the given depth is to be delimited or not.
- *
- * @param main
- * The main program data.
- * @param depth
- * The depth to check.
- *
- * @return
- * F_true if delimited.
- * F_false if not delimited.
- */
-#ifndef _di_fss_extended_read_is_delimited_at_depth_
- extern f_status_t fss_extended_read_is_delimited_at_depth(fll_program_data_t * const main, const f_array_length_t depth) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_read_is_delimited_at_depth_
-
-/**
- * Process a given 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
- * The processed depth parameters.
- * @param objects_delimits
- * An array of delimits detected during processing, for top-level objects.
- * @param contents_delimits
- * An array of delimits detected during processing, for contents.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_extended_read_main_preprocess_depth()
- */
-#ifndef _di_fss_extended_read_main_process_file_
- extern f_status_t fss_extended_read_main_process_file(fll_program_data_t * const main, const f_console_arguments_t arguments, const f_string_t file_name, const fss_extended_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_read_main_process_file_
-
#ifdef __cplusplus
} // extern "C"
#endif
}
}
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, fss_extended_write_long_file_s);
status = F_status_set_error(F_parameter);
}
}
if (argv[index].used) {
f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
- for (; range.start < length; ++range.start) {
+ for (; range.start < argv[index].used; ++range.start) {
status = f_fss_is_space(argv[index], range);
if (F_status_is_error(status)) break;
}
f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
- f_string_dynamic_t object = f_string_dynamic_t_initialize;
f_string_dynamics_t contents = f_string_dynamics_t_initialize;
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_extended_write_parameter_partial_e].result == f_console_result_found_e) {
if (main->parameters.array[fss_extended_write_parameter_object_e].result == f_console_result_additional_e) {
contents.used = 0;
+
uint16_t signal_check = 0;
for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_write_parameter_object_e].values.used; ++i) {
signal_check = 0;
}
- 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;
-
- status = fss_extended_write_process(main, output, quote, &object, 0, &buffer);
+ status = fss_extended_write_process(main, output, quote, &argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]], 0, &buffer);
if (F_status_is_error(status)) break;
} // for
}
else {
- object.used = 0;
-
status = f_string_dynamics_increase_by(main->parameters.array[fss_extended_write_parameter_content_e].values.used, &contents);
if (status == F_array_too_large) {
} // for
status = fss_extended_write_process(main, output, quote, 0, &contents, &buffer);
-
- // clear the contents array of the static strings to avoid deallocation attempts on static variables.
- for (; i < main->parameters.array[fss_extended_write_parameter_content_e].values.used; ++i) {
- contents.array[contents.used].string = 0;
- contents.array[contents.used].used = 0;
- contents.array[contents.used].size = 0;
- } // for
-
- contents.used = 0;
- contents.size = 0;
}
}
}
if (!((++signal_check) % fss_extended_write_signal_check_d)) {
if (fss_extended_write_signal_received(main)) {
status = F_status_set_error(F_interrupt);
+
break;
}
object_next = main->parameters.array[fss_extended_write_parameter_object_e].locations.array[i + 1];
}
- object = argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]];
-
contents.used = 0;
for (; j < main->parameters.array[fss_extended_write_parameter_content_e].values.used; ++j) {
contents.array[contents.used].used = 0;
}
- status = f_string_append(argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[j]], strnlen(argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[j]], F_console_parameter_size_d), &contents.array[contents.used]);
+ status = f_string_dynamic_append(argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[j]], &contents.array[contents.used]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
break;
}
if (F_status_is_error(status)) break;
- status = fss_extended_write_process(main, output, quote, &object, &contents, &buffer);
+ status = fss_extended_write_process(main, output, quote, &argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]], &contents, &buffer);
if (F_status_is_error(status)) break;
} // for
}
}
f_string_dynamic_resize(0, &escaped);
-
- // Object, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free().
- object.string = 0;
- object.used = 0;
- object.size = 0;
-
- // Reset contents used, it is dynamically allocated so leave everything else alone.
- contents.used = 0;
}
if (main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_additional_e) {
}
f_string_dynamic_resize(0, &buffer);
- f_string_dynamic_resize(0, &object);
f_string_dynamics_resize(0, &contents);
fss_extended_write_main_delete(main);
#endif // _di_fss_extended_write_error_parameter_at_least_once_print_
#ifndef _di_fss_extended_write_error_parameter_value_missing_print_
- void fss_extended_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) {
+ void fss_extended_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_extended_write_error_parameter_value_missing_print_
- void fss_extended_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
+ void fss_extended_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_write_error_parameter_value_missing_print_
/**
flockfile(file.stream);
- fll_program_print_help_header(file, context, fss_identify_program_name_long_s, fss_identify_program_version);
+ fll_program_print_help_header(file, context, fss_identify_program_name_long_s, fss_identify_program_version_s);
fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
status = F_none;
if (main->parameters.array[fss_identify_parameter_help_e].result == f_console_result_found_e) {
}
if (main->parameters.array[fss_identify_parameter_version_e].result == f_console_result_found_e) {
- fll_program_print_version(main->output.to, fss_identify_program_version);
+ fll_program_print_version(main->output.to, fss_identify_program_version_s);
fss_identify_main_delete(main);
fss_identify_data_t data = fss_identify_data_t_initialize;
+ data.argv = main->parameters.arguments.array;
+
if (F_status_is_error_not(status)) {
if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
}
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(argv[index].used);
+ const f_string_range_t range = macro_f_string_range_t_initialize(data.argv[index].used);
- status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &data.line);
+ status = fl_conversion_string_to_number_unsigned(data.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, 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, data.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 = argv[index].used;
+ const f_array_length_t length = data.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(argv[index].string + i, length, F_true);
+ status = f_utf_is_word(data.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("%[%Q%]", main->error.to.stream, main->error.notable, argv[index], main->error.notable);
+ fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, data.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++] = argv[index].string[i];
+ data.name.string[data.name.used++] = data.argv[index].string[i];
} // for
}
}
file.stream = F_type_input_d;
file.size_read = 512;
- status = fss_identify_load_line(main, file, "-", &buffer, &range);
+ status = fss_identify_load_line(main, file, f_string_empty_s, &buffer, &range);
if (F_status_is_error_not(status)) {
- status = fss_identify_process(main, "-", buffer, &range, &data);
+ status = fss_identify_process(main, &data, f_string_ascii_minus_s, buffer, &range);
}
}
file.size_read = 512;
- status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
+ status = f_file_stream_open(data.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);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.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, argv[main->parameters.remaining.array[i]], &buffer, &range);
+ status = fss_identify_load_line(main, file, data.argv[main->parameters.remaining.array[i]], &buffer, &range);
if (F_status_is_error_not(status)) {
- status = fss_identify_process(main, argv[main->parameters.remaining.array[i]], buffer, &range, &data);
+ status = fss_identify_process(main, &data, data.argv[main->parameters.remaining.array[i]], buffer, &range);
}
}
/**
* The data structure for FSS Identify.
*
+ * argv: The argument structure in the progam data parameters for simplifying syntax.
* current: The current position within the ids, used to determine when the line is matched.
* line: The line number to select.
- * total: The total ids across all files.
* name: The name to select.
+ * total: The total ids across all files.
*/
#ifndef _di_fss_identify_data_t_
typedef struct {
f_array_length_t line;
f_array_length_t total;
+ f_string_static_t *argv;
+
f_string_dynamic_t name;
} fss_identify_data_t;
0, \
0, \
0, \
+ 0, \
f_string_dynamic_t_initialize, \
}
#endif // _di_fss_identify_data_t_
if (!((++signal_check) % fss_identify_signal_check_d)) {
if (fss_identify_signal_received(main)) {
status = F_status_set_error(F_interrupt);
+
break;
}
status = f_string_dynamic_resize(buffer->size + file.size_read, buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, name.used ? name : f_string_ascii_s, f_file_operation_read_s, name ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, name.used ? name : f_string_ascii_minus_s, f_file_operation_read_s, name.used ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
return status;
}
status = f_file_stream_read_block(file, buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read_block", F_true, name.used ? name : f_string_ascii_s, f_file_operation_read_s, name ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read_block", F_true, name.used ? name : f_string_ascii_minus_s, f_file_operation_read_s, name.used ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
return status;
}
} while (F_status_is_error_not(status) && status != F_none_eof);
- // reset the start point to prepare the buffer for processing.
+ // Reset the start point to prepare the buffer for processing.
range->start = 0;
return status;
#endif // _di_fss_identify_load_line_
#ifndef _di_fss_identify_process_
- f_status_t fss_identify_process(fll_program_data_t * const main, const f_string_t name, const f_string_static_t buffer, f_string_range_t *range, fss_identify_data_t *data) {
+ f_status_t fss_identify_process(fll_program_data_t * const main, fss_identify_data_t * const data, const f_string_static_t name, const f_string_static_t buffer, f_string_range_t *range) {
f_status_t status = F_none;
f_fll_ids_t ids = f_fll_ids_t_initialize;
- status = fll_fss_identify(buffer.string, range, &ids);
+ status = fll_fss_identify(buffer, range, &ids);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_identify", F_true, name.used ? name : f_string_ascii_s, f_file_operation_read_s, name.used ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_identify", F_true, name.used ? name : f_string_ascii_pipe_s, f_file_operation_read_s, name.used ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
f_type_fll_ids_resize(0, &ids);
* @see f_string_dynamic_resize()
*/
#ifndef _di_fss_identify_load_line_
- extern f_status_t fss_identify_load_line(fll_program_data_t * const main, const f_file_t file, const f_string_t name, f_string_static_t *buffer, f_string_range_t *range) F_attribute_visibility_internal_d;
+ extern f_status_t fss_identify_load_line(fll_program_data_t * const main, const f_file_t file, const f_string_static_t name, f_string_static_t *buffer, f_string_range_t *range) F_attribute_visibility_internal_d;
#endif // _di_fss_identify_load_line_
/**
*
* @param main
* The main program data.
+ * @param data
+ * The program data.
* @param name
* The name of the file.
* Set to NULL to designate that this is a pipe.
* The string representing the file to process.
* @param range
* The range representing the line in the buffer.
- * @param data
- * The program data.
*
* @return
* F_none on success.
* @see fll_fss_identify()
*/
#ifndef _di_fss_identify_process_
- extern f_status_t fss_identify_process(fll_program_data_t * const main, const f_string_t name, const f_string_static_t buffer, f_string_range_t *range, fss_identify_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_identify_process(fll_program_data_t * const main, fss_identify_data_t * const data, const f_string_static_t name, const f_string_static_t buffer, f_string_range_t *range) F_attribute_visibility_internal_d;
#endif // _di_fss_identify_process_
#ifdef __cplusplus
#endif
#ifndef _di_fss_identify_print_
- void fss_identify_print(fll_program_data_t * const main, f_fll_id_t id) {
+ void fss_identify_print(fll_program_data_t * const main, const f_fll_id_t id) {
flockfile(main->output.to.stream);
if (main->parameters.array[fss_identify_parameter_object_e].result == f_console_result_found_e || main->parameters.array[fss_identify_parameter_content_e].result != f_console_result_found_e) {
- f_print(id.name, id.used, main->output.to.stream);
+ f_print((const f_string_t) id.name, id.used, main->output.to.stream);
if (main->parameters.array[fss_identify_parameter_object_e].result != f_console_result_found_e || main->parameters.array[fss_identify_parameter_content_e].result == f_console_result_found_e) {
f_print_dynamic_raw(f_fss_type_header_part5_s, main->output.to.stream);
* The Identifier to print.
*/
#ifndef _di_fss_identify_print_
- extern void fss_identify_print(fll_program_data_t * const main, f_fll_id_t id) F_attribute_visibility_internal_d;
+ extern void fss_identify_print(fll_program_data_t * const main, const f_fll_id_t id) F_attribute_visibility_internal_d;
#endif // _di_fss_identify_print_
#ifdef __cplusplus
#endif
#ifndef _di_fss_payload_read_defines_
+ const f_string_static_t fss_payload_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_name_s, 0, FSS_PAYLOAD_READ_pipe_name_s_length);
+
const f_string_static_t fss_payload_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_content_end_s, 0, FSS_PAYLOAD_READ_pipe_content_end_s_length);
const f_string_static_t fss_payload_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_content_ignore_s, 0, FSS_PAYLOAD_READ_pipe_content_ignore_s_length);
const f_string_static_t fss_payload_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_content_start_s, 0, FSS_PAYLOAD_READ_pipe_content_start_s_length);
#ifndef _di_fss_payload_read_defines_
#define fss_payload_read_signal_check_d 10000
- #define FSS_PAYLOAD_READ_pipe_content_end_s '\f'
- #define FSS_PAYLOAD_READ_pipe_content_ignore_s '\v'
- #define FSS_PAYLOAD_READ_pipe_content_start_s '\b'
+ #define FSS_PAYLOAD_READ_pipe_name_s "(pipe)"
+
+ #define FSS_PAYLOAD_READ_pipe_content_end_s "\f"
+ #define FSS_PAYLOAD_READ_pipe_content_ignore_s "\v"
+ #define FSS_PAYLOAD_READ_pipe_content_start_s "\b"
+
+ #define FSS_PAYLOAD_READ_pipe_name_s_length 6
#define FSS_PAYLOAD_READ_pipe_content_end_s_length 1
#define FSS_PAYLOAD_READ_pipe_content_ignore_s_length 1
#define FSS_PAYLOAD_READ_pipe_content_start_s_length 1
- extern const fss_payload_read_pipe_content_end_s;
- extern const fss_payload_read_pipe_content_ignore_s;
- extern const fss_payload_read_pipe_content_start_s;
+ extern const f_string_static_t fss_payload_read_pipe_name_s;
+
+ extern const f_string_static_t fss_payload_read_pipe_content_end_s;
+ extern const f_string_static_t fss_payload_read_pipe_content_ignore_s;
+ extern const f_string_static_t fss_payload_read_pipe_content_start_s;
#endif // _di_fss_payload_read_defines_
/**
macro_f_console_parameter_t_initialize(fss_payload_read_short_trim_s.string, fss_payload_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_payload_total_parameters_d 23
+ #define fss_payload_read_total_parameters_d 23
#endif // _di_fss_payload_read_parameters_
/**
flockfile(file.stream);
- fll_program_print_help_header(file, context, fss_payload_program_name_long_s, fss_payload_program_version_s);
+ fll_program_print_help_header(file, context, fss_payload_read_program_name_long_s, fss_payload_read_program_version_s);
fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
fll_program_print_help_option(file, context, fss_payload_read_short_total_s, fss_payload_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
fll_program_print_help_option(file, context, fss_payload_read_short_trim_s, fss_payload_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
- fll_program_print_help_usage(file, context, fss_payload_program_name_s, fll_program_parameter_filenames_s);
+ fll_program_print_help_usage(file, context, fss_payload_read_program_name_s, fll_program_parameter_filenames_s);
fl_print_format(" %[Notes:%]%r", file.stream, context.set.important, context.set.important, f_string_eol_s);
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
status = F_none;
if (main->parameters.array[fss_payload_read_parameter_help_e].result == f_console_result_found_e) {
fss_payload_read_print_help(main->output.to, main->context);
fss_payload_read_main_delete(main);
+
return status;
}
if (main->parameters.array[fss_payload_read_parameter_version_e].result == f_console_result_found_e) {
- fll_program_print_version(main->output.to, fss_payload_program_version_s);
+ fll_program_print_version(main->output.to, fss_payload_read_program_version_s);
fss_payload_read_main_delete(main);
+
return status;
}
fss_payload_read_file_t files_array[main->parameters.remaining.used + 1];
fss_payload_read_data_t data = fss_payload_read_data_t_initialize;
+ data.argv = main->parameters.arguments.array;
data.files.array = files_array;
data.files.used = 1;
data.files.size = main->parameters.remaining.used + 1;
fss_payload_read_parameter_total_e,
};
- const f_string_t parameter_name[] = {
+ const f_string_static_t parameter_name[] = {
fss_payload_read_long_depth_s,
fss_payload_read_long_line_s,
fss_payload_read_long_pipe_s,
funlockfile(main->error.to.stream);
status = F_status_set_error(F_parameter);
+
break;
}
} // for
}
if (F_status_is_error_not(status) && main->parameters.array[fss_payload_read_parameter_delimit_e].result == f_console_result_additional_e) {
- f_array_length_t location = 0;
+ f_array_length_t index = 0;
f_array_length_t length = 0;
uint16_t signal_check = 0;
if (!((++signal_check) % fss_payload_read_signal_check_d)) {
if (fss_payload_read_signal_received(main)) {
status = F_status_set_error(F_interrupt);
+
break;
}
signal_check = 0;
}
- location = main->parameters.array[fss_payload_read_parameter_delimit_e].values.array[i];
- length = strnlen(arguments->argv[location], F_console_parameter_size_d);
+ index = main->parameters.array[fss_payload_read_parameter_delimit_e].values.array[i];
+ length = data.argv[index].used;
if (!length) {
flockfile(main->error.to.stream);
funlockfile(main->error.to.stream);
status = F_status_set_error(F_parameter);
+
break;
}
- else if (fl_string_compare(arguments->argv[location], fss_payload_read_delimit_mode_name_none_s, length, fss_payload_read_delimit_mode_name_none_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(data.argv[index], fss_payload_read_delimit_mode_name_none_s) == F_equal_to) {
data.delimit_mode = fss_payload_read_delimit_mode_none_e;
}
- else if (fl_string_compare(arguments->argv[location], fss_payload_read_delimit_mode_name_all_s, length, fss_payload_read_delimit_mode_name_all_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(data.argv[index], fss_payload_read_delimit_mode_name_all_s) == F_equal_to) {
data.delimit_mode = fss_payload_read_delimit_mode_all_e;
}
- else if (fl_string_compare(arguments->argv[location], fss_payload_read_delimit_mode_name_object_s, length, fss_payload_read_delimit_mode_name_object_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(data.argv[index], fss_payload_read_delimit_mode_name_object_s) == F_equal_to) {
switch (data.delimit_mode) {
case 0:
data.delimit_mode = fss_payload_read_delimit_mode_object_e;
data.delimit_mode = fss_payload_read_delimit_mode_content_object_e;
}
- if (arguments->argv[location][length - 1] == fss_payload_read_delimit_mode_name_greater_s.string[0]) {
+ if (data.argv[index].string[length - 1] == fss_payload_read_delimit_mode_name_greater_s.string[0]) {
if (!(data.delimit_mode == fss_payload_read_delimit_mode_none_e || data.delimit_mode == fss_payload_read_delimit_mode_all_e)) {
if (data.delimit_mode == fss_payload_read_delimit_mode_content_object_e) {
data.delimit_mode = fss_payload_read_delimit_mode_content_greater_object_e;
// Shorten the length to better convert the remainder to a number.
--length;
}
- else if (arguments->argv[location][length - 1] == fss_payload_read_delimit_mode_name_lesser_s.string[0]) {
+ else if (data.argv[index].string[length - 1] == fss_payload_read_delimit_mode_name_lesser_s.string[0]) {
if (!(data.delimit_mode == fss_payload_read_delimit_mode_none_e || data.delimit_mode == fss_payload_read_delimit_mode_all_e)) {
if (data.delimit_mode == fss_payload_read_delimit_mode_content_object_e) {
data.delimit_mode = fss_payload_read_delimit_mode_content_lesser_object_e;
f_string_range_t range = macro_f_string_range_t_initialize(length);
// Ignore leading plus sign.
- if (arguments->argv[location][0] == '+') {
+ if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
++range.start;
}
- status = fl_conversion_string_to_number_unsigned(arguments->argv[location], range, &data.delimit_depth);
+ status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_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_payload_read_long_delimit_s, arguments->argv[location]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_delimit_s, data.argv[index]);
break;
}
}
if (F_status_is_error_not(status)) {
- status = fss_payload_read_depth_process(main, arguments, &data);
+ status = fss_payload_read_depth_process(main, &data);
}
// This standard only partially supports nesting, so any depth greater than 1 can be predicted without processing the file.
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", 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_file_stream_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
else if (data.buffer.used) {
data.files.array[0].range.stop = data.buffer.used - 1;
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);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_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(arguments->argv[main->parameters.remaining.array[i]], 0, &file);
+ status = f_file_stream_open(data.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, data.argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
else if (data.buffer.used > data.files.array[data.files.used].range.start) {
- data.files.array[data.files.used].name = arguments->argv[main->parameters.remaining.array[i]];
+ data.files.array[data.files.used].name = data.argv[main->parameters.remaining.array[i]];
data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
}
}
}
if (F_status_is_error_not(status)) {
- status = fss_payload_read_process(main, arguments, &data);
+ status = fss_payload_read_process(main, &data);
}
fss_payload_read_data_delete_simple(&data);
* - total: The total lines found and selected is printed instead of the Content.
* - trim: Empty space before and after Objects and Content will not be printed (They will be trimmed).
*
+ * argv: The argument structure in the progam data parameters for simplifying syntax.
* options: Bitwise flags representing parameters.
* delimit_mode: The delimit mode.
* delimit_depth: The delimit depth.
f_number_unsigned_t select;
f_number_unsigned_t line;
+ f_string_static_t *argv;
+
fss_payload_read_files_t files;
fss_payload_read_depths_t depths;
0, \
0, \
0, \
+ 0, \
fss_payload_read_files_t_initialize, \
fss_payload_read_depths_t_initialize, \
f_string_dynamic_t_initialize, \
#endif
#ifndef _di_fss_payload_read_delimit_content_is_
- f_status_t fss_payload_read_delimit_content_is(const f_array_length_t depth, fss_payload_read_data_t * const data) {
+ f_status_t fss_payload_read_delimit_content_is(fss_payload_read_data_t * const data, const f_array_length_t depth) {
if (data->delimit_mode == fss_payload_read_delimit_mode_none_e) {
return F_false;
#endif // _di_fss_payload_read_delimit_content_is_
#ifndef _di_fss_payload_read_delimit_object_is_
- f_status_t fss_payload_read_delimit_object_is(const f_array_length_t depth, fss_payload_read_data_t * const data) {
+ f_status_t fss_payload_read_delimit_object_is(fss_payload_read_data_t * const data, const f_array_length_t depth) {
switch (data->delimit_mode) {
case fss_payload_read_delimit_mode_none_e:
#endif // _di_fss_payload_read_delimit_object_is_
#ifndef _di_fss_payload_read_depth_process_
- f_status_t fss_payload_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
+ f_status_t fss_payload_read_depth_process(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
f_status_t status = F_none;
else {
position_depth = main->parameters.array[fss_payload_read_parameter_depth_e].values.array[i];
- const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[position_depth]));
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
- status = fl_conversion_string_to_number_unsigned(arguments->argv[position_depth], range, &data->depths.array[i].depth);
+ status = fl_conversion_string_to_number_unsigned(data->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_payload_read_long_depth_s, arguments->argv[position_depth]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_depth_s, data->argv[position_depth]);
return status;
}
data->depths.array[i].index_at = main->parameters.array[fss_payload_read_parameter_at_e].values.array[position_at];
- const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[data->depths.array[i].index_at]));
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
- status = fl_conversion_string_to_number_unsigned(arguments->argv[data->depths.array[i].index_at], range, &data->depths.array[i].value_at);
+ status = fl_conversion_string_to_number_unsigned(data->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_payload_read_long_at_s, arguments->argv[data->depths.array[i].index_at]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_at_s, data->argv[data->depths.array[i].index_at]);
return status;
}
data->depths.array[i].index_name = main->parameters.array[fss_payload_read_parameter_name_e].values.array[position_name];
if (main->parameters.array[fss_payload_read_parameter_trim_e].result == f_console_result_found_e) {
- status = fl_string_rip(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name);
+ status = fl_string_rip(data->argv[data->depths.array[i].index_name].string, data->argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
}
else {
- status = f_string_append(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name);
+ status = f_string_dynamic_append(data->argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
}
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_payload_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_payload_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_dynamic_append", F_true);
return status;
}
#endif // _di_fss_payload_read_file_identify_
#ifndef _di_fss_payload_read_load_
- f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t *data) {
+ f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
f_state_t state = macro_f_state_t_initialize(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, 0, 0, 0);
f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
#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_static_t name, f_number_unsigned_t *number) {
+ f_status_t fss_payload_read_load_number(fll_program_data_t * const main, fss_payload_read_data_t * const data, 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(main->parameters.arguments.array[index], F_console_parameter_size_d));
+ const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
- const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
+ const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[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, main->parameters.arguments.array[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
return status;
}
#endif // _di_fss_payload_read_load_number_
#ifndef _di_fss_payload_read_process_
- f_status_t fss_payload_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
+ f_status_t fss_payload_read_process(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
- f_status_t status = fss_payload_read_process_option(main, arguments, data);
+ f_status_t status = fss_payload_read_process_option(main, data);
if (F_status_is_error(status)) return status;
// This standard does not support multiple content groups, except for "headers" FSS-0001 Extended at depth 1.
}
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object_header : &except_none;
- f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is((data->option & fss_payload_read_data_option_select_d) ? data->select : 0, data) ? &data->delimits_content_header : &except_none;
+ f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object_header : &except_none;
+ f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, (data->option & fss_payload_read_data_option_select_d) ? data->select : 0) ? &data->delimits_content_header : &except_none;
if (data->option & fss_payload_read_data_option_raw_d) {
delimits_object = &except_none;
}
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
- f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+ f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+ f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
uint16_t signal_check = 0;
bool is_payload = F_false;
#endif // _di_fss_payload_read_process_
#ifndef _di_fss_payload_read_process_at_
- f_status_t fss_payload_read_process_at(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_at(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
if (data->option & (fss_payload_read_data_option_columns_d | fss_payload_read_data_option_total_d)) {
}
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
- f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+ f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+ f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
if (data->option & fss_payload_read_data_option_raw_d) {
delimits_object = &except_none;
if (data->option & fss_payload_read_data_option_line_d) {
f_array_length_t line = 0;
- status = fss_payload_read_process_at_line(main, i, *delimits_object, *delimits_content, data, &line);
+ status = fss_payload_read_process_at_line(main, data, i, *delimits_object, *delimits_content, &line);
if (status == F_success) return F_none;
}
else if (data->option & fss_payload_read_data_option_columns_d) {
#endif // _di_fss_payload_read_process_at_
#ifndef _di_fss_payload_read_process_at_extended_
- f_status_t fss_payload_read_process_at_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_at_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
if (data->depths.array[data->depths.used - 1].value_at >= data->objects_header.used) {
if (data->option & (fss_payload_read_data_option_columns_d | fss_payload_read_data_option_total_d)) {
}
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object_header : &except_none;
- f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is((data->option & fss_payload_read_data_option_select_d) ? data->select : 0, data) ? &data->delimits_content_header : &except_none;
+ f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object_header : &except_none;
+ f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, (data->option & fss_payload_read_data_option_select_d) ? data->select : 0) ? &data->delimits_content_header : &except_none;
if (data->option & fss_payload_read_data_option_raw_d) {
delimits_object = &except_none;
#endif // _di_fss_payload_read_process_at_extended_
#ifndef _di_fss_payload_read_process_at_line_
- f_status_t fss_payload_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_payload_read_data_t *data, f_array_length_t *line) {
+ f_status_t fss_payload_read_process_at_line(fll_program_data_t * const main, fss_payload_read_data_t * const data, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, f_array_length_t *line) {
if (data->option & fss_payload_read_data_option_object_d) {
if (*line == data->line) {
#endif // _di_fss_payload_read_process_at_line_
#ifndef _di_fss_payload_read_process_columns_
- f_status_t fss_payload_read_process_columns(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_columns(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
if (!(data->option & fss_payload_read_data_option_content_d)) {
flockfile(main->output.to.stream);
#endif // _di_fss_payload_read_process_columns_
#ifndef _di_fss_payload_read_process_columns_extended_
- f_status_t fss_payload_read_process_columns_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_columns_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
if (!(data->option & fss_payload_read_data_option_content_d)) {
flockfile(main->output.to.stream);
#endif // _di_fss_payload_read_process_columns_extended_
#ifndef _di_fss_payload_read_process_line_
- f_status_t fss_payload_read_process_line(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_line(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
- f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+ f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+ f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
if (data->option & fss_payload_read_data_option_raw_d) {
delimits_object = &except_none;
signal_check = 0;
}
- status = fss_payload_read_process_at_line(main, i, *delimits_object, *delimits_content, data, &line);
+ status = fss_payload_read_process_at_line(main, data, i, *delimits_object, *delimits_content, &line);
if (status == F_success) break;
} // for
#endif // _di_fss_payload_read_process_line_
#ifndef _di_fss_payload_read_process_line_extended_
- f_status_t fss_payload_read_process_line_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_line_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object_header : &except_none;
- f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is((data->option & fss_payload_read_data_option_select_d) ? data->select : 0, data) ? &data->delimits_content_header : &except_none;
+ f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object_header : &except_none;
+ f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, (data->option & fss_payload_read_data_option_select_d) ? data->select : 0) ? &data->delimits_content_header : &except_none;
if (data->option & fss_payload_read_data_option_raw_d) {
delimits_object = &except_none;
#endif // _di_fss_payload_read_process_line_extended_
#ifndef _di_fss_payload_read_process_name_
- f_status_t fss_payload_read_process_name(fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_name(fss_payload_read_data_t * const data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
#endif // _di_fss_payload_read_process_name_
#ifndef _di_fss_payload_read_process_name_extended_
- f_status_t fss_payload_read_process_name_extended(fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_name_extended(fss_payload_read_data_t * const data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
#endif // _di_fss_payload_read_process_name_extended_
#ifndef _di_fss_payload_read_process_option_
- f_status_t fss_payload_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
+ f_status_t fss_payload_read_process_option(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
f_status_t status = F_none;
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, &data->line);
+ status = fss_payload_read_load_number(main, data, 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, &data->select);
+ status = fss_payload_read_load_number(main, data, fss_payload_read_parameter_select_e, fss_payload_read_long_select_s, &data->select);
if (F_status_is_error(status)) return status;
}
#endif // _di_fss_payload_read_process_option_
#ifndef _di_fss_payload_read_process_total_
- f_status_t fss_payload_read_process_total(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_total(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
f_array_length_t total = 0;
f_string_range_t range = f_string_range_t_initialize;
#endif // _di_fss_payload_read_process_total_
#ifndef _di_fss_payload_read_process_total_extended_
- f_status_t fss_payload_read_process_total_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_total_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
f_array_length_t total = 0;
* F_false if to not apply delimits.
*/
#ifndef _di_fss_payload_read_delimit_content_is_
- extern f_status_t fss_payload_read_delimit_content_is(const f_array_length_t depth, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_delimit_content_is(fss_payload_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_delimit_content_is_
/**
* Determine if the given depth is to be delimited or not for an Object.
*
- * @param depth
- * The depth to check.
* @param data
* The program data.
+ * @param depth
+ * The depth to check.
*
* @return
* F_true if to apply delimits.
* F_false if to not apply delimits.
*/
#ifndef _di_fss_payload_read_delimit_object_is_
- extern f_status_t fss_payload_read_delimit_object_is(const f_array_length_t depth, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_delimit_object_is(fss_payload_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_delimit_object_is_
/**
* @see fss_payload_read_depths_resize()
*/
#ifndef _di_fss_payload_read_depth_process_
- extern f_status_t fss_payload_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_depth_process(fll_program_data_t * const main, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_depth_process_
/**
* @see fss_payload_read_process_option()
*/
#ifndef _di_fss_payload_read_load_
- extern f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_load_
/**
*
* @param main
* The main program data.
+ * @param data
+ * The program data.
* @param parameter
* An ID representing the parameter.
* @param name
* @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_static_t name, 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, fss_payload_read_data_t * const data, 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_
/**
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param data
* The program data.
*
* @see fss_payload_read_process_option()
*/
#ifndef _di_fss_payload_read_process_
- extern f_status_t fss_payload_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process(fll_program_data_t * const main, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_
/**
* @see fss_payload_read_process_at_line()
*/
#ifndef _di_fss_payload_read_process_at_
- extern f_status_t fss_payload_read_process_at(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_at(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_at_
/**
* @see fss_payload_read_process_at_line()
*/
#ifndef _di_fss_payload_read_process_at_extended_
- extern f_status_t fss_payload_read_process_at_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_at_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_at_extended_
/**
*
* @param main
* The main program data.
+ * @param data
+ * The program data.
* @param delimits_object
* The delimits to be applied to an Object.
* @param delimits_content
* The delimits to be applied to Content.
- * @param data
- * The program data.
* @param line
* The current line being processed.
* This will be incremented as necessary.
* F_success on success and the line was matched (and possibly printed).
*/
#ifndef _di_fss_payload_read_process_at_line_
- extern f_status_t fss_payload_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_payload_read_data_t *data, f_array_length_t *line) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_at_line(fll_program_data_t * const main, fss_payload_read_data_t * const data, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, f_array_length_t *line) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_at_line_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_columns_
- extern f_status_t fss_payload_read_process_columns(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_columns(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_columns_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_columns_extended_
- extern f_status_t fss_payload_read_process_columns_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_columns_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_columns_extended_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_line_
- extern f_status_t fss_payload_read_process_line(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_line(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_line_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_line_extended_
- extern f_status_t fss_payload_read_process_line_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_line_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_line_extended_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_name_
- extern f_status_t fss_payload_read_process_name(fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_name(fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_name_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_name_extended_
- extern f_status_t fss_payload_read_process_name_extended(fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_name_extended(fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_name_extended_
/**
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param data
* The program data.
*
* @see fss_payload_read_load_setting()
*/
#ifndef _di_fss_payload_read_process_option_
- extern f_status_t fss_payload_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_option(fll_program_data_t * const main, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_option_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_total_
- extern f_status_t fss_payload_read_process_total(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_total(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_total_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_total_extended_
- extern f_status_t fss_payload_read_process_total_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_total_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_total_extended_
#ifdef __cplusplus
const f_string_static_t fss_payload_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_pipe_content_start_s, 0, FSS_PAYLOAD_WRITE_pipe_content_start_s_length);
#endif // _di_fss_payload_write_defines_
-##ifndef _di_fss_payload_write_parameters_
+#ifndef _di_fss_payload_write_parameters_
const f_string_static_t fss_payload_write_short_file_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_file_s, 0, FSS_PAYLOAD_WRITE_short_file_s_length);
const f_string_static_t fss_payload_write_short_content_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_content_s, 0, FSS_PAYLOAD_WRITE_short_content_s_length);
const f_string_static_t fss_payload_write_short_double_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_double_s, 0, FSS_PAYLOAD_WRITE_short_double_s_length);
output.id = -1;
output.stream = 0;
- status = f_file_stream_open(arguments->argv[location], 0, &output);
+ status = f_file_stream_open(argv[location], f_string_empty_s, &output);
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[location], 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[location], f_file_operation_open_s, fll_error_file_type_file_e);
}
}
}
}
else if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1];
- const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d);
- if (length) {
- f_string_range_t range = macro_f_string_range_t_initialize(length);
+ if (argv[index].used) {
+ f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
- main->prepend.string = arguments->argv[index];
- main->prepend.used = length;
- main->prepend.size = length;
+ for (; range.start < argv[index].used; range.start++) {
- for (; range.start < length; range.start++) {
-
- status = f_fss_is_space(main->prepend, range);
+ status = f_fss_is_space(argv[index], range);
if (F_status_is_error(status)) break;
if (status == F_false) {
}
f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
- f_string_dynamic_t object = f_string_dynamic_t_initialize;
- f_string_dynamic_t content = f_string_dynamic_t_initialize;
// @todo Go through the list of Objects, if given, and confirm that payload is specified and is specified last, otherwise error out.
// @todo a new parameter needs to exist for specifying that a Content is a payload for cases where Object is not given (and then this needs to verify that only a single Content is given).
if (fss_payload_write_signal_received(main)) {
status = F_status_set_error(F_interrupt);
+
break;
}
- object.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, F_console_parameter_size_d);
- object.size = object.used;
-
- status = fss_payload_write_process(main, output, quote, &object, 0, &buffer);
+ status = fss_payload_write_process(main, output, quote, &argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]], 0, &buffer);
if (F_status_is_error(status)) break;
} // for
}
if (fss_payload_write_signal_received(main)) {
status = F_status_set_error(F_interrupt);
+
break;
}
- content.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, F_console_parameter_size_d);
- content.size = content.used;
-
- status = fss_payload_write_process(main, output, quote, 0, &content, &buffer);
+ status = fss_payload_write_process(main, output, quote, 0, &argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]], &buffer);
if (F_status_is_error(status)) break;
} // for
}
if (fss_payload_write_signal_received(main)) {
status = F_status_set_error(F_interrupt);
+
break;
}
- object.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]];
- object.used = strnlen(object.string, F_console_parameter_size_d);
- object.size = object.used;
-
- content.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]];
- content.used = strnlen(content.string, F_console_parameter_size_d);
- content.size = content.used;
-
- status = fss_payload_write_process(main, output, quote, &object, &content, &buffer);
+ status = fss_payload_write_process(main, output, quote, &argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]], &argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]], &buffer);
if (F_status_is_error(status)) break;
} // for
}
}
f_string_dynamic_resize(0, &escaped);
-
- // Object and content, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free().
- object.string = 0;
- object.used = 0;
- object.size = 0;
-
- content.string = 0;
- content.used = 0;
- content.size = 0;
}
if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_additional_e) {
}
f_string_dynamic_resize(0, &buffer);
- f_string_dynamic_resize(0, &object);
- f_string_dynamic_resize(0, &content);
fss_payload_write_main_delete(main);
return status;
#endif // _di_fss_payload_write_error_parameter_unsupported_eol_print_
#ifndef _di_fss_payload_write_error_parameter_value_missing_print_
- void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) {
+ void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
range.stop = 0;
}
- status = fll_fss_payload_write_string(*object, *content, trim, &main->prepend, state, buffer);
+ const f_string_static_t *prepend = 0;
+
+ if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) {
+ const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1];
+
+ prepend = &main->parameters.arguments.array[index];
+ }
+
+ status = fll_fss_payload_write_string(*object, *content, trim, prepend, state, buffer);
if (F_status_set_fine(status) == F_none_eol) {
fss_payload_write_error_parameter_unsupported_eol_print(main);
range.start = 0;
range.stop = content->used - 1;
- status = fl_fss_basic_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, &main->prepend, state, &range, buffer);
+ const f_string_static_t *prepend = 0;
+
+ if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) {
+ const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1];
+
+ prepend = &main->parameters.arguments.array[index];
+ }
+
+ status = fl_fss_basic_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, state, &range, buffer);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fl_fss_payload_content_write", F_true);
* The parameter name, such as "help" in "--help".
*/
#ifndef _di_fss_payload_write_error_parameter_value_missing_print_
- void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
+ void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_write_error_parameter_value_missing_print_
/**
/**
* The program data.
*
+ * argv: The argument structure in the progam data parameters for simplifying syntax.
* main: The main program data.
- * argv: The argument structure in fll_program_data_t.parameters for simplifying syntax.
* file: The output file for writing the processed data to (may potentially default to "output").
* mode: The input/output mode (see utf8_modes).
* valid: Designate the output context set for valid characters.