The symbols are being added in stages.
Add the currency and modifier symbols.
Update several comments with the todo and fixme notations.
* 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
}
#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
* 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.
*/
/**
* KFS Filesystem Paths
- * @todo outdated, needs to be updated.
*/
#ifndef _di_path_tree_kevux_standard_
/**
* FHS Filesystem Paths
- * @todo outdated, needs to be updated.
*/
#ifndef _di_path_tree_hierarchy_standard_
/**
* 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.
*
* 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"
#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;
}
*
* 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
return private_f_utf_character_is_emoji(character_utf);
}
- if (isdigit(*character)) {
- return F_true;
- }
-
return F_false;
}
#endif // _di_f_utf_is_emoji_
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;
}
/**
* 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.
/**
* 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.
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_
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;
}
/**
* 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.
*
/**
* 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.
*
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 {
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;
}
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 {
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;
}
* 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.
*
* 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).
* 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.
* 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).
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;
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) {
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
* 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.
*
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;