From a7a72699cdc6d096e8866227906bb5e1ea6bb09b Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 5 Dec 2022 21:59:24 -0600 Subject: [PATCH] Update: Add support for backtick quoting for IKI. Comply with the recent addition to the IKI specification that designates backticks as a quote alternative to single and double quotes. Fix several inconsistencies observed, such as "quoted" vs "quote". The code is inconsistently using a type code and a literal character for passing the desired quote. This is probably a long lost incomplete refactor. Change all of the FSS code to accept the character as a uint8_t. Get rid of the f_fss_quote_t and related, replacing them with uint8_t. Get rid of the f_fss_delimit_* macros. These are redundant and it is simpler just to use the f_fss_* variants. Rename F_fss_delimit_placeholder_s to F_string_placeholder_s (and similar). The flags for single and double quotes are not needed when the charaacter is being explicitly set. --- level_0/f_fss/c/fss.c | 8 +- level_0/f_fss/c/fss/common.h | 98 +++++++------- level_0/f_fss/c/fss/named.h | 6 +- level_0/f_fss/c/fss/quote.h | 77 +---------- level_0/f_fss/c/fss/set.h | 10 +- level_0/f_fss/c/private-fss.c | 16 +-- level_0/f_fss/c/private-fss.h | 32 ++--- level_1/fl_fss/c/fss/basic.c | 16 +-- level_1/fl_fss/c/fss/basic.h | 8 +- level_1/fl_fss/c/fss/basic_list.c | 48 +++---- level_1/fl_fss/c/fss/embedded_list.c | 52 +++---- level_1/fl_fss/c/fss/extended.c | 45 ++++--- level_1/fl_fss/c/fss/extended.h | 20 +-- level_1/fl_fss/c/fss/extended_list.c | 42 +++--- level_1/fl_fss/c/private-fss.c | 150 ++++++++++----------- level_1/fl_fss/c/private-fss.h | 20 +-- level_2/fll_fss/c/fss/basic.c | 6 +- level_2/fll_fss/c/fss/basic.h | 6 +- level_2/fll_fss/c/fss/extended.c | 8 +- level_2/fll_fss/c/fss/extended.h | 6 +- level_3/fake/c/private-make-operate.c | 14 +- level_3/fake/c/private-make-operate.h | 24 ++-- level_3/firewall/c/private-firewall.c | 2 +- level_3/fss_basic_list_read/c/private-common.h | 4 +- .../fss_basic_list_write/c/fss_basic_list_write.c | 14 +- level_3/fss_basic_list_write/c/private-write.c | 4 +- level_3/fss_basic_list_write/c/private-write.h | 4 +- level_3/fss_basic_read/c/private-common.c | 2 +- level_3/fss_basic_read/c/private-common.h | 4 +- level_3/fss_basic_read/c/private-print.c | 36 ++++- level_3/fss_basic_write/c/fss_basic_write.c | 6 +- level_3/fss_basic_write/c/private-write.c | 4 +- level_3/fss_basic_write/c/private-write.h | 4 +- level_3/fss_embedded_list_read/c/private-read.c | 2 +- .../c/fss_embedded_list_write.c | 6 +- level_3/fss_embedded_list_write/c/private-write.c | 4 +- level_3/fss_embedded_list_write/c/private-write.h | 4 +- level_3/fss_extended_list_read/c/private-common.h | 4 +- level_3/fss_extended_list_read/c/private-read.c | 2 +- .../c/fss_extended_list_write.c | 6 +- level_3/fss_extended_list_write/c/private-write.c | 4 +- level_3/fss_extended_list_write/c/private-write.h | 4 +- level_3/fss_extended_read/c/private-common.c | 4 +- level_3/fss_extended_read/c/private-common.h | 8 +- level_3/fss_extended_read/c/private-print.c | 71 ++++++++-- level_3/fss_extended_read/c/private-read.c | 36 ++++- level_3/fss_extended_write/c/fss_extended_write.c | 6 +- level_3/fss_extended_write/c/private-write.c | 4 +- level_3/fss_extended_write/c/private-write.h | 4 +- level_3/fss_payload_read/c/private-common.c | 4 +- level_3/fss_payload_read/c/private-common.h | 12 +- level_3/fss_payload_read/c/private-print.c | 72 ++++++++-- level_3/fss_payload_read/c/private-read.c | 36 ++++- level_3/fss_write/c/basic/fss_write.c | 8 +- level_3/fss_write/c/extended/fss_write.c | 16 ++- level_3/fss_write/c/main/common.c | 27 ++++ level_3/fss_write/c/main/common.h | 116 ++++++++-------- 57 files changed, 710 insertions(+), 546 deletions(-) diff --git a/level_0/f_fss/c/fss.c b/level_0/f_fss/c/fss.c index 15f0ac5..6ea1378 100644 --- a/level_0/f_fss/c/fss.c +++ b/level_0/f_fss/c/fss.c @@ -16,7 +16,7 @@ extern "C" { for (f_array_length_t i = 0; i < delimits.used; ++i) { if (delimits.array[i] < buffer->used) { - buffer->string[delimits.array[i]] = f_fss_delimit_placeholder_s.string[0]; + buffer->string[delimits.array[i]] = f_fss_placeholder_s.string[0]; } } // for @@ -35,7 +35,7 @@ extern "C" { for (f_array_length_t i = 0; i < delimits.used; ++i) { if (delimits.array[i] < buffer->used && delimits.array[i] >= range.start && delimits.array[i] <= range.stop) { - buffer->string[delimits.array[i]] = f_fss_delimit_placeholder_s.string[0]; + buffer->string[delimits.array[i]] = f_fss_placeholder_s.string[0]; } } // for @@ -226,7 +226,7 @@ extern "C" { if (range->start >= buffer.used) return F_none_eos; if (range->start > range->stop) return F_none_stop; - if (buffer.string[range->start] != f_fss_delimit_placeholder_s.string[0]) break; + if (buffer.string[range->start] != f_fss_placeholder_s.string[0]) break; } // for return F_none; @@ -266,7 +266,7 @@ extern "C" { return F_none_eol; } - if (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0]) { + if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) { ++range->start; continue; diff --git a/level_0/f_fss/c/fss/common.h b/level_0/f_fss/c/fss/common.h index 2183ef1..e6c9a92 100644 --- a/level_0/f_fss/c/fss/common.h +++ b/level_0/f_fss/c/fss/common.h @@ -20,44 +20,47 @@ extern "C" { * FSS-specific types. */ #ifndef _di_f_fss_types_t_ - #define F_fss_brace_close_s F_string_ascii_brace_close_s - #define F_fss_brace_open_s F_string_ascii_brace_open_s - #define F_fss_colon_s F_string_ascii_colon_s - #define F_fss_minus_s F_string_ascii_minus_s - #define F_fss_f_s F_string_ascii_f_s - #define F_fss_pound_s F_string_ascii_pound_s - #define F_fss_quote_double_s F_string_ascii_quote_double_s - #define F_fss_quote_single_s F_string_ascii_quote_single_s - #define F_fss_s_s F_string_ascii_s_s - #define F_fss_slash_s F_string_ascii_slash_backward_s - #define F_fss_space_s F_string_ascii_space_s - #define F_fss_underscore_s F_string_ascii_underscore_s - - #define F_fss_brace_close_s_length F_string_ascii_brace_close_s_length - #define F_fss_brace_open_s_length F_string_ascii_brace_open_s_length - #define F_fss_colon_s_length F_string_ascii_colon_s_length - #define F_fss_minus_s_length F_string_ascii_minus_s_length - #define F_fss_f_s_length F_string_ascii_f_s_length - #define F_fss_pound_s_length F_string_ascii_pound_s_length - #define F_fss_quote_double_s_length F_string_ascii_quote_double_s_length - #define F_fss_quote_single_s_length F_string_ascii_quote_single_s_length - #define F_fss_s_s_length F_string_ascii_s_s_length - #define F_fss_slash_s_length F_string_ascii_slash_backward_s_length - #define F_fss_space_s_length F_string_ascii_space_s_length - #define F_fss_underscore_s_length F_string_ascii_underscore_s_length - - #define f_fss_brace_close_s f_string_ascii_brace_close_s - #define f_fss_brace_open_s f_string_ascii_brace_open_s - #define f_fss_colon_s f_string_ascii_colon_s - #define f_fss_minus_s f_string_ascii_minus_s - #define f_fss_f_s f_string_ascii_f_s - #define f_fss_pound_s f_string_ascii_pound_s - #define f_fss_quote_double_s f_string_ascii_quote_double_s - #define f_fss_quote_single_s f_string_ascii_quote_single_s - #define f_fss_s_s f_string_ascii_s_s - #define f_fss_slash_s f_string_ascii_slash_backward_s - #define f_fss_space_s f_string_ascii_space_s - #define f_fss_underscore_s f_string_ascii_underscore_s + #define F_fss_brace_close_s F_string_ascii_brace_close_s + #define F_fss_brace_open_s F_string_ascii_brace_open_s + #define F_fss_colon_s F_string_ascii_colon_s + #define F_fss_minus_s F_string_ascii_minus_s + #define F_fss_f_s F_string_ascii_f_s + #define F_fss_pound_s F_string_ascii_pound_s + #define F_fss_quote_backtick_s F_string_ascii_grave_s + #define F_fss_quote_double_s F_string_ascii_quote_double_s + #define F_fss_quote_single_s F_string_ascii_quote_single_s + #define F_fss_s_s F_string_ascii_s_s + #define F_fss_slash_s F_string_ascii_slash_backward_s + #define F_fss_space_s F_string_ascii_space_s + #define F_fss_underscore_s F_string_ascii_underscore_s + + #define F_fss_brace_close_s_length F_string_ascii_brace_close_s_length + #define F_fss_brace_open_s_length F_string_ascii_brace_open_s_length + #define F_fss_colon_s_length F_string_ascii_colon_s_length + #define F_fss_minus_s_length F_string_ascii_minus_s_length + #define F_fss_f_s_length F_string_ascii_f_s_length + #define F_fss_pound_s_length F_string_ascii_pound_s_length + #define F_fss_quote_backtick_s_length F_string_ascii_grave_s_length + #define F_fss_quote_double_s_length F_string_ascii_quote_double_s_length + #define F_fss_quote_single_s_length F_string_ascii_quote_single_s_length + #define F_fss_s_s_length F_string_ascii_s_s_length + #define F_fss_slash_s_length F_string_ascii_slash_backward_s_length + #define F_fss_space_s_length F_string_ascii_space_s_length + #define F_fss_underscore_s_length F_string_ascii_underscore_s_length + + #define f_fss_brace_close_s f_string_ascii_brace_close_s + #define f_fss_brace_open_s f_string_ascii_brace_open_s + #define f_fss_colon_s f_string_ascii_colon_s + #define f_fss_minus_s f_string_ascii_minus_s + #define f_fss_f_s f_string_ascii_f_s + #define f_fss_pound_s f_string_ascii_pound_s + #define f_fss_quote_backtick_s f_string_ascii_grave_s + #define f_fss_quote_double_s f_string_ascii_quote_double_s + #define f_fss_quote_single_s f_string_ascii_quote_single_s + #define f_fss_s_s f_string_ascii_s_s + #define f_fss_slash_s f_string_ascii_slash_backward_s + #define f_fss_space_s f_string_ascii_space_s + #define f_fss_underscore_s f_string_ascii_underscore_s #define f_fss_comment_s f_fss_pound_s #define f_fss_eol_s f_string_eol_s @@ -97,20 +100,11 @@ extern "C" { * FSS-specific delimiters. */ #ifndef _di_f_fss_delimiters_ - #define F_fss_delimit_placeholder_s F_string_placeholder_s - #define F_fss_delimit_quote_single_s F_fss_quote_single_s - #define F_fss_delimit_quote_double_s F_fss_quote_double_s - #define F_fss_delimit_slash_s F_fss_slash_s - - #define F_fss_delimit_placeholder_s_length F_string_placeholder_s_length - #define F_fss_delimit_quote_single_s_length F_fss_quote_single_s_length - #define F_fss_delimit_quote_double_s_length F_fss_quote_double_s_length - #define F_fss_delimit_slash_s_length F_fss_slash_s_length - - #define f_fss_delimit_placeholder_s f_string_placeholder_s - #define f_fss_delimit_quote_single_s f_fss_quote_single_s - #define f_fss_delimit_quote_double_s f_fss_quote_double_s - #define f_fss_delimit_slash_s f_fss_slash_s + #define F_fss_placeholder_s F_string_placeholder_s + + #define F_fss_placeholder_s_length F_string_placeholder_s_length + + #define f_fss_placeholder_s f_string_placeholder_s #endif //_di_f_fss_delimiters_ /** diff --git a/level_0/f_fss/c/fss/named.h b/level_0/f_fss/c/fss/named.h index f3f4238..cf4c703 100644 --- a/level_0/f_fss/c/fss/named.h +++ b/level_0/f_fss/c/fss/named.h @@ -33,10 +33,10 @@ extern "C" { f_fss_objects_t objects; f_fss_contents_t contents; - f_fss_quotess_t quotess; + f_uint8ss_t quotess; } f_fss_named_t; - #define f_fss_named_t_initialize { f_fss_object_t_initialize, f_fss_objects_t_initialize, f_fss_contents_t_initialize, f_fss_quotess_t_initialize } + #define f_fss_named_t_initialize { f_fss_object_t_initialize, f_fss_objects_t_initialize, f_fss_contents_t_initialize, f_uint8ss_t_initialize } #define macro_f_fss_named_t_initialize(name, objects, contents, quotess) macro_f_array_lengths_t_initialize(name, objects, contents, quotess) @@ -44,7 +44,7 @@ extern "C" { macro_f_fss_object_t_clear(named.name) \ macro_f_fss_objects_t_clear(named.objects) \ macro_f_fss_contents_t_clear(named.contents) \ - macro_f_fss_quotess_t_clear(named.quotess) + macro_f_uint8ss_t_clear(named.quotess) #define macro_f_fss_named_t_resize(status, named, length) status = f_fss_named_resize(length, &named); #define macro_f_fss_named_t_adjust(status, named, length) status = f_fss_named_adjust(length, &named); diff --git a/level_0/f_fss/c/fss/quote.h b/level_0/f_fss/c/fss/quote.h index 47e95b5..0ff0cd1 100644 --- a/level_0/f_fss/c/fss/quote.h +++ b/level_0/f_fss/c/fss/quote.h @@ -20,85 +20,20 @@ extern "C" { * Types for FSS quote. * * f_fss_quote_type_*: - * - none: Not a quote. - * - single: Quote type is a single quote. - * - double: Quote type is a double quote. + * - none: Not a quote. + * - backtick: Quote type is a backtick. + * - double: Quote type is a double quote. + * - single: Quote type is a single quote. */ #ifndef _di_f_fss_quote_type_ enum { f_fss_quote_type_none_e = 0, - f_fss_quote_type_single_e, + f_fss_quote_type_backtick_e, f_fss_quote_type_double_e, + f_fss_quote_type_single_e, }; #endif // _di_f_fss_quote_type_ -/** - * A number representing a quote type fom the FSS quote type enumeration. - */ -#ifndef _di_f_fss_quote_t_ - typedef uint8_t f_fss_quote_t; - - #define macro_f_fss_quote_t_initialize(quote) quote -#endif // _di_f_fss_quote_t_ - -/** - * An array of f_fss_quote_t. - * - * array: The array of fss quote. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_f_fss_quotes_t_ - typedef f_uint8s_t f_fss_quotes_t; - - #define f_fss_quotes_t_initialize f_uint8s_t_initialize - - #define macro_f_fss_quotes_t_initialize(array, size, used) { array, size, used } - #define macro_f_fss_quotes_t_initialize2(array, length) { array, length, length } - - #define macro_f_fss_quotes_t_clear(quotes) macro_f_uint8s_t_clear(quotes) - - #define macro_f_fss_quotes_t_resize(status, quotes, length) macro_f_uint8s_t_resize(status, quotes, length) - #define macro_f_fss_quotes_t_adjust(status, quotes, length) macro_f_uint8s_t_adjust(status, quotes, length) - - #define macro_f_fss_quotes_t_delete_simple(quotes) macro_f_uint8s_t_delete_simple(quotes) - #define macro_f_fss_quotes_t_destroy_simple(quotes) macro_f_uint8s_t_destroy_simple(quotes) - - #define macro_f_fss_quotes_t_increase(status, step, quotes) macro_f_uint8s_t_increase(status, step, quotes) - #define macro_f_fss_quotes_t_increase_by(status, quotes, amount) macro_f_uint8s_t_increase_by(status, quotes, amount) - #define macro_f_fss_quotes_t_decrease_by(status, quotes, amount) macro_f_uint8s_t_decrease_by(status, quotes, amount) - #define macro_f_fss_quotes_t_decimate_by(status, quotes, amount) macro_f_uint8s_t_decimate_by(status, quotes, amount) -#endif // _di_f_fss_quotes_t_ - -/** - * An array of f_fss_quotes_t. - * - * array: The array of an array of fss quote. - * size: Total amount of allocated space. - * used: Total number of allocated spaces used. - */ -#ifndef _di_f_fss_quotess_t_ - typedef f_uint8ss_t f_fss_quotess_t; - - #define f_fss_quotess_t_initialize f_uint8ss_t_initialize - - #define macro_f_fss_quotess_t_initialize(array, size, used) { array, size, used } - #define macro_f_fss_quotess_t_initialize2(array, length) { array, length, length } - - #define macro_f_fss_quotess_t_clear(quotess) macro_f_uint8ss_t_clear(quotess) - - #define macro_f_fss_quotess_t_resize(status, quotess, length) macro_f_uint8ss_t_resize(status, quotess, length) - #define macro_f_fss_quotess_t_adjust(status, quotess, length) macro_f_uint8ss_t_adjust(status, quotess, length) - - #define macro_f_fss_quotess_t_delete_simple(quotess) macro_f_uint8ss_t_delete_simple(quotess) - #define macro_f_fss_quotess_t_destroy_simple(quotess) macro_f_uint8ss_t_destroy_simple(quotess) - - #define macro_f_fss_quotess_t_increase(status, step, quotess) macro_f_uint8ss_t_increase(status, step, quotess) - #define macro_f_fss_quotess_t_increase_by(status, quotess, amount) macro_f_uint8ss_t_increase_by(status, quotess, amount) - #define macro_f_fss_quotess_t_decrease_by(status, quotess, amount) macro_f_uint8ss_t_decrease_by(status, quotess, amount) - #define macro_f_fss_quotess_t_decimate_by(status, quotess, amount) macro_f_uint8ss_t_decimate_by(status, quotess, amount) -#endif // _di_f_fss_quotess_t_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_fss/c/fss/set.h b/level_0/f_fss/c/fss/set.h index a8de491..5cf73b0 100644 --- a/level_0/f_fss/c/fss/set.h +++ b/level_0/f_fss/c/fss/set.h @@ -101,19 +101,19 @@ extern "C" { f_fss_objects_t objects; f_fss_contents_t contents; - f_fss_quotes_t objects_quote; - f_fss_quotess_t contents_quote; + f_uint8s_t objects_quote; + f_uint8ss_t contents_quote; } f_fss_set_quote_t; - #define f_fss_set_quote_t_initialize { f_fss_objects_t_initialize, f_fss_contents_t_initialize, f_fss_quotes_t_initialize, f_fss_quotess_t_initialize } + #define f_fss_set_quote_t_initialize { f_fss_objects_t_initialize, f_fss_contents_t_initialize, f_uint8s_t_initialize, f_uint8ss_t_initialize } #define macro_f_fss_set_quote_t_initialize(objects, contents, objects_quote, contents_quote) { objects, contents, objects_quote, contents_quote } #define macro_f_fss_set_quote_t_clear(set) \ macro_f_fss_objects_t_clear(set.objects) \ macro_f_fss_contents_t_clear(set.contents) \ - macro_f_fss_quotes_t_clear(set.objects_quote) \ - macro_f_fss_quotess_t_clear(set.contents_quote) + macro_f_uint8s_t_clear(set.objects_quote) \ + macro_f_uint8ss_t_clear(set.contents_quote) #define macro_f_fss_set_quote_t_resize(status, set_quote, length) status = f_fss_set_quote_resize(length, &set_quote); #define macro_f_fss_set_quote_t_adjust(status, set_quote, length) status = f_fss_set_quote_adjust(length, &set_quote); diff --git a/level_0/f_fss/c/private-fss.c b/level_0/f_fss/c/private-fss.c index 1605e88..a45d82f 100644 --- a/level_0/f_fss/c/private-fss.c +++ b/level_0/f_fss/c/private-fss.c @@ -276,10 +276,10 @@ extern "C" { macro_f_fss_contents_t_adjust(status, set_quote->contents, length); if (F_status_is_error(status)) return status; - macro_f_fss_quotes_t_adjust(status, set_quote->objects_quote, length); + macro_f_uint8s_t_adjust(status, set_quote->objects_quote, length); if (F_status_is_error(status)) return status; - macro_f_fss_quotess_t_adjust(status, set_quote->contents_quote, length); + macro_f_uint8ss_t_adjust(status, set_quote->contents_quote, length); if (F_status_is_error(status)) return status; return F_none; @@ -297,10 +297,10 @@ extern "C" { macro_f_fss_contents_t_resize(status, set_quote->contents, length); if (F_status_is_error(status)) return status; - macro_f_fss_quotes_t_resize(status, set_quote->objects_quote, length); + macro_f_uint8s_t_resize(status, set_quote->objects_quote, length); if (F_status_is_error(status)) return status; - macro_f_fss_quotess_t_resize(status, set_quote->contents_quote, length); + macro_f_uint8ss_t_resize(status, set_quote->contents_quote, length); if (F_status_is_error(status)) return status; return F_none; @@ -320,10 +320,10 @@ extern "C" { macro_f_fss_contents_t_adjust(status, set_quotes->array[i].contents, 0); if (F_status_is_error(status)) return status; - macro_f_fss_quotes_t_adjust(status, set_quotes->array[i].objects_quote, 0); + macro_f_uint8s_t_adjust(status, set_quotes->array[i].objects_quote, 0); if (F_status_is_error(status)) return status; - macro_f_fss_quotess_t_adjust(status, set_quotes->array[i].contents_quote, 0); + macro_f_uint8ss_t_adjust(status, set_quotes->array[i].contents_quote, 0); if (F_status_is_error(status)) return status; } // for @@ -356,10 +356,10 @@ extern "C" { macro_f_fss_contents_t_resize(status, set_quotes->array[i].contents, 0); if (F_status_is_error(status)) return status; - macro_f_fss_quotes_t_resize(status, set_quotes->array[i].objects_quote, 0); + macro_f_uint8s_t_resize(status, set_quotes->array[i].objects_quote, 0); if (F_status_is_error(status)) return status; - macro_f_fss_quotess_t_resize(status, set_quotes->array[i].contents_quote, 0); + macro_f_uint8ss_t_resize(status, set_quotes->array[i].contents_quote, 0); if (F_status_is_error(status)) return status; } // for diff --git a/level_0/f_fss/c/private-fss.h b/level_0/f_fss/c/private-fss.h index 01f5256..64170d2 100644 --- a/level_0/f_fss/c/private-fss.h +++ b/level_0/f_fss/c/private-fss.h @@ -358,13 +358,13 @@ extern "C" { * * Errors (with error bit) from: macro_f_fss_contents_t_adjust(). * Errors (with error bit) from: macro_f_fss_objects_t_adjust(). - * Errors (with error bit) from: macro_f_fss_quotes_t_adjust(). - * Errors (with error bit) from: macro_f_fss_quotess_t_adjust(). + * Errors (with error bit) from: macro_f_uint8s_t_adjust(). + * Errors (with error bit) from: macro_f_uint8ss_t_adjust(). * * @see macro_f_fss_contents_t_adjust() * @see macro_f_fss_objects_t_adjust() - * @see macro_f_fss_quotes_t_adjust() - * @see macro_f_fss_quotess_t_adjust() + * @see macro_f_uint8s_t_adjust() + * @see macro_f_uint8ss_t_adjust() * * @see f_fss_set_quote_adjust() * @see f_fss_set_quote_decimate_by() @@ -388,13 +388,13 @@ extern "C" { * * Errors (with error bit) from: macro_f_fss_contents_t_resize(). * Errors (with error bit) from: macro_f_fss_objects_t_resize(). - * Errors (with error bit) from: macro_f_fss_quotes_t_resize(). - * Errors (with error bit) from: macro_f_fss_quotess_t_resize(). + * Errors (with error bit) from: macro_f_uint8s_t_resize(). + * Errors (with error bit) from: macro_f_uint8ss_t_resize(). * * @see macro_f_fss_contents_t_resize() * @see macro_f_fss_objects_t_resize() - * @see macro_f_fss_quotes_t_resize() - * @see macro_f_fss_quotess_t_resize() + * @see macro_f_uint8s_t_resize() + * @see macro_f_uint8ss_t_resize() * * @see f_fss_set_quote_decrease_by() * @see f_fss_set_quote_increase() @@ -420,14 +420,14 @@ extern "C" { * * Errors (with error bit) from: macro_f_fss_contents_t_adjust(). * Errors (with error bit) from: macro_f_fss_objects_t_adjust(). - * Errors (with error bit) from: macro_f_fss_quotes_t_adjust(). - * Errors (with error bit) from: macro_f_fss_quotess_t_adjust(). + * Errors (with error bit) from: macro_f_uint8s_t_adjust(). + * Errors (with error bit) from: macro_f_uint8ss_t_adjust(). * Errors (with error bit) from: f_memory_adjust(). * * @see macro_f_fss_contents_t_adjust() * @see macro_f_fss_objects_t_adjust() - * @see macro_f_fss_quotes_t_adjust() - * @see macro_f_fss_quotess_t_adjust() + * @see macro_f_uint8s_t_adjust() + * @see macro_f_uint8ss_t_adjust() * * @see f_fss_set_quotes_adjust() * @see f_fss_set_quotes_decimate_by() @@ -452,14 +452,14 @@ extern "C" { * * Errors (with error bit) from: macro_f_fss_contents_t_resize(). * Errors (with error bit) from: macro_f_fss_objects_t_resize(). - * Errors (with error bit) from: macro_f_fss_quotes_t_resize(). - * Errors (with error bit) from: macro_f_fss_quotess_t_resize(). + * Errors (with error bit) from: macro_f_uint8s_t_resize(). + * Errors (with error bit) from: macro_f_uint8ss_t_resize(). * Errors (with error bit) from: f_memory_resize(). * * @see macro_f_fss_contents_t_resize() * @see macro_f_fss_objects_t_resize() - * @see macro_f_fss_quotes_t_resize() - * @see macro_f_fss_quotess_t_resize() + * @see macro_f_uint8s_t_resize() + * @see macro_f_uint8ss_t_resize() * * @see f_fss_set_quotes_decrease_by() * @see f_fss_set_quotes_increase() diff --git a/level_1/fl_fss/c/fss/basic.c b/level_1/fl_fss/c/fss/basic.c index 610848e..9b0481c 100644 --- a/level_1/fl_fss/c/fss/basic.c +++ b/level_1/fl_fss/c/fss/basic.c @@ -108,7 +108,7 @@ extern "C" { return F_status_set_error(F_none_eol); } - if (content.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue; + if (content.string[range->start] == f_fss_placeholder_s.string[0]) continue; destination->string[destination->used++] = content.string[range->start]; } // for @@ -124,7 +124,7 @@ extern "C" { #endif // _di_fl_fss_basic_content_write_ #ifndef _di_fl_fss_basic_object_read_ - f_status_t fl_fss_basic_object_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, f_fss_quote_t * const quote, f_fss_delimits_t * const delimits) { + f_status_t fl_fss_basic_object_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, uint8_t * const quote, f_fss_delimits_t * const delimits) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!found) return F_status_set_error(F_parameter); @@ -144,7 +144,7 @@ extern "C" { #endif // _di_fl_fss_basic_object_read_ #ifndef _di_fl_fss_basic_object_write_ - f_status_t fl_fss_basic_object_write(const f_string_static_t object, const f_fss_quote_t quote, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination) { + f_status_t fl_fss_basic_object_write(const f_string_static_t object, const uint8_t quote, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const 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); @@ -152,11 +152,11 @@ extern "C" { const f_array_length_t destination_used = destination->used; - f_status_t status = private_fl_fss_basic_write(F_true, object, quote ? quote : f_fss_delimit_quote_double_s.string[0], state, range, destination); + f_status_t status = private_fl_fss_basic_write(F_true, object, quote ? quote : f_fss_quote_double_s.string[0], state, range, destination); if (status == F_data_not_stop || status == F_data_not_eos) { - // Objects cannot be empty, so write a quoted empty string. + // Objects cannot be empty, so write a quote empty string. const f_status_t status_allocation = f_string_dynamic_increase_by(2, destination); if (F_status_is_error(status_allocation)) { @@ -165,8 +165,8 @@ extern "C" { return status_allocation; } - destination->string[destination->used++] = quote ? f_fss_delimit_quote_single_s.string[0] : f_fss_delimit_quote_double_s.string[0]; - destination->string[destination->used++] = quote ? f_fss_delimit_quote_single_s.string[0] : f_fss_delimit_quote_double_s.string[0]; + destination->string[destination->used++] = quote ? quote : f_fss_quote_double_s.string[0]; + destination->string[destination->used++] = quote ? quote : f_fss_quote_double_s.string[0]; } if (complete == f_fss_complete_partial_e || complete == f_fss_complete_partial_trim_e || complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e) { @@ -174,7 +174,7 @@ extern "C" { f_status_t status2 = F_none; if (complete == f_fss_complete_full_trim_e) { - status2 = private_fl_fss_basic_write_object_trim(quote ? quote : f_fss_delimit_quote_double_s.string[0], destination_used, state, destination); + status2 = private_fl_fss_basic_write_object_trim(quote ? quote : f_fss_quote_double_s.string[0], destination_used, state, destination); if (F_status_is_error(status2)) { destination->used = destination_used; diff --git a/level_1/fl_fss/c/fss/basic.h b/level_1/fl_fss/c/fss/basic.h index 9f81c05..4c72f8c 100644 --- a/level_1/fl_fss/c/fss/basic.h +++ b/level_1/fl_fss/c/fss/basic.h @@ -158,7 +158,7 @@ extern "C" { * @param found * A location where a valid object was found. * @param quote - * This will store whether or not this object is quote and what quote is in use. + * This will store the quote character to use (if value is 0, then there is not quote). * Set pointer address to 0 to not use. * @param delimits * A delimits array representing where delimits exist within the buffer. @@ -198,7 +198,7 @@ extern "C" { * @see f_utf_buffer_increment() */ #ifndef _di_fl_fss_basic_object_read_ - extern f_status_t fl_fss_basic_object_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, f_fss_quote_t * const quote, f_fss_delimits_t * const delimits); + extern f_status_t fl_fss_basic_object_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, uint8_t * const quote, f_fss_delimits_t * const delimits); #endif // _di_fl_fss_basic_object_read_ /** @@ -214,7 +214,7 @@ extern "C" { * The string to write as (does not stop at NULLS, they are ignored and not written). * @param quote * If 0, then double quotes are auto-inserted, when required. - * Otherwise, this is the type of quote to wrap the object in when writing. + * Otherwise, this is quote character to wrap the object in when writing. * @param complete * If f_fss_complete_none_e, then only the object name is written. * If f_fss_complete_full_e, this will write any appropriate open and close aspects of this object. @@ -259,7 +259,7 @@ extern "C" { * @see f_string_dynamic_increase_by() */ #ifndef _di_fl_fss_basic_object_write_ - extern f_status_t fl_fss_basic_object_write(const f_string_static_t object, const f_fss_quote_t quote, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination); + extern f_status_t fl_fss_basic_object_write(const f_string_static_t object, const uint8_t quote, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination); #endif // _di_fl_fss_basic_object_write_ #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss/basic_list.c b/level_1/fl_fss/c/fss/basic_list.c index d000c87..ccb10c1 100644 --- a/level_1/fl_fss/c/fss/basic_list.c +++ b/level_1/fl_fss/c/fss/basic_list.c @@ -64,7 +64,7 @@ extern "C" { continue; } - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { slash_first = range->start; slash_count = 1; @@ -80,8 +80,8 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue; - if (buffer.string[range->start] != f_fss_delimit_slash_s.string[0]) break; + if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) continue; + if (buffer.string[range->start] != f_fss_slash_s.string[0]) break; ++slash_count; } // for @@ -133,7 +133,7 @@ extern "C" { while (slash_count > 0) { - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { if (slash_count % 2 == 1) { delimits->array[delimits->used++] = range->start; } @@ -340,7 +340,7 @@ extern "C" { } } - if (content.string[range->start] == f_fss_delimit_slash_s.string[0] && !is_comment) { + if (content.string[range->start] == f_fss_slash_s.string[0] && !is_comment) { slash_count = 1; if (do_prepend) { @@ -365,10 +365,10 @@ extern "C" { } } - if (content.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue; - if (content.string[range->start] != f_fss_delimit_slash_s.string[0]) break; + if (content.string[range->start] == f_fss_placeholder_s.string[0]) continue; + if (content.string[range->start] != f_fss_slash_s.string[0]) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; ++slash_count; } // for @@ -385,10 +385,10 @@ extern "C" { if (F_status_is_error(status)) break; while (--slash_count) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // while - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; destination->string[destination->used++] = f_fss_basic_list_open_s.string[0]; range->start = start + 1; @@ -429,7 +429,7 @@ extern "C" { status = f_string_dynamic_increase_by(3, destination); if (F_status_is_error(status)) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; destination->string[destination->used++] = f_fss_basic_list_open_s.string[0]; range->start = start + 1; @@ -466,7 +466,7 @@ extern "C" { } } - if (content.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (content.string[range->start] != f_fss_placeholder_s.string[0]) { if (do_prepend) { status = f_string_dynamic_append(*prepend, destination); if (F_status_is_error(status)) break; @@ -505,7 +505,7 @@ extern "C" { // Check to see if a newline exists, at the end. if (destination->used) { for (i = destination->used - 1; i > 0; --i) { - if (destination->string[i] != f_fss_delimit_placeholder_s.string[0]) break; + if (destination->string[i] != f_fss_placeholder_s.string[0]) break; } // for } @@ -583,7 +583,7 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { slash_first = range->start; slash_count = 1; @@ -599,9 +599,9 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0]) { + if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) { continue; - } else if (buffer.string[range->start] != f_fss_delimit_slash_s.string[0]) { + } else if (buffer.string[range->start] != f_fss_slash_s.string[0]) { break; } @@ -653,7 +653,7 @@ extern "C" { if (slash_count % 2 == 0) { while (slash_count > 0) { - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { if (slash_count % 2 == 1) { delimits->array[delimits->used] = range->start; ++delimits->used; @@ -830,7 +830,7 @@ extern "C" { status = f_string_dynamic_increase(state.step_large, destination); if (F_status_is_error(status)) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; break; } @@ -841,7 +841,7 @@ extern "C" { if (status == F_true) break; // Objects will not have leading white spaces, but having this does not result in an invalid object, so just write the provided spaces. - if (object.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (object.string[range->start] != f_fss_placeholder_s.string[0]) { if (object.string[range->start] == f_fss_eol_s.string[0]) { status = F_status_set_error(F_none_eol); @@ -891,7 +891,7 @@ extern "C" { } } - if (object.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (object.string[range->start] == f_fss_slash_s.string[0]) { slash_count = 1; for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) { @@ -906,8 +906,8 @@ extern "C" { } } - if (object.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue; - if (object.string[range->start] != f_fss_delimit_slash_s.string[0]) break; + if (object.string[range->start] == f_fss_placeholder_s.string[0]) continue; + if (object.string[range->start] != f_fss_slash_s.string[0]) break; ++slash_count; } // for @@ -924,13 +924,13 @@ extern "C" { if (F_status_is_error(status)) break; while (--slash_count) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // while if (range->start > range->stop || range->start >= object.used) break; } - if (object.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (object.string[range->start] != f_fss_placeholder_s.string[0]) { if (object.string[range->start] == f_fss_eol_s.string[0]) { status = F_status_set_error(F_none_eol); diff --git a/level_1/fl_fss/c/fss/embedded_list.c b/level_1/fl_fss/c/fss/embedded_list.c index ba0230b..58bc729 100644 --- a/level_1/fl_fss/c/fss/embedded_list.c +++ b/level_1/fl_fss/c/fss/embedded_list.c @@ -116,14 +116,14 @@ extern "C" { continue; } - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { slash_first = range->start; slash_last = range->start; slashes.array[depth] = 1; position_previous = range->start++; - while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0] || buffer.string[range->start] == f_fss_delimit_slash_s.string[0])) { + while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_placeholder_s.string[0] || buffer.string[range->start] == f_fss_slash_s.string[0])) { if (state.interrupt) { status = state.interrupt((void *) &state, 0); @@ -137,7 +137,7 @@ extern "C" { position_previous = range->start; - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { slash_last = range->start++; ++slashes.array[depth]; } @@ -212,7 +212,7 @@ extern "C" { break; } - if (buffer.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (buffer.string[range->start] != f_fss_placeholder_s.string[0]) { status = f_fss_is_space(state, buffer, *range); if (F_status_is_error(status)) break; @@ -255,7 +255,7 @@ extern "C" { // Apply slash delimits, only slashes and placeholders should be present. while (slashes.array[depth]) { - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { if (slashes.array[depth] % 2 == 1) { delimits->array[delimits->used++] = range->start; } @@ -335,7 +335,7 @@ extern "C" { if (buffer.string[range->start] == f_fss_eol_s.string[0]) break; - if (buffer.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (buffer.string[range->start] != f_fss_placeholder_s.string[0]) { status = f_fss_is_space(state, buffer, *range); if (F_status_is_error(status)) break; @@ -468,7 +468,7 @@ extern "C" { if (buffer.string[range->start] == f_fss_eol_s.string[0]) break; - if (buffer.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (buffer.string[range->start] != f_fss_placeholder_s.string[0]) { status = f_fss_is_space(state, buffer, *range); if (F_status_is_error(status)) break; @@ -729,7 +729,7 @@ extern "C" { } } - if (content.string[range->start] == f_fss_delimit_slash_s.string[0] && !is_comment) { + if (content.string[range->start] == f_fss_slash_s.string[0] && !is_comment) { slash_count = 1; if (do_prepend) { @@ -753,10 +753,10 @@ extern "C" { } } - if (content.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue; - if (content.string[range->start] != f_fss_delimit_slash_s.string[0]) break; + if (content.string[range->start] == f_fss_placeholder_s.string[0]) continue; + if (content.string[range->start] != f_fss_slash_s.string[0]) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; ++slash_count; } // for @@ -774,11 +774,11 @@ extern "C" { if (content.string[range->start] == f_fss_embedded_list_open_s.string[0]) { while (--slash_count) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // while } - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; destination->string[destination->used++] = content.string[start]; range->start = start + 1; @@ -858,7 +858,7 @@ extern "C" { status = f_string_dynamic_increase_by(3, destination); if (F_status_is_error(status)) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; destination->string[destination->used++] = content.string[start]; range->start = start + 1; @@ -891,7 +891,7 @@ extern "C" { break; } - if (content.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (content.string[range->start] != f_fss_placeholder_s.string[0]) { if (do_prepend) { status = f_string_dynamic_append(*prepend, destination); if (F_status_is_error(status)) break; @@ -1021,14 +1021,14 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { slash_first = range->start; slash_count = 1; status = f_utf_buffer_increment(buffer, range, 1); if (F_status_is_error(status)) break; - while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0] || buffer.string[range->start] == f_fss_delimit_slash_s.string[0])) { + while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_placeholder_s.string[0] || buffer.string[range->start] == f_fss_slash_s.string[0])) { if (state.interrupt) { status = state.interrupt((void *) &state, 0); @@ -1040,7 +1040,7 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) slash_count++; + if (buffer.string[range->start] == f_fss_slash_s.string[0]) slash_count++; status = f_utf_buffer_increment(buffer, range, 1); if (F_status_is_error(status)) break; @@ -1090,7 +1090,7 @@ extern "C" { if (slash_count % 2 == 0) { while (slash_count > 0) { - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { if (slash_count % 2 == 1) { delimits->array[delimits->used++] = range->start; } @@ -1293,7 +1293,7 @@ extern "C" { status = f_string_dynamic_increase(state.step_large, destination); if (F_status_is_error(status)) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; break; } @@ -1304,7 +1304,7 @@ extern "C" { if (status == F_true) break; // Objects will not have leading white spaces, but having this does not result in an invalid object, so just write the provided spaces. - if (object.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (object.string[range->start] != f_fss_placeholder_s.string[0]) { if (object.string[range->start] == f_fss_eol_s.string[0]) { status = F_status_set_error(F_none_eol); @@ -1354,7 +1354,7 @@ extern "C" { } } - if (object.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (object.string[range->start] == f_fss_slash_s.string[0]) { slash_count = 1; for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) { @@ -1369,8 +1369,8 @@ extern "C" { } } - if (object.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue; - if (object.string[range->start] != f_fss_delimit_slash_s.string[0]) break; + if (object.string[range->start] == f_fss_placeholder_s.string[0]) continue; + if (object.string[range->start] != f_fss_slash_s.string[0]) break; ++slash_count; } // for @@ -1387,7 +1387,7 @@ extern "C" { if (F_status_is_error(status)) break; while (--slash_count) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // while if (range->start > range->stop || range->start >= object.used) { @@ -1397,7 +1397,7 @@ extern "C" { } } - if (object.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (object.string[range->start] != f_fss_placeholder_s.string[0]) { if (object.string[range->start] == f_fss_eol_s.string[0]) { status = F_status_set_error(F_none_eol); diff --git a/level_1/fl_fss/c/fss/extended.c b/level_1/fl_fss/c/fss/extended.c index d762420..bf84328 100644 --- a/level_1/fl_fss/c/fss/extended.c +++ b/level_1/fl_fss/c/fss/extended.c @@ -7,7 +7,7 @@ extern "C" { #endif #ifndef _di_fl_fss_extended_content_read_ - f_status_t fl_fss_extended_content_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_content_t * const found, f_fss_quotes_t * const quotes, f_fss_delimits_t * const delimits) { + f_status_t fl_fss_extended_content_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_content_t * const found, f_uint8s_t * const quotes, f_fss_delimits_t * const delimits) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!found) return F_status_set_error(F_parameter); @@ -33,15 +33,15 @@ extern "C" { const f_array_length_t quotes_used = quotes ? quotes->used : 0; uint8_t content_found = 0; - f_fss_quote_t quoted = f_fss_quote_type_none_e; + uint8_t quote = 0; while (range->start <= range->stop && range->start < buffer.used) { f_string_range_t content_partial = f_string_range_t_initialize; - quoted = f_fss_quote_type_none_e; + quote = 0; - status = private_fl_fss_basic_read(buffer, F_false, state, range, &content_partial, "ed, delimits); + status = private_fl_fss_basic_read(buffer, F_false, state, range, &content_partial, "e, delimits); if (status == F_fss_found_object || status == F_fss_found_object_content_not) { status_allocate = f_string_ranges_increase(state.step_small, found); @@ -63,11 +63,14 @@ extern "C" { found->array[found->used++] = content_partial; if (quotes) { - if (quoted == f_fss_quote_type_double_e) { - quotes->array[quotes->used] = f_string_ascii_quote_double_s.string[0]; + if (quote == f_fss_quote_type_double_e) { + quotes->array[quotes->used] = f_fss_quote_double_s.string[0]; } - else if (quoted == f_fss_quote_type_single_e) { - quotes->array[quotes->used] = f_string_ascii_quote_single_s.string[0]; + else if (quote == f_fss_quote_type_single_e) { + quotes->array[quotes->used] = f_fss_quote_single_s.string[0]; + } + else if (quote == f_fss_quote_type_backtick_e) { + quotes->array[quotes->used] = f_fss_quote_backtick_s.string[0]; } else { quotes->array[quotes->used] = 0; @@ -126,23 +129,23 @@ extern "C" { #endif // _di_fl_fss_extended_content_read_ #ifndef _di_fl_fss_extended_content_write_ - f_status_t fl_fss_extended_content_write(const f_string_static_t content, const f_fss_quote_t quoted, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination) { + f_status_t fl_fss_extended_content_write(const f_string_static_t content, const uint8_t quote, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const 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); #endif // _di_level_1_parameter_checking_ // This operates exactly like an object, syntax-wise. - const f_status_t status = private_fl_fss_basic_write(F_false, content, quoted ? quoted : f_fss_delimit_quote_double_s.string[0], state, range, destination); + const f_status_t status = private_fl_fss_basic_write(F_false, content, quote ? quote : f_fss_quote_double_s.string[0], state, range, destination); if (status == F_data_not_stop || status == F_data_not_eos) { - // Content that is empty must be represented by a quoted empty string. + // Content that is empty must be represented by a quote empty string. const f_status_t status_allocation = f_string_dynamic_increase_by(4, destination); if (F_status_is_error(status_allocation)) return status_allocation; - destination->string[destination->used++] = quoted ? f_fss_delimit_quote_single_s.string[0] : f_fss_delimit_quote_double_s.string[0]; - destination->string[destination->used++] = quoted ? f_fss_delimit_quote_single_s.string[0] : f_fss_delimit_quote_double_s.string[0]; + destination->string[destination->used++] = quote ? quote : f_fss_quote_double_s.string[0]; + destination->string[destination->used++] = quote ? quote : f_fss_quote_double_s.string[0]; // Content should be terminated, even if empty. if (complete == f_fss_complete_partial_e || complete == f_fss_complete_partial_trim_e || complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e || complete == f_fss_complete_next_e) { @@ -176,7 +179,7 @@ extern "C" { #endif // _di_fl_fss_extended_content_write_ #ifndef _di_fl_fss_extended_object_read_ - f_status_t fl_fss_extended_object_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, f_fss_quote_t * const quoted, f_fss_delimits_t * const delimits) { + f_status_t fl_fss_extended_object_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, uint8_t * const quote, f_fss_delimits_t * const delimits) { #ifndef _di_level_1_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!found) return F_status_set_error(F_parameter); @@ -185,7 +188,7 @@ extern "C" { const f_array_length_t delimits_used = delimits->used; - const f_status_t status = private_fl_fss_basic_read(buffer, F_true, state, range, found, quoted, delimits); + const f_status_t status = private_fl_fss_basic_read(buffer, F_true, state, range, found, quote, delimits); if (F_status_is_error(status) || status == F_fss_found_object_not || status == F_data_not || status == F_data_not_eos || status == F_data_not_stop) { delimits->used = delimits_used; @@ -196,7 +199,7 @@ extern "C" { #endif // _di_fl_fss_extended_object_read_ #ifndef _di_fl_fss_extended_object_write_ -f_status_t fl_fss_extended_object_write(const f_string_static_t object, const f_fss_quote_t quoted, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination) { +f_status_t fl_fss_extended_object_write(const f_string_static_t object, const uint8_t quote, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const 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); @@ -204,16 +207,16 @@ f_status_t fl_fss_extended_object_write(const f_string_static_t object, const f_ const f_array_length_t used_start = destination->used; - f_status_t status = private_fl_fss_basic_write(F_true, object, quoted ? quoted : f_fss_delimit_quote_double_s.string[0], state, range, destination); + f_status_t status = private_fl_fss_basic_write(F_true, object, quote ? quote : f_fss_quote_double_s.string[0], state, range, destination); if (status == F_data_not_stop || status == F_data_not_eos) { - // Objects cannot be empty, so write a quoted empty string. + // Objects cannot be empty, so write a quote empty string. const f_status_t status_allocation = f_string_dynamic_increase_by(2, destination); if (F_status_is_error(status_allocation)) return status_allocation; - destination->string[destination->used++] = quoted ? f_fss_delimit_quote_single_s.string[0] : f_fss_delimit_quote_double_s.string[0]; - destination->string[destination->used++] = quoted ? f_fss_delimit_quote_single_s.string[0] : f_fss_delimit_quote_double_s.string[0]; + destination->string[destination->used++] = quote ? quote : f_fss_quote_double_s.string[0]; + destination->string[destination->used++] = quote ? quote : f_fss_quote_double_s.string[0]; } if (complete == f_fss_complete_partial_e || complete == f_fss_complete_partial_trim_e || complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e) { @@ -221,7 +224,7 @@ f_status_t fl_fss_extended_object_write(const f_string_static_t object, const f_ f_status_t status2 = F_none; if (complete == f_fss_complete_full_trim_e) { - status2 = private_fl_fss_basic_write_object_trim(quoted ? quoted : f_fss_delimit_quote_double_s.string[0], used_start, state, destination); + status2 = private_fl_fss_basic_write_object_trim(quote ? quote : f_fss_quote_double_s.string[0], used_start, state, destination); if (F_status_is_error(status2)) return status2; } diff --git a/level_1/fl_fss/c/fss/extended.h b/level_1/fl_fss/c/fss/extended.h index b5ce70b..b7cc23c 100644 --- a/level_1/fl_fss/c/fss/extended.h +++ b/level_1/fl_fss/c/fss/extended.h @@ -93,7 +93,7 @@ extern "C" { * @see fl_fss_extended_content_read() */ #ifndef _di_fl_fss_extended_content_read_ - extern f_status_t fl_fss_extended_content_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_content_t * const found, f_fss_quotes_t * const quotes, f_fss_delimits_t * const delimits); + extern f_status_t fl_fss_extended_content_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_content_t * const found, f_uint8s_t * const quotes, f_fss_delimits_t * const delimits); #endif // _di_fl_fss_extended_content_read_ /** @@ -106,9 +106,9 @@ extern "C" { * * @param content * The string to write as (does not stop at NULLS, they are ignored and not written). - * @param quoted + * @param quote * If 0, then double quotes are auto-inserted, when required. - * Otherwise, this is the type of quote to wrap the object in when writing. + * Otherwise, this is quote character to wrap the object in when writing. * @param complete * If f_fss_complete_none_e, then only the content is written. * If f_fss_complete_next_e, then the content followed by any appropriate "next" character separating one content from the next, if applicable. @@ -158,7 +158,7 @@ extern "C" { * @see fl_fss_extended_content_write() */ #ifndef _di_fl_fss_extended_content_write_ - extern f_status_t fl_fss_extended_content_write(const f_string_static_t content, const f_fss_quote_t quoted, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination); + extern f_status_t fl_fss_extended_content_write(const f_string_static_t content, const uint8_t quote, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination); #endif // _di_fl_fss_extended_content_write_ /** @@ -184,8 +184,8 @@ extern "C" { * A start location past the stop location or buffer used means that the entire range was processed. * @param found * A location where a valid object was found. - * @param quoted - * This will store whether or not this object is quoted and what quote is in use. + * @param quote + * This will store the quote character to use (if value is 0, then there is not quote). * Set pointer address to 0 to not use. * @param delimits * A delimits array representing where delimits exist within the buffer. @@ -230,7 +230,7 @@ extern "C" { * @see fl_fss_extended_content_read() */ #ifndef _di_fl_fss_extended_object_read_ - extern f_status_t fl_fss_extended_object_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, f_fss_quote_t * const quoted, f_fss_delimits_t * const delimits); + extern f_status_t fl_fss_extended_object_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, uint8_t * const quote, f_fss_delimits_t * const delimits); #endif // _di_fl_fss_extended_object_read_ /** @@ -244,9 +244,9 @@ extern "C" { * * @param object * The string to write as (does not stop at NULLS, they are ignored and not written). - * @param quoted + * @param quote * If 0, then double quotes are auto-inserted, when required. - * Otherwise, this is the type of quote to wrap the object in when writing. + * Otherwise, this is quote character to wrap the object in when writing. * @param complete * If f_fss_complete_none_e, then only the object name is written. * If f_fss_complete_full_e, this will write any appropriate open and close aspects of this object. @@ -289,7 +289,7 @@ extern "C" { * @see f_string_dynamic_increase_by() */ #ifndef _di_fl_fss_extended_object_write_ - extern f_status_t fl_fss_extended_object_write(const f_string_static_t object, const f_fss_quote_t quoted, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination); + extern f_status_t fl_fss_extended_object_write(const f_string_static_t object, const uint8_t quote, const uint8_t complete, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination); #endif // _di_fl_fss_extended_object_write_ #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss/extended_list.c b/level_1/fl_fss/c/fss/extended_list.c index 9e30b75..98f6ac0 100644 --- a/level_1/fl_fss/c/fss/extended_list.c +++ b/level_1/fl_fss/c/fss/extended_list.c @@ -57,7 +57,7 @@ extern "C" { if (status == F_none_eos || status == F_none_stop) break; - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { slash_first = range->start; slash_count = 1; @@ -73,8 +73,8 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue; - if (buffer.string[range->start] != f_fss_delimit_slash_s.string[0]) break; + if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) continue; + if (buffer.string[range->start] != f_fss_slash_s.string[0]) break; ++slash_count; } // for @@ -282,7 +282,7 @@ extern "C" { } } - if (content.string[range->start] == f_fss_delimit_slash_s.string[0] && !is_comment) { + if (content.string[range->start] == f_fss_slash_s.string[0] && !is_comment) { slash_count = 1; if (do_prepend) { @@ -306,10 +306,10 @@ extern "C" { } } - if (content.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue; - if (content.string[range->start] != f_fss_delimit_slash_s.string[0]) break; + if (content.string[range->start] == f_fss_placeholder_s.string[0]) continue; + if (content.string[range->start] != f_fss_slash_s.string[0]) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; ++slash_count; } // for @@ -328,7 +328,7 @@ extern "C" { status = f_string_dynamic_increase_by(2, destination); if (F_status_is_error(status)) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; destination->string[destination->used++] = f_fss_extended_list_close_s.string[0]; range->start = start + 1; @@ -408,7 +408,7 @@ extern "C" { status = f_string_dynamic_increase_by(2, destination); if (F_status_is_error(status)) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; destination->string[destination->used++] = content.string[start]; range->start = start + 1; @@ -441,7 +441,7 @@ extern "C" { break; } - if (content.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (content.string[range->start] != f_fss_placeholder_s.string[0]) { if (do_prepend) { status = f_string_dynamic_append(*prepend, destination); if (F_status_is_error(status)) break; @@ -571,14 +571,14 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { slash_first = range->start; slash_count = 1; status = f_utf_buffer_increment(buffer, range, 1); if (F_status_is_error(status)) break; - while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0] || buffer.string[range->start] == f_fss_delimit_slash_s.string[0])) { + while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_placeholder_s.string[0] || buffer.string[range->start] == f_fss_slash_s.string[0])) { if (state.interrupt) { status = state.interrupt((void *) &state, 0); @@ -590,7 +590,7 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) ++slash_count; + if (buffer.string[range->start] == f_fss_slash_s.string[0]) ++slash_count; status = f_utf_buffer_increment(buffer, range, 1); if (F_status_is_error(status)) break; @@ -639,7 +639,7 @@ extern "C" { if (slash_count % 2 == 0) { while (slash_count > 0) { - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { if (slash_count % 2 == 1) { delimits->array[delimits->used++] = range->start; } @@ -843,7 +843,7 @@ extern "C" { status = f_string_dynamic_increase(state.step_large, destination); if (F_status_is_error(status)) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; break; } @@ -854,7 +854,7 @@ extern "C" { if (status == F_true) break; // Objects will not have leading white spaces, but having this does not result in an invalid object, so just write the provided spaces. - if (object.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (object.string[range->start] != f_fss_placeholder_s.string[0]) { if (object.string[range->start] == f_fss_eol_s.string[0]) { status = F_status_set_error(F_none_eol); @@ -904,7 +904,7 @@ extern "C" { } } - if (object.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (object.string[range->start] == f_fss_slash_s.string[0]) { slash_count = 1; for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) { @@ -919,8 +919,8 @@ extern "C" { } } - if (object.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue; - if (object.string[range->start] != f_fss_delimit_slash_s.string[0]) break; + if (object.string[range->start] == f_fss_placeholder_s.string[0]) continue; + if (object.string[range->start] != f_fss_slash_s.string[0]) break; ++slash_count; } // for @@ -937,7 +937,7 @@ extern "C" { if (F_status_is_error(status)) break; while (--slash_count) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // while if (range->start > range->stop || range->start >= object.used) { @@ -947,7 +947,7 @@ extern "C" { } } - if (object.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (object.string[range->start] != f_fss_placeholder_s.string[0]) { if (object.string[range->start] == f_fss_eol_s.string[0]) { status = F_status_set_error(F_none_eol); diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c index f027405..53a69e7 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -21,7 +21,7 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue; + if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) continue; if (buffer.string[range->start] == f_fss_eol_s.string[0]) break; status = f_string_dynamic_increase(state.step_large, destination); @@ -53,7 +53,7 @@ extern "C" { } } - if (destination->string[destination_range.start] == f_fss_delimit_placeholder_s.string[0]) continue; + if (destination->string[destination_range.start] == f_fss_placeholder_s.string[0]) continue; status = f_fss_is_space(state, *destination, destination_range); @@ -68,7 +68,7 @@ extern "C" { width = macro_f_utf_byte_width(destination->string[destination_range.start]); for (i = 0; i < width; ++i) { - destination->string[destination_range.start + i] = f_fss_delimit_placeholder_s.string[0]; + destination->string[destination_range.start + i] = f_fss_placeholder_s.string[0]; } // for } // for @@ -82,7 +82,7 @@ extern "C" { } } - if (destination->string[destination_range.start] == f_fss_delimit_placeholder_s.string[0]) { + if (destination->string[destination_range.start] == f_fss_placeholder_s.string[0]) { --destination->used; continue; @@ -123,7 +123,7 @@ extern "C" { #endif // !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_extended_list_object_write_) #if !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) || !defined(_di_fl_fss_extended_content_read_) - f_status_t private_fl_fss_basic_read(const f_string_static_t buffer, const bool object_as, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, f_fss_quote_t *quoted, f_fss_delimits_t * const delimits) { + f_status_t private_fl_fss_basic_read(const f_string_static_t buffer, const bool object_as, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, uint8_t * const quote, f_fss_delimits_t * const delimits) { f_status_t status = f_fss_skip_past_space(state, buffer, range); if (F_status_is_error(status)) return status; @@ -173,15 +173,15 @@ extern "C" { return F_fss_found_object_not; } - // Handle quoted support. + // Handle quote support. f_char_t quote_found = 0; - if (quoted) { - *quoted = f_fss_quote_type_none_e; + if (quote) { + *quote = 0; } // Identify where the object begins. - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { f_array_length_t first_slash = range->start; found->start = range->start; @@ -211,7 +211,7 @@ extern "C" { continue; } - if (buffer.string[range->start] != f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] != f_fss_slash_s.string[0]) { status = f_fss_is_space(state, buffer, *range); if (F_status_is_error(status)) return status; @@ -250,9 +250,9 @@ extern "C" { return F_none_stop; } - if (buffer.string[range->start] == f_fss_delimit_quote_single_s.string[0] || buffer.string[range->start] == f_fss_delimit_quote_double_s.string[0] || (object_as && buffer.string[range->start] == f_fss_comment_s.string[0])) { + if (buffer.string[range->start] == f_fss_quote_single_s.string[0] || buffer.string[range->start] == f_fss_quote_double_s.string[0] || buffer.string[range->start] == f_fss_quote_backtick_s.string[0] || (object_as && buffer.string[range->start] == f_fss_comment_s.string[0])) { - // Only the first slash before a quoted needs to be escaped (or not) as once there is a slash before a quoted, this cannot ever be a quote object. + // Only the first slash before a quote needs to be escaped (or not) as once there is a slash before a quote, this cannot ever be a quote object. // This simplifies the number of slashes needed. status = f_array_lengths_increase(state.step_small, delimits); if (F_status_is_error(status)) return status; @@ -263,7 +263,7 @@ extern "C" { if (F_status_is_error(status)) return status; } } - else if (buffer.string[range->start] == f_fss_delimit_quote_single_s.string[0] || buffer.string[range->start] == f_fss_delimit_quote_double_s.string[0]) { + else if (buffer.string[range->start] == f_fss_quote_single_s.string[0] || buffer.string[range->start] == f_fss_quote_double_s.string[0] || buffer.string[range->start] == f_fss_quote_backtick_s.string[0]) { quote_found = buffer.string[range->start]; status = f_utf_buffer_increment(buffer, range, 1); @@ -329,7 +329,7 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { first_slash = range->start; slash_count = 1; @@ -346,13 +346,13 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0]) { + if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) { status = f_utf_buffer_increment(buffer, range, 1); if (F_status_is_error(status)) return status; continue; } - else if (buffer.string[range->start] != f_fss_delimit_slash_s.string[0]) { + else if (buffer.string[range->start] != f_fss_slash_s.string[0]) { break; } @@ -377,7 +377,7 @@ extern "C" { if (buffer.string[range->start] == quote_found) { location = range->start; - // Check to see if there is a whitespace, EOS, or EOL after the quoted, if not, then this is not a closing quoted and delimits do not apply. + // Check to see if there is a whitespace, EOS, or EOL after the quote, if not, then this is not a closing quote and delimits do not apply. if (range->start + 1 <= range->stop && range->start + 1 < buffer.used) { ++range->start; @@ -386,7 +386,7 @@ extern "C" { if (range->start > range->stop || range->start >= buffer.used) { - // EOS or EOL was reached, so it is a valid closing quoted. + // EOS or EOL was reached, so it is a valid closing quote. // (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE.) status = F_true; } @@ -397,21 +397,18 @@ extern "C" { } else { - // EOS or EOL was reached, so it is a valid closing quoted. + // EOS or EOL was reached, so it is a valid closing quote. // (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE.) status = F_true; } if (status == F_true) { - if (quoted) { - if (quote_found == f_fss_delimit_quote_single_s.string[0]) { - *quoted = f_fss_quote_type_single_e; - } - else if (quote_found == f_fss_delimit_quote_double_s.string[0]) { - *quoted = f_fss_quote_type_double_e; + if (quote) { + if (quote_found == f_fss_quote_single_s.string[0] || quote_found == f_fss_quote_double_s.string[0] || quote_found == f_fss_quote_backtick_s.string[0]) { + *quote = quote_found; } else { - *quoted = f_fss_quote_type_none_e; + *quote = 0; } } @@ -423,7 +420,7 @@ extern "C" { while (slash_count > 0) { - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { if (slash_count % 2 == 1) { delimits->array[delimits->used] = range->start; ++delimits->used; @@ -438,7 +435,7 @@ extern "C" { range->start = location + 1; - while (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0]) { + while (buffer.string[range->start] == f_fss_placeholder_s.string[0]) { if (state.interrupt) { status = state.interrupt((void *) &state, 0); @@ -511,7 +508,7 @@ extern "C" { while (slash_count > 0) { - if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (buffer.string[range->start] == f_fss_slash_s.string[0]) { if (slash_count % 2 == 1) { delimits->array[delimits->used++] = range->start; } @@ -533,7 +530,7 @@ extern "C" { } else if (buffer.string[range->start] == quote_found) { - // Check to see if there is a whitespace, EOS, or EOL after the quoted, if not, then this is not a closing quoted. + // Check to see if there is a whitespace, EOS, or EOL after the quote, if not, then this is not a closing quote. location = range->start; if (range->start + 1 <= range->stop && range->start + 1 < buffer.used) { @@ -544,7 +541,7 @@ extern "C" { if (range->start > range->stop || range->start >= buffer.used) { - // EOS or EOL was reached, so it is a valid closing quoted. + // EOS or EOL was reached, so it is a valid closing quote. // (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE.) status = F_true; } @@ -555,7 +552,7 @@ extern "C" { } else { - // EOS or EOL was reached, so it is a valid closing quoted. + // EOS or EOL was reached, so it is a valid closing quote. // (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE.) status = F_true; } @@ -563,15 +560,12 @@ extern "C" { range->start = location; if (status == F_true) { - if (quoted) { - if (quote_found == f_fss_delimit_quote_single_s.string[0]) { - *quoted = f_fss_quote_type_single_e; - } - else if (quote_found == f_fss_delimit_quote_double_s.string[0]) { - *quoted = f_fss_quote_type_double_e; + if (quote) { + if (quote_found == f_fss_quote_single_s.string[0] || quote_found == f_fss_quote_double_s.string[0] || quote_found == f_fss_quote_backtick_s.string[0]) { + *quote = quote_found; } else { - *quoted = f_fss_quote_type_none_e; + *quote = f_fss_quote_type_none_e; } } @@ -608,7 +602,7 @@ extern "C" { return F_fss_found_object; } - if (buffer.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + if (buffer.string[range->start] != f_fss_placeholder_s.string[0]) { while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) { if (state.interrupt) { @@ -695,7 +689,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_) - f_status_t private_fl_fss_basic_write(const bool object_as, const f_string_static_t object, const f_fss_quote_t quoted, f_state_t state, f_string_range_t *range, f_string_dynamic_t *destination) { + f_status_t private_fl_fss_basic_write(const bool object_as, const f_string_static_t object, const uint8_t quote, f_state_t state, f_string_range_t *range, f_string_dynamic_t *destination) { f_status_t status = f_fss_skip_past_space(state, object, range); if (F_status_is_error(status)) return status; @@ -719,13 +713,13 @@ extern "C" { f_array_length_t item_total = 0; f_array_length_t i = 0; - const f_char_t quote_char = quoted == f_fss_quote_type_double_e ? f_string_ascii_quote_double_s.string[0] : f_string_ascii_quote_single_s.string[0]; + const f_char_t quote_char = quote ? quote : f_string_ascii_quote_double_s.string[0]; // Use placeholders for potential quote and potential delimited quote to avoid doing things such as memmove(). - destination->string[destination->used++] = f_fss_delimit_placeholder_s.string[0]; - destination->string[destination->used++] = f_fss_delimit_placeholder_s.string[0]; + destination->string[destination->used++] = f_fss_placeholder_s.string[0]; + destination->string[destination->used++] = f_fss_placeholder_s.string[0]; - // If there is an initial quote, then this must be quoted and the existing quote must be delimited. + // If there is an initial quote, then this must be quote and the existing quote must be delimited. if (object.string[input_start] == quote_char) { quoted_is = F_true; } @@ -747,7 +741,7 @@ extern "C" { } } - if (object.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (object.string[range->start] == f_fss_slash_s.string[0]) { item_first = range->start++; item_total = 1; @@ -763,17 +757,17 @@ extern "C" { } } - if (object.string[range->start] == f_fss_delimit_slash_s.string[0]) { + if (object.string[range->start] == f_fss_slash_s.string[0]) { ++item_total; } - else if (object.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + else if (object.string[range->start] != f_fss_placeholder_s.string[0]) { break; } } // for if (range->start > range->stop || range->start >= object.used) { - // Slashes before the final quote must be escaped when quoted, add the delimit slashes. + // Slashes before the final quote must be escaped when quote, add the delimit slashes. if (quoted_is) { // If this is the first quote, then only a single delimit slash is needed. @@ -781,14 +775,14 @@ extern "C" { status = f_string_dynamic_increase(state.step_large, destination); if (F_status_is_error(status)) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } else { status = f_string_dynamic_increase_by(item_total, destination); if (F_status_is_error(status)) break; for (i = 0; i < item_total; ++i) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // for } } @@ -797,7 +791,7 @@ extern "C" { if (F_status_is_error(status)) break; for (i = 0; i < item_total; ++i) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // for break; @@ -821,7 +815,7 @@ extern "C" { if (F_status_is_error(status)) break; for (i = 0; i < item_total; ++i) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // for destination->string[destination->used++] = quote_char; @@ -829,7 +823,7 @@ extern "C" { break; } - // if any space is found after a quote after a slash, then this must be delimited and quoted. + // if any space is found after a quote after a slash, then this must be delimited and quote. status = f_fss_is_space(state, object, *range); if (F_status_is_error(status)) break; @@ -850,14 +844,14 @@ extern "C" { status = f_string_dynamic_increase(state.step_large, destination); if (F_status_is_error(status)) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } else { status = f_string_dynamic_increase_by(item_total, destination); if (F_status_is_error(status)) break; for (i = 0; i < item_total; ++i) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // for } } @@ -868,7 +862,7 @@ extern "C" { if (F_status_is_error(status)) break; for (i = 0; i < item_total; ++i) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // for destination->string[destination->used++] = quote_char; @@ -879,7 +873,7 @@ extern "C" { } else if (object_as && object.string[range->start] == f_fss_comment_s.string[0]) { - // Only the first slash needs to be escaped for a comment, and then only if not quoted. + // Only the first slash needs to be escaped for a comment, and then only if not quote. if (item_first == input_start) { commented = F_true; } @@ -888,7 +882,7 @@ extern "C" { if (F_status_is_error(status)) break; for (i = 0; i < item_total; ++i) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // for destination->string[destination->used++] = object.string[range->start++]; @@ -897,7 +891,7 @@ extern "C" { } else { - // If any space is found, then this must be quoted. + // If any space is found, then this must be quote. status = f_fss_is_space(state, object, *range); if (F_status_is_error(status)) break; @@ -918,7 +912,7 @@ extern "C" { // There is nothing to delimit, so all slashes should be printed as is. for (i = 0; i < item_total; ++i) { - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } // for status = f_string_dynamic_increase_by(width, destination); @@ -937,7 +931,7 @@ extern "C" { status = f_string_dynamic_increase(state.step_large, destination); if (F_status_is_error(status)) break; - destination->string[used_start + 1] = f_fss_delimit_slash_s.string[0]; + destination->string[used_start + 1] = f_fss_slash_s.string[0]; } status = f_fss_skip_past_delimit(state, object, range); @@ -963,7 +957,7 @@ extern "C" { continue; } - // If any space is found, then this must be quoted. + // If any space is found, then this must be quote. status = f_fss_is_space(state, object, *range); if (F_status_is_error(status)) break; @@ -978,7 +972,7 @@ extern "C" { status = f_string_dynamic_increase(state.step_large, destination); if (F_status_is_error(status)) break; - destination->string[destination->used++] = f_fss_delimit_slash_s.string[0]; + destination->string[destination->used++] = f_fss_slash_s.string[0]; } quoted_is = F_true; @@ -1000,7 +994,7 @@ extern "C" { break; } - else if (object.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { + else if (object.string[range->start] != f_fss_placeholder_s.string[0]) { if (!quoted_is) { status = f_fss_is_space(state, object, *range); if (F_status_is_error(status)) break; @@ -1055,7 +1049,7 @@ extern "C" { } } - if (object.string[i] != f_fss_delimit_placeholder_s.string[0]) break; + if (object.string[i] != f_fss_placeholder_s.string[0]) break; } // for // Only when followed by a space must the start quote be delimited. @@ -1080,13 +1074,13 @@ extern "C" { } } else { - destination->string[used_start + 1] = f_fss_delimit_placeholder_s.string[0]; + destination->string[used_start + 1] = f_fss_placeholder_s.string[0]; } } } } else if (commented) { - destination->string[used_start] = f_fss_delimit_slash_s.string[0]; + destination->string[used_start] = f_fss_slash_s.string[0]; } if (range->start > range->stop) { @@ -1098,16 +1092,16 @@ extern "C" { #endif // !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_) || !defined(_di_fl_fss_extended_object_write_) - f_status_t private_fl_fss_basic_write_object_trim(const f_fss_quote_t quoted, const f_array_length_t used_start, f_state_t state, f_string_dynamic_t * const destination) { + f_status_t private_fl_fss_basic_write_object_trim(const uint8_t quote, const f_array_length_t used_start, f_state_t state, f_string_dynamic_t * const destination) { f_status_t status = F_none; f_string_range_t destination_range = macro_f_string_range_t_initialize2(destination->used); f_array_length_t i = 0; uint8_t width = 0; - const f_char_t quote_char = quoted == f_fss_quote_type_double_e ? f_string_ascii_quote_double_s.string[0] : f_string_ascii_quote_single_s.string[0]; + const f_char_t quote_char = quote ? quote : f_string_ascii_quote_double_s.string[0]; - // If there are any spaces, then this will be quoted so find the first non-placeholder character. + // If there are any spaces, then this will be quote so find the first non-placeholder character. for (; destination_range.start < destination->used; ++destination_range.start) { if (state.interrupt) { @@ -1120,7 +1114,7 @@ extern "C" { } } - if (destination->string[destination_range.start] != f_fss_delimit_placeholder_s.string[0]) break; + if (destination->string[destination_range.start] != f_fss_placeholder_s.string[0]) break; } // for if (destination->string[destination_range.start] == quote_char) { @@ -1138,7 +1132,7 @@ extern "C" { } } - if (destination->string[destination_range.start] == f_fss_delimit_placeholder_s.string[0]) continue; + if (destination->string[destination_range.start] == f_fss_placeholder_s.string[0]) continue; status = f_fss_is_space(state, *destination, destination_range); @@ -1153,7 +1147,7 @@ extern "C" { width = macro_f_utf_byte_width(destination->string[destination_range.start]); for (i = 0; i < width; ++i) { - destination->string[destination_range.start + i] = f_fss_delimit_placeholder_s.string[0]; + destination->string[destination_range.start + i] = f_fss_placeholder_s.string[0]; } // for } // for @@ -1191,7 +1185,7 @@ extern "C" { } } - if (destination->string[destination_range.start] == f_fss_delimit_placeholder_s.string[0]) continue; + if (destination->string[destination_range.start] == f_fss_placeholder_s.string[0]) continue; status = f_fss_is_space(state, *destination, destination_range); @@ -1209,7 +1203,7 @@ extern "C" { width = macro_f_utf_byte_width(destination->string[destination_range.start]); for (i = 0; i < width; ++i) { - destination->string[destination_range.start + i] = f_fss_delimit_placeholder_s.string[0]; + destination->string[destination_range.start + i] = f_fss_placeholder_s.string[0]; } // for } // for @@ -1238,8 +1232,8 @@ extern "C" { } // for if (destination_range.start == rear) { - destination->string[front] = f_fss_delimit_placeholder_s.string[0]; - destination->string[rear] = f_fss_delimit_placeholder_s.string[0]; + destination->string[front] = f_fss_placeholder_s.string[0]; + destination->string[rear] = f_fss_placeholder_s.string[0]; } } diff --git a/level_1/fl_fss/c/private-fss.h b/level_1/fl_fss/c/private-fss.h index 203c053..8e743e6 100644 --- a/level_1/fl_fss/c/private-fss.h +++ b/level_1/fl_fss/c/private-fss.h @@ -111,8 +111,8 @@ extern "C" { * A start location past the stop location or buffer used means that the entire range was processed. * @param found * A set of all locations where a valid object was found. - * @param quoted - * This will store whether or not this object is quoted and what quote is in use. + * @param quote + * This will store the quote character to use (if value is 0, then there is not quote). * Set pointer address to 0 to not use. * @param delimits * An array of delimits detected during processing. @@ -154,7 +154,7 @@ extern "C" { * @see fl_fss_extended_content_read() */ #if !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) || !defined(_di_fl_fss_extended_content_read_) - extern f_status_t private_fl_fss_basic_read(const f_string_static_t buffer, const bool object_as, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, f_fss_quote_t * const quoted, f_fss_delimits_t * const delimits) F_attribute_visibility_internal_d; + extern f_status_t private_fl_fss_basic_read(const f_string_static_t buffer, const bool object_as, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, uint8_t * const quote, f_fss_delimits_t * const delimits) F_attribute_visibility_internal_d; #endif // !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) || !defined(_di_fl_fss_extended_content_read_) /** @@ -172,9 +172,9 @@ extern "C" { * As Content, this does nothing special in regards to a leading '#'. * @param object * The string to write as (does not stop at NULLS, they are ignored and not written). - * @param quoted - * If 0, then double quotes are auto-inserted, if needed. - * Otherwise, this is the type of quote to wrap the object in when writing. + * @param quote + * If 0, then double quotes are auto-inserted, when required. + * Otherwise, this is quote character to wrap the object in when writing. * @param state * A state for providing flags and handling interrupts during long running operations. * There is no print_error(). @@ -218,15 +218,15 @@ extern "C" { * @see fl_fss_extended_content_write() */ #if !defined(fl_fss_basic_object_write) || !defined(fl_fss_extended_object_write) || !defined(_di_fl_fss_extended_content_write_) - extern f_status_t private_fl_fss_basic_write(const bool object_as, const f_string_static_t object, const f_fss_quote_t quoted, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d; + extern f_status_t private_fl_fss_basic_write(const bool object_as, const f_string_static_t object, const uint8_t quote, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d; #endif // !defined(fl_fss_basic_object_write) || !defined(fl_fss_extended_object_write) || !defined(_di_fl_fss_extended_content_write_) /** * Trim a given object used by the basic and extended object write functions. * - * @param quoted + * @param quote * If 0, then double quotes are auto-inserted, when required. - * Otherwise, this is the type of quote to wrap the object in when writing. + * Otherwise, this is quote character to wrap the object in when writing. * @param used_start * The destination.used value before any operations were perfomed. * @param state @@ -253,7 +253,7 @@ extern "C" { * @see fl_fss_extended_object_write() */ #if !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_extended_object_write_) - extern f_status_t private_fl_fss_basic_write_object_trim(const f_fss_quote_t quoted, const f_array_length_t used_start, f_state_t state, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d; + extern f_status_t private_fl_fss_basic_write_object_trim(const uint8_t quote, const f_array_length_t used_start, f_state_t state, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d; #endif // !defined(_di_fl_fss_basic_object_write_) || !defined(_di_fl_fss_extended_object_write_) #ifdef __cplusplus diff --git a/level_2/fll_fss/c/fss/basic.c b/level_2/fll_fss/c/fss/basic.c index 8b9b495..6c19c67 100644 --- a/level_2/fll_fss/c/fss/basic.c +++ b/level_2/fll_fss/c/fss/basic.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fll_fss_basic_read_ - f_status_t fll_fss_basic_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_objects_t * const objects, f_fss_contents_t * const contents, f_fss_quotes_t * const objects_quoted, f_fss_delimits_t * const objects_delimits, f_fss_delimits_t * const contents_delimits) { + f_status_t fll_fss_basic_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_objects_t * const objects, f_fss_contents_t * const contents, f_uint8s_t * const objects_quoted, f_fss_delimits_t * const objects_delimits, f_fss_delimits_t * const contents_delimits) { #ifndef _di_level_2_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!objects) return F_status_set_error(F_parameter); @@ -19,7 +19,7 @@ extern "C" { bool found_data = F_false; - f_fss_quote_t *quoted_object = 0; + uint8_t *quoted_object = 0; do { status = f_string_ranges_increase(state.step_small, objects); @@ -157,7 +157,7 @@ extern "C" { #endif // _di_fll_fss_basic_read_ #ifndef _di_fll_fss_basic_write_ - f_status_t fll_fss_basic_write(const f_string_static_t object, const f_string_static_t content, const f_fss_quote_t quote, f_state_t state, f_string_dynamic_t * const destination) { + f_status_t fll_fss_basic_write(const f_string_static_t object, const f_string_static_t content, const uint8_t quote, f_state_t state, f_string_dynamic_t * const destination) { #ifndef _di_level_2_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ diff --git a/level_2/fll_fss/c/fss/basic.h b/level_2/fll_fss/c/fss/basic.h index 95e2e2d..6940b43 100644 --- a/level_2/fll_fss/c/fss/basic.h +++ b/level_2/fll_fss/c/fss/basic.h @@ -82,7 +82,7 @@ extern "C" { * @see fl_fss_basic_object_read() */ #ifndef _di_fll_fss_basic_read_ - extern f_status_t fll_fss_basic_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_objects_t * const objects, f_fss_contents_t * const contents, f_fss_quotes_t * const objects_quoted, f_fss_delimits_t * const objects_delimits, f_fss_delimits_t * const contents_delimits); + extern f_status_t fll_fss_basic_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_objects_t * const objects, f_fss_contents_t * const contents, f_uint8s_t * const objects_quoted, f_fss_delimits_t * const objects_delimits, f_fss_delimits_t * const contents_delimits); #endif // _di_fll_fss_basic_read_ /** @@ -94,7 +94,7 @@ extern "C" { * A string representing the content. * @param quote * If 0, then double quotes are auto-inserted, when required. - * Otherwise, this is the type of quote to wrap the object in when writing. + * Otherwise, this is quote character to wrap the object in when writing. * @param state A state for providing flags and handling interrupts during long running operations. * There is no print_error(). @@ -125,7 +125,7 @@ extern "C" { * @see fl_fss_basic_object_write() */ #ifndef _di_fll_fss_basic_write_ - extern f_status_t fll_fss_basic_write(const f_string_static_t object, const f_string_static_t content, const f_fss_quote_t quote, f_state_t state, f_string_dynamic_t * const destination); + extern f_status_t fll_fss_basic_write(const f_string_static_t object, const f_string_static_t content, const uint8_t quote, f_state_t state, f_string_dynamic_t * const destination); #endif // _di_fll_fss_basic_write_ #ifdef __cplusplus diff --git a/level_2/fll_fss/c/fss/extended.c b/level_2/fll_fss/c/fss/extended.c index 309f614..d73d6bb 100644 --- a/level_2/fll_fss/c/fss/extended.c +++ b/level_2/fll_fss/c/fss/extended.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fll_fss_extended_read_ - f_status_t fll_fss_extended_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_objects_t * const objects, f_fss_contents_t * const contents, f_fss_quotes_t * const objects_quoted, f_fss_quotess_t * const contents_quoted, f_fss_delimits_t * const objects_delimits, f_fss_delimits_t * const contents_delimits) { + f_status_t fll_fss_extended_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_objects_t * const objects, f_fss_contents_t * const contents, f_uint8s_t * const objects_quoted, f_uint8ss_t * const contents_quoted, f_fss_delimits_t * const objects_delimits, f_fss_delimits_t * const contents_delimits) { #ifndef _di_level_2_parameter_checking_ if (!range) return F_status_set_error(F_parameter); if (!objects) return F_status_set_error(F_parameter); @@ -19,8 +19,8 @@ extern "C" { bool found_data = F_false; - f_fss_quote_t *quoted_object = 0; - f_fss_quotes_t *quoted_content = 0; + uint8_t *quoted_object = 0; + f_uint8s_t *quoted_content = 0; do { status = f_string_ranges_increase(state.step_small, objects); @@ -198,7 +198,7 @@ extern "C" { #endif // _di_fll_fss_extended_read_ #ifndef _di_fll_fss_extended_write_ - f_status_t fll_fss_extended_write(const f_string_static_t object, const f_string_statics_t contents, const f_fss_quote_t quote, f_state_t state, f_string_dynamic_t * const destination) { + f_status_t fll_fss_extended_write(const f_string_static_t object, const f_string_statics_t contents, const uint8_t quote, f_state_t state, f_string_dynamic_t * const destination) { #ifndef _di_level_2_parameter_checking_ if (!destination) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ diff --git a/level_2/fll_fss/c/fss/extended.h b/level_2/fll_fss/c/fss/extended.h index 879b57e..e03224e 100644 --- a/level_2/fll_fss/c/fss/extended.h +++ b/level_2/fll_fss/c/fss/extended.h @@ -84,7 +84,7 @@ extern "C" { * @see fl_fss_extended_object_read() */ #ifndef _di_fll_fss_extended_read_ - extern f_status_t fll_fss_extended_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_objects_t * const objects, f_fss_contents_t * const contents, f_fss_quotes_t * const objects_quoted, f_fss_quotess_t * const contents_quoted, f_fss_delimits_t * const objects_delimits, f_fss_delimits_t * const contents_delimits); + extern f_status_t fll_fss_extended_read(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_objects_t * const objects, f_fss_contents_t * const contents, f_uint8s_t * const objects_quoted, f_uint8ss_t * const contents_quoted, f_fss_delimits_t * const objects_delimits, f_fss_delimits_t * const contents_delimits); #endif // _di_fll_fss_extended_read_ /** @@ -96,7 +96,7 @@ extern "C" { * An array of strings representing multiple content to write. * @param quote * If 0, then double quotes are auto-inserted, when required. - * Otherwise, this is the type of quote to wrap the object in when writing. + * Otherwise, this is quote character to wrap the object in when writing. * @param state A state for providing flags and handling interrupts during long running operations. * There is no print_error(). @@ -127,7 +127,7 @@ extern "C" { * @see fl_fss_extended_object_write() */ #ifndef _di_fll_fss_extended_write_ - extern f_status_t fll_fss_extended_write(const f_string_static_t object, const f_string_statics_t contents, const f_fss_quote_t quote, f_state_t state, f_string_dynamic_t * const destination); + extern f_status_t fll_fss_extended_write(const f_string_static_t object, const f_string_statics_t contents, const uint8_t quote, f_state_t state, f_string_dynamic_t * const destination); #endif // _di_fll_fss_extended_write_ #ifdef __cplusplus diff --git a/level_3/fake/c/private-make-operate.c b/level_3/fake/c/private-make-operate.c index e4abe5b..ff28938 100644 --- a/level_3/fake/c/private-make-operate.c +++ b/level_3/fake/c/private-make-operate.c @@ -163,7 +163,7 @@ extern "C" { #endif // _di_fake_make_operate_ #ifndef _di_fake_make_operate_expand_ - void fake_make_operate_expand(fake_make_data_t * const data_make, const f_string_range_t section_name, const f_fss_content_t content, const f_fss_quotes_t quotes, f_status_t * const status) { + void fake_make_operate_expand(fake_make_data_t * const data_make, const f_string_range_t section_name, const f_fss_content_t content, const f_uint8s_t quotes, f_status_t * const status) { if (F_status_is_error(*status)) return; if (!content.used) return; @@ -723,7 +723,7 @@ extern "C" { #endif // _di_fake_make_operate_expand_ #ifndef _di_fake_make_operate_expand_build_ - f_status_t fake_make_operate_expand_build(fake_make_data_t * const data_make, const f_fss_quote_t quoted, const f_string_range_t range_name) { + f_status_t fake_make_operate_expand_build(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { f_status_t status = F_none; f_string_dynamic_t value = f_string_dynamic_t_initialize; @@ -1001,7 +1001,7 @@ extern "C" { return F_false; } - if (quoted) { + if (quote) { status = f_string_dynamic_append_nulless(value, &data_make->cache_arguments.array[data_make->cache_arguments.used]); } else { @@ -1025,7 +1025,7 @@ extern "C" { #endif // _di_fake_make_operate_expand_build_ #ifndef _di_fake_make_operate_expand_context_ - f_status_t fake_make_operate_expand_context(fake_make_data_t * const data_make, const f_fss_quote_t quoted, const f_string_range_t range_name) { + f_status_t fake_make_operate_expand_context(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { f_status_t status = F_none; const f_string_static_t *context = 0; @@ -1064,7 +1064,7 @@ extern "C" { } // for if (context) { - if (quoted) { + if (quote) { status = f_string_dynamic_append_nulless(*context, &data_make->cache_arguments.array[data_make->cache_arguments.used]); } else { @@ -1087,7 +1087,7 @@ extern "C" { #endif // _di_fake_make_operate_expand_context_ #ifndef _di_fake_make_operate_expand_environment_ - f_status_t fake_make_operate_expand_environment(fake_make_data_t * const data_make, const f_fss_quote_t quoted, const f_string_range_t range_name) { + f_status_t fake_make_operate_expand_environment(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { f_status_t status = F_none; @@ -1119,7 +1119,7 @@ extern "C" { if (F_status_is_error(status)) return status; - if (!quoted) { + if (!quote) { ++data_make->cache_arguments.used; } diff --git a/level_3/fake/c/private-make-operate.h b/level_3/fake/c/private-make-operate.h index 755b416..177c038 100644 --- a/level_3/fake/c/private-make-operate.h +++ b/level_3/fake/c/private-make-operate.h @@ -44,15 +44,15 @@ extern "C" { * The section name. * @param content * The content array. - * @param quoteds - * The array of quoted associated with the content. + * @param quotes + * The array of quotes associated with the content. * @param status * The return status. * * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_expand_ - extern void fake_make_operate_expand(fake_make_data_t * const data_make, const f_string_range_t section_name, const f_fss_content_t content, const f_fss_quotes_t quoteds, f_status_t * const status) F_attribute_visibility_internal_d; + extern void fake_make_operate_expand(fake_make_data_t * const data_make, const f_string_range_t section_name, const f_fss_content_t content, const f_uint8s_t quotes, f_status_t * const status) F_attribute_visibility_internal_d; #endif // _di_fake_make_operate_expand_ /** @@ -62,8 +62,8 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. - * @param quoted - * The quoted associated with the content. + * @param quote + * The quote associated with the content. * @param range_name * The range representing the variable content name string within the data_make->buffer. * @@ -74,7 +74,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_expand_context_ - extern f_status_t fake_make_operate_expand_context(fake_make_data_t * const data_make, const f_fss_quote_t quoted, const f_string_range_t range_name) F_attribute_visibility_internal_d; + extern f_status_t fake_make_operate_expand_context(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) F_attribute_visibility_internal_d; #endif // _di_fake_make_operate_expand_context_ /** @@ -82,8 +82,8 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. - * @param quoted - * The quoted associated with the content. + * @param quote + * The quote associated with the content. * @param range_name * The range representing the variable content name string within the data_make->buffer. * @@ -102,7 +102,7 @@ extern "C" { * @see f_string_dynamics_increase() */ #ifndef _di_fake_make_operate_expand_environment_ - extern f_status_t fake_make_operate_expand_environment(fake_make_data_t * const data_make, const f_fss_quote_t quoted, const f_string_range_t range_name) F_attribute_visibility_internal_d; + extern f_status_t fake_make_operate_expand_environment(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) F_attribute_visibility_internal_d; #endif // _di_fake_make_operate_expand_environment_ /** @@ -110,8 +110,8 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. - * @param quoted - * The quoted associated with the content. + * @param quote + * The quote associated with the content. * @param range_name * The range representing the variable content name string within the data_make->buffer. * @@ -122,7 +122,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_expand_build_ - extern f_status_t fake_make_operate_expand_build(fake_make_data_t * const data_make, const f_fss_quote_t quoted, const f_string_range_t range_name) F_attribute_visibility_internal_d; + extern f_status_t fake_make_operate_expand_build(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) F_attribute_visibility_internal_d; #endif // _di_fake_make_operate_expand_build_ /** diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 6b54c5a..fc77c09 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -886,7 +886,7 @@ f_status_t firewall_create_custom_chains(firewall_data_t * const data, firewall_ // Copy the string character by character, ignoring placeholders. for (j = local->chain_objects.array[i].start; j <= local->chain_objects.array[i].stop; ++j) { - if (local->buffer.string[j] == f_fss_delimit_placeholder_s.string[0]) continue; + if (local->buffer.string[j] == f_fss_placeholder_s.string[0]) continue; data->chains.array[data->chains.used].string[data->chains.array[data->chains.used].used++] = local->buffer.string[j]; arguments.array[1].string[arguments.array[1].used++] = local->buffer.string[j]; diff --git a/level_3/fss_basic_list_read/c/private-common.h b/level_3/fss_basic_list_read/c/private-common.h index 7e94adb..5f159ee 100644 --- a/level_3/fss_basic_list_read/c/private-common.h +++ b/level_3/fss_basic_list_read/c/private-common.h @@ -194,7 +194,7 @@ extern "C" { f_fss_delimits_t delimits_object; f_fss_delimits_t delimits_content; f_fss_comments_t comments; - f_fss_quotes_t quotes; + f_uint8s_t quotes; } fss_basic_list_read_data_t; #define fss_basic_list_read_data_t_initialize \ @@ -212,7 +212,7 @@ extern "C" { f_fss_contents_t_initialize, \ f_fss_delimits_t_initialize, \ f_fss_delimits_t_initialize, \ - f_fss_quotes_t_initialize, \ + f_uint8s_t_initialize, \ f_fss_comments_t_initialize, \ } #endif // _di_fss_basic_list_read_data_t_ diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.c b/level_3/fss_basic_list_write/c/fss_basic_list_write.c index c14fff1..39f1c99 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.c @@ -319,18 +319,18 @@ extern "C" { } } - f_fss_quote_t quoted = f_fss_quote_type_double_e; + uint8_t quote = f_fss_quote_double_s; if (F_status_is_error_not(status)) { if (main->parameters.array[fss_basic_list_write_parameter_double_e].result & f_console_result_found_e) { if (main->parameters.array[fss_basic_list_write_parameter_single_e].result & f_console_result_found_e) { if (main->parameters.array[fss_basic_list_write_parameter_double_e].location < main->parameters.array[fss_basic_list_write_parameter_single_e].location) { - quoted = f_fss_quote_type_single_e; + quote = f_fss_quote_single_s; } } } else if (main->parameters.array[fss_basic_list_write_parameter_single_e].result & f_console_result_found_e) { - quoted = f_fss_quote_type_single_e; + quote = f_fss_quote_single_s; } } @@ -338,7 +338,7 @@ extern "C" { if (F_status_is_error_not(status)) { if (main->pipe & fll_program_data_pipe_input_e) { - status = fss_basic_list_write_process_pipe(main, output, quoted, &buffer); + status = fss_basic_list_write_process_pipe(main, output, quote, &buffer); if (F_status_is_error(status)) { if (main->error.verbosity > f_console_verbosity_quiet_e) { @@ -373,7 +373,7 @@ extern "C" { index = main->parameters.array[fss_basic_list_write_parameter_object_e].values.array[i]; - status = fss_basic_list_write_process(main, output, quoted, &argv[index], 0, &buffer); + status = fss_basic_list_write_process(main, output, quote, &argv[index], 0, &buffer); if (F_status_is_error(status)) break; } // for } @@ -394,7 +394,7 @@ extern "C" { index = main->parameters.array[fss_basic_list_write_parameter_content_e].values.array[i]; - status = fss_basic_list_write_process(main, output, quoted, 0, &argv[index], &buffer); + status = fss_basic_list_write_process(main, output, quote, 0, &argv[index], &buffer); if (F_status_is_error(status)) break; } // for } @@ -416,7 +416,7 @@ extern "C" { index = main->parameters.array[fss_basic_list_write_parameter_object_e].values.array[i]; - status = fss_basic_list_write_process(main, output, quoted, &argv[index], &argv[main->parameters.array[fss_basic_list_write_parameter_content_e].values.array[i]], &buffer); + status = fss_basic_list_write_process(main, output, quote, &argv[index], &argv[main->parameters.array[fss_basic_list_write_parameter_content_e].values.array[i]], &buffer); if (F_status_is_error(status)) break; } // for } diff --git a/level_3/fss_basic_list_write/c/private-write.c b/level_3/fss_basic_list_write/c/private-write.c index 9371235..c644739 100644 --- a/level_3/fss_basic_list_write/c/private-write.c +++ b/level_3/fss_basic_list_write/c/private-write.c @@ -58,7 +58,7 @@ extern "C" { #endif // _di_fss_basic_list_write_error_parameter_value_missing_print_ #ifndef _di_fss_basic_list_write_process_ - f_status_t fss_basic_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t * const buffer) { + f_status_t fss_basic_list_write_process(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t * const buffer) { f_status_t status = F_none; f_state_t state = macro_f_state_t_initialize(fss_basic_list_write_common_allocation_large_d, fss_basic_list_write_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0); @@ -140,7 +140,7 @@ extern "C" { #endif // _di_fss_basic_list_write_process_ #ifndef _di_fss_basic_list_write_process_pipe_ - f_status_t fss_basic_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t * const buffer) { + f_status_t fss_basic_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, f_string_dynamic_t * const buffer) { f_status_t status = F_none; f_status_t status_pipe = F_none; diff --git a/level_3/fss_basic_list_write/c/private-write.h b/level_3/fss_basic_list_write/c/private-write.h index 16ba393..3d55a87 100644 --- a/level_3/fss_basic_list_write/c/private-write.h +++ b/level_3/fss_basic_list_write/c/private-write.h @@ -70,7 +70,7 @@ extern "C" { * F_failure (with error bit) for any other failure. */ #ifndef _di_fss_basic_list_write_process_ - extern f_status_t fss_basic_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t * const buffer) F_attribute_visibility_internal_d; + extern f_status_t fss_basic_list_write_process(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t * const buffer) F_attribute_visibility_internal_d; #endif // _di_fss_basic_list_write_process_ /** @@ -91,7 +91,7 @@ extern "C" { * F_failure (with error bit) for any other failure. */ #ifndef _di_fss_basic_list_write_process_pipe_ - extern f_status_t fss_basic_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t * const buffer) F_attribute_visibility_internal_d; + extern f_status_t fss_basic_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, f_string_dynamic_t * const buffer) F_attribute_visibility_internal_d; #endif // _di_fss_basic_list_write_process_pipe_ #ifdef __cplusplus diff --git a/level_3/fss_basic_read/c/private-common.c b/level_3/fss_basic_read/c/private-common.c index 0bfe454..8cec401 100644 --- a/level_3/fss_basic_read/c/private-common.c +++ b/level_3/fss_basic_read/c/private-common.c @@ -18,7 +18,7 @@ extern "C" { macro_f_fss_contents_t_delete_simple(data->contents); macro_f_fss_objects_t_delete_simple(data->objects); macro_f_fss_delimits_t_delete_simple(data->delimits); - macro_f_fss_quotes_t_delete_simple(data->quotes); + macro_f_uint8s_t_delete_simple(data->quotes); } #endif // _di_fss_basic_read_data_delete_simple_ diff --git a/level_3/fss_basic_read/c/private-common.h b/level_3/fss_basic_read/c/private-common.h index 4f8b126..7c9cfe7 100644 --- a/level_3/fss_basic_read/c/private-common.h +++ b/level_3/fss_basic_read/c/private-common.h @@ -191,7 +191,7 @@ extern "C" { f_fss_objects_t objects; f_fss_contents_t contents; f_fss_delimits_t delimits; - f_fss_quotes_t quotes; + f_uint8s_t quotes; } fss_basic_read_data_t; #define fss_basic_read_data_t_initialize \ @@ -208,7 +208,7 @@ extern "C" { f_fss_objects_t_initialize, \ f_fss_contents_t_initialize, \ f_fss_delimits_t_initialize, \ - f_fss_quotes_t_initialize, \ + f_uint8s_t_initialize, \ } #endif // _di_fss_basic_read_data_t_ diff --git a/level_3/fss_basic_read/c/private-print.c b/level_3/fss_basic_read/c/private-print.c index c2836c8..1704ae3 100644 --- a/level_3/fss_basic_read/c/private-print.c +++ b/level_3/fss_basic_read/c/private-print.c @@ -20,13 +20,27 @@ extern "C" { if (data->option & fss_basic_read_data_option_trim_d) { if (data->option & fss_basic_read_data_option_original_d) { if (data->quotes.array[at]) { - f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } fl_print_trim_dynamic_partial(data->buffer, data->objects.array[at], main->output.to); if (data->quotes.array[at]) { - f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } } else { @@ -36,13 +50,27 @@ extern "C" { else { if (data->option & fss_basic_read_data_option_original_d) { if (data->quotes.array[at]) { - f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } f_print_dynamic_partial(data->buffer, data->objects.array[at], main->output.to); if (data->quotes.array[at]) { - f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } } else { diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index b3c53e2..b112b3f 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -318,18 +318,18 @@ extern "C" { } } - f_fss_quote_t quote = f_fss_quote_type_double_e; + uint8_t quote = f_fss_quote_double_s; if (F_status_is_error_not(status)) { if (main->parameters.array[fss_basic_write_parameter_double_e].result & f_console_result_found_e) { if (main->parameters.array[fss_basic_write_parameter_single_e].result & f_console_result_found_e) { if (main->parameters.array[fss_basic_write_parameter_double_e].location < main->parameters.array[fss_basic_write_parameter_single_e].location) { - quote = f_fss_quote_type_single_e; + quote = f_fss_quote_single_s; } } } else if (main->parameters.array[fss_basic_write_parameter_single_e].result & f_console_result_found_e) { - quote = f_fss_quote_type_single_e; + quote = f_fss_quote_single_s; } } diff --git a/level_3/fss_basic_write/c/private-write.c b/level_3/fss_basic_write/c/private-write.c index 1bc27cc..254617f 100644 --- a/level_3/fss_basic_write/c/private-write.c +++ b/level_3/fss_basic_write/c/private-write.c @@ -58,7 +58,7 @@ extern "C" { #endif // _di_fss_basic_write_error_parameter_unsupported_eol_print_ #ifndef _di_fss_basic_write_process_ - f_status_t fss_basic_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) { + f_status_t fss_basic_write_process(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) { f_status_t status = F_none; f_state_t state = macro_f_state_t_initialize(fss_basic_write_common_allocation_large_d, fss_basic_write_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0); @@ -144,7 +144,7 @@ extern "C" { #endif // _di_fss_basic_write_process_ #ifndef _di_fss_basic_write_process_pipe_ - f_status_t fss_basic_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) { + f_status_t fss_basic_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, f_string_dynamic_t *buffer) { f_status_t status = F_none; f_status_t status_pipe = F_none; diff --git a/level_3/fss_basic_write/c/private-write.h b/level_3/fss_basic_write/c/private-write.h index e596537..899344b 100644 --- a/level_3/fss_basic_write/c/private-write.h +++ b/level_3/fss_basic_write/c/private-write.h @@ -70,7 +70,7 @@ extern "C" { * F_failure (with error bit) for any other failure. */ #ifndef _di_fss_basic_write_process_ - extern f_status_t fss_basic_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; + extern f_status_t fss_basic_write_process(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; #endif // _di_fss_basic_write_process_ /** @@ -91,7 +91,7 @@ extern "C" { * F_failure (with error bit) for any other failure. */ #ifndef _di_fss_basic_write_process_pipe_ - extern f_status_t fss_basic_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; + extern f_status_t fss_basic_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; #endif // _di_fss_basic_write_process_pipe_ #ifdef __cplusplus diff --git a/level_3/fss_embedded_list_read/c/private-read.c b/level_3/fss_embedded_list_read/c/private-read.c index 8df02bd..61e86cb 100644 --- a/level_3/fss_embedded_list_read/c/private-read.c +++ b/level_3/fss_embedded_list_read/c/private-read.c @@ -279,7 +279,7 @@ extern "C" { for (; i < comments->used; ++i) { for (j = comments->array[i].start; j <= comments->array[i].stop; ++j) { - data->buffer.string[j] = f_fss_delimit_placeholder_s.string[0]; + data->buffer.string[j] = f_fss_placeholder_s.string[0]; } // for } // for } diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c index 494ffb9..942d2e4 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c @@ -319,18 +319,18 @@ extern "C" { } } - f_fss_quote_t quote = f_fss_quote_type_double_e; + uint8_t quote = f_fss_quote_double_s; if (F_status_is_error_not(status)) { if (main->parameters.array[fss_embedded_list_write_parameter_double_e].result & f_console_result_found_e) { if (main->parameters.array[fss_embedded_list_write_parameter_single_e].result & f_console_result_found_e) { if (main->parameters.array[fss_embedded_list_write_parameter_double_e].location < main->parameters.array[fss_embedded_list_write_parameter_single_e].location) { - quote = f_fss_quote_type_single_e; + quote = f_fss_quote_single_s; } } } else if (main->parameters.array[fss_embedded_list_write_parameter_single_e].result & f_console_result_found_e) { - quote = f_fss_quote_type_single_e; + quote = f_fss_quote_single_s; } } diff --git a/level_3/fss_embedded_list_write/c/private-write.c b/level_3/fss_embedded_list_write/c/private-write.c index d4bc709..77f40b7 100644 --- a/level_3/fss_embedded_list_write/c/private-write.c +++ b/level_3/fss_embedded_list_write/c/private-write.c @@ -64,7 +64,7 @@ extern "C" { #endif // _di_fss_embedded_list_write_error_parameter_value_missing_print_ #ifndef _di_fss_embedded_list_write_process_ - f_status_t fss_embedded_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) { + f_status_t fss_embedded_list_write_process(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) { f_status_t status = F_none; f_state_t state = macro_f_state_t_initialize(fss_embedded_list_write_common_allocation_large_d, fss_embedded_list_write_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0); @@ -146,7 +146,7 @@ extern "C" { #endif // _di_fss_embedded_list_write_process_ #ifndef _di_fss_embedded_list_write_process_pipe_ - f_status_t fss_embedded_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) { + f_status_t fss_embedded_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) { f_status_t status = F_none; f_status_t status_pipe = F_none; diff --git a/level_3/fss_embedded_list_write/c/private-write.h b/level_3/fss_embedded_list_write/c/private-write.h index a54549b..bba97f7 100644 --- a/level_3/fss_embedded_list_write/c/private-write.h +++ b/level_3/fss_embedded_list_write/c/private-write.h @@ -73,7 +73,7 @@ extern "C" { * F_failure (with error bit) for any other failure. */ #ifndef _di_fss_embedded_list_write_process_ - extern f_status_t fss_embedded_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; + extern f_status_t fss_embedded_list_write_process(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; #endif // _di_fss_embedded_list_write_process_ /** @@ -97,7 +97,7 @@ extern "C" { * F_failure (with error bit) for any other failure. */ #ifndef _di_fss_embedded_list_write_process_pipe_ - extern f_status_t fss_embedded_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) F_attribute_visibility_internal_d; + extern f_status_t fss_embedded_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) F_attribute_visibility_internal_d; #endif // _di_fss_embedded_list_write_process_pipe_ /** diff --git a/level_3/fss_extended_list_read/c/private-common.h b/level_3/fss_extended_list_read/c/private-common.h index 8bd3c49..1078cd3 100644 --- a/level_3/fss_extended_list_read/c/private-common.h +++ b/level_3/fss_extended_list_read/c/private-common.h @@ -194,7 +194,7 @@ extern "C" { f_fss_contents_t contents; f_fss_delimits_t delimits_object; f_fss_delimits_t delimits_content; - f_fss_quotes_t quotes; + f_uint8s_t quotes; f_fss_comments_t comments; } fss_extended_list_read_data_t; @@ -213,7 +213,7 @@ extern "C" { f_fss_contents_t_initialize, \ f_fss_delimits_t_initialize, \ f_fss_delimits_t_initialize, \ - f_fss_quotes_t_initialize, \ + f_uint8s_t_initialize, \ f_fss_comments_t_initialize, \ } #endif // _di_fss_extended_list_read_data_t_ diff --git a/level_3/fss_extended_list_read/c/private-read.c b/level_3/fss_extended_list_read/c/private-read.c index da9a4c2..d5a6b2e 100644 --- a/level_3/fss_extended_list_read/c/private-read.c +++ b/level_3/fss_extended_list_read/c/private-read.c @@ -430,7 +430,7 @@ extern "C" { while (k >= data->contents.array[i].array[0].start) { - if (data->buffer.string[k] == f_fss_delimit_placeholder_s.string[0]) { + if (data->buffer.string[k] == f_fss_placeholder_s.string[0]) { --k; continue; diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.c b/level_3/fss_extended_list_write/c/fss_extended_list_write.c index 7cc336c..3d0823e 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.c @@ -318,18 +318,18 @@ extern "C" { } } - f_fss_quote_t quote = f_fss_quote_type_double_e; + uint8_t quote = f_fss_quote_double_s; if (F_status_is_error_not(status)) { if (main->parameters.array[fss_extended_list_write_parameter_double_e].result & f_console_result_found_e) { if (main->parameters.array[fss_extended_list_write_parameter_single_e].result & f_console_result_found_e) { if (main->parameters.array[fss_extended_list_write_parameter_double_e].location < main->parameters.array[fss_extended_list_write_parameter_single_e].location) { - quote = f_fss_quote_type_single_e; + quote = f_fss_quote_single_s; } } } else if (main->parameters.array[fss_extended_list_write_parameter_single_e].result & f_console_result_found_e) { - quote = f_fss_quote_type_single_e; + quote = f_fss_quote_single_s; } } diff --git a/level_3/fss_extended_list_write/c/private-write.c b/level_3/fss_extended_list_write/c/private-write.c index 3b3b40e..9e0bd5f 100644 --- a/level_3/fss_extended_list_write/c/private-write.c +++ b/level_3/fss_extended_list_write/c/private-write.c @@ -58,7 +58,7 @@ extern "C" { #endif // _di_fss_extended_list_write_error_parameter_value_missing_print_ #ifndef _di_fss_extended_list_write_process_ - f_status_t fss_extended_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) { + f_status_t fss_extended_list_write_process(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) { f_status_t status = F_none; f_state_t state = macro_f_state_t_initialize(fss_extended_list_write_common_allocation_large_d, fss_extended_list_write_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0); @@ -140,7 +140,7 @@ extern "C" { #endif // _di_fss_extended_list_write_process_ #ifndef _di_fss_extended_list_write_process_pipe_ - f_status_t fss_extended_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) { + f_status_t fss_extended_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) { f_status_t status = F_none; f_status_t status_pipe = F_none; diff --git a/level_3/fss_extended_list_write/c/private-write.h b/level_3/fss_extended_list_write/c/private-write.h index 39cdf64..23616a9 100644 --- a/level_3/fss_extended_list_write/c/private-write.h +++ b/level_3/fss_extended_list_write/c/private-write.h @@ -73,7 +73,7 @@ extern "C" { * F_failure (with error bit) for any other failure. */ #ifndef _di_fss_extended_list_write_process_ - extern f_status_t fss_extended_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; + extern f_status_t fss_extended_list_write_process(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; #endif // _di_fss_extended_list_write_process_ /** @@ -97,7 +97,7 @@ extern "C" { * F_failure (with error bit) for any other failure. */ #ifndef _di_fss_extended_list_write_process_pipe_ - extern f_status_t fss_extended_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) F_attribute_visibility_internal_d; + extern f_status_t fss_extended_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) F_attribute_visibility_internal_d; #endif // _di_fss_extended_list_write_process_pipe_ /** diff --git a/level_3/fss_extended_read/c/private-common.c b/level_3/fss_extended_read/c/private-common.c index ac6911f..cd03488 100644 --- a/level_3/fss_extended_read/c/private-common.c +++ b/level_3/fss_extended_read/c/private-common.c @@ -19,8 +19,8 @@ extern "C" { macro_f_fss_objects_t_delete_simple(data->objects); macro_f_fss_delimits_t_delete_simple(data->delimits_object); macro_f_fss_delimits_t_delete_simple(data->delimits_content); - macro_f_fss_quotes_t_delete_simple(data->quotes_object); - macro_f_fss_quotess_t_delete_simple(data->quotes_content); + macro_f_uint8s_t_delete_simple(data->quotes_object); + macro_f_uint8ss_t_delete_simple(data->quotes_content); } #endif // _di_fss_extended_read_data_delete_simple_ diff --git a/level_3/fss_extended_read/c/private-common.h b/level_3/fss_extended_read/c/private-common.h index a25d201..3825736 100644 --- a/level_3/fss_extended_read/c/private-common.h +++ b/level_3/fss_extended_read/c/private-common.h @@ -193,8 +193,8 @@ extern "C" { f_fss_contents_t contents; f_fss_delimits_t delimits_object; f_fss_delimits_t delimits_content; - f_fss_quotes_t quotes_object; - f_fss_quotess_t quotes_content; + f_uint8s_t quotes_object; + f_uint8ss_t quotes_content; } fss_extended_read_data_t; #define fss_extended_read_data_t_initialize \ @@ -212,8 +212,8 @@ extern "C" { f_fss_contents_t_initialize, \ f_fss_delimits_t_initialize, \ f_fss_delimits_t_initialize, \ - f_fss_quotes_t_initialize, \ - f_fss_quotess_t_initialize, \ + f_uint8s_t_initialize, \ + f_uint8ss_t_initialize, \ } #endif // _di_fss_extended_read_data_t_ diff --git a/level_3/fss_extended_read/c/private-print.c b/level_3/fss_extended_read/c/private-print.c index c78d316..75eb6e5 100644 --- a/level_3/fss_extended_read/c/private-print.c +++ b/level_3/fss_extended_read/c/private-print.c @@ -20,24 +20,52 @@ extern "C" { if (data->option & fss_extended_read_data_option_object_d) { if (data->option & fss_extended_read_data_option_trim_d) { if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) { - f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_object.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to); if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) { - f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_object.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } } else { if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) { - f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_object.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to); if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) { - f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_object.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } } @@ -54,13 +82,26 @@ extern "C" { content_printed = F_true; if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[data->select]) { - f_print_dynamic_raw(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content.array[at].array[data->select] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[data->select], delimits_content, main->output.to); if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[data->select]) { - f_print_dynamic_raw(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content.array[at].array[data->select] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } } } @@ -74,13 +115,27 @@ extern "C" { content_printed = F_true; if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[i]) { - f_print_dynamic_raw(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content.array[at].array[i] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[i], delimits_content, main->output.to); if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[i]) { - f_print_dynamic_raw(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content.array[at].array[i] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } if (i + 1 < data->contents.array[at].used && data->contents.array[at].array[i + 1].start <= data->contents.array[at].array[i + 1].stop) { diff --git a/level_3/fss_extended_read/c/private-read.c b/level_3/fss_extended_read/c/private-read.c index cc4e942..79865e7 100644 --- a/level_3/fss_extended_read/c/private-read.c +++ b/level_3/fss_extended_read/c/private-read.c @@ -406,13 +406,27 @@ extern "C" { } else { if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) { - f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to); + f_print_dynamic_raw( + data->quotes_object.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } fss_extended_read_print_at(main, i, *delimits_object, *delimits_content, data); if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) { - f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to); + f_print_dynamic_raw( + data->quotes_object.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } } } @@ -426,13 +440,27 @@ extern "C" { } else { if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[i]) { - f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to); + f_print_dynamic_raw( + data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content.array[at].array[i] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } fss_extended_read_print_at(main, i, *delimits_object, *delimits_content, data); if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[i]) { - f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to); + f_print_dynamic_raw( + data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content.array[at].array[i] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } } diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index af035dc..1641a28 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -329,18 +329,18 @@ extern "C" { } } - f_fss_quote_t quote = f_fss_quote_type_double_e; + uint8_t quote = f_fss_quote_double_s; if (F_status_is_error_not(status)) { if (main->parameters.array[fss_extended_write_parameter_double_e].result & f_console_result_found_e) { if (main->parameters.array[fss_extended_write_parameter_single_e].result & f_console_result_found_e) { if (main->parameters.array[fss_extended_write_parameter_double_e].location < main->parameters.array[fss_extended_write_parameter_single_e].location) { - quote = f_fss_quote_type_single_e; + quote = f_fss_quote_single_s; } } } else if (main->parameters.array[fss_extended_write_parameter_single_e].result & f_console_result_found_e) { - quote = f_fss_quote_type_single_e; + quote = f_fss_quote_single_s; } } diff --git a/level_3/fss_extended_write/c/private-write.c b/level_3/fss_extended_write/c/private-write.c index 798e2d7..f25d96d 100644 --- a/level_3/fss_extended_write/c/private-write.c +++ b/level_3/fss_extended_write/c/private-write.c @@ -64,7 +64,7 @@ extern "C" { #endif // _di_fss_extended_write_error_parameter_unsupported_eol_print_ #ifndef _di_fss_extended_write_process_ - f_status_t fss_extended_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_statics_t *contents, f_string_dynamic_t *buffer) { + f_status_t fss_extended_write_process(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, const f_string_static_t *object, const f_string_statics_t *contents, f_string_dynamic_t *buffer) { f_status_t status = F_none; f_state_t state = macro_f_state_t_initialize(fss_extended_write_common_allocation_large_d, fss_extended_write_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0); @@ -154,7 +154,7 @@ extern "C" { #endif // _di_fss_extended_write_process_ #ifndef _di_fss_extended_write_process_pipe_ - f_status_t fss_extended_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) { + f_status_t fss_extended_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, f_string_dynamic_t *buffer) { f_status_t status = F_none; f_status_t status_pipe = F_none; diff --git a/level_3/fss_extended_write/c/private-write.h b/level_3/fss_extended_write/c/private-write.h index 883328e..e5ebb79 100644 --- a/level_3/fss_extended_write/c/private-write.h +++ b/level_3/fss_extended_write/c/private-write.h @@ -82,7 +82,7 @@ extern "C" { * F_failure (with error bit) for any other failure. */ #ifndef _di_fss_extended_write_process_ - extern f_status_t fss_extended_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_statics_t *contents, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; + extern f_status_t fss_extended_write_process(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, const f_string_static_t *object, const f_string_statics_t *contents, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; #endif // _di_fss_extended_write_process_ /** @@ -103,7 +103,7 @@ extern "C" { * F_failure (with error bit) for any other failure. */ #ifndef _di_fss_extended_write_process_pipe_ - extern f_status_t fss_extended_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; + extern f_status_t fss_extended_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const uint8_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d; #endif // _di_fss_extended_write_process_pipe_ #ifdef __cplusplus diff --git a/level_3/fss_payload_read/c/private-common.c b/level_3/fss_payload_read/c/private-common.c index 7ba3183..d82b1f9 100644 --- a/level_3/fss_payload_read/c/private-common.c +++ b/level_3/fss_payload_read/c/private-common.c @@ -19,8 +19,8 @@ extern "C" { macro_f_fss_contents_t_delete_simple(data->contents_header); macro_f_fss_objects_t_delete_simple(data->objects); macro_f_fss_objects_t_delete_simple(data->objects_header); - macro_f_fss_quotes_t_delete_simple(data->quotes_object_header); - macro_f_fss_quotess_t_delete_simple(data->quotes_content_header); + macro_f_uint8s_t_delete_simple(data->quotes_object_header); + macro_f_uint8ss_t_delete_simple(data->quotes_content_header); macro_f_fss_delimits_t_delete_simple(data->delimits_object); macro_f_fss_delimits_t_delete_simple(data->delimits_object_header); macro_f_fss_delimits_t_delete_simple(data->delimits_content); diff --git a/level_3/fss_payload_read/c/private-common.h b/level_3/fss_payload_read/c/private-common.h index e52f234..66d1ccd 100644 --- a/level_3/fss_payload_read/c/private-common.h +++ b/level_3/fss_payload_read/c/private-common.h @@ -200,14 +200,14 @@ extern "C" { f_fss_objects_t objects_header; f_fss_contents_t contents; f_fss_contents_t contents_header; - f_fss_quotes_t quotes_object_header; - f_fss_quotess_t quotes_content_header; + f_uint8s_t quotes_object_header; + f_uint8ss_t quotes_content_header; f_fss_delimits_t delimits_object; f_fss_delimits_t delimits_object_header; f_fss_delimits_t delimits_content; f_fss_delimits_t delimits_content_header; f_fss_comments_t comments; - f_fss_quotes_t quotes; + f_uint8s_t quotes; } fss_payload_read_data_t; #define fss_payload_read_data_t_initialize \ @@ -226,13 +226,13 @@ extern "C" { f_fss_objects_t_initialize, \ f_fss_contents_t_initialize, \ f_fss_contents_t_initialize, \ - f_fss_quotes_t_initialize, \ - f_fss_quotess_t_initialize, \ + f_uint8s_t_initialize, \ + f_uint8ss_t_initialize, \ f_fss_delimits_t_initialize, \ f_fss_delimits_t_initialize, \ f_fss_delimits_t_initialize, \ f_fss_delimits_t_initialize, \ - f_fss_quotes_t_initialize, \ + f_uint8s_t_initialize, \ f_fss_comments_t_initialize, \ } #endif // _di_fss_payload_read_data_t_ diff --git a/level_3/fss_payload_read/c/private-print.c b/level_3/fss_payload_read/c/private-print.c index 6f90110..adb201e 100644 --- a/level_3/fss_payload_read/c/private-print.c +++ b/level_3/fss_payload_read/c/private-print.c @@ -68,24 +68,52 @@ extern "C" { if (data->option & fss_payload_read_data_option_object_d) { if (data->option & fss_payload_read_data_option_trim_d) { if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) { - f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_object_header.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object_header.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } fl_print_trim_except_dynamic_partial(data->buffer, data->objects_header.array[at], delimits_object, main->output.to); if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) { - f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_object_header.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object_header.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } } else { if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) { - f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_object_header.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object_header.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } f_print_except_dynamic_partial(data->buffer, data->objects_header.array[at], delimits_object, main->output.to); if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) { - f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_object_header.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object_header.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s, + : f_fss_quote_double_s, + main->output.to + ); } } @@ -102,13 +130,27 @@ extern "C" { content_printed = F_true; if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[data->select]) { - f_print_dynamic_raw(data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } f_print_except_dynamic_partial(data->buffer, data->contents_header.array[at].array[data->select], delimits_content, main->output.to); if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[data->select]) { - f_print_dynamic_raw(data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } } } @@ -122,13 +164,27 @@ extern "C" { content_printed = F_true; if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[i]) { - f_print_dynamic_raw(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content_header.array[at].array[i] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } f_print_except_dynamic_partial(data->buffer, data->contents_header.array[at].array[i], delimits_content, main->output.to); if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[i]) { - f_print_dynamic_raw(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to); + f_print_dynamic_raw( + data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content_header.array[at].array[i] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } if (i + 1 < data->contents_header.array[at].used && data->contents_header.array[at].array[i + 1].start <= data->contents_header.array[at].array[i + 1].stop) { diff --git a/level_3/fss_payload_read/c/private-read.c b/level_3/fss_payload_read/c/private-read.c index 42dbd5e..9529332 100644 --- a/level_3/fss_payload_read/c/private-read.c +++ b/level_3/fss_payload_read/c/private-read.c @@ -603,13 +603,27 @@ extern "C" { } else { if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) { - f_print_character_safely(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to); + f_print_dynamic_raw( + data->quotes_object_header.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object_header.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } fss_payload_read_print_at_extended(main, i, *delimits_object, *delimits_content, data); if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) { - f_print_character_safely(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to); + f_print_dynamic_raw( + data->quotes_object_header.array[at] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_object_header.array[at] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } } } @@ -623,13 +637,27 @@ extern "C" { } else { if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[i]) { - f_print_character_safely(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to); + f_print_dynamic_raw( + data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content_header.array[at].array[i] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } fss_payload_read_print_at_extended(main, i, *delimits_object, *delimits_content, data); if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[i]) { - f_print_character_safely(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to); + f_print_dynamic_raw( + data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e + ? f_fss_quote_single_s + : data->quotes_content_header.array[at].array[i] == f_fss_quote_type_backtick_e + ? f_fss_quote_backtick_s + : f_fss_quote_double_s, + main->output.to + ); } } diff --git a/level_3/fss_write/c/basic/fss_write.c b/level_3/fss_write/c/basic/fss_write.c index 21c039f..92f6048 100644 --- a/level_3/fss_write/c/basic/fss_write.c +++ b/level_3/fss_write/c/basic/fss_write.c @@ -60,7 +60,9 @@ extern "C" { if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) { macro_fss_write_setting(setting)->status = fl_fss_basic_object_write( *macro_fss_write_setting(setting)->object, - (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e, + macro_fss_write_setting(setting)->quote.used + ? macro_fss_write_setting(setting)->quote.string[0] + : f_fss_quote_double_s.string[0], f_fss_complete_none_e, macro_fss_write_setting(setting)->state, ¯o_fss_write_setting(setting)->range, @@ -70,7 +72,9 @@ extern "C" { else { macro_fss_write_setting(setting)->status = fl_fss_basic_object_write( *macro_fss_write_setting(setting)->object, - (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e, + macro_fss_write_setting(setting)->quote.used + ? macro_fss_write_setting(setting)->quote.string[0] + : f_fss_quote_double_s.string[0], (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e, macro_fss_write_setting(setting)->state, ¯o_fss_write_setting(setting)->range, diff --git a/level_3/fss_write/c/extended/fss_write.c b/level_3/fss_write/c/extended/fss_write.c index 3883a9d..8885091 100644 --- a/level_3/fss_write/c/extended/fss_write.c +++ b/level_3/fss_write/c/extended/fss_write.c @@ -13,7 +13,9 @@ extern "C" { if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) { macro_fss_write_setting(setting)->status = fl_fss_extended_content_write( *macro_fss_write_setting(setting)->content, - (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e, + macro_fss_write_setting(setting)->quote.used + ? macro_fss_write_setting(setting)->quote.string[0] + : f_fss_quote_double_s.string[0], f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc.. macro_fss_write_setting(setting)->state, ¯o_fss_write_setting(setting)->range, @@ -23,7 +25,9 @@ extern "C" { else { macro_fss_write_setting(setting)->status = fl_fss_extended_content_write( *macro_fss_write_setting(setting)->content, - (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e, + macro_fss_write_setting(setting)->quote.used + ? macro_fss_write_setting(setting)->quote.string[0] + : f_fss_quote_double_s.string[0], (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e, macro_fss_write_setting(setting)->state, ¯o_fss_write_setting(setting)->range, @@ -62,7 +66,9 @@ extern "C" { if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) { macro_fss_write_setting(setting)->status = fl_fss_extended_object_write( *macro_fss_write_setting(setting)->object, - (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e, + macro_fss_write_setting(setting)->quote.used + ? macro_fss_write_setting(setting)->quote.string[0] + : f_fss_quote_double_s.string[0], f_fss_complete_none_e, macro_fss_write_setting(setting)->state, ¯o_fss_write_setting(setting)->range, @@ -72,7 +78,9 @@ extern "C" { else { macro_fss_write_setting(setting)->status = fl_fss_extended_object_write( *macro_fss_write_setting(setting)->object, - (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e, + macro_fss_write_setting(setting)->quote.used + ? macro_fss_write_setting(setting)->quote.string[0] + : f_fss_quote_double_s.string[0], (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e, macro_fss_write_setting(setting)->state, ¯o_fss_write_setting(setting)->range, diff --git a/level_3/fss_write/c/main/common.c b/level_3/fss_write/c/main/common.c index 20553dd..220d4d1 100644 --- a/level_3/fss_write/c/main/common.c +++ b/level_3/fss_write/c/main/common.c @@ -25,6 +25,7 @@ extern "C" { #ifndef _di_fss_write_parameters_ const f_string_static_t fss_write_short_as_s = macro_f_string_static_t_initialize(FSS_WRITE_short_as_s, 0, FSS_WRITE_short_as_s_length); + const f_string_static_t fss_write_short_backtick_s = macro_f_string_static_t_initialize(FSS_WRITE_short_backtick_s, 0, FSS_WRITE_short_backtick_s_length); const f_string_static_t fss_write_short_content_s = macro_f_string_static_t_initialize(FSS_WRITE_short_content_s, 0, FSS_WRITE_short_content_s_length); const f_string_static_t fss_write_short_double_s = macro_f_string_static_t_initialize(FSS_WRITE_short_double_s, 0, FSS_WRITE_short_double_s_length); const f_string_static_t fss_write_short_file_s = macro_f_string_static_t_initialize(FSS_WRITE_short_file_s, 0, FSS_WRITE_short_file_s_length); @@ -36,6 +37,7 @@ extern "C" { const f_string_static_t fss_write_short_trim_s = macro_f_string_static_t_initialize(FSS_WRITE_short_trim_s, 0, FSS_WRITE_short_trim_s_length); const f_string_static_t fss_write_long_as_s = macro_f_string_static_t_initialize(FSS_WRITE_long_as_s, 0, FSS_WRITE_long_as_s_length); + const f_string_static_t fss_write_long_backtick_s = macro_f_string_static_t_initialize(FSS_WRITE_long_backtick_s, 0, FSS_WRITE_long_backtick_s_length); const f_string_static_t fss_write_long_content_s = macro_f_string_static_t_initialize(FSS_WRITE_long_content_s, 0, FSS_WRITE_long_content_s_length); const f_string_static_t fss_write_long_double_s = macro_f_string_static_t_initialize(FSS_WRITE_long_double_s, 0, FSS_WRITE_long_double_s_length); const f_string_static_t fss_write_long_file_s = macro_f_string_static_t_initialize(FSS_WRITE_long_file_s, 0, FSS_WRITE_long_file_s_length); @@ -606,11 +608,36 @@ extern "C" { if (main->parameters.array[fss_write_parameter_single_e].result & f_console_result_found_e) { if (main->parameters.array[fss_write_parameter_double_e].location < main->parameters.array[fss_write_parameter_single_e].location) { setting->quote = f_fss_quote_single_s; + + if (main->parameters.array[fss_write_parameter_backtick_e].result & f_console_result_found_e) { + if (main->parameters.array[fss_write_parameter_single_e].location < main->parameters.array[fss_write_parameter_backtick_e].location) { + setting->quote = f_fss_quote_backtick_s; + } + } + } + else if (main->parameters.array[fss_write_parameter_backtick_e].result & f_console_result_found_e) { + if (main->parameters.array[fss_write_parameter_double_e].location < main->parameters.array[fss_write_parameter_backtick_e].location) { + setting->quote = f_fss_quote_backtick_s; + } + } + } + else if (main->parameters.array[fss_write_parameter_backtick_e].result & f_console_result_found_e) { + if (main->parameters.array[fss_write_parameter_double_e].location < main->parameters.array[fss_write_parameter_backtick_e].location) { + setting->quote = f_fss_quote_backtick_s; } } } else if (main->parameters.array[fss_write_parameter_single_e].result & f_console_result_found_e) { setting->quote = f_fss_quote_single_s; + + if (main->parameters.array[fss_write_parameter_backtick_e].result & f_console_result_found_e) { + if (main->parameters.array[fss_write_parameter_single_e].location < main->parameters.array[fss_write_parameter_backtick_e].location) { + setting->quote = f_fss_quote_backtick_s; + } + } + } + else if (main->parameters.array[fss_write_parameter_backtick_e].result & f_console_result_found_e) { + setting->quote = f_fss_quote_backtick_s; } if (main->parameters.array[fss_write_parameter_trim_e].result & f_console_result_found_e) { diff --git a/level_3/fss_write/c/main/common.h b/level_3/fss_write/c/main/common.h index 555a116..fd6fe44 100644 --- a/level_3/fss_write/c/main/common.h +++ b/level_3/fss_write/c/main/common.h @@ -114,51 +114,56 @@ extern "C" { * The main program parameters. */ #ifndef _di_fss_write_parameters_ - #define FSS_WRITE_short_as_s "a" - #define FSS_WRITE_short_content_s "c" - #define FSS_WRITE_short_double_s "d" - #define FSS_WRITE_short_file_s "f" - #define FSS_WRITE_short_ignore_s "I" - #define FSS_WRITE_short_object_s "o" - #define FSS_WRITE_short_partial_s "p" - #define FSS_WRITE_short_prepend_s "P" - #define FSS_WRITE_short_single_s "s" - #define FSS_WRITE_short_trim_s "T" - - #define FSS_WRITE_long_as_s "as" - #define FSS_WRITE_long_content_s "content" - #define FSS_WRITE_long_double_s "double" - #define FSS_WRITE_long_file_s "file" - #define FSS_WRITE_long_ignore_s "ignore" - #define FSS_WRITE_long_object_s "object" - #define FSS_WRITE_long_partial_s "partial" - #define FSS_WRITE_long_prepend_s "prepend" - #define FSS_WRITE_long_single_s "single" - #define FSS_WRITE_long_trim_s "trim" - - #define FSS_WRITE_short_as_s_length 1 - #define FSS_WRITE_short_content_s_length 1 - #define FSS_WRITE_short_double_s_length 1 - #define FSS_WRITE_short_file_s_length 1 - #define FSS_WRITE_short_ignore_s_length 1 - #define FSS_WRITE_short_object_s_length 1 - #define FSS_WRITE_short_partial_s_length 1 - #define FSS_WRITE_short_prepend_s_length 1 - #define FSS_WRITE_short_single_s_length 1 - #define FSS_WRITE_short_trim_s_length 1 - - #define FSS_WRITE_long_as_s_length 2 - #define FSS_WRITE_long_content_s_length 7 - #define FSS_WRITE_long_double_s_length 6 - #define FSS_WRITE_long_file_s_length 4 - #define FSS_WRITE_long_ignore_s_length 6 - #define FSS_WRITE_long_object_s_length 6 - #define FSS_WRITE_long_partial_s_length 7 - #define FSS_WRITE_long_prepend_s_length 7 - #define FSS_WRITE_long_single_s_length 6 - #define FSS_WRITE_long_trim_s_length 4 + #define FSS_WRITE_short_as_s "a" + #define FSS_WRITE_short_backtick_s "b" + #define FSS_WRITE_short_content_s "c" + #define FSS_WRITE_short_double_s "d" + #define FSS_WRITE_short_file_s "f" + #define FSS_WRITE_short_ignore_s "I" + #define FSS_WRITE_short_object_s "o" + #define FSS_WRITE_short_partial_s "p" + #define FSS_WRITE_short_prepend_s "P" + #define FSS_WRITE_short_single_s "s" + #define FSS_WRITE_short_trim_s "T" + + #define FSS_WRITE_long_as_s "as" + #define FSS_WRITE_long_backtick_s "backtick" + #define FSS_WRITE_long_content_s "content" + #define FSS_WRITE_long_double_s "double" + #define FSS_WRITE_long_file_s "file" + #define FSS_WRITE_long_ignore_s "ignore" + #define FSS_WRITE_long_object_s "object" + #define FSS_WRITE_long_partial_s "partial" + #define FSS_WRITE_long_prepend_s "prepend" + #define FSS_WRITE_long_single_s "single" + #define FSS_WRITE_long_trim_s "trim" + + #define FSS_WRITE_short_as_s_length 1 + #define FSS_WRITE_short_backtick_s_length 1 + #define FSS_WRITE_short_content_s_length 1 + #define FSS_WRITE_short_double_s_length 1 + #define FSS_WRITE_short_file_s_length 1 + #define FSS_WRITE_short_ignore_s_length 1 + #define FSS_WRITE_short_object_s_length 1 + #define FSS_WRITE_short_partial_s_length 1 + #define FSS_WRITE_short_prepend_s_length 1 + #define FSS_WRITE_short_single_s_length 1 + #define FSS_WRITE_short_trim_s_length 1 + + #define FSS_WRITE_long_as_s_length 2 + #define FSS_WRITE_long_backtick_s_length 8 + #define FSS_WRITE_long_content_s_length 7 + #define FSS_WRITE_long_double_s_length 6 + #define FSS_WRITE_long_file_s_length 4 + #define FSS_WRITE_long_ignore_s_length 6 + #define FSS_WRITE_long_object_s_length 6 + #define FSS_WRITE_long_partial_s_length 7 + #define FSS_WRITE_long_prepend_s_length 7 + #define FSS_WRITE_long_single_s_length 6 + #define FSS_WRITE_long_trim_s_length 4 extern const f_string_static_t fss_write_short_as_s; + extern const f_string_static_t fss_write_short_backtick_s; extern const f_string_static_t fss_write_short_content_s; extern const f_string_static_t fss_write_short_double_s; extern const f_string_static_t fss_write_short_file_s; @@ -170,6 +175,7 @@ extern "C" { extern const f_string_static_t fss_write_short_trim_s; extern const f_string_static_t fss_write_long_as_s; + extern const f_string_static_t fss_write_long_backtick_s; extern const f_string_static_t fss_write_long_content_s; extern const f_string_static_t fss_write_long_double_s; extern const f_string_static_t fss_write_long_file_s; @@ -195,6 +201,7 @@ extern "C" { fss_write_parameter_line_last_no_e, fss_write_parameter_as_e, + fss_write_parameter_backtick_e, fss_write_parameter_content_e, fss_write_parameter_double_e, fss_write_parameter_file_e, @@ -222,6 +229,7 @@ extern "C" { macro_f_console_parameter_t_initialize4(f_console_standard_short_line_last_no_s, f_console_standard_long_line_last_no_s, 0, f_console_flag_inverse_e), \ \ macro_f_console_parameter_t_initialize2(fss_write_short_as_s.string, fss_write_long_as_s.string, 0, 1, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize2(fss_write_short_backtick_s.string, fss_write_long_backtick_s.string, 0, 0, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize2(fss_write_short_content_s.string, fss_write_long_content_s.string, 0, 1, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize2(fss_write_short_double_s.string, fss_write_long_double_s.string, 0, 0, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize2(fss_write_short_file_s.string, fss_write_long_file_s.string, 0, 1, f_console_flag_normal_e), \ @@ -233,7 +241,7 @@ extern "C" { macro_f_console_parameter_t_initialize2(fss_write_short_trim_s.string, fss_write_long_trim_s.string, 0, 0, f_console_flag_normal_e), \ } - #define fss_write_total_parameters_d 22 + #define fss_write_total_parameters_d 23 #endif // _di_fss_write_parameters_ /** @@ -243,14 +251,12 @@ extern "C" { * - none: No modes in use. * - content: The Content being written is specified. * - content_multiple: Designate that multiple Content is allowed for an Object for this standard rather than a single Content per Object. - * - double: Operate using double quotes. * - file_to: Using a specified destination file. * - help: Print help. * - ignore: Ignore a given range within a Content (specify flag before setting loading to designate ignores is supported by standard). * - object: The Object being written is specified. * - partial: Do not write end of Object/Content character. * - prepend: Prepend the given white space characters to the start of each multi-line Content. - * - single: Operate using single quotes. * - trim: Trim Object names. * - version: Print version. */ @@ -259,16 +265,14 @@ extern "C" { fss_write_flag_none_e = 0x0, fss_write_flag_content_e = 0x1, fss_write_flag_content_multiple_e = 0x2, - fss_write_flag_double_e = 0x4, - fss_write_flag_file_to_e = 0x8, - fss_write_flag_help_e = 0x10, - fss_write_flag_ignore_e = 0x20, - fss_write_flag_object_e = 0x40, - fss_write_flag_partial_e = 0x80, - fss_write_flag_prepend_e = 0x100, - fss_write_flag_single_e = 0x200, - fss_write_flag_trim_e = 0x400, - fss_write_flag_version_e = 0x800, + fss_write_flag_file_to_e = 0x4, + fss_write_flag_help_e = 0x8, + fss_write_flag_ignore_e = 0x10, + fss_write_flag_object_e = 0x20, + fss_write_flag_partial_e = 0x40, + fss_write_flag_prepend_e = 0x80, + fss_write_flag_trim_e = 0x100, + fss_write_flag_version_e = 0x200, }; #endif // _di_fss_write_flag_e_ -- 1.8.3.1