Get the programs into better working state.
Now I need to next focus on ensuring that they work as expected.
The payload and embedded list need special handling and are very much not implemented.
}
}
+ fss_read_ensure_quotes_length(main);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fss_read_print_error(&main->program.error, macro_fss_read_f(fss_read_ensure_quotes_length));
+
+ return;
+ }
+
main->setting.state.status = F_none;
}
#endif // _di_fss_read_basic_process_load_
*
* Errors (with error bit) from: fll_fss_basic_read()
*
+ * Errors (with error bit) from: fss_read_ensure_quotes_length()
+ *
* @see fll_fss_basic_read()
*
+ * @see fss_read_ensure_quotes_length()
* @see fss_read_file_identify()
*/
#ifndef _di_fss_read_basic_process_load_
data.callback.process_help = &fss_read_basic_process_help;
data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process_load_depth = &fss_read_setting_load_depth;
data.callback.process_normal = &fss_read_process_normal;
data.callback.process_at = &fss_read_process_normal_at;
}
}
+ fss_read_ensure_quotes_length(main);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fss_read_print_error(&main->program.error, macro_fss_read_f(fss_read_ensure_quotes_length));
+
+ return;
+ }
+
main->setting.state.status = F_none;
}
#endif // _di_fss_read_basic_list_process_load_
*
* Errors (with error bit) from: fll_fss_basic_list_read()
*
+ * Errors (with error bit) from: fss_read_ensure_quotes_length()
+ *
* @see fll_fss_basic_list_read()
*
+ * @see fss_read_ensure_quotes_length()
* @see fss_read_file_identify()
*/
#ifndef _di_fss_read_basic_list_process_load_
data.program.output.custom = (void *) &data;
data.program.warning.custom = (void *) &data;
- data.setting.flag |= fss_read_main_flag_trim_object_e;
-
data.setting.state.custom = (void *) &data;
data.setting.standard = fss_read_basic_list_standard_s;
data.callback.process_help = &fss_read_basic_list_process_help;
data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process_load_depth = &fss_read_setting_load_depth;
data.callback.process_normal = &fss_read_process_normal;
data.callback.process_at = &fss_read_process_normal_at;
}
}
+ fss_read_ensure_quotes_length(main);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fss_read_print_error(&main->program.error, macro_fss_read_f(fss_read_ensure_quotes_length));
+
+ return;
+ }
+
main->setting.state.status = F_none;
}
#endif // _di_fss_read_embedded_list_process_load_
*
* Errors (with error bit) from: fll_fss_embedded_list_read()
*
+ * Errors (with error bit) from: fss_read_ensure_quotes_length()
+ *
* @see fll_fss_embedded_list_read()
*
+ * @see fss_read_ensure_quotes_length()
* @see fss_read_file_identify()
*/
#ifndef _di_fss_read_embedded_list_process_load_
data.callback.process_help = &fss_read_embedded_list_process_help;
data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process_load_depth = &fss_read_setting_load_depth;
data.callback.process_normal = &fss_read_process_normal;
data.callback.process_at = &fss_read_process_normal_at;
}
}
+ fss_read_ensure_quotes_length(main);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fss_read_print_error(&main->program.error, macro_fss_read_f(fss_read_ensure_quotes_length));
+
+ return;
+ }
+
main->setting.state.status = F_none;
}
#endif // _di_fss_read_extended_process_load_
*
* Errors (with error bit) from: fll_fss_extended_read()
*
+ * Errors (with error bit) from: fss_read_ensure_quotes_length()
+ *
* @see fll_fss_extended_read()
*
+ * @see fss_read_ensure_quotes_length()
* @see fss_read_file_identify()
*/
#ifndef _di_fss_read_extended_process_load_
data.callback.process_help = &fss_read_extended_process_help;
data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process_load_depth = &fss_read_setting_load_depth;
data.callback.process_normal = &fss_read_process_normal;
data.callback.process_at = &fss_read_process_normal_at;
if ((main->setting.flag & fss_read_main_flag_content_e) && main->setting.contents.array[at].used) {
if (main->callback.print_content) {
- main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[0], main->setting.quotes_content.array[at].array[0], delimits_content);
+ main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[0], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[0] : 0, delimits_content);
}
}
}
}
+ fss_read_ensure_quotes_length(main);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fss_read_print_error(&main->program.error, macro_fss_read_f(fss_read_ensure_quotes_length));
+
+ return;
+ }
+
main->setting.state.status = F_none;
}
#endif // _di_fss_read_extended_list_process_load_
*
* Errors (with error bit) from: fll_fss_extended_list_read()
*
+ * Errors (with error bit) from: fss_read_ensure_quotes_length()
+ *
* @see fll_fss_extended_list_read()
*
+ * @see fss_read_ensure_quotes_length()
* @see fss_read_file_identify()
*/
#ifndef _di_fss_read_extended_list_process_load_
data.program.output.custom = (void *) &data;
data.program.warning.custom = (void *) &data;
- data.setting.flag |= fss_read_main_flag_trim_object_e;
-
data.setting.state.custom = (void *) &data;
data.setting.standard = fss_read_extended_list_standard_s;
data.callback.process_help = &fss_read_extended_list_process_help;
data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process_load_depth = &fss_read_setting_load_depth;
data.callback.process_normal = &fss_read_process_normal;
data.callback.process_at = &fss_read_process_normal_at;
extern "C" {
#endif
+#ifndef _di_fss_read_ensure_quotes_length_
+ void fss_read_ensure_quotes_length(fss_read_main_t * const main) {
+
+ if (main->setting.quotes_object.size < main->setting.objects.used) {
+ main->setting.state.status = f_uint8s_increase_by(main->setting.objects.used - main->setting.quotes_object.size, &main->setting.quotes_object);
+ if (F_status_is_error(main->setting.state.status)) return;
+ }
+
+ if (main->setting.quotes_content.size < main->setting.contents.used) {
+ main->setting.state.status = f_uint8ss_increase_by(main->setting.contents.used - main->setting.quotes_content.size, &main->setting.quotes_content);
+ if (F_status_is_error(main->setting.state.status)) return;
+ }
+
+ main->setting.state.status = F_none;
+ }
+#endif // _di_fss_read_ensure_quotes_length_
+
#ifndef _di_fss_read_setting_load_
void fss_read_setting_load(const f_console_arguments_t arguments, fss_read_main_t * const main, void (*callback)(const f_console_arguments_t arguments, fss_read_main_t * const main)) {
if (parameters->array[fss_read_parameter_content_e].result & f_console_result_found_e) {
if (parameters->array[fss_read_parameter_object_e].result & f_console_result_found_e) {
- if (parameters->array[fss_read_parameter_content_e].location < parameters->array[fss_read_parameter_object_e].location) {
- main->setting.flag |= fss_read_main_flag_object_e;
- }
- else {
- main->setting.flag |= fss_read_main_flag_content_e;
- }
- }
- else {
- main->setting.flag |= fss_read_main_flag_content_e;
+ main->setting.flag |= fss_read_main_flag_object_e;
}
+
+ main->setting.flag |= fss_read_main_flag_content_e;
}
else if (parameters->array[fss_read_parameter_object_e].result & f_console_result_found_e) {
main->setting.flag |= fss_read_main_flag_object_e;
main->setting.files.array[0].range.stop = main->setting.buffer.used - 1;
if (main->callback.process_last_line) {
- main->callback.process_last_line((void *) &main);
+ main->callback.process_last_line((void *) main);
if (F_status_is_error(main->setting.state.status)) return;
}
+
+ ++main->setting.files.used;
}
else {
main->setting.files.array[0].range.start = 1;
+ main->setting.files.array[0].range.stop = 0;
}
}
off_t size_block = 0;
off_t size_file = 0;
off_t size_read = 0;
+ fss_read_file_t *file_data = 0;
for (i = 0; i < parameters->remaining.used; ++i) {
if (fss_read_signal_check(main)) return;
index = parameters->remaining.array[i];
-
- main->setting.files.array[main->setting.files.used].name = parameters->arguments.array[index];
- main->setting.files.array[main->setting.files.used].range.start = main->setting.buffer.used;
+ file_data = &main->setting.files.array[main->setting.files.used];
+ file_data->name = parameters->arguments.array[index];
+ file_data->range.start = main->setting.buffer.used;
file.id = -1;
file.stream = 0;
- main->setting.state.status = f_file_stream_open(main->setting.files.array[main->setting.files.used].name, f_string_empty_s, &file);
+ main->setting.state.status = f_file_stream_open(file_data->name, f_string_empty_s, &file);
if (F_status_is_error(main->setting.state.status)) {
if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
size_file = 0;
- main->setting.state.status = f_file_size_by_id(file, &size_file);
+ main->setting.state.status = f_file_size(file_data->name, F_true, &size_file);
if (F_status_is_error(main->setting.state.status)) {
if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_file_size_by_id), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_file_size), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
if (size_file > fss_read_allocation_block_max_d) {
file.size_read = fss_read_allocation_block_read_large_d;
size_block = fss_read_allocation_block_max_d;
-
- // Pre-allocate entire file buffer plus space for the terminating NULL.
- f_string_dynamic_increase_by(size_file + (size_block - (size_file % size_block)) + 1, &main->setting.buffer);
}
else {
file.size_read = fss_read_allocation_block_read_small_d;
size_block = size_file;
-
- // Pre-allocate entire file buffer plus space for the terminating NULL.
- f_string_dynamic_increase_by(size_file + 1, &main->setting.buffer);
}
+ // Pre-allocate entire file buffer plus space for the terminating NULL.
+ f_string_dynamic_increase_by(size_file + 1, &main->setting.buffer);
+
if (F_status_is_error(main->setting.state.status)) {
if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
break;
}
- if (main->setting.buffer.used > main->setting.files.array[main->setting.files.used].range.start) {
+ if (main->setting.buffer.used > file_data->range.start) {
main->setting.files.array[main->setting.files.used++].range.stop = main->setting.buffer.used - 1;
if (main->callback.process_last_line) {
- main->callback.process_last_line((void *) &main);
+ main->callback.process_last_line((void *) main);
if (F_status_is_error(main->setting.state.status)) break;
}
}
f_file_stream_close(&file);
}
else {
- main->setting.files.array[main->setting.files.used].range.start = 1;
- main->setting.files.array[main->setting.files.used].range.stop = 1;
+ file_data->range.start = 1;
+ file_data->range.stop = 0;
}
} // for
i = parameters->array[fss_read_parameter_depth_e].values.used;
}
- // @fixme: much of the logic in this depths handling was static and is now dynamic, this needs to be reviewed and updated.
- if (i + 1 > main->setting.depths.size) {
- main->setting.state.status = fss_read_depths_resize(i + 1, &main->setting.depths);
+ if (i > main->setting.depths.size) {
+ main->setting.state.status = fss_read_depths_resize(i, &main->setting.depths);
if (F_status_is_error(main->setting.state.status)) {
if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
f_array_length_t position_depth = 0;
f_array_length_t position_at = 0;
f_array_length_t position_name = 0;
+ fss_read_depth_t *current = 0;
for (i = 0; i < main->setting.depths.used; ++i) {
if (fss_read_signal_check(main)) return;
- main->setting.depths.array[i].depth = 0;
- main->setting.depths.array[i].index_at = 0;
- main->setting.depths.array[i].index_name = 0;
- main->setting.depths.array[i].value_at = 0;
- main->setting.depths.array[i].value_name.used = 0; // @fixme this needs to be fully reset to 0.
+ current = &main->setting.depths.array[i];
+ current->depth = 0;
+ current->index_at = 0;
+ current->index_name = 0;
+ current->value_at = 0;
+ current->value_name.used = 0;
- if (!parameters->array[fss_read_parameter_depth_e].values.used) {
- position_depth = 0;
- }
- else {
+ if (parameters->array[fss_read_parameter_depth_e].values.used) {
position_depth = parameters->array[fss_read_parameter_depth_e].values.array[i];
- main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[position_depth], &main->setting.depths.array[i].depth);
+ main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[position_depth], ¤t->depth);
if (F_status_is_error(main->setting.state.status)) {
if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
return;
}
}
+ else {
+ position_depth = 0;
+ }
if (parameters->array[fss_read_parameter_at_e].result & f_console_result_value_e) {
for (; position_at < parameters->array[fss_read_parameter_at_e].values.used; ++position_at) {
break;
}
- main->setting.depths.array[i].index_at = parameters->array[fss_read_parameter_at_e].values.array[position_at];
+ current->index_at = parameters->array[fss_read_parameter_at_e].values.array[position_at];
- main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[main->setting.depths.array[i].index_at], &main->setting.depths.array[i].value_at);
+ main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[current->index_at], ¤t->value_at);
if (F_status_is_error(main->setting.state.status)) {
if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- fll_error_parameter_integer_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(fl_conversion_dynamic_to_unsigned_detect), F_true, fss_read_long_at_s, parameters->arguments.array[main->setting.depths.array[i].index_at]);
+ fll_error_parameter_integer_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(fl_conversion_dynamic_to_unsigned_detect), F_true, fss_read_long_at_s, parameters->arguments.array[current->index_at]);
return;
}
break;
}
- main->setting.depths.array[i].index_name = parameters->array[fss_read_parameter_name_e].values.array[position_name];
+ current->index_name = parameters->array[fss_read_parameter_name_e].values.array[position_name];
if (parameters->array[fss_read_parameter_trim_e].result & f_console_result_found_e) {
- main->setting.state.status = f_rip_dynamic(parameters->arguments.array[main->setting.depths.array[i].index_name], &main->setting.depths.array[i].value_name);
+ main->setting.state.status = f_rip_dynamic(parameters->arguments.array[current->index_name], ¤t->value_name);
}
else {
- main->setting.state.status = f_string_dynamic_append(parameters->arguments.array[main->setting.depths.array[i].index_name], &main->setting.depths.array[i].value_name);
+ main->setting.state.status = f_string_dynamic_append(parameters->arguments.array[current->index_name], ¤t->value_name);
}
if (F_status_is_error(main->setting.state.status)) {
if (fss_read_signal_check(main)) return;
- if (main->setting.depths.array[i].depth == main->setting.depths.array[j].depth) {
+ current = &main->setting.depths.array[i];
+
+ if (current->depth == main->setting.depths.array[j].depth) {
main->setting.state.status = F_status_set_error(F_parameter);
if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- fss_read_print_error_parameter_value_once_only_number(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_depth_s, main->setting.depths.array[i].depth);
+ fss_read_print_error_parameter_value_once_only_number(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_depth_s, current->depth);
return;
}
- if (main->setting.depths.array[i].depth > main->setting.depths.array[j].depth) {
+ if (current->depth > main->setting.depths.array[j].depth) {
main->setting.state.status = F_status_set_error(F_parameter);
if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
}
- fss_read_print_error_parameter_value_before_value_number(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_depth_s, main->setting.depths.array[i].depth, main->setting.depths.array[j].depth);
+ fss_read_print_error_parameter_value_before_value_number(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_depth_s, current->depth, main->setting.depths.array[j].depth);
return;
}
} // for
} // for
- if (main->callback.process_load_depth) {
- main->callback.process_load_depth(arguments, (void *) main, parameters);
- if (F_status_is_error(main->setting.state.status)) return;
- }
-
main->setting.state.status = F_none;
}
#endif // _di_fss_read_setting_load_depth_
#endif
/**
+ * Make sure the array size of quotes_object and quotes_content matches the respective objects and contents.
+ *
+ * @param main
+ * The main program data.
+ *
+ * This alters main.setting.state.status:
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_uint8s_increase_by().
+ * Errors (with error bit) from: f_uint8ss_increase_by().
+ *
+ * @see f_uint8s_increase_by()
+ * @see f_uint8ss_increase_by()
+ */
+#ifndef _di_fss_read_ensure_quotes_length_
+ extern void fss_read_ensure_quotes_length(fss_read_main_t * const main);
+#endif // _di_fss_read_ensure_quotes_length_
+
+/**
* Perform the standard program setting load process.
*
* This prints error messages as appropriate.
* Must not be NULL.
* Must be of type fss_read_main_t.
*
- * This calls main.callback.process_load_depth() if not NULL.
- *
* This alters main.setting.state.status:
* F_none on success.
*
const f_string_t fss_read_f_a[] = {
"f_console_parameter_process",
"f_file_read_block",
- "f_file_size_by_id",
+ "f_file_size",
"f_file_stream_open",
"f_file_stream_read",
"f_file_stream_read_block",
"fll_program_parameter_process_context",
"fll_program_parameter_process_verbosity",
"fss_read_depths_resize",
+ "fss_read_ensure_quotes_length",
"fss_read_files_resize",
"fss_read_setting_load_depth",
};
enum {
fss_read_f_f_console_parameter_process_e,
fss_read_f_f_file_read_block_e,
- fss_read_f_f_file_size_by_id_e,
+ fss_read_f_f_file_size_e,
fss_read_f_f_file_stream_open_e,
fss_read_f_f_file_stream_read_e,
fss_read_f_f_file_stream_read_block_e,
fss_read_f_fll_program_parameter_process_context_e,
fss_read_f_fll_program_parameter_process_verbosity_e,
fss_read_f_fss_read_depths_resize_e,
+ fss_read_f_fss_read_ensure_quotes_length_e,
fss_read_f_fss_read_files_resize_e,
fss_read_f_fss_read_setting_load_depth_e,
}; // enum
if (!depths) return F_status_set_error(F_parameter);
if (depths->used + length > F_array_length_t_size_d) return F_status_set_error(F_array_too_large);
- f_status_t status = F_none;
-
for (f_array_length_t i = length; i < depths->size; ++i) {
fss_read_depth_delete(&depths->array[i]);
} // for
- status = f_memory_resize(depths->size, length, sizeof(fss_read_file_t), (void **) & depths->array);
+ const f_status_t status = f_memory_resize(depths->size, length, sizeof(fss_read_depth_t), (void **) & depths->array);
if (F_status_is_error(status)) return status;
depths->size = length;
f_array_length_t index_name;
f_number_unsigned_t value_at;
- f_string_dynamic_t value_name;
+ f_string_dynamic_t value_name;
} fss_read_depth_t;
#define fss_read_depth_t_initialize \
/**
* The FSS read callbacks.
*
- * process_help: Process help (generally printing help).
- * process_last_line: Process printing last line if necessary when loading in a file (or pipe).
- * process_load_depth: Process loading of the depth related parameters when loading the settings.
- * process_normal: Process normally (data from parameters and files).
+ * process_help: Process help (generally printing help).
+ * process_last_line: Process printing last line if necessary when loading in a file (or pipe).
+ * process_normal: Process normally (data from parameters and files).
*
- * process_at: Process at parameter, usually called by the process_normal() callback.
- * process_columns: Process columns parameter, usually called by the process_normal() callback.
- * process_line: Process line parameter, usually called by the process_normal() callback.
- * process_load: Process loading of FSS data from buffer (not to be confused with loading settings), usually called by the process_normal() callback.
- * process_name: Process name parameter, usually called by the process_normal() callback.
- * process_total: Process total parameter, usually called by the process_normal() callback.
+ * process_at: Process at parameter, usually called by the process_normal() callback.
+ * process_columns: Process columns parameter, usually called by the process_normal() callback.
+ * process_line: Process line parameter, usually called by the process_normal() callback.
+ * process_load: Process loading of FSS data from buffer (not to be confused with loading settings), usually called by the process_normal() callback.
+ * process_name: Process name parameter, usually called by the process_normal() callback.
+ * process_total: Process total parameter, usually called by the process_normal() callback.
*
* print_at: Print at the given location, usually called by the process_normal() callback.
* print_object: Print the Object, usually called by the process_normal() callback.
typedef struct {
void (*process_help)(void * const main);
void (*process_last_line)(void * const main);
- void (*process_load_depth)(const f_console_arguments_t arguments, void * const main, f_console_parameters_t * const parameters);
void (*process_normal)(void * const main);
void (*process_at)(void * const main, const bool names[], const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content);
main->callback.process_help = &fss_read_main_process_help;
main->callback.process_last_line = &fss_read_process_last_line;
- main->callback.process_load_depth = &fss_read_setting_load_depth;
main->callback.process_normal = &fss_read_process_normal;
main->callback.process_at = &fss_read_process_normal_at;
main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_content_e;
main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_object_e;
- main->setting.flag |= fss_read_main_flag_trim_object_e;
-
main->callback.process_help = &fss_read_basic_list_process_help;
main->callback.process_load = &fss_read_basic_list_process_load;
main->callback.print_set_end = &fss_read_print_set_end;
main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_content_e;
main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_object_e;
- main->setting.flag |= fss_read_main_flag_trim_object_e;
-
main->callback.process_help = &fss_read_extended_list_process_help;
main->callback.process_load = &fss_read_extended_list_process_load;
main->callback.print_set_end = &fss_read_print_set_end;
main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_content_e;
main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_object_e;
- main->setting.flag |= fss_read_main_flag_trim_object_e;
main->setting.flag |= fss_read_main_flag_content_multiple_e | fss_read_main_flag_depth_multiple_e;
main->callback.process_help = &fss_read_embedded_list_process_help;
main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_content_e;
main->setting.flag -= main->setting.flag & fss_read_main_flag_quote_object_e;
- main->setting.flag |= fss_read_main_flag_trim_object_e;
-
main->callback.process_help = &fss_read_payload_process_help;
main->callback.process_load = &fss_read_payload_process_load;
main->callback.print_set_end = &fss_read_print_set_end;
if ((main->setting.flag & fss_read_main_flag_content_e) && main->setting.contents.array[at].used) {
if (main->callback.print_content) {
- main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[0], main->setting.quotes_content.array[at].array[0], delimits_content);
+ main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[0], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[0] : 0, delimits_content);
}
}
if (!print) return F_status_set_error(F_output_not);
- fll_print_dynamic_raw(
- type == f_fss_quote_type_single_e
- ? f_fss_quote_single_s
- : type == f_fss_quote_type_backtick_e
- ? f_fss_quote_backtick_s
- : f_fss_quote_double_s,
- print->to
- );
+ if (type) {
+ fll_print_dynamic_raw(
+ type == f_fss_quote_type_single_e
+ ? f_fss_quote_single_s
+ : type == f_fss_quote_type_backtick_e
+ ? f_fss_quote_backtick_s
+ : f_fss_quote_double_s,
+ print->to
+ );
+ }
return F_none;
}
}
}
+ fss_read_ensure_quotes_length(main);
+
+ if (F_status_is_error(main->setting.state.status)) {
+ fss_read_print_error(&main->program.error, macro_fss_read_f(fss_read_ensure_quotes_length));
+
+ return;
+ }
+
main->setting.state.status = F_none;
}
#endif // _di_fss_read_payload_process_load_
*
* Errors (with error bit) from: fll_fss_payload_read()
*
+ * Errors (with error bit) from: fss_read_ensure_quotes_length()
+ *
+ * @see fss_read_ensure_quotes_length()
* @see fll_fss_payload_read()
*
* @see fss_read_file_identify()
data.program.output.custom = (void *) &data;
data.program.warning.custom = (void *) &data;
- data.setting.flag |= fss_read_main_flag_trim_object_e;
-
data.setting.state.custom = (void *) &data;
data.setting.standard = fss_read_payload_standard_s;
data.callback.process_help = &fss_read_payload_process_help;
data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process_load_depth = &fss_read_setting_load_depth;
data.callback.process_normal = &fss_read_process_normal;
data.callback.process_at = &fss_read_process_normal_at;