From: Kevin Day Date: Wed, 14 Oct 2020 03:53:47 +0000 (-0500) Subject: Progress: FSS basic list and extended list. X-Git-Tag: 0.5.1~33 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=4f9335fa6381b0906dcbc308b019f88959870ca0;p=fll Progress: FSS basic list and extended list. Move some common and repeated code into private functions. Be sure to allow and handle whitespace after a valid object close that is being delimited within content. Begin adding support for nested in the extended list content write. - The idea here is to have a whitelist of ranges to ignore. - This offloads the possible complex logic to a higher level. The basic and extended list level 2 write functions should both accept a single content instead of an array of content. Rename the fss write functions, appending _string. - These functions accept a string instead of an appropriate object/content structure. - I will need to write the functions that accept the appropriate object/content structures to perform the same tasks. Make the prepend a constant pointer to make it easier to not specify it (no variable needs to be defined, just pass 0). --- diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index b495437..3cdcbb1 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -91,8 +91,8 @@ extern "C" { } #endif // _di_fl_fss_basic_content_read_ -#ifndef _di_fl_fss_basic_object_write_ - f_return_status fl_fss_basic_object_write(const f_string_static_t object, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { +#ifndef _di_fl_fss_basic_object_write_string_ + f_return_status fl_fss_basic_object_write_string(const f_string_static_t object, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!destination) return F_status_set_error(F_parameter); @@ -130,10 +130,10 @@ extern "C" { return status; } -#endif // _di_fl_fss_basic_object_write_ +#endif // _di_fl_fss_basic_object_write_string_ -#ifndef _di_fl_fss_basic_content_write_ - f_return_status fl_fss_basic_content_write(const f_string_static_t content, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { +#ifndef _di_fl_fss_basic_content_write_string_ + f_return_status fl_fss_basic_content_write_string(const f_string_static_t content, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!destination) return F_status_set_error(F_parameter); @@ -190,7 +190,7 @@ extern "C" { return F_none_eos; } -#endif // _di_fl_fss_basic_content_write_ +#endif // _di_fl_fss_basic_content_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_fss/c/fss_basic.h b/level_1/fl_fss/c/fss_basic.h index 702fa37..469b921 100644 --- a/level_1/fl_fss/c/fss_basic.h +++ b/level_1/fl_fss/c/fss_basic.h @@ -121,7 +121,7 @@ extern "C" { #endif // _di_fl_fss_basic_content_read_ /** - * Write an fss-0000 object. + * Write an fss-0000 object from a given string. * * This will write the given string range as a valid object. * Anything within this range will be escaped as necessary. @@ -161,12 +161,12 @@ extern "C" { * Errors (with error bit) from: f_fss_is_space(). * Errors (with error bit) from: f_utf_buffer_increment(). */ -#ifndef _di_fl_fss_basic_object_write_ - extern f_return_status fl_fss_basic_object_write(const f_string_static_t object, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); -#endif // _di_fl_fss_basic_object_write_ +#ifndef _di_fl_fss_basic_object_write_string_ + extern f_return_status fl_fss_basic_object_write_string(const f_string_static_t object, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); +#endif // _di_fl_fss_basic_object_write_string_ /** - * Write an fss-0000 content. + * Write an fss-0000 content from a given string. * * This will write the given string range as a valid content. * Anything within this range will be escaped as necessary. @@ -196,9 +196,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if appended string length is too large to store in the destination. */ -#ifndef _di_fl_fss_basic_content_write_ - extern f_return_status fl_fss_basic_content_write(const f_string_static_t content, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); -#endif // _di_fl_fss_basic_content_write_ +#ifndef _di_fl_fss_basic_content_write_string_ + extern f_return_status fl_fss_basic_content_write_string(const f_string_static_t content, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); +#endif // _di_fl_fss_basic_content_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_fss/c/fss_basic_list.c b/level_1/fl_fss/c/fss_basic_list.c index b9a5e16..a328590 100644 --- a/level_1/fl_fss/c/fss_basic_list.c +++ b/level_1/fl_fss/c/fss_basic_list.c @@ -407,8 +407,8 @@ extern "C" { } #endif // _di_fl_fss_basic_list_content_read_ -#ifndef _di_fl_fss_basic_list_object_write_ - f_return_status fl_fss_basic_list_object_write(const f_string_static_t object, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { +#ifndef _di_fl_fss_basic_list_object_write_string_ + f_return_status fl_fss_basic_list_object_write_string(const f_string_static_t object, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -597,10 +597,10 @@ extern "C" { return F_none; } -#endif // _di_fl_fss_basic_list_object_write_ +#endif // _di_fl_fss_basic_list_object_write_string_ -#ifndef _di_fl_fss_basic_list_content_write_ - f_return_status fl_fss_basic_list_content_write(const f_string_static_t content, const uint8_t complete, const f_string_static_t prepend, f_string_range_t *range, f_string_dynamic_t *destination) { +#ifndef _di_fl_fss_basic_list_content_write_string_ + f_return_status fl_fss_basic_list_content_write_string(const f_string_static_t content, const uint8_t complete, const f_string_static_t *prepend, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!destination) return F_status_set_error(F_parameter); @@ -657,44 +657,19 @@ extern "C" { destination->string[destination->used++] = content.string[range->start]; has_graph = F_true; - status = f_utf_buffer_increment(content, range, 1); - if (F_status_is_error(status)) break; + for (range->start++; range->start <= range->stop && range->start < content.used; range->start++) { - for (; range->start <= range->stop && range->start < content.used; range->start++) { - - if (content.string[range->start] == f_fss_delimit_placeholder) { - continue; - } - else if (content.string[range->start] != f_fss_delimit_slash) { - break; - } + if (content.string[range->start] == f_fss_delimit_placeholder) continue; + if (content.string[range->start] != f_fss_delimit_slash) break; destination->string[destination->used++] = f_fss_delimit_slash; slash_count++; } // for if (content.string[range->start] == f_fss_basic_list_open) { - start = range->start; - - status = f_utf_buffer_increment(content, range, 1); - if (F_status_is_error(status)) break; - - while (range->start < content.used && range->start <= range->stop) { - - if (content.string[range->start] == f_fss_eol) { - do_prepend = F_true; - break; - } - - status = f_fss_is_space(content, *range); - if (F_status_is_error(status)) break; - - if (status == F_false) break; - - status = f_utf_buffer_increment(content, range, 1); - if (F_status_is_error(status)) break; - } // while + start = range->start++; + status = private_fl_fss_basic_list_write_skip_whitespace(content, range); if (F_status_is_error(status)) break; if (content.string[range->start] == f_fss_eol || range->start >= content.used || range->start > range->stop) { @@ -708,42 +683,26 @@ extern "C" { } // while destination->string[destination->used++] = f_fss_delimit_slash; - has_graph = F_false; - is_comment = F_false; - } - else { - status = private_fl_fss_destination_increase(destination); - if (F_status_is_error(status)) break; - } + destination->string[destination->used++] = f_fss_basic_list_open; - destination->string[destination->used++] = f_fss_basic_list_open; + range->start = start + 1; - if (content.string[range->start] == f_fss_eol) { - destination->string[destination->used++] = f_fss_eol; + status = private_fl_fss_basic_list_write_add_until_end(content, range, destination); + if (F_status_is_error(status)) break; + + continue; } + status = private_fl_fss_destination_increase(destination); + if (F_status_is_error(status)) break; + + destination->string[destination->used++] = f_fss_basic_list_open; range->start = start + 1; continue; } } else if (content.string[range->start] == f_fss_basic_list_open && !is_comment) { start = range->start++; - has_graph = F_true; - - while (range->start < content.used && range->start <= range->stop) { - - if (content.string[range->start] == f_fss_eol) break; - - status = f_fss_is_space(content, *range); - if (F_status_is_error(status)) break; - - if (status == F_false) break; - - status = f_utf_buffer_increment(content, range, 1); - if (F_status_is_error(status)) break; - } // while - - if (F_status_is_error(status)) break; if (do_prepend) { status = private_fl_fss_destination_prepend(prepend, destination); @@ -752,30 +711,32 @@ extern "C" { do_prepend = F_false; } + has_graph = F_true; + + status = private_fl_fss_basic_list_write_skip_whitespace(content, range); + if (F_status_is_error(status)) break; + if (content.string[range->start] == f_fss_eol || range->start >= content.used || range->start > range->stop) { - if (content.string[range->start] == f_fss_eol) { - do_prepend = F_true; - } // increase by slash and basic list open and possible newline. status = private_fl_fss_destination_increase_by(3, destination); if (F_status_is_error(status)) break; destination->string[destination->used++] = f_fss_delimit_slash; - has_graph = F_false; - is_comment = F_false; - } - else { - status = private_fl_fss_destination_increase(destination); - if (F_status_is_error(status)) break; - } + destination->string[destination->used++] = f_fss_basic_list_open; - destination->string[destination->used++] = f_fss_basic_list_open; + range->start = start + 1; - if (content.string[range->start] == f_fss_eol) { - destination->string[destination->used++] = f_fss_eol; + status = private_fl_fss_basic_list_write_add_until_end(content, range, destination); + if (F_status_is_error(status)) break; + + continue; } + status = private_fl_fss_destination_increase(destination); + if (F_status_is_error(status)) break; + + destination->string[destination->used++] = f_fss_basic_list_open; range->start = start + 1; continue; } @@ -841,7 +802,7 @@ extern "C" { return F_none; } -#endif // _di_fl_fss_basic_list_content_write_ +#endif // _di_fl_fss_basic_list_content_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_fss/c/fss_basic_list.h b/level_1/fl_fss/c/fss_basic_list.h index 440a3b0..559de67 100644 --- a/level_1/fl_fss/c/fss_basic_list.h +++ b/level_1/fl_fss/c/fss_basic_list.h @@ -76,7 +76,7 @@ extern "C" { #endif // _di_fl_fss_basic_list_object_read_ /** - * Read an fss-0002 content. + * Read an fss-0002 content from a given string. * * This will update the buffer at the given range with any placeholders to unescape any escaped data. * Calling this more than once on the same buffer range could result in multiple unescaping. @@ -154,12 +154,12 @@ extern "C" { * * Errors (with error bit) from: f_utf_buffer_increment(). */ -#ifndef _di_fl_fss_basic_list_object_write_ - extern f_return_status fl_fss_basic_list_object_write(const f_string_static_t object, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); -#endif // _di_fl_fss_basic_list_object_write_ +#ifndef _di_fl_fss_basic_list_object_write_string_ + extern f_return_status fl_fss_basic_list_object_write_string(const f_string_static_t object, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); +#endif // _di_fl_fss_basic_list_object_write_string_ /** - * Write an fss-0002 content. + * Write an fss-0002 content from a given string. * * This will write the given string range as a valid content. * Anything within this range will be escaped as necessary. @@ -177,7 +177,7 @@ extern "C" { * @param prepend * A string of whitespace to prepend at the start of each line. * This should only be whitespace, anything else could product invalid content. - * Set prepend.used to 0 to not use. + * Set the pointer address to 0 to disable. * @param range * The start/stop location within the content string to write as an content. * @param destination @@ -197,9 +197,9 @@ extern "C" { * * Errors (with error bit) from: f_utf_buffer_increment(). */ -#ifndef _di_fl_fss_basic_list_content_write_ - extern f_return_status fl_fss_basic_list_content_write(const f_string_static_t content, const uint8_t complete, const f_string_static_t prepend, f_string_range_t *range, f_string_dynamic_t *destination); -#endif // _di_fl_fss_basic_list_content_write_ +#ifndef _di_fl_fss_basic_list_content_write_string_ + extern f_return_status fl_fss_basic_list_content_write_string(const f_string_static_t content, const uint8_t complete, const f_string_static_t *prepend, f_string_range_t *range, f_string_dynamic_t *destination); +#endif // _di_fl_fss_basic_list_content_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index 6063e62..4425ea6 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -156,8 +156,8 @@ extern "C" { } #endif // _di_fl_fss_extended_content_read_ -#ifndef _di_fl_fss_extended_object_write_ -f_return_status fl_fss_extended_object_write(const f_string_static_t object, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { +#ifndef _di_fl_fss_extended_object_write_string_ +f_return_status fl_fss_extended_object_write_string(const f_string_static_t object, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!destination) return F_status_set_error(F_parameter); @@ -195,10 +195,10 @@ f_return_status fl_fss_extended_object_write(const f_string_static_t object, con return status; } -#endif // _di_fl_fss_extended_object_write_ +#endif // _di_fl_fss_extended_object_write_string_ -#ifndef _di_fl_fss_extended_content_write_ - f_return_status fl_fss_extended_content_write(const f_string_static_t content, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { +#ifndef _di_fl_fss_extended_content_write_string_ + f_return_status fl_fss_extended_content_write_string(const f_string_static_t content, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!destination) return F_status_set_error(F_parameter); @@ -247,7 +247,7 @@ f_return_status fl_fss_extended_object_write(const f_string_static_t object, con return status; } -#endif // _di_fl_fss_extended_content_write_ +#endif // _di_fl_fss_extended_content_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_fss/c/fss_extended.h b/level_1/fl_fss/c/fss_extended.h index f4f2868..cdb45d4 100644 --- a/level_1/fl_fss/c/fss_extended.h +++ b/level_1/fl_fss/c/fss_extended.h @@ -124,7 +124,7 @@ extern "C" { #endif // _di_fl_fss_extended_content_read_ /** - * Write an fss-0001 object. + * Write an fss-0001 object from a given string. * * This will write the given string range as a valid object. * Anything within this range will be escaped as necessary. @@ -162,12 +162,12 @@ extern "C" { * Errors (with error bit) from: f_fss_is_space(). * Errors (with error bit) from: f_utf_buffer_increment(). */ -#ifndef _di_fl_fss_extended_object_write_ - extern f_return_status fl_fss_extended_object_write(const f_string_static_t object, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); -#endif // _di_fl_fss_extended_object_write_ +#ifndef _di_fl_fss_extended_object_write_string_ + extern f_return_status fl_fss_extended_object_write_string(const f_string_static_t object, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); +#endif // _di_fl_fss_extended_object_write_string_ /** - * Write an fss-0001 content. + * Write an fss-0001 content from a given string. * * This will write the given string range as a valid content. * Anything within this range will be escaped as necessary. @@ -206,9 +206,9 @@ extern "C" { * Errors (with error bit) from: f_fss_is_space(). * Errors (with error bit) from: f_utf_buffer_increment(). */ -#ifndef _di_fl_fss_extended_content_write_ - extern f_return_status fl_fss_extended_content_write(const f_string_static_t content, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); -#endif // _di_fl_fss_extended_content_write_ +#ifndef _di_fl_fss_extended_content_write_string_ + extern f_return_status fl_fss_extended_content_write_string(const f_string_static_t content, const f_fss_quote_t quote, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); +#endif // _di_fl_fss_extended_content_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_fss/c/fss_extended_list.c b/level_1/fl_fss/c/fss_extended_list.c index a2b6b18..b8cfead 100644 --- a/level_1/fl_fss/c/fss_extended_list.c +++ b/level_1/fl_fss/c/fss_extended_list.c @@ -791,8 +791,8 @@ extern "C" { } #endif // _di_fl_fss_extended_list_content_read_ -#ifndef _di_fl_fss_extended_list_object_write_ - f_return_status fl_fss_extended_list_object_write(const f_string_static_t object, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { +#ifndef _di_fl_fss_extended_list_object_write_string_ + f_return_status fl_fss_extended_list_object_write_string(const f_string_static_t object, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -993,10 +993,10 @@ extern "C" { return F_none; } -#endif // _di_fl_fss_extended_list_object_write_ +#endif // _di_fl_fss_extended_list_object_write_string_ -#ifndef _di_fl_fss_extended_list_content_write_ - f_return_status fl_fss_extended_list_content_write(const f_string_static_t content, const uint8_t complete, const f_string_static_t prepend, f_string_range_t *range, f_string_dynamic_t *destination) { +#ifndef _di_fl_fss_extended_list_content_write_string_ + f_return_status fl_fss_extended_list_content_write_string(const f_string_static_t content, const uint8_t complete, const f_string_static_t *prepend, const f_string_ranges_t *ignore, f_string_range_t *range, f_string_dynamic_t *destination) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!destination) return F_status_set_error(F_parameter); @@ -1038,6 +1038,8 @@ extern "C" { f_string_length_t slash_count = 0; f_string_length_t start = 0; + f_array_length_t r = 0; + uint8_t width = 0; while (range->start <= range->stop && range->start < content.used) { @@ -1053,49 +1055,26 @@ extern "C" { } destination->string[destination->used++] = content.string[range->start]; - has_graph = F_true; - status = f_utf_buffer_increment(content, range, 1); - if (F_status_is_error(status)) break; + for (range->start++; range->start <= range->stop && range->start < content.used; range->start++) { - for (; range->start <= range->stop && range->start < content.used; range->start++) { - - if (content.string[range->start] == f_fss_delimit_placeholder) { - continue; - } - else if (content.string[range->start] != f_fss_delimit_slash) { - break; - } + if (content.string[range->start] == f_fss_delimit_placeholder) continue; + if (content.string[range->start] != f_fss_delimit_slash) break; destination->string[destination->used++] = f_fss_delimit_slash; slash_count++; } // for - if (content.string[range->start] == f_fss_extended_list_open) { - start = range->start; - - status = f_utf_buffer_increment(content, range, 1); - if (F_status_is_error(status)) break; - - while (range->start < content.used && range->start <= range->stop) { - - if (content.string[range->start] == f_fss_eol) { - do_prepend = F_true; - break; - } - - status = f_fss_is_space(content, *range); - if (F_status_is_error(status)) break; - - if (status == F_false) break; - - status = f_utf_buffer_increment(content, range, 1); - if (F_status_is_error(status)) break; - } // while + if (content.string[range->start] == f_fss_extended_list_open || content.string[range->start] == f_fss_extended_list_close) { + start = range->start++; + status = private_fl_fss_basic_list_write_skip_whitespace(content, range); if (F_status_is_error(status)) break; - if (content.string[range->start] == f_fss_eol || range->start >= content.used || range->start > range->stop) { + if (has_graph && content.string[range->start] == f_fss_extended_list_close) { + // do nothing. + } + else if (content.string[range->start] == f_fss_eol || range->start >= content.used || range->start > range->stop) { // increase by total slashes + 1, along with the extended list open and possible newline. status = private_fl_fss_destination_increase_by(slash_count + 3, destination); @@ -1106,15 +1085,25 @@ extern "C" { } // while destination->string[destination->used++] = f_fss_delimit_slash; - has_graph = F_false; - is_comment = F_false; - } - else { - status = private_fl_fss_destination_increase(destination); + destination->string[destination->used++] = content.string[start]; + + range->start = start + 1; + + status = private_fl_fss_basic_list_write_add_until_end(content, range, destination); if (F_status_is_error(status)) break; + + if (content.string[range->start] != f_fss_eol) { + has_graph = F_true; + } + + continue; } - destination->string[destination->used++] = f_fss_extended_list_open; + // increase by character at "start" and possible newline. + status = private_fl_fss_destination_increase_by(2, destination); + if (F_status_is_error(status)) break; + + destination->string[destination->used++] = content.string[start]; if (content.string[range->start] == f_fss_eol) { destination->string[destination->used++] = f_fss_eol; @@ -1128,24 +1117,8 @@ extern "C" { continue; } } - else if (content.string[range->start] == f_fss_extended_list_open && !is_comment) { + else if ((content.string[range->start] == f_fss_extended_list_open || (!has_graph && content.string[range->start] == f_fss_extended_list_close)) && !is_comment) { start = range->start++; - has_graph = F_true; - - while (range->start < content.used && range->start <= range->stop) { - - if (content.string[range->start] == f_fss_eol) break; - - status = f_fss_is_space(content, *range); - if (F_status_is_error(status)) break; - - if (status == F_false) break; - - status = f_utf_buffer_increment(content, range, 1); - if (F_status_is_error(status)) break; - } // while - - if (F_status_is_error(status)) break; if (do_prepend) { status = private_fl_fss_destination_prepend(prepend, destination); @@ -1154,34 +1127,51 @@ extern "C" { do_prepend = F_false; } + has_graph = F_true; + + status = private_fl_fss_basic_list_write_skip_whitespace(content, range); + if (F_status_is_error(status)) break; + if (content.string[range->start] == f_fss_eol || range->start >= content.used || range->start > range->stop) { if (content.string[range->start] == f_fss_eol) { do_prepend = F_true; } + if (ignore && ignore->used) { + for (r = 0; r < ignore->used; r++) { + if (start >= ignore->array[r].start && start <= ignore->array[r].stop) break; + } // for + + if (r < ignore->used) { + status = private_fl_fss_destination_increase(destination); + if (F_status_is_error(status)) break; + + destination->string[destination->used++] = content.string[start]; + range->start = start + 1; + ends_on_eol = F_false; + continue; + } + } + // increase by slash and extended list open and possible newline. status = private_fl_fss_destination_increase_by(3, destination); if (F_status_is_error(status)) break; destination->string[destination->used++] = f_fss_delimit_slash; - has_graph = F_false; - is_comment = F_false; - } - else { - status = private_fl_fss_destination_increase(destination); - if (F_status_is_error(status)) break; - } + destination->string[destination->used++] = content.string[start]; - destination->string[destination->used++] = f_fss_extended_list_open; + range->start = start + 1; - if (content.string[range->start] == f_fss_eol) { - destination->string[destination->used++] = f_fss_eol; - ends_on_eol = F_true; - } - else { - ends_on_eol = F_false; + status = private_fl_fss_basic_list_write_add_until_end(content, range, destination); + if (F_status_is_error(status)) break; + + continue; } + status = private_fl_fss_destination_increase(destination); + if (F_status_is_error(status)) break; + + destination->string[destination->used++] = content.string[start]; range->start = start + 1; continue; } @@ -1256,7 +1246,7 @@ extern "C" { return F_none; } -#endif // _di_fl_fss_extended_list_content_write_ +#endif // _di_fl_fss_extended_list_content_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_fss/c/fss_extended_list.h b/level_1/fl_fss/c/fss_extended_list.h index eadfe23..4df2116 100644 --- a/level_1/fl_fss/c/fss_extended_list.h +++ b/level_1/fl_fss/c/fss_extended_list.h @@ -123,7 +123,7 @@ extern "C" { #endif // _di_fl_fss_extended_list_content_read_ /** - * Write an fss-0003 object. + * Write an fss-0003 object from a given string. * * This will write the given string range as a valid object. * Anything within this range will be escaped as necessary. @@ -158,12 +158,12 @@ extern "C" { * * Errors (with error bit) from: f_utf_buffer_increment(). */ -#ifndef _di_fl_fss_extended_list_object_write_ - extern f_return_status fl_fss_extended_list_object_write(const f_string_static_t object, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); -#endif // _di_fl_fss_extended_list_object_write_ +#ifndef _di_fl_fss_extended_list_object_write_string_ + extern f_return_status fl_fss_extended_list_object_write_string(const f_string_static_t object, const uint8_t complete, f_string_range_t *range, f_string_dynamic_t *destination); +#endif // _di_fl_fss_extended_list_object_write_string_ /** - * Write an fss-0003 content. + * Write an fss-0003 content from a given string. * * This will write the given string range as a valid content. * Anything within this range will be escaped as necessary. @@ -181,7 +181,12 @@ extern "C" { * @param prepend * A string of whitespace to prepend at the start of each line. * This should only be whitespace, anything else could product invalid content. - * Set prepend.used to 0 to not use. + * Set the pointer address to 0 to disable. + * @param ignore + * An optional list of ranges within the string to ignore. + * These ranges are only checked/ignored if there is a valid nested object open or a valid nested object close. + * Any valid nested object open or valid nested object close inside an ingore range will not be escaped. + * Set the pointer address to 0 to disable. * @param range * The start/stop location within the content string to write as an content. * @param destination @@ -200,9 +205,9 @@ extern "C" { * * Errors (with error bit) from: f_utf_buffer_increment(). */ -#ifndef _di_fl_fss_extended_list_content_write_ - extern f_return_status fl_fss_extended_list_content_write(const f_string_static_t content, const uint8_t complete, const f_string_static_t prepend, f_string_range_t *range, f_string_dynamic_t *destination); -#endif // _di_fl_fss_extended_list_content_write_ +#ifndef _di_fl_fss_extended_list_content_write_string_ + extern f_return_status fl_fss_extended_list_content_write_string(const f_string_static_t content, const uint8_t complete, const f_string_static_t *prepend, const f_string_ranges_t *ignore, f_string_range_t *range, f_string_dynamic_t *destination); +#endif // _di_fl_fss_extended_list_content_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c index d4cd253..6d9a651 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -5,7 +5,7 @@ extern "C" { #endif -#if !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_extended_object_write_) +#if !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) f_return_status private_fl_fss_basic_write_object_trim(const f_fss_quote_t quote, const f_string_length_t used_start, f_string_dynamic_t *destination) { f_status_t status = F_none; f_string_range_t destination_range = f_macro_string_range_t_initialize(destination->used); @@ -99,9 +99,29 @@ extern "C" { return F_none; } -#endif // !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_extended_object_write_) +#endif // !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) -#if !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_extended_list_object_write_) +#if !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) + f_return_status private_fl_fss_basic_list_write_add_until_end(const f_string_static_t buffer, f_string_range_t *range, f_string_dynamic_t *destination) { + f_status_t status = F_none; + + for (; range->start <= range->stop && range->start < buffer.used; range->start++) { + + if (buffer.string[range->start] == f_fss_delimit_placeholder) continue; + if (buffer.string[range->start] == f_fss_eol) break; + + status = private_fl_fss_destination_increase(destination); + if (F_status_is_error(status)) break; + + destination->string[destination->used++] = buffer.string[range->start]; + } // for + + return status; + } +#endif // !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) + + +#if !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_) f_return_status private_fl_fss_basic_list_write_object_trim(const f_string_length_t used_start, f_string_dynamic_t *destination) { f_status_t status = F_none; f_string_range_t destination_range = f_macro_string_range_t_initialize(destination->used); @@ -168,7 +188,33 @@ extern "C" { return F_none; } -#endif // !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_extended_list_object_write_) +#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_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) + f_return_status private_fl_fss_basic_list_write_skip_whitespace(const f_string_static_t buffer, f_string_range_t *range) { + f_status_t status = F_none; + + while (range->start <= range->stop && range->start < buffer.used) { + + if (buffer.string[range->start] == f_fss_delimit_placeholder) { + range->start++; + continue; + } + + if (buffer.string[range->start] == f_fss_eol) break; + + 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); + if (F_status_is_error(status)) break; + } // while + + return status; + } +#endif // !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_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_string_lengths_t *delimits) { @@ -664,7 +710,7 @@ extern "C" { } #endif // !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) -#if !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_extended_object_write_) || !defined(_di_fl_fss_extended_content_write_) +#if !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) || !defined(_di_fl_fss_extended_content_write_string_) f_return_status private_fl_fss_basic_write(const bool object_as, const f_string_static_t object, const f_fss_quote_t quote, f_string_range_t *range, f_string_dynamic_t *destination) { f_status_t status = F_none; @@ -1001,9 +1047,9 @@ extern "C" { return F_none_eos; } -#endif // !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_extended_object_write_) || !defined(_di_fl_fss_extended_content_write_) +#endif // !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) || !defined(_di_fl_fss_extended_content_write_string_) -#if !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_basic_content_write_) || !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_object_write_) || !defined(_di_fl_fss_extended_content_write_) || !defined(_di_fl_fss_extended_list_object_write_) || !defined(_di_fl_fss_extended_list_content_write_) +#if !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_basic_content_write_string_) || !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) || !defined(_di_fl_fss_extended_content_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) f_return_status private_fl_fss_destination_increase(f_string_dynamic_t *destination) { f_status_t status = F_none; @@ -1022,9 +1068,9 @@ extern "C" { return status; } -#endif // !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_basic_content_write_) || !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_object_write_) || !defined(_di_fl_fss_extended_content_write_) || !defined(_di_fl_fss_extended_list_object_write_) || !defined(_di_fl_fss_extended_list_content_write_) +#endif // !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_basic_content_write_string_) || !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) || !defined(_di_fl_fss_extended_content_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) -#if !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_basic_content_write_) || !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_object_write_) || !defined(_di_fl_fss_extended_content_write_) || !defined(_di_fl_fss_extended_list_object_write_) || !defined(_di_fl_fss_extended_list_content_write_) +#if !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_basic_content_write_string_) || !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) || !defined(_di_fl_fss_extended_content_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) f_return_status private_fl_fss_destination_increase_by(const f_string_length_t amount, f_string_dynamic_t *destination) { f_status_t status = F_none; @@ -1038,27 +1084,25 @@ extern "C" { return status; } -#endif // !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_basic_content_write_) || !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_object_write_) || !defined(_di_fl_fss_extended_content_write_) || !defined(_di_fl_fss_extended_list_object_write_) || !defined(_di_fl_fss_extended_list_content_write_) +#endif // !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_basic_content_write_string_) || !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) || !defined(_di_fl_fss_extended_content_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) -#if !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_list_content_write_) - f_return_status private_fl_fss_destination_prepend(const f_string_static_t prepend, f_string_dynamic_t *destination) { +#if !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) + f_return_status private_fl_fss_destination_prepend(const f_string_static_t *prepend, f_string_dynamic_t *destination) { - if (!prepend.used) { + if (!prepend || !prepend->used) { return F_none; } - if (prepend.used) { - f_status_t status = private_fl_fss_destination_increase_by(prepend.used, destination); - if (F_status_is_error(status)) return status; - } + f_status_t status = private_fl_fss_destination_increase_by(prepend->used, destination); + if (F_status_is_error(status)) return status; - for (f_string_length_t i = 0; i < prepend.used; i++) { - destination->string[destination->used++] = prepend.string[i]; + for (f_string_length_t i = 0; i < prepend->used; i++) { + destination->string[destination->used++] = prepend->string[i]; } // for return F_none; } -#endif // !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_list_content_write_) +#endif // !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_fss/c/private-fss.h b/level_1/fl_fss/c/private-fss.h index 2c4973c..644efe7 100644 --- a/level_1/fl_fss/c/private-fss.h +++ b/level_1/fl_fss/c/private-fss.h @@ -31,12 +31,35 @@ extern "C" { * * Errors (with error bit) from: f_fss_is_space(). * - * @see fl_fss_basic_object_write() - * @see fl_fss_extended_object_write() + * @see fl_fss_basic_object_write_string() + * @see fl_fss_extended_object_write_string() */ -#if !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_extended_object_write_) +#if !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) extern f_return_status private_fl_fss_basic_write_object_trim(const f_fss_quote_t quote, const f_string_length_t used_start, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_extended_object_write_) +#endif // !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) + +/** + * Add all bytes to destination until stop point, buffer end, or EOL. + * + * @param buffer + * The buffer to seek through. + * @param range + * The start/stop location within the buffer string to process. + * @param destination + * The buffer where the bytes are written to. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: private_fl_fss_destination_increase(). + * + * @see fl_fss_basic_list_content_write_string() + * @see fl_fss_extended_list_content_write_string() + * @see private_fl_fss_destination_increase() + */ +#if !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) + extern f_return_status private_fl_fss_basic_list_write_add_until_end(const f_string_static_t buffer, f_string_range_t *range, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) /** * Trim a given object used by the basic list and extended list object write functions. @@ -51,12 +74,33 @@ extern "C" { * * Errors (with error bit) from: f_fss_is_space(). * - * @see fl_fss_basic_list_object_write() - * @see fl_fss_extended_list_object_write() + * @see fl_fss_basic_list_object_write_string() + * @see fl_fss_extended_list_object_write_string() */ -#if !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_extended_list_object_write_) +#if !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_) extern f_return_status private_fl_fss_basic_list_write_object_trim(const f_string_length_t used_start, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_extended_list_object_write_) +#endif // !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_) + +/** + * Skip past whitespace, seeking until stop point, buffer end, or EOL. + * + * @param buffer + * The buffer to seek through. + * @param range + * The start/stop location within the buffer string to process. + * + * @return + * F_none on success. + * + * Errors (with error bit) from: f_fss_is_space(). + * Errors (with error bit) from: f_utf_buffer_increment(). + * + * @see fl_fss_basic_list_content_write_string() + * @see fl_fss_extended_list_content_write_string() + */ +#if !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) + extern f_return_status private_fl_fss_basic_list_write_skip_whitespace(const f_string_static_t buffer, f_string_range_t *range) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) /** * Private implementation of fl_fss_basic_object_read(). @@ -117,7 +161,7 @@ extern "C" { #endif // !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) || !defined(_di_fl_fss_extended_content_read_) /** - * Private implementation of fl_fss_basic_object_write(). + * Private implementation of fl_fss_basic_object_write_string(). * * Intended to be shared to each of the different implementation variations. * @@ -154,13 +198,13 @@ extern "C" { * * Errors (with error bit) from: f_utf_buffer_increment(). * - * @see fl_fss_basic_object_write() - * @see fl_fss_extended_object_write() - * @see fl_fss_extended_content_write() + * @see fl_fss_basic_object_write_string() + * @see fl_fss_extended_object_write_string() + * @see fl_fss_extended_content_write_string() */ -#if !defined(fl_fss_basic_object_write) || !defined(fl_fss_extended_object_write) || !defined(_di_fl_fss_extended_content_write_) +#if !defined(fl_fss_basic_object_write_string) || !defined(fl_fss_extended_object_write_string) || !defined(_di_fl_fss_extended_content_write_string_) extern f_return_status private_fl_fss_basic_write(const bool object_as, const f_string_static_t object, const f_fss_quote_t quoted, f_string_range_t *range, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; -#endif // !defined(fl_fss_basic_object_write) || !defined(fl_fss_extended_object_write) || !defined(_di_fl_fss_extended_content_write_) +#endif // !defined(fl_fss_basic_object_write_string) || !defined(fl_fss_extended_object_write_string) || !defined(_di_fl_fss_extended_content_write_string_) /** * Increase the size of destination buffer, but only if necessary. @@ -173,18 +217,18 @@ extern "C" { * F_memory_reallocation (with error bit) on reallocation error. * F_string_too_large (with error bit) if appended string length is too large to store in the destination. * - * @see fl_fss_basic_object_write() - * @see fl_fss_basic_content_write() - * @see fl_fss_basic_list_object_write() - * @see fl_fss_basic_list_content_write() - * @see fl_fss_extended_object_write() - * @see fl_fss_extended_content_write() - * @see fl_fss_extended_list_object_write() - * @see fl_fss_extended_list_content_write() + * @see fl_fss_basic_object_write_string() + * @see fl_fss_basic_content_write_string() + * @see fl_fss_basic_list_object_write_string() + * @see fl_fss_basic_list_content_write_string() + * @see fl_fss_extended_object_write_string() + * @see fl_fss_extended_content_write_string() + * @see fl_fss_extended_list_object_write_string() + * @see fl_fss_extended_list_content_write_string() */ -#if !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_basic_content_write_) || !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_object_write_) || !defined(_di_fl_fss_extended_content_write_) || !defined(_di_fl_fss_extended_list_object_write_) || !defined(_di_fl_fss_extended_list_content_write_) +#if !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_basic_content_write_string_) || !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) || !defined(_di_fl_fss_extended_content_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) extern f_return_status private_fl_fss_destination_increase(f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_basic_content_write_) || !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_object_write_) || !defined(_di_fl_fss_extended_content_write_) || !defined(_di_fl_fss_extended_list_object_write_) || !defined(_di_fl_fss_extended_list_content_write_) +#endif // !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_basic_content_write_string_) || !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) || !defined(_di_fl_fss_extended_content_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) /** * Increase the size of destination buffer by the given amount, but only if necessary. @@ -199,25 +243,25 @@ extern "C" { * F_memory_reallocation (with error bit) on reallocation error. * F_string_too_large (with error bit) if appended string length is too large to store in the destination. * - * @see fl_fss_basic_object_write() - * @see fl_fss_basic_content_write() - * @see fl_fss_basic_list_object_write() - * @see fl_fss_basic_list_content_write() - * @see fl_fss_extended_object_write() - * @see fl_fss_extended_content_write() - * @see fl_fss_extended_list_object_write() - * @see fl_fss_extended_list_content_write() + * @see fl_fss_basic_object_write_string() + * @see fl_fss_basic_content_write_string() + * @see fl_fss_basic_list_object_write_string() + * @see fl_fss_basic_list_content_write_string() + * @see fl_fss_extended_object_write_string() + * @see fl_fss_extended_content_write_string() + * @see fl_fss_extended_list_object_write_string() + * @see fl_fss_extended_list_content_write_string() */ -#if !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_basic_content_write_) || !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_object_write_) || !defined(_di_fl_fss_extended_content_write_) || !defined(_di_fl_fss_extended_list_object_write_) || !defined(_di_fl_fss_extended_list_content_write_) +#if !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_basic_content_write_string_) || !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) || !defined(_di_fl_fss_extended_content_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) f_return_status private_fl_fss_destination_increase_by(const f_string_length_t amount, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_basic_content_write_) || !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_object_write_) || !defined(_di_fl_fss_extended_content_write_) || !defined(_di_fl_fss_extended_list_object_write_) || !defined(_di_fl_fss_extended_list_content_write_) +#endif // !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_basic_content_write_string_) || !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_object_write_string_) || !defined(_di_fl_fss_extended_content_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) /** * Prepend the given string onto the destination buffer, allocating space as necessary. * * @param prepend * A string to prepend at the start of each line, such as spaces. - * Set prepend.used to 0 to not use. + * Set the pointer address to 0 to disable. * @param destination * The destination buffer to prepend to. * @@ -226,12 +270,12 @@ extern "C" { * F_memory_reallocation (with error bit) on reallocation error. * F_string_too_large (with error bit) if appended string length is too large to store in the destination. * - * @see fl_fss_basic_list_content_write() - * @see fl_fss_extended_list_content_write() + * @see fl_fss_basic_list_content_write_string() + * @see fl_fss_extended_list_content_write_string() */ -#if !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_list_content_write_) - f_return_status private_fl_fss_destination_prepend(const f_string_static_t prepend, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; -#endif // !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_list_content_write_) +#if !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) + f_return_status private_fl_fss_destination_prepend(const f_string_static_t *prepend, f_string_dynamic_t *destination) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) #ifdef __cplusplus } // extern "C" diff --git a/level_2/fll_fss/c/fss_basic.c b/level_2/fll_fss/c/fss_basic.c index 9ba467d..c70a9ee 100644 --- a/level_2/fll_fss/c/fss_basic.c +++ b/level_2/fll_fss/c/fss_basic.c @@ -154,8 +154,8 @@ extern "C" { } #endif // _di_fll_fss_basic_read_ -#ifndef _di_fll_fss_basic_write_ - f_return_status fll_fss_basic_write(const f_string_static_t object, const f_string_static_t content, const f_fss_quote_t quote, f_string_dynamic_t *destination) { +#ifndef _di_fll_fss_basic_write_string_ + f_return_status fll_fss_basic_write_string(const f_string_static_t object, const f_string_static_t content, const f_fss_quote_t quote, f_string_dynamic_t *destination) { #ifndef _di_level_2_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -163,7 +163,7 @@ extern "C" { f_status_t status = 0; f_string_range_t range = f_macro_string_range_t_initialize(object.used); - status = fl_fss_basic_object_write(object, quote, f_fss_complete_full, &range, destination); + status = fl_fss_basic_object_write_string(object, quote, f_fss_complete_full, &range, destination); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { return status; @@ -174,7 +174,7 @@ extern "C" { range.start = 0; range.stop = content.used - 1; - status = fl_fss_basic_content_write(content, f_fss_complete_full, &range, destination); + status = fl_fss_basic_content_write_string(content, f_fss_complete_full, &range, destination); if (F_status_is_error(status)) return status; } else { @@ -189,7 +189,7 @@ extern "C" { return status; } -#endif // _di_fll_fss_basic_write_ +#endif // _di_fll_fss_basic_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_2/fll_fss/c/fss_basic.h b/level_2/fll_fss/c/fss_basic.h index f7d77a1..22d764d 100644 --- a/level_2/fll_fss/c/fss_basic.h +++ b/level_2/fll_fss/c/fss_basic.h @@ -42,7 +42,7 @@ extern "C" { * This will be populated with all valid contents found. * @param quoted_objects * An array of all objects discovered with quotes and the quote discovered. - * Set pointer address to 0 to disable. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -88,13 +88,13 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors (with error bit) from: fl_fss_basic_content_write(). - * Errors (with error bit) from: fl_fss_basic_object_write(). + * Errors (with error bit) from: fl_fss_basic_content_write_string(). + * Errors (with error bit) from: fl_fss_basic_object_write_string(). * Errors (with error bit) from: fl_string_dynamic_size_increase(). */ -#ifndef _di_fll_fss_basic_write_ - extern f_return_status fll_fss_basic_write(const f_string_static_t object, const f_string_static_t content, const f_fss_quote_t quote, f_string_dynamic_t *destination); -#endif // _di_fll_fss_basic_write_ +#ifndef _di_fll_fss_basic_write_string_ + extern f_return_status fll_fss_basic_write_string(const f_string_static_t object, const f_string_static_t content, const f_fss_quote_t quote, f_string_dynamic_t *destination); +#endif // _di_fll_fss_basic_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_2/fll_fss/c/fss_basic_list.c b/level_2/fll_fss/c/fss_basic_list.c index fbce3c8..af1a636 100644 --- a/level_2/fll_fss/c/fss_basic_list.c +++ b/level_2/fll_fss/c/fss_basic_list.c @@ -130,8 +130,8 @@ extern "C" { } #endif // _di_fll_fss_basic_list_read_ -#ifndef _di_fll_fss_basic_list_write_ - f_return_status fll_fss_basic_list_write(const f_string_static_t object, const f_string_statics_t contents, const f_string_static_t contents_prepend, f_string_dynamic_t *destination) { +#ifndef _di_fll_fss_basic_list_write_string_ + 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) { #ifndef _di_level_2_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -139,24 +139,28 @@ extern "C" { f_status_t status = 0; f_string_range_t range = f_macro_string_range_t_initialize(object.used); - status = fl_fss_basic_list_object_write(object, f_fss_complete_full, &range, destination); + status = fl_fss_basic_list_object_write_string(object, f_fss_complete_full, &range, destination); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { return status; } if (status == F_none || status == F_none_stop || status == F_none_eos || status == F_none_eol) { - if (contents.used && contents.array[0].used) { + if (content.used) { range.start = 0; - range.stop = contents.array[0].used - 1; - - status = fl_fss_basic_list_content_write(contents.array[0], f_fss_complete_full, contents_prepend, &range, destination); + range.stop = content.used - 1; + } + else { + range.start = 1; + range.stop = 0; } + + status = fl_fss_basic_list_content_write_string(content, f_fss_complete_full, content_prepend, &range, destination); } return status; } -#endif // _di_fll_fss_basic_list_write_ +#endif // _di_fll_fss_basic_list_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_2/fll_fss/c/fss_basic_list.h b/level_2/fll_fss/c/fss_basic_list.h index 9e44850..0f35fa7 100644 --- a/level_2/fll_fss/c/fss_basic_list.h +++ b/level_2/fll_fss/c/fss_basic_list.h @@ -65,11 +65,11 @@ extern "C" { * * @param object * A string representing the object. - * @param contents - * An array of strings representing multiple content to write. - * @param contents_prepend - * A string to prepend at the start of each line in contents, such as spaces. - * Set prepend.used to 0 to not use. + * @param content + * A string representing the content. + * @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 * The buffer to write to. * @@ -84,13 +84,13 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors (with error bit) from: fl_fss_basic_list_content_write(). - * Errors (with error bit) from: fl_fss_basic_list_object_write(). + * Errors (with error bit) from: fl_fss_basic_list_content_write_string(). + * Errors (with error bit) from: fl_fss_basic_list_object_write_string(). * Errors (with error bit) from: fl_string_dynamic_size_increase(). */ -#ifndef _di_fll_fss_basic_list_write_ - extern f_return_status fll_fss_basic_list_write(const f_string_static_t object, const f_string_statics_t contents, const f_string_static_t contents_prepend, f_string_dynamic_t *buffer); -#endif // _di_fll_fss_basic_list_write_ +#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); +#endif // _di_fll_fss_basic_list_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_2/fll_fss/c/fss_extended.c b/level_2/fll_fss/c/fss_extended.c index 98765e4..f8fa1ec 100644 --- a/level_2/fll_fss/c/fss_extended.c +++ b/level_2/fll_fss/c/fss_extended.c @@ -190,8 +190,8 @@ extern "C" { } #endif // _di_fll_fss_extended_read_ -#ifndef _di_fll_fss_extended_write_ - f_return_status fll_fss_extended_write(const f_string_static_t object, const f_string_statics_t contents, const f_fss_quote_t quote, f_string_dynamic_t *destination) { +#ifndef _di_fll_fss_extended_write_string_ + f_return_status fll_fss_extended_write_string(const f_string_static_t object, const f_string_statics_t contents, const f_fss_quote_t quote, f_string_dynamic_t *destination) { #ifndef _di_level_2_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -199,7 +199,7 @@ extern "C" { f_status_t status = 0; f_string_range_t range = f_macro_string_range_t_initialize(object.used); - status = fl_fss_extended_object_write(object, quote, f_fss_complete_full, &range, destination); + status = fl_fss_extended_object_write_string(object, quote, f_fss_complete_full, &range, destination); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { return status; @@ -223,7 +223,7 @@ extern "C" { range.stop = 0; } - status = fl_fss_extended_content_write(contents.array[i], quote, complete, &range, destination); + status = fl_fss_extended_content_write_string(contents.array[i], quote, complete, &range, destination); if (F_status_is_error(status)) { return status; @@ -233,7 +233,7 @@ extern "C" { return status; } -#endif // _di_fll_fss_extended_write_ +#endif // _di_fll_fss_extended_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_2/fll_fss/c/fss_extended.h b/level_2/fll_fss/c/fss_extended.h index 0f499e3..9392d2f 100644 --- a/level_2/fll_fss/c/fss_extended.h +++ b/level_2/fll_fss/c/fss_extended.h @@ -40,10 +40,10 @@ extern "C" { * This will be populated with all valid contents found. * @param quoted_objects * An array of all objects discovered with quotes and the quote discovered. - * Set pointer address to 0 to disable. + * Set the pointer address to 0 to disable. * @param quoted_contents * An array of all contents discovered with quotes and the quote discovered. - * Set pointer address to 0 to disable. + * Set the pointer address to 0 to disable. * * @return * F_none on success. @@ -89,13 +89,13 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors (with error bit) from: fl_fss_extended_content_write(). - * Errors (with error bit) from: fl_fss_extended_object_write(). + * Errors (with error bit) from: fl_fss_extended_content_write_string(). + * Errors (with error bit) from: fl_fss_extended_object_write_string(). * Errors (with error bit) from: fl_string_dynamic_size_increase(). */ -#ifndef _di_fll_fss_extended_write_ - extern f_return_status fll_fss_extended_write(const f_string_static_t object, const f_string_statics_t contents, const f_fss_quote_t quote, f_string_dynamic_t *destination); -#endif // _di_fll_fss_extended_write_ +#ifndef _di_fll_fss_extended_write_string_ + extern f_return_status fll_fss_extended_write_string(const f_string_static_t object, const f_string_statics_t contents, const f_fss_quote_t quote, f_string_dynamic_t *destination); +#endif // _di_fll_fss_extended_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_2/fll_fss/c/fss_extended_list.c b/level_2/fll_fss/c/fss_extended_list.c index 8c25ea6..d5201f9 100644 --- a/level_2/fll_fss/c/fss_extended_list.c +++ b/level_2/fll_fss/c/fss_extended_list.c @@ -111,53 +111,37 @@ extern "C" { } #endif // _di_fll_fss_extended_list_read_ -/* -#ifndef _di_fll_fss_extended_list_write_ - f_return_status fll_fss_extended_list_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer) { - #ifndef _di_level_3_parameter_checking_ - if (!buffer) return F_status_set_error(F_parameter); - if (contents.used > contents.size) return F_status_set_error(F_parameter); - #endif // _di_level_3_parameter_checking_ +#ifndef _di_fll_fss_extended_list_write_string_ + f_return_status fll_fss_extended_list_write_string(const f_string_static_t object, const f_string_static_t content, const f_string_static_t *content_prepend, const f_string_ranges_t *ignore, f_string_dynamic_t *destination) { + #ifndef _di_level_2_parameter_checking_ + if (!destination) return F_status_set_error(F_parameter); + #endif // _di_level_2_parameter_checking_ f_status_t status = 0; - f_array_length_t current = 0; - f_string_range_t range = f_string_range_t_initialize; + f_string_range_t range = f_macro_string_range_t_initialize(object.used); - range.start = 0; - range.stop = object.used - 1; - - status = fl_fss_extended_list_object_write(object, &range, buffer); + status = fl_fss_extended_list_object_write_string(object, f_fss_complete_full, &range, destination); if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { return status; } if (status == F_none || status == F_none_stop || status == F_none_eos || status == F_none_eol) { - if (contents.used > 0) { + if (content.used) { range.start = 0; - range.stop = contents.array[0].used - 1; - - status = fl_fss_extended_list_content_write(contents.array[0], &range, buffer); - - if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) { - return status; - } + range.stop = content.used - 1; } else { - if (buffer->used == buffer->size) { - status = fl_string_dynamic_size_increase(f_fss_default_allocation_step, buffer); - if (F_status_is_error(status)) return status; - } - - buffer->string[buffer->used] = f_string_eol[0]; - buffer->used++; + range.start = 1; + range.stop = 0; } + + status = fl_fss_extended_list_content_write_string(content, f_fss_complete_full, content_prepend, ignore, &range, destination); } - return F_none; + return status; } -#endif // _di_fll_fss_extended_list_write_ -*/ +#endif // _di_fll_fss_extended_list_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_2/fll_fss/c/fss_extended_list.h b/level_2/fll_fss/c/fss_extended_list.h index 0a14aa7..f4b3576 100644 --- a/level_2/fll_fss/c/fss_extended_list.h +++ b/level_2/fll_fss/c/fss_extended_list.h @@ -69,10 +69,18 @@ extern "C" { * * @param object * A string representing the object. - * @param contents - * An array of strings representing multiple content to write. - * @param buffer - * The buffer to write to. + * @param content + * A string representing the content. + * @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 ignore + * An optional list of ranges within the string to ignore. + * These ranges are only checked/ignored if there is a valid nested object open or a valid nested object close. + * Any valid nested object open or valid nested object close inside an ingore range will not be escaped. + * Set the pointer address to 0 to disable. + * @param destination + * The buffer where the content is written to. * * @return * F_none on success. @@ -85,13 +93,13 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors (with error bit) from: fl_fss_extended_list_content_write(). - * Errors (with error bit) from: fl_fss_extended_list_object_write(). + * Errors (with error bit) from: fl_fss_extended_list_content_write_string(). + * Errors (with error bit) from: fl_fss_extended_list_object_write_string(). * Errors (with error bit) from: fl_string_dynamic_size_increase(). */ -#ifndef _di_fll_fss_extended_list_write_ - //extern f_return_status fll_fss_extended_list_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer); -#endif // _di_fll_fss_extended_list_write_ +#ifndef _di_fll_fss_extended_list_write_string_ + extern f_return_status fll_fss_extended_list_write_string(const f_string_static_t object, const f_string_static_t content, const f_string_static_t *content_prepend, const f_string_ranges_t *ignore, f_string_dynamic_t *destination); +#endif // _di_fll_fss_extended_list_write_string_ #ifdef __cplusplus } // extern "C" diff --git a/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c b/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c index 089c108..71b8bc9 100644 --- a/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c @@ -78,7 +78,7 @@ extern "C" { } } - status = fl_fss_basic_list_object_write(*object, complete, &range, buffer); + status = fl_fss_basic_list_object_write_string(*object, complete, &range, buffer); if (F_status_set_fine(status) == F_none_eol) { fss_basic_list_write_error_parameter_unsupported_eol_print(data); @@ -87,7 +87,7 @@ extern "C" { } if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_fss_basic_list_object_write", F_true); + fll_error_print(data.error, F_status_set_fine(status), "fl_fss_basic_list_object_write_string", F_true); return status; } } @@ -96,10 +96,10 @@ extern "C" { range.start = 0; range.stop = content->used - 1; - status = fl_fss_basic_list_content_write(*content, object ? f_fss_complete_full : f_fss_complete_none, data.prepend, &range, buffer); + status = fl_fss_basic_list_content_write_string(*content, object ? f_fss_complete_full : f_fss_complete_none, &data.prepend, &range, buffer); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_fss_basic_list_content_write", F_true); + fll_error_print(data.error, F_status_set_fine(status), "fl_fss_basic_list_content_write_string", F_true); return status; } } diff --git a/level_3/fss_basic_write/c/private-fss_basic_write.c b/level_3/fss_basic_write/c/private-fss_basic_write.c index 526dd2d..ba33799 100644 --- a/level_3/fss_basic_write/c/private-fss_basic_write.c +++ b/level_3/fss_basic_write/c/private-fss_basic_write.c @@ -78,7 +78,7 @@ extern "C" { } } - status = fl_fss_basic_object_write(*object, quote, complete, &range, buffer); + status = fl_fss_basic_object_write_string(*object, quote, complete, &range, buffer); if (F_status_set_fine(status) == F_none_eol) { fss_basic_write_error_parameter_unsupported_eol_print(data); @@ -87,7 +87,7 @@ extern "C" { } if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_fss_basic_object_write", F_true); + fll_error_print(data.error, F_status_set_fine(status), "fl_fss_basic_object_write_string", F_true); return status; } } @@ -102,7 +102,7 @@ extern "C" { range.stop = 0; } - status = fl_fss_basic_content_write(*content, object ? f_fss_complete_full : f_fss_complete_none, &range, buffer); + status = fl_fss_basic_content_write_string(*content, object ? f_fss_complete_full : f_fss_complete_none, &range, buffer); if (F_status_set_fine(status) == F_none_eol) { fss_basic_write_error_parameter_unsupported_eol_print(data); @@ -111,7 +111,7 @@ extern "C" { } if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_fss_basic_content_write", F_true); + fll_error_print(data.error, F_status_set_fine(status), "fl_fss_basic_content_write_string", F_true); return status; } } diff --git a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c index cf7776a..c6bc35b 100644 --- a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c @@ -78,7 +78,7 @@ extern "C" { } } - status = fl_fss_extended_list_object_write(*object, complete, &range, buffer); + status = fl_fss_extended_list_object_write_string(*object, complete, &range, buffer); if (F_status_set_fine(status) == F_none_eol) { fss_extended_list_write_error_parameter_unsupported_eol_print(data); @@ -87,7 +87,7 @@ extern "C" { } if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_fss_extended_list_object_write", F_true); + fll_error_print(data.error, F_status_set_fine(status), "fl_fss_extended_list_object_write_string", F_true); return status; } } @@ -96,10 +96,11 @@ extern "C" { range.start = 0; range.stop = content->used - 1; - status = fl_fss_extended_list_content_write(*content, object ? f_fss_complete_full : f_fss_complete_none, data.prepend, &range, buffer); + // @todo: add const f_string_ranges_t *ignore parameter. + status = fl_fss_extended_list_content_write_string(*content, object ? f_fss_complete_full : f_fss_complete_none, &data.prepend, 0, &range, buffer); if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_fss_extended_list_content_write", F_true); + fll_error_print(data.error, F_status_set_fine(status), "fl_fss_extended_list_content_write_string", F_true); return status; } } diff --git a/level_3/fss_extended_write/c/private-fss_extended_write.c b/level_3/fss_extended_write/c/private-fss_extended_write.c index de2ad59..b95a86b 100644 --- a/level_3/fss_extended_write/c/private-fss_extended_write.c +++ b/level_3/fss_extended_write/c/private-fss_extended_write.c @@ -78,7 +78,7 @@ extern "C" { } } - status = fl_fss_extended_object_write(*object, quote, complete, &range, buffer); + status = fl_fss_extended_object_write_string(*object, quote, complete, &range, buffer); if (F_status_set_fine(status) == F_none_eol) { fss_extended_write_error_parameter_unsupported_eol_print(data); @@ -87,7 +87,7 @@ extern "C" { } if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_fss_extended_object_write", F_true); + fll_error_print(data.error, F_status_set_fine(status), "fl_fss_extended_object_write_string", F_true); return F_status_set_error(status); } } @@ -105,7 +105,7 @@ extern "C" { range.stop = 0; } - status = fl_fss_extended_content_write(contents->array[i], quote, i + 1 < contents->used ? f_fss_complete_next : f_fss_complete_end, &range, buffer); + status = fl_fss_extended_content_write_string(contents->array[i], quote, i + 1 < contents->used ? f_fss_complete_next : f_fss_complete_end, &range, buffer); if (F_status_set_fine(status) == F_none_eol) { fss_extended_write_error_parameter_unsupported_eol_print(data); @@ -114,7 +114,7 @@ extern "C" { } if (F_status_is_error(status)) { - fll_error_print(data.error, F_status_set_fine(status), "fl_fss_extended_content_write", F_true); + fll_error_print(data.error, F_status_set_fine(status), "fl_fss_extended_content_write_string", F_true); return F_status_set_error(status); } } // for