From b841c1c855a5ca3de16a8a139524a8d14716aeb8 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 3 May 2022 21:16:39 -0500 Subject: [PATCH] Cleanup: Rename 'binary' to 'bytecode' in UTF8 program. The use of the term "binary" here is both valid and invalid. The UTF-8 is considered text and so this is better called text. Another name for this is "bytecode". Given that these both have "b" (for partially preserving the parameters) and "bytecode" is a bit more specific than text, use "bytecode". --- level_3/utf8/c/common.c | 8 ++-- level_3/utf8/c/common.h | 40 ++++++++--------- level_3/utf8/c/private-common.h | 2 +- level_3/utf8/c/private-print.c | 8 ++-- level_3/utf8/c/private-print.h | 10 ++--- level_3/utf8/c/private-utf8.c | 8 ++-- level_3/utf8/c/private-utf8.h | 4 +- ...ivate-utf8_binary.c => private-utf8_bytecode.c} | 26 +++++------ ...ivate-utf8_binary.h => private-utf8_bytecode.h} | 26 +++++------ level_3/utf8/c/private-utf8_codepoint.c | 14 +++--- level_3/utf8/c/private-utf8_codepoint.h | 4 +- level_3/utf8/c/utf8.c | 50 +++++++++++----------- level_3/utf8/c/utf8.h | 8 ++-- level_3/utf8/data/build/settings | 2 +- 14 files changed, 105 insertions(+), 105 deletions(-) rename level_3/utf8/c/{private-utf8_binary.c => private-utf8_bytecode.c} (84%) rename level_3/utf8/c/{private-utf8_binary.h => private-utf8_bytecode.h} (59%) diff --git a/level_3/utf8/c/common.c b/level_3/utf8/c/common.c index ad3b961..20e8b88 100644 --- a/level_3/utf8/c/common.c +++ b/level_3/utf8/c/common.c @@ -38,7 +38,7 @@ extern "C" { #endif // _di_utf8_defines_ #ifndef _di_utf8_parameters_ - const f_string_static_t utf8_short_from_binary_s = macro_f_string_static_t_initialize(UTF8_short_from_binary_s, 0, UTF8_short_from_binary_s_length); + const f_string_static_t utf8_short_from_bytecode_s = macro_f_string_static_t_initialize(UTF8_short_from_bytecode_s, 0, UTF8_short_from_bytecode_s_length); const f_string_static_t utf8_short_from_codepoint_s = macro_f_string_static_t_initialize(UTF8_short_from_codepoint_s, 0, UTF8_short_from_codepoint_s_length); const f_string_static_t utf8_short_from_file_s = macro_f_string_static_t_initialize(UTF8_short_from_file_s, 0, UTF8_short_from_file_s_length); @@ -47,13 +47,13 @@ extern "C" { const f_string_static_t utf8_short_strip_invalid_s = macro_f_string_static_t_initialize(UTF8_short_strip_invalid_s, 0, UTF8_short_strip_invalid_s_length); const f_string_static_t utf8_short_verify_s = macro_f_string_static_t_initialize(UTF8_short_verify_s, 0, UTF8_short_verify_s_length); - const f_string_static_t utf8_short_to_binary_s = macro_f_string_static_t_initialize(UTF8_short_to_binary_s, 0, UTF8_short_to_binary_s_length); + const f_string_static_t utf8_short_to_bytecode_s = macro_f_string_static_t_initialize(UTF8_short_to_bytecode_s, 0, UTF8_short_to_bytecode_s_length); const f_string_static_t utf8_short_to_codepoint_s = macro_f_string_static_t_initialize(UTF8_short_to_codepoint_s, 0, UTF8_short_to_codepoint_s_length); const f_string_static_t utf8_short_to_combining_s = macro_f_string_static_t_initialize(UTF8_short_to_combining_s, 0, UTF8_short_to_combining_s_length); const f_string_static_t utf8_short_to_file_s = macro_f_string_static_t_initialize(UTF8_short_to_file_s, 0, UTF8_short_to_file_s_length); const f_string_static_t utf8_short_to_width_s = macro_f_string_static_t_initialize(UTF8_short_to_width_s, 0, UTF8_short_to_width_s_length); - const f_string_static_t utf8_long_from_binary_s = macro_f_string_static_t_initialize(UTF8_long_from_binary_s, 0, UTF8_long_from_binary_s_length); + const f_string_static_t utf8_long_from_bytecode_s = macro_f_string_static_t_initialize(UTF8_long_from_bytecode_s, 0, UTF8_long_from_bytecode_s_length); const f_string_static_t utf8_long_from_codepoint_s = macro_f_string_static_t_initialize(UTF8_long_from_codepoint_s, 0, UTF8_long_from_codepoint_s_length); const f_string_static_t utf8_long_from_file_s = macro_f_string_static_t_initialize(UTF8_long_from_file_s, 0, UTF8_long_from_file_s_length); @@ -62,7 +62,7 @@ extern "C" { const f_string_static_t utf8_long_strip_invalid_s = macro_f_string_static_t_initialize(UTF8_long_strip_invalid_s, 0, UTF8_long_strip_invalid_s_length); const f_string_static_t utf8_long_verify_s = macro_f_string_static_t_initialize(UTF8_long_verify_s, 0, UTF8_long_verify_s_length); - const f_string_static_t utf8_long_to_binary_s = macro_f_string_static_t_initialize(UTF8_long_to_binary_s, 0, UTF8_long_to_binary_s_length); + const f_string_static_t utf8_long_to_bytecode_s = macro_f_string_static_t_initialize(UTF8_long_to_bytecode_s, 0, UTF8_long_to_bytecode_s_length); const f_string_static_t utf8_long_to_codepoint_s = macro_f_string_static_t_initialize(UTF8_long_to_codepoint_s, 0, UTF8_long_to_codepoint_s_length); const f_string_static_t utf8_long_to_combining_s = macro_f_string_static_t_initialize(UTF8_long_to_combining_s, 0, UTF8_long_to_combining_s_length); const f_string_static_t utf8_long_to_file_s = macro_f_string_static_t_initialize(UTF8_long_to_file_s, 0, UTF8_long_to_file_s_length); diff --git a/level_3/utf8/c/common.h b/level_3/utf8/c/common.h index c71d95e..ab64ec5 100644 --- a/level_3/utf8/c/common.h +++ b/level_3/utf8/c/common.h @@ -141,7 +141,7 @@ extern "C" { * The main program parameters. */ #ifndef _di_utf8_parameters_ - #define UTF8_short_from_binary_s "b" + #define UTF8_short_from_bytecode_s "b" #define UTF8_short_from_codepoint_s "c" #define UTF8_short_from_file_s "f" @@ -150,13 +150,13 @@ extern "C" { #define UTF8_short_strip_invalid_s "s" #define UTF8_short_verify_s "v" - #define UTF8_short_to_binary_s "B" + #define UTF8_short_to_bytecode_s "B" #define UTF8_short_to_codepoint_s "C" #define UTF8_short_to_combining_s "O" #define UTF8_short_to_file_s "F" #define UTF8_short_to_width_s "W" - #define UTF8_long_from_binary_s "from_binary" + #define UTF8_long_from_bytecode_s "from_bytecode" #define UTF8_long_from_codepoint_s "from_codepoint" #define UTF8_long_from_file_s "from_file" @@ -165,13 +165,13 @@ extern "C" { #define UTF8_long_strip_invalid_s "strip_invalid" #define UTF8_long_verify_s "verify" - #define UTF8_long_to_binary_s "to_binary" + #define UTF8_long_to_bytecode_s "to_bytecode" #define UTF8_long_to_codepoint_s "to_codepoint" #define UTF8_long_to_combining_s "to_combining" #define UTF8_long_to_file_s "to_file" #define UTF8_long_to_width_s "to_width" - #define UTF8_short_from_binary_s_length 1 + #define UTF8_short_from_bytecode_s_length 1 #define UTF8_short_from_codepoint_s_length 1 #define UTF8_short_from_file_s_length 1 @@ -180,13 +180,13 @@ extern "C" { #define UTF8_short_strip_invalid_s_length 1 #define UTF8_short_verify_s_length 1 - #define UTF8_short_to_binary_s_length 1 + #define UTF8_short_to_bytecode_s_length 1 #define UTF8_short_to_codepoint_s_length 1 #define UTF8_short_to_combining_s_length 1 #define UTF8_short_to_file_s_length 1 #define UTF8_short_to_width_s_length 1 - #define UTF8_long_from_binary_s_length 11 + #define UTF8_long_from_bytecode_s_length 13 #define UTF8_long_from_codepoint_s_length 14 #define UTF8_long_from_file_s_length 9 @@ -195,13 +195,13 @@ extern "C" { #define UTF8_long_strip_invalid_s_length 13 #define UTF8_long_verify_s_length 6 - #define UTF8_long_to_binary_s_length 9 + #define UTF8_long_to_bytecode_s_length 11 #define UTF8_long_to_codepoint_s_length 12 #define UTF8_long_to_combining_s_length 12 #define UTF8_long_to_file_s_length 7 #define UTF8_long_to_width_s_length 8 - extern const f_string_static_t utf8_short_from_binary_s; + extern const f_string_static_t utf8_short_from_bytecode_s; extern const f_string_static_t utf8_short_from_codepoint_s; extern const f_string_static_t utf8_short_from_file_s; @@ -210,13 +210,13 @@ extern "C" { extern const f_string_static_t utf8_short_strip_invalid_s; extern const f_string_static_t utf8_short_verify_s; - extern const f_string_static_t utf8_short_to_binary_s; + extern const f_string_static_t utf8_short_to_bytecode_s; extern const f_string_static_t utf8_short_to_codepoint_s; extern const f_string_static_t utf8_short_to_combining_s; extern const f_string_static_t utf8_short_to_file_s; extern const f_string_static_t utf8_short_to_width_s; - extern const f_string_static_t utf8_long_from_binary_s; + extern const f_string_static_t utf8_long_from_bytecode_s; extern const f_string_static_t utf8_long_from_codepoint_s; extern const f_string_static_t utf8_long_from_file_s; @@ -225,7 +225,7 @@ extern "C" { extern const f_string_static_t utf8_long_strip_invalid_s; extern const f_string_static_t utf8_long_verify_s; - extern const f_string_static_t utf8_long_to_binary_s; + extern const f_string_static_t utf8_long_to_bytecode_s; extern const f_string_static_t utf8_long_to_codepoint_s; extern const f_string_static_t utf8_long_to_combining_s; extern const f_string_static_t utf8_long_to_file_s; @@ -242,7 +242,7 @@ extern "C" { utf8_parameter_verbosity_debug_e, utf8_parameter_version_e, - utf8_parameter_from_binary_e, + utf8_parameter_from_bytecode_e, utf8_parameter_from_codepoint_e, utf8_parameter_from_file_e, @@ -250,7 +250,7 @@ extern "C" { utf8_parameter_separate_e, utf8_parameter_strip_invalid_e, - utf8_parameter_to_binary_e, + utf8_parameter_to_bytecode_e, utf8_parameter_to_codepoint_e, utf8_parameter_to_combining_e, utf8_parameter_to_file_e, @@ -270,13 +270,13 @@ extern "C" { macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \ macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \ macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \ - macro_f_console_parameter_t_initialize(utf8_short_from_binary_s.string, utf8_long_from_binary_s.string, 0, 0, f_console_type_normal_e), \ + macro_f_console_parameter_t_initialize(utf8_short_from_bytecode_s.string, utf8_long_from_bytecode_s.string, 0, 0, f_console_type_normal_e), \ macro_f_console_parameter_t_initialize(utf8_short_from_codepoint_s.string, utf8_long_from_codepoint_s.string, 0, 0, f_console_type_normal_e), \ macro_f_console_parameter_t_initialize(utf8_short_from_file_s.string, utf8_long_from_file_s.string, 0, 1, f_console_type_normal_e), \ macro_f_console_parameter_t_initialize(utf8_short_headers_s.string, utf8_long_headers_s.string, 0, 0, f_console_type_normal_e), \ macro_f_console_parameter_t_initialize(utf8_short_separate_s.string, utf8_long_headers_s.string, 0, 0, f_console_type_normal_e), \ macro_f_console_parameter_t_initialize(utf8_short_strip_invalid_s.string, utf8_long_strip_invalid_s.string, 0, 0, f_console_type_normal_e), \ - macro_f_console_parameter_t_initialize(utf8_short_to_binary_s.string, utf8_long_to_binary_s.string, 0, 0, f_console_type_normal_e), \ + macro_f_console_parameter_t_initialize(utf8_short_to_bytecode_s.string, utf8_long_to_bytecode_s.string, 0, 0, f_console_type_normal_e), \ macro_f_console_parameter_t_initialize(utf8_short_to_codepoint_s.string, utf8_long_to_codepoint_s.string, 0, 0, f_console_type_normal_e), \ macro_f_console_parameter_t_initialize(utf8_short_to_combining_s.string, utf8_long_to_combining_s.string, 0, 0, f_console_type_normal_e), \ macro_f_console_parameter_t_initialize(utf8_short_to_file_s.string, utf8_long_to_file_s.string, 0, 1, f_console_type_normal_e), \ @@ -291,19 +291,19 @@ extern "C" { * Modes used to designate how to the input and output are to be processed. * * utf8_mode_from_*: - * - binary: The input format is binary. + * - bytecode: The input format is bytecode. * - codepoint: The input format is codepoint (U+XXXX or U+XXXXXX). * * utf8_mode_to_*: - * - binary: The outout format is binary. + * - bytecode: The outout format is bytecode. * - codepoint: The outout format is codepoint (U+XXXX or U+XXXXXX). * - combining: The outout format is whether or not character is combining (may be used with "width"). * - width: The outout format is how wide the character is (may be used with "combining"). */ #ifndef _di_utf8_modes_ - #define utf8_mode_from_binary_d 0x1 + #define utf8_mode_from_bytecode_d 0x1 #define utf8_mode_from_codepoint_d 0x2 - #define utf8_mode_to_binary_d 0x4 + #define utf8_mode_to_bytecode_d 0x4 #define utf8_mode_to_codepoint_d 0x8 #define utf8_mode_to_combining_d 0x10 #define utf8_mode_to_width_d 0x20 diff --git a/level_3/utf8/c/private-common.h b/level_3/utf8/c/private-common.h index a291ee2..38652c2 100644 --- a/level_3/utf8/c/private-common.h +++ b/level_3/utf8/c/private-common.h @@ -71,7 +71,7 @@ extern "C" { 0, \ 0, \ f_file_t_initialize, \ - utf8_mode_from_binary_d | utf8_mode_to_codepoint_d, \ + utf8_mode_from_bytecode_d | utf8_mode_to_codepoint_d, \ f_color_set_t_initialize, \ f_color_set_t_initialize, \ f_string_static_t_initialize, \ diff --git a/level_3/utf8/c/private-print.c b/level_3/utf8/c/private-print.c index 780f9b2..754c7d7 100644 --- a/level_3/utf8/c/private-print.c +++ b/level_3/utf8/c/private-print.c @@ -6,12 +6,12 @@ extern "C" { #endif -#ifndef _di_utf8_print_binary_ - void utf8_print_binary(utf8_data_t * const data, const f_string_static_t character) { +#ifndef _di_utf8_print_bytecode_ + void utf8_print_bytecode(utf8_data_t * const data, const f_string_static_t character) { fl_print_format("%r%r%r", data->file.stream, data->prepend, character, data->append); } -#endif // _di_utf8_print_binary_ +#endif // _di_utf8_print_bytecode_ #ifndef _di_utf8_print_character_invalid_ void utf8_print_character_invalid(utf8_data_t * const data, const f_string_static_t character) { @@ -24,7 +24,7 @@ extern "C" { if ((data->mode & utf8_mode_to_combining_d) || (data->mode & utf8_mode_to_width_d)) { utf8_print_combining_or_width(data, character); } - else if (data->mode & utf8_mode_to_binary_d) { + else if (data->mode & utf8_mode_to_bytecode_d) { fl_print_format("%r%[%r%]%r", data->file.stream, data->prepend, data->valid_not, character, data->valid_not, data->append); } else if (data->mode & utf8_mode_from_codepoint_d) { diff --git a/level_3/utf8/c/private-print.h b/level_3/utf8/c/private-print.h index a4033a7..df35aa0 100644 --- a/level_3/utf8/c/private-print.h +++ b/level_3/utf8/c/private-print.h @@ -13,7 +13,7 @@ extern "C" { #endif /** - * Print the binary character (such as '豸'). + * Print the bytecode character (such as '豸'). * * @param data * The program data. @@ -21,12 +21,12 @@ extern "C" { * The character to print. * This is a string that represents a single character. */ -#ifndef _di_utf8_print_binary_ - extern void utf8_print_binary(utf8_data_t * const data, const f_string_static_t character) F_attribute_visibility_internal_d; -#endif // _di_utf8_print_binary_ +#ifndef _di_utf8_print_bytecode_ + extern void utf8_print_bytecode(utf8_data_t * const data, const f_string_static_t character) F_attribute_visibility_internal_d; +#endif // _di_utf8_print_bytecode_ /** - * Print an invalid character either as a Unicode codeblock or as a binary. + * Print an invalid character either as a Unicode codeblock or as a bytecode. * * This handles whether or not the invalid character should be printed or not based on program parameters. * diff --git a/level_3/utf8/c/private-utf8.c b/level_3/utf8/c/private-utf8.c index 255a46e..3ac7858 100644 --- a/level_3/utf8/c/private-utf8.c +++ b/level_3/utf8/c/private-utf8.c @@ -2,7 +2,7 @@ #include "private-common.h" #include "private-print.h" #include "private-utf8.h" -#include "private-utf8_binary.h" +#include "private-utf8_bytecode.h" #include "private-utf8_codepoint.h" #ifdef __cplusplus @@ -40,8 +40,8 @@ extern "C" { status = F_none; - if (data->mode & utf8_mode_from_binary_d) { - status = utf8_convert_binary(data, text); + if (data->mode & utf8_mode_from_bytecode_d) { + status = utf8_convert_bytecode(data, text); } else { status = utf8_detect_codepoint(data, text, &mode_codepoint); @@ -65,7 +65,7 @@ extern "C" { utf8_process_text_width(&text); } // for - if (F_status_is_error_not(status) && !(data->mode & utf8_mode_from_binary_d)) { + if (F_status_is_error_not(status) && !(data->mode & utf8_mode_from_bytecode_d)) { if (mode_codepoint != utf8_codepoint_mode_ready_e && mode_codepoint != utf8_codepoint_mode_end_e && mode_codepoint != utf8_codepoint_mode_bad_end_e) { if (mode_codepoint == utf8_codepoint_mode_number_e) { mode_codepoint = utf8_codepoint_mode_end_e; diff --git a/level_3/utf8/c/private-utf8.h b/level_3/utf8/c/private-utf8.h index 6670bda..9fbad00 100644 --- a/level_3/utf8/c/private-utf8.h +++ b/level_3/utf8/c/private-utf8.h @@ -26,11 +26,11 @@ extern "C" { * F_false on success and contains invalid sequences. * F_interrupt on (exit) signal received. * - * Errors (with error bit) from: utf8_convert_binary() + * Errors (with error bit) from: utf8_convert_bytecode() * Errors (with error bit) from: utf8_convert_codepoint() * Errors (with error bit) from: utf8_detect_codepoint() * - * @see utf8_convert_binary() + * @see utf8_convert_bytecode() * @see utf8_convert_codepoint() * @see utf8_detect_codepoint() * @see utf8_signal_received() diff --git a/level_3/utf8/c/private-utf8_binary.c b/level_3/utf8/c/private-utf8_bytecode.c similarity index 84% rename from level_3/utf8/c/private-utf8_binary.c rename to level_3/utf8/c/private-utf8_bytecode.c index b5f440b..77271d1 100644 --- a/level_3/utf8/c/private-utf8_binary.c +++ b/level_3/utf8/c/private-utf8_bytecode.c @@ -2,15 +2,15 @@ #include "private-common.h" #include "private-print.h" #include "private-utf8.h" -#include "private-utf8_binary.h" +#include "private-utf8_bytecode.h" #include "private-utf8_codepoint.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_utf8_convert_binary_ - f_status_t utf8_convert_binary(utf8_data_t * const data, const f_string_static_t character) { +#ifndef _di_utf8_convert_bytecode_ + f_status_t utf8_convert_bytecode(utf8_data_t * const data, const f_string_static_t character) { f_status_t status = F_none; bool valid_not = F_false; @@ -41,8 +41,8 @@ extern "C" { } } else if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) { - if (data->mode & utf8_mode_to_binary_d) { - utf8_print_binary(data, character); + if (data->mode & utf8_mode_to_bytecode_d) { + utf8_print_bytecode(data, character); } else if (data->mode & utf8_mode_to_codepoint_d) { utf8_print_codepoint(data, codepoint); @@ -58,10 +58,10 @@ extern "C" { return F_none; } -#endif // _di_utf8_convert_binary_ +#endif // _di_utf8_convert_bytecode_ -#ifndef _di_utf8_process_file_binary_ - f_status_t utf8_process_file_binary(utf8_data_t * const data, const f_file_t file) { +#ifndef _di_utf8_process_file_bytecode_ + f_status_t utf8_process_file_bytecode(utf8_data_t * const data, const f_file_t file) { f_status_t status = F_none; @@ -107,8 +107,8 @@ extern "C" { } // for if (j == character.used) { - if (data->mode & utf8_mode_from_binary_d) { - status = utf8_convert_binary(data, character); + if (data->mode & utf8_mode_from_bytecode_d) { + status = utf8_convert_bytecode(data, character); } else { status = utf8_detect_codepoint(data, character, &mode_codepoint); @@ -136,8 +136,8 @@ extern "C" { if (F_status_is_error_not(status) && status != F_interrupt && next == F_false) { character.used = j; - if (data->mode & utf8_mode_from_binary_d) { - status = utf8_convert_binary(data, character); + if (data->mode & utf8_mode_from_bytecode_d) { + status = utf8_convert_bytecode(data, character); } else { status = utf8_detect_codepoint(data, character, &mode_codepoint); @@ -160,7 +160,7 @@ extern "C" { return valid; } -#endif // _di_utf8_process_file_binary_ +#endif // _di_utf8_process_file_bytecode_ #ifdef __cplusplus } // extern "C" diff --git a/level_3/utf8/c/private-utf8_binary.h b/level_3/utf8/c/private-utf8_bytecode.h similarity index 59% rename from level_3/utf8/c/private-utf8_binary.h rename to level_3/utf8/c/private-utf8_bytecode.h index 43ee503..65ea852 100644 --- a/level_3/utf8/c/private-utf8_binary.h +++ b/level_3/utf8/c/private-utf8_bytecode.h @@ -5,15 +5,15 @@ * API Version: 0.5 * Licenses: lgpl-2.1-or-later */ -#ifndef _PRIVATE_utf8_binary_h -#define _PRIVATE_utf8_binary_h +#ifndef _PRIVATE_utf8_bytecode_h +#define _PRIVATE_utf8_bytecode_h #ifdef __cplusplus extern "C" { #endif /** - * Convert a binary character to another format. + * Convert a bytecode character to another format. * * This automatically determines the output format and is also handles the verify process. * @@ -31,12 +31,12 @@ extern "C" { * * Errors (with error bit) from: f_utf_unicode_to() */ -#ifndef _di_utf8_convert_binary_ - extern f_status_t utf8_convert_binary(utf8_data_t * const data, const f_string_static_t character) F_attribute_visibility_internal_d; -#endif // _di_utf8_convert_binary_ +#ifndef _di_utf8_convert_bytecode_ + extern f_status_t utf8_convert_bytecode(utf8_data_t * const data, const f_string_static_t character) F_attribute_visibility_internal_d; +#endif // _di_utf8_convert_bytecode_ /** - * Process file as a binary input, handling conversion or verification as appropriate. + * Process file as a bytecode input, handling conversion or verification as appropriate. * * @param data * The program data. @@ -49,19 +49,19 @@ extern "C" { * F_false on success and contains invalid sequences. * F_interrupt on (exit) signal received. * - * Errors (with error bit) from: utf8_convert_binary() + * Errors (with error bit) from: utf8_convert_bytecode() * Errors (with error bit) from: utf8_detect_codepoint() * * @see fll_program_standard_signal_received() - * @see utf8_convert_binary() + * @see utf8_convert_bytecode() * @see utf8_detect_codepoint() */ -#ifndef _di_utf8_process_file_binary_ - extern f_status_t utf8_process_file_binary(utf8_data_t * const data, const f_file_t file) F_attribute_visibility_internal_d; -#endif // _di_utf8_process_file_binary_ +#ifndef _di_utf8_process_file_bytecode_ + extern f_status_t utf8_process_file_bytecode(utf8_data_t * const data, const f_file_t file) F_attribute_visibility_internal_d; +#endif // _di_utf8_process_file_bytecode_ #ifdef __cplusplus } // extern "C" #endif -#endif // _PRIVATE_utf8_binary_h +#endif // _PRIVATE_utf8_bytecode_h diff --git a/level_3/utf8/c/private-utf8_codepoint.c b/level_3/utf8/c/private-utf8_codepoint.c index 6df7b29..5b8e927 100644 --- a/level_3/utf8/c/private-utf8_codepoint.c +++ b/level_3/utf8/c/private-utf8_codepoint.c @@ -2,7 +2,7 @@ #include "private-common.h" #include "private-print.h" #include "private-utf8.h" -#include "private-utf8_binary.h" +#include "private-utf8_bytecode.h" #include "private-utf8_codepoint.h" #ifdef __cplusplus @@ -52,7 +52,7 @@ extern "C" { } } else if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) { - if (data->mode & utf8_mode_to_binary_d) { + if (data->mode & utf8_mode_to_bytecode_d) { f_char_t byte[5] = { 0, 0, 0, 0, 0 }; f_string_static_t character = macro_f_string_static_t_initialize2(byte, 5); @@ -65,7 +65,7 @@ extern "C" { status = F_none; character.used = macro_f_utf_byte_width(character.string[0]); - utf8_print_binary(data, character); + utf8_print_bytecode(data, character); } } else if (data->mode & utf8_mode_to_codepoint_d) { @@ -243,8 +243,8 @@ extern "C" { } // for if (j == character.used) { - if (data->mode & utf8_mode_from_binary_d) { - status = utf8_convert_binary(data, character); + if (data->mode & utf8_mode_from_bytecode_d) { + status = utf8_convert_bytecode(data, character); } else { status = utf8_detect_codepoint(data, character, &mode_codepoint); @@ -272,8 +272,8 @@ extern "C" { if (F_status_is_error_not(status) && status != F_interrupt && next == F_false) { character.used = j; - if (data->mode & utf8_mode_from_binary_d) { - status = utf8_convert_binary(data, character); + if (data->mode & utf8_mode_from_bytecode_d) { + status = utf8_convert_bytecode(data, character); } else { status = utf8_detect_codepoint(data, character, &mode_codepoint); diff --git a/level_3/utf8/c/private-utf8_codepoint.h b/level_3/utf8/c/private-utf8_codepoint.h index fcd935c..acb0730 100644 --- a/level_3/utf8/c/private-utf8_codepoint.h +++ b/level_3/utf8/c/private-utf8_codepoint.h @@ -70,11 +70,11 @@ extern "C" { * F_false on success and contains invalid sequences. * F_interrupt on (exit) signal received. * - * Errors (with error bit) from: utf8_convert_binary() + * Errors (with error bit) from: utf8_convert_bytecode() * Errors (with error bit) from: utf8_detect_codepoint() * * @see fll_program_standard_signal_received() - * @see utf8_convert_binary() + * @see utf8_convert_bytecode() * @see utf8_detect_codepoint() */ #ifndef _di_utf8_process_file_codepoint_ diff --git a/level_3/utf8/c/utf8.c b/level_3/utf8/c/utf8.c index 3d78dc6..4471b84 100644 --- a/level_3/utf8/c/utf8.c +++ b/level_3/utf8/c/utf8.c @@ -2,7 +2,7 @@ #include "private-common.h" #include "private-print.h" #include "private-utf8.h" -#include "private-utf8_binary.h" +#include "private-utf8_bytecode.h" #include "private-utf8_codepoint.h" #ifdef __cplusplus @@ -28,13 +28,13 @@ extern "C" { f_print_dynamic_raw(f_string_eol_s, file.stream); - fll_program_print_help_option(file, context, utf8_short_from_binary_s, utf8_long_from_binary_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The expected input format is binary (character data)."); + fll_program_print_help_option(file, context, utf8_short_from_bytecode_s, utf8_long_from_bytecode_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The expected input format is bytecode (character data)."); fll_program_print_help_option(file, context, utf8_short_from_codepoint_s, utf8_long_from_codepoint_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The expected input format is codepoint (such as U+0000)."); fll_program_print_help_option(file, context, utf8_short_from_file_s, utf8_long_from_file_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use the given file as the input source."); f_print_dynamic_raw(f_string_eol_s, file.stream); - fll_program_print_help_option(file, context, utf8_short_to_binary_s, utf8_long_to_binary_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The output format is binary (character data)."); + fll_program_print_help_option(file, context, utf8_short_to_bytecode_s, utf8_long_to_bytecode_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The output format is bytecode (character data)."); fll_program_print_help_option(file, context, utf8_short_to_codepoint_s, utf8_long_to_codepoint_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The output format is codepoint (such as U+0000)."); fll_program_print_help_option(file, context, utf8_short_to_combining_s, utf8_long_to_combining_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The output format is to print whether or not character is combining or not."); fll_program_print_help_option(file, context, utf8_short_to_file_s, utf8_long_to_file_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use the given file as the output destination."); @@ -49,7 +49,7 @@ extern "C" { fll_program_print_help_usage(file, context, utf8_program_name_s, utf8_program_help_parameters_s); - fl_print_format(" The default behavior is to assume the expected input is binary from the command line to be output to the screen as codepoints.%r%r", file.stream, f_string_eol_s, f_string_eol_s); + fl_print_format(" The default behavior is to assume the expected input is bytecode from the command line to be output to the screen as codepoints.%r%r", file.stream, f_string_eol_s, f_string_eol_s); fl_print_format(" Multiple input sources are allowed but only a single output destination is allowed.%r%r", file.stream, f_string_eol_s, f_string_eol_s); @@ -150,7 +150,7 @@ extern "C" { // Identify and prioritize from mode parameters. { - f_console_parameter_id_t ids[2] = { utf8_parameter_from_binary_e, utf8_parameter_from_codepoint_e }; + f_console_parameter_id_t ids[2] = { utf8_parameter_from_bytecode_e, utf8_parameter_from_codepoint_e }; f_console_parameter_id_t choice = 0; const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 2); @@ -164,16 +164,16 @@ extern "C" { return status; } - if (choice == utf8_parameter_from_binary_e) { + if (choice == utf8_parameter_from_bytecode_e) { if (data.mode & utf8_mode_from_codepoint_d) { data.mode -= utf8_mode_from_codepoint_d; } - data.mode |= utf8_mode_from_binary_d; + data.mode |= utf8_mode_from_bytecode_d; } else if (choice == utf8_parameter_from_codepoint_e) { - if (data.mode & utf8_mode_from_binary_d) { - data.mode -= utf8_mode_from_binary_d; + if (data.mode & utf8_mode_from_bytecode_d) { + data.mode -= utf8_mode_from_bytecode_d; } data.mode |= utf8_mode_from_codepoint_d; @@ -182,7 +182,7 @@ extern "C" { // Identify and prioritize to mode parameters. { - f_console_parameter_id_t ids[4] = { utf8_parameter_to_binary_e, utf8_parameter_to_codepoint_e, utf8_parameter_to_combining_e, utf8_parameter_to_width_e }; + f_console_parameter_id_t ids[4] = { utf8_parameter_to_bytecode_e, utf8_parameter_to_codepoint_e, utf8_parameter_to_combining_e, utf8_parameter_to_width_e }; f_console_parameter_id_t choice = 0; const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 4); @@ -196,7 +196,7 @@ extern "C" { return status; } - if (choice == utf8_parameter_to_binary_e) { + if (choice == utf8_parameter_to_bytecode_e) { if (data.mode & utf8_mode_to_codepoint_d) { data.mode -= utf8_mode_to_codepoint_d; } @@ -209,11 +209,11 @@ extern "C" { data.mode -= utf8_mode_to_width_d; } - data.mode |= utf8_mode_to_binary_d; + data.mode |= utf8_mode_to_bytecode_d; } else if (choice == utf8_parameter_to_codepoint_e) { - if (data.mode & utf8_mode_to_binary_d) { - data.mode -= utf8_mode_to_binary_d; + if (data.mode & utf8_mode_to_bytecode_d) { + data.mode -= utf8_mode_to_bytecode_d; } if (data.mode & utf8_mode_to_combining_d) { @@ -227,8 +227,8 @@ extern "C" { data.mode |= utf8_mode_to_codepoint_d; } else if (choice == utf8_parameter_to_combining_e) { - if (data.mode & utf8_mode_to_binary_d) { - data.mode -= utf8_mode_to_binary_d; + if (data.mode & utf8_mode_to_bytecode_d) { + data.mode -= utf8_mode_to_bytecode_d; } if (data.mode & utf8_mode_to_codepoint_d) { @@ -243,8 +243,8 @@ extern "C" { data.mode |= utf8_mode_to_combining_d; } else if (choice == utf8_parameter_to_width_e) { - if (data.mode & utf8_mode_to_binary_d) { - data.mode -= utf8_mode_to_binary_d; + if (data.mode & utf8_mode_to_bytecode_d) { + data.mode -= utf8_mode_to_bytecode_d; } if (data.mode & utf8_mode_to_codepoint_d) { @@ -354,7 +354,7 @@ extern "C" { status = F_status_set_error(F_parameter); } - if (!(data.mode & utf8_mode_to_binary_d)) { + if (!(data.mode & utf8_mode_to_bytecode_d)) { if (main->parameters.array[utf8_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[utf8_parameter_headers_e].result == f_console_result_found_e) { data.prepend = utf8_string_prepend_padding_s; data.append = f_string_eol_s; @@ -378,15 +378,15 @@ extern "C" { utf8_print_section_header_pipe(&data); - if (data.mode & utf8_mode_from_binary_d) { - status = utf8_process_file_binary(&data, file); + if (data.mode & utf8_mode_from_bytecode_d) { + status = utf8_process_file_bytecode(&data, file); } else { status = utf8_process_file_codepoint(&data, file); } if (F_status_is_error(status) && F_status_set_fine(status) != F_utf_fragment) { - fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_binary_d ? "utf8_process_file_binary" : "utf8_process_file_codepoint", F_true, f_string_empty_s, f_file_operation_process_s, fll_error_file_type_pipe_e); + fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_bytecode_d ? "utf8_process_file_bytecode" : "utf8_process_file_codepoint", F_true, f_string_empty_s, f_file_operation_process_s, fll_error_file_type_pipe_e); } } @@ -420,8 +420,8 @@ extern "C" { break; } - if (data.mode & utf8_mode_from_binary_d) { - status = utf8_process_file_binary(&data, file); + if (data.mode & utf8_mode_from_bytecode_d) { + status = utf8_process_file_bytecode(&data, file); } else { status = utf8_process_file_codepoint(&data, file); @@ -436,7 +436,7 @@ extern "C" { } if (F_status_is_error(status) && F_status_set_fine(status) != F_utf_fragment) { - fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_binary_d ? "utf8_process_file_binary" : "utf8_process_file_codepoint", F_true, data.argv[index], f_file_operation_process_s, fll_error_file_type_file_e); + fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_bytecode_d ? "utf8_process_file_bytecode" : "utf8_process_file_codepoint", F_true, data.argv[index], f_file_operation_process_s, fll_error_file_type_file_e); break; } diff --git a/level_3/utf8/c/utf8.h b/level_3/utf8/c/utf8.h index 1d65bac..8d02b14 100644 --- a/level_3/utf8/c/utf8.h +++ b/level_3/utf8/c/utf8.h @@ -8,10 +8,10 @@ * This is intendend to support Unicode 14.0. * * This is a program for handling basic UTF-8 related conversions. - * - Convert from UTF-8 character to binary. - * - Convert from Unicode Codepoint (such as U+0000) to binary. - * - Convert from UTF-8 binary to character. - * - Convert from UTF-8 binary to Unicode Codepoint (such as U+0000). + * - Convert from UTF-8 character to bytecode. + * - Convert from Unicode Codepoint (such as U+0000) to bytecode. + * - Convert from UTF-8 bytecode to character. + * - Convert from UTF-8 bytecode to Unicode Codepoint (such as U+0000). */ #ifndef _utf8_h #define _utf8_h diff --git a/level_3/utf8/data/build/settings b/level_3/utf8/data/build/settings index d33c4b1..344825b 100644 --- a/level_3/utf8/data/build/settings +++ b/level_3/utf8/data/build/settings @@ -22,7 +22,7 @@ build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library utf8.c common.c private-common.c private-print.c private-utf8.c private-utf8_binary.c private-utf8_codepoint.c +build_sources_library utf8.c common.c private-common.c private-print.c private-utf8.c private-utf8_bytecode.c private-utf8_codepoint.c build_sources_program main.c -- 1.8.3.1