The delimits are no longer modified in place.
Make the buffer a constant static dynamic string.
Remove comment about updating the buffer, which is no longer correct.
#endif
#ifndef _di_fl_fss_basic_object_read_
- f_return_status fl_fss_basic_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quote, f_fss_delimits_t *delimits) {
+ f_return_status fl_fss_basic_object_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quote, f_fss_delimits_t *delimits) {
#ifndef _di_level_1_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!found) return F_status_set_error(F_parameter);
if (!delimits) return F_status_set_error(F_parameter);
const f_array_length_t delimits_used = delimits->used;
- f_status_t status = private_fl_fss_basic_read(F_true, buffer, range, found, quote, delimits);
+ f_status_t status = private_fl_fss_basic_read(buffer, F_true, range, found, quote, delimits);
if (F_status_is_error(status)) {
delimits->used = delimits_used;
#endif // _di_fl_fss_basic_object_read_
#ifndef _di_fl_fss_basic_content_read_
- f_return_status fl_fss_basic_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits) {
+ f_return_status fl_fss_basic_content_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits) {
#ifndef _di_level_1_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!found) return F_status_set_error(F_parameter);
if (!delimits) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- f_status_t status = f_fss_skip_past_space(*buffer, range);
+ f_status_t status = f_fss_skip_past_space(buffer, range);
if (F_status_is_error(status)) return status;
if (status == F_none_eol) {
for (;; range->start++) {
- status = f_fss_skip_past_delimit(*buffer, range);
+ status = f_fss_skip_past_delimit(buffer, range);
if (F_status_is_error(status)) return status;
if (status == F_none_eos || status == F_none_stop) {
return status;
}
- if (buffer->string[range->start] == f_fss_basic_close) break;
+ if (buffer.string[range->start] == f_fss_basic_close) break;
} // for
found->array[found->used++].stop = range->start - 1;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
return FL_fss_found_content;
*
* @param buffer
* The buffer to read from.
- * This will be updated with delimit placeholders as it is being processed.
* @param range
* The start/stop location within the buffer to be processed.
* The start location will be updated as the buffer is being processed.
* Errors (with error bit) from: f_fss_skip_past_space().
*/
#ifndef _di_fl_fss_basic_object_read_
- extern f_return_status fl_fss_basic_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quote, f_fss_delimits_t *delimits);
+ extern f_return_status fl_fss_basic_object_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quote, f_fss_delimits_t *delimits);
#endif // _di_fl_fss_basic_object_read_
/**
*
* @param buffer
* The buffer to read from.
- * This will be updated with delimit placeholders as it is being processed.
* @param range
* The start/stop location within the buffer to be processed.
* The start location will be updated as the buffer is being processed.
* Errors (with error bit) from: f_fss_skip_past_space().
*/
#ifndef _di_fl_fss_basic_content_read_
- extern f_return_status fl_fss_basic_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits);
+ extern f_return_status fl_fss_basic_content_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits);
#endif // _di_fl_fss_basic_content_read_
/**
#endif
#ifndef _di_fl_fss_basic_list_object_read_
- f_return_status fl_fss_basic_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits) {
+ f_return_status fl_fss_basic_list_object_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits) {
#ifndef _di_level_1_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!found) return F_status_set_error(F_parameter);
if (!delimits) return F_status_set_error(F_parameter);
const f_array_length_t delimits_used = delimits->used;
- f_status_t status = f_fss_skip_past_space(*buffer, range);
+ f_status_t status = f_fss_skip_past_space(buffer, range);
if (F_status_is_error(status)) return status;
if (status == F_none_eol) {
found->start = range->start;
// ignore all comment lines.
- if (buffer->string[range->start] == f_fss_comment) {
+ if (buffer.string[range->start] == f_fss_comment) {
- status = f_fss_seek_to_eol(*buffer, range);
+ status = f_fss_seek_to_eol(buffer, range);
if (F_status_is_error(status)) return status;
if (status == F_none_eos) {
bool graph_first = F_true;
// identify where the object ends.
- while (range->start <= range->stop && range->start < buffer->used && buffer->string[range->start] != f_fss_eol) {
+ while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol) {
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
slash_first = range->start;
slash_count = 1;
- for (range->start++; range->start <= range->stop && range->start < buffer->used; range->start++) {
+ for (range->start++; range->start <= range->stop && range->start < buffer.used; range->start++) {
- if (buffer->string[range->start] == f_fss_delimit_placeholder) {
+ if (buffer.string[range->start] == f_fss_delimit_placeholder) {
continue;
- } else if (buffer->string[range->start] != f_fss_delimit_slash) {
+ } else if (buffer.string[range->start] != f_fss_delimit_slash) {
break;
}
slash_count++;
} // for
- fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
- if (buffer->string[range->start] == f_fss_basic_list_open) {
+ if (buffer.string[range->start] == f_fss_basic_list_open) {
graph_first = F_false;
stop = range->start - 1;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) break;
+ if (buffer.string[range->start] == f_fss_eol) break;
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) break;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
start = range->start;
range->start = slash_first;
if (slash_count % 2 == 0) {
while (slash_count > 0) {
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
delimits->used++;
slash_count--;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) {
delimits->used = delimits_used;
return FL_fss_found_object_not;
}
}
- else if (graph_first && buffer->string[range->start] == f_fss_comment) {
+ else if (graph_first && buffer.string[range->start] == f_fss_comment) {
graph_first = F_false;
// comments may only have whitespace before the '#', therefore only the first slash needs to be delimited.
continue;
}
- else if (buffer->string[range->start] == f_fss_basic_list_open) {
+ else if (buffer.string[range->start] == f_fss_basic_list_open) {
graph_first = F_false;
stop = range->start - 1;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) break;
+ if (buffer.string[range->start] == f_fss_eol) break;
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) break;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
- fl_macro_fss_object_return_on_overflow_delimited((*buffer), (*range), (*found), F_none_eos, F_none_stop);
+ fl_macro_fss_object_return_on_overflow_delimited((buffer), (*range), (*found), F_none_eos, F_none_stop);
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
found->stop = stop;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
return FL_fss_found_object;
continue;
}
else if (graph_first) {
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) {
}
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
}
// seek to the end of the line when no valid object is found.
- status = f_fss_seek_to_eol(*buffer, range);
+ status = f_fss_seek_to_eol(buffer, range);
// move the start position to after the EOL.
range->start++;
#endif // _di_fl_fss_basic_list_object_read_
#ifndef _di_fl_fss_basic_list_content_read_
- f_return_status fl_fss_basic_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments) {
+ f_return_status fl_fss_basic_list_content_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments) {
#ifndef _di_level_1_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!found) return F_status_set_error(F_parameter);
if (!delimits) return F_status_set_error(F_parameter);
const f_array_length_t delimits_used = delimits->used;
const f_array_length_t comments_used = comments->used;
- f_status_t status = f_fss_skip_past_delimit(*buffer, range);
+ f_status_t status = f_fss_skip_past_delimit(buffer, range);
if (F_status_is_error(status)) return status;
- fl_macro_fss_content_with_comments_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, F_none_eos, F_none_stop);
+ fl_macro_fss_content_with_comments_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, F_none_eos, F_none_stop);
status = private_fl_fss_ranges_increase(found);
if (F_status_is_error(status)) return status;
uint8_t graph_first = 0x1; // 0x0 = false, 0x1 = true, 0x2 = false, but there is a delimited comment, comment_delimit is set.
// identify where the content ends.
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
if (graph_first == 0x2) {
status = private_fl_fss_delimits_increase(delimits);
if (F_status_is_error(status)) break;
continue;
}
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
slash_first = range->start;
slash_count = 1;
- for (range->start++; range->start <= range->stop && range->start < buffer->used; range->start++) {
+ for (range->start++; range->start <= range->stop && range->start < buffer.used; range->start++) {
- if (buffer->string[range->start] == f_fss_delimit_placeholder) {
+ if (buffer.string[range->start] == f_fss_delimit_placeholder) {
continue;
- } else if (buffer->string[range->start] != f_fss_delimit_slash) {
+ } else if (buffer.string[range->start] != f_fss_delimit_slash) {
break;
}
slash_count++;
} // for
- if (range->start > range->stop || range->start >= buffer->used) break;
+ if (range->start > range->stop || range->start >= buffer.used) break;
- if (buffer->string[range->start] == f_fss_basic_list_open) {
+ if (buffer.string[range->start] == f_fss_basic_list_open) {
graph_first = 0x0;
range->start++;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) break;
+ if (buffer.string[range->start] == f_fss_eol) break;
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) break;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
- if (range->start > range->stop || range->start >= buffer->used) break;
+ if (range->start > range->stop || range->start >= buffer.used) break;
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
start = range->start;
range->start = slash_first;
while (slash_count > 0) {
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used++] = range->start;
}
slash_count--;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
range->start = start + 1;
}
}
- else if (graph_first == 0x1 && buffer->string[range->start] == f_fss_comment) {
+ else if (graph_first == 0x1 && buffer.string[range->start] == f_fss_comment) {
graph_first = 0x2;
comment_delimit = slash_first;
range->start++;
continue;
}
- if (buffer->string[range->start] == f_fss_basic_list_open) {
+ if (buffer.string[range->start] == f_fss_basic_list_open) {
range->start++;
graph_first = 0x0;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) break;
+ if (buffer.string[range->start] == f_fss_eol) break;
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) break;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
if (F_status_is_error(status)) break;
- if (range->start > range->stop || range->start >= buffer->used) break;
+ if (range->start > range->stop || range->start >= buffer.used) break;
// found a valid object, set stop point to last newline.
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
- if (newline_last == found->array[found->used].start && buffer->string[found->array[found->used].start] != f_fss_eol) {
+ if (newline_last == found->array[found->used].start && buffer.string[found->array[found->used].start] != f_fss_eol) {
range->start = newline_last;
return FL_fss_found_content_not;
}
return FL_fss_found_content;
}
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
if (graph_first == 0x2) {
status = private_fl_fss_delimits_increase(delimits);
if (F_status_is_error(status)) break;
continue;
}
- if (graph_first == 0x1 && buffer->string[range->start] == f_fss_comment) {
+ if (graph_first == 0x1 && buffer.string[range->start] == f_fss_comment) {
start = range->start;
- status = f_fss_seek_to_eol(*buffer, range);
+ status = f_fss_seek_to_eol(buffer, range);
if (F_status_is_error(status)) break;
status = private_fl_fss_ranges_increase(comments);
if (F_status_is_error(status)) break;
- if (range->start > range->stop || range->start >= buffer->used) {
+ if (range->start > range->stop || range->start >= buffer.used) {
range->start--;
}
else {
}
if (graph_first == 0x1) {
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) {
}
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
found->array[found->used++].stop = range->start - 1;
- fl_macro_fss_content_return_on_overflow_delimited((*buffer), (*range), (*found), F_none_eos, F_none_stop);
+ fl_macro_fss_content_return_on_overflow_delimited((buffer), (*range), (*found), F_none_eos, F_none_stop);
return FL_fss_found_content;
}
*
* @param buffer
* The buffer to read from.
- * This will be updated with delimit placeholders as it is being processed.
* @param range
* The start/stop location within the buffer to be processed.
* The start location will be updated as the buffer is being processed.
* Errors (with error bit) from: f_fss_skip_past_space().
*/
#ifndef _di_fl_fss_basic_list_object_read_
- extern f_return_status fl_fss_basic_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits);
+ extern f_return_status fl_fss_basic_list_object_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits);
#endif // _di_fl_fss_basic_list_object_read_
/**
*
* @param buffer
* The buffer to read from.
- * This will be updated with delimit placeholders as it is being processed.
* @param range
* The start/stop location within the buffer to be processed.
* The start location will be updated as the buffer is being processed.
* Errors (with error bit) from: f_fss_skip_past_space().
*/
#ifndef _di_fl_fss_basic_list_content_read_
- extern f_return_status fl_fss_basic_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments);
+ extern f_return_status fl_fss_basic_list_content_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments);
#endif // _di_fl_fss_basic_list_content_read_
/**
#endif
#ifndef _di_fl_fss_embedded_list_object_read_
- f_return_status fl_fss_embedded_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits) {
+ f_return_status fl_fss_embedded_list_object_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits) {
#ifndef _di_level_1_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!found) return F_status_set_error(F_parameter);
if (!delimits) return F_status_set_error(F_parameter);
const f_array_length_t delimits_used = delimits->used;
- f_status_t status = f_fss_skip_past_space(*buffer, range);
+ f_status_t status = f_fss_skip_past_space(buffer, range);
if (F_status_is_error(status)) return status;
if (status == F_none_eol) {
}
// return found nothing if this line only contains whitespace and delimit placeholders.
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
// move the start position to after the EOL.
range->start++;
found->start = range->start;
// ignore all comment lines.
- if (buffer->string[range->start] == f_fss_comment) {
- status = f_fss_seek_to_eol(*buffer, range);
+ if (buffer.string[range->start] == f_fss_comment) {
+ status = f_fss_seek_to_eol(buffer, range);
if (F_status_is_error(status)) {
delimits->used = delimits_used;
bool graph_first = F_true;
// identify where the object ends.
- while (range->start <= range->stop && range->start < buffer->used && buffer->string[range->start] != f_fss_eol) {
+ while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol) {
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
slash_first = range->start;
slash_count = 1;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
- while (range->start <= range->stop && range->start < buffer->used && (buffer->string[range->start] == f_fss_delimit_placeholder || buffer->string[range->start] == f_fss_delimit_slash)) {
+ while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder || buffer.string[range->start] == f_fss_delimit_slash)) {
- if (buffer->string[range->start] == f_fss_delimit_slash) slash_count++;
+ if (buffer.string[range->start] == f_fss_delimit_slash) slash_count++;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
if (F_status_is_error(status)) break;
- fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
- if (buffer->string[range->start] == f_fss_embedded_list_open) {
+ if (buffer.string[range->start] == f_fss_embedded_list_open) {
graph_first = F_false;
stop = range->start - 1;
range->start++;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) break;
+ if (buffer.string[range->start] == f_fss_eol) break;
- status = f_fss_is_graph(*buffer, *range);
+ status = f_fss_is_graph(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_true) break;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
start = range->start;
range->start = slash_first;
if (slash_count % 2 == 0) {
while (slash_count > 0) {
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
delimits->used++;
slash_count--;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
return FL_fss_found_object_not;
}
}
- else if (graph_first && buffer->string[range->start] == f_fss_comment) {
+ else if (graph_first && buffer.string[range->start] == f_fss_comment) {
graph_first = F_false;
// comments may only have whitespace before the '#', therefore only the first slash needs to be delimited.
continue;
}
- else if (buffer->string[range->start] == f_fss_embedded_list_open) {
+ else if (buffer.string[range->start] == f_fss_embedded_list_open) {
graph_first = F_false;
stop = range->start - 1;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) break;
+ if (buffer.string[range->start] == f_fss_eol) break;
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) break;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
if (F_status_is_error(status)) break;
- fl_macro_fss_object_return_on_overflow_delimited((*buffer), (*range), (*found), F_none_eos, F_none_stop);
+ fl_macro_fss_object_return_on_overflow_delimited((buffer), (*range), (*found), F_none_eos, F_none_stop);
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
found->stop = stop;
// move the start position to after the EOL.
continue;
}
else if (graph_first) {
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) {
}
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
}
// seek to the end of the line when no valid object is found.
- while (range->start <= range->stop && range->start < buffer->used && buffer->string[range->start] != f_fss_eol) {
+ while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol) {
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) {
delimits->used = delimits_used;
}
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) {
delimits->used = delimits_used;
#endif // _di_fl_fss_embedded_list_object_read_
#ifndef _di_fl_fss_embedded_list_content_read_
- f_return_status fl_fss_embedded_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_nest_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments) {
+ f_return_status fl_fss_embedded_list_content_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_nest_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments) {
#ifndef _di_level_1_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!found) return F_status_set_error(F_parameter);
if (!delimits) return F_status_set_error(F_parameter);
const f_array_length_t found_used = found->used;
- f_status_t status = f_fss_skip_past_delimit(*buffer, range);
+ f_status_t status = f_fss_skip_past_delimit(buffer, range);
if (F_status_is_error(status)) return status;
if (status == F_none_eos || status == F_none_stop) {
positions_start.array[0] = range->start;
positions_start.used = 1;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
if (graph_first == 0x2) {
status = private_fl_fss_delimits_increase(delimits);
if (F_status_is_error(status)) break;
graph_first = 0x1;
if (depth > 0) {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
}
else {
- fl_macro_fss_nest_return_on_overflow_delimited((*buffer), (*range), (*found), positions_start, objects, F_none_eos, F_none_stop);
+ fl_macro_fss_nest_return_on_overflow_delimited((buffer), (*range), (*found), positions_start, objects, F_none_eos, F_none_stop);
}
line_start = range->start;
continue;
}
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
slash_first = range->start;
slash_last = range->start;
slash_count = 1;
position_previous = range->start;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
- while (range->start <= range->stop && range->start < buffer->used && (buffer->string[range->start] == f_fss_delimit_placeholder || buffer->string[range->start] == f_fss_delimit_slash)) {
+ while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder || buffer.string[range->start] == f_fss_delimit_slash)) {
position_previous = range->start;
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
slash_last = range->start++;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
if (F_status_is_error(status)) break;
if (depth > 0) {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
}
else {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop);
}
// All slashes for an open are delimited (because it could represent a slash in the object name).
// Only the first slash before a close is delimited, all others are maintained.
// for example '}' = valid close, '\}' represents '}', '\\}' represents '\}', '\\\}' represents '\\}', '\\\\}' represents '\\\}', and so on..
// When slash is odd and a (delimited) valid open/close is found, then save delimited positions and continue.
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
if (graph_first == 0x2) {
status = private_fl_fss_delimits_increase(delimits);
if (F_status_is_error(status)) break;
line_start = range->start;
graph_first = 0x1;
}
- else if (buffer->string[range->start] == f_fss_embedded_list_open || buffer->string[range->start] == f_fss_embedded_list_close) {
+ else if (buffer.string[range->start] == f_fss_embedded_list_open || buffer.string[range->start] == f_fss_embedded_list_close) {
before_list_open = position_previous;
is_open = F_false;
graph_first = 0x0;
- if (buffer->string[range->start] == f_fss_embedded_list_open) {
+ if (buffer.string[range->start] == f_fss_embedded_list_open) {
is_open = F_true;
}
position_previous = range->start++;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
if (graph_first == 0x2) {
status = private_fl_fss_delimits_increase(delimits);
if (F_status_is_error(status)) break;
break;
}
- if (buffer->string[range->start] != f_fss_delimit_placeholder) {
- status = f_fss_is_space(*buffer, *range);
+ if (buffer.string[range->start] != f_fss_delimit_placeholder) {
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) break;
position_previous = range->start;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
if (F_status_is_error(status)) break;
if (depth > 0) {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
}
else {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop);
}
// this is a valid object open/close that has been delimited, save the slash delimit positions.
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
newline_last = range->start;
line_start = range->start + 1;
graph_first = 0x1;
// apply slash delimits, only slashes and placeholders should be present.
while (slash_count > 0) {
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used++] = range->start;
}
range->start = newline_last;
}
}
- else if (graph_first == 0x1 && buffer->string[range->start] == f_fss_comment) {
+ else if (graph_first == 0x1 && buffer.string[range->start] == f_fss_comment) {
graph_first = 0x2;
comment_delimit = slash_first;
}
graph_first = 0x0;
}
}
- else if (buffer->string[range->start] == f_fss_embedded_list_open) {
+ else if (buffer.string[range->start] == f_fss_embedded_list_open) {
graph_first = 0x0;
before_list_open = position_previous;
position_previous = range->start;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) break;
+ if (buffer.string[range->start] == f_fss_eol) break;
- if (buffer->string[range->start] != f_fss_delimit_placeholder) {
- status = f_fss_is_space(*buffer, *range);
+ if (buffer.string[range->start] != f_fss_delimit_placeholder) {
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) break;
position_previous = range->start;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
if (F_status_is_error(status)) break;
if (depth > 0) {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
}
else {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop);
}
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
depth++;
if (depth >= positions_start.size) {
else {
// No valid object close found, seek until EOL.
- status = f_fss_seek_to_eol(*buffer, range);
+ status = f_fss_seek_to_eol(buffer, range);
if (F_status_is_error(status)) break;
if (graph_first == 0x2) {
line_start = range->start + 1;
graph_first = 0x1;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
newline_last = range->start;
line_start = range->start + 1;
break;
position_previous = range->start;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
if (F_status_is_error(status)) break;
if (depth > 0) {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
}
else {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop);
}
}
}
- else if (buffer->string[range->start] == f_fss_embedded_list_close) {
+ else if (buffer.string[range->start] == f_fss_embedded_list_close) {
graph_first = 0x0;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
position_previous = range->start;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
break;
}
- if (buffer->string[range->start] != f_fss_delimit_placeholder) {
- status = f_fss_is_space(*buffer, *range);
+ if (buffer.string[range->start] != f_fss_delimit_placeholder) {
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) {
if (F_status_is_error(status)) break;
if (depth > 0) {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop);
}
else {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop);
}
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
status = private_fl_fss_nest_increase(found);
if (F_status_is_error(status)) break;
graph_first = 0x1;
if (!depth) {
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
- fl_macro_fss_nest_return_on_overflow_delimited((*buffer), (*range), (*found), positions_start, objects, F_none_eos, F_none_stop)
+ fl_macro_fss_nest_return_on_overflow_delimited((buffer), (*range), (*found), positions_start, objects, F_none_eos, F_none_stop)
f_macro_string_lengths_t_delete_simple(positions_start);
f_macro_fss_objects_t_delete_simple(objects);
else {
// No valid object close found, seek until EOL.
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
if (graph_first == 0x2) {
status = private_fl_fss_delimits_increase(delimits);
if (F_status_is_error(status)) break;
position_previous = range->start;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
if (F_status_is_error(status)) break;
if (depth > 0) {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop)
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop)
}
else {
- fl_macro_fss_nest_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop)
+ fl_macro_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, F_data_not_eos, F_data_not_stop)
}
}
}
- else if (graph_first == 0x1 && buffer->string[range->start] == f_fss_comment) {
+ else if (graph_first == 0x1 && buffer.string[range->start] == f_fss_comment) {
position = range->start;
- status = f_fss_seek_to_eol(*buffer, range);
+ status = f_fss_seek_to_eol(buffer, range);
if (F_status_is_error(status)) break;
status = private_fl_fss_ranges_increase(comments);
if (F_status_is_error(status)) break;
- if (range->start > range->stop || range->start >= buffer->used) {
+ if (range->start > range->stop || range->start >= buffer.used) {
range->start--;
}
else {
comments->array[comments->used++].stop = range->start++;
continue;
}
- else if (buffer->string[range->start] != f_fss_eol) {
+ else if (buffer.string[range->start] != f_fss_eol) {
position_previous = range->start;
if (graph_first == 0x1) {
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) {
}
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
- if (range->start >= buffer->used || range->start > range->stop) {
+ if (range->start >= buffer.used || range->start > range->stop) {
break;
}
position_previous = range->start;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
*
* @param buffer
* The buffer to read from.
- * This will be updated with delimit placeholders as it is being processed.
* @param range
* The start/stop location within the buffer to be processed.
* The start location will be updated as the buffer is being processed.
* Errors (with error bit) from: f_fss_skip_past_space().
*/
#ifndef _di_fl_fss_embedded_list_object_read_
- extern f_return_status fl_fss_embedded_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits);
+ extern f_return_status fl_fss_embedded_list_object_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits);
#endif // _di_fl_fss_embedded_list_object_read_
/**
*
* @param buffer
* The buffer to read from.
- * This will be updated with delimit placeholders as it is being processed.
* @param range
* The start/stop location within the buffer to be processed.
* The start location will be updated as the buffer is being processed.
* Errors (with error bit) from: f_fss_skip_past_space().
*/
#ifndef _di_fl_fss_embedded_list_content_read_
- extern f_return_status fl_fss_embedded_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_nest_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments);
+ extern f_return_status fl_fss_embedded_list_content_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_nest_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments);
#endif // _di_fl_fss_embedded_list_content_read_
/**
#endif
#ifndef _di_fl_fss_extended_object_read_
- f_return_status fl_fss_extended_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quoted, f_fss_delimits_t *delimits) {
+ f_return_status fl_fss_extended_object_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quoted, f_fss_delimits_t *delimits) {
#ifndef _di_level_1_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!found) return F_status_set_error(F_parameter);
if (!delimits) return F_status_set_error(F_parameter);
const f_array_length_t delimits_used = delimits->used;
- f_status_t status = private_fl_fss_basic_read(F_true, buffer, range, found, quoted, delimits);
+ f_status_t status = private_fl_fss_basic_read(buffer, F_true, range, found, quoted, delimits);
if (F_status_is_error(status)) {
delimits->used = delimits_used;
#endif // _di_fl_fss_extended_object_read_
#ifndef _di_fl_fss_extended_content_read_
- f_return_status fl_fss_extended_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_quotes_t *quotes, f_fss_delimits_t *delimits) {
+ f_return_status fl_fss_extended_content_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_quotes_t *quotes, f_fss_delimits_t *delimits) {
#ifndef _di_level_1_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!found) return F_status_set_error(F_parameter);
if (!delimits) return F_status_set_error(F_parameter);
f_status_t status = F_none;
f_status_t status_allocate = F_none;
- status = f_fss_skip_past_space(*buffer, range);
+ status = f_fss_skip_past_space(buffer, range);
if (F_status_is_error(status)) return status;
if (status == F_none_eol) {
uint8_t content_found = 0;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
f_string_range_t content_partial = f_string_range_t_initialize;
f_fss_quote_t quoted = 0;
- status = private_fl_fss_basic_read(F_false, buffer, range, &content_partial, "ed, delimits);
+ status = private_fl_fss_basic_read(buffer, F_false, range, &content_partial, "ed, delimits);
if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) {
*
* @param buffer
* The buffer to read from.
- * This will be updated with delimit placeholders as it is being processed.
* @param range
* The start/stop location within the buffer to be processed.
* The start location will be updated as the buffer is being processed.
* Errors (with error bit) from: f_fss_skip_past_space().
*/
#ifndef _di_fl_fss_extended_object_read_
- extern f_return_status fl_fss_extended_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quoted, f_fss_delimits_t *delimits);
+ extern f_return_status fl_fss_extended_object_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quoted, f_fss_delimits_t *delimits);
#endif // _di_fl_fss_extended_object_read_
/**
*
* @param buffer
* The buffer to read from.
- * This will be updated with delimit placeholders as it is being processed.
* @param range
* The start/stop location within the buffer to be processed.
* The start location will be updated as the buffer is being processed.
* Errors (with error bit) from: f_fss_skip_past_space().
*/
#ifndef _di_fl_fss_extended_content_read_
- extern f_return_status fl_fss_extended_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_quotes_t *quotes, f_fss_delimits_t *delimits);
+ extern f_return_status fl_fss_extended_content_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_quotes_t *quotes, f_fss_delimits_t *delimits);
#endif // _di_fl_fss_extended_content_read_
/**
#endif
#ifndef _di_fl_fss_extended_list_object_read_
- f_return_status fl_fss_extended_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits) {
+ f_return_status fl_fss_extended_list_object_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits) {
#ifndef _di_level_1_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!found) return F_status_set_error(F_parameter);
if (!delimits) return F_status_set_error(F_parameter);
const f_array_length_t delimits_used = delimits->used;
- f_status_t status = f_fss_skip_past_space(*buffer, range);
+ f_status_t status = f_fss_skip_past_space(buffer, range);
if (F_status_is_error(status)) return status;
if (status == F_none_eol) {
}
// return found nothing if this line only contains whitespace and delimit placeholders.
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
// move the start position to after the EOL.
range->start++;
found->start = range->start;
// ignore all comment lines.
- if (buffer->string[range->start] == f_fss_comment) {
- status = f_fss_seek_to_eol(*buffer, range);
+ if (buffer.string[range->start] == f_fss_comment) {
+ status = f_fss_seek_to_eol(buffer, range);
if (F_status_is_error(status)) {
delimits->used = delimits_used;
bool graph_first = F_true;
// identify where the object ends.
- while (range->start <= range->stop && range->start < buffer->used && buffer->string[range->start] != f_fss_eol) {
+ while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol) {
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
slash_first = range->start;
slash_count = 1;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
- while (range->start <= range->stop && range->start < buffer->used && (buffer->string[range->start] == f_fss_delimit_placeholder || buffer->string[range->start] == f_fss_delimit_slash)) {
+ while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder || buffer.string[range->start] == f_fss_delimit_slash)) {
- if (buffer->string[range->start] == f_fss_delimit_slash) slash_count++;
+ if (buffer.string[range->start] == f_fss_delimit_slash) slash_count++;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
if (F_status_is_error(status)) break;
- fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
- if (buffer->string[range->start] == f_fss_extended_list_open) {
+ if (buffer.string[range->start] == f_fss_extended_list_open) {
graph_first = F_false;
stop = range->start - 1;
range->start++;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) break;
+ if (buffer.string[range->start] == f_fss_eol) break;
- status = f_fss_is_graph(*buffer, *range);
+ status = f_fss_is_graph(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_true) break;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
start = range->start;
range->start = slash_first;
if (slash_count % 2 == 0) {
while (slash_count > 0) {
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
delimits->used++;
slash_count--;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
return FL_fss_found_object_not;
}
}
- else if (graph_first && buffer->string[range->start] == f_fss_comment) {
+ else if (graph_first && buffer.string[range->start] == f_fss_comment) {
graph_first = F_false;
// comments may only have whitespace before the '#', therefore only the first slash needs to be delimited.
continue;
}
- else if (buffer->string[range->start] == f_fss_extended_list_open) {
+ else if (buffer.string[range->start] == f_fss_extended_list_open) {
graph_first = F_false;
stop = range->start - 1;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) break;
+ if (buffer.string[range->start] == f_fss_eol) break;
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) break;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
if (F_status_is_error(status)) break;
- fl_macro_fss_object_return_on_overflow_delimited((*buffer), (*range), (*found), F_none_eos, F_none_stop);
+ fl_macro_fss_object_return_on_overflow_delimited((buffer), (*range), (*found), F_none_eos, F_none_stop);
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
found->stop = stop;
// move the start position to after the EOL.
continue;
}
else if (graph_first) {
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) {
}
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
}
// seek to the end of the line when no valid object is found.
- while (range->start <= range->stop && range->start < buffer->used && buffer->string[range->start] != f_fss_eol) {
+ while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol) {
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) {
delimits->used = delimits_used;
}
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
+ fl_macro_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) {
delimits->used = delimits_used;
#endif // _di_fl_fss_extended_list_object_read_
#ifndef _di_fl_fss_extended_list_content_read_
- f_return_status fl_fss_extended_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments) {
+ f_return_status fl_fss_extended_list_content_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments) {
#ifndef _di_level_1_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!found) return F_status_set_error(F_parameter);
if (!delimits) return F_status_set_error(F_parameter);
const f_array_length_t delimits_used = delimits->used;
const f_array_length_t comments_used = comments->used;
- f_status_t status = f_fss_skip_past_delimit(*buffer, range);
+ f_status_t status = f_fss_skip_past_delimit(buffer, range);
if (F_status_is_error(status)) return status;
- fl_macro_fss_content_with_comments_return_on_overflow((*buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, F_none_eos, F_none_stop);
+ fl_macro_fss_content_with_comments_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, F_none_eos, F_none_stop);
status = private_fl_fss_ranges_increase(found);
if (F_status_is_error(status)) return status;
f_string_length_t start = 0;
// identify where the content ends.
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- status = f_fss_skip_past_space(*buffer, range);
+ status = f_fss_skip_past_space(buffer, range);
if (F_status_is_error(status)) return status;
if (status == F_none_eol) {
continue;
}
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
slash_first = range->start;
slash_count = 1;
- for (range->start++; range->start <= range->stop && range->start < buffer->used; ++range->start) {
+ for (range->start++; range->start <= range->stop && range->start < buffer.used; ++range->start) {
- if (buffer->string[range->start] == f_fss_delimit_placeholder) {
+ if (buffer.string[range->start] == f_fss_delimit_placeholder) {
continue;
- } else if (buffer->string[range->start] != f_fss_delimit_slash) {
+ } else if (buffer.string[range->start] != f_fss_delimit_slash) {
break;
}
slash_count++;
} // for
- if (range->start > range->stop || range->start >= buffer->used) break;
+ if (range->start > range->stop || range->start >= buffer.used) break;
// Only the first slash before a close is delimited, all others are maintained.
// For example '}' = valid close, '\}' represents '}', '\\}' represents '\}', '\\\}' represents '\\}', '\\\\}' represents '\\\}', and so on..
// With one or more slashes, even if delimited, this line may never designate a valid content close.
- if (buffer->string[range->start] == f_fss_extended_list_close) {
+ if (buffer.string[range->start] == f_fss_extended_list_close) {
range->start++;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) break;
+ if (buffer.string[range->start] == f_fss_eol) break;
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) break;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
- if (range->start > range->stop || range->start >= buffer->used) break;
+ if (range->start > range->stop || range->start >= buffer.used) break;
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
status = private_fl_fss_delimits_increase(delimits);
if (F_status_is_error(status)) break;
continue;
}
}
- else if (buffer->string[range->start] == f_fss_comment) {
+ else if (buffer.string[range->start] == f_fss_comment) {
status = private_fl_fss_delimits_increase(delimits);
if (F_status_is_error(status)) break;
delimits->array[delimits->used++] = slash_first;
}
- status = f_fss_seek_to_eol(*buffer, range);
+ status = f_fss_seek_to_eol(buffer, range);
if (F_status_is_error(status)) break;
continue;
}
- if (buffer->string[range->start] == f_fss_extended_list_close) {
+ if (buffer.string[range->start] == f_fss_extended_list_close) {
range->start++;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) break;
+ if (buffer.string[range->start] == f_fss_eol) break;
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) break;
if (status == F_false) break;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
} // while
if (F_status_is_error(status)) break;
- if (range->start > range->stop || range->start >= buffer->used) break;
+ if (range->start > range->stop || range->start >= buffer.used) break;
// found a valid content close, set stop point to last newline.
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
range->start = newline_last + 1;
found->array[found->used++].stop = newline_last;
continue;
}
- if (buffer->string[range->start] == f_fss_comment) {
+ if (buffer.string[range->start] == f_fss_comment) {
start = range->start;
- status = f_fss_seek_to_eol(*buffer, range);
+ status = f_fss_seek_to_eol(buffer, range);
if (F_status_is_error(status)) break;
status = private_fl_fss_ranges_increase(comments);
if (F_status_is_error(status)) break;
- if (range->start > range->stop || range->start >= buffer->used) {
+ if (range->start > range->stop || range->start >= buffer.used) {
range->start--;
}
else {
}
// There is no possibility of a valid content close, so seek until newline.
- status = f_fss_seek_to_eol(*buffer, range);
+ status = f_fss_seek_to_eol(buffer, range);
if (F_status_is_error(status)) break;
} // while
*
* @param buffer
* The buffer to read from.
- * This will be updated with delimit placeholders as it is being processed.
* @param range
* The start/stop location within the buffer to be processed.
* The start location will be updated as the buffer is being processed.
* Errors (with error bit) from: f_fss_skip_past_space().
*/
#ifndef _di_fl_fss_extended_list_object_read_
- extern f_return_status fl_fss_extended_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits);
+ extern f_return_status fl_fss_extended_list_object_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_delimits_t *delimits);
#endif // _di_fl_fss_extended_list_object_read_
/**
*
* @param buffer
* The buffer to read from.
- * This will be updated with delimit placeholders as it is being processed.
* @param range
* The start/stop location within the buffer to be processed.
* The start location will be updated as the buffer is being processed.
* Errors (with error bit) from: f_fss_skip_past_space().
*/
#ifndef _di_fl_fss_extended_list_content_read_
- extern f_return_status fl_fss_extended_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments);
+ extern f_return_status fl_fss_extended_list_content_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_delimits_t *delimits, f_fss_comments_t *comments);
#endif // _di_fl_fss_extended_list_content_read_
/**
#endif // !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_)
#if !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) || !defined(_di_fl_fss_extended_content_read_)
- f_return_status private_fl_fss_basic_read(const bool object_as, f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quote, f_fss_delimits_t *delimits) {
+ f_return_status private_fl_fss_basic_read(const f_string_static_t buffer, const bool object_as, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quote, f_fss_delimits_t *delimits) {
- f_status_t status = f_fss_skip_past_space(*buffer, range);
+ f_status_t status = f_fss_skip_past_space(buffer, range);
if (F_status_is_error(status)) return status;
if (status == F_none_eol) {
found->start = range->start;
// ignore all comment lines.
- if (object_as && buffer->string[range->start] == f_fss_comment) {
+ if (object_as && buffer.string[range->start] == f_fss_comment) {
- while (buffer->string[range->start] != f_fss_eol) {
+ while (buffer.string[range->start] != f_fss_eol) {
range->start++;
- if (range->start >= buffer->used) return F_data_not_eos;
+ if (range->start >= buffer.used) return F_data_not_eos;
if (range->start > range->stop) return F_data_not_stop;
} // while
}
// identify where the object begins.
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
f_string_length_t first_slash = range->start;
found->start = range->start;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- status = f_fss_is_zero_width(*buffer, *range);
+ status = f_fss_is_zero_width(buffer, *range);
if (F_status_is_error(status)) return status;
if (status == F_true) {
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
continue;
}
- if (buffer->string[range->start] != f_fss_delimit_slash) {
- status = f_fss_is_space(*buffer, *range);
+ if (buffer.string[range->start] != f_fss_delimit_slash) {
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) return status;
// found the end of the object while processing the slash for potential delimits.
if (status == F_true) {
found->stop = range->start - 1;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
return FL_fss_found_object_content_not;
}
break;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
- if (range->start >= buffer->used) {
- found->stop = buffer->used - 1;
+ if (range->start >= buffer.used) {
+ found->stop = buffer.used - 1;
return F_none_eos;
}
return F_none_stop;
}
- if (buffer->string[range->start] == f_fss_delimit_quote_single || buffer->string[range->start] == f_fss_delimit_quote_double || (object_as && buffer->string[range->start] == f_fss_comment)) {
+ if (buffer.string[range->start] == f_fss_delimit_quote_single || buffer.string[range->start] == f_fss_delimit_quote_double || (object_as && buffer.string[range->start] == f_fss_comment)) {
// only the first slash before a quoted needs to be escaped (or not) as once there is a slash before a quoted, this cannot ever be a quote object.
// this simplifies the number of slashes needed.
delimits->array[delimits->used] = first_slash;
delimits->used++;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
}
}
- else if (buffer->string[range->start] == f_fss_delimit_quote_single || buffer->string[range->start] == f_fss_delimit_quote_double) {
- quote_found = buffer->string[range->start];
+ else if (buffer.string[range->start] == f_fss_delimit_quote_single || buffer.string[range->start] == f_fss_delimit_quote_double) {
+ quote_found = buffer.string[range->start];
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
found->start = range->start;
if (!quote_found) {
status = F_none;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) return status;
if (status == F_true) break;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
found->stop = range->start - 1;
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
// move the start position to after the EOL.
range->start++;
return FL_fss_found_object_content_not;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
return FL_fss_found_object;
f_string_length_t slash_count = 0;
f_string_length_t location = 0;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
first_slash = range->start;
slash_count = 1;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_delimit_placeholder) {
- status = f_utf_buffer_increment(*buffer, range, 1);
+ if (buffer.string[range->start] == f_fss_delimit_placeholder) {
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
continue;
}
- else if (buffer->string[range->start] != f_fss_delimit_slash) {
+ else if (buffer.string[range->start] != f_fss_delimit_slash) {
break;
}
slash_count++;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
- if (range->start >= buffer->used) {
- found->stop = buffer->used - 1;
+ if (range->start >= buffer.used) {
+ found->stop = buffer.used - 1;
return F_unterminated_group_eos;
}
return F_unterminated_group_stop;
}
- if (buffer->string[range->start] == quote_found) {
+ if (buffer.string[range->start] == quote_found) {
location = range->start;
// check to see if there is a whitespace, EOS, or EOL after the quoted, if not, then this is not a closing quoted and delimits do not apply.
- if (range->start + 1 <= range->stop && range->start + 1 < buffer->used) {
+ if (range->start + 1 <= range->stop && range->start + 1 < buffer.used) {
range->start++;
- status = f_fss_skip_past_delimit(*buffer, range);
+ status = f_fss_skip_past_delimit(buffer, range);
if (F_status_is_error(status)) return status;
- if (range->start > range->stop || range->start >= buffer->used) {
+ if (range->start > range->stop || range->start >= buffer.used) {
// EOS or EOL was reached, so it is a valid closing quoted.
// (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE (@todo maybe none on stop?).
status = F_true;
}
else {
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) return status;
}
}
while (slash_count > 0) {
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
delimits->used++;
slash_count--;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
range->start = location + 1;
- while (buffer->string[range->start] == f_fss_delimit_placeholder) {
+ while (buffer.string[range->start] == f_fss_delimit_placeholder) {
range->start++;
- if (range->start >= buffer->used) return F_none_eos;
+ if (range->start >= buffer.used) return F_none_eos;
if (range->start > range->stop) return F_none_stop;
} // while
- status = f_fss_is_graph(*buffer, *range);
+ status = f_fss_is_graph(buffer, *range);
if (F_status_is_error(status)) return status;
if (status == F_true) {
- while (range->start <= range->stop && range->start < buffer->used && buffer->string[range->start] != f_fss_eol) {
+ while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol) {
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
- if (range->start >= buffer->used) {
- found->stop = buffer->used - 1;
+ if (range->start >= buffer.used) {
+ found->stop = buffer.used - 1;
return F_data_not_eos;
}
return F_data_not_stop;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
return FL_fss_found_object_not;
}
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
found->stop = location - 1;
// move the start position to after the EOL.
found->stop = location - 1;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
return FL_fss_found_object;
while (slash_count > 0) {
- if (buffer->string[range->start] == f_fss_delimit_slash) {
+ if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
delimits->used++;
slash_count--;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
}
}
}
- else if (buffer->string[range->start] == quote_found) {
+ else if (buffer.string[range->start] == quote_found) {
// check to see if there is a whitespace, EOS, or EOL after the quoted, if not, then this is not a closing quoted.
location = range->start;
- if (range->start + 1 <= range->stop && range->start + 1 < buffer->used) {
+ if (range->start + 1 <= range->stop && range->start + 1 < buffer.used) {
range->start++;
- status = f_fss_skip_past_delimit(*buffer, range);
+ status = f_fss_skip_past_delimit(buffer, range);
if (F_status_is_error(status)) return status;
- if (range->start > range->stop || range->start >= buffer->used) {
+ if (range->start > range->stop || range->start >= buffer.used) {
// EOS or EOL was reached, so it is a valid closing quoted.
// (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE (@todo maybe none on stop?).
status = F_true;
}
else {
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) return status;
}
}
found->stop = range->start - 1;
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
- while (range->start <= range->stop && range->start < buffer->used) {
+ while (range->start <= range->stop && range->start < buffer.used) {
- if (buffer->string[range->start] == f_fss_eol) {
+ if (buffer.string[range->start] == f_fss_eol) {
// move the start position to after the EOL.
range->start++;
return FL_fss_found_object_content_not;
}
- status = f_fss_is_space(*buffer, *range);
+ status = f_fss_is_space(buffer, *range);
if (F_status_is_error(status)) return status;
if (status == F_true) {
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
return FL_fss_found_object;
}
- if (buffer->string[range->start] != f_fss_delimit_placeholder) {
+ if (buffer.string[range->start] != f_fss_delimit_placeholder) {
- while (range->start <= range->stop && range->start < buffer->used && buffer->string[range->start] != f_fss_eol) {
+ while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol) {
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
- if (range->start >= buffer->used) {
- found->stop = buffer->used - 1;
+ if (range->start >= buffer.used) {
+ found->stop = buffer.used - 1;
return F_data_not_eos;
}
return F_data_not_stop;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
return FL_fss_found_object_not;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
- if (range->start >= buffer->used) {
- found->stop = buffer->used - 1;
+ if (range->start >= buffer.used) {
+ found->stop = buffer.used - 1;
return F_none_eos;
}
}
}
}
- else if (buffer->string[range->start] == f_fss_eol) {
+ else if (buffer.string[range->start] == f_fss_eol) {
// move the start position to after the EOL.
range->start++;
return FL_fss_found_object_not;
}
- status = f_utf_buffer_increment(*buffer, range, 1);
+ status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
- if (range->start >= buffer->used) {
- found->stop = buffer->used - 1;
+ if (range->start >= buffer.used) {
+ found->stop = buffer.used - 1;
return F_unterminated_group_eos;
}
}
// seek to the EOL when no valid object is found.
- status = f_fss_seek_to_eol(*buffer, range);
+ status = f_fss_seek_to_eol(buffer, range);
if (F_status_is_error(status)) return status;
// move the start position to after the EOL.
*
* Intended to be shared to each of the different implementation variations.
*
+ * @param buffer
+ * The buffer to read from.
* @param object_as
* If TRUE, then this operate as an Object.
* IF FALSE, then this operates as a Content.
*
* As Object, this checks if the first graph character is a comment character '#', or an escaped comment character '#'.
* As Content, this does nothing special in regards to a leading '#'.
- * @param buffer
- * The buffer to read from.
- * This will be updated with delimit placeholders as it is being processed.
* @param range
* The start/stop location within the buffer to be processed.
* The start location will be updated as the buffer is being processed.
* @see fl_fss_extended_content_read()
*/
#if !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) || !defined(_di_fl_fss_extended_content_read_)
- extern f_return_status private_fl_fss_basic_read(const bool object_as, f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quoted, f_fss_delimits_t *delimits) f_gcc_attribute_visibility_internal;
+ extern f_return_status private_fl_fss_basic_read(const f_string_static_t buffer, const bool object_as, f_string_range_t *range, f_fss_object_t *found, f_fss_quote_t *quoted, f_fss_delimits_t *delimits) f_gcc_attribute_visibility_internal;
#endif // !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) || !defined(_di_fl_fss_extended_content_read_)
/**
#endif
#ifndef _di_fll_fss_basic_read_
- f_return_status fll_fss_basic_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) {
+ f_return_status fll_fss_basic_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) {
#ifndef _di_level_2_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!objects) return F_status_set_error(F_parameter);
if (!contents) return F_status_set_error(F_parameter);
return status;
}
- if (range->start >= range->stop || range->start >= buffer->used) {
+ if (range->start >= range->stop || range->start >= buffer.used) {
if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) {
objects->used++;
}
if (found_data) {
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_none_eos;
}
return F_none_stop;
}
else {
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_data_not_eos;
}
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) {
+ else if (range->start >= range->stop || range->start >= buffer.used) {
if (status == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not) {
objects->used++;
contents->used++;
}
}
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_none_eos;
}
* Errors (with error bit) from: fl_fss_basic_object_read().
*/
#ifndef _di_fll_fss_basic_read_
- extern f_return_status fll_fss_basic_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits);
+ extern f_return_status fll_fss_basic_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits);
#endif // _di_fll_fss_basic_read_
/**
#endif
#ifndef _di_fll_fss_basic_list_read_
- f_return_status fll_fss_basic_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) {
+ f_return_status fll_fss_basic_list_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) {
#ifndef _di_level_2_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!objects) return F_status_set_error(F_parameter);
if (!contents) return F_status_set_error(F_parameter);
status = fl_fss_basic_list_object_read(buffer, range, &objects->array[objects->used], objects_delimits);
if (F_status_is_error(status)) return status;
- if (range->start >= range->stop || range->start >= buffer->used) {
+ if (range->start >= range->stop || range->start >= buffer.used) {
if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) {
objects->used++;
}
if (found_data) {
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_none_eos;
}
return F_none_stop;
}
else {
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_data_not_eos;
}
else if (status != FL_fss_found_object && status != FL_fss_found_content && status != FL_fss_found_content_not && status != FL_fss_found_object_content_not) {
return status;
}
- else if (range->start >= range->stop || range->start >= buffer->used) {
+ else 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 == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not) {
contents->used++;
}
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_none_eos;
}
* Errors (with error bit) from: fl_fss_basic_list_object_read().
*/
#ifndef _di_fll_fss_basic_list_read_
- extern f_return_status fll_fss_basic_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments);
+ extern f_return_status fll_fss_basic_list_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments);
#endif // _di_fll_fss_basic_list_read_
/**
* @param content_prepend
* A string to prepend at the start of each line in content, such as spaces.
* Set the pointer address to 0 to disable.
- * @param buffer
+ * @param destination
* The buffer to write to.
*
* @return
* Errors (with error bit) from: fl_string_dynamic_increase_by().
*/
#ifndef _di_fll_fss_basic_list_write_string_
- extern f_return_status fll_fss_basic_list_write_string(const f_string_static_t object, const f_string_static_t content, const f_string_static_t *content_prepend, f_string_dynamic_t *buffer);
+ extern f_return_status fll_fss_basic_list_write_string(const f_string_static_t object, const f_string_static_t content, const f_string_static_t *content_prepend, f_string_dynamic_t *destination);
#endif // _di_fll_fss_basic_list_write_string_
#ifdef __cplusplus
#endif
#ifndef _di_fll_fss_embedded_list_read_
- f_return_status fll_fss_embedded_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_nest_t *nest, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) {
+ f_return_status fll_fss_embedded_list_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_nest_t *nest, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) {
#ifndef _di_level_3_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!nest) return F_status_set_error(F_parameter);
if (!objects_delimits) return F_status_set_error(F_parameter);
status = fl_fss_embedded_list_object_read(buffer, range, &nest->depth[0].array[nest->depth[0].used].object, objects_delimits);
if (F_status_is_error(status)) return status;
- if (range->start >= range->stop || range->start >= buffer->used) {
+ if (range->start >= range->stop || range->start >= buffer.used) {
if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) {
// extended list requires content closure, so this could be an error.
}
if (found_data) {
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_none_eos;
}
return F_none_stop;
}
else {
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_data_not_eos;
}
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 >= buffer->used) {
+ else if (range->start >= range->stop || range->start >= buffer.used) {
+ if (range->start >= buffer.used) {
return F_none_eos;
}
* Errors (with error bit) from: fl_fss_embedded_list_object_read().
*/
#ifndef _di_fll_fss_embedded_list_read_
- extern f_return_status fll_fss_embedded_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_nest_t *nest, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments);
+ extern f_return_status fll_fss_embedded_list_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_nest_t *nest, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments);
#endif // _di_fll_fss_embedded_list_read_
/**
#endif
#ifndef _di_fll_fss_extended_read_
- f_return_status fll_fss_extended_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_quotess_t *contents_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) {
+ f_return_status fll_fss_extended_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_quotess_t *contents_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) {
#ifndef _di_level_2_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!objects) return F_status_set_error(F_parameter);
if (!contents) return F_status_set_error(F_parameter);
return status;
}
- if (range->start >= range->stop || range->start >= buffer->used) {
+ if (range->start >= range->stop || range->start >= buffer.used) {
if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) {
objects->used++;
}
if (found_data) {
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_none_eos;
}
return F_none_stop;
}
else {
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_data_not_eos;
}
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) {
+ else if (range->start >= range->stop || range->start >= buffer.used) {
if (status == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not || status == F_unterminated_group) {
objects->used++;
contents->used++;
}
}
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
if (status == F_unterminated_group) return F_unterminated_group_eos;
return F_none_eos;
* Errors (with error bit) from: fl_fss_extended_object_read().
*/
#ifndef _di_fll_fss_extended_read_
- extern f_return_status fll_fss_extended_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_quotess_t *contents_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits);
+ extern f_return_status fll_fss_extended_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quotes_t *objects_quoted, f_fss_quotess_t *contents_quoted, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits);
#endif // _di_fll_fss_extended_read_
/**
#endif
#ifndef _di_fll_fss_extended_list_read_
- f_return_status fll_fss_extended_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) {
+ f_return_status fll_fss_extended_list_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) {
#ifndef _di_level_2_parameter_checking_
- if (!buffer) return F_status_set_error(F_parameter);
if (!range) return F_status_set_error(F_parameter);
if (!objects) return F_status_set_error(F_parameter);
if (!contents) return F_status_set_error(F_parameter);
status = fl_fss_extended_list_object_read(buffer, range, &objects->array[objects->used], objects_delimits);
if (F_status_is_error(status)) return status;
- if (range->start >= range->stop || range->start >= buffer->used) {
+ if (range->start >= range->stop || range->start >= buffer.used) {
if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) {
objects->used++;
}
if (found_data) {
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_none_eos;
}
return F_none_stop;
}
else {
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_data_not_eos;
}
else if (status != FL_fss_found_object && status != FL_fss_found_content && status != FL_fss_found_content_not && status != FL_fss_found_object_content_not) {
return status;
}
- else if (range->start >= range->stop || range->start >= buffer->used) {
+ else 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 == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not) {
contents->used++;
}
- if (range->start >= buffer->used) {
+ if (range->start >= buffer.used) {
return F_none_eos;
}
* Errors (with error bit) from: fl_fss_extended_list_object_read().
*/
#ifndef _di_fll_fss_extended_list_read_
- extern f_return_status fll_fss_extended_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments);
+ extern f_return_status fll_fss_extended_list_read(const f_string_static_t buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments);
#endif // _di_fll_fss_extended_list_read_
/**
f_string_range_t range = f_macro_string_range_t_initialize(buffer.used);
f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
- *status = fll_fss_extended_read(&buffer, &range, &objects, &contents, 0, 0, &delimits, 0);
+ *status = fll_fss_extended_read(buffer, &range, &objects, &contents, 0, 0, &delimits, 0);
if (F_status_is_error(*status)) {
fake_print_error_fss(data, F_status_set_fine(*status), "fll_fss_extended_read", data.file_data_build_settings.string, range, F_true);
f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
f_fss_comments_t comments = f_fss_comments_t_initialize;
- *status = fll_fss_basic_list_read(&data_make->buffer, &range, &list_objects, &list_contents, &delimits, 0, &comments);
+ *status = fll_fss_basic_list_read(data_make->buffer, &range, &list_objects, &list_contents, &delimits, 0, &comments);
if (F_status_is_error(*status)) {
fake_print_error_fss(data, *status, "fll_fss_basic_list_read", data.file_data_build_fakefile.string, range, F_true);
delimits.used = 0;
content_range = list_contents.array[i].array[0];
- *status = fll_fss_extended_read(&data_make->buffer, &content_range, &settings.objects, &settings.contents, 0, 0, &delimits, 0);
+ *status = fll_fss_extended_read(data_make->buffer, &content_range, &settings.objects, &settings.contents, 0, 0, &delimits, 0);
if (F_status_is_error(*status)) {
fake_print_error_fss(data, F_status_set_fine(*status), "fll_fss_extended_read", data.file_data_build_fakefile.string, content_range, F_true);
delimits.used = 0;
content_range = list_contents.array[i].array[0];
- *status = fll_fss_extended_read(&data_make->buffer, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0);
+ *status = fll_fss_extended_read(data_make->buffer, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0);
if (F_status_is_error(*status)) {
fake_print_error_fss(data, F_status_set_fine(*status), "fll_fss_extended_read", data.file_data_build_fakefile.string, content_range, F_true);
{
f_string_range_t input = f_macro_string_range_t_initialize(local_buffer.used);
- status = fll_fss_basic_read(&local_buffer, &input, &basic_objects, &basic_contents, 0, &delimits, 0);
+ status = fll_fss_basic_read(local_buffer, &input, &basic_objects, &basic_contents, 0, &delimits, 0);
}
if (F_status_set_error(status)) {
{
f_string_range_t input = f_macro_string_range_t_initialize(local->buffer.used);
- status = fll_fss_basic_list_read(&local->buffer, &input, &local->chain_objects, &local->chain_contents, &delimits, 0, &comments);
+ status = fll_fss_basic_list_read(local->buffer, &input, &local->chain_objects, &local->chain_contents, &delimits, 0, &comments);
}
if (F_status_is_error(status)) {
f_return_status firewall_process_rules(f_string_range_t *range, firewall_local_data_t *local, firewall_data_t *data) {
f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
- f_status_t status = fll_fss_extended_read(&local->buffer, range, &local->rule_objects, &local->rule_contents, 0, 0, &delimits, 0);
+ f_status_t status = fll_fss_extended_read(local->buffer, range, &local->rule_objects, &local->rule_contents, 0, 0, &delimits, 0);
if (F_status_is_error_not(status)) {
status = fl_fss_apply_delimit(delimits, &local->buffer);
delimits->used = 0;
comments->used = 0;
- status = fll_fss_basic_list_read(&data->buffer, &input, &data->objects, &data->contents, delimits, 0, comments);
+ status = fll_fss_basic_list_read(data->buffer, &input, &data->objects, &data->contents, delimits, 0, comments);
if (F_status_is_error(status)) {
// @todo: detect and replace fll_error_file_type_file with fll_error_file_type_pipe as appropriate.
delimits->used = 0;
- status = fll_fss_basic_read(&data->buffer, &input, &data->objects, &data->contents, 0, delimits, 0);
+ status = fll_fss_basic_read(data->buffer, &input, &data->objects, &data->contents, 0, delimits, 0);
if (F_status_is_error(status)) {
// @todo: detect and replace fll_error_file_type_file with fll_error_file_type_pipe as appropriate.
contents_delimits->used = 0;
comments->used = 0;
- status = fll_fss_embedded_list_read(&data->buffer, &input, &data->nest, objects_delimits, contents_delimits, comments);
+ status = fll_fss_embedded_list_read(data->buffer, &input, &data->nest, objects_delimits, contents_delimits, comments);
if (F_status_is_error(status)) {
// @todo: detect and replace fll_error_file_type_file with fll_error_file_type_pipe as appropriate.
delimits->used = 0;
comments->used = 0;
- status = fll_fss_extended_list_read(&data->buffer, &input, &data->objects, &data->contents, delimits, 0, comments);
+ status = fll_fss_extended_list_read(data->buffer, &input, &data->objects, &data->contents, delimits, 0, comments);
if (F_status_is_error(status)) {
// @todo: detect and replace fll_error_file_type_file with fll_error_file_type_pipe as appropriate.
objects_delimits->used = 0;
contents_delimits->used = 0;
- status = fll_fss_extended_read(&data->buffer, &input, &data->objects, &data->contents, 0, 0, objects_delimits, contents_delimits);
+ status = fll_fss_extended_read(data->buffer, &input, &data->objects, &data->contents, 0, 0, objects_delimits, contents_delimits);
if (F_status_is_error(status)) {
// @todo: detect and replace fll_error_file_type_file with fll_error_file_type_pipe as appropriate.