A copy and paste mistake where f_fss_quote_type_double_e when instead f_fss_quote_type_single_e should be used resulted in the quote being set to NULL.
Also do some code clean up.
return F_fss_found_content_not;
}
- if (status == F_none_eos) {
- return F_data_not_eos;
- }
-
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_eos) return F_data_not_eos;
+ if (status == F_none_stop) return F_data_not_stop;
status = f_string_ranges_increase(state.step_small, found);
if (F_status_is_error(status)) return status;
status = f_fss_skip_past_delimit(state, buffer, range);
if (F_status_is_error(status)) break;
- if (status == F_none_eos || status == F_none_stop) {
- return status;
- }
-
+ if (status == F_none_eos || status == F_none_stop) return status;
if (buffer.string[range->start] == f_fss_basic_close_s.string[0]) break;
} // for
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
found->array[found->used++].stop = range->start - 1;
destination->string[destination->used++] = f_fss_basic_close_s.string[0];
}
- if (range->start > range->stop) {
- return F_data_not_stop;
- }
+ if (range->start > range->stop) return F_data_not_stop;
return F_data_not_eos;
}
if (state.interrupt) {
status = state.interrupt((void *) &state, 0);
- if (F_status_set_fine(status) == F_interrupt) {
- return F_status_set_error(F_interrupt);
- }
+ if (F_status_set_fine(status) == F_interrupt) return F_status_set_error(F_interrupt);
}
if (content.string[range->start] == f_fss_eol_s.string[0]) {
destination->string[destination->used++] = f_fss_basic_close_s.string[0];
}
- if (range->start > range->stop) {
- return F_none_stop;
- }
+ if (range->start > range->stop) return F_none_stop;
return F_none_eos;
}
destination->string[destination->used++] = f_fss_basic_list_close_s.string[0];
}
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_stop) return F_data_not_stop;
return F_data_not_eos;
}
}
}
- if (range->start > range->stop) {
- return F_none_stop;
- }
-
- if (range->start >= content.used) {
- return F_none_eos;
- }
+ if (range->start > range->stop) return F_none_stop;
+ if (range->start >= content.used) return F_none_eos;
return F_none;
}
return F_fss_found_object_not;
}
- if (status == F_none_eos) {
- return F_data_not_eos;
- }
-
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_eos) return F_data_not_eos;
+ if (status == F_none_stop) return F_data_not_stop;
// Begin the search.
found->start = range->start;
status = f_fss_seek_to_eol(state, buffer, range);
if (F_status_is_error(status)) return status;
- if (status == F_none_eos) {
- return F_data_not_eos;
- }
-
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_eos) return F_data_not_eos;
+ if (status == F_none_stop) return F_data_not_stop;
// Move the start position to after the EOL.
++range->start;
if (F_status_set_fine(status) == F_interrupt) {
status = F_status_set_error(F_interrupt);
+
break;
}
}
return status;
}
- if (status == F_none_eos) {
- return F_data_not_eos;
- }
-
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_eos) return F_data_not_eos;
+ if (status == F_none_stop) return F_data_not_stop;
// seek to the end of the line when no valid object is found.
status = f_fss_seek_to_eol(state, buffer, range);
}
}
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_stop) return F_data_not_stop;
return F_data_not_eos;
}
}
}
- if (range->start > range->stop) {
- return F_none_stop;
- }
-
- if (range->start >= object.used) {
- return F_none_eos;
- }
+ if (range->start > range->stop) return F_none_stop;
+ if (range->start >= object.used) return F_none_eos;
return F_none;
}
delimits->used = delimits_used;
comments->used = comments_used;
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
if (range->start > range->stop) {
- if (!depth) {
- return F_status_set_error(F_end_not_stop);
- }
+ if (!depth) return F_status_set_error(F_end_not_stop);
return F_status_set_error(F_end_not_nest_stop);
}
- if (!depth) {
- return F_status_set_error(F_end_not_eos);
- }
+ if (!depth) return F_status_set_error(F_end_not_eos);
return F_status_set_error(F_end_not_nest_eos);
}
}
range->start = start + 1;
+
continue;
}
}
destination->string[destination->used++] = content.string[start];
range->start = start + 1;
+
continue;
}
}
destination->string[destination->used++] = content.string[start];
range->start = start + 1;
+
continue;
}
else if (content.string[range->start] == f_fss_comment_s.string[0] && !has_graph) {
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
destination->string[destination->used++] = f_fss_embedded_list_close_end_s.string[0];
}
- if (range->start > range->stop) {
- return F_none_stop;
- }
-
- if (range->start >= content.used) {
- return F_none_eos;
- }
+ if (range->start > range->stop) return F_none_stop;
+ if (range->start >= content.used) return F_none_eos;
return F_none;
}
return F_fss_found_object_not;
}
- if (status == F_none_eos) {
- return F_data_not_eos;
- }
-
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_eos) return F_data_not_eos;
+ if (status == F_none_stop) return F_data_not_stop;
// Return found nothing if this line only contains white space and delimit placeholders.
if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
return status;
}
- if (status == F_none_eos) {
- return F_data_not_eos;
- }
-
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_eos) return F_data_not_eos;
+ if (status == F_none_stop) return F_data_not_stop;
// Move the start position to after the EOL.
++range->start;
}
}
- if (range->start > range->stop) {
- return F_none_stop;
- }
-
- if (range->start >= object.used) {
- return F_none_eos;
- }
+ if (range->start > range->stop) return F_none_stop;
+ if (range->start >= object.used) return F_none_eos;
return F_none;
}
return F_fss_found_content_not;
}
- if (status == F_none_eos) {
- return F_data_not_eos;
- }
-
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_eos) return F_data_not_eos;
+ if (status == F_none_stop) return F_data_not_stop;
const f_array_length_t delimits_used = delimits->used;
const f_array_length_t quotes_used = quotes ? quotes->used : 0;
if (quoted == f_fss_quote_type_double_e) {
quotes->array[quotes->used] = f_string_ascii_quote_double_s.string[0];
}
- else if (quoted == f_fss_quote_type_double_e) {
+ else if (quoted == f_fss_quote_type_single_e) {
quotes->array[quotes->used] = f_string_ascii_quote_single_s.string[0];
}
else {
} // while
if (content_found) {
- if (content_found == 2) {
- return status;
- }
+ if (content_found == 2) return status;
return F_fss_found_content;
}
destination->string[destination->used++] = f_fss_extended_close_s.string[0];
}
- if (status == F_data_not_stop) {
- return F_none_stop;
- }
+ if (status == F_data_not_stop) return F_none_stop;
return F_none_eos;
}
destination->string[destination->used++] = f_fss_extended_list_close_end_s.string[0];
}
- if (range->start > range->stop) {
- return F_none_stop;
- }
-
- if (range->start >= content.used) {
- return F_none_eos;
- }
+ if (range->start > range->stop) return F_none_stop;
+ if (range->start >= content.used) return F_none_eos;
return F_none;
}
return F_fss_found_object_not;
}
- if (status == F_none_eos) {
- return F_data_not_eos;
- }
-
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_eos) return F_data_not_eos;
+ if (status == F_none_stop) return F_data_not_stop;
// Return found nothing if this line only contains white space and delimit placeholders.
if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
return status;
}
- if (status == F_none_eos) {
- return F_data_not_eos;
- }
-
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_eos) return F_data_not_eos;
+ if (status == F_none_stop) return F_data_not_stop;
// Move the start position to after the EOL.
++range->start;
}
}
- if (range->start > range->stop) {
- return F_none_stop;
- }
-
- if (range->start >= object.used) {
- return F_none_eos;
- }
+ if (range->start > range->stop) return F_none_stop;
+ if (range->start >= object.used) return F_none_eos;
return F_none;
}
status = f_string_rangess_increase(state.step_small, contents);
if (F_status_is_error(status)) return status;
+ contents->array[contents->used].used = 0;
+
if (objects_quoted) {
status = f_uint8s_increase(state.step_small, objects_quoted);
if (F_status_is_error(status)) return status;
}
if (found_data) {
- if (range->start >= buffer.used) {
- return F_none_eos;
- }
+ if (range->start >= buffer.used) return F_none_eos;
return F_none_stop;
}
- else {
- if (range->start >= buffer.used) {
- return F_data_not_eos;
- }
- return F_data_not_stop;
- }
+ if (range->start >= buffer.used) return F_data_not_eos;
+
+ return F_data_not_stop;
}
if (status == F_fss_found_object) {
return status;
}
- else if (status == F_data_not_eos || status == F_data_not_stop) {
+
+ if (status == F_data_not_eos || status == F_data_not_stop) {
// If at least some valid object was found, then return F_none equivelents.
if (objects->used > initial_used) {
- if (status == F_data_not_eos) {
- return F_none_eos;
- }
-
- if (status == F_data_not_stop) {
- return F_none_stop;
- }
+ if (status == F_data_not_eos) return F_none_eos;
+ if (status == F_data_not_stop) return F_none_stop;
}
return status;
}
- else if (status != F_fss_found_object && status != F_fss_found_content && status != F_fss_found_content_not && status != F_fss_found_object_content_not) {
+
+ if (status != F_fss_found_object && status != F_fss_found_content && status != F_fss_found_content_not && status != F_fss_found_object_content_not) {
return status;
}
+
// When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
- else if (range->start >= range->stop || range->start >= buffer.used) {
+ if (range->start >= range->stop || range->start >= buffer.used) {
if (status == F_fss_found_object || status == F_fss_found_content || status == F_fss_found_content_not || status == F_fss_found_object_content_not) {
++objects->used;
++contents->used;
}
}
- if (range->start >= buffer.used) {
- return F_none_eos;
- }
+ if (range->start >= buffer.used) return F_none_eos;
return F_none_stop;
}
status = f_string_rangess_increase(state.step_small, contents);
if (F_status_is_error(status)) return status;
+ contents->array[contents->used].used = 0;
+
do {
status = fl_fss_basic_list_object_read(buffer, state, range, &objects->array[objects->used], objects_delimits);
if (F_status_is_error(status)) return status;
}
if (found_data) {
- if (range->start >= buffer.used) {
- return F_none_eos;
- }
+ if (range->start >= buffer.used) return F_none_eos;
return F_none_stop;
}
- if (range->start >= buffer.used) {
- return F_data_not_eos;
- }
+ if (range->start >= buffer.used) return F_data_not_eos;
return F_data_not_stop;
}
// If at least some valid object was found, then return F_none equivalents.
if (objects->used > initial_used) {
- if (status == F_data_not_eos) {
- return F_none_eos;
- }
-
- if (status == F_data_not_stop) {
- return F_none_stop;
- }
+ if (status == F_data_not_eos) return F_none_eos;
+ if (status == F_data_not_stop) return F_none_stop;
}
return status;
++contents->used;
}
- if (range->start >= buffer.used) {
- return F_none_eos;
- }
+ if (range->start >= buffer.used) return F_none_eos;
return F_none_stop;
}
status = f_fss_items_resize(state.step_small, &nest->depth[0]);
if (F_status_is_error(status)) return status;
+ nest->depth[nest->used].used = 0;
+
status = fl_fss_embedded_list_object_read(buffer, state, range, &nest->depth[0].array[nest->depth[0].used].object, objects_delimits);
if (F_status_is_error(status)) return status;
}
if (found_data) {
- if (range->start >= buffer.used) {
- return F_none_eos;
- }
+ if (range->start >= buffer.used) return F_none_eos;
return F_none_stop;
}
- else {
- if (range->start >= buffer.used) {
- return F_data_not_eos;
- }
- return F_data_not_stop;
- }
+ if (range->start >= buffer.used) return F_data_not_eos;
+
+ return F_data_not_stop;
}
if (status == F_fss_found_object) {
if (status == F_none_eos || status == F_none_stop) {
return status;
}
- else if (status == F_data_not_eos || status == F_data_not_stop) {
+
+ if (status == F_data_not_eos || status == F_data_not_stop) {
// If at least some valid object was found, then return F_none equivalents.
if (nest->depth[0].used > initial_used) {
- if (status == F_data_not_eos) {
- return F_none_eos;
- }
-
- if (status == F_data_not_stop) {
- return F_none_stop;
- }
+ if (status == F_data_not_eos) return F_none_eos;
+ if (status == F_data_not_stop) return F_none_stop;
}
return status;
}
- else if (status == F_end_not_eos || status == F_end_not_stop || status == F_end_not_nest_eos || status == F_end_not_nest_stop) {
+
+ if (status == F_end_not_eos || status == F_end_not_stop || status == F_end_not_nest_eos || status == F_end_not_nest_stop) {
// If at least some valid object was found, then return F_none equivalents.
if (nest->depth[0].used > initial_used) {
- if (status == F_data_not_eos) {
- return F_none_eos;
- }
-
- if (status == F_data_not_stop) {
- return F_none_stop;
- }
+ if (status == F_data_not_eos) return F_none_eos;
+ if (status == F_data_not_stop) return F_none_stop;
}
return status;
}
- else if (status != F_fss_found_object && status != F_fss_found_content && status != F_fss_found_content_not && status != F_fss_found_object_content_not) {
+
+ if (status != F_fss_found_object && status != F_fss_found_content && status != F_fss_found_content_not && status != F_fss_found_object_content_not) {
return status;
}
- else if (range->start >= range->stop || range->start >= buffer.used) {
+
+ if (range->start >= range->stop || range->start >= buffer.used) {
// When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
- if (range->start >= buffer.used) {
- return F_none_eos;
- }
+ if (range->start >= buffer.used) return F_none_eos;
return F_none_stop;
}
status = f_string_rangess_increase(state.step_small, contents);
if (F_status_is_error(status)) return status;
+ contents->array[contents->used].used = 0;
+
if (objects_quoted) {
status = f_uint8s_increase(state.step_small, objects_quoted);
if (F_status_is_error(status)) return status;
if (contents_quoted) {
status = f_uint8ss_increase(state.step_small, contents_quoted);
if (F_status_is_error(status)) return status;
+
+ contents_quoted->array[contents_quoted->used].used = 0;
}
do {
}
if (found_data) {
- if (range->start >= buffer.used) {
- return F_none_eos;
- }
+ if (range->start >= buffer.used) return F_none_eos;
return F_none_stop;
}
- if (range->start >= buffer.used) {
- return F_data_not_eos;
- }
+ if (range->start >= buffer.used) return F_data_not_eos;
return F_data_not_stop;
}
break;
}
- else if (status == F_fss_found_object_content_not) {
+
+ if (status == F_fss_found_object_content_not) {
found_data = F_true;
break;
return status;
}
- else if (status == F_data_not_eos || status == F_data_not_stop || status == F_end_not_group_eos || status == F_end_not_group_stop) {
+
+ if (status == F_data_not_eos || status == F_data_not_stop || status == F_end_not_group_eos || status == F_end_not_group_stop) {
// If at least some valid object was found, then return F_none equivelents.
if (objects->used > initial_used) {
- if (status == F_data_not_eos) {
- return F_none_eos;
- }
-
- if (status == F_data_not_stop) {
- return F_none_stop;
- }
+ if (status == F_data_not_eos) return F_none_eos;
+ if (status == F_data_not_stop) return F_none_stop;
}
return status;
}
- else if (status != F_fss_found_object && status != F_fss_found_content && status != F_fss_found_content_not && status != F_fss_found_object_content_not && status != F_end_not_group) {
+
+ if (status != F_fss_found_object && status != F_fss_found_content && status != F_fss_found_content_not && status != F_fss_found_object_content_not && status != F_end_not_group) {
return status;
}
- else if (range->start >= range->stop || range->start >= buffer.used) {
+
+ if (range->start >= range->stop || range->start >= buffer.used) {
// When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
if (status == F_fss_found_object || status == F_fss_found_content || status == F_fss_found_content_not || status == F_fss_found_object_content_not || status == F_end_not_group) {
}
if (range->start >= buffer.used) {
- if (status == F_end_not_group) {
- return F_end_not_group_eos;
- }
+ if (status == F_end_not_group) return F_end_not_group_eos;
return F_none_eos;
}
- if (status == F_end_not_group) {
- return F_end_not_group_stop;
- }
+ if (status == F_end_not_group) return F_end_not_group_stop;
return F_none_stop;
}
status = f_string_rangess_increase(state.step_small, contents);
if (F_status_is_error(status)) return status;
+ contents->array[contents->used].used = 0;
+
do {
status = fl_fss_extended_list_object_read(buffer, state, range, &objects->array[objects->used], objects_delimits);
if (F_status_is_error(status)) return status;
}
if (found_data) {
- if (range->start >= buffer.used) {
- return F_none_eos;
- }
+ if (range->start >= buffer.used) return F_none_eos;
return F_none_stop;
}
- else {
- if (range->start >= buffer.used) {
- return F_data_not_eos;
- }
- return F_data_not_stop;
- }
+ if (range->start >= buffer.used) return F_data_not_eos;
+
+ return F_data_not_stop;
}
if (status == F_fss_found_object) {
return status;
}
- else if (status == F_data_not_eos || status == F_data_not_stop) {
+
+ if (status == F_data_not_eos || status == F_data_not_stop) {
// If at least some valid object was found, then return F_none equivalents.
if (objects->used > initial_used) {
- if (status == F_data_not_eos) {
- return F_none_eos;
- }
-
- if (status == F_data_not_stop) {
- return F_none_stop;
- }
+ if (status == F_data_not_eos) return F_none_eos;
+ if (status == F_data_not_stop) return F_none_stop;
}
return status;
}
- else if (status != F_fss_found_object && status != F_fss_found_content && status != F_fss_found_content_not && status != F_fss_found_object_content_not) {
+
+ if (status != F_fss_found_object && status != F_fss_found_content && status != F_fss_found_content_not && status != F_fss_found_object_content_not) {
return status;
}
- else if (range->start >= range->stop || range->start >= buffer.used) {
+
+ if (range->start >= range->stop || range->start >= buffer.used) {
// When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
if (status == F_fss_found_object || status == F_fss_found_content || status == F_fss_found_content_not || status == F_fss_found_object_content_not) {
++contents->used;
}
- if (range->start >= buffer.used) {
- return F_none_eos;
- }
+ if (range->start >= buffer.used) return F_none_eos;
return F_none_stop;
}
status = f_string_rangess_increase(state.step_small, contents);
if (F_status_is_error(status)) return status;
+ contents->array[contents->used].used = 0;
+
do {
status = fl_fss_basic_list_object_read(buffer, state, range, &objects->array[objects->used], objects_delimits);
if (F_status_is_error(status)) return status;
if (fl_string_dynamic_partial_compare_string(f_fss_string_payload_s.string, buffer, f_fss_string_payload_s.used, objects->array[objects->used]) == F_equal_to) {
status = F_fss_found_object_content_not;
}
- else {
- // Returning without a "payload" is an error.
+ // Returning without a "payload" is an error.
+ else {
status = F_status_set_error(F_fss_found_object_content_not);
}
// Returning without a "payload" is an error.
if (found_data) {
- if (range->start >= buffer.used) {
- return F_status_set_error(F_none_eos);
- }
+ if (range->start >= buffer.used) return F_status_set_error(F_none_eos);
return F_status_set_error(F_none_stop);
}
- if (range->start >= buffer.used) {
- return F_status_set_error(F_data_not_eos);
- }
+ if (range->start >= buffer.used) return F_status_set_error(F_data_not_eos);
return F_status_set_error(F_data_not_stop);
}
status2 = f_string_ranges_increase(state.step_small, &contents->array[contents->used]);
if (F_status_is_error(status2)) return status2;
+ contents->array[contents->used].used = 0;
+
if (fl_string_dynamic_partial_compare_string(f_fss_string_payload_s.string, buffer, f_fss_string_payload_s.used, objects->array[objects->used]) == F_equal_to) {
++objects->used;
if (objects->used > initial_used) {
// Returning without a "payload" is an error.
- if (status == F_data_not_eos) {
- return F_status_set_error(F_none_eos);
- }
-
- if (status == F_data_not_stop) {
- return F_status_set_error(F_none_stop);
- }
+ if (status == F_data_not_eos) return F_status_set_error(F_none_eos);
+ if (status == F_data_not_stop) return F_status_set_error(F_none_stop);
}
return F_status_set_error(status);
}
// Returning without a "payload" is an error.
- if (range->start >= buffer.used) {
- return F_status_set_error(F_none_eos);
- }
+ if (range->start >= buffer.used) return F_status_set_error(F_none_eos);
return F_status_set_error(F_none_stop);
}
if (state.interrupt) {
status = state.interrupt((void *) &state, 0);
- if (F_status_set_fine(status) == F_interrupt) {
- return F_status_set_error(F_interrupt);
- }
+ if (F_status_set_fine(status) == F_interrupt) return F_status_set_error(F_interrupt);
}
memcpy(destination->string + destination->used + i, content.string + i, sizeof(f_char_t) * F_fss_default_block_size_normal_d);