This includes some performance tweaks based on the previous commit in regards to file stream read inefficiency.
f_status_t status = F_none;
ssize_t size_read = 0;
- for (;;) {
+ do {
status = f_string_dynamic_increase_by(file.size_read, buffer);
if (F_status_is_error(status)) return status;
buffer->used += size_read;
- if (size_read < file.size_read) break;
- } // for
+ } while (size_read == file.size_read);
return F_none_eof;
}
#endif // _di_fss_basic_list_read_program_name_
#ifndef _di_fss_basic_list_read_defines_
+ const f_string_static_t fss_basic_list_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_pipe_name_s, 0, FSS_BASIC_LIST_READ_pipe_name_s_length);
+
const f_string_static_t fss_basic_list_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_pipe_content_end_s, 0, FSS_BASIC_LIST_READ_pipe_content_end_s_length);
const f_string_static_t fss_basic_list_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_pipe_content_ignore_s, 0, FSS_BASIC_LIST_READ_pipe_content_ignore_s_length);
const f_string_static_t fss_basic_list_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_pipe_content_start_s, 0, FSS_BASIC_LIST_READ_pipe_content_start_s_length);
const f_string_static_t fss_basic_list_read_long_trim_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_trim_s, 0, FSS_BASIC_LIST_READ_long_trim_s_length);
#endif // _di_fss_basic_list_read_parameters_
+#ifndef _di_fss_basic_list_read_delimit_mode_
+ const f_string_static_t fss_basic_list_read_delimit_mode_name_none_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_delimit_mode_name_none_s, 0, FSS_BASIC_LIST_READ_delimit_mode_name_none_s_length);
+ const f_string_static_t fss_basic_list_read_delimit_mode_name_all_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_delimit_mode_name_all_s, 0, FSS_BASIC_LIST_READ_delimit_mode_name_all_s_length);
+ const f_string_static_t fss_basic_list_read_delimit_mode_name_object_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_delimit_mode_name_object_s, 0, FSS_BASIC_LIST_READ_delimit_mode_name_object_s_length);
+ const f_string_static_t fss_basic_list_read_delimit_mode_name_greater_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_delimit_mode_name_greater_s, 0, FSS_BASIC_LIST_READ_delimit_mode_name_greater_s_length);
+ const f_string_static_t fss_basic_list_read_delimit_mode_name_lesser_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_delimit_mode_name_lesser_s, 0, FSS_BASIC_LIST_READ_delimit_mode_name_lesser_s_length);
+#endif // _di_fss_basic_list_read_delimit_mode_
+
#ifndef _di_fss_basic_list_read_main_delete_
f_status_t fss_basic_list_read_main_delete(fll_program_data_t * const main) {
#define FSS_BASIC_LIST_READ_program_version_nano_s_length 0
#endif // !(defined(FSS_BASIC_LIST_READ_program_version_nano_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_s_length))
- #define FSS_BASIC_LIST_READ_program_version_s FSS_BASIC_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_BASIC_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_BASIC_LIST_READ_program_version_micro_s fss_basic_list_program_version_nano_prefix_s FSS_BASIC_LIST_READ_program_version_nano_s
+ #define FSS_BASIC_LIST_READ_program_version_s FSS_BASIC_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_BASIC_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_BASIC_LIST_READ_program_version_micro_s FSS_BASIC_LIST_READ_program_version_nano_prefix_s FSS_BASIC_LIST_READ_program_version_nano_s
- #define FSS_BASIC_LIST_READ_program_version_s_length FSS_BASIC_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_READ_program_version_micro_s_length + fss_basic_list_program_version_nano_prefix_s_length + FSS_BASIC_LIST_READ_program_version_nano_s_length
+ #define FSS_BASIC_LIST_READ_program_version_s_length FSS_BASIC_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_READ_program_version_micro_s_length + FSS_BASIC_LIST_READ_program_version_nano_prefix_s_length + FSS_BASIC_LIST_READ_program_version_nano_s_length
- extern const f_string_static_t fss_basic_list_program_version_s;
+ extern const f_string_static_t fss_basic_list_read_program_version_s;
#endif // _di_fss_basic_list_read_program_version_
/**
#define FSS_BASIC_LIST_READ_program_name_s_length 19
#define FSS_BASIC_LIST_READ_program_name_long_s_length 19
- extern const f_string_static_t fss_basic_list_program_name_s;
- extern const f_string_static_t fss_basic_list_program_name_long_s;
+ extern const f_string_static_t fss_basic_list_read_program_name_s;
+ extern const f_string_static_t fss_basic_list_read_program_name_long_s;
#endif // _di_fss_basic_list_read_program_name_
/**
* The program defines.
+ *
+ * fss_basic_list_read_pipe_*:
+ * - name: A name used to represent the pipe when printing file names.
+ * - content_end: A code used to reprsent the end of Content for use in binary formats.
+ * - content_ignore: A code used to reprsent the ignoring Content for use in binary formats.
+ * - content_start: A code used to reprsent the start of Content for use in binary formats.
*/
#ifndef _di_fss_basic_list_read_defines_
#define fss_basic_list_read_signal_check_d 10000
+ #define FSS_BASIC_LIST_READ_pipe_name_s "(pipe)"
+
#define FSS_BASIC_LIST_READ_pipe_content_end_s "\f"
#define FSS_BASIC_LIST_READ_pipe_content_ignore_s "\v"
#define FSS_BASIC_LIST_READ_pipe_content_start_s "\b"
+ #define FSS_BASIC_LIST_READ_pipe_name_s_length 6
+
#define FSS_BASIC_LIST_READ_pipe_content_end_s_length 1
#define FSS_BASIC_LIST_READ_pipe_content_ignore_s_length 1
#define FSS_BASIC_LIST_READ_pipe_content_start_s_length 1
+ extern const f_string_static_t fss_basic_list_read_pipe_name_s;
+
extern const f_string_static_t fss_basic_list_read_pipe_content_end_s;
extern const f_string_static_t fss_basic_list_read_pipe_content_ignore_s;
extern const f_string_static_t fss_basic_list_read_pipe_content_start_s;
macro_f_console_parameter_t_initialize(fss_basic_list_read_short_trim_s.string, fss_basic_list_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
- #define fss_basic_list_total_parameters_d 23
+ #define fss_basic_list_read_total_parameters_d 23
#endif // _di_fss_basic_list_read_parameters_
/**
* - object: Objects arre to have delimits applied.
*/
#ifndef _di_fss_basic_list_read_delimit_mode_
- #define fss_basic_list_read_delimit_mode_name_none_s "none"
- #define fss_basic_list_read_delimit_mode_name_all_s "all"
- #define fss_basic_list_read_delimit_mode_name_object_s "object"
- #define fss_basic_list_read_delimit_mode_name_greater_s "+"
- #define fss_basic_list_read_delimit_mode_name_lesser_s "-"
-
- #define fss_basic_list_read_delimit_mode_name_none_s_length 4
- #define fss_basic_list_read_delimit_mode_name_all_s_length 3
- #define fss_basic_list_read_delimit_mode_name_object_s_length 6
- #define fss_basic_list_read_delimit_mode_name_greater_s_length 1
- #define fss_basic_list_read_delimit_mode_name_lesser_s_length 1
+ #define FSS_BASIC_LIST_READ_delimit_mode_name_none_s "none"
+ #define FSS_BASIC_LIST_READ_delimit_mode_name_all_s "all"
+ #define FSS_BASIC_LIST_READ_delimit_mode_name_object_s "object"
+ #define FSS_BASIC_LIST_READ_delimit_mode_name_greater_s "+"
+ #define FSS_BASIC_LIST_READ_delimit_mode_name_lesser_s "-"
+
+ #define FSS_BASIC_LIST_READ_delimit_mode_name_none_s_length 4
+ #define FSS_BASIC_LIST_READ_delimit_mode_name_all_s_length 3
+ #define FSS_BASIC_LIST_READ_delimit_mode_name_object_s_length 6
+ #define FSS_BASIC_LIST_READ_delimit_mode_name_greater_s_length 1
+ #define FSS_BASIC_LIST_READ_delimit_mode_name_lesser_s_length 1
+
+ extern const f_string_static_t fss_basic_list_read_delimit_mode_name_none_s;
+ extern const f_string_static_t fss_basic_list_read_delimit_mode_name_all_s;
+ extern const f_string_static_t fss_basic_list_read_delimit_mode_name_object_s;
+ extern const f_string_static_t fss_basic_list_read_delimit_mode_name_greater_s;
+ extern const f_string_static_t fss_basic_list_read_delimit_mode_name_lesser_s;
enum {
fss_basic_list_read_delimit_mode_none_e = 1,
flockfile(file.stream);
- fll_program_print_help_header(file, context, fss_basic_list_program_name_long_s, fss_basic_list_program_version_s);
+ fll_program_print_help_header(file, context, fss_basic_list_read_program_name_long_s, fss_basic_list_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_basic_list_read_short_total_s, fss_basic_list_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_basic_list_read_short_trim_s, fss_basic_list_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_basic_list_program_name_s, fll_program_parameter_filenames_s);
+ fll_program_print_help_usage(file, context, fss_basic_list_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);
fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%r", file.stream, f_string_eol_s);
fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When using the %[%r%s%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When using the %[%r%r%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%r", file.stream, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%r", file.stream, f_string_eol_s);
fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" Specify both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_object_s, context.set.notable);
- fl_print_format(" and the %[%r%s%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" Specify both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_object_s, context.set.notable);
+ fl_print_format(" and the %[%r%r%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at_s, context.set.notable);
- fl_print_format(" and %[%r%s%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name_s, context.set.notable);
- fl_print_format(" the %[%r%s%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at_s, context.set.notable);
- fl_print_format(" %[%s%s%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at_s, context.set.notable);
+ fl_print_format(" and %[%r%r%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name_s, context.set.notable);
+ fl_print_format(" the %[%r%r%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at_s, context.set.notable);
+ fl_print_format(" %[%r%r%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" This program may support parameters, such as %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, context.set.notable);
- fl_print_format(" or %[%r%s%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" This program may support parameters, such as %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, context.set.notable);
+ fl_print_format(" or %[%r%r%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select_s, context.set.notable, f_string_eol_s);
fl_print_format(" This is done to help ensure consistency for scripting.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" For parameters like %[%r%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth_s, context.set.notable);
fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%r", file.stream, f_string_eol_s);
- fl_print_format(" For parameters like %[%r%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select_s, context.set.notable);
fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_trim_s, context.set.notable);
+ fl_print_format(" The parameter %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_trim_s, context.set.notable);
fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When specifying both the %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_object_s, context.set.notable);
- fl_print_format(" parameter and the %[%r%s%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_content_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When specifying both the %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_object_s, context.set.notable);
+ fl_print_format(" parameter and the %[%r%r%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_content_s, context.set.notable, f_string_eol_s);
fl_print_format(" Both the Object and Content printed are already escaped.%r", file.stream, f_string_eol_s);
fl_print_format(" Both the Object and Content are separated by an EOL.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] accepts the following:%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: Do not apply delimits.%r", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_none_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: (default) Apply all delimits.%r", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_all_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: Apply delimits for Objects.%r", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_object_s, context.set.notable, 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_basic_list_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_basic_list_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_basic_list_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_basic_list_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 %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%r", file.stream, context.set.notable, fss_basic_list_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 %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%r%r", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_lesser_s, 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_basic_list_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_basic_list_read_delimit_mode_name_lesser_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[%r%s%] parameter may be specified multiple times to customize the delimit behavior.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit_s, context.set.notable, 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_basic_list_read_long_delimit_s, context.set.notable, f_string_eol_s);
- fl_print_format(" The %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit_s, context.set.notable);
- fl_print_format(" values %[%s%]", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_none_s, context.set.notable);
- fl_print_format(" and %[%s%],", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_all_s, context.set.notable);
+ fl_print_format(" The %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit_s, context.set.notable);
+ fl_print_format(" values %[%r%]", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_none_s, context.set.notable);
+ fl_print_format(" and %[%r%],", file.stream, context.set.notable, fss_basic_list_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%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_columns_s, context.set.notable);
- fl_print_format(" and %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select_s, context.set.notable);
+ fl_print_format(" The parameters %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_columns_s, context.set.notable);
+ fl_print_format(" and %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select_s, context.set.notable);
fl_print_format(" refer to a Content column.%r", file.stream, f_string_eol_s);
fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%r", file.stream, f_string_eol_s);
fl_print_format(" This is not to be confused with a depth.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
-
status = F_none;
if (main->parameters.array[fss_basic_list_read_parameter_help_e].result == f_console_result_found_e) {
}
if (main->parameters.array[fss_basic_list_read_parameter_version_e].result == f_console_result_found_e) {
- fll_program_print_version(main->output.to, fss_basic_list_program_version_s);
+ fll_program_print_version(main->output.to, fss_basic_list_read_program_version_s);
fss_basic_list_read_main_delete(main);
fss_basic_list_read_file_t files_array[main->parameters.remaining.used + 1];
fss_basic_list_read_data_t data = fss_basic_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;
- data.files.array[0].name = "(pipe)";
+ data.files.array[0].name = fss_basic_list_read_pipe_name_s;
data.files.array[0].range.start = 1;
data.files.array[0].range.stop = 0;
fss_basic_list_read_parameter_total_e,
};
- const f_string_t parameter_name[] = {
+ const f_string_static_t parameter_name[] = {
fss_basic_list_read_long_depth_s,
fss_basic_list_read_long_line_s,
fss_basic_list_read_long_pipe_s,
}
index = main->parameters.array[fss_basic_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_basic_list_read_delimit_mode_name_none_s.string, argv[index], fss_basic_list_read_delimit_mode_name_none_s.used) == F_equal_to) {
+ else if (fl_string_dynamic_compare_string(fss_basic_list_read_delimit_mode_name_none_s.string, data.argv[index], fss_basic_list_read_delimit_mode_name_none_s.used) == F_equal_to) {
data.delimit_mode = fss_basic_list_read_delimit_mode_none_e;
}
- else if (fl_string_dynamic_compare_string(fss_basic_list_read_delimit_mode_name_all_s.string, argv[index], fss_basic_list_read_delimit_mode_name_all_s.used) == F_equal_to) {
+ else if (fl_string_dynamic_compare_string(fss_basic_list_read_delimit_mode_name_all_s.string, data.argv[index], fss_basic_list_read_delimit_mode_name_all_s.used) == F_equal_to) {
data.delimit_mode = fss_basic_list_read_delimit_mode_all_e;
}
- else if (fl_string_dynamic_compare_string(fss_basic_list_read_delimit_mode_name_object_s.string, argv[index], fss_basic_list_read_delimit_mode_name_object_s.used) == F_equal_to) {
+ else if (fl_string_dynamic_compare_string(fss_basic_list_read_delimit_mode_name_object_s.string, data.argv[index], fss_basic_list_read_delimit_mode_name_object_s.used) == F_equal_to) {
switch (data.delimit_mode) {
case 0:
data.delimit_mode = fss_basic_list_read_delimit_mode_object_e;
data.delimit_mode = fss_basic_list_read_delimit_mode_content_object_e;
}
- if (argv[index][length - 1] == fss_basic_list_read_delimit_mode_name_greater_s.string[0]) {
+ if (data.argv[index].string[length - 1] == fss_basic_list_read_delimit_mode_name_greater_s.string[0]) {
if (!(data.delimit_mode == fss_basic_list_read_delimit_mode_none_e || data.delimit_mode == fss_basic_list_read_delimit_mode_all_e)) {
if (data.delimit_mode == fss_basic_list_read_delimit_mode_content_object_e) {
data.delimit_mode = fss_basic_list_read_delimit_mode_content_greater_object_e;
// Shorten the length to better convert the remainder to a number.
--length;
}
- else if (argv[index][length - 1] == fss_basic_list_read_delimit_mode_name_lesser_s.string[0]) {
+ else if (data.argv[index].string[length - 1] == fss_basic_list_read_delimit_mode_name_lesser_s.string[0]) {
if (!(data.delimit_mode == fss_basic_list_read_delimit_mode_none_e || data.delimit_mode == fss_basic_list_read_delimit_mode_all_e)) {
if (data.delimit_mode == fss_basic_list_read_delimit_mode_content_object_e) {
data.delimit_mode = fss_basic_list_read_delimit_mode_content_lesser_object_e;
f_string_range_t range = macro_f_string_range_t_initialize(length);
// Ignore leading plus sign.
- if (argv[index][0] == f_string_ascii_plus_s[0]) {
+ if (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_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_basic_list_read_long_delimit_s, data.argv[index]);
break;
}
}
if (F_status_is_error_not(status)) {
- status = fss_basic_list_read_depth_process(main, arguments, &data);
+ status = fss_basic_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.
- if (F_status_is_error_not(status) && data.depths.array[0].depth > 0) {
+ if (F_status_is_error_not(status) && data.depths.array[0].depth) {
if (main->parameters.array[fss_basic_list_read_parameter_total_e].result == f_console_result_found_e) {
fss_basic_list_read_print_zero(main);
}
funlockfile(main->error.to.stream);
- fss_basic_list_read_depths_resize(0, &data.depths);
-
status = F_status_set_error(F_parameter);
}
- if (F_status_is_error_not(status)) {
- for (f_array_length_t i = 0; i < data.files.used; ++i) {
- macro_f_string_range_t_clear(data.files.array[i].range);
- } // for
- }
-
if (F_status_is_error_not(status) && main->process_pipe) {
f_file_t file = f_file_t_initialize;
}
}
- if (F_status_is_error_not(status) && main->parameters.remaining.used > 0) {
+ if (F_status_is_error_not(status) && main->parameters.remaining.used) {
f_file_t file = f_file_t_initialize;
f_array_length_t size_file = 0;
uint16_t signal_check = 0;
signal_check = 0;
}
+ data.files.array[data.files.used].name = data.argv[main->parameters.remaining.array[i]];
data.files.array[data.files.used].range.start = data.buffer.used;
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(argv[main->parameters.remaining.array[i]], 0, &file);
+ status = f_file_stream_open(data.files.array[data.files.used].name, 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;
}
if (size_file) {
- status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
-
- if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
-
- break;
- }
+ file.size_read = size_file + 1;
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++].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_list_read_process(main, arguments, &data);
+ status = fss_basic_list_read_process(main, &data);
}
fss_basic_list_read_data_delete_simple(&data);
int main(const int argc, const f_string_t *argv) {
f_console_arguments_t arguments = { argc, argv };
- fll_program_data_t data = fss_basic_list_read_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_basic_list_read_common_
- #define fss_basic_list_common_allocation_large_d 256
- #define fss_basic_list_read_common_allocation_small_d 16
+ #define fss_basic_list_read_common_allocation_large_d 2048
+ #define fss_basic_list_read_common_allocation_small_d 128
#endif // _di_fss_basic_list_read_common_
/**
/**
* A structure for designating where within the buffer a particular file exists, using a statically allocated array.
*
- * name: The name of the file representing the range. Set string to NULL to represent the STDIN pipe.
+ * name: The name of the file representing the range.
* range: A range within the buffer representing the file.
*/
#ifndef _di_fss_basic_list_read_file_t_
typedef struct {
- f_string_t name;
+ f_string_static_t name;
f_string_range_t range;
} fss_basic_list_read_file_t;
#define fss_basic_list_read_file_t_initialize \
{ \
- f_string_t_initialize, \
+ f_string_static_t_initialize, \
f_string_range_t_initialize, \
}
#endif // _di_fss_basic_list_read_file_t_
f_number_unsigned_t select;
f_number_unsigned_t line;
+ f_string_static_t *argv;
+
fss_basic_list_read_files_t files;
fss_basic_list_read_depths_t depths;
0, \
0, \
0, \
+ 0, \
fss_basic_list_read_files_t_initialize, \
fss_basic_list_read_depths_t_initialize, \
f_string_dynamic_t_initialize, \
void fss_basic_list_read_print_content_ignore(fll_program_data_t * const main) {
if (main->parameters.array[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_basic_list_read_pipe_content_ignore_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_basic_list_read_pipe_content_ignore_s, main->output.to.stream);
}
}
#endif // _di_fss_basic_list_read_print_content_ignore_
void fss_basic_list_read_print_object_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_basic_list_read_pipe_content_start_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_basic_list_read_pipe_content_start_s, main->output.to.stream);
}
else {
if (main->parameters.array[fss_basic_list_read_parameter_content_e].result == f_console_result_found_e) {
- f_print_character(f_fss_basic_list_open_s.string[0], main->output.to.stream);
- f_print_character(f_fss_basic_list_open_end_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_basic_list_open_s, main->output.to.stream);
+ f_print_dynamic_raw(f_fss_basic_list_open_end_s, main->output.to.stream);
}
else {
- f_print_character(f_fss_eol_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_eol_s, main->output.to.stream);
}
}
}
void fss_basic_list_read_print_set_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_basic_list_read_pipe_content_end_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_basic_list_read_pipe_content_end_s, main->output.to.stream);
}
}
#endif // _di_fss_basic_list_read_print_set_end_
#ifndef _di_fss_basic_list_read_print_one_
void fss_basic_list_read_print_one(fll_program_data_t * const main) {
- f_print_character(f_string_ascii_1_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_string_ascii_1_s, main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
}
#endif // _di_fss_basic_list_read_print_one_
#ifndef _di_fss_basic_list_read_print_zero_
void fss_basic_list_read_print_zero(fll_program_data_t * const main) {
- f_print_character(f_string_ascii_0_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_string_ascii_0_s, main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
}
#endif // _di_fss_basic_list_read_print_zero_
#endif
#ifndef _di_fss_basic_list_read_delimit_content_is_
- f_status_t fss_basic_list_read_delimit_content_is(const f_array_length_t depth, fss_basic_list_read_data_t * const data) {
+ f_status_t fss_basic_list_read_delimit_content_is(fss_basic_list_read_data_t * const data, const f_array_length_t depth) {
if (data->delimit_mode == fss_basic_list_read_delimit_mode_none_e) {
return F_false;
#endif // _di_fss_basic_list_read_delimit_content_is_
#ifndef _di_fss_basic_list_read_delimit_object_is_
- f_status_t fss_basic_list_read_delimit_object_is(const f_array_length_t depth, fss_basic_list_read_data_t * const data) {
+ f_status_t fss_basic_list_read_delimit_object_is(fss_basic_list_read_data_t * const data, const f_array_length_t depth) {
switch (data->delimit_mode) {
case fss_basic_list_read_delimit_mode_none_e:
#endif // _di_fss_basic_list_read_delimit_object_is_
#ifndef _di_fss_basic_list_read_depth_process_
- f_status_t fss_basic_list_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) {
+ f_status_t fss_basic_list_read_depth_process(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) {
f_status_t status = F_none;
else {
position_depth = main->parameters.array[fss_basic_list_read_parameter_depth_e].values.array[i];
- const f_string_range_t range = macro_f_string_range_t_initialize(strlen(argv[position_depth]));
+ const f_string_range_t range = macro_f_string_range_t_initialize(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_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_basic_list_read_long_depth_s, data->argv[position_depth]);
return status;
}
data->depths.array[i].index_at = main->parameters.array[fss_basic_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_basic_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_basic_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_basic_list_read_parameter_name_e].values.array[position_name];
if (main->parameters.array[fss_basic_list_read_parameter_trim_e].result == f_console_result_found_e) {
- status = fl_string_dynamic_rip(argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
+ status = fl_string_rip(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_list_read_depth_process_
#ifndef _di_fss_basic_list_read_file_identify_
- f_string_t fss_basic_list_read_file_identify(const f_array_length_t at, const fss_basic_list_read_files_t files) {
+ f_string_static_t fss_basic_list_read_file_identify(const f_array_length_t at, const fss_basic_list_read_files_t files) {
for (f_array_length_t i = 0; i < files.used; ++i) {
return files.array[files.used - 1].name;
}
- return "";
+ return f_string_empty_s;
}
#endif // _di_fss_basic_list_read_file_identify_
#ifndef _di_fss_basic_list_read_load_
- f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t *data) {
+ f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) {
- f_state_t state = macro_f_state_t_initialize(fss_basic_list_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_basic_list_read_common_allocation_large_d, fss_basic_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);
data->delimits_object.used = 0;
const f_status_t status = fll_fss_basic_list_read(data->buffer, state, &input, &data->objects, &data->contents, &data->delimits_object, &data->delimits_content, &data->comments);
if (F_status_is_error(status)) {
- const f_string_t file_name = fss_basic_list_read_file_identify(input.start, data->files);
-
- fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_basic_list_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_basic_list_read", F_true, fss_basic_list_read_file_identify(input.start, data->files), f_file_operation_process_s, fll_error_file_type_file_e);
return status;
}
#endif // _di_fss_basic_list_read_load_
#ifndef _di_fss_basic_list_read_load_number_
- f_status_t fss_basic_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
+ f_status_t fss_basic_list_read_load_number(fll_program_data_t * const main, fss_basic_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->argv[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->argv[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->argv[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_list_read_load_number_
#ifndef _di_fss_basic_list_read_process_
- f_status_t fss_basic_list_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) {
+ f_status_t fss_basic_list_read_process(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) {
- f_status_t status = fss_basic_list_read_process_option(main, arguments, data);
+ f_status_t status = fss_basic_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_basic_list_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
- f_array_lengths_t *delimits_content = fss_basic_list_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+ f_array_lengths_t *delimits_object = fss_basic_list_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+ f_array_lengths_t *delimits_content = fss_basic_list_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
uint16_t signal_check = 0;
if (data->option & fss_basic_list_read_data_option_raw_d) {
#endif // _di_fss_basic_list_read_process_
#ifndef _di_fss_basic_list_read_process_at_
- f_status_t fss_basic_list_read_process_at(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_list_read_process_at(fll_program_data_t * const main, fss_basic_list_read_data_t * const data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
if (data->option & (fss_basic_list_read_data_option_columns_d | fss_basic_list_read_data_option_total_d)) {
}
f_array_lengths_t except_none = f_array_lengths_t_initialize;
- f_array_lengths_t *delimits_object = fss_basic_list_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
- f_array_lengths_t *delimits_content = fss_basic_list_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+ f_array_lengths_t *delimits_object = fss_basic_list_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+ f_array_lengths_t *delimits_content = fss_basic_list_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
if (data->option & fss_basic_list_read_data_option_raw_d) {
delimits_object = &except_none;
if (data->option & fss_basic_list_read_data_option_line_d) {
f_array_length_t line = 0;
- status = fss_basic_list_read_process_at_line(main, i, *delimits_object, *delimits_content, data, &line);
+ status = fss_basic_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_basic_list_read_data_option_columns_d) {
#endif // _di_fss_basic_list_read_process_at_
#ifndef _di_fss_basic_list_read_process_at_line_
- f_status_t fss_basic_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_basic_list_read_data_t *data, f_array_length_t *line) {
+ f_status_t fss_basic_list_read_process_at_line(fll_program_data_t * const main, fss_basic_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_basic_list_read_data_option_object_d) {
if (*line == data->line) {
return F_none;
}
- f_string_range_t range = f_string_range_t_initialize;
+ f_string_range_t range = data->contents.array[at].array[0];
f_array_length_t i = 0;
uint16_t signal_check = 0;
- range.start = data->contents.array[at].array[0].start;
- range.stop = data->contents.array[at].array[0].stop;
-
// This content has no data, do not even check "include empty" because it cannot be counted as a line.
if (range.start > range.stop) {
return F_none;
#endif // _di_fss_basic_list_read_process_at_line_
#ifndef _di_fss_basic_list_read_process_columns_
- f_status_t fss_basic_list_read_process_columns(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_list_read_process_columns(fll_program_data_t * const main, fss_basic_list_read_data_t * const data, bool names[]) {
if (!(data->option & fss_basic_list_read_data_option_content_d)) {
flockfile(main->output.to.stream);
f_array_length_t max = 0;
uint16_t signal_check = 0;
- for (f_array_length_t at = 0; at < data->contents.used; ++at) {
+ for (f_array_length_t i = 0; i < data->contents.used; ++i) {
- if (!names[at]) continue;
+ if (!names[i]) continue;
if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
if (fss_basic_list_read_signal_received(main)) {
signal_check = 0;
}
- if (data->contents.array[at].used > max) {
- max = data->contents.array[at].used;
+ if (data->contents.array[i].used > max) {
+ max = data->contents.array[i].used;
}
} // for
#endif // _di_fss_basic_list_read_process_columns_
#ifndef _di_fss_basic_list_read_process_line_
- f_status_t fss_basic_list_read_process_line(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_list_read_process_line(fll_program_data_t * const main, fss_basic_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_basic_list_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
- f_array_lengths_t *delimits_content = fss_basic_list_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+ f_array_lengths_t *delimits_object = fss_basic_list_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+ f_array_lengths_t *delimits_content = fss_basic_list_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
if (data->option & fss_basic_list_read_data_option_raw_d) {
delimits_object = &except_none;
signal_check = 0;
}
- status = fss_basic_list_read_process_at_line(main, i, *delimits_object, *delimits_content, data, &line);
+ status = fss_basic_list_read_process_at_line(main, data, i, *delimits_object, *delimits_content, &line);
if (status == F_success) break;
} // for
f_array_lengths_t except_none = f_array_lengths_t_initialize;
if (data->depths.array[0].index_name) {
- f_array_length_t i = 0;
-
memset(names, F_false, sizeof(bool) * data->objects.used);
// This standard should always tread selected names as trimmed.
- for (i = 0; i < data->objects.used; ++i) {
+ for (f_array_length_t i = 0; i < data->objects.used; ++i) {
if (fl_string_dynamic_partial_compare_except_trim_dynamic(data->depths.array[0].value_name, data->buffer, data->objects.array[i], except_none, data->delimits_object) == F_equal_to) {
names[i] = F_true;
#endif // _di_fss_basic_list_read_process_name_
#ifndef _di_fss_basic_list_read_process_option_
- f_status_t fss_basic_list_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) {
+ f_status_t fss_basic_list_read_process_option(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) {
f_status_t status = F_none;
if (main->parameters.array[fss_basic_list_read_parameter_line_e].result == f_console_result_additional_e) {
data->option |= fss_basic_list_read_data_option_line_d;
- status = fss_basic_list_read_load_number(main, fss_basic_list_read_parameter_line_e, fss_basic_list_read_long_line_s, arguments, &data->line);
+ status = fss_basic_list_read_load_number(main, data, fss_basic_list_read_parameter_line_e, fss_basic_list_read_long_line_s, &data->line);
if (F_status_is_error(status)) return status;
}
if (main->parameters.array[fss_basic_list_read_parameter_select_e].result == f_console_result_additional_e) {
data->option |= fss_basic_list_read_data_option_select_d;
- status = fss_basic_list_read_load_number(main, fss_basic_list_read_parameter_select_e, fss_basic_list_read_long_select_s, arguments, &data->select);
+ status = fss_basic_list_read_load_number(main, data, fss_basic_list_read_parameter_select_e, fss_basic_list_read_long_select_s, &data->select);
if (F_status_is_error(status)) return status;
}
#endif // _di_fss_basic_list_read_process_option_
#ifndef _di_fss_basic_list_read_process_total_
- f_status_t fss_basic_list_read_process_total(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_list_read_process_total(fll_program_data_t * const main, fss_basic_list_read_data_t * const data, bool names[]) {
f_array_length_t total = 0;
f_string_range_t range = f_string_range_t_initialize;
range.stop = data->contents.array[at].array[0].stop;
// This content has no data, do not even check "include empty" because it cannot be counted as a line.
- if (range.start > range.stop) {
- continue;
- }
+ if (range.start > range.stop) continue;
for (i = range.start; i <= range.stop; ++i) {
/**
* 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_basic_list_read_delimit_content_is_
- extern f_status_t fss_basic_list_read_delimit_content_is(const f_array_length_t depth, fss_basic_list_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_delimit_content_is(fss_basic_list_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_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_basic_list_read_delimit_object_is_
- extern f_status_t fss_basic_list_read_delimit_object_is(const f_array_length_t depth, fss_basic_list_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_delimit_object_is(fss_basic_list_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_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_basic_list_read_depths_resize()
*/
#ifndef _di_fss_basic_list_read_depth_process_
- extern f_status_t fss_basic_list_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_depth_process(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_depth_process_
/**
* On failure to identify, an empty string is returned.
*/
#ifndef _di_fss_basic_list_read_file_identify_
- extern f_string_t fss_basic_list_read_file_identify(const f_array_length_t at, const fss_basic_list_read_files_t files) F_attribute_visibility_internal_d;
+ extern f_string_static_t fss_basic_list_read_file_identify(const f_array_length_t at, const fss_basic_list_read_files_t files) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_file_identify_
/**
* @see fss_basic_list_read_process_option()
*/
#ifndef _di_fss_basic_list_read_load_
- extern f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_load_
/**
*
* @param main
* The main program data.
+ * @param data
+ * The program data.
* @param parameter
* An ID representing the parameter.
* @param name
* The parameter name to print on error.
- * @param arguments
- * The console arguments passed to the program.
* @param number
* The location to store the loaded number.
*
* @see fss_basic_list_read_depths_resize()
*/
#ifndef _di_fss_basic_list_read_load_number_
- extern f_status_t fss_basic_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_load_number(fll_program_data_t * const main, fss_basic_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_basic_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_basic_list_read_process_option()
*/
#ifndef _di_fss_basic_list_read_process_
- extern f_status_t fss_basic_list_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_
/**
* @see fss_basic_list_read_process_at_line()
*/
#ifndef _di_fss_basic_list_read_process_at_
- extern f_status_t fss_basic_list_read_process_at(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_at(fll_program_data_t * const main, fss_basic_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_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_basic_list_read_process_at_line_
- extern f_status_t fss_basic_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_basic_list_read_data_t *data, f_array_length_t *line) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_at_line(fll_program_data_t * const main, fss_basic_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_basic_list_read_process_at_line_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_list_read_process_columns_
- extern f_status_t fss_basic_list_read_process_columns(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_columns(fll_program_data_t * const main, fss_basic_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_columns_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_list_read_process_line_
- extern f_status_t fss_basic_list_read_process_line(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_line(fll_program_data_t * const main, fss_basic_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_line_
/**
*
* @param main
* The main program data.
- * @param arguments
- * The parameters passed to the process.
* @param data
* The program data.
*
* @see fss_basic_list_read_load_setting()
*/
#ifndef _di_fss_basic_list_read_process_option_
- extern f_status_t fss_basic_list_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_option(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_option_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_list_read_process_total_
- extern f_status_t fss_basic_list_read_process_total(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_total(fll_program_data_t * const main, fss_basic_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_total_
#ifdef __cplusplus
fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%r", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s);
fl_print_format(" The end of the pipe represents the end of any Object or Content.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The FSS-0002 (Basic List) specification does not support quoted names, therefore the parameters '%[%s%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_single_s, context.set.notable);
- fl_print_format(" and '%[%r%s%]' do nothing.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_double_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The FSS-0002 (Basic List) specification does not support quoted names, therefore the parameters '%[%r%r%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_single_s, context.set.notable);
+ fl_print_format(" and '%[%r%r%]' do nothing.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_double_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" This program does not use the parameter '%[%r%s%]', which therefore does nothing.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_ignore_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_ignore_s, context.set.notable, f_string_eol_s);
fl_print_format(" This parameter requires two values.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
funlockfile(file.stream);
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_basic_list_write_common_
- #define fss_basic_list_write_common_allocation_large_d 256
- #define fss_basic_list_write_common_allocation_small_d 16
+ #define fss_basic_list_write_common_allocation_large_d 2048
+ #define fss_basic_list_write_common_allocation_small_d 128
#endif // _di_fss_basic_list_write_common_
/**
const f_string_static_t fss_basic_read_long_trim_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_trim_s, 0, FSS_BASIC_READ_long_trim_s_length);
#endif // _di_fss_basic_read_parameters_
+#ifndef _di_fss_basic_read_delimit_mode_
+ const f_string_static_t fss_basic_read_delimit_mode_name_none_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_delimit_mode_name_none_s, 0, FSS_BASIC_READ_delimit_mode_name_none_s_length);
+ const f_string_static_t fss_basic_read_delimit_mode_name_all_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_delimit_mode_name_all_s, 0, FSS_BASIC_READ_delimit_mode_name_all_s_length);
+ const f_string_static_t fss_basic_read_delimit_mode_name_object_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_delimit_mode_name_object_s, 0, FSS_BASIC_READ_delimit_mode_name_object_s_length);
+ const f_string_static_t fss_basic_read_delimit_mode_name_greater_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_delimit_mode_name_greater_s, 0, FSS_BASIC_READ_delimit_mode_name_greater_s_length);
+ const f_string_static_t fss_basic_read_delimit_mode_name_lesser_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_delimit_mode_name_lesser_s, 0, FSS_BASIC_READ_delimit_mode_name_lesser_s_length);
+#endif // _di_fss_basic_read_delimit_mode_
+
#ifndef _di_fss_basic_read_main_delete_
f_status_t fss_basic_read_main_delete(fll_program_data_t * const main) {
* - object: Objects arre to have delimits applied.
*/
#ifndef _di_fss_basic_read_delimit_mode_
- #define fss_basic_read_delimit_mode_name_none_s "none"
- #define fss_basic_read_delimit_mode_name_all_s "all"
- #define fss_basic_read_delimit_mode_name_object_s "object"
- #define fss_basic_read_delimit_mode_name_greater_s "+"
- #define fss_basic_read_delimit_mode_name_lesser_s "-"
-
- #define fss_basic_read_delimit_mode_name_none_s_length 4
- #define fss_basic_read_delimit_mode_name_all_s_length 3
- #define fss_basic_read_delimit_mode_name_object_s_length 6
- #define fss_basic_read_delimit_mode_name_greater_s_length 1
- #define fss_basic_read_delimit_mode_name_lesser_s_length 1
+ #define FSS_BASIC_READ_delimit_mode_name_none_s "none"
+ #define FSS_BASIC_READ_delimit_mode_name_all_s "all"
+ #define FSS_BASIC_READ_delimit_mode_name_object_s "object"
+ #define FSS_BASIC_READ_delimit_mode_name_greater_s "+"
+ #define FSS_BASIC_READ_delimit_mode_name_lesser_s "-"
+
+ #define FSS_BASIC_READ_delimit_mode_name_none_s_length 4
+ #define FSS_BASIC_READ_delimit_mode_name_all_s_length 3
+ #define FSS_BASIC_READ_delimit_mode_name_object_s_length 6
+ #define FSS_BASIC_READ_delimit_mode_name_greater_s_length 1
+ #define FSS_BASIC_READ_delimit_mode_name_lesser_s_length 1
+
+ extern const f_string_static_t fss_basic_read_delimit_mode_name_none_s;
+ extern const f_string_static_t fss_basic_read_delimit_mode_name_all_s;
+ extern const f_string_static_t fss_basic_read_delimit_mode_name_object_s;
+ extern const f_string_static_t fss_basic_read_delimit_mode_name_greater_s;
+ extern const f_string_static_t fss_basic_read_delimit_mode_name_lesser_s;
enum {
fss_basic_read_delimit_mode_none_e = 1,
fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%r", file.stream, f_string_eol_s);
fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When using the %[%r%s%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When using the %[%r%r%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%r", file.stream, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%r", file.stream, f_string_eol_s);
fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" Specify both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_object_s, context.set.notable);
- fl_print_format(" and the %[%r%s%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" Specify both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_object_s, context.set.notable);
+ fl_print_format(" and the %[%r%r%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at_s, context.set.notable);
- fl_print_format(" and %[%r%s%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name_s, context.set.notable);
- fl_print_format(" the %[%r%s%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at_s, context.set.notable);
- fl_print_format(" %[%r%s%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at_s, context.set.notable);
+ fl_print_format(" and %[%r%r%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name_s, context.set.notable);
+ fl_print_format(" the %[%r%r%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at_s, context.set.notable);
+ fl_print_format(" %[%r%r%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" This program may support parameters, such as %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, context.set.notable);
- fl_print_format(" or %[%r%s%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" This program may support parameters, such as %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, context.set.notable);
+ fl_print_format(" or %[%r%r%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select_s, context.set.notable, f_string_eol_s);
fl_print_format(" This is done to help ensure consistency for scripting.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" For parameters like %[%r%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth_s, context.set.notable);
fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%r", file.stream, f_string_eol_s);
- fl_print_format(" For parameters like %[%r%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select_s, context.set.notable);
fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_trim_s, context.set.notable);
+ fl_print_format(" The parameter %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_trim_s, context.set.notable);
fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When specifying both the %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_object_s, context.set.notable);
- fl_print_format(" parameter and the %[%r%s%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_content_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When specifying both the %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_object_s, context.set.notable);
+ fl_print_format(" parameter and the %[%r%r%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_content_s, context.set.notable, f_string_eol_s);
fl_print_format(" Both the Object and Content printed are already escaped.%r", file.stream, f_string_eol_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%s%] accepts the following:%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: Do not apply delimits.%r", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_none_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: (default) Apply all delimits.%r", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_all_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: Apply delimits for Objects.%r", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_object_s, context.set.notable, 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_basic_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_basic_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_basic_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_basic_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 %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%r", file.stream, context.set.notable, fss_basic_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 %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%r%r", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_lesser_s, 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_basic_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_basic_read_delimit_mode_name_lesser_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[%r%s%] parameter may be specified multiple times to customize the delimit behavior.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit_s, context.set.notable, 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_basic_read_long_delimit_s, context.set.notable, f_string_eol_s);
- fl_print_format(" The %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit_s, context.set.notable);
- fl_print_format(" values %[%s%]", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_none_s, context.set.notable);
- fl_print_format(" and %[%s%],", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_all_s, context.set.notable);
+ fl_print_format(" The %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit_s, context.set.notable);
+ fl_print_format(" values %[%r%]", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_none_s, context.set.notable);
+ fl_print_format(" and %[%r%],", file.stream, context.set.notable, fss_basic_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%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_columns_s, context.set.notable);
- fl_print_format(" and %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select_s, context.set.notable);
+ fl_print_format(" The parameters %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_columns_s, context.set.notable);
+ fl_print_format(" and %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select_s, context.set.notable);
fl_print_format(" refer to a Content column.%r", file.stream, f_string_eol_s);
fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%r", file.stream, f_string_eol_s);
fl_print_format(" This is not to be confused with a depth.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
}
if (size_file) {
- status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
-
- if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
-
- break;
- }
+ file.size_read = size_file + 1;
status = f_file_stream_read(file, &data.buffer);
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_basic_read_common_
- #define fss_basic_read_common_allocation_large_d 256
- #define fss_basic_read_delimit_common_allocation_small_d 16
+ #define fss_basic_read_common_allocation_large_d 2048
+ #define fss_basic_read_common_allocation_small_d 128
#endif // _di_fss_basic_read_common_
/**
/**
* A structure for designating where within the buffer a particular file exists, using a statically allocated array.
*
- * name: The name of the file representing the range. Set string to NULL to represent the STDIN pipe.
+ * name: The name of the file representing the range.
* range: A range within the buffer representing the file.
*/
#ifndef _di_fss_basic_read_file_t_
typedef struct {
- f_string_t name;
+ f_string_static_t name;
f_string_range_t range;
} fss_basic_read_file_t;
#define fss_basic_read_file_t_initialize \
{ \
- f_string_t_initialize, \
+ f_string_static_t_initialize, \
f_string_range_t_initialize, \
}
#endif // _di_fss_basic_read_file_t_
if (data->option & fss_basic_read_data_option_trim_d) {
if (data->option & fss_basic_read_data_option_raw_d) {
if (data->quotes.array[at]) {
- f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
fl_print_trim_dynamic_partial(data->buffer, data->objects.array[at], main->output.to.stream);
if (data->quotes.array[at]) {
- f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
}
else {
else {
if (data->option & fss_basic_read_data_option_raw_d) {
if (data->quotes.array[at]) {
- f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
f_print_dynamic_partial(data->buffer, data->objects.array[at], main->output.to.stream);
if (data->quotes.array[at]) {
- f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
}
else {
void fss_basic_read_print_object_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_basic_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_basic_read_pipe_content_start_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_basic_read_pipe_content_start_s, main->output.to.stream);
}
else {
- f_print_character(f_fss_space_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_space_s, main->output.to.stream);
}
}
#endif // _di_fss_basic_read_print_object_end_
#ifndef _di_fss_basic_read_print_one_
void fss_basic_read_print_one(fll_program_data_t * const main) {
- f_print_character(f_string_ascii_1_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_string_ascii_1_s, main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
}
#endif // _di_fss_basic_read_print_one_
void fss_basic_read_print_set_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_basic_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_basic_read_pipe_content_end_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_basic_read_pipe_content_end_s, main->output.to.stream);
}
else {
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
#ifndef _di_fss_basic_read_print_zero_
void fss_basic_read_print_zero(fll_program_data_t * const main) {
- f_print_character(f_string_ascii_0_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_string_ascii_0_s, main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
}
#endif // _di_fss_basic_read_print_zero_
#endif // _di_fss_basic_read_depth_process_
#ifndef _di_fss_basic_read_file_identify_
- f_string_t fss_basic_read_file_identify(const f_array_length_t at, const fss_basic_read_files_t files) {
+ f_string_static_t fss_basic_read_file_identify(const f_array_length_t at, const fss_basic_read_files_t files) {
for (f_array_length_t i = 0; i < files.used; ++i) {
return files.array[files.used - 1].name;
}
- return "";
+ return f_string_empty_s;
}
#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_state_t state = macro_f_state_t_initialize(fss_basic_read_common_allocation_large_d, fss_basic_read_delimit_common_allocation_small_d, 0, 0, 0, 0, 0);
+ 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);
data->delimits.used = 0;
fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%r", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s);
fl_print_format(" The end of the pipe represents the end of any Object or Content.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The FSS-0000 (Basic) specification does not support multi-line Content, therefore the parameter '%[%r%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend_s, context.set.notable);
+ fl_print_format(" The FSS-0000 (Basic) specification does not support multi-line Content, therefore the parameter '%[%r%r%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend_s, context.set.notable);
fl_print_format(" does nothing.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" This program does not use the parameter '%[%r%s%]', which therefore does nothing.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_write_long_ignore_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_write_long_ignore_s, context.set.notable, f_string_eol_s);
fl_print_format(" This parameter requires two values.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
funlockfile(file.stream);
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_basic_write_common_
- #define fss_basic_write_common_allocation_large_d 256
- #define fss_basic_write_common_allocation_small_d 16
+ #define fss_basic_write_common_allocation_large_d 2048
+ #define fss_basic_write_common_allocation_small_d 128
#endif // _di_fss_basic_write_common_
/**
const f_string_static_t fss_embedded_list_read_long_trim_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_trim_s, 0, FSS_EMBEDDED_LIST_READ_long_trim_s_length);
#endif // _di_fss_embedded_list_read_parameters_
+#ifndef _di_fss_embedded_list_read_delimit_mode_
+ const f_string_static_t fss_embedded_list_read_delimit_mode_name_none_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_none_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_none_s_length);
+ const f_string_static_t fss_embedded_list_read_delimit_mode_name_all_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_all_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_all_s_length);
+ const f_string_static_t fss_embedded_list_read_delimit_mode_name_object_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_object_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_object_s_length);
+ const f_string_static_t fss_embedded_list_read_delimit_mode_name_greater_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_greater_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_greater_s_length);
+ const f_string_static_t fss_embedded_list_read_delimit_mode_name_lesser_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_lesser_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_lesser_s_length);
+#endif // _di_fss_embedded_list_read_delimit_mode_
+
#ifndef _di_fss_embedded_list_read_main_delete_
f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t * const main) {
* Provide delimit management.
*/
#ifndef _di_fss_embedded_list_read_delimit_mode_
- #define fss_embedded_list_read_delimit_mode_name_none_s "none"
- #define fss_embedded_list_read_delimit_mode_name_all_s "all"
- #define fss_embedded_list_read_delimit_mode_name_greater_s "+"
- #define fss_embedded_list_read_delimit_mode_name_lesser_s "-"
-
- #define fss_embedded_list_read_delimit_mode_name_none_s_length 4
- #define fss_embedded_list_read_delimit_mode_name_all_s_length 3
- #define fss_embedded_list_read_delimit_mode_name_greater_s_length 1
- #define fss_embedded_list_read_delimit_mode_name_lesser_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_delimit_mode_name_none_s "none"
+ #define FSS_EMBEDDED_LIST_READ_delimit_mode_name_all_s "all"
+ #define FSS_EMBEDDED_LIST_READ_delimit_mode_name_greater_s "+"
+ #define FSS_EMBEDDED_LIST_READ_delimit_mode_name_lesser_s "-"
+
+ #define FSS_EMBEDDED_LIST_READ_delimit_mode_name_none_s_length 4
+ #define FSS_EMBEDDED_LIST_READ_delimit_mode_name_all_s_length 3
+ #define FSS_EMBEDDED_LIST_READ_delimit_mode_name_greater_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_delimit_mode_name_lesser_s_length 1
+
+ extern const f_string_static_t fss_embedded_list_read_delimit_mode_name_none_s;
+ extern const f_string_static_t fss_embedded_list_read_delimit_mode_name_all_s;
+ extern const f_string_static_t fss_embedded_list_read_delimit_mode_name_greater_s;
+ extern const f_string_static_t fss_embedded_list_read_delimit_mode_name_lesser_s;
enum {
fss_embedded_list_read_delimit_mode_none_e = 1,
fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%r", file.stream, f_string_eol_s);
fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When using the %[%r%s%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When using the %[%r%r%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%r", file.stream, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%r", file.stream, f_string_eol_s);
fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" Specify both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_object_s, context.set.notable);
- fl_print_format(" and the %[%r%s%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" Specify both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_object_s, context.set.notable);
+ fl_print_format(" and the %[%r%r%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at_s, context.set.notable);
- fl_print_format(" and %[%r%s%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name_s, context.set.notable);
- fl_print_format(" the %[%r%s%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at_s, context.set.notable);
- fl_print_format(" %[%r%s%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at_s, context.set.notable);
+ fl_print_format(" and %[%r%r%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name_s, context.set.notable);
+ fl_print_format(" the %[%r%r%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at_s, context.set.notable);
+ fl_print_format(" %[%r%r%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" This program may support parameters, such as %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, context.set.notable);
- fl_print_format(" or %[%r%s%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" This program may support parameters, such as %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, context.set.notable);
+ fl_print_format(" or %[%r%r%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, context.set.notable, f_string_eol_s);
fl_print_format(" This is done to help ensure consistency for scripting.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" For parameters like %[%r%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth_s, context.set.notable);
fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%r", file.stream, f_string_eol_s);
- fl_print_format(" For parameters like %[%r%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, context.set.notable);
fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_trim_s, context.set.notable);
+ fl_print_format(" The parameter %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_trim_s, context.set.notable);
fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When specifying both the %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_object_s, context.set.notable);
- fl_print_format(" parameter and the %[%r%s%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_content_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When specifying both the %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_object_s, context.set.notable);
+ fl_print_format(" parameter and the %[%r%r%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_content_s, context.set.notable, f_string_eol_s);
fl_print_format(" Both the Object and Content printed are already escaped.%r", file.stream, f_string_eol_s);
fl_print_format(" Both the Object and Content are separated by an EOL.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] accepts the following:%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: Do not apply delimits.%r", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_none_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: (default) Apply all delimits.%r", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_all_s, context.set.notable, 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_embedded_list_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_embedded_list_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_embedded_list_read_delimit_mode_name_all_s, context.set.notable, f_string_eol_s);
// @todo
- //fl_print_format(" - %[%s%]: Apply delimits for Objects.%r", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_object, context.set.notable, f_string_eol_s);
+ //fl_print_format(" - %[%r%]: Apply delimits for Objects.%r", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_object, 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 %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%r", file.stream, context.set.notable, fss_embedded_list_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 %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%r%r", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_lesser_s, 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_embedded_list_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_embedded_list_read_delimit_mode_name_lesser_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[%r%s%] parameter may be specified multiple times to customize the delimit behavior.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit_s, context.set.notable, 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_embedded_list_read_long_delimit_s, context.set.notable, f_string_eol_s);
- fl_print_format(" The %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit_s, context.set.notable);
- fl_print_format(" values %[%s%]", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_none_s, context.set.notable);
- fl_print_format(" and %[%s%],", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_all_s, context.set.notable);
+ fl_print_format(" The %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit_s, context.set.notable);
+ fl_print_format(" values %[%r%]", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_none_s, context.set.notable);
+ fl_print_format(" and %[%r%],", file.stream, context.set.notable, fss_embedded_list_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%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_columns_s, context.set.notable);
- fl_print_format(" and %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, context.set.notable);
+ fl_print_format(" The parameters %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_columns_s, context.set.notable);
+ fl_print_format(" and %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select_s, context.set.notable);
fl_print_format(" refer to a Content column.%r", file.stream, f_string_eol_s);
fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%r", file.stream, f_string_eol_s);
fl_print_format(" This is not to be confused with a depth.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_embedded_list_read_common_
- #define fss_embedded_list_read_common_allocation_large_d 256
- #define fss_embedded_list_read_common_allocation_small_d 16
+ #define fss_embedded_list_read_common_allocation_large_d 2048
+ #define fss_embedded_list_read_common_allocation_small_d 128
#endif // _di_fss_embedded_list_read_common_
/**
void fss_embedded_list_read_print_object_end(fss_embedded_list_read_main_t * const main) {
if (main->parameters.array[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_embedded_list_read_pipe_content_start_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_embedded_list_read_pipe_content_start_s, main->output.to.stream);
}
else {
if (main->parameters.array[fss_embedded_list_read_parameter_object_e].result == f_console_result_found_e && main->parameters.array[fss_embedded_list_read_parameter_content_e].result == f_console_result_found_e) {
- f_print_character(f_fss_embedded_list_open_s.string[0], main->output.to.stream);
- f_print_character(f_fss_embedded_list_open_end_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_embedded_list_open_s, main->output.to.stream);
+ f_print_dynamic_raw(f_fss_embedded_list_open_end_s, main->output.to.stream);
}
else {
- f_print_character(f_fss_eol_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_eol_s, main->output.to.stream);
}
}
}
void fss_embedded_list_read_print_content_ignore(fss_embedded_list_read_main_t * const main) {
if (main->parameters.array[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_embedded_list_read_pipe_content_ignore_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_embedded_list_read_pipe_content_ignore_s, main->output.to.stream);
}
}
#endif // _di_fss_embedded_list_read_print_content_ignore_
void fss_embedded_list_read_print_set_end(fss_embedded_list_read_main_t * const main) {
if (main->parameters.array[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_embedded_list_read_pipe_content_end_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_embedded_list_read_pipe_content_end_s, main->output.to.stream);
}
else {
if (main->parameters.array[fss_embedded_list_read_parameter_object_e].result == f_console_result_found_e && main->parameters.array[fss_embedded_list_read_parameter_content_e].result == f_console_result_found_e) {
- f_print_character(f_fss_embedded_list_close_s.string[0], main->output.to.stream);
- f_print_character(f_fss_embedded_list_close_end_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_embedded_list_close_s, main->output.to.stream);
+ f_print_dynamic_raw(f_fss_embedded_list_close_end_s, main->output.to.stream);
}
else {
- f_print_character(f_fss_eol_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_eol_s, main->output.to.stream);
}
}
}
fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%r", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s);
fl_print_format(" The end of the pipe represents the end of any Object or Content.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The FSS-0008 (Embedded List) specification does not support quoted names, therefore the parameters '%[%r%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_single_s, context.set.notable);
- fl_print_format(" and '%[%r%s%]' do nothing.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_double_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The FSS-0008 (Embedded List) specification does not support quoted names, therefore the parameters '%[%r%r%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_single_s, context.set.notable);
+ fl_print_format(" and '%[%r%r%]' do nothing.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_double_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter '%[%r%s%]' designates to not escape any valid nested Object or Content within some Content.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_ignore_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" The parameter '%[%r%r%]' designates to not escape any valid nested Object or Content within some Content.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_ignore_s, context.set.notable, f_string_eol_s);
fl_print_format(" This parameter requires two values.%r", file.stream, f_string_eol_s);
fl_print_format(" This parameter is not used for ignoring anything from the input pipe.%r", file.stream, f_string_eol_s);
- fl_print_format(" This parameter must be specified after a '%[%r%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, context.set.notable);
- fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%r%s%]' parameter.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" This parameter must be specified after a '%[%r%r%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, context.set.notable);
+ fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%r%r%]' parameter.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content_s, context.set.notable, f_string_eol_s, f_string_eol_s);
funlockfile(file.stream);
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_embedded_list_write_common_
- #define fss_embedded_list_write_common_allocation_large_d 256
- #define fss_embedded_list_write_common_allocation_small_d 16
+ #define fss_embedded_list_write_common_allocation_large_d 2048
+ #define fss_embedded_list_write_common_allocation_small_d 128
#endif // _di_fss_embedded_list_write_common_
/**
const f_string_static_t fss_extended_list_read_long_trim_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_trim_s, 0, FSS_EXTENDED_LIST_READ_long_trim_s_length);
#endif // _di_fss_extended_list_read_parameters_
+#ifndef _di_fss_extended_list_read_delimit_mode_
+ const f_string_static_t fss_extended_list_read_delimit_mode_name_none_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_delimit_mode_name_none_s, 0, FSS_EXTENDED_LIST_READ_delimit_mode_name_none_s_length);
+ const f_string_static_t fss_extended_list_read_delimit_mode_name_all_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_delimit_mode_name_all_s, 0, FSS_EXTENDED_LIST_READ_delimit_mode_name_all_s_length);
+ const f_string_static_t fss_extended_list_read_delimit_mode_name_object_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_delimit_mode_name_object_s, 0, FSS_EXTENDED_LIST_READ_delimit_mode_name_object_s_length);
+ const f_string_static_t fss_extended_list_read_delimit_mode_name_greater_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_delimit_mode_name_greater_s, 0, FSS_EXTENDED_LIST_READ_delimit_mode_name_greater_s_length);
+ const f_string_static_t fss_extended_list_read_delimit_mode_name_lesser_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_delimit_mode_name_lesser_s, 0, FSS_EXTENDED_LIST_READ_delimit_mode_name_lesser_s_length);
+#endif // _di_fss_extended_list_read_delimit_mode_
+
#ifndef _di_fss_extended_list_read_main_delete_
f_status_t fss_extended_list_read_main_delete(fll_program_data_t *main) {
* - object: Objects arre to have delimits applied.
*/
#ifndef _di_fss_extended_list_read_delimit_mode_
- #define fss_extended_list_read_delimit_mode_name_none_s "none"
- #define fss_extended_list_read_delimit_mode_name_all_s "all"
- #define fss_extended_list_read_delimit_mode_name_object_s "object"
- #define fss_extended_list_read_delimit_mode_name_greater_s "+"
- #define fss_extended_list_read_delimit_mode_name_lesser_s "-"
-
- #define fss_extended_list_read_delimit_mode_name_none_s_length 4
- #define fss_extended_list_read_delimit_mode_name_all_s_length 3
- #define fss_extended_list_read_delimit_mode_name_object_s_length 6
- #define fss_extended_list_read_delimit_mode_name_greater_s_length 1
- #define fss_extended_list_read_delimit_mode_name_lesser_s_length 1
+ #define FSS_EXTENDED_LIST_READ_delimit_mode_name_none_s "none"
+ #define FSS_EXTENDED_LIST_READ_delimit_mode_name_all_s "all"
+ #define FSS_EXTENDED_LIST_READ_delimit_mode_name_object_s "object"
+ #define FSS_EXTENDED_LIST_READ_delimit_mode_name_greater_s "+"
+ #define FSS_EXTENDED_LIST_READ_delimit_mode_name_lesser_s "-"
+
+ #define FSS_EXTENDED_LIST_READ_delimit_mode_name_none_s_length 4
+ #define FSS_EXTENDED_LIST_READ_delimit_mode_name_all_s_length 3
+ #define FSS_EXTENDED_LIST_READ_delimit_mode_name_object_s_length 6
+ #define FSS_EXTENDED_LIST_READ_delimit_mode_name_greater_s_length 1
+ #define FSS_EXTENDED_LIST_READ_delimit_mode_name_lesser_s_length 1
+
+ extern const f_string_static_t fss_extended_list_read_delimit_mode_name_none_s;
+ extern const f_string_static_t fss_extended_list_read_delimit_mode_name_all_s;
+ extern const f_string_static_t fss_extended_list_read_delimit_mode_name_object_s;
+ extern const f_string_static_t fss_extended_list_read_delimit_mode_name_greater_s;
+ extern const f_string_static_t fss_extended_list_read_delimit_mode_name_lesser_s;
enum {
fss_extended_list_read_delimit_mode_none_e = 1,
fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%r", file.stream, f_string_eol_s);
fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When using the %[%r%s%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When using the %[%r%r%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%r", file.stream, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%r", file.stream, f_string_eol_s);
fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" Specify both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_object_s, context.set.notable);
- fl_print_format(" and the %[%r%s%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" Specify both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_object_s, context.set.notable);
+ fl_print_format(" and the %[%r%r%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at_s, context.set.notable);
- fl_print_format(" and %[%r%s%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name_s, context.set.notable);
- fl_print_format(" the %[%r%s%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at_s, context.set.notable);
- fl_print_format(" %[%r%s%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at_s, context.set.notable);
+ fl_print_format(" and %[%r%r%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name_s, context.set.notable);
+ fl_print_format(" the %[%r%r%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at_s, context.set.notable);
+ fl_print_format(" %[%r%r%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" This program may support parameters, such as %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, context.set.notable);
- fl_print_format(" or %[%r%s%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" This program may support parameters, such as %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, context.set.notable);
+ fl_print_format(" or %[%r%r%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select_s, context.set.notable, f_string_eol_s);
fl_print_format(" This is done to help ensure consistency for scripting.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" For parameters like %[%s%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth_s, context.set.notable);
fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%r", file.stream, f_string_eol_s);
- fl_print_format(" For parameters like %[%r%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select_s, context.set.notable);
fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_trim_s, context.set.notable);
+ fl_print_format(" The parameter %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_trim_s, context.set.notable);
fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When specifying both the %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_object_s, context.set.notable);
- fl_print_format(" parameter and the %[%r%s%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_content_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When specifying both the %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_object_s, context.set.notable);
+ fl_print_format(" parameter and the %[%r%r%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_content_s, context.set.notable, f_string_eol_s);
fl_print_format(" Both the Object and Content printed are already escaped.%r", file.stream, f_string_eol_s);
fl_print_format(" Both the Object and Content are separated by an EOL.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] accepts the following:%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: Do not apply delimits.%r", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_none_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: (default) Apply all delimits.%r", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_all_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: Apply delimits for Objects.%r", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_object_s, context.set.notable, 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_list_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_list_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_list_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_list_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 %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%r", file.stream, context.set.notable, fss_extended_list_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 %[%s%]: (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_list_read_delimit_mode_name_lesser_s, 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_list_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_list_read_delimit_mode_name_lesser_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[%s%s%] 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_list_read_long_delimit_s, context.set.notable, 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_list_read_long_delimit_s, context.set.notable, f_string_eol_s);
- fl_print_format(" The %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit_s, context.set.notable);
- fl_print_format(" values %[%s%]", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_none_s, context.set.notable);
- fl_print_format(" and %[%s%],", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_all_s, context.set.notable);
+ fl_print_format(" The %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit_s, context.set.notable);
+ fl_print_format(" values %[%r%]", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_none_s, context.set.notable);
+ fl_print_format(" and %[%r%],", file.stream, context.set.notable, fss_extended_list_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%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_columns_s, context.set.notable);
- fl_print_format(" and %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select_s, context.set.notable);
+ fl_print_format(" The parameters %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_columns_s, context.set.notable);
+ fl_print_format(" and %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select_s, context.set.notable);
fl_print_format(" refer to a Content column.%r", file.stream, f_string_eol_s);
fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%r", file.stream, f_string_eol_s);
fl_print_format(" This is not to be confused with a depth.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
}
if (size_file) {
- status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
-
- if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
-
- break;
- }
+ file.size_read = size_file + 1;
status = f_file_stream_read(file, &data.buffer);
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_extended_list_read_common_
- #define fss_extended_list_read_common_allocation_large_d 256
- #define fss_extended_list_read_common_allocation_small_d 16
+ #define fss_extended_list_read_common_allocation_large_d 2048
+ #define fss_extended_list_read_common_allocation_small_d 128
#endif // _di_fss_extended_list_read_common_
/**
/**
* A structure for designating where within the buffer a particular file exists, using a statically allocated array.
*
- * name: The name of the file representing the range. Set string to NULL to represent the STDIN pipe.
+ * name: The name of the file representing the range.
* range: A range within the buffer representing the file.
*/
#ifndef _di_fss_extended_list_read_file_t_
typedef struct {
- f_string_t name;
+ f_string_static_t name;
f_string_range_t range;
} fss_extended_list_read_file_t;
#define fss_extended_list_read_file_t_initialize \
{ \
- f_string_t_initialize, \
+ f_string_static_t_initialize, \
f_string_range_t_initialize, \
}
#endif // _di_fss_extended_list_read_file_t_
void fss_extended_list_read_print_content_ignore(fll_program_data_t * const main) {
if (main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_extended_list_read_pipe_content_ignore, main->output.to.stream);
+ f_print_dynamic_raw(fss_extended_list_read_pipe_content_ignore, main->output.to.stream);
}
}
#endif // _di_fss_extended_list_read_print_content_ignore_
void fss_extended_list_read_print_object_end(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
if (main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_extended_list_read_pipe_content_start, main->output.to.stream);
+ f_print_dynamic_raw(fss_extended_list_read_pipe_content_start, main->output.to.stream);
}
else {
if ((data->option & fss_extended_list_read_data_option_object_d) && (data->option & fss_extended_list_read_data_option_content_d)) {
- f_print_character(f_fss_extended_list_open_s.string[0], main->output.to.stream);
- f_print_character(f_fss_extended_list_open_end_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_extended_list_open_s, main->output.to.stream);
+ f_print_dynamic_raw(f_fss_extended_list_open_end_s, main->output.to.stream);
}
}
}
else {
if (data->option & fss_extended_list_read_data_option_object_d) {
if (data->option & fss_extended_list_read_data_option_content_d) {
- f_print_character(f_fss_extended_list_close_s.string[0], main->output.to.stream);
- f_print_character(f_fss_extended_list_close_end_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_extended_list_close_s, main->output.to.stream);
+ f_print_dynamic_raw(f_fss_extended_list_close_end_s, main->output.to.stream);
}
else if (!(data->option & fss_extended_list_read_data_option_content_d)) {
- f_print_character(f_fss_eol_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_eol_s, main->output.to.stream);
}
}
}
#ifndef _di_fss_extended_list_read_print_one_
void fss_extended_list_read_print_one(fll_program_data_t * const main) {
- f_print_character(f_string_ascii_1_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_string_ascii_1_s, main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
}
#endif // _di_fss_extended_list_read_print_one_
#ifndef _di_fss_extended_list_read_print_zero_
void fss_extended_list_read_print_zero(fll_program_data_t * const main) {
- f_print_character(f_string_ascii_0_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_string_ascii_0_s, main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
}
#endif // _di_fss_extended_list_read_print_zero_
#endif // _di_fss_extended_list_read_depth_process_
#ifndef _di_fss_extended_list_read_file_identify_
- f_string_t fss_extended_list_read_file_identify(const f_array_length_t at, const fss_extended_list_read_files_t files) {
+ f_string_static_t fss_extended_list_read_file_identify(const f_array_length_t at, const fss_extended_list_read_files_t files) {
for (f_array_length_t i = 0; i < files.used; ++i) {
return files.array[files.used - 1].name;
}
- return "";
+ return f_string_empty_s;
}
#endif // _di_fss_extended_list_read_file_identify_
fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%r", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s);
fl_print_format(" The end of the pipe represents the end of any Object or Content.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The FSS-0003 (Extended List) specification does not support quoted names, therefore the parameters '%[%r%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_single_s, context.set.notable);
- fl_print_format(" and '%[%r%s%]' do nothing.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_double_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The FSS-0003 (Extended List) specification does not support quoted names, therefore the parameters '%[%r%r%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_single_s, context.set.notable);
+ fl_print_format(" and '%[%r%r%]' do nothing.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_double_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter '%[%r%s%]' designates to not escape any valid nested Object or Content within some Content.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_ignore_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" The parameter '%[%r%r%]' designates to not escape any valid nested Object or Content within some Content.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_ignore_s, context.set.notable, f_string_eol_s);
fl_print_format(" This parameter requires two values.%r", file.stream, f_string_eol_s);
fl_print_format(" This parameter is not used for ignoring anything from the input pipe.%r", file.stream, f_string_eol_s);
- fl_print_format(" This parameter must be specified after a '%[%r%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, context.set.notable);
- fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%r%s%]' parameter.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" This parameter must be specified after a '%[%r%r%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, context.set.notable);
+ fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%r%r%]' parameter.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content_s, context.set.notable, f_string_eol_s, f_string_eol_s);
funlockfile(file.stream);
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_extended_list_write_common_
- #define fss_extended_list_write_common_allocation_large_d 256
- #define fss_extended_list_write_common_allocation_small_d 16
+ #define fss_extended_list_write_common_allocation_large_d 2048
+ #define fss_extended_list_write_common_allocation_small_d 128
#endif // _di_fss_extended_list_write_common_
/**
const f_string_static_t fss_extended_read_long_trim_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_trim_s, 0, FSS_EXTENDED_READ_long_trim_s_length);
#endif // _di_fss_extended_read_parameters_
+#ifndef _di_fss_extended_read_delimit_mode_
+ const f_string_static_t fss_extended_read_delimit_mode_name_none_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_delimit_mode_name_none_s, 0, FSS_EXTENDED_READ_delimit_mode_name_none_s_length);
+ const f_string_static_t fss_extended_read_delimit_mode_name_all_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_delimit_mode_name_all_s, 0, FSS_EXTENDED_READ_delimit_mode_name_all_s_length);
+ const f_string_static_t fss_extended_read_delimit_mode_name_object_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_delimit_mode_name_object_s, 0, FSS_EXTENDED_READ_delimit_mode_name_object_s_length);
+ const f_string_static_t fss_extended_read_delimit_mode_name_greater_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_delimit_mode_name_greater_s, 0, FSS_EXTENDED_READ_delimit_mode_name_greater_s_length);
+ const f_string_static_t fss_extended_read_delimit_mode_name_lesser_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_delimit_mode_name_lesser_s, 0, FSS_EXTENDED_READ_delimit_mode_name_lesser_s_length);
+#endif // _di_fss_extended_read_delimit_mode_
+
#ifndef _di_fss_extended_read_main_delete_
f_status_t fss_extended_read_main_delete(fll_program_data_t * const main) {
* - 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 "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
+
+ 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;
+ extern const f_string_static_t fss_extended_read_delimit_mode_name_object_s;
+ extern const f_string_static_t fss_extended_read_delimit_mode_name_greater_s;
+ extern const f_string_static_t fss_extended_read_delimit_mode_name_lesser_s;
enum {
fss_extended_read_delimit_mode_none_e = 1,
fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%r", file.stream, f_string_eol_s);
fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When using the %[%r%s%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When using the %[%r%r%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%r", file.stream, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%r", file.stream, f_string_eol_s);
fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" Specify both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_object_s, context.set.notable);
- fl_print_format(" and the %[%r%s%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" Specify both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_object_s, context.set.notable);
+ fl_print_format(" and the %[%r%r%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at_s, context.set.notable);
- fl_print_format(" and %[%r%s%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name_s, context.set.notable);
- fl_print_format(" the %[%r%s%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at_s, context.set.notable);
- fl_print_format(" %[%r%s%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at_s, context.set.notable);
+ fl_print_format(" and %[%r%r%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name_s, context.set.notable);
+ fl_print_format(" the %[%r%r%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at_s, context.set.notable);
+ fl_print_format(" %[%r%r%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" This program may support parameters, such as %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, context.set.notable);
- fl_print_format(" or %[%r%s%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" This program may support parameters, such as %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, context.set.notable);
+ fl_print_format(" or %[%r%r%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select_s, context.set.notable, f_string_eol_s);
fl_print_format(" This is done to help ensure consistency for scripting.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" For parameters like %[%r%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth_s, context.set.notable);
fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%r", file.stream, f_string_eol_s);
- fl_print_format(" For parameters like %[%r%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select_s, context.set.notable);
fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_trim_s, context.set.notable);
+ fl_print_format(" The parameter %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_trim_s, context.set.notable);
fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When specifying both the %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_object_s, context.set.notable);
- fl_print_format(" parameter and the %[%r%s%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_content_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When specifying both the %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_object_s, context.set.notable);
+ fl_print_format(" parameter and the %[%r%r%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_content_s, context.set.notable, f_string_eol_s);
fl_print_format(" Both the Object and Content printed are already escaped.%r", file.stream, f_string_eol_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%s%] 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(" - %[%s%]: 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(" - %[%s%]: (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(" - %[%s%]: 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(" 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(" - 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 %[%s%]: (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 %[%s%]: (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, 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(" The %[%r%s%] 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%] 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%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit_s, context.set.notable);
- fl_print_format(" values %[%s%]", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_none, context.set.notable);
- fl_print_format(" and %[%s%],", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_all, context.set.notable);
+ 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(" overrule all other delimit values.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameters %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_columns_s, context.set.notable);
- fl_print_format(" and %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select_s, context.set.notable);
+ 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);
+ fl_print_format(" and %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select_s, context.set.notable);
fl_print_format(" refer to a Content column.%r", file.stream, f_string_eol_s);
fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%r", file.stream, f_string_eol_s);
fl_print_format(" This is not to be confused with a depth.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
}
if (size_file) {
- status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
-
- if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
-
- break;
- }
+ file.size_read = size_file + 1;
status = f_file_stream_read(file, &data.buffer);
int main(const int argc, const f_string_t *argv) {
f_console_arguments_t arguments = { argc, argv };
- fll_program_data_t data = fss_extended_read_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_extended_read_common_
- #define fss_extended_read_common_allocation_large_d 256
- #define fss_extended_read_common_allocation_small_d 16
+ #define fss_extended_read_common_allocation_large_d 2048
+ #define fss_extended_read_common_allocation_small_d 128
#endif // _di_fss_extended_read_common_
/**
/**
* A structure for designating where within the buffer a particular file exists, using a statically allocated array.
*
- * name: The name of the file representing the range. Set string to NULL to represent the STDIN pipe.
+ * name: The name of the file representing the range.
* range: A range within the buffer representing the file.
*/
#ifndef _di_fss_extended_read_file_t_
typedef struct {
- f_string_t name;
+ f_string_static_t name;
f_string_range_t range;
} fss_extended_read_file_t;
#define fss_extended_read_file_t_initialize \
{ \
- f_string_t_initialize, \
+ f_string_static_t_initialize, \
f_string_range_t_initialize, \
}
#endif // _di_fss_extended_read_file_t_
if (data->option & fss_extended_read_data_option_object_d) {
if (data->option & fss_extended_read_data_option_trim_d) {
if ((data->option & fss_extended_read_data_option_raw_d) && data->quotes_object.array[at]) {
- f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream);
if ((data->option & fss_extended_read_data_option_raw_d) && data->quotes_object.array[at]) {
- f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
}
else {
if ((data->option & fss_extended_read_data_option_raw_d) && data->quotes_object.array[at]) {
- f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream);
if ((data->option & fss_extended_read_data_option_raw_d) && data->quotes_object.array[at]) {
- f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
}
content_printed = F_true;
if ((data->option & fss_extended_read_data_option_raw_d) && data->quotes_content.array[at].array[data->select]) {
- f_print_character_safely(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[data->select], delimits_content, main->output.to.stream);
if ((data->option & fss_extended_read_data_option_raw_d) && data->quotes_content.array[at].array[data->select]) {
- f_print_character_safely(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
}
}
content_printed = F_true;
if ((data->option & fss_extended_read_data_option_raw_d) && data->quotes_content.array[at].array[i]) {
- f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[i], delimits_content, main->output.to.stream);
if ((data->option & fss_extended_read_data_option_raw_d) && data->quotes_content.array[at].array[i]) {
- f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
if (i + 1 < data->contents.array[at].used && data->contents.array[at].array[i + 1].start <= data->contents.array[at].array[i + 1].stop) {
void fss_extended_read_print_content_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_extended_read_pipe_content_start_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_extended_read_pipe_content_start_s, main->output.to.stream);
}
else {
- f_print_character(f_fss_space_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_space_s, main->output.to.stream);
}
}
#endif // _di_fss_extended_read_print_content_end_
void fss_extended_read_print_object_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_extended_read_pipe_content_end_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_extended_read_pipe_content_end_s, main->output.to.stream);
}
else {
- f_print_character(f_fss_space_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_space_s, main->output.to.stream);
}
}
#endif // _di_fss_extended_read_print_object_end_
#ifndef _di_fss_extended_read_print_one_
void fss_extended_read_print_one(fll_program_data_t * const main) {
- f_print_character(f_string_ascii_1_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_string_ascii_1_s, main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
}
#endif // _di_fss_extended_read_print_one_
void fss_extended_read_print_set_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_extended_read_pipe_content_end_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_extended_read_pipe_content_end_s, main->output.to.stream);
}
else {
- f_print_character(f_fss_eol_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_fss_eol_s, main->output.to.stream);
}
}
#endif // _di_fss_extended_read_print_set_end_
#ifndef _di_fss_extended_read_print_zero_
void fss_extended_read_print_zero(fll_program_data_t * const main) {
- f_print_character(f_string_ascii_0_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(f_string_ascii_0_s, main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
}
#endif // _di_fss_extended_read_print_zero_
#endif // _di_fss_extended_read_depth_process_
#ifndef _di_fss_extended_read_file_identify_
- f_string_t fss_extended_read_file_identify(const f_array_length_t at, const fss_extended_read_files_t files) {
+ f_string_static_t fss_extended_read_file_identify(const f_array_length_t at, const fss_extended_read_files_t files) {
for (f_array_length_t i = 0; i < files.used; ++i) {
return files.array[files.used - 1].name;
}
- return "";
+ return f_string_empty_s;
}
#endif // _di_fss_extended_read_file_identify_
fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%r", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s);
fl_print_format(" The end of the pipe represents the end of any Object or Content.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The FSS-0001 (Extended) specification does not support multi-line Content, therefore the parameter '%[%r%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend_s, context.set.notable);
+ fl_print_format(" The FSS-0001 (Extended) specification does not support multi-line Content, therefore the parameter '%[%r%r%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend_s, context.set.notable);
fl_print_format(" does nothing.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" This program does not use the parameter '%[%r%s%]', which therefore does nothing.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_write_long_ignore_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_write_long_ignore_s, context.set.notable, f_string_eol_s);
fl_print_format(" This parameter requires two values.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
funlockfile(file.stream);
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_extended_write_common_
- #define fss_extended_write_common_allocation_large_d 256
- #define fss_extended_write_common_allocation_small_d 16
+ #define fss_extended_write_common_allocation_large_d 2048
+ #define fss_extended_write_common_allocation_small_d 128
#endif // _di_fss_extended_write_common_
/**
fll_program_print_help_usage(file, context, fss_identify_program_name_s, fll_program_parameter_filenames_s);
- fl_print_format(" The %[%r%s%] parameter refers to the file lines and not the lines in a given file.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_line_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The %[%r%r%] parameter refers to the file lines and not the lines in a given file.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_line_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" If neither the %[%r%s%] nor", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_object_s, context.set.notable);
- fl_print_format(" %[%r%s%] are specified, then the default behavior is to print both.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_content_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" If neither the %[%r%r%] nor", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_object_s, context.set.notable);
+ fl_print_format(" %[%r%r%] are specified, then the default behavior is to print both.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_content_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When specifying the %[%r%s%] parameter, neither the", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_total_s, context.set.notable);
- fl_print_format(" %[%r%s%] nor the", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_object_s, context.set.notable);
- fl_print_format(" %[%r%s%] parameter may be specified.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_content_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When specifying the %[%r%r%] parameter, neither the", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_total_s, context.set.notable);
+ fl_print_format(" %[%r%r%] nor the", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_object_s, context.set.notable);
+ fl_print_format(" %[%r%r%] parameter may be specified.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_content_s, context.set.notable, f_string_eol_s, f_string_eol_s);
fl_print_format(" An FSS file is identified by the following format: '%[# Object-Content%]'", file.stream, context.set.notable, context.set.notable);
fl_print_format(" where the Object, is a machine-name representing the name and may only consist of \"word\" characters and the Content is a 4-digit hexidecimal number representing a particular variant of the Object.%r", file.stream, f_string_eol_s);
const f_string_static_t fss_payload_read_long_trim_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_trim_s, 0, FSS_PAYLOAD_READ_long_trim_s_length);
#endif // _di_fss_payload_read_parameters_
+#ifndef _di_fss_payload_read_delimit_mode_
+ const f_string_static_t fss_payload_read_delimit_mode_name_none_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_delimit_mode_name_none_s, 0, FSS_PAYLOAD_READ_delimit_mode_name_none_s_length);
+ const f_string_static_t fss_payload_read_delimit_mode_name_all_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_delimit_mode_name_all_s, 0, FSS_PAYLOAD_READ_delimit_mode_name_all_s_length);
+ const f_string_static_t fss_payload_read_delimit_mode_name_object_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_delimit_mode_name_object_s, 0, FSS_PAYLOAD_READ_delimit_mode_name_object_s_length);
+ const f_string_static_t fss_payload_read_delimit_mode_name_greater_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_delimit_mode_name_greater_s, 0, FSS_PAYLOAD_READ_delimit_mode_name_greater_s_length);
+ const f_string_static_t fss_payload_read_delimit_mode_name_lesser_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_delimit_mode_name_lesser_s, 0, FSS_PAYLOAD_READ_delimit_mode_name_lesser_s_length);
+#endif // _di_fss_payload_read_delimit_mode_
+
#ifndef _di_fss_payload_read_main_delete_
f_status_t fss_payload_read_main_delete(fll_program_data_t * const main) {
* - object: Objects arre to have delimits applied.
*/
#ifndef _di_fss_payload_read_delimit_mode_
- #define fss_payload_read_delimit_mode_name_none_s "none"
- #define fss_payload_read_delimit_mode_name_all_s "all"
- #define fss_payload_read_delimit_mode_name_object_s "object"
- #define fss_payload_read_delimit_mode_name_greater_s "+"
- #define fss_payload_read_delimit_mode_name_lesser_s "-"
-
- #define fss_payload_read_delimit_mode_name_none_s_length 4
- #define fss_payload_read_delimit_mode_name_all_s_length 3
- #define fss_payload_read_delimit_mode_name_object_s_length 6
- #define fss_payload_read_delimit_mode_name_greater_s_length 1
- #define fss_payload_read_delimit_mode_name_lesser_s_length 1
+ #define FSS_PAYLOAD_READ_delimit_mode_name_none_s "none"
+ #define FSS_PAYLOAD_READ_delimit_mode_name_all_s "all"
+ #define FSS_PAYLOAD_READ_delimit_mode_name_object_s "object"
+ #define FSS_PAYLOAD_READ_delimit_mode_name_greater_s "+"
+ #define FSS_PAYLOAD_READ_delimit_mode_name_lesser_s "-"
+
+ #define FSS_PAYLOAD_READ_delimit_mode_name_none_s_length 4
+ #define FSS_PAYLOAD_READ_delimit_mode_name_all_s_length 3
+ #define FSS_PAYLOAD_READ_delimit_mode_name_object_s_length 6
+ #define FSS_PAYLOAD_READ_delimit_mode_name_greater_s_length 1
+ #define FSS_PAYLOAD_READ_delimit_mode_name_lesser_s_length 1
+
+ extern const f_string_static_t fss_payload_read_delimit_mode_name_none_s;
+ extern const f_string_static_t fss_payload_read_delimit_mode_name_all_s;
+ extern const f_string_static_t fss_payload_read_delimit_mode_name_object_s;
+ extern const f_string_static_t fss_payload_read_delimit_mode_name_greater_s;
+ extern const f_string_static_t fss_payload_read_delimit_mode_name_lesser_s;
enum {
fss_payload_read_delimit_mode_none_e = 1,
fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%r", file.stream, f_string_eol_s);
fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When using the %[%r%s%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When using the %[%r%r%] option, an order of operations is enforced on the parameters.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%r", file.stream, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_at_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable, f_string_eol_s);
- fl_print_format(" %[%r%s%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object index at the specified depth.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_at_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: A new depth within the specified depth, indexed from the root.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" %[%r%r%]: An Object name at the specified depth.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] must be in numeric order, but values in between may be skipped.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable, f_string_eol_s);
fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%r", file.stream, f_string_eol_s);
fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The parameter %[%r%r%] selects a Content column.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_select_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" Specify both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_object_s, context.set.notable);
- fl_print_format(" and the %[%r%s%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" Specify both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_object_s, context.set.notable);
+ fl_print_format(" and the %[%r%r%] parameters to get the total objects.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_total_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When both %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_at_s, context.set.notable);
- fl_print_format(" and %[%r%s%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_name_s, context.set.notable);
- fl_print_format(" the %[%r%s%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_at_s, context.set.notable);
- fl_print_format(" %[%r%s%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When both %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_at_s, context.set.notable);
+ fl_print_format(" and %[%r%r%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_name_s, context.set.notable);
+ fl_print_format(" the %[%r%r%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_at_s, context.set.notable);
+ fl_print_format(" %[%r%r%] parameter value.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_name_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" This program may support parameters, such as %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable);
- fl_print_format(" or %[%r%s%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_select_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" This program may support parameters, such as %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable);
+ fl_print_format(" or %[%r%r%], even if not supported by the standard.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_select_s, context.set.notable, f_string_eol_s);
fl_print_format(" This is done to help ensure consistency for scripting.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" For parameters like %[%r%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable);
fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%r", file.stream, f_string_eol_s);
- fl_print_format(" For parameters like %[%r%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_select_s, context.set.notable);
+ fl_print_format(" For parameters like %[%r%r%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_select_s, context.set.notable);
fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_trim_s, context.set.notable);
+ fl_print_format(" The parameter %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_trim_s, context.set.notable);
fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When specifying both the %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_object_s, context.set.notable);
- fl_print_format(" parameter and the %[%r%s%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_content_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When specifying both the %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_object_s, context.set.notable);
+ fl_print_format(" parameter and the %[%r%r%] parameter, the entire Object and Content are printed, including the formatting.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_content_s, context.set.notable, f_string_eol_s);
fl_print_format(" Both the Object and Content printed are already escaped.%r", file.stream, f_string_eol_s);
fl_print_format(" Both the Object and Content are separated by an EOL.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The parameter %[%r%s%] accepts the following:%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_delimit_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: Do not apply delimits.%r", file.stream, context.set.notable, fss_payload_read_delimit_mode_name_none_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: (default) Apply all delimits.%r", file.stream, context.set.notable, fss_payload_read_delimit_mode_name_all_s, context.set.notable, f_string_eol_s);
- fl_print_format(" - %[%s%]: Apply delimits for Objects.%r", file.stream, context.set.notable, fss_payload_read_delimit_mode_name_object_s, context.set.notable, 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_payload_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_payload_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_payload_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_payload_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 %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%r", file.stream, context.set.notable, fss_payload_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 %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%r%r", file.stream, context.set.notable, fss_payload_read_delimit_mode_name_lesser_s, 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_payload_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_payload_read_delimit_mode_name_lesser_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The %[%r%s%] parameter may be specified multiple times to customize the delimit behavior.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_delimit_s, context.set.notable, 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_payload_read_long_delimit_s, context.set.notable, f_string_eol_s);
- fl_print_format(" The %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_delimit_s, context.set.notable);
- fl_print_format(" values %[%s%]", file.stream, context.set.notable, fss_payload_read_delimit_mode_name_none_s, context.set.notable);
- fl_print_format(" and %[%s%],", file.stream, context.set.notable, fss_payload_read_delimit_mode_name_all_s, context.set.notable);
+ fl_print_format(" The %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_delimit_s, context.set.notable);
+ fl_print_format(" values %[%r%]", file.stream, context.set.notable, fss_payload_read_delimit_mode_name_none_s, context.set.notable);
+ fl_print_format(" and %[%r%],", file.stream, context.set.notable, fss_payload_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%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_columns_s, context.set.notable);
- fl_print_format(" and %[%r%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_select_s, context.set.notable);
+ fl_print_format(" The parameters %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_columns_s, context.set.notable);
+ fl_print_format(" and %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_select_s, context.set.notable);
fl_print_format(" refer to a Content column.%r", file.stream, f_string_eol_s);
fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%r", file.stream, f_string_eol_s);
fl_print_format(" This is not to be confused with a depth.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" As an exceptional case, a %[%r%s%] of", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable);
+ fl_print_format(" As an exceptional case, a %[%r%r%] of", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_depth_s, context.set.notable);
fl_print_format(" %[1%] applies only to the explicit Object of", file.stream, context.set.notable, context.set.notable);
fl_print_format(" '%[%r%]'.%r", file.stream, context.set.notable, f_fss_string_header_s, context.set.notable, f_string_eol_s);
fl_print_format(" Content at this depth is processed as FSS-0001 Extended.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
fl_print_format(" The Content of the explicit Object of", file.stream);
fl_print_format(" '%[%r%]'", file.stream, context.set.notable, f_fss_string_payload_s, context.set.notable, f_string_eol_s);
fl_print_format(" will not contain any Content close pipe control codes when using", file.stream);
- fl_print_format(" %[%r%s%].%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_pipe_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" %[%r%r%].%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_read_long_pipe_s, context.set.notable, f_string_eol_s, f_string_eol_s);
funlockfile(file.stream);
}
if (size_file) {
- status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
-
- if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
-
- break;
- }
-
+ file.size_read = size_file + 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.
// Guarantee that a newline exists at the end of the buffer.
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_payload_read_common_
- #define fss_payload_common_allocation_large_d 256
- #define fss_payload_read_common_allocation_small_d 16
+ #define fss_payload_read_common_allocation_large_d 2048
+ #define fss_payload_read_common_allocation_small_d 128
#endif // _di_fss_payload_read_common_
/**
/**
* A structure for designating where within the buffer a particular file exists, using a statically allocated array.
*
- * name: The name of the file representing the range. Set string to NULL to represent the STDIN pipe.
+ * name: The name of the file representing the range.
* range: A range within the buffer representing the file.
*/
#ifndef _di_fss_payload_read_file_t_
typedef struct {
- f_string_t name;
+ f_string_static_t name;
f_string_range_t range;
} fss_payload_read_file_t;
#define fss_payload_read_file_t_initialize \
{ \
- f_string_t_initialize, \
+ f_string_static_t_initialize, \
f_string_range_t_initialize, \
}
#endif // _di_fss_payload_read_file_t_
if (data->option & fss_payload_read_data_option_object_d) {
if (data->option & fss_payload_read_data_option_trim_d) {
if ((data->option & fss_payload_read_data_option_raw_d) && data->quotes_object_header.array[at]) {
- f_print_character_safely(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
fl_print_trim_except_dynamic_partial(data->buffer, data->objects_header.array[at], delimits_object, main->output.to.stream);
if ((data->option & fss_payload_read_data_option_raw_d) && data->quotes_object_header.array[at]) {
- f_print_character_safely(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
}
else {
if ((data->option & fss_payload_read_data_option_raw_d) && data->quotes_object_header.array[at]) {
- f_print_character_safely(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
f_print_except_dynamic_partial(data->buffer, data->objects_header.array[at], delimits_object, main->output.to.stream);
if ((data->option & fss_payload_read_data_option_raw_d) && data->quotes_object_header.array[at]) {
- f_print_character_safely(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
}
content_printed = F_true;
if ((data->option & fss_payload_read_data_option_raw_d) && data->quotes_content_header.array[at].array[data->select]) {
- f_print_character_safely(data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
f_print_except_dynamic_partial(data->buffer, data->contents_header.array[at].array[data->select], delimits_content, main->output.to.stream);
if ((data->option & fss_payload_read_data_option_raw_d) && data->quotes_content_header.array[at].array[data->select]) {
- f_print_character_safely(data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
}
}
content_printed = F_true;
if ((data->option & fss_payload_read_data_option_raw_d) && data->quotes_content_header.array[at].array[i]) {
- f_print_character_safely(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
f_print_except_dynamic_partial(data->buffer, data->contents_header.array[at].array[i], delimits_content, main->output.to.stream);
if ((data->option & fss_payload_read_data_option_raw_d) && data->quotes_content_header.array[at].array[i]) {
- f_print_character_safely(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+ f_print_dynamic_raw(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
}
if (i + 1 < data->contents_header.array[at].used && data->contents_header.array[at].array[i + 1].start <= data->contents_header.array[at].array[i + 1].stop) {
void fss_payload_read_print_content_end_extended(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_payload_read_pipe_content_start_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_payload_read_pipe_content_start_s, main->output.to.stream);
}
else {
f_print_dynamic_raw(f_fss_space_s, main->output.to.stream);
void fss_payload_read_print_content_ignore(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_payload_read_pipe_content_ignore_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_payload_read_pipe_content_ignore_s, main->output.to.stream);
}
}
#endif // _di_fss_payload_read_print_content_ignore_
void fss_payload_read_print_object_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_payload_read_pipe_content_start_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_payload_read_pipe_content_start_s, main->output.to.stream);
}
else {
if (main->parameters.array[fss_payload_read_parameter_content_e].result == f_console_result_found_e) {
void fss_payload_read_print_object_end_extended(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_payload_read_pipe_content_end_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_payload_read_pipe_content_end_s, main->output.to.stream);
}
else {
f_print_dynamic_raw(f_fss_space_s, main->output.to.stream);
void fss_payload_read_print_set_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_payload_read_pipe_content_end_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_payload_read_pipe_content_end_s, main->output.to.stream);
}
}
#endif // _di_fss_payload_read_print_set_end_
void fss_payload_read_print_set_end_extended(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
- f_print_character(fss_payload_read_pipe_content_end_s, main->output.to.stream);
+ f_print_dynamic_raw(fss_payload_read_pipe_content_end_s, main->output.to.stream);
}
else {
f_print_dynamic_raw(f_fss_eol_s, main->output.to.stream);
#endif // _di_fss_payload_read_depth_process_
#ifndef _di_fss_payload_read_file_identify_
- f_string_t fss_payload_read_file_identify(const f_array_length_t at, const fss_payload_read_files_t files) {
+ f_string_static_t fss_payload_read_file_identify(const f_array_length_t at, const fss_payload_read_files_t files) {
for (f_array_length_t i = 0; i < files.used; ++i) {
return files.array[files.used - 1].name;
}
- return "";
+ return f_string_empty_s;
}
#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_state_t state = macro_f_state_t_initialize(fss_payload_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+ 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);
data->delimits_object.used = 0;
fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%r", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s);
fl_print_format(" The end of the pipe represents the end of any Object or Content.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" The FSS-000E (Payload) specification does not support quoted names, therefore the parameters '%[%r%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_write_long_single_s, context.set.notable);
- fl_print_format(" and '%[%r%s%]' do nothing.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_write_long_double_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" The FSS-000E (Payload) specification does not support quoted names, therefore the parameters '%[%r%r%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_write_long_single_s, context.set.notable);
+ fl_print_format(" and '%[%r%r%]' do nothing.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_write_long_double_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" This program does not use the parameter '%[%r%s%]', which therefore does nothing.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_write_long_ignore_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" This program does not use the parameter '%[%r%r%]', which therefore does nothing.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_payload_write_long_ignore_s, context.set.notable, f_string_eol_s);
fl_print_format(" This parameter requires two values.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
funlockfile(file.stream);
* - small: An allocation step used for buffers that are anticipated to have small buffers.
*/
#ifndef _di_fss_payload_write_common_
- #define fss_payload_write_common_allocation_large_d 256
- #define fss_payload_write_common_allocation_small_d 16
+ #define fss_payload_write_common_allocation_large_d 2048
+ #define fss_payload_write_common_allocation_small_d 128
#endif // _di_fss_payload_write_common_
/**
if (F_status_is_fine(status) && main->parameters.remaining.used > 0) {
uint16_t signal_check = 0;
- f_array_length_t total = 0;
f_file_t file = f_file_t_initialize;
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
}
macro_f_file_t_reset(file);
- total = 0;
+ file.size_read = 0;
status = f_file_open(argv[main->parameters.remaining.array[i]], 0, &file);
break;
}
- status = f_file_size_by_id(file.id, &total);
+ status = f_file_size_by_id(file.id, &file.size_read);
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_process_s, fll_error_file_type_file_e);
}
// Skip past empty files.
- if (!total) {
+ if (!file.size_read) {
f_file_stream_close(F_true, &file);
continue;
}
- status = f_file_read_until(file, total, &main->buffer);
+ ++file.size_read;
+
+ status = f_file_read(file, &main->buffer);
f_file_stream_close(F_true, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_until", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_process_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_process_s, fll_error_file_type_file_e);
break;
}