From: Kevin Day Date: Sun, 29 May 2022 21:03:15 +0000 (-0500) Subject: Update: Add Unicode Symbols for currency and modifiers and minor comment clean ups. X-Git-Tag: 0.5.10~86 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=d645e4677a7b27a009b71c66f6a628af7201268c;p=fll Update: Add Unicode Symbols for currency and modifiers and minor comment clean ups. The symbols are being added in stages. Add the currency and modifier symbols. Update several comments with the todo and fixme notations. --- diff --git a/level_0/f_conversion/c/conversion.h b/level_0/f_conversion/c/conversion.h index 3dd1f65..f700c7f 100644 --- a/level_0/f_conversion/c/conversion.h +++ b/level_0/f_conversion/c/conversion.h @@ -6,9 +6,6 @@ * Licenses: lgpl-2.1-or-later * * Provide means to convert one data type to another, such as a string to an integer. - * - * @fixme Currently these functions are very inefficient. - * These will be improved once I have finished studying on the matter. */ #ifndef _F_conversion_h #define _F_conversion_h diff --git a/level_0/f_conversion/c/private-conversion.c b/level_0/f_conversion/c/private-conversion.c index 7d92665..189c8e7 100644 --- a/level_0/f_conversion/c/private-conversion.c +++ b/level_0/f_conversion/c/private-conversion.c @@ -308,7 +308,7 @@ extern "C" { } #ifdef _is_F_endian_big - work <<= 1; // @todo review this and see if there is more that needs to be done. + work <<= 1; #else work >>= 1; #endif // _is_F_endian_big diff --git a/level_0/f_file/c/file.h b/level_0/f_file/c/file.h index 970f247..e0a4dcf 100644 --- a/level_0/f_file/c/file.h +++ b/level_0/f_file/c/file.h @@ -8,7 +8,7 @@ * Provides structures and data types for a file I/O. * Provides operations for opening/closing files. * - * @fixme Currently this uses makedev(3) to create devices, which is non-standad. + * @fixme Currently this uses makedev(3) to create devices, which is non-standard. * The documentation for mknod(2) isn't clear on how to make major/minor based block and character devices. * Find out how to implement this and elliminate the use of the non-standard makedev(3) call. */ diff --git a/level_0/f_path/c/path/common.h b/level_0/f_path/c/path/common.h index 193767f..8793afc 100644 --- a/level_0/f_path/c/path/common.h +++ b/level_0/f_path/c/path/common.h @@ -70,7 +70,6 @@ extern "C" { /** * KFS Filesystem Paths - * @todo outdated, needs to be updated. */ #ifndef _di_path_tree_kevux_standard_ @@ -198,7 +197,6 @@ extern "C" { /** * FHS Filesystem Paths - * @todo outdated, needs to be updated. */ #ifndef _di_path_tree_hierarchy_standard_ diff --git a/level_0/f_print/c/print/common.h b/level_0/f_print/c/print/common.h index 36ac6fb..26a1fce 100644 --- a/level_0/f_print/c/print/common.h +++ b/level_0/f_print/c/print/common.h @@ -212,8 +212,6 @@ extern "C" { /** * Provide type format flags. * - * @todo There may or may not be support in the future for min/max type sizes, such that "%n" = min, "%m" = max, and "%niii" = min int8_t. - * * f_print_format_type_*: * - character: "c", Type is a 1-byte unsigned character. * - character_safe: "C", Type is a 1-byte unsigned character, where control characters and invalid UTF-8 are replaced. diff --git a/level_0/f_string/c/string/static.h b/level_0/f_string/c/string/static.h index fba5b4c..f9e3c59 100644 --- a/level_0/f_string/c/string/static.h +++ b/level_0/f_string/c/string/static.h @@ -144,8 +144,6 @@ extern "C" { * * The NULL ASCII string can be represented by the integer 0; however, given that these are all NULL-terminated strings the NULL character is represented with a NULL termination as well. * The NULL ASCII string therefore has two NULLs, first the NULL represents the NULL and the second represents the NULL termination. - * - * @todo provide extended ASCII-characters. */ #ifndef _di_string_ascii_s_ #define F_string_ascii_0_s "0" diff --git a/level_0/f_utf/c/private-utf_symbol.c b/level_0/f_utf/c/private-utf_symbol.c index d32e3ef..979e36a 100644 --- a/level_0/f_utf/c/private-utf_symbol.c +++ b/level_0/f_utf/c/private-utf_symbol.c @@ -9,7 +9,242 @@ extern "C" { #if !defined(_di_f_utf_character_is_symbol_) || !defined(_di_f_utf_is_symbol_) f_status_t private_f_utf_character_is_symbol(const f_utf_char_t character) { - // @todo handle all Unicode "symbol". + if (macro_f_utf_char_t_width_is(character) == 2) { + + if (macro_f_utf_char_t_to_char_1(character) == 0xc2) { + + // Latin-1 Supplement: U+00A2 to U+00A5. + if (character >= 0xc2a20000 && character <= 0xc2a50000) { + return F_true; + } + + // Latin-1 Supplement: U+00A8, U+00AF, U+00B4, U+00B8. + if (character == 0xc2a80000 || character == 0xc2af0000 || character == 0xc2b40000 || character == 0xc2b80000) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_1(character) == 0xcb) { + + // Spacing Modifier Letters: U+02C2 to U+02C5. + if (character >= 0xcb820000 && character <= 0xcb850000) { + return F_true; + } + + // Spacing Modifier Letters: U+02D2 to U+02DF. + if (character >= 0xcb920000 && character <= 0xcb9f0000) { + return F_true; + } + + // Spacing Modifier Letters: U+02E5 to U+02EB. + if (character >= 0xcba50000 && character <= 0xcbab0000) { + return F_true; + } + + // Spacing Modifier Letters: U+02ED to U+02FF. + if (character >= 0xcbad0000 && character <= 0xcbbf0000) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_1(character) == 0xcd) { + + // Greek and Coptic: U+0375. + if (character == 0xcdb50000) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_1(character) == 0xce) { + + // Greek and Coptic: U+0384, U+0385. + if (character == 0xce840000 || character == 0xce850000) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_1(character) == 0xd6) { + + // Armenian: U+00A2. + if (character == 0xd68f0000) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_1(character) == 0xd8) { + + // Arabic: U+00A2. + if (character == 0xd88b0000) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_1(character) == 0xdf) { + + // NKo: U+07FE, U+07FF. + if (character == 0xdfbe0000 || character == 0xdfbf0000) { + return F_true; + } + } + return F_false; + } + + if (macro_f_utf_char_t_width_is(character) == 3) { + + if (macro_f_utf_char_t_to_char_1(character) == 0xe0) { + + // Arabic Extended-B: U+0888. + if (character == 0xe0a28800) { + return F_true; + } + + // Bengali: U+09F2, U+09F3, U+09FB. + if (character == 0xe0a7b200 || character == 0xe0a7b300 || character == 0xe0a7bb00) { + return F_true; + } + + // Gujarati: U+0AF1. + if (character == 0xe0abb100) { + return F_true; + } + + // Tamil: U+0BF9. + if (character == 0xe0afb900) { + return F_true; + } + + // Thai: U+0E3F. + if (character == 0xe0b8bf00) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_1(character) == 0xe1) { + + // Khmer: U+17DB. + if (character == 0xe19f9b00) { + return F_true; + } + + // Greek Extended: U+1FBD, U+1FBF, U+1FC0, U+1FC1. + if (character == 0xe1bebd00 || character == 0xe1bebf00 || character == 0xe1bf8000 || character == 0xe1bf8100) { + return F_true; + } + + // Greek Extended: U+1FCD to U+1FCF. + if (character >= 0xe1bf8d00 && character <= 0xe1bf8f00) { + return F_true; + } + + // Greek Extended: U+1FDD to U+1FDF. + if (character >= 0xe1bf9d00 && character <= 0xe1bf9f00) { + return F_true; + } + + // Greek Extended: U+1FED to U+1FEF. + if (character >= 0xe1bfad00 && character <= 0xe1bfaf00) { + return F_true; + } + + // Greek Extended: U+1FFD, U+1FFE. + if (character == 0xe1bfbd00 || character == 0xe1bfbe00) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_1(character) == 0xe2) { + + // Currency Symbols: U+20A0 to U+20C0. + if (character >= 0xe282a000 && character <= 0xe2838000) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_1(character) == 0xe3) { + + // Hiragana: U+309B, U+309C. + if (character == 0xe3829b00 || character == 0xe3829c00) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_1(character) == 0xea) { + + // Modifier Tone Letters: U+A700 to U+A716. + if (character >= 0xea9c8000 && character <= 0xea9c9600) { + return F_true; + } + + // Modifier Tone Letters: U+A720, U+A721. + if (character == 0xea9ca000 || character == 0xea9ca100) { + return F_true; + } + + // Latin Extended-D: U+A789, U+A78A. + if (character == 0xea9e8900 || character == 0xea9e8a00) { + return F_true; + } + + // Common Indic Number Forms: U+A838. + if (character == 0xeaa0b800) { + return F_true; + } + + // Latin Extended-E: U+AB5B, U+AB6A, U+AB6B. + if (character == 0xeaad9b00 || character == 0xeaadaa00 || character == 0xeaadab00) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_1(character) == 0xef) { + + // Arabic Presentation Forms-A: U+FBB2 to U+FBC2. + if (character >= 0xefaeb200 && character <= 0xefaf8200) { + return F_true; + } + + // Arabic Presentation Forms-A: U+FDFC. + if (character == 0xefb7bc00) { + return F_true; + } + + // Small Form Variants: U+FE69. + if (character == 0xefb9a900) { + return F_true; + } + + // Halfwidth and Fullwidth Forms: U+FF04, U+FF3E, U+FF40, U+FFE0. + if (character == 0xefbc8400 || character == 0xefbcbe00 || character == 0xefbd8000 || character == 0xefbfa000) { + return F_true; + } + + // Halfwidth and Fullwidth Forms: U+FFE1, U+FFE3, U+FFE5, U+FFE6. + if (character == 0xefbfa100 || character == 0xefbfa300 || character == 0xefbfa500 || character == 0xefbfa600) { + return F_true; + } + } + + return F_false; + } + + if (macro_f_utf_char_t_to_char_1(character) == 0xf0) { + + if (macro_f_utf_char_t_to_char_2(character) == 0x91) { + + // Tamil Supplement: U+11FDD to U+11FE0. + if (character >= 0xf091bf9d && character <= 0xf091bfa0) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_2(character) == 0x9e) { + + // Wancho: U+1E2FF. + if (character == 0xf09e8bbf) { + return F_true; + } + + // Indic Siyaq Numbers: U+ECB0. + if (character == 0xf09eb2b0) { + return F_true; + } + } + else if (macro_f_utf_char_t_to_char_2(character) == 0x9f) { + + // Miscellaneous Symbols and Pictographs: U+1F3FB to U+1F3FF. + if (character >= 0xf09f8fbb && character <= 0xf09f8fbf) { + return F_true; + } + } + } return F_false; } diff --git a/level_0/f_utf/c/utf/common.h b/level_0/f_utf/c/utf/common.h index ab11825..ff4634f 100644 --- a/level_0/f_utf/c/utf/common.h +++ b/level_0/f_utf/c/utf/common.h @@ -7,8 +7,6 @@ * * Defines common data to be used for/by project utf. * - * @fixme this code probably only works on little-endian only as-is, this needs to be checked for and possibly redesign to support both big or little. - * * This is auto-included by utf.h and should not need to be explicitly included. */ #ifndef _F_utf_common_h diff --git a/level_0/f_utf/c/utf/is.c b/level_0/f_utf/c/utf/is.c index 76a658a..eda7421 100644 --- a/level_0/f_utf/c/utf/is.c +++ b/level_0/f_utf/c/utf/is.c @@ -366,10 +366,6 @@ extern "C" { return private_f_utf_character_is_emoji(character_utf); } - if (isdigit(*character)) { - return F_true; - } - return F_false; } #endif // _di_f_utf_is_emoji_ @@ -666,17 +662,17 @@ extern "C" { return private_f_utf_character_is_symbol(character_utf); } - // ASCII: '$' or '+'. + // ASCII: U+0024 ('$') or U+002B ('+'). if (character[0] == 0x24 || character[0] == 0x2b) { return F_true; } - // ASCII: '<' to '>'. + // ASCII: U+003C ('<') to U+003E ('>'). if (character[0] > 0x3c && character[0] < 0x3e) { return F_true; } - // ASCII: '^', '`', '|', or '~'. + // ASCII: U+005E ('^'), U+0060 ('`'), U+007C ('|'), or U+007E ('~'). if (character[0] == 0x5e || character[0] == 0x60 || character[0] == 0x7c || character[0] == 0x7e) { return F_true; } diff --git a/level_0/f_utf/c/utf/is.h b/level_0/f_utf/c/utf/is.h index 1f97518..ebfec66 100644 --- a/level_0/f_utf/c/utf/is.h +++ b/level_0/f_utf/c/utf/is.h @@ -281,8 +281,6 @@ extern "C" { /** * Check to see if the entire byte block of the character is an ASCII or UTF-8 emoji character. * - * @todo Incomplete, UTF-8 codes not yet checked! - * * @param character * The character to validate. * There must be enough space allocated to compare against, as limited by width_max. @@ -432,8 +430,6 @@ extern "C" { /** * Check to see if the entire byte block of the character is an ASCII or UTF-8 punctuation character. * - * @todo Incomplete, UTF-8 codes not yet checked! - * * @param character * The character to validate. * There must be enough space allocated to compare against, as limited by width_max. diff --git a/level_0/f_utf/c/utf/is_character.c b/level_0/f_utf/c/utf/is_character.c index 05f0410..744ca94 100644 --- a/level_0/f_utf/c/utf/is_character.c +++ b/level_0/f_utf/c/utf/is_character.c @@ -223,10 +223,6 @@ extern "C" { return private_f_utf_character_is_emoji(character); } - if (isdigit(macro_f_utf_char_t_to_char_1(character))) { - return F_true; - } - return F_false; } #endif // _di_f_utf_character_is_emoji_ @@ -406,17 +402,17 @@ extern "C" { return private_f_utf_character_is_symbol(character); } - // ASCII: '$' or '+'. + // ASCII: U+0024 ('$') or U+002B ('+'). if (character == 0x24000000 || character == 0x2b000000) { return F_true; } - // ASCII: '<' to '>'. + // ASCII: U+003C ('<') to U+003E ('>'). if (character > 0x3c000000 && character < 0x3e000000) { return F_true; } - // ASCII: '^', '`', '|', or '~'. + // ASCII: U+005E ('^'), U+0060 ('`'), U+007C ('|'), or U+007E ('~'). if (character == 0x5e000000 || character == 0x60000000 || character == 0x7c000000 || character == 0x7e000000) { return F_true; } diff --git a/level_0/f_utf/c/utf/is_character.h b/level_0/f_utf/c/utf/is_character.h index 1f1ee2c..50be205 100644 --- a/level_0/f_utf/c/utf/is_character.h +++ b/level_0/f_utf/c/utf/is_character.h @@ -238,8 +238,6 @@ extern "C" { /** * Check to see if the entire byte block of the character is an ASCII or UTF-8 emoji character. * - * @todo Incomplete, UTF-8 codes not yet checked! - * * @param character * The character to validate. * @@ -367,8 +365,6 @@ extern "C" { /** * Check to see if the entire byte block of the character is an ASCII or UTF-8 punctuation character. * - * @todo Incomplete, UTF-8 codes not yet checked! - * * @param character * The character to validate. * diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c index 46a5597..fb138b9 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -391,7 +391,7 @@ extern "C" { if (range->start > range->stop || range->start >= buffer.used) { // EOS or EOL was reached, so it is a valid closing quoted. - // (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE (@todo maybe none on stop?). + // (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; } else { @@ -402,7 +402,7 @@ extern "C" { else { // EOS or EOL was reached, so it is a valid closing quoted. - // (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE (@todo maybe none on stop?). + // (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; } @@ -549,7 +549,7 @@ extern "C" { if (range->start > range->stop || range->start >= buffer.used) { // EOS or EOL was reached, so it is a valid closing quoted. - // (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE (@todo maybe none on stop?). + // (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; } else { @@ -560,7 +560,7 @@ extern "C" { else { // EOS or EOL was reached, so it is a valid closing quoted. - // (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE (@todo maybe none on stop?). + // (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; } diff --git a/level_2/fll_fss/c/fss/basic.h b/level_2/fll_fss/c/fss/basic.h index 1be437f..3b06544 100644 --- a/level_2/fll_fss/c/fss/basic.h +++ b/level_2/fll_fss/c/fss/basic.h @@ -62,7 +62,7 @@ extern "C" { * F_none on success. * F_none_eos on success after reaching the end of the buffer. * F_none_stop on success after reaching stopping point. - * F_data_not_eol if there is no data to write and EOL was reached (@todo review related code and detemine what this is doing). + * F_data_not_eol if there is no data to write and EOL was reached. * F_data_not_eos no data to write due start location being greater than or equal to buffer size. * F_data_not_stop no data to write due start location being greater than stop location. * diff --git a/level_2/fll_fss/c/fss/embedded_list.h b/level_2/fll_fss/c/fss/embedded_list.h index d3c8c98..5e9d553 100644 --- a/level_2/fll_fss/c/fss/embedded_list.h +++ b/level_2/fll_fss/c/fss/embedded_list.h @@ -59,7 +59,7 @@ extern "C" { * F_none on success (both valid object and valid content found with start location is at end of content). * F_none_eos on success after reaching the end of the buffer (both valid object and valid content found with start location is at end of buffer). * F_none_stop on success after reaching stopping point (both valid object and valid content found with start location is at stop point). - * F_data_not_eol if there is no data to write and EOL was reached (@todo review related code and detemine what this is doing). + * F_data_not_eol if there is no data to write and EOL was reached. * F_data_not_eos no data to write due start location being greater than or equal to buffer size. * F_data_not_stop no data to write due start location being greater than stop location. * F_fss_found_object_content_not on success and object was found but no content was found (start location is at end of object). diff --git a/level_2/fll_fss/c/fss/extended.h b/level_2/fll_fss/c/fss/extended.h index 0ff0535..ed4d425 100644 --- a/level_2/fll_fss/c/fss/extended.h +++ b/level_2/fll_fss/c/fss/extended.h @@ -66,7 +66,7 @@ extern "C" { * F_none_eos on success after reaching the end of the buffer. * F_data_not_stop no data to write due start location being greater than stop location. * F_data_not_eos no data to write due start location being greater than or equal to buffer size. - * F_data_not_eol if there is no data to write and EOL was reached (@todo review related code and detemine what this is doing). + * F_data_not_eol if there is no data to write and EOL was reached. * * F_number_overflow (with error bit) if the maximum buffer size is reached. * F_parameter (with error bit) if a parameter is invalid. diff --git a/level_2/fll_fss/c/fss/extended_list.h b/level_2/fll_fss/c/fss/extended_list.h index cbb623c..142b989 100644 --- a/level_2/fll_fss/c/fss/extended_list.h +++ b/level_2/fll_fss/c/fss/extended_list.h @@ -63,7 +63,7 @@ extern "C" { * F_none on success (both valid object and valid content found with start location is at end of content). * F_none_eos on success after reaching the end of the buffer (both valid object and valid content found with start location is at end of buffer). * F_none_stop on success after reaching stopping point (both valid object and valid content found with start location is at stop point). - * F_data_not_eol if there is no data to write and EOL was reached (@todo review related code and detemine what this is doing). + * F_data_not_eol if there is no data to write and EOL was reached. * F_data_not_eos no data to write due start location being greater than or equal to buffer size. * F_data_not_stop no data to write due start location being greater than stop location. * F_fss_found_object_content_not on success and object was found but no content was found (start location is at end of object). diff --git a/level_3/fake/c/private-make-operate_process_type.c b/level_3/fake/c/private-make-operate_process_type.c index 4f45a3d..1ebf270 100644 --- a/level_3/fake/c/private-make-operate_process_type.c +++ b/level_3/fake/c/private-make-operate_process_type.c @@ -665,7 +665,6 @@ extern "C" { state_process->condition_result = fake_condition_result_true_e; - // @fixme This needs to handle converting numbers with decimals (like 1.01), perhaps operate on them as strings or provide a special processor. range.start = 0; range.stop = arguments.array[i].used - 1; diff --git a/level_3/fake/c/private-make-operate_validate.c b/level_3/fake/c/private-make-operate_validate.c index 5d615f5..8769bf4 100644 --- a/level_3/fake/c/private-make-operate_validate.c +++ b/level_3/fake/c/private-make-operate_validate.c @@ -1011,7 +1011,6 @@ extern "C" { f_number_unsigned_t number = 0; bool is_negative = F_false; - // @fixme there needs to handle converting numbers with decimals (like 1.01), perhaps operate on them as strings or provide a special processor. for (i = k; i < arguments.used; ++i, status_number = F_none) { if (arguments.array[i].used) { @@ -1415,13 +1414,13 @@ extern "C" { if (!name.used) return F_none; - if (!(isalpha(name.string[0]) || name.string[0] == '_')) { + if (!isalpha(name.string[0]) && name.string[0] != '_') { return F_false; } for (f_array_length_t i = 1; i < name.used; ++i) { - if (!(isalnum(name.string[i]) || name.string[i] == '_')) { + if (!isalnum(name.string[i]) && name.string[i] != '_') { return F_false; } } // for diff --git a/level_3/fake/c/private-make-operate_validate.h b/level_3/fake/c/private-make-operate_validate.h index 617ae7b..2371abe 100644 --- a/level_3/fake/c/private-make-operate_validate.h +++ b/level_3/fake/c/private-make-operate_validate.h @@ -45,8 +45,6 @@ extern "C" { * Every character after that may be alphanumeric or underscore. * All other characters, including Unicode characters, are invalid. * - * @fixme make this UTF-8 friendly. - * * @param name * The variable name string to validate. * diff --git a/level_3/fss_payload_write/c/fss_payload_write.c b/level_3/fss_payload_write/c/fss_payload_write.c index 3b0f1d5..53a7bab 100644 --- a/level_3/fss_payload_write/c/fss_payload_write.c +++ b/level_3/fss_payload_write/c/fss_payload_write.c @@ -406,9 +406,6 @@ extern "C" { f_string_dynamic_t buffer = f_string_dynamic_t_initialize; - // @todo Go through the list of Objects, if given, and confirm that payload is specified and is specified last, otherwise error out. - // @todo a new parameter needs to exist for specifying that a Content is a payload for cases where Object is not given (and then this needs to verify that only a single Content is given). - if (F_status_is_error_not(status)) { f_string_dynamic_t escaped = f_string_dynamic_t_initialize;