This unfortunately increases the complexity slightly as deallocation must occur before functions exist.
On the other hand doing so avoids overly complicated loops that would probably make the code less readable.
if (input->start >= buffer->used) return f_invalid_parameter;
#endif // _di_level_1_parameter_checking_
+ // delimits must only be applied once a valid object is found
+ f_string_lengths delimits = f_string_lengths_initialize;
+
fl_macro_fss_skip_past_whitespace((*buffer), (*input))
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
// return found nothing if this line only contains whitespace and delimit placeholders
if (buffer->string[input->start] == f_fss_basic_close) {
// ignore all comment lines
if (buffer->string[input->start] == f_fss_comment) {
- fl_macro_fss_object_seek_till_newline((*buffer), (*input), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_seek_till_newline((*buffer), (*input), delimits, f_no_data_on_eos, f_no_data_on_stop)
input->start++;
return fl_fss_found_no_object;
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
if (buffer->string[input->start] == f_fss_delimit_single_quote || buffer->string[input->start] == f_fss_delimit_double_quote) {
- buffer->string[last_slash] = f_fss_delimit_placeholder;
+ if (delimits.used >= delimits.size) {
+ f_status allocation_status = f_status_initialize;
+
+ f_resize_string_lengths(allocation_status, delimits, delimits.size + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(allocation_status)) {
+ f_delete_string_lengths(allocation_status, delimits);
+ return allocation_status;
+ }
+ }
+
+ delimits.array[delimits.used] = last_slash;
+ delimits.used++;
input->start++;
}
} else if (buffer->string[input->start] == f_fss_delimit_single_quote || buffer->string[input->start] == f_fss_delimit_double_quote) {
if (quoted == f_eos) {
while (isgraph(buffer->string[input->start]) || buffer->string[input->start] == f_fss_delimit_placeholder) {
input->start++;
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
} // while
if (isspace(buffer->string[input->start])) {
found->stop = input->start - 1;
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
if (buffer->string[input->start] == f_eol) {
input->start++;
return fl_fss_found_object_no_content;
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_unterminated_group_on_eos, f_unterminated_group_on_stop)
if (buffer->string[input->start] == quoted) {
f_string_length location = input->start;
input->start = first_slash;
if (slash_count % 2 == 0) {
+ if (delimits.used + (slash_count / 2) >= delimits.size) {
+ f_status allocation_status = f_status_initialize;
+
+ f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(allocation_status)) {
+ f_delete_string_lengths(allocation_status, delimits);
+ return allocation_status;
+ }
+ }
+
while (slash_count > 0) {
if (buffer->string[input->start] == f_fss_delimit_slash) {
if (slash_count % 2 != 0) {
- buffer->string[input->start] = f_fss_delimit_placeholder;
+ delimits.array[delimits.used] = input->start;
+ delimits.used++;
}
slash_count--;
input->start = location + 1;
fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*input))
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
if (isgraph(buffer->string[input->start])) {
while (input->start < buffer->used && input->start <= input->stop && buffer->string[input->start] != f_eol) {
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
+
+ {
+ f_status allocation_status = f_status_initialize;
+
+ f_delete_string_lengths(allocation_status, delimits);
+ }
input->start++;
return fl_fss_found_no_object;
} else if (buffer->string[input->start] == f_eol) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
found->stop = input->start - 1;
input->start++;
return fl_fss_found_object_no_content;
}
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
found->stop = input->start - 1;
input->start++;
return fl_fss_found_object;
} else {
+ if (delimits.used + (slash_count / 2) >= delimits.size) {
+ f_status allocation_status = f_status_initialize;
+
+ f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(allocation_status)) {
+ f_delete_string_lengths(allocation_status, delimits);
+ return allocation_status;
+ }
+ }
+
while (slash_count > 0) {
if (buffer->string[input->start] == f_fss_delimit_slash) {
if (slash_count % 2 != 0) {
- buffer->string[input->start] = f_fss_delimit_placeholder;
+ delimits.array[delimits.used] = input->start;
+ delimits.used++;
}
slash_count--;
while (input->start <= input->stop && input->start < buffer->used) {
if (buffer->string[input->start] == f_eol) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
input->start++;
return fl_fss_found_object_no_content;
} else if (isspace(buffer->string[input->start])) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
input->start++;
return fl_fss_found_object;
} else if (buffer->string[input->start] != f_fss_delimit_placeholder) {
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
+
+ {
+ f_status allocation_status = f_status_initialize;
+
+ f_delete_string_lengths(allocation_status, delimits);
+ }
input->start++;
return fl_fss_found_no_object;
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
} else if (buffer->string[input->start] == f_eol) {
+ {
+ f_status allocation_status = f_status_initialize;
+
+ f_delete_string_lengths(allocation_status, delimits);
+ }
+
input->start++;
return fl_fss_found_no_object;
}
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_unterminated_group_on_eos, f_unterminated_group_on_stop)
}
// seek to the end of the line when no valid object is found
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
+
+ {
+ f_status allocation_status = f_status_initialize;
+
+ f_delete_string_lengths(allocation_status, delimits);
+ }
input->start++;
return fl_fss_found_no_object;
if (found->used > found->size) return f_invalid_parameter;
#endif // _di_level_1_parameter_checking_
+ // delimits must only be applied once a valid object is found
+ f_string_lengths delimits = f_string_lengths_initialize;
+
fl_macro_fss_skip_past_whitespace((*buffer), (*input))
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
// return found nothing if this line only contains whitespace and delimit placeholders
if (buffer->string[input->start] == f_eol) {
return fl_fss_found_no_content;
}
- fl_macro_fss_allocate_content_if_necessary((*found));
+ fl_macro_fss_allocate_content_if_necessary((*found), delimits);
found->array[found->used].start = input->start;
// search for valid content
do {
fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*input))
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
if (buffer->string[input->start] == f_fss_basic_close) break;
if (input->start >= buffer->used) return f_invalid_parameter;
#endif // _di_level_1_parameter_checking_
+ // delimits must only be applied once a valid object is found
+ f_string_lengths delimits = f_string_lengths_initialize;
+
fl_macro_fss_skip_past_whitespace((*buffer), (*input))
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
// return found nothing if this line only contains whitespace and delimit placeholders
if (buffer->string[input->start] == f_eol) {
// ignore all comment lines
if (buffer->string[input->start] == f_fss_comment) {
- fl_macro_fss_object_seek_till_newline((*buffer), (*input), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_seek_till_newline((*buffer), (*input), delimits, f_no_data_on_eos, f_no_data_on_stop)
input->start++;
return fl_fss_found_no_object;
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
if (buffer->string[input->start] == f_fss_basic_list_open) {
f_string_length stop_point = input->start - 1;
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
if (buffer->string[input->start] == f_eol) {
f_string_length location = input->start;
input->start = first_slash;
+ if (delimits.used + (slash_count / 2) >= delimits.size) {
+ f_status allocation_status = f_status_initialize;
+
+ f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(allocation_status)) {
+ f_delete_string_lengths(allocation_status, delimits);
+ return allocation_status;
+ }
+ }
+
if (slash_count % 2 == 0) {
while (slash_count > 0) {
if (buffer->string[input->start] == f_fss_delimit_slash) {
if (slash_count % 2 != 0) {
- buffer->string[input->start] = f_fss_delimit_placeholder;
+ delimits.array[delimits.used] = input->start;
+ delimits.used++;
}
slash_count--;
input->start++;
} // while
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
found->stop = stop_point;
input->start = location + 1;
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
if (buffer->string[input->start] == f_eol) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
found->stop = stop_point;
input->start++;
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
input->start++;
return fl_fss_found_no_object;
if (input->start >= buffer->used) return f_invalid_parameter;
#endif // _di_level_1_parameter_checking_
+ // delimits must only be applied once a valid object is found
+ f_string_lengths delimits = f_string_lengths_initialize;
+
fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*input))
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
- fl_macro_fss_allocate_content_if_necessary((*found));
+ fl_macro_fss_allocate_content_if_necessary((*found), delimits);
found->array[found->used].start = input->start;
f_string_length last_newline = input->start;
} // while
if (found_newline) {
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
} else {
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
}
if (buffer->string[input->start] == f_fss_basic_list_open) {
} // while
if (found_newline) {
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
} else {
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
}
if (buffer->string[input->start] == f_eol) {
input->start = first_slash;
if (slash_count % 2 == 0) {
+ // FIXME: apply delimits??
if (found_newline) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
found->array[found->used].stop = last_newline;
input->start = last_newline + 1;
found->used++;
return fl_fss_found_no_content;
}
+ if (delimits.used + (slash_count / 2) >= delimits.size) {
+ f_status allocation_status = f_status_initialize;
+
+ f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(allocation_status)) {
+ f_delete_string_lengths(allocation_status, delimits);
+ return allocation_status;
+ }
+ }
+
while (slash_count > 0) {
if (buffer->string[input->start] == f_fss_delimit_slash) {
if (slash_count % 2 != 0) {
- buffer->string[input->start] = f_fss_delimit_placeholder;
+ delimits.array[delimits.used] = input->start;
+ delimits.used++;
}
slash_count--;
} // while
if (found_newline) {
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
} else {
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
}
if (buffer->string[input->start] == f_eol) {
if (found_newline) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
found->array[found->used].stop = last_newline;
input->start = last_newline + 1;
found->used++;
} // while
if (found_newline) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
found->array[found->used].stop = last_newline - 1;
input->start = last_newline + 1;
found->used++;
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
return fl_fss_found_content;
}
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
return fl_fss_found_no_content;
}
if (input->start >= buffer->used) return f_invalid_parameter;
#endif // _di_level_1_parameter_checking_
+ // delimits must only be applied once a valid object is found
+ f_string_lengths delimits = f_string_lengths_initialize;
+
fl_macro_fss_skip_past_whitespace((*buffer), (*input))
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
// return found nothing if this line only contains whitespace and delimit placeholders
if (buffer->string[input->start] == f_fss_extended_close) {
// ignore all comment lines
if (buffer->string[input->start] == f_fss_comment) {
- fl_macro_fss_object_seek_till_newline((*buffer), (*input), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_seek_till_newline((*buffer), (*input), delimits, f_no_data_on_eos, f_no_data_on_stop)
input->start++;
return fl_fss_found_no_object;
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
if (buffer->string[input->start] == f_fss_delimit_single_quote || buffer->string[input->start] == f_fss_delimit_double_quote) {
- buffer->string[last_slash] = f_fss_delimit_placeholder;
+ if (delimits.used >= delimits.size) {
+ f_status allocation_status = f_status_initialize;
+
+ f_resize_string_lengths(allocation_status, delimits, delimits.size + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(allocation_status)) {
+ f_delete_string_lengths(allocation_status, delimits);
+ return allocation_status;
+ }
+ }
+
+ delimits.array[delimits.used] = last_slash;
+ delimits.used++;
input->start++;
}
} else if (buffer->string[input->start] == f_fss_delimit_single_quote || buffer->string[input->start] == f_fss_delimit_double_quote) {
if (quoted == f_eos) {
while (isgraph(buffer->string[input->start]) || buffer->string[input->start] == f_fss_delimit_placeholder) {
input->start++;
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
} // while
if (isspace(buffer->string[input->start])) {
found->stop = input->start - 1;
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
if (buffer->string[input->start] == f_eol) {
input->start++;
return fl_fss_found_object_no_content;
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_unterminated_group_on_eos, f_unterminated_group_on_stop)
if (buffer->string[input->start] == quoted) {
f_string_length location = input->start;
input->start = first_slash;
+ if (delimits.used + (slash_count / 2) >= delimits.size) {
+ f_status allocation_status = f_status_initialize;
+
+ f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(allocation_status)) {
+ f_delete_string_lengths(allocation_status, delimits);
+ return allocation_status;
+ }
+ }
+
if (slash_count % 2 == 0) {
while (slash_count > 0) {
if (buffer->string[input->start] == f_fss_delimit_slash) {
if (slash_count % 2 != 0) {
- buffer->string[input->start] = f_fss_delimit_placeholder;
+ delimits.array[delimits.used] = input->start;
+ delimits.used++;
}
slash_count--;
input->start = location + 1;
fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*input))
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_unterminated_group_on_eos, f_unterminated_group_on_stop)
if (isgraph(buffer->string[input->start])) {
while (input->start < buffer->used && input->start <= input->stop && buffer->string[input->start] != f_eol) {
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
input->start++;
return fl_fss_found_no_object;
} else if (buffer->string[input->start] == f_eol) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
found->stop = input->start - 1;
input->start++;
return fl_fss_found_object_no_content;
}
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
found->stop = input->start - 1;
input->start++;
return fl_fss_found_object;
} else {
+ if (delimits.used + (slash_count / 2) >= delimits.size) {
+ f_status allocation_status = f_status_initialize;
+
+ f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(allocation_status)) {
+ f_delete_string_lengths(allocation_status, delimits);
+ return allocation_status;
+ }
+ }
+
while (slash_count > 0) {
if (buffer->string[input->start] == f_fss_delimit_slash) {
if (slash_count % 2 != 0) {
- buffer->string[input->start] = f_fss_delimit_placeholder;
+ delimits.array[delimits.used] = input->start;
+ delimits.used++;
}
slash_count--;
while (input->start <= input->stop && input->start < buffer->used) {
if (buffer->string[input->start] == f_eol) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
input->start++;
return fl_fss_found_object_no_content;
} else if (isspace(buffer->string[input->start])) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
input->start++;
return fl_fss_found_object;
} else if (buffer->string[input->start] != f_fss_delimit_placeholder) {
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
input->start++;
return fl_fss_found_no_object;
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
} else if (buffer->string[input->start] == f_eol) {
input->start++;
return fl_fss_found_no_object;
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_unterminated_group_on_eos, f_unterminated_group_on_stop)
}
// seek to the end of the line when no valid object is found
input->start++;
} // while
- fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop)
+ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop)
input->start++;
return fl_fss_found_no_object;
if (input->start >= buffer->used) return f_invalid_parameter;
#endif // _di_level_1_parameter_checking_
+ // delimits must only be applied once a valid object is found
+ f_string_lengths delimits = f_string_lengths_initialize;
+
fl_macro_fss_skip_past_whitespace((*buffer), (*input))
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
// return found nothing if this line only contains whitespace and delimit placeholders
if (buffer->string[input->start] == f_fss_extended_close) {
if (found->used >= found->size) {
f_resize_fss_content(status, (*found), found->size + f_fss_default_allocation_step);
- if (f_macro_test_for_allocation_errors(status)) return status;
+ if (f_macro_test_for_allocation_errors(status)){
+ f_status allocation_status = f_status_initialize;
+ f_delete_string_lengths(allocation_status, delimits);
+
+ return status;
+ }
}
// begin the search
found->used++;
if (buffer->string[input->start] == f_eol) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
return fl_fss_found_content;
}
continue;
}
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
if (buffer->string[input->start] == f_fss_delimit_single_quote || buffer->string[input->start] == f_fss_delimit_double_quote) {
- buffer->string[last_slash] = f_fss_delimit_placeholder;
+ if (delimits.used >= delimits.size) {
+ f_status allocation_status = f_status_initialize;
+
+ f_resize_string_lengths(allocation_status, delimits, delimits.size + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(allocation_status)) {
+ f_delete_string_lengths(allocation_status, delimits);
+ return allocation_status;
+ }
+ }
+
+ delimits.array[delimits.used] = last_slash;
+ delimits.used++;
input->start++;
}
} else if (buffer->string[input->start] == f_fss_delimit_single_quote || buffer->string[input->start] == f_fss_delimit_double_quote) {
if (quoted == f_eos) {
while (isgraph(buffer->string[input->start]) || buffer->string[input->start] == f_fss_delimit_placeholder) {
input->start++;
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
} // while
if (isspace(buffer->string[input->start])) {
found->used++;
if (buffer->string[input->start] == f_eol) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
input->start++;
return fl_fss_found_content;
}
input->start++;
} // while
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop)
+ fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), delimits, f_unterminated_group_on_eos, f_unterminated_group_on_stop)
if (buffer->string[input->start] == quoted) {
location = input->start;
input->start = first_slash;
if (slash_count % 2 == 0) {
+ if (delimits.used + (slash_count / 2) >= delimits.size) {
+ f_status allocation_status = f_status_initialize;
+
+ f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(allocation_status)) {
+ f_delete_string_lengths(allocation_status, delimits);
+ return allocation_status;
+ }
+ }
+
while (slash_count > 0) {
if (buffer->string[input->start] == f_fss_delimit_slash) {
if (slash_count % 2 != 0) {
- buffer->string[input->start] = f_fss_delimit_placeholder;
+ delimits.array[delimits.used] = input->start;
+ delimits.used++;
}
slash_count--;
input->start = location + 1;
fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*input))
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
if (isgraph(buffer->string[input->start])) {
while (input->start < buffer->used && input->start <= input->stop && buffer->string[input->start] != f_eol) {
input->start++;
} // while
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop)
+ fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), delimits, f_unterminated_group_on_eos, f_unterminated_group_on_stop)
input->start++;
return f_unterminated_group;
} else if (buffer->string[input->start] == f_eol) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
found->array[found->used].stop = input->start - 1;
input->start++;
found->used++;
found->used++;
continue;
} else {
+ if (delimits.used + (slash_count / 2) >= delimits.size) {
+ f_status allocation_status = f_status_initialize;
+
+ f_resize_string_lengths(allocation_status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(allocation_status)) {
+ f_delete_string_lengths(allocation_status, delimits);
+ return allocation_status;
+ }
+ }
+
while (slash_count > 0) {
if (buffer->string[input->start] == f_fss_delimit_slash) {
if (slash_count % 2 != 0) {
- buffer->string[input->start] = f_fss_delimit_placeholder;
+ delimits.array[delimits.used] = input->start;
+ delimits.used++;
}
slash_count--;
while (input->start <= input->stop && input->start < buffer->used) {
if (buffer->string[input->start] == f_eol) {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
input->start++;
found->used++;
input->start++;
} // while
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop)
+ fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), delimits, f_unterminated_group_on_eos, f_unterminated_group_on_stop)
input->start++;
return f_unterminated_group;
break;
}
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
} else if (buffer->string[input->start] == f_eol) {
if (found->used == already_used) {
input->start++;
return fl_fss_found_no_content;
} else {
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
found->array[found->used].stop = input->start - 1;
input->start++;
found->used++;
input->start++;
} // while
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop)
+ fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), delimits, f_unterminated_group_on_eos, f_unterminated_group_on_stop)
}
if (continue_main_loop) {
break;
} // while
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
// seek to the end of the line when no valid content is found
while (input->start < buffer->used && input->start <= input->stop && buffer->string[input->start] != f_eol) {
input->start++;
} // while
- fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop)
+ fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*input), (*found), delimits, f_none_on_eos, f_none_on_stop)
if (found->used == already_used) {
input->start++;
return fl_fss_found_no_content;
}
+ fl_macro_fss_apply_delimit_placeholders((*buffer), delimits);
+
input->start++;
return fl_fss_found_content;
}
extern "C"{
#endif
+#ifndef _di_fl_macro_fss_apply_delimit_placeholders_
+ #define fl_macro_fss_apply_delimit_placeholders(buffer, delimits) \
+ { \
+ f_status allocation_status = f_status_initialize; \
+ \
+ f_string_length i = 0; \
+ \
+ while (i < delimits.used) { \
+ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
+ i++; \
+ } \
+ \
+ f_delete_string_lengths(allocation_status, delimits); \
+ }
+#endif // _di_fl_macro_fss_apply_delimit_placeholders_
+
#ifndef _di_fl_macro_fss_skip_past_whitespace_
#define fl_macro_fss_skip_past_whitespace(buffer, input) \
while (!isgraph(buffer.string[input.start]) || buffer.string[input.start] == f_fss_delimit_placeholder) { \
#endif // _di_fl_macro_fss_skip_past_delimit_placeholders_
#ifndef _di_fl_macro_fss_object_return_on_overflow_
- #define fl_macro_fss_object_return_on_overflow(buffer, input, found, eos_status, stop_status) \
+ #define fl_macro_fss_object_return_on_overflow(buffer, input, found, delimits, eos_status, stop_status) \
if (input.start >= buffer.used) { \
+ f_status allocation_status = f_status_initialize; \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
found.stop = buffer.used - 1; \
return eos_status; \
} else if (input.start > input.stop) { \
+ f_status allocation_status = f_status_initialize; \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
found.stop = input.stop; \
return stop_status; \
}
#endif // _di_fl_macro_fss_object_return_on_overflow_
+#ifndef _di_fl_macro_fss_object_delimited_return_on_overflow_
+ #define fl_macro_fss_object_delimited_return_on_overflow(buffer, input, found, delimits, eos_status, stop_status) \
+ if (input.start >= buffer.used) { \
+ f_status allocation_status = f_status_initialize; \
+ f_string_length i = 0; \
+ \
+ while (i < delimits.used) { \
+ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
+ i++; \
+ } \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
+ found.stop = buffer.used - 1; \
+ return eos_status; \
+ } else if (input.start > input.stop) { \
+ f_status allocation_status = f_status_initialize; \
+ f_string_length i = 0; \
+ \
+ while (i < delimits.used) { \
+ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
+ i++; \
+ } \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
+ found.stop = input.stop; \
+ return stop_status; \
+ }
+#endif // _di_fl_macro_fss_object_delimited_return_on_overflow_
+
#ifndef _di_fl_macro_fss_content_return_on_overflow_
- #define fl_macro_fss_content_return_on_overflow(buffer, input, found, eos_status, stop_status) \
+ #define fl_macro_fss_content_return_on_overflow(buffer, input, found, delimits, eos_status, stop_status) \
if (input.start >= buffer.used) { \
+ f_status allocation_status = f_status_initialize; \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
found.array[found.used].stop = buffer.used - 1; \
return eos_status; \
} else if (input.start > input.stop) { \
+ f_status allocation_status = f_status_initialize; \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
found.array[found.used].stop = input.stop; \
return stop_status; \
}
#endif // _di_fl_macro_fss_content_return_on_overflow_
+#ifndef _di_fl_macro_fss_content_delimited_return_on_overflow_
+ #define fl_macro_fss_content_delimited_return_on_overflow(buffer, input, found, delimits, eos_status, stop_status) \
+ if (input.start >= buffer.used) { \
+ f_status allocation_status = f_status_initialize; \
+ f_string_length i = 0; \
+ \
+ while (i < delimits.used) { \
+ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
+ i++; \
+ } \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
+ found.array[found.used].stop = buffer.used - 1; \
+ return eos_status; \
+ } else if (input.start > input.stop) { \
+ f_status allocation_status = f_status_initialize; \
+ f_string_length i = 0; \
+ \
+ while (i < delimits.used) { \
+ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
+ i++; \
+ } \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
+ found.array[found.used].stop = input.stop; \
+ return stop_status; \
+ }
+#endif // _di_fl_macro_fss_content_delimited_return_on_overflow_
+
#ifndef _di_fl_macro_fss_content_return_on_overflow_reset_
- #define fl_macro_fss_content_return_on_overflow_reset(buffer, input, found, eos_status, stop_status, set_stop) \
+ #define fl_macro_fss_content_return_on_overflow_reset(buffer, input, found, delimits, eos_status, stop_status, set_stop) \
if (input.start >= buffer.used) { \
+ f_status allocation_status = f_status_initialize; \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
input.start = set_stop; \
found.array[found.used].stop = set_stop; \
return eos_status; \
} else if (input.start > input.stop) { \
+ f_status allocation_status = f_status_initialize; \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
input.start = set_stop; \
found.array[found.used].stop = set_stop; \
return stop_status; \
}
#endif // _di_fl_macro_fss_content_return_on_overflow_reset_
+#ifndef _di_fl_macro_fss_content_delimited_return_on_overflow_reset_
+ #define fl_macro_fss_content_delimited_return_on_overflow_reset(buffer, input, found, delimits, eos_status, stop_status, set_stop) \
+ if (input.start >= buffer.used) { \
+ f_status allocation_status = f_status_initialize; \
+ f_string_length i = 0; \
+ \
+ while (i < delimits.used) { \
+ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
+ i++; \
+ } \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
+ input.start = set_stop; \
+ found.array[found.used].stop = set_stop; \
+ return eos_status; \
+ } else if (input.start > input.stop) { \
+ f_status allocation_status = f_status_initialize; \
+ f_string_length i = 0; \
+ \
+ while (i < delimits.used) { \
+ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
+ i++; \
+ } \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
+ input.start = set_stop; \
+ found.array[found.used].stop = set_stop; \
+ return stop_status; \
+ }
+#endif // _di_fl_macro_fss_content_delimited_return_on_overflow_reset_
+
#ifndef _di_fl_macro_fss_allocate_content_if_necessary_
- #define fl_macro_fss_allocate_content_if_necessary(content) \
+ #define fl_macro_fss_allocate_content_if_necessary(content, delimits) \
if (content.used >= content.size) { \
f_status status = f_status_initialize; \
\
f_resize_fss_content(status, content, content.size + f_fss_default_allocation_step); \
- if (f_macro_test_for_allocation_errors(status)) return status; \
+ if (f_macro_test_for_allocation_errors(status)) { \
+ f_status allocation_status = f_status_initialize; \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
+ return status; \
+ } \
}
#endif // _di_fl_macro_fss_allocate_content_if_necessary_
#ifndef _di_fl_macro_fss_object_seek_till_newline_
- #define fl_macro_fss_object_seek_till_newline(buffer, input, eos_status, stop_status) \
+ #define fl_macro_fss_object_seek_till_newline(buffer, input, delimits, eos_status, stop_status) \
while (buffer.string[input.start] != f_eol) { \
++input.start; \
if (input.start >= buffer.used) { \
+ f_status allocation_status = f_status_initialize; \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
return eos_status; \
} \
if (input.start > input.stop) { \
+ f_status allocation_status = f_status_initialize; \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
return stop_status; \
} \
} // while
#endif // _di_fl_macro_fss_object_seek_till_newline_
+#ifndef _di_fl_macro_fss_object_delimited_seek_till_newline_
+ #define fl_macro_fss_object_delimited_seek_till_newline(buffer, input, delimits, eos_status, stop_status) \
+ while (buffer.string[input.start] != f_eol) { \
+ ++input.start; \
+ if (input.start >= buffer.used) { \
+ f_status allocation_status = f_status_initialize; \
+ f_string_length i = 0; \
+ \
+ while (i < delimits.used) { \
+ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
+ i++; \
+ } \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
+ return eos_status; \
+ } \
+ if (input.start > input.stop) { \
+ f_status allocation_status = f_status_initialize; \
+ f_string_length i = 0; \
+ \
+ while (i < delimits.used) { \
+ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
+ i++; \
+ } \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
+ return stop_status; \
+ } \
+ } // while
+#endif // _di_fl_macro_fss_object_delimited_seek_till_newline_
+
#ifndef _di_fl_macro_fss_content_seek_till_newline_
- #define fl_macro_fss_content_seek_till_newline(buffer, input, found, eos_status, stop_status) \
+ #define fl_macro_fss_content_seek_till_newline(buffer, input, found, delimits, eos_status, stop_status) \
while (buffer.string[input.start] != f_eol) { \
++input.start; \
if (input.start >= buffer.used) { \
+ f_status allocation_status = f_status_initialize; \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
found.array[found.used].stop = input.stop; \
return eos_status; \
} \
if (input.start > input.stop) { \
+ f_status allocation_status = f_status_initialize; \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
found.array[found.used].stop = input.stop; \
return stop_status; \
} \
} // while
#endif // _di_fl_macro_fss_content_seek_till_newline_
+#ifndef _di_fl_macro_fss_content_delimited_seek_till_newline_
+ #define fl_macro_fss_content_delimited_seek_till_newline(buffer, input, found, delimits, eos_status, stop_status) \
+ while (buffer.string[input.start] != f_eol) { \
+ ++input.start; \
+ if (input.start >= buffer.used) { \
+ f_status allocation_status = f_status_initialize; \
+ f_string_length i = 0; \
+ \
+ while (i < delimits.used) { \
+ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
+ i++; \
+ } \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
+ found.array[found.used].stop = input.stop; \
+ return eos_status; \
+ } \
+ if (input.start > input.stop) { \
+ f_status allocation_status = f_status_initialize; \
+ f_string_length i = 0; \
+ \
+ while (i < delimits.used) { \
+ buffer.string[delimits.array[i]] = f_fss_delimit_placeholder; \
+ i++; \
+ } \
+ f_delete_string_lengths(allocation_status, delimits); \
+ \
+ found.array[found.used].stop = input.stop; \
+ return stop_status; \
+ } \
+ } // while
+#endif // _di_fl_macro_fss_content_delimited_seek_till_newline_
+
#ifdef __cplusplus
} // extern "C"
#endif
if (status == fl_fss_found_object || status == fl_fss_found_object_no_content) {
objects->used++;
- fl_macro_fss_allocate_content_if_necessary(contents->array[contents->used]);
+ if (contents->array[contents->used].used >= contents->array[contents->used].size) {
+ f_status status = f_status_initialize;
+
+ f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(status)) {
+ return status;
+ }
+ }
contents->used++;
} else if (status == fl_fss_found_object_no_content) {
found_data = f_true;
- fl_macro_fss_allocate_content_if_necessary(contents->array[contents->used]);
+ if (contents->array[contents->used].used >= contents->array[contents->used].size) {
+ f_status status = f_status_initialize;
+
+ f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(status)) {
+ return status;
+ }
+ }
break;
}
if (status == fl_fss_found_object || status == fl_fss_found_object_no_content) {
objects->used++;
- fl_macro_fss_allocate_content_if_necessary(contents->array[contents->used]);
+ if (contents->array[contents->used].used >= contents->array[contents->used].size) {
+ f_status status = f_status_initialize;
+
+ f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(status)) {
+ return status;
+ }
+ }
contents->used++;
} else if (status == fl_fss_found_object_no_content) {
found_data = f_true;
- fl_macro_fss_allocate_content_if_necessary(contents->array[contents->used]);
+ if (contents->array[contents->used].used >= contents->array[contents->used].size) {
+ f_status status = f_status_initialize;
+
+ f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(status)) {
+ return status;
+ }
+ }
break;
}
if (status == fl_fss_found_object || status == fl_fss_found_object_no_content) {
objects->used++;
- fl_macro_fss_allocate_content_if_necessary(contents->array[contents->used]);
+ if (contents->array[contents->used].used >= contents->array[contents->used].size) {
+ f_status status = f_status_initialize;
+
+ f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(status)) {
+ return status;
+ }
+ }
contents->used++;
} else if (status == fl_fss_found_object_no_content) {
found_data = f_true;
- fl_macro_fss_allocate_content_if_necessary(contents->array[contents->used]);
+ if (contents->array[contents->used].used >= contents->array[contents->used].size) {
+ f_status status = f_status_initialize;
+
+ f_resize_fss_content(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step);
+
+ if (f_macro_test_for_allocation_errors(status)) {
+ return status;
+ }
+ }
break;
}