Implement a new feature for determining how many columns total are available for some Content.
Update the specifications accordingly.
The term "columns" has been added to designate this concept of the now of column sets within some Content.
Previously, this was weakly named.
The select functionality "--select" allows for selecting these columns but there has been no way to know how many columns exist.
This is not a good design for scripting and similar usage.
By providing a total number of columns, the select function becomes more complete and useful.
When columns is specified without any particular Object specified, then the maximum columns length for all Content is printed.
fll_program_print_help_option(output, context, fss_basic_list_read_short_at, fss_basic_list_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index.");
fll_program_print_help_option(output, context, fss_basic_list_read_short_content, fss_basic_list_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default).");
+ fll_program_print_help_option(output, context, fss_basic_list_read_short_columns, fss_basic_list_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns.");
fll_program_print_help_option(output, context, fss_basic_list_read_short_delimit, fss_basic_list_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits.");
fll_program_print_help_option(output, context, fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth.");
fll_program_print_help_option(output, context, fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing.");
fprintf(output.stream, " The parameter ");
f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_basic_list_read_long_select);
- fprintf(output.stream, " selects a Content index at a given depth.%c", f_string_eol_s[0]);
- fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested Content).%c", f_string_eol_s[0]);
+ fprintf(output.stream, " selects a Content column.%c", f_string_eol_s[0]);
fprintf(output.stream, "%c", f_string_eol_s[0]);
fprintf(output.stream, "%c", f_string_eol_s[0]);
+ fprintf(output.stream, " The parameters ");
+ f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_basic_list_read_long_columns);
+ fprintf(output.stream, " and ");
+ f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_basic_list_read_long_select);
+ fprintf(output.stream, " refer to a Content column.%c", f_string_eol_s[0]);
+ fprintf(output.stream, " The word \"column\" is being loosely defined to refer to a specific Content.%c", f_string_eol_s[0]);
+ fprintf(output.stream, " This is not to be confused with a depth.%c", f_string_eol_s[0]);
+
+ fprintf(output.stream, "%c", f_string_eol_s[0]);
+
return F_none;
}
#endif // _di_fss_basic_list_read_print_help_
} // for
}
+ if (F_status_is_error_not(status) && main->parameters[fss_basic_list_read_parameter_columns].result == f_console_result_found) {
+ const f_array_length_t parameter_code[] = {
+ fss_basic_list_read_parameter_depth,
+ fss_basic_list_read_parameter_line,
+ fss_basic_list_read_parameter_pipe,
+ fss_basic_list_read_parameter_select,
+ fss_basic_list_read_parameter_total,
+ };
+
+ const f_string_t parameter_name[] = {
+ fss_basic_list_read_long_depth,
+ fss_basic_list_read_long_line,
+ fss_basic_list_read_long_pipe,
+ fss_basic_list_read_long_select,
+ fss_basic_list_read_long_total,
+ };
+
+ const uint8_t parameter_match[] = {
+ f_console_result_additional,
+ f_console_result_additional,
+ f_console_result_found,
+ f_console_result_additional,
+ f_console_result_found,
+ };
+
+ for (f_array_length_t i = 0; i < 5; ++i) {
+
+ if (main->parameters[parameter_code[i]].result == parameter_match[i]) {
+ f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the '", fll_error_print_error);
+ f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_basic_list_read_long_columns);
+ f_color_print(main->error.to.stream, main->context.set.error, "' parameter with the '");
+ f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, parameter_name[i]);
+ f_color_print(main->error.to.stream, main->context.set.error, "' parameter.%c", f_string_eol_s[0]);
+
+ status = F_status_set_error(F_parameter);
+ break;
+ }
+ } // for
+ }
+
if (F_status_is_error_not(status) && main->parameters[fss_basic_list_read_parameter_pipe].result == f_console_result_found) {
if (main->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) {
f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the '", fll_error_print_error);
status = F_status_set_error(F_parameter);
}
- else if (main->parameters[fss_basic_list_read_parameter_line].result == f_console_result_found) {
+ else if (main->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) {
f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the '", fll_error_print_error);
f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_basic_list_read_long_pipe);
f_color_print(main->error.to.stream, main->context.set.error, "' parameter with the '");
#define fss_basic_list_read_short_at "a"
#define fss_basic_list_read_short_content "c"
+ #define fss_basic_list_read_short_columns "C"
#define fss_basic_list_read_short_delimit "D"
#define fss_basic_list_read_short_depth "d"
#define fss_basic_list_read_short_empty "e"
#define fss_basic_list_read_long_at "at"
#define fss_basic_list_read_long_content "content"
+ #define fss_basic_list_read_long_columns "columns"
#define fss_basic_list_read_long_delimit "delimit"
#define fss_basic_list_read_long_depth "depth"
#define fss_basic_list_read_long_empty "empty"
fss_basic_list_read_parameter_at,
fss_basic_list_read_parameter_content,
+ fss_basic_list_read_parameter_columns,
fss_basic_list_read_parameter_delimit,
fss_basic_list_read_parameter_depth,
fss_basic_list_read_parameter_empty,
f_console_parameter_t_initialize(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(fss_basic_list_read_short_at, fss_basic_list_read_long_at, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_list_read_short_content, fss_basic_list_read_long_content, 0, 0, f_console_type_normal), \
+ f_console_parameter_t_initialize(fss_basic_list_read_short_columns, fss_basic_list_read_long_columns, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_list_read_short_delimit, fss_basic_list_read_long_delimit, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, 0, 0, f_console_type_normal), \
}
- #define fss_basic_list_read_total_parameters 21
+ #define fss_basic_list_read_total_parameters 22
#endif // _di_fss_basic_list_read_defines_
/**
*
* fss_basic_list_read_data_option_*:
* - at: The object at the given position is being selected (Think of this as select a row for some Object).
+ * - columns: The total columns found and selected is printed instead of the Content.
* - content: The Content is to be printed.
* - empty: Empty Content will be printed (Objects that have no Content will have their empty Content printed).
* - line: A specific Content at a given line is to be selected (Think of this as select a row for some Content).
*/
#ifndef _di_fss_basic_list_read_data_t_
#define fss_basic_list_read_data_option_at 0x1
- #define fss_basic_list_read_data_option_content 0x2
- #define fss_basic_list_read_data_option_empty 0x4
- #define fss_basic_list_read_data_option_line 0x8
- #define fss_basic_list_read_data_option_name 0x10
- #define fss_basic_list_read_data_option_object 0x20
- #define fss_basic_list_read_data_option_select 0x40
- #define fss_basic_list_read_data_option_total 0x80
- #define fss_basic_list_read_data_option_trim 0x100
+ #define fss_basic_list_read_data_option_columns 0x2
+ #define fss_basic_list_read_data_option_content 0x4
+ #define fss_basic_list_read_data_option_empty 0x8
+ #define fss_basic_list_read_data_option_line 0x10
+ #define fss_basic_list_read_data_option_name 0x20
+ #define fss_basic_list_read_data_option_object 0x40
+ #define fss_basic_list_read_data_option_select 0x80
+ #define fss_basic_list_read_data_option_total 0x100
+ #define fss_basic_list_read_data_option_trim 0x200
typedef struct {
uint16_t option;
return fss_basic_list_read_process_at(main, data, names);
}
+ if (data->option & fss_basic_list_read_data_option_columns) {
+ return fss_basic_list_read_process_columns(main, data, names);
+ }
+
if (data->option & fss_basic_list_read_data_option_total) {
return fss_basic_list_read_process_total(main, data, names);
}
f_status_t fss_basic_list_read_process_at(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
- if (!data->objects.used) {
- fss_extended_list_read_print_zero(main);
- }
- else if (names[data->depths.array[0].value_at] && (data->option & fss_basic_list_read_data_option_total)) {
+ if (data->option & (fss_basic_list_read_data_option_columns | fss_basic_list_read_data_option_total)) {
fss_basic_list_read_print_zero(main);
}
status = fss_basic_list_read_process_at_line(at, *delimits_object, *delimits_content, main, data, &line);
if (status == F_success) return F_none;
}
+ else if (data->option & fss_basic_list_read_data_option_columns) {
+ fprintf(main->output.stream, "%llu%c", data->contents.array[i].used, f_string_eol_s[0]);
+ }
else if (data->option & fss_basic_list_read_data_option_total) {
if (data->contents.array[i].used) {
fss_basic_list_read_print_one(main);
}
#endif // _di_fss_basic_list_read_process_at_
+#ifndef _di_fss_basic_list_read_process_columns_
+ f_status_t fss_basic_list_read_process_columns(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
+
+ if (!(data->option & fss_basic_list_read_data_option_content)) {
+ fss_basic_list_read_print_zero(main);
+
+ return F_none;
+ }
+
+ f_array_length_t max = 0;
+
+ for (f_array_length_t at = 0; at < data->contents.used; ++at) {
+
+ if (!names[at]) continue;
+
+ if (data->contents.array[at].used > max) {
+ max = data->contents.array[at].used;
+ }
+ } // for
+
+ fprintf(main->output.stream, "%llu%c", max, f_string_eol_s[0]);
+
+ return F_none;
+ }
+#endif // _di_fss_basic_list_read_process_columns_
+
#ifndef _di_fss_basic_list_read_process_at_line_
f_status_t fss_basic_list_read_process_at_line(const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, f_array_length_t *line) {
data->option |= fss_basic_list_read_data_option_at;
}
+ if (main->parameters[fss_basic_list_read_parameter_columns].result == f_console_result_found) {
+ data->option |= fss_basic_list_read_data_option_columns;
+ }
+
if (main->parameters[fss_basic_list_read_parameter_content].result == f_console_result_found) {
data->option |= fss_basic_list_read_data_option_content;
}
#endif // _di_fss_basic_list_read_process_at_
/**
+ * Process based on columns parameter.
+ *
+ * @param main
+ * The main data.
+ * @param data
+ * The program data.
+ * @param names
+ * An array of booleans representing whether or not some Object name is to be used.
+ * (If TRUE, then the name is to be used and if FALSE, then the name is not to be used.)
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_basic_list_read_process_columns_
+ extern f_status_t fss_basic_list_read_process_columns(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) f_attribute_visibility_internal;
+#endif // _di_fss_basic_list_read_process_columns_
+
+/**
* Process based on at parameter for some line.
*
* @param main
fll_program_print_help_option(output, context, fss_basic_read_short_at, fss_basic_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index.");
fll_program_print_help_option(output, context, fss_basic_read_short_content, fss_basic_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default).");
+ fll_program_print_help_option(output, context, fss_basic_read_short_columns, fss_basic_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns.");
fll_program_print_help_option(output, context, fss_basic_read_short_delimit, fss_basic_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits.");
fll_program_print_help_option(output, context, fss_basic_read_short_depth, fss_basic_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth.");
fll_program_print_help_option(output, context, fss_basic_read_short_empty, fss_basic_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing.");
fprintf(output.stream, " The parameter ");
f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_basic_read_long_select);
- fprintf(output.stream, " selects a Content index at a given depth.%c", f_string_eol_s[0]);
- fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested Content).%c", f_string_eol_s[0]);
+ fprintf(output.stream, " selects a Content column.%c", f_string_eol_s[0]);
fprintf(output.stream, "%c", f_string_eol_s[0]);
fprintf(output.stream, "%c", f_string_eol_s[0]);
+ fprintf(output.stream, " The parameters ");
+ f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_basic_read_long_columns);
+ fprintf(output.stream, " and ");
+ f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_basic_read_long_select);
+ fprintf(output.stream, " refer to a Content column.%c", f_string_eol_s[0]);
+ fprintf(output.stream, " The word \"column\" is being loosely defined to refer to a specific Content.%c", f_string_eol_s[0]);
+ fprintf(output.stream, " This is not to be confused with a depth.%c", f_string_eol_s[0]);
+
+ fprintf(output.stream, "%c", f_string_eol_s[0]);
+
return F_none;
}
#endif // _di_fss_basic_read_print_help_
} // for
}
+ if (F_status_is_error_not(status) && main->parameters[fss_basic_read_parameter_columns].result == f_console_result_found) {
+ const f_array_length_t parameter_code[] = {
+ fss_basic_read_parameter_depth,
+ fss_basic_read_parameter_line,
+ fss_basic_read_parameter_pipe,
+ fss_basic_read_parameter_select,
+ fss_basic_read_parameter_total,
+ };
+
+ const f_string_t parameter_name[] = {
+ fss_basic_read_long_depth,
+ fss_basic_read_long_line,
+ fss_basic_read_long_pipe,
+ fss_basic_read_long_select,
+ fss_basic_read_long_total,
+ };
+
+ const uint8_t parameter_match[] = {
+ f_console_result_additional,
+ f_console_result_additional,
+ f_console_result_found,
+ f_console_result_additional,
+ f_console_result_found,
+ };
+
+ for (f_array_length_t i = 0; i < 5; ++i) {
+
+ if (main->parameters[parameter_code[i]].result == parameter_match[i]) {
+ f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the '", fll_error_print_error);
+ f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_basic_read_long_columns);
+ f_color_print(main->error.to.stream, main->context.set.error, "' parameter with the '");
+ f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, parameter_name[i]);
+ f_color_print(main->error.to.stream, main->context.set.error, "' parameter.%c", f_string_eol_s[0]);
+
+ status = F_status_set_error(F_parameter);
+ break;
+ }
+ } // for
+ }
+
if (F_status_is_error_not(status) && main->parameters[fss_basic_read_parameter_pipe].result == f_console_result_found) {
if (main->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the '", fll_error_print_error);
#define fss_basic_read_short_at "a"
#define fss_basic_read_short_content "c"
+ #define fss_basic_read_short_columns "C"
#define fss_basic_read_short_delimit "D"
#define fss_basic_read_short_depth "d"
#define fss_basic_read_short_empty "e"
#define fss_basic_read_long_at "at"
#define fss_basic_read_long_content "content"
+ #define fss_basic_read_long_columns "columns"
#define fss_basic_read_long_delimit "delimit"
#define fss_basic_read_long_depth "depth"
#define fss_basic_read_long_empty "empty"
fss_basic_read_parameter_at,
fss_basic_read_parameter_content,
+ fss_basic_read_parameter_columns,
fss_basic_read_parameter_delimit,
fss_basic_read_parameter_depth,
fss_basic_read_parameter_empty,
f_console_parameter_t_initialize(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(fss_basic_read_short_at, fss_basic_read_long_at, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_read_short_content, fss_basic_read_long_content, 0, 0, f_console_type_normal), \
+ f_console_parameter_t_initialize(fss_basic_read_short_columns, fss_basic_read_long_columns, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_read_short_delimit, fss_basic_read_long_delimit, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_read_short_depth, fss_basic_read_long_depth, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_read_short_empty, fss_basic_read_long_empty, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_read_short_trim, fss_basic_read_long_trim, 0, 0, f_console_type_normal), \
}
- #define fss_basic_read_total_parameters 21
+ #define fss_basic_read_total_parameters 22
#endif // _di_fss_basic_read_defines_
/**
*
* fss_basic_read_data_option_*:
* - at: The object at the given position is being selected (Think of this as select a row for some Object).
+ * - columns: The total columns found and selected is printed instead of the Content.
* - content: The Content is to be printed.
* - empty: Empty Content will be printed (Objects that have no Content will have their empty Content printed).
* - line: A specific Content at a given line is to be selected (Think of this as select a row for some Content).
*/
#ifndef _di_fss_basic_read_data_t_
#define fss_basic_read_data_option_at 0x1
- #define fss_basic_read_data_option_content 0x2
- #define fss_basic_read_data_option_empty 0x4
- #define fss_basic_read_data_option_line 0x8
- #define fss_basic_read_data_option_name 0x10
- #define fss_basic_read_data_option_object 0x20
- #define fss_basic_read_data_option_select 0x40
- #define fss_basic_read_data_option_total 0x80
- #define fss_basic_read_data_option_trim 0x100
+ #define fss_basic_read_data_option_columns 0x2
+ #define fss_basic_read_data_option_content 0x4
+ #define fss_basic_read_data_option_empty 0x8
+ #define fss_basic_read_data_option_line 0x10
+ #define fss_basic_read_data_option_name 0x20
+ #define fss_basic_read_data_option_object 0x40
+ #define fss_basic_read_data_option_select 0x80
+ #define fss_basic_read_data_option_total 0x100
+ #define fss_basic_read_data_option_trim 0x200
typedef struct {
uint16_t option;
return fss_basic_read_process_at(main, data, names);
}
+ if (data->option & fss_basic_read_data_option_columns) {
+ return fss_basic_read_process_columns(main, data, names);
+ }
+
if (data->option & fss_basic_read_data_option_total) {
return fss_basic_read_process_total(main, data, names);
}
f_status_t fss_basic_read_process_at(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
- if (!data->objects.used) {
- fss_extended_list_read_print_zero(main);
- }
- else if (names[data->depths.array[0].value_at] && (data->option & fss_basic_read_data_option_total)) {
+ if (data->option & (fss_basic_read_data_option_columns | fss_basic_read_data_option_total)) {
fss_basic_read_print_zero(main);
}
fss_basic_read_print_at(i, *delimits, except_none, main, data);
}
}
+ else if (data->option & fss_basic_read_data_option_columns) {
+ fprintf(main->output.stream, "%llu%c", data->contents.array[i].used, f_string_eol_s[0]);
+ }
else if (data->option & fss_basic_read_data_option_total) {
if (data->contents.array[i].used) {
fss_basic_read_print_one(main);
}
#endif // _di_fss_basic_read_process_at_
+#ifndef _di_fss_basic_read_process_columns_
+ f_status_t fss_basic_read_process_columns(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) {
+
+ if (!(data->option & fss_basic_read_data_option_content)) {
+ fss_basic_read_print_zero(main);
+
+ return F_none;
+ }
+
+ f_array_length_t max = 0;
+
+ for (f_array_length_t at = 0; at < data->contents.used; ++at) {
+
+ if (!names[at]) continue;
+
+ if (data->contents.array[at].used > max) {
+ max = data->contents.array[at].used;
+ }
+ } // for
+
+ fprintf(main->output.stream, "%llu%c", max, f_string_eol_s[0]);
+
+ return F_none;
+ }
+#endif // _di_fss_basic_read_process_columns_
+
#ifndef _di_fss_basic_read_process_line_
f_status_t fss_basic_read_process_line(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) {
data->option |= fss_basic_read_data_option_at;
}
+ if (main->parameters[fss_basic_read_parameter_columns].result == f_console_result_found) {
+ data->option |= fss_basic_read_data_option_columns;
+ }
+
if (main->parameters[fss_basic_read_parameter_content].result == f_console_result_found) {
data->option |= fss_basic_read_data_option_content;
}
#endif // _di_fss_basic_read_process_at_
/**
+ * Process based on columns parameter.
+ *
+ * @param main
+ * The main data.
+ * @param data
+ * The program data.
+ * @param names
+ * An array of booleans representing whether or not some Object name is to be used.
+ * (If TRUE, then the name is to be used and if FALSE, then the name is not to be used.)
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_basic_read_process_columns_
+ extern f_status_t fss_basic_read_process_columns(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) f_attribute_visibility_internal;
+#endif // _di_fss_basic_read_process_columns_
+
+/**
* Process based on line parameter.
*
* @param main
fll_program_print_help_option(output, context, fss_extended_list_read_short_at, fss_extended_list_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index.");
fll_program_print_help_option(output, context, fss_extended_list_read_short_content, fss_extended_list_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default).");
+ fll_program_print_help_option(output, context, fss_extended_list_read_short_columns, fss_extended_list_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns.");
fll_program_print_help_option(output, context, fss_extended_list_read_short_delimit, fss_extended_list_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits.");
fll_program_print_help_option(output, context, fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth.");
fll_program_print_help_option(output, context, fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing.");
fprintf(output.stream, " The parameter ");
f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_extended_list_read_long_select);
- fprintf(output.stream, " selects a Content index at a given depth.%c", f_string_eol_s[0]);
- fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested Content).%c", f_string_eol_s[0]);
+ fprintf(output.stream, " selects a Content column.%c", f_string_eol_s[0]);
fprintf(output.stream, "%c", f_string_eol_s[0]);
fprintf(output.stream, "%c", f_string_eol_s[0]);
+ fprintf(output.stream, " The parameters ");
+ f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_extended_list_read_long_columns);
+ fprintf(output.stream, " and ");
+ f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_extended_list_read_long_select);
+ fprintf(output.stream, " refer to a Content column.%c", f_string_eol_s[0]);
+ fprintf(output.stream, " The word \"column\" is being loosely defined to refer to a specific Content.%c", f_string_eol_s[0]);
+ fprintf(output.stream, " This is not to be confused with a depth.%c", f_string_eol_s[0]);
+
+ fprintf(output.stream, "%c", f_string_eol_s[0]);
+
return F_none;
}
#endif // _di_fss_extended_list_read_print_help_
} // for
}
+ if (F_status_is_error_not(status) && main->parameters[fss_extended_list_read_parameter_columns].result == f_console_result_found) {
+ const f_array_length_t parameter_code[] = {
+ fss_extended_list_read_parameter_depth,
+ fss_extended_list_read_parameter_line,
+ fss_extended_list_read_parameter_pipe,
+ fss_extended_list_read_parameter_select,
+ fss_extended_list_read_parameter_total,
+ };
+
+ const f_string_t parameter_name[] = {
+ fss_extended_list_read_long_depth,
+ fss_extended_list_read_long_line,
+ fss_extended_list_read_long_pipe,
+ fss_extended_list_read_long_select,
+ fss_extended_list_read_long_total,
+ };
+
+ const uint8_t parameter_match[] = {
+ f_console_result_additional,
+ f_console_result_additional,
+ f_console_result_found,
+ f_console_result_additional,
+ f_console_result_found,
+ };
+
+ for (f_array_length_t i = 0; i < 5; ++i) {
+
+ if (main->parameters[parameter_code[i]].result == parameter_match[i]) {
+ f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the '", fll_error_print_error);
+ f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_extended_list_read_long_columns);
+ f_color_print(main->error.to.stream, main->context.set.error, "' parameter with the '");
+ f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, parameter_name[i]);
+ f_color_print(main->error.to.stream, main->context.set.error, "' parameter.%c", f_string_eol_s[0]);
+
+ status = F_status_set_error(F_parameter);
+ break;
+ }
+ } // for
+ }
+
if (F_status_is_error_not(status) && main->parameters[fss_extended_list_read_parameter_pipe].result == f_console_result_found) {
if (main->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) {
f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the '", fll_error_print_error);
status = F_status_set_error(F_parameter);
}
- else if (main->parameters[fss_extended_list_read_parameter_line].result == f_console_result_found) {
+ else if (main->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) {
f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the '", fll_error_print_error);
f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_extended_list_read_long_pipe);
f_color_print(main->error.to.stream, main->context.set.error, "' parameter with the '");
#define fss_extended_list_read_short_at "a"
#define fss_extended_list_read_short_content "c"
+ #define fss_extended_list_read_short_columns "C"
#define fss_extended_list_read_short_delimit "D"
#define fss_extended_list_read_short_depth "d"
#define fss_extended_list_read_short_empty "e"
#define fss_extended_list_read_long_at "at"
#define fss_extended_list_read_long_content "content"
+ #define fss_extended_list_read_long_columns "columns"
#define fss_extended_list_read_long_delimit "delimit"
#define fss_extended_list_read_long_depth "depth"
#define fss_extended_list_read_long_empty "empty"
fss_extended_list_read_parameter_at,
fss_extended_list_read_parameter_content,
+ fss_extended_list_read_parameter_columns,
fss_extended_list_read_parameter_delimit,
fss_extended_list_read_parameter_depth,
fss_extended_list_read_parameter_empty,
f_console_parameter_t_initialize(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(fss_extended_list_read_short_at, fss_extended_list_read_long_at, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_list_read_short_content, fss_extended_list_read_long_content, 0, 0, f_console_type_normal), \
+ f_console_parameter_t_initialize(fss_extended_list_read_short_columns, fss_extended_list_read_long_columns, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_list_read_short_delimit, fss_extended_list_read_long_delimit, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, 0, 0, f_console_type_normal), \
}
- #define fss_extended_list_read_total_parameters 21
+ #define fss_extended_list_read_total_parameters 22
#endif // _di_fss_extended_list_read_defines_
/**
*
* fss_extended_list_read_data_option_*:
* - at: The object at the given position is being selected (Think of this as select a row for some Object).
+ * - columns: The total columns found and selected is printed instead of the Content.
* - content: The Content is to be printed.
* - empty: Empty Content will be printed (Objects that have no Content will have their empty Content printed).
* - line: A specific Content at a given line is to be selected (Think of this as select a row for some Content).
*/
#ifndef _di_fss_extended_list_read_data_t_
#define fss_extended_list_read_data_option_at 0x1
- #define fss_extended_list_read_data_option_content 0x2
- #define fss_extended_list_read_data_option_empty 0x4
- #define fss_extended_list_read_data_option_line 0x8
- #define fss_extended_list_read_data_option_name 0x10
- #define fss_extended_list_read_data_option_object 0x20
- #define fss_extended_list_read_data_option_select 0x40
- #define fss_extended_list_read_data_option_total 0x80
- #define fss_extended_list_read_data_option_trim 0x100
+ #define fss_extended_list_read_data_option_columns 0x2
+ #define fss_extended_list_read_data_option_content 0x4
+ #define fss_extended_list_read_data_option_empty 0x8
+ #define fss_extended_list_read_data_option_line 0x10
+ #define fss_extended_list_read_data_option_name 0x20
+ #define fss_extended_list_read_data_option_object 0x40
+ #define fss_extended_list_read_data_option_select 0x80
+ #define fss_extended_list_read_data_option_total 0x100
+ #define fss_extended_list_read_data_option_trim 0x200
typedef struct {
uint16_t option;
return fss_extended_list_read_process_at(main, data, names);
}
+ if (data->option & fss_extended_list_read_data_option_columns) {
+ return fss_extended_list_read_process_columns(main, data, names);
+ }
+
if (data->option & fss_extended_list_read_data_option_total) {
return fss_extended_list_read_process_total(main, data, names);
}
f_status_t fss_extended_list_read_process_at(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
- if (!data->objects.used) {
- fss_extended_list_read_print_zero(main);
- }
- else if (names[data->depths.array[0].value_at] && (data->option & fss_extended_list_read_data_option_total)) {
+ if (data->option & (fss_extended_list_read_data_option_columns | fss_extended_list_read_data_option_total)) {
fss_extended_list_read_print_zero(main);
}
status = fss_extended_list_read_process_at_line(at, *delimits_object, *delimits_content, main, data, &line);
if (status == F_success) return F_none;
}
+ else if (data->option & fss_extended_list_read_data_option_columns) {
+ fprintf(main->output.stream, "%llu%c", data->contents.array[i].used, f_string_eol_s[0]);
+ }
else if (data->option & fss_extended_list_read_data_option_total) {
if ((data->option & fss_extended_list_read_data_option_object) && !(data->option & fss_extended_list_read_data_option_content)) {
if (data->contents.array[i].used) {
}
#endif // _di_fss_extended_list_read_process_at_
+#ifndef _di_fss_extended_list_read_process_columns_
+ f_status_t fss_extended_list_read_process_columns(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+
+ if (!(data->option & fss_extended_list_read_data_option_content)) {
+ fss_extended_list_read_print_zero(main);
+
+ return F_none;
+ }
+
+ f_array_length_t max = 0;
+
+ for (f_array_length_t at = 0; at < data->contents.used; ++at) {
+
+ if (!names[at]) continue;
+
+ if (data->contents.array[at].used > max) {
+ max = data->contents.array[at].used;
+ }
+ } // for
+
+ fprintf(main->output.stream, "%llu%c", max, f_string_eol_s[0]);
+
+ return F_none;
+ }
+#endif // _di_fss_extended_list_read_process_columns_
+
#ifndef _di_fss_extended_list_read_process_at_line_
f_status_t fss_extended_list_read_process_at_line(const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, f_array_length_t *line) {
// There is only a single Content column for this standard.
if (data->option & fss_extended_list_read_data_option_content) {
-
- // @fixme empty content is it closed with '}' or is there no empty Content at all?
if (!data->contents.array[at].used) {
return F_none;
}
data->option |= fss_extended_list_read_data_option_at;
}
+ if (main->parameters[fss_extended_list_read_parameter_columns].result == f_console_result_found) {
+ data->option |= fss_extended_list_read_data_option_columns;
+ }
+
if (main->parameters[fss_extended_list_read_parameter_content].result == f_console_result_found) {
data->option |= fss_extended_list_read_data_option_content;
}
#endif // _di_fss_extended_list_read_process_at_
/**
+ * Process based on columns parameter.
+ *
+ * @param main
+ * The main data.
+ * @param data
+ * The program data.
+ * @param names
+ * An array of booleans representing whether or not some Object name is to be used.
+ * (If TRUE, then the name is to be used and if FALSE, then the name is not to be used.)
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_extended_list_read_process_columns_
+ extern f_status_t fss_extended_list_read_process_columns(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) f_attribute_visibility_internal;
+#endif // _di_fss_extended_list_read_process_columns_
+
+/**
* Process based on at parameter for some line.
*
* @param main
fll_program_print_help_option(output, context, fss_extended_read_short_at, fss_extended_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index.");
fll_program_print_help_option(output, context, fss_extended_read_short_content, fss_extended_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default).");
+ fll_program_print_help_option(output, context, fss_extended_read_short_columns, fss_extended_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns.");
fll_program_print_help_option(output, context, fss_extended_read_short_delimit, fss_extended_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits.");
fll_program_print_help_option(output, context, fss_extended_read_short_depth, fss_extended_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth.");
fll_program_print_help_option(output, context, fss_extended_read_short_empty, fss_extended_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing.");
fprintf(output.stream, " The parameter ");
f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_extended_read_long_select);
- fprintf(output.stream, " selects a Content index at a given depth.%c", f_string_eol_s[0]);
- fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested Content).%c", f_string_eol_s[0]);
+ fprintf(output.stream, " selects a Content column.%c", f_string_eol_s[0]);
fprintf(output.stream, "%c", f_string_eol_s[0]);
fprintf(output.stream, "%c", f_string_eol_s[0]);
+ fprintf(output.stream, " The parameters ");
+ f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_extended_read_long_columns);
+ fprintf(output.stream, " and ");
+ f_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_extended_read_long_select);
+ fprintf(output.stream, " refer to a Content column.%c", f_string_eol_s[0]);
+ fprintf(output.stream, " The word \"column\" is being loosely defined to refer to a specific Content.%c", f_string_eol_s[0]);
+ fprintf(output.stream, " This is not to be confused with a depth.%c", f_string_eol_s[0]);
+
+ fprintf(output.stream, "%c", f_string_eol_s[0]);
+
return F_none;
}
#endif // _di_fss_extended_read_print_help_
} // for
}
+ if (F_status_is_error_not(status) && main->parameters[fss_extended_read_parameter_columns].result == f_console_result_found) {
+ const f_array_length_t parameter_code[] = {
+ fss_extended_read_parameter_depth,
+ fss_extended_read_parameter_line,
+ fss_extended_read_parameter_pipe,
+ fss_extended_read_parameter_select,
+ fss_extended_read_parameter_total,
+ };
+
+ const f_string_t parameter_name[] = {
+ fss_extended_read_long_depth,
+ fss_extended_read_long_line,
+ fss_extended_read_long_pipe,
+ fss_extended_read_long_select,
+ fss_extended_read_long_total,
+ };
+
+ const uint8_t parameter_match[] = {
+ f_console_result_additional,
+ f_console_result_additional,
+ f_console_result_found,
+ f_console_result_additional,
+ f_console_result_found,
+ };
+
+ for (f_array_length_t i = 0; i < 5; ++i) {
+
+ if (main->parameters[parameter_code[i]].result == parameter_match[i]) {
+ f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the '", fll_error_print_error);
+ f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_extended_read_long_columns);
+ f_color_print(main->error.to.stream, main->context.set.error, "' parameter with the '");
+ f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, parameter_name[i]);
+ f_color_print(main->error.to.stream, main->context.set.error, "' parameter.%c", f_string_eol_s[0]);
+
+ status = F_status_set_error(F_parameter);
+ break;
+ }
+ } // for
+ }
+
if (F_status_is_error_not(status) && main->parameters[fss_extended_read_parameter_pipe].result == f_console_result_found) {
if (main->parameters[fss_extended_read_parameter_total].result == f_console_result_found) {
f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the '", fll_error_print_error);
status = F_status_set_error(F_parameter);
}
- else if (main->parameters[fss_extended_read_parameter_line].result == f_console_result_found) {
+ else if (main->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) {
f_color_print(main->error.to.stream, main->context.set.error, "%sCannot specify the '", fll_error_print_error);
f_color_print(main->error.to.stream, main->context.set.notable, "%s%s", f_console_symbol_long_enable_s, fss_extended_read_long_pipe);
f_color_print(main->error.to.stream, main->context.set.error, "' parameter with the '");
#define fss_extended_read_short_at "a"
#define fss_extended_read_short_content "c"
+ #define fss_extended_read_short_columns "C"
#define fss_extended_read_short_delimit "D"
#define fss_extended_read_short_depth "d"
#define fss_extended_read_short_empty "e"
#define fss_extended_read_long_at "at"
#define fss_extended_read_long_content "content"
+ #define fss_extended_read_long_columns "columns"
#define fss_extended_read_long_delimit "delimit"
#define fss_extended_read_long_depth "depth"
#define fss_extended_read_long_empty "empty"
fss_extended_read_parameter_at,
fss_extended_read_parameter_content,
+ fss_extended_read_parameter_columns,
fss_extended_read_parameter_delimit,
fss_extended_read_parameter_depth,
fss_extended_read_parameter_empty,
f_console_parameter_t_initialize(f_console_standard_short_version_s, f_console_standard_long_version_s, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(fss_extended_read_short_at, fss_extended_read_long_at, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_read_short_content, fss_extended_read_long_content, 0, 0, f_console_type_normal), \
+ f_console_parameter_t_initialize(fss_extended_read_short_columns, fss_extended_read_long_columns, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_read_short_delimit, fss_extended_read_long_delimit, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_read_short_depth, fss_extended_read_long_depth, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_read_short_empty, fss_extended_read_long_empty, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_read_short_trim, fss_extended_read_long_trim, 0, 0, f_console_type_normal), \
}
- #define fss_extended_read_total_parameters 21
+ #define fss_extended_read_total_parameters 22
#endif // _di_fss_extended_read_defines_
/**
*
* fss_extended_read_data_option_*:
* - at: The object at the given position is being selected (Think of this as select a row for some Object).
+ * - columns: The total columns found and selected is printed instead of the Content.
* - content: The Content is to be printed.
* - empty: Empty Content will be printed (Objects that have no Content will have their empty Content printed).
* - line: A specific Content at a given line is to be selected (Think of this as select a row for some Content).
*/
#ifndef _di_fss_extended_read_data_t_
#define fss_extended_read_data_option_at 0x1
- #define fss_extended_read_data_option_content 0x2
- #define fss_extended_read_data_option_empty 0x4
- #define fss_extended_read_data_option_line 0x8
- #define fss_extended_read_data_option_name 0x10
- #define fss_extended_read_data_option_object 0x20
- #define fss_extended_read_data_option_select 0x40
- #define fss_extended_read_data_option_total 0x80
- #define fss_extended_read_data_option_trim 0x100
+ #define fss_extended_read_data_option_columns 0x2
+ #define fss_extended_read_data_option_content 0x4
+ #define fss_extended_read_data_option_empty 0x8
+ #define fss_extended_read_data_option_line 0x10
+ #define fss_extended_read_data_option_name 0x20
+ #define fss_extended_read_data_option_object 0x40
+ #define fss_extended_read_data_option_select 0x80
+ #define fss_extended_read_data_option_total 0x100
+ #define fss_extended_read_data_option_trim 0x200
typedef struct {
uint16_t option;
return fss_extended_read_process_at(main, data, names);
}
+ if (data->option & fss_extended_read_data_option_columns) {
+ return fss_extended_read_process_columns(main, data, names);
+ }
+
if (data->option & fss_extended_read_data_option_total) {
return fss_extended_read_process_total(main, data, names);
}
f_status_t fss_extended_read_process_at(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
- if (!data->objects.used) {
- fss_extended_list_read_print_zero(main);
- }
- else if (names[data->depths.array[0].value_at] && (data->option & fss_extended_read_data_option_total)) {
+ if (data->option & (fss_extended_read_data_option_columns | fss_extended_read_data_option_total)) {
fss_extended_read_print_zero(main);
}
fss_extended_read_print_at(i, *delimits_object, *delimits_content, main, data);
}
}
+ else if (data->option & fss_extended_read_data_option_columns) {
+ fprintf(main->output.stream, "%llu%c", data->contents.array[i].used, f_string_eol_s[0]);
+ }
else if (data->option & fss_extended_read_data_option_total) {
if (fss_extended_read_print_at_total(i, main, data) == F_none) {
break;
}
#endif // _di_fss_extended_read_process_at_
+#ifndef _di_fss_extended_read_process_columns_
+ f_status_t fss_extended_read_process_columns(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) {
+
+ if (!(data->option & fss_extended_read_data_option_content)) {
+ fss_extended_read_print_zero(main);
+
+ return F_none;
+ }
+
+ f_array_length_t max = 0;
+
+ for (f_array_length_t at = 0; at < data->contents.used; ++at) {
+
+ if (!names[at]) continue;
+
+ if (data->contents.array[at].used > max) {
+ max = data->contents.array[at].used;
+ }
+ } // for
+
+ fprintf(main->output.stream, "%llu%c", max, f_string_eol_s[0]);
+
+ return F_none;
+ }
+#endif // _di_fss_extended_read_process_columns_
+
#ifndef _di_fss_extended_read_process_line_
f_status_t fss_extended_read_process_line(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) {
data->option |= fss_extended_read_data_option_at;
}
+ if (main->parameters[fss_extended_read_parameter_columns].result == f_console_result_found) {
+ data->option |= fss_extended_read_data_option_columns;
+ }
+
if (main->parameters[fss_extended_read_parameter_content].result == f_console_result_found) {
data->option |= fss_extended_read_data_option_content;
}
#endif // _di_fss_extended_read_process_at_
/**
+ * Process based on columns parameter.
+ *
+ * @param main
+ * The main data.
+ * @param data
+ * The program data.
+ * @param names
+ * An array of booleans representing whether or not some Object name is to be used.
+ * (If TRUE, then the name is to be used and if FALSE, then the name is not to be used.)
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_fss_extended_read_process_columns_
+ extern f_status_t fss_extended_read_process_columns(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) f_attribute_visibility_internal;
+#endif // _di_fss_extended_read_process_columns_
+
+/**
* Process based on line parameter.
*
* @param main
An Object may be followed by a newline, in which case means that the Object has no Content.
Content exists on the same line as the Object.
- Content consists of everything following the first non-whitespace character until the newline.
- Content includes trailing whitespace before newline is reached.
- Content does not include any of the leading whitespace.
+ Content is represented as a single Content column terminated by a newline.
+ Content column consists of everything following the first non-whitespace character until the newline.
+ Content column includes trailing whitespace before newline is reached.
+ Content column does not include any of the leading whitespace.
No delimits are supported in the content.
If only printing whitespace follows a valid Object, that Object is considered to have no Content.
An Object may be followed by a newline, in which case means that the Object has no Content.
Content exists on the same line as the Object.
- Content of whitespace separated sets until the newline.
- Any number of sets may exist in the Content until the newline is reached.
+ Content is represented as multiple Content columns.
+ Content columns are whitespace separated parts within the Content and terminated by a newline.
+ Any number of Content columns may exist in the Content until the newline is reached.
Key\:
\s = whitespace, except newline.
A colon followed by any whitespace until a newline terminates a valid Object.
Non-whitespace may not follow the colon of a valid Object.
- Content exists on every line following a valid object until the end of file (or string) or until the next valid Object is found.
+ Content is represented as a single Content column of every line following a valid object until the end of file (or string) or until the next valid Object is found.
Any content that could be interpreted as a valid Object must have the colon delimited.
There is no single-quote or double-quote delimitation in this specification.
An Object is not considered fully valid until a valid close-brace (}) is found, designating the end of the Content.
Non-whitespace may not follow the open-brace of a valid Object.
- Content exists on every line following a valid object until the end of file (or string) or until a non-delimited close-brace (}).
- Any Content that could be interpreted as an end of content must be delimited if it should be part of the content.
- Whitespace may follow a valid close-brace but a terminating newline must be present to designate a valid end of content.
+ Content is represented as a single Content column of every line following a valid object until the end of file (or string) or until a non-delimited close-brace (}).
+ Any Content column that could be interpreted as an end of content must be delimited if it should be part of the Content.
+ Whitespace may follow a valid close-brace but a terminating newline must be present to designate a valid end of Content.
There is no single-quote or double-quote delimitation in this specification.
Only the open-brace that would result in a valid Object or the close-brace that would terminate valid Content can be delimited.
Featureless Settings Specification: 000C - Iki Text:
IKI is an unstructured WIKI-like syntax meant to be simpler than WIKI syntax.
- This fss specification represents a plain text file not following any special FSS structure but instead supports the IKI syntax.
+ This FSS specification represents a plain text file not following any special FSS structure but instead supports the IKI syntax.
The IKI syntax may be used in any FSS specification and the specific vocabulary is defined by appending
For compatibility with the FSS terminology, the Vocabulary Name is to be considered the Object and the Vocabulary value is to be considered the Content.
+ The Content column, therefore, exists as a single Column (which is the entire Vocabulary value).
There is no requirement for any specific IKI vocabulary by this standard only that the given syntax is supported.
To specify the IKI vocabulary being used append the IKI vocabulary header immediately after the fss header like such: "# fss-000c iki-0001".
The specification may choose how a given Object or Content are represented and parsed.
For example, in FSS-0000 (Basic), Content is treated as a single item whereas in FSS-0001 (Extended), Content is broken apart in multiple sub parts.
+ Contents may be broken up into zero or more discrete sets of Content.
+ Each of these discrete sets of Content are referred to as a column.
+ These columns do not need to be setup in a column structure, the word "column" is simply used as a grouping terminology.
+ While a Content refers to the entire set, a column (more specifically, a Content column) refers to the individual discrete sets within the Content.
+ For example, in FSS-000 (Basic) the entire Content may be further represented as a single column.
+ For example, in FSS-001 (Extended) the entire Content may be further represented as multiple columns.
+
In all cases, specifications that separate Objects from Contents using whitespace, the first whitespace separating the Object and Content must not be considered part of the Object nor part of the Content.
All spaces after the first separating whitespace is generally ignored until the first non-whitespace character is found, unless otherwise specified.