From: Kevin Day Date: Tue, 6 Dec 2022 01:41:12 +0000 (-0600) Subject: Update: Add support for backtick quoting for IKI. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=0cd17d8af971bb8a283f774867bf72d497bbd763;p=fll 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. --- diff --git a/level_0/f_iki/c/iki.c b/level_0/f_iki/c/iki.c index e9ca32b..6b894a5 100644 --- a/level_0/f_iki/c/iki.c +++ b/level_0/f_iki/c/iki.c @@ -9,7 +9,7 @@ extern "C" { f_status_t f_iki_content_is(const f_string_static_t content, const f_string_static_t quote) { #ifndef _di_level_0_parameter_checking_ if (!quote.used) return F_status_set_error(F_parameter); - if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter); + if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0] && quote.string[0] != f_iki_syntax_quote_backtick_s.string[0]) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (!content.used) { @@ -24,7 +24,7 @@ extern "C" { f_status_t f_iki_content_partial_is(const f_string_static_t content, const f_string_range_t range, const f_string_static_t quote) { #ifndef _di_level_0_parameter_checking_ if (!quote.used) return F_status_set_error(F_parameter); - if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter); + if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0] && quote.string[0] != f_iki_syntax_quote_backtick_s.string[0]) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (!content.used) { @@ -172,7 +172,7 @@ extern "C" { if (F_status_is_error(status) || range->start > range->stop || range->start >= buffer->used) break; // Found a valid vocabulary name. - if (buffer->string[range->start] == f_iki_syntax_quote_single_s.string[0] || buffer->string[range->start] == f_iki_syntax_quote_double_s.string[0]) { + if (buffer->string[range->start] == f_iki_syntax_quote_single_s.string[0] || buffer->string[range->start] == f_iki_syntax_quote_double_s.string[0] || buffer->string[range->start] == f_iki_syntax_quote_backtick_s.string[0]) { status = F_true; quote = buffer->string[range->start]; } @@ -210,7 +210,7 @@ extern "C" { if (separator_found) { // Save delimit for a would-be valid IKI that is now delimited. - if (buffer->string[range->start] == f_iki_syntax_quote_single_s.string[0] || buffer->string[range->start] == f_iki_syntax_quote_double_s.string[0]) { + if (buffer->string[range->start] == f_iki_syntax_quote_single_s.string[0] || buffer->string[range->start] == f_iki_syntax_quote_double_s.string[0] || buffer->string[range->start] == f_iki_syntax_quote_backtick_s.string[0]) { status = f_array_lengths_increase(state.step_small, &data->delimits); if (F_status_is_error(status)) break; diff --git a/level_0/f_iki/c/iki.h b/level_0/f_iki/c/iki.h index eaee161..d79b104 100644 --- a/level_0/f_iki/c/iki.h +++ b/level_0/f_iki/c/iki.h @@ -42,7 +42,7 @@ extern "C" { * The string to validate as an content name. * @param quote * The quote character in use. - * This must be either a single (') or double (") quote. + * This must be either a single quote (') (U+0027), double quote (") (U+0022), or backtick (`) (U+0060). * * @return * F_true on success and string is a valid content name. @@ -66,7 +66,7 @@ extern "C" { * The range within the buffer that represents the content name. * @param quote * The quote character in use. - * This must be either a single (') or double (") quote. + * This must be either a single quote (') (U+0027), double quote (") (U+0022), or backtick (`) (U+0060). * * @return * F_true on success and string is a valid content name. diff --git a/level_0/f_iki/c/iki/common.c b/level_0/f_iki/c/iki/common.c index 566a314..454f098 100644 --- a/level_0/f_iki/c/iki/common.c +++ b/level_0/f_iki/c/iki/common.c @@ -8,6 +8,7 @@ extern "C" { #ifndef _di_f_iki_syntax_ const f_string_static_t f_iki_syntax_separator_s = macro_f_string_static_t_initialize(F_iki_syntax_separator_s, 0, F_iki_syntax_separator_s_length); const f_string_static_t f_iki_syntax_placeholder_s = macro_f_string_static_t_initialize(F_iki_syntax_placeholder_s, 0, F_iki_syntax_placeholder_s_length); + const f_string_static_t f_iki_syntax_quote_backtick_s = macro_f_string_static_t_initialize(F_iki_syntax_quote_backtick_s, 0, F_iki_syntax_quote_backtick_s_length); const f_string_static_t f_iki_syntax_quote_double_s = macro_f_string_static_t_initialize(F_iki_syntax_quote_double_s, 0, F_iki_syntax_quote_double_s_length); const f_string_static_t f_iki_syntax_quote_single_s = macro_f_string_static_t_initialize(F_iki_syntax_quote_single_s, 0, F_iki_syntax_quote_single_s_length); const f_string_static_t f_iki_syntax_slash_s = macro_f_string_static_t_initialize(F_iki_syntax_slash_s, 0, F_iki_syntax_slash_s_length); diff --git a/level_0/f_iki/c/iki/common.h b/level_0/f_iki/c/iki/common.h index f9e762b..e651ec5 100644 --- a/level_0/f_iki/c/iki/common.h +++ b/level_0/f_iki/c/iki/common.h @@ -38,20 +38,23 @@ extern "C" { * IKI-specific syntax. */ #ifndef _di_f_iki_syntax_ - #define F_iki_syntax_separator_s ":" - #define F_iki_syntax_placeholder_s "" - #define F_iki_syntax_quote_double_s "\"" - #define F_iki_syntax_quote_single_s "\'" - #define F_iki_syntax_slash_s "\\" - - #define F_iki_syntax_separator_s_length 1 - #define F_iki_syntax_placeholder_s_length 1 - #define F_iki_syntax_quote_double_s_length 1 - #define F_iki_syntax_quote_single_s_length 1 - #define F_iki_syntax_slash_s_length 1 + #define F_iki_syntax_separator_s F_string_ascii_colon_s + #define F_iki_syntax_placeholder_s F_string_placeholder_s + #define F_iki_syntax_quote_backtick_s F_string_ascii_grave_s + #define F_iki_syntax_quote_double_s F_string_ascii_quote_double_s + #define F_iki_syntax_quote_single_s F_string_ascii_quote_single_s + #define F_iki_syntax_slash_s F_string_ascii_slash_backward_s + + #define F_iki_syntax_separator_s_length F_string_ascii_colon_s_length + #define F_iki_syntax_placeholder_s_length F_string_placeholder_s_length + #define F_iki_syntax_quote_backtick_s_length F_string_ascii_grave_s_length + #define F_iki_syntax_quote_double_s_length F_string_ascii_quote_double_s_length + #define F_iki_syntax_quote_single_s_length F_string_ascii_quote_single_s_length + #define F_iki_syntax_slash_s_length F_string_ascii_slash_backward_s_length extern const f_string_static_t f_iki_syntax_separator_s; extern const f_string_static_t f_iki_syntax_placeholder_s; + extern const f_string_static_t f_iki_syntax_quote_backtick_s; extern const f_string_static_t f_iki_syntax_quote_double_s; extern const f_string_static_t f_iki_syntax_quote_single_s; extern const f_string_static_t f_iki_syntax_slash_s; diff --git a/level_0/f_iki/c/private-iki.h b/level_0/f_iki/c/private-iki.h index e291525..d4585fa 100644 --- a/level_0/f_iki/c/private-iki.h +++ b/level_0/f_iki/c/private-iki.h @@ -28,7 +28,7 @@ extern "C" { * The range within the buffer that represents the content name. * @param quote * The quote character in use. - * This must be either a single (') or double (") quote. + * This must be either a single quote (') (U+0027), double quote (") (U+0022), or backtick (`) (U+0060). * * @return * F_true on success and string is a valid content name. diff --git a/level_2/fll_iki/c/iki.c b/level_2/fll_iki/c/iki.c index 08d8755..d7db229 100644 --- a/level_2/fll_iki/c/iki.c +++ b/level_2/fll_iki/c/iki.c @@ -9,7 +9,7 @@ extern "C" { f_status_t fll_iki_content_escape(const f_string_static_t content, const f_string_static_t quote, f_string_dynamic_t * const escaped) { #ifndef _di_level_2_parameter_checking_ if (!quote.used) return F_status_set_error(F_parameter); - if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter); + if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0] && quote.string[0] != f_iki_syntax_quote_backtick_s.string[0]) return F_status_set_error(F_parameter); if (escaped->used > escaped->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -25,7 +25,7 @@ extern "C" { if (range.start > range.stop) return F_status_set_error(F_parameter); if (range.start >= content.used) return F_status_set_error(F_parameter); if (!quote.used) return F_status_set_error(F_parameter); - if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter); + if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0] && quote.string[0] != f_iki_syntax_quote_backtick_s.string[0]) return F_status_set_error(F_parameter); if (escaped->used > escaped->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -39,7 +39,7 @@ extern "C" { if (range.start > range.stop) return F_status_set_error(F_parameter); if (range.start >= content.used) return F_status_set_error(F_parameter); if (!quote.used) return F_status_set_error(F_parameter); - if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter); + if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0] && quote.string[0] != f_iki_syntax_quote_backtick_s.string[0]) return F_status_set_error(F_parameter); if (unescaped->used > unescaped->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ @@ -51,7 +51,7 @@ extern "C" { f_status_t fll_iki_content_unescape(const f_string_static_t content, const f_string_static_t quote, f_string_dynamic_t * const unescaped) { #ifndef _di_level_2_parameter_checking_ if (!quote.used) return F_status_set_error(F_parameter); - if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0]) return F_status_set_error(F_parameter); + if (quote.string[0] != f_iki_syntax_quote_single_s.string[0] && quote.string[0] != f_iki_syntax_quote_double_s.string[0] && quote.string[0] != f_iki_syntax_quote_backtick_s.string[0]) return F_status_set_error(F_parameter); if (unescaped->used > unescaped->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ diff --git a/level_2/fll_iki/c/iki.h b/level_2/fll_iki/c/iki.h index ac8277a..9b2d0ed 100644 --- a/level_2/fll_iki/c/iki.h +++ b/level_2/fll_iki/c/iki.h @@ -43,7 +43,7 @@ extern "C" { * The string to escape. * @param quote * The quote character in use. - * This must be either a single (') or double (") quote. + * This must be either a single quote (') (U+0027), double quote (") (U+0022), or backtick (`) (U+0060). * @param escaped * The content whose data is escaped. * The escaped string data is appended to this, so set the escaped.used = 0 if "replace" behavior is desired. @@ -74,7 +74,7 @@ extern "C" { * The range within the buffer that represents the content. * @param quote * The quote character in use. - * This must be either a single (') or double (") quote. + * This must be either a single quote (') (U+0027), double quote (") (U+0022), or backtick (`) (U+0060). * @param escaped * The content whose data is escaped. * The escaped string data is appended to this, so set the escaped.used = 0 if "replace" behavior is desired. @@ -105,7 +105,7 @@ extern "C" { * The range within the buffer that represents the content. * @param quote * The quote character in use. - * This must be either a single (') or double (") quote. + * This must be either a single quote (') (U+0027), double quote (") (U+0022), or backtick (`) (U+0060). * @param unescaped * The content whose data is unescaped. * The unescaped string data is appended to this, so set the unescaped.used = 0 if "replace" behavior is desired. @@ -135,7 +135,7 @@ extern "C" { * The string to escape. * @param quote * The quote character in use. - * This must be either a single (') or double (") quote. + * This must be either a single quote (') (U+0027), double quote (") (U+0022), or backtick (`) (U+0060). * @param unescaped * The content whose data is unescaped. * The unescaped string data is appended to this, so set the unescaped.used = 0 if "replace" behavior is desired. diff --git a/level_2/fll_iki/c/private-iki.h b/level_2/fll_iki/c/private-iki.h index becca45..36f0b60 100644 --- a/level_2/fll_iki/c/private-iki.h +++ b/level_2/fll_iki/c/private-iki.h @@ -26,7 +26,7 @@ extern "C" { * The range within the buffer that represents the content. * @param quote * The quote character in use. - * This must be either a single (') or double (") quote. + * This must be either a single quote (') (U+0027), double quote (") (U+0022), or backtick (`) (U+0060). * @param escaped * The content whose data is escaped. * The escaped string data is appended to this, so set the escaped.used = 0 if "replace" behavior is desired. @@ -57,7 +57,7 @@ extern "C" { * The range within the buffer that represents the content. * @param quote * The quote character in use. - * This must be either a single (') or double (") quote. + * This must be either a single quote (') (U+0027), double quote (") (U+0022), or backtick (`) (U+0060). * @param unescaped * The content whose data is unescaped. * The unescaped string data is appended to this, so set the unescaped.used = 0 if "replace" behavior is desired. diff --git a/level_3/iki_write/c/common.c b/level_3/iki_write/c/common.c index a4746bf..f6454ec 100644 --- a/level_3/iki_write/c/common.c +++ b/level_3/iki_write/c/common.c @@ -18,15 +18,17 @@ extern "C" { #endif // _di_iki_write_strings_ #ifndef _di_iki_write_parameters_ - const f_string_static_t iki_write_short_file_s = macro_f_string_static_t_initialize(IKI_WRITE_short_file_s, 0, IKI_WRITE_short_file_s_length); + const f_string_static_t iki_write_short_backtick_s = macro_f_string_static_t_initialize(IKI_WRITE_short_backtick_s, 0, IKI_WRITE_short_backtick_s_length); const f_string_static_t iki_write_short_content_s = macro_f_string_static_t_initialize(IKI_WRITE_short_content_s, 0, IKI_WRITE_short_content_s_length); const f_string_static_t iki_write_short_double_s = macro_f_string_static_t_initialize(IKI_WRITE_short_double_s, 0, IKI_WRITE_short_double_s_length); + const f_string_static_t iki_write_short_file_s = macro_f_string_static_t_initialize(IKI_WRITE_short_file_s, 0, IKI_WRITE_short_file_s_length); const f_string_static_t iki_write_short_object_s = macro_f_string_static_t_initialize(IKI_WRITE_short_object_s, 0, IKI_WRITE_short_object_s_length); const f_string_static_t iki_write_short_single_s = macro_f_string_static_t_initialize(IKI_WRITE_short_single_s, 0, IKI_WRITE_short_single_s_length); - const f_string_static_t iki_write_long_file_s = macro_f_string_static_t_initialize(IKI_WRITE_long_file_s, 0, IKI_WRITE_long_file_s_length); + const f_string_static_t iki_write_long_backtick_s = macro_f_string_static_t_initialize(IKI_WRITE_long_backtick_s, 0, IKI_WRITE_long_backtick_s_length); const f_string_static_t iki_write_long_content_s = macro_f_string_static_t_initialize(IKI_WRITE_long_content_s, 0, IKI_WRITE_long_content_s_length); const f_string_static_t iki_write_long_double_s = macro_f_string_static_t_initialize(IKI_WRITE_long_double_s, 0, IKI_WRITE_long_double_s_length); + const f_string_static_t iki_write_long_file_s = macro_f_string_static_t_initialize(IKI_WRITE_long_file_s, 0, IKI_WRITE_long_file_s_length); const f_string_static_t iki_write_long_object_s = macro_f_string_static_t_initialize(IKI_WRITE_long_object_s, 0, IKI_WRITE_long_object_s_length); const f_string_static_t iki_write_long_single_s = macro_f_string_static_t_initialize(IKI_WRITE_long_single_s, 0, IKI_WRITE_long_single_s_length); #endif // _di_iki_write_parameters_ @@ -257,11 +259,36 @@ extern "C" { if (main->parameters.array[iki_write_parameter_single_e].result & f_console_result_found_e) { if (main->parameters.array[iki_write_parameter_double_e].location < main->parameters.array[iki_write_parameter_single_e].location) { setting->quote = f_iki_syntax_quote_single_s; + + if (main->parameters.array[iki_write_parameter_backtick_e].result & f_console_result_found_e) { + if (main->parameters.array[iki_write_parameter_single_e].location < main->parameters.array[iki_write_parameter_backtick_e].location) { + setting->quote = f_iki_syntax_quote_backtick_s; + } + } + } + else if (main->parameters.array[iki_write_parameter_backtick_e].result & f_console_result_found_e) { + if (main->parameters.array[iki_write_parameter_double_e].location < main->parameters.array[iki_write_parameter_backtick_e].location) { + setting->quote = f_iki_syntax_quote_backtick_s; + } + } + } + else if (main->parameters.array[iki_write_parameter_backtick_e].result & f_console_result_found_e) { + if (main->parameters.array[iki_write_parameter_double_e].location < main->parameters.array[iki_write_parameter_backtick_e].location) { + setting->quote = f_iki_syntax_quote_backtick_s; } } } else if (main->parameters.array[iki_write_parameter_single_e].result & f_console_result_found_e) { setting->quote = f_iki_syntax_quote_single_s; + + if (main->parameters.array[iki_write_parameter_backtick_e].result & f_console_result_found_e) { + if (main->parameters.array[iki_write_parameter_single_e].location < main->parameters.array[iki_write_parameter_backtick_e].location) { + setting->quote = f_iki_syntax_quote_backtick_s; + } + } + } + else if (main->parameters.array[iki_write_parameter_backtick_e].result & f_console_result_found_e) { + setting->quote = f_iki_syntax_quote_backtick_s; } } #endif // _di_iki_write_setting_load_ diff --git a/level_3/iki_write/c/common.h b/level_3/iki_write/c/common.h index ea6d1d2..0d63610 100644 --- a/level_3/iki_write/c/common.h +++ b/level_3/iki_write/c/common.h @@ -81,39 +81,45 @@ extern "C" { * The main program parameters. */ #ifndef _di_iki_write_parameters_ - #define IKI_WRITE_short_file_s "f" - #define IKI_WRITE_short_content_s "c" - #define IKI_WRITE_short_double_s "d" - #define IKI_WRITE_short_object_s "o" - #define IKI_WRITE_short_single_s "s" - - #define IKI_WRITE_long_file_s "file" - #define IKI_WRITE_long_content_s "content" - #define IKI_WRITE_long_double_s "double" - #define IKI_WRITE_long_object_s "object" - #define IKI_WRITE_long_single_s "single" - - #define IKI_WRITE_short_file_s_length 1 - #define IKI_WRITE_short_content_s_length 1 - #define IKI_WRITE_short_double_s_length 1 - #define IKI_WRITE_short_object_s_length 1 - #define IKI_WRITE_short_single_s_length 1 - - #define IKI_WRITE_long_file_s_length 4 - #define IKI_WRITE_long_content_s_length 7 - #define IKI_WRITE_long_double_s_length 6 - #define IKI_WRITE_long_object_s_length 6 - #define IKI_WRITE_long_single_s_length 6 - - extern const f_string_static_t iki_write_short_file_s; + #define IKI_WRITE_short_backtick_s "b" + #define IKI_WRITE_short_content_s "c" + #define IKI_WRITE_short_double_s "d" + #define IKI_WRITE_short_file_s "f" + #define IKI_WRITE_short_object_s "o" + #define IKI_WRITE_short_single_s "s" + + #define IKI_WRITE_long_backtick_s "backtick" + #define IKI_WRITE_long_content_s "content" + #define IKI_WRITE_long_double_s "double" + #define IKI_WRITE_long_file_s "file" + #define IKI_WRITE_long_object_s "object" + #define IKI_WRITE_long_single_s "single" + + #define IKI_WRITE_short_backtick_s_length 1 + #define IKI_WRITE_short_content_s_length 1 + #define IKI_WRITE_short_double_s_length 1 + #define IKI_WRITE_short_file_s_length 1 + #define IKI_WRITE_short_object_s_length 1 + #define IKI_WRITE_short_single_s_length 1 + + #define IKI_WRITE_long_backtick_s_length 8 + #define IKI_WRITE_long_content_s_length 7 + #define IKI_WRITE_long_double_s_length 6 + #define IKI_WRITE_long_file_s_length 4 + #define IKI_WRITE_long_object_s_length 6 + #define IKI_WRITE_long_single_s_length 6 + + extern const f_string_static_t iki_write_short_backtick_s; extern const f_string_static_t iki_write_short_content_s; extern const f_string_static_t iki_write_short_double_s; + extern const f_string_static_t iki_write_short_file_s; extern const f_string_static_t iki_write_short_object_s; extern const f_string_static_t iki_write_short_single_s; - extern const f_string_static_t iki_write_long_file_s; + extern const f_string_static_t iki_write_long_backtick_s; extern const f_string_static_t iki_write_long_content_s; extern const f_string_static_t iki_write_long_double_s; + extern const f_string_static_t iki_write_long_file_s; extern const f_string_static_t iki_write_long_object_s; extern const f_string_static_t iki_write_long_single_s; @@ -131,9 +137,10 @@ extern "C" { iki_write_parameter_line_first_no_e, iki_write_parameter_line_last_no_e, - iki_write_parameter_file_e, + iki_write_parameter_backtick_e, iki_write_parameter_content_e, iki_write_parameter_double_e, + iki_write_parameter_file_e, iki_write_parameter_object_e, iki_write_parameter_single_e, }; @@ -153,39 +160,36 @@ extern "C" { macro_f_console_parameter_t_initialize4(f_console_standard_short_line_first_no_s, f_console_standard_long_line_first_no_s, 0, f_console_flag_inverse_e), \ 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(iki_write_short_file_s.string, iki_write_long_file_s.string, 0, 1, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize2(iki_write_short_content_s.string, iki_write_long_content_s.string, 0, 1, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize2(iki_write_short_double_s.string, iki_write_long_double_s.string, 0, 0, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize2(iki_write_short_object_s.string, iki_write_long_object_s.string, 0, 1, f_console_flag_normal_e), \ - macro_f_console_parameter_t_initialize2(iki_write_short_single_s.string, iki_write_long_single_s.string, 0, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize2(iki_write_short_backtick_s.string, iki_write_long_backtick_s.string, 0, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize2(iki_write_short_content_s.string, iki_write_long_content_s.string, 0, 1, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize2(iki_write_short_double_s.string, iki_write_long_double_s.string, 0, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize2(iki_write_short_file_s.string, iki_write_long_file_s.string, 0, 1, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize2(iki_write_short_object_s.string, iki_write_long_object_s.string, 0, 1, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize2(iki_write_short_single_s.string, iki_write_long_single_s.string, 0, 0, f_console_flag_normal_e), \ } - #define iki_write_total_parameters_d 17 + #define iki_write_total_parameters_d 18 #endif // _di_iki_write_parameters_ /** * Flags used to represent flags passed to the main function. * * iki_write_main_flag_*_e: - * - none: No modes in use. - * - content: The Content being written is specified. - * - double: Operate using double quotes. - * - file_to: Using a specified destination file. - * - help: Print help. - * - object: The Object being written is specified. - * - single: Operate using single quotes. - * - version: Print version. + * - none: No modes in use. + * - content: The Content being written is specified. + * - file_to: Using a specified destination file. + * - help: Print help. + * - object: The Object being written is specified. + * - version: Print version. */ #ifndef _di_iki_write_main_flag_e_ enum { iki_write_main_flag_none_e = 0x0, iki_write_main_flag_content_e = 0x1, - iki_write_main_flag_double_e = 0x2, - iki_write_main_flag_file_to_e = 0x4, - iki_write_main_flag_help_e = 0x8, - iki_write_main_flag_object_e = 0x10, - iki_write_main_flag_single_e = 0x20, - iki_write_main_flag_version_e = 0x40, + iki_write_main_flag_file_to_e = 0x2, + iki_write_main_flag_help_e = 0x4, + iki_write_main_flag_object_e = 0x8, + iki_write_main_flag_version_e = 0x10, }; #endif // _di_iki_write_main_flag_e_ diff --git a/level_3/iki_write/c/print.c b/level_3/iki_write/c/print.c index 63784f1..7790d01 100644 --- a/level_3/iki_write/c/print.c +++ b/level_3/iki_write/c/print.c @@ -109,11 +109,12 @@ extern "C" { f_print_dynamic_raw(f_string_eol_s, print.to); - fll_program_print_help_option(print, iki_write_short_file_s, iki_write_long_file_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a file to send data to."); - fll_program_print_help_option(print, iki_write_short_content_s, iki_write_long_content_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "The Content to write."); - fll_program_print_help_option(print, iki_write_short_double_s, iki_write_long_double_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use double quotes (default)."); - fll_program_print_help_option(print, iki_write_short_object_s, iki_write_long_object_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The Object to write."); - fll_program_print_help_option(print, iki_write_short_single_s, iki_write_long_single_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use single quotes."); + fll_program_print_help_option(print, iki_write_short_backtick_s, iki_write_long_backtick_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Use backtick for quotes."); + fll_program_print_help_option(print, iki_write_short_content_s, iki_write_long_content_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The Content to write."); + fll_program_print_help_option(print, iki_write_short_double_s, iki_write_long_double_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use double quotes (default)."); + fll_program_print_help_option(print, iki_write_short_file_s, iki_write_long_file_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a file to send data to."); + fll_program_print_help_option(print, iki_write_short_object_s, iki_write_long_object_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " The Object to write."); + fll_program_print_help_option(print, iki_write_short_single_s, iki_write_long_single_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Use single quotes."); f_print_dynamic_raw(f_string_eol_s, print.to); f_print_dynamic_raw(f_string_eol_s, print.to);