Now that f_char_t exists and is in use, rename f_utf_character_t to f_utf_char_t to be consistent (and simpler).
The endianness detection is incorrect.
The BIG_ENDIAN is not represented as expected.
Change the detection to use GCC's __BYTE_ORDER__ macros.
Fallback to little endian if those macros are not available.
It took a while to figure out this was the problem and I got rather confused going back and forth between byte orders.
I think the changes I made are correct, but I need additional better testing on the byte orders.
if (arguments.argv[location][sub_location] != *parameters->array[i].symbol_short) continue;
if (width > 0) {
- f_utf_character_t character_argument_utf = 0;
- f_utf_character_t character_console_utf = 0;
+ f_utf_char_t character_argument_utf = 0;
+ f_utf_char_t character_console_utf = 0;
f_number_unsigned_t width_max = parameters->arguments.array[location].used - sub_location;
}
#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
return F_none;
}
}
- else if (macro_f_utf_character_t_width_is(character) == 1) {
+ else if (macro_f_utf_char_t_width_is(character) == 1) {
if (fwrite_unlocked(f_print_sequence_unknown_s.string, 1, f_print_sequence_unknown_s.used, output) == f_print_sequence_unknown_s.used) {
return F_none;
}
}
- else if (macro_f_utf_character_t_width_is(character) > 1 || character > 0x1f) {
+ else if (macro_f_utf_char_t_width_is(character) > 1 || character > 0x1f) {
if (fwrite_unlocked(&character, 1, 1, output)) {
return F_utf;
}
for (register f_array_length_t i = 0; string[i]; ) {
safe.used = 0;
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
if (width > 1) {
if (string[i + 1]) {
return F_none;
}
}
- else if (macro_f_utf_character_t_width_is(character) == 1) {
+ else if (macro_f_utf_char_t_width_is(character) == 1) {
if (write(id, f_print_sequence_unknown_s.string, f_print_sequence_unknown_s.used) != -1) {
return F_none;
}
}
- else if (macro_f_utf_character_t_width_is(character) > 1 || character > 0x1f) {
+ else if (macro_f_utf_char_t_width_is(character) > 1 || character > 0x1f) {
if (write(id, &character, 1) != -1) {
return F_none;
}
}
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
}
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
}
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
}
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
while (i < length) {
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
while (i < length) {
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
for (register f_array_length_t i = 0; string[i]; ) {
safe = f_string_empty_s;
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
if (width > 1) {
if (string[i + 1]) {
return f_print_sequence_delete_s;
}
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return f_print_sequence_unknown_s;
}
- if (macro_f_utf_character_t_width_is(character) > 1 || character > 0x1f) {
+ if (macro_f_utf_char_t_width_is(character) > 1 || character > 0x1f) {
return f_string_empty_s;
}
}
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
}
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
}
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
}
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
while (i < length) {
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
while (i < length) {
if (string[i]) {
- width = macro_f_utf_character_t_width(string[i]);
+ width = macro_f_utf_char_t_width(string[i]);
safe = private_f_print_safely_get(string + i, width);
}
return f_print_sequence_delete_s;
}
- if (macro_f_utf_character_t_width_is(character[0])) {
+ if (macro_f_utf_char_t_width_is(character[0])) {
if (f_utf_is_valid(character, width_max) != F_true || f_utf_is_control(character, width_max)) {
return f_print_sequence_unknown_s;
}
* This is placed here because status is first and endianness must be set before everything else.
*
* Define either _is_F_endian_big or _is_F_endian_little (but not both) to override compiler detected endianness or to manually set endianness if not detected.
+ *
+ * Fallback to little endian if unable to detect.
+ *
+ * Manually define _is_F_endian_big or _is_F_endian_little to control this rather than relying on autodetection.
*/
#if !defined(_is_F_endian_big) && !defined(_is_F_endian_little)
- #ifdef BIG_ENDIAN
- #define _is_F_endian_big
+ #ifdef __BYTE_ORDER__
+ #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ #define _is_F_endian_big
+ #else
+ #define _is_F_endian_little
+ #endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#else
#define _is_F_endian_little
- #endif // BIG_ENDIAN
+ #endif // __BYTE_ORDER__
#endif // !defined(_is_F_endian_big) && !defined(_is_F_endian_little)
/**
}
if (destination->used) {
- memmove(destination->string + length, destination->string, destination->used);
+ memmove(destination->string + length, destination->string, sizeof(f_char_t) * destination->used);
memcpy(destination->string, source, sizeof(f_char_t) * length);
}
else {
}
destination->used += length;
+
return F_none;
}
#endif // !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_)
if (F_status_is_error(status)) return status;
}
- memmove(destination->string + offset + size, destination->string + offset, destination->used - offset);
- memcpy(destination->string + offset, source + first, size);
+ memmove(destination->string + offset + size, destination->string + offset, sizeof(f_char_t) * (destination->used - offset));
+ memcpy(destination->string + offset, source + first, sizeof(f_char_t) * size);
destination->used += size;
offset += size;
if (F_status_is_error(status)) return status;
}
- memmove(destination->string + offset + size, destination->string + offset, destination->used - offset);
+ memmove(destination->string + offset + size, destination->string + offset, sizeof(f_char_t) * (destination->used - offset));
memcpy(destination->string + offset, source + first, sizeof(f_char_t) * size);
destination->used += size;
} // while
first = i + 1;
+
continue;
}
} // for
{
const f_status_t status = f_string_dynamic_partial_append_assure(source, partial, &destination);
- printf("\nDEBUG: [%d]='%s %s'\n", destination.used, destination.string, destination.string + 3);
-
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
#endif
#if !defined(_di_f_utf_char_to_character_) || !defined(_di_f_utf_is_alpha_) || !defined(_di_f_utf_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_numeric_) || !defined(_di_f_utf_is_ascii_) || !defined(_di_f_utf_is_combining_) || !defined(_di_f_utf_is_control_) || !defined(_di_f_utf_is_control_picture_) || !defined(_di_f_utf_is_digit_) || !defined(_di_f_utf_is_emoji_) || !defined(_di_f_utf_is_graph_) || !defined(_di_f_utf_is_numeric_) || !defined(_di_f_utf_is_phonetic_) || !defined(_di_f_utf_is_private_) || !defined(_di_f_utf_is_punctuation_) || !defined(_di_f_utf_is_surrogate_) || !defined(_di_f_utf_is_symbol_) || !defined(_di_f_utf_is_unassigned_) || !defined(_di_f_utf_is_valid_) || !defined(_di_f_utf_is_whitespace_) || !defined(_di_f_utf_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_other_) || !defined(_di_f_utf_is_wide_) || !defined(_di_f_utf_is_word_) || !defined(_di_f_utf_is_word_dash_) || !defined(_di_f_utf_is_word_dash_plus_) || !defined(_di_f_utf_is_zero_width_) || !defined(f_utf_unicode_to)
- f_status_t private_f_utf_char_to_character(const f_string_t character, const f_array_length_t width_max, f_utf_character_t *character_utf) {
+ f_status_t private_f_utf_char_to_character(const f_string_t character, const f_array_length_t width_max, f_utf_char_t *character_utf) {
if (!macro_f_utf_byte_width_is(*character)) {
- *character_utf = macro_f_utf_character_t_from_char_1(character[0]);
+ *character_utf = macro_f_utf_char_t_from_char_1(character[0]);
return F_none;
}
return F_status_set_error(F_failure);
}
- *character_utf = macro_f_utf_character_t_from_char_1(character[0]);
+ *character_utf = macro_f_utf_char_t_from_char_1(character[0]);
if (macro_f_utf_byte_width_is(*character) < 2) {
return F_none;
}
- *character_utf |= macro_f_utf_character_t_from_char_2(character[1]);
+ *character_utf |= macro_f_utf_char_t_from_char_2(character[1]);
if (macro_f_utf_byte_width_is(*character) == 2) {
return F_none;
}
- *character_utf |= macro_f_utf_character_t_from_char_3(character[2]);
+ *character_utf |= macro_f_utf_char_t_from_char_3(character[2]);
if (macro_f_utf_byte_width_is(*character) == 3) {
return F_none;
}
- *character_utf |= macro_f_utf_character_t_from_char_4(character[3]);
+ *character_utf |= macro_f_utf_char_t_from_char_4(character[3]);
return F_none;
}
#endif // !defined(_di_f_utf_char_to_character_) || !defined(_di_f_utf_is_alpha_) || !defined(_di_f_utf_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_numeric_) || !defined(_di_f_utf_is_ascii_) || !defined(_di_f_utf_is_combining_) || !defined(_di_f_utf_is_control_) || !defined(_di_f_utf_is_control_picture_) || !defined(_di_f_utf_is_digit_) || !defined(_di_f_utf_is_emoji_) || !defined(_di_f_utf_is_graph_) || !defined(_di_f_utf_is_numeric_) || !defined(_di_f_utf_is_phonetic_) || !defined(_di_f_utf_is_private_) || !defined(_di_f_utf_is_punctuation_) || !defined(_di_f_utf_is_surrogate_) || !defined(_di_f_utf_is_symbol_) || !defined(_di_f_utf_is_unassigned_) || !defined(_di_f_utf_is_valid_) || !defined(_di_f_utf_is_whitespace_) || !defined(_di_f_utf_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_other_) || !defined(_di_f_utf_is_wide_) || !defined(_di_f_utf_is_word_) || !defined(_di_f_utf_is_word_dash_) || !defined(_di_f_utf_is_word_dash_plus_) || !defined(_di_f_utf_is_zero_width_) || !defined(f_utf_unicode_to)
#if !defined(_di_f_utf_character_is_alpha_) || !defined(_di_f_utf_is_alpha_)
- f_status_t private_f_utf_character_is_alpha(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_alpha(const f_utf_char_t character) {
if (private_f_utf_character_is_zero_width(character)) {
return F_false;
#endif // !defined(_di_f_utf_character_is_alpha_) || !defined(_di_f_utf_is_alpha_)
#if !defined(_di_f_utf_character_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_digit_)
- f_status_t private_f_utf_character_is_alpha_digit(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_alpha_digit(const f_utf_char_t character) {
if (private_f_utf_character_is_digit(character)) {
return F_true;
#endif // !defined(_di_f_utf_character_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_digit_)
#if !defined(_di_f_utf_character_is_alpha_numeric_) || !defined(_di_f_utf_is_alpha_numeric_)
- f_status_t private_f_utf_character_is_alpha_numeric(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_alpha_numeric(const f_utf_char_t character) {
if (private_f_utf_character_is_numeric(character)) {
return F_true;
#endif // !defined(_di_f_utf_character_is_alpha_numeric_) || !defined(_di_f_utf_is_alpha_numeric_)
#if !defined(_di_f_utf_character_is_ascii_) || !defined(_di_f_utf_is_ascii_)
- f_status_t private_f_utf_character_is_ascii(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_ascii(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) < 2) {
- if (macro_f_utf_character_t_to_char_1(character) >= 0x00 && macro_f_utf_character_t_to_char_1(character) <= 0x7f) {
+ if (macro_f_utf_char_t_width_is(character) < 2) {
+ if (macro_f_utf_char_t_to_char_1(character) >= 0x00 && macro_f_utf_char_t_to_char_1(character) <= 0x7f) {
return F_true;
}
}
#endif // !defined(_di_f_utf_character_is_ascii_) || !defined(_di_f_utf_is_ascii_)
#if !defined(_di_f_utf_character_is_combining_) || !defined(_di_f_utf_is_combining_)
- f_status_t private_f_utf_character_is_combining(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_combining(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_width_is(character) == 2) {
// Diacritical Marks: U+0300 to U+036F.
if (character >= 0xcc800000 && character <= 0xcdaf0000) {
return F_false;
}
- if (macro_f_utf_character_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
// Samaritan: U+0816 to U+0819.
if (character >= 0xe0a09600 && character <= 0xe0a09900) {
#endif // !defined(_di_f_utf_character_is_combining_) || !defined(_di_f_utf_is_combining_)
#if !defined(_di_f_utf_character_is_control_) || !defined(_di_f_utf_is_control_)
- f_status_t private_f_utf_character_is_control(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_control(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_width_is(character) == 2) {
// Control Codes.
return F_true;
}
}
- else if (macro_f_utf_character_t_width_is(character) == 3) {
+ else if (macro_f_utf_char_t_width_is(character) == 3) {
// Control Formats.
return F_true;
}
}
- else if (macro_f_utf_character_t_width_is(character) == 4) {
+ else if (macro_f_utf_char_t_width_is(character) == 4) {
// Control Formats.
#endif // !defined(_di_f_utf_character_is_control_) || !defined(_di_f_utf_is_control_)
#if !defined(_di_f_utf_character_is_control_code_) || !defined(_di_f_utf_is_control_code_)
- f_status_t private_f_utf_character_is_control_code(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_control_code(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_width_is(character) == 2) {
// Latin-1 Supplement: U+0080 to U+009F.
if (character >= 0xc2800000 && character <= 0xc29f0000) {
#endif // !defined(_di_f_utf_character_is_control_code_) || !defined(_di_f_utf_is_contro_codel_)
#if !defined(_di_f_utf_character_is_control_format_) || !defined(_di_f_utf_is_control_format_)
- f_status_t private_f_utf_character_is_control_format(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_control_format(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_width_is(character) == 2) {
// Latin-1 Supplement: U+00AD.
if (character == 0xc2ad0000) {
return F_true;
}
}
- else if (macro_f_utf_character_t_width_is(character) == 3) {
+ else if (macro_f_utf_char_t_width_is(character) == 3) {
// Arabic Extended-A: U+08E2.
if (character == 0xe0a3a200) {
return F_true;
}
}
- else if (macro_f_utf_character_t_width_is(character) == 4) {
+ else if (macro_f_utf_char_t_width_is(character) == 4) {
// Kaithi: U+110BD, U+110CD.
if (character == 0xf09182bd || character == 0xf091838d) {
#endif // !defined(_di_f_utf_character_is_control_format_) || !defined(_di_f_utf_is_control_format_)
#if !defined(_di_f_utf_character_is_control_picture_) || !defined(_di_f_utf_is_control_picture_)
- f_status_t private_f_utf_character_is_control_picture(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_control_picture(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
// Control Pictures: U+2400 to U+2426.
if (character >= 0xe2908000 && character <= 0xe290a600) {
#endif // !defined(_di_f_utf_character_is_control_picture_) || !defined(_di_f_utf_is_control_picture_)
#if !defined(_di_f_utf_character_is_digit_) || !defined(_di_f_utf_is_digit_)
- f_status_t private_f_utf_character_is_digit(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_digit(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_width_is(character) == 2) {
uint16_t bytes = (uint16_t) ((character & 0xffff0000) >> 16);
// Arabic: U+0660 to U+0669.
return F_false;
}
- if (macro_f_utf_character_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
uint16_t bytes = (uint16_t) ((character & 0x00ffff00) >> 8);
- if (macro_f_utf_character_t_to_char_1(character) == 0xe0) {
+ if (macro_f_utf_char_t_to_char_1(character) == 0xe0) {
// Devanagari: U+0966 to U+096F.
if (bytes >= 0xa5a6 && bytes <= 0xa5af) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xe1) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xe1) {
// Khmer: U+17E0 to U+17E9.
if (bytes >= 0x9fa0 && bytes <= 0x9fa9) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xea) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xea) {
// Vai: U+A620 to U+A629.
if (bytes >= 0x98a0 && bytes <= 0x98a9) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xef) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xef) {
// Halfwidth and Fullwidth Forms: U+FF10 to U+FF19.
if (bytes >= 0xbc90 && bytes <= 0xbc99) {
return F_false;
}
- if (macro_f_utf_character_t_width_is(character) == 4) {
+ if (macro_f_utf_char_t_width_is(character) == 4) {
uint16_t bytes = (uint16_t) ((character & 0xffff0000) >> 16);
- if (macro_f_utf_character_t_to_char_1(character) == 0xf0) {
- if (macro_f_utf_character_t_to_char_2(character) == 0x90) {
+ if (macro_f_utf_char_t_to_char_1(character) == 0xf0) {
+ if (macro_f_utf_char_t_to_char_2(character) == 0x90) {
// Osmanya: U+104A0 to U+104A9.
if (bytes >= 0x92a0 && bytes <= 0x92a9) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_2(character) == 0x91) {
+ else if (macro_f_utf_char_t_to_char_2(character) == 0x91) {
// Brahmi: U+11066 to U+1106F.
if (bytes >= 0x81a6 && bytes <= 0x81af) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_2(character) == 0x96) {
+ else if (macro_f_utf_char_t_to_char_2(character) == 0x96) {
// Mro: U+16A60 to U+16A69.
if (bytes >= 0xa9a0 && bytes <= 0xa9a9) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_2(character) == 0x9d) {
+ else if (macro_f_utf_char_t_to_char_2(character) == 0x9d) {
// Mathematical Alphanumeric (Bold) Symbols: U+1D7CE to U+1D7D7.
if (bytes >= 0x9f8e && bytes <= 0x9f97) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_2(character) == 0x9e) {
+ else if (macro_f_utf_char_t_to_char_2(character) == 0x9e) {
// Nyiakeng Puachue Hmong: U+1E140 to U+1E149.
if (bytes >= 0x8580 && bytes <= 0x8589) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_2(character) == 0x9f) {
+ else if (macro_f_utf_char_t_to_char_2(character) == 0x9f) {
// Symbols for Legacy Computing (Segmented): U+1FBF0 to U+1FBF9.
if (bytes >= 0xafb0 && bytes <= 0xafb9) {
#endif // !defined(_di_f_utf_character_is_digit_) || !defined(_di_f_utf_is_digit_)
#if !defined(_di_f_utf_character_is_emoji_) || !defined(_di_f_utf_is_emoji_)
- f_status_t private_f_utf_character_is_emoji(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_emoji(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_width_is(character) == 2) {
// Latin-1 Supplement: U+00A9, U+00AE.
if (character == 0xc2a90000 || character == 0xc2ae0000) {
return F_false;
}
- if (macro_f_utf_character_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
// General Punctuation: U+203C, U+2049.
if (character == 0xe280bc00 || character == 0xe2818900) {
return F_false;
}
- if (macro_f_utf_character_t_width_is(character) == 4) {
+ if (macro_f_utf_char_t_width_is(character) == 4) {
// U+1F0CF to U+1F171.
if (character >= 0xf09f8084 && character <= 0xf09f85b1) {
#endif // !defined(_di_f_utf_character_is_emoji_) || !defined(_di_f_utf_is_emoji_)
#if !defined(_di_f_utf_character_is_numeric_) || !defined(_di_f_utf_is_numeric_)
- f_status_t private_f_utf_character_is_numeric(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_numeric(const f_utf_char_t character) {
if (private_f_utf_character_is_digit(character)) {
return F_true;
// @todo add letter UTF-8 numbers.
// @todo add other UTF-8 numbers.
- if (macro_f_utf_character_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
// Number Forms: U+2150 to U+218B.
if (character >= 0xe2859000 && character <= 0xe2868b00) {
return F_true;
}
}
- else if (macro_f_utf_character_t_width_is(character) == 4) {
+ else if (macro_f_utf_char_t_width_is(character) == 4) {
// Coptic Epact Numbers: U+102E1 to U+102FB.
if (character >= 0xf0908ba1 && character <= 0xf0908bbb) {
#endif // !defined(_di_f_utf_character_is_numeric_) || !defined(_di_f_utf_is_numeric_)
#if !defined(_di_f_utf_character_is_phonetic_) || !defined(_di_f_utf_is_phonetic_)
- f_status_t private_f_utf_character_is_phonetic(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_phonetic(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
// Phonetic Extensions: U+1D00 to U+1D7F.
if (character >= 0xe1b48000 && character <= 0xe1b5bf00) {
#endif // !defined(_di_f_utf_character_is_phonetic_) || !defined(_di_f_utf_is_phonetic_)
#if !defined(_di_f_utf_character_is_private_) || !defined(_di_f_utf_is_private_)
- f_status_t private_f_utf_character_is_private(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_private(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) < 3) {
+ if (macro_f_utf_char_t_width_is(character) < 3) {
return F_false;
}
- if (macro_f_utf_character_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
// High Private Use Surrogates: U+DB80 to U+DBFF.
if (character >= 0xedae8000 && character <= 0xedafbf00) {
#endif // !defined(_di_f_utf_character_is_private_) || !defined(_di_f_utf_is_private_)
#if !defined(_di_f_utf_character_is_punctuation_) || !defined(_di_f_utf_is_punctuation_)
- f_status_t private_f_utf_character_is_punctuation(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_punctuation(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_width_is(character) == 2) {
- if (macro_f_utf_character_t_to_char_1(character) == 0xc2) {
+ if (macro_f_utf_char_t_to_char_1(character) == 0xc2) {
// Latin-1 Supplement: U+00A1, U+00A7, U+00B6, U+00B7.
if (character == 0xc2a10000 || character == 0xc2a70000 || character == 0xc2b60000 || character == 0xc2b70000) {
return F_true;
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xcd) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xcd) {
// Greek and Coptic: U+037E
if (character == 0xcdbe0000) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xce) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xce) {
// Greek and Coptic: U+0387
if (character == 0xce870000) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xd5) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xd5) {
// Armenian: U+055A to U+055
if (character >= 0xd59a0000 && character <= 0xd59f0000) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xd6) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xd6) {
// Armenian: U+0589
if (character == 0xd6890000) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xd7) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xd7) {
// Hebrew: U+05C0, U+05C3, U+05C6, U+05F3.
if (character == 0xd7800000 || character == 0xd7830000 || character == 0xd7860000 || character == 0xd7b30000) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xd8) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xd8) {
// Arabic: U+0609, U+060A, U+060C, U+060D.
if (character == 0xd8890000 || character == 0xd88a0000 || character == 0xd88c0000 || character == 0xd88d0000) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xd9) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xd9) {
// Arabic: U+061B, U+061E, U+061F, U+06D4.
if (character == 0xd89b0000 || character == 0xd89e0000 || character == 0xd89f0000 || character == 0xdb940000) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xdc) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xdc) {
// Syriac: U+0700 to U+070D.
if (character >= 0xdc800000 && character <= 0xdc8d0000) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xdf) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xdf) {
// NKo: U+07F7 to U+07F9.
if (character >= 0xdfb70000 && character <= 0xdfb90000) {
}
}
}
- else if (macro_f_utf_character_t_width_is(character) == 3) {
+ else if (macro_f_utf_char_t_width_is(character) == 3) {
- if (macro_f_utf_character_t_to_char_1(character) == 0xe0) {
+ if (macro_f_utf_char_t_to_char_1(character) == 0xe0) {
// Samaritan: U+0830 to U+083E.
if (character >= 0xe0a0b000 && character <= 0xe0a0be00) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xe1) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xe1) {
// Myanmar: U+104A to U+104F.
if (character >= 0xe1818a00 && character <= 0xe1818f00) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xe2) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xe2) {
// General Punctuation: U+2010 to U+2027.
if (character >= 0xe2809000 && character <= 0xe280a700) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xe3) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xe3) {
// CJK Symbols and Punctuation: U+3001 to U+3003.
if (character >= 0xe3808100 && character <= 0xe3808300) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xea) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xea) {
// Lisu: U+A4FE, U+A4FF.
if (character == 0xea93be00 || character == 0xea93bf00) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xef) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xef) {
// Vertical Forms: U+FE10 to U+FE19.
if (character >= 0xefb89000 && character <= 0xefb89900) {
}
}
}
- else if (macro_f_utf_character_t_width_is(character) == 4) {
- if (macro_f_utf_character_t_to_char_1(character) == 0xf0) {
- if (macro_f_utf_character_t_to_char_2(character) == 0x90) {
+ else if (macro_f_utf_char_t_width_is(character) == 4) {
+ if (macro_f_utf_char_t_to_char_1(character) == 0xf0) {
+ if (macro_f_utf_char_t_to_char_2(character) == 0x90) {
// Aegean Numbers: U+10100 to U+10102.
if (character >= 0xf0908480 && character <= 0xf0908482) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_2(character) == 0x91) {
+ else if (macro_f_utf_char_t_to_char_2(character) == 0x91) {
// Brahmi: U+11047 to U+1104D.
if (character >= 0xf0918187 && character <= 0xf091818d) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_2(character) == 0x92) {
+ else if (macro_f_utf_char_t_to_char_2(character) == 0x92) {
// Cuneiform Numbers and Punctuation: U+12470 to U+12474.
if (character >= 0xf09291b0 && character <= 0xf09291b4) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_2(character) == 0x96) {
+ else if (macro_f_utf_char_t_to_char_2(character) == 0x96) {
// Mro: U+16A6E, U+16A6F.
if (character == 0xf096a9ae || character == 0xf096a9af) {
#endif // !defined(_di_f_utf_character_is_punctuation_) || !defined(_di_f_utf_is_punctuation_)
#if !defined(_di_f_utf_character_is_surrogate_) || !defined(_di_f_utf_is_surrogate_)
- f_status_t private_f_utf_character_is_surrogate(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_surrogate(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
// High Surrogates: U+D800 to U+DB7F.
if (character >= 0xeda08000 && character <= 0xedadbf00) {
#endif // !defined(_di_f_utf_character_is_surrogate_) || !defined(_di_f_utf_is_surrogate_)
#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_character_t character) {
+ f_status_t private_f_utf_character_is_symbol(const f_utf_char_t character) {
// @todo handle all Unicode "symbol".
#endif // !defined(_di_f_utf_character_is_symbol_) || !defined(_di_f_utf_is_symbol_)
#if !defined(_di_f_utf_character_is_valid_) || !defined(_di_f_utf_is_valid_)
- f_status_t private_f_utf_character_is_valid(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_valid(const f_utf_char_t character) {
// @todo Check to see if this logic handles U+FDD0 to U+FDEF and any character ending in FFFE or FFFF.
// Codes U+FDD0 to U+FDEF are: 0xefb79000 to 0xefb7af00.
- if (macro_f_utf_character_t_width_is(character) < 2) {
- if (macro_f_utf_character_t_to_char_1(character) >= 0x00 && macro_f_utf_character_t_to_char_1(character) <= 0x7f) {
+ if (macro_f_utf_char_t_width_is(character) < 2) {
+ if (macro_f_utf_char_t_to_char_1(character) >= 0x00 && macro_f_utf_char_t_to_char_1(character) <= 0x7f) {
return F_true;
}
}
- else if (macro_f_utf_character_t_width_is(character) == 2) {
- if (macro_f_utf_character_t_to_char_1(character) >= 0xc2 && macro_f_utf_character_t_to_char_1(character) <= 0xdf) {
- if (macro_f_utf_character_t_to_char_2(character) >= 0x80 && macro_f_utf_character_t_to_char_2(character) <= 0xbf) {
+ else if (macro_f_utf_char_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_to_char_1(character) >= 0xc2 && macro_f_utf_char_t_to_char_1(character) <= 0xdf) {
+ if (macro_f_utf_char_t_to_char_2(character) >= 0x80 && macro_f_utf_char_t_to_char_2(character) <= 0xbf) {
return F_true;
}
}
}
- else if (macro_f_utf_character_t_width_is(character) == 3) {
- if (macro_f_utf_character_t_to_char_1(character) == 0xe0) {
- if (macro_f_utf_character_t_to_char_2(character) >= 0xa0 && macro_f_utf_character_t_to_char_2(character) <= 0xbf) {
- if (macro_f_utf_character_t_to_char_3(character) >= 0x80 && macro_f_utf_character_t_to_char_3(character) <= 0xbf) {
+ else if (macro_f_utf_char_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_to_char_1(character) == 0xe0) {
+ if (macro_f_utf_char_t_to_char_2(character) >= 0xa0 && macro_f_utf_char_t_to_char_2(character) <= 0xbf) {
+ if (macro_f_utf_char_t_to_char_3(character) >= 0x80 && macro_f_utf_char_t_to_char_3(character) <= 0xbf) {
return F_true;
}
}
}
- else if ((macro_f_utf_character_t_to_char_1(character) >= 0xe1 && macro_f_utf_character_t_to_char_1(character) <= 0xec) || (macro_f_utf_character_t_to_char_1(character) >= 0xee && macro_f_utf_character_t_to_char_1(character) <= 0xef)) {
- if (macro_f_utf_character_t_to_char_2(character) >= 0x80 && macro_f_utf_character_t_to_char_2(character) <= 0xbf) {
- if (macro_f_utf_character_t_to_char_3(character) >= 0x80 && macro_f_utf_character_t_to_char_3(character) <= 0xbf) {
+ else if ((macro_f_utf_char_t_to_char_1(character) >= 0xe1 && macro_f_utf_char_t_to_char_1(character) <= 0xec) || (macro_f_utf_char_t_to_char_1(character) >= 0xee && macro_f_utf_char_t_to_char_1(character) <= 0xef)) {
+ if (macro_f_utf_char_t_to_char_2(character) >= 0x80 && macro_f_utf_char_t_to_char_2(character) <= 0xbf) {
+ if (macro_f_utf_char_t_to_char_3(character) >= 0x80 && macro_f_utf_char_t_to_char_3(character) <= 0xbf) {
return F_true;
}
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xed) {
- if (macro_f_utf_character_t_to_char_2(character) >= 0x80 && macro_f_utf_character_t_to_char_2(character) <= 0x9f) {
- if (macro_f_utf_character_t_to_char_3(character) >= 0x80 && macro_f_utf_character_t_to_char_3(character) <= 0xbf) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xed) {
+ if (macro_f_utf_char_t_to_char_2(character) >= 0x80 && macro_f_utf_char_t_to_char_2(character) <= 0x9f) {
+ if (macro_f_utf_char_t_to_char_3(character) >= 0x80 && macro_f_utf_char_t_to_char_3(character) <= 0xbf) {
return F_true;
}
}
}
}
- else if (macro_f_utf_character_t_width_is(character) == 4) {
- if (macro_f_utf_character_t_to_char_1(character) == 0xf0) {
- if (macro_f_utf_character_t_to_char_2(character) >= 0x90 && macro_f_utf_character_t_to_char_2(character) <= 0xbf) {
- if (macro_f_utf_character_t_to_char_3(character) >= 0x80 && macro_f_utf_character_t_to_char_3(character) <= 0xbf) {
- if (macro_f_utf_character_t_to_char_4(character) >= 0x80 && macro_f_utf_character_t_to_char_4(character) <= 0xbf) {
+ else if (macro_f_utf_char_t_width_is(character) == 4) {
+ if (macro_f_utf_char_t_to_char_1(character) == 0xf0) {
+ if (macro_f_utf_char_t_to_char_2(character) >= 0x90 && macro_f_utf_char_t_to_char_2(character) <= 0xbf) {
+ if (macro_f_utf_char_t_to_char_3(character) >= 0x80 && macro_f_utf_char_t_to_char_3(character) <= 0xbf) {
+ if (macro_f_utf_char_t_to_char_4(character) >= 0x80 && macro_f_utf_char_t_to_char_4(character) <= 0xbf) {
return F_true;
}
}
}
}
- else if (macro_f_utf_character_t_to_char_1(character) >= 0xf1 && macro_f_utf_character_t_to_char_1(character) <= 0xf3) {
- if (macro_f_utf_character_t_to_char_2(character) >= 0x80 && macro_f_utf_character_t_to_char_2(character) <= 0xbf) {
- if (macro_f_utf_character_t_to_char_3(character) >= 0x80 && macro_f_utf_character_t_to_char_3(character) <= 0xbf) {
- if (macro_f_utf_character_t_to_char_4(character) >= 0x80 && macro_f_utf_character_t_to_char_4(character) <= 0xbf) {
+ else if (macro_f_utf_char_t_to_char_1(character) >= 0xf1 && macro_f_utf_char_t_to_char_1(character) <= 0xf3) {
+ if (macro_f_utf_char_t_to_char_2(character) >= 0x80 && macro_f_utf_char_t_to_char_2(character) <= 0xbf) {
+ if (macro_f_utf_char_t_to_char_3(character) >= 0x80 && macro_f_utf_char_t_to_char_3(character) <= 0xbf) {
+ if (macro_f_utf_char_t_to_char_4(character) >= 0x80 && macro_f_utf_char_t_to_char_4(character) <= 0xbf) {
return F_true;
}
}
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xf4) {
- if (macro_f_utf_character_t_to_char_2(character) >= 0x80 && macro_f_utf_character_t_to_char_2(character) <= 0x8f) {
- if (macro_f_utf_character_t_to_char_3(character) >= 0x80 && macro_f_utf_character_t_to_char_3(character) <= 0xbf) {
- if (macro_f_utf_character_t_to_char_4(character) >= 0x80 && macro_f_utf_character_t_to_char_4(character) <= 0xbf) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xf4) {
+ if (macro_f_utf_char_t_to_char_2(character) >= 0x80 && macro_f_utf_char_t_to_char_2(character) <= 0x8f) {
+ if (macro_f_utf_char_t_to_char_3(character) >= 0x80 && macro_f_utf_char_t_to_char_3(character) <= 0xbf) {
+ if (macro_f_utf_char_t_to_char_4(character) >= 0x80 && macro_f_utf_char_t_to_char_4(character) <= 0xbf) {
return F_true;
}
}
#endif // !defined(_di_f_utf_character_is_valid_) || !defined(_di_f_utf_is_valid_)
#if !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_)
- f_status_t private_f_utf_character_is_whitespace(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_whitespace(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_width_is(character) == 2) {
// Latin-1 Supplement: U+00A0.
if (character == 0xc2a00000) {
return F_true;
}
}
- else if (macro_f_utf_character_t_width_is(character) == 3) {
- if (macro_f_utf_character_t_to_char_1(character) == 0xe2) {
+ else if (macro_f_utf_char_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_to_char_1(character) == 0xe2) {
// General Punctuation: U+2000 to U+200A.
if (character >= 0xe2808000 && character <= 0xe2808a00) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xe3) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xe3) {
// CJK Symbols and Punctuation: U+3000.
if (character == 0xe3808000) {
#endif // !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_)
#if !defined(_di_f_utf_character_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_modifier_)
- f_status_t private_f_utf_character_is_whitespace_modifier(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_whitespace_modifier(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_width_is(character) == 2) {
// Spacing Modifier Letters: U+02B0 to U+02FF.
if (character >= 0xcab00000 && character <= 0xcbbf0000) {
#endif // !defined(_di_f_utf_character_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_modifier_)
#if !defined(_di_f_utf_character_is_whitespace_other_) || !defined(_di_f_utf_is_whitespace_other_)
- f_status_t private_f_utf_character_is_whitespace_other(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_whitespace_other(const f_utf_char_t character) {
// Ogham: U+1680 (isn't whitespace but is technically considered one: ( )).
if (character == 0xe19a8000) {
#endif // !defined(_di_f_utf_character_is_whitespace_other_) || !defined(_di_f_utf_is_whitespace_other_)
#if !defined(_di_f_utf_character_is_wide_) || !defined(_di_f_utf_is_wide_)
- f_status_t private_f_utf_character_is_wide(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_wide(const f_utf_char_t character) {
#ifndef _di_level_0_parameter_checking_
if (!character) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
- if (macro_f_utf_character_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_width_is(character) == 2) {
return F_false;
}
- if (macro_f_utf_character_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
// Hangul Jamo: U+1100 to U+115F.
if (character >= 0xe1848000 && character <= 0xe1859f00) {
#endif // !defined(_di_f_utf_character_is_wide_) || !defined(_di_f_utf_is_wide_)
#if !defined(_di_f_utf_character_is_word_) || !defined(_di_f_utf_is_word_)
- f_status_t private_f_utf_character_is_word(const f_utf_character_t character, const bool strict) {
+ f_status_t private_f_utf_character_is_word(const f_utf_char_t character, const bool strict) {
if (private_f_utf_character_is_alpha_digit(character)) {
return F_true;
}
- if (macro_f_utf_character_t_width_is(character) == 3) {
- if (macro_f_utf_character_t_to_char_1(character) == 0xe2) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_to_char_1(character) == 0xe2) {
// General Punctuation: U+203F (‿), U+203E (‾), U+2040 (⁀), U+2054 (⁔).
if (character == 0xe280bf00 || character == 0xe280be00 || character == 0xe2818000 || character == 0xe2819400) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xef) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xef) {
// General Punctuation: U+FE4D (﹍), U+FE4E (﹎), U+FE4F (﹏).
if (character == 0xefb98d00 || character == 0xefb98e00 || character == 0xefb98f00) {
#endif // !defined(_di_f_utf_character_is_word_) || !defined(_di_f_utf_is_word_)
#if !defined(_di_f_utf_character_is_word_dash_) || !defined(_di_f_utf_is_word_dash_)
- f_status_t private_f_utf_character_is_word_dash(const f_utf_character_t character, const bool strict) {
+ f_status_t private_f_utf_character_is_word_dash(const f_utf_char_t character, const bool strict) {
if (private_f_utf_character_is_word(character, strict)) {
return F_true;
}
- if (macro_f_utf_character_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
// General Punctuation: U+2010, U+2011.
if (character == 0xe2809000 || character == 0xe2809100) {
#endif // !defined(_di_f_utf_character_is_word_dash_) || !defined(_di_f_utf_is_word_dash_)
#if !defined(_di_f_utf_character_is_word_dash_plus_) || !defined(_di_f_utf_is_word_dash_plus_)
- f_status_t private_f_utf_character_is_word_dash_plus(const f_utf_character_t character, const bool strict) {
+ f_status_t private_f_utf_character_is_word_dash_plus(const f_utf_char_t character, const bool strict) {
if (private_f_utf_character_is_word_dash(character, strict)) {
return F_true;
#endif // !defined(_di_f_utf_character_is_word_dash_plus_) || !defined(_di_f_utf_is_word_dash_plus_)
#if !defined(_di_f_utf_character_is_zero_width_) || !defined(_di_f_utf_is_zero_width_)
- f_status_t private_f_utf_character_is_zero_width(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_zero_width(const f_utf_char_t character) {
- if (macro_f_utf_character_t_to_char_1(character) == 0xe1) {
+ if (macro_f_utf_char_t_to_char_1(character) == 0xe1) {
// Mongolian: U+180E.
if (character == 0xe1a08e00) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xe2) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xe2) {
// General Punctuation: U+200B, U+200C, U+200D, U+2060.
if (character == 0xe2808b00 || character == 0xe2808c00 || character == 0xe2808d00 || character == 0xe281a000) {
return F_true;
}
}
- else if (macro_f_utf_character_t_to_char_1(character) == 0xef) {
+ else if (macro_f_utf_char_t_to_char_1(character) == 0xef) {
// Arabic Presentation Forms-B: U+FEFF.
if (character == 0xefbbbf00) {
#endif // !defined(_di_f_utf_character_is_zero_width_) || !defined(_di_f_utf_is_zero_width_)
#if !defined(_di_f_utf_unicode_to_) || !defined(_di_f_utf_character_unicode_to_)
- f_status_t private_f_utf_character_unicode_to(const f_utf_character_t character, uint32_t *unicode) {
+ f_status_t private_f_utf_character_unicode_to(const f_utf_char_t character, uint32_t *unicode) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
}
// U+0000 -> U+007F (ASCII).
- if (macro_f_utf_character_t_width(character) == 1) {
- *unicode = macro_f_utf_character_t_to_char_1(character) & 0x7f;
+ if (macro_f_utf_char_t_width(character) == 1) {
+ *unicode = macro_f_utf_char_t_to_char_1(character) & 0x7f;
}
// U+0080 -> U+07FF.
- else if (macro_f_utf_character_t_width(character) == 2) {
- *unicode = (macro_f_utf_character_t_to_char_1(character) & 0x1f) << 6;
- *unicode |= macro_f_utf_character_t_to_char_2(character) & 0x3f;
+ else if (macro_f_utf_char_t_width(character) == 2) {
+ *unicode = (macro_f_utf_char_t_to_char_1(character) & 0x1f) << 6;
+ *unicode |= macro_f_utf_char_t_to_char_2(character) & 0x3f;
}
// U+0800 -> U+FFFF.
- else if (macro_f_utf_character_t_width(character) == 3) {
- *unicode = (macro_f_utf_character_t_to_char_1(character) & 0xf) << 12;
- *unicode |= (macro_f_utf_character_t_to_char_2(character) & 0x3f) << 6;
- *unicode |= macro_f_utf_character_t_to_char_3(character) & 0x3f;
+ else if (macro_f_utf_char_t_width(character) == 3) {
+ *unicode = (macro_f_utf_char_t_to_char_1(character) & 0xf) << 12;
+ *unicode |= (macro_f_utf_char_t_to_char_2(character) & 0x3f) << 6;
+ *unicode |= macro_f_utf_char_t_to_char_3(character) & 0x3f;
}
// U+10000 -> U+10FFFF.
- else if (macro_f_utf_character_t_width(character) == 4) {
- *unicode = (macro_f_utf_character_t_to_char_1(character) & 0x7) << 18;
- *unicode |= (macro_f_utf_character_t_to_char_2(character) & 0x3f) << 12;
- *unicode |= (macro_f_utf_character_t_to_char_2(character) & 0x3f) << 6;
- *unicode |= macro_f_utf_character_t_to_char_4(character) & 0x3f;
+ else if (macro_f_utf_char_t_width(character) == 4) {
+ *unicode = (macro_f_utf_char_t_to_char_1(character) & 0x7) << 18;
+ *unicode |= (macro_f_utf_char_t_to_char_2(character) & 0x3f) << 12;
+ *unicode |= (macro_f_utf_char_t_to_char_2(character) & 0x3f) << 6;
+ *unicode |= macro_f_utf_char_t_to_char_4(character) & 0x3f;
}
return F_none;
* Intended to be shared to each of the different implementation variations.
*
* @param character
- * The character string to be converted to the f_utf_character_t type.
+ * The character string to be converted to the f_utf_char_t type.
* There must be enough space allocated to convert against, as limited by width_max.
* @param width_max
* The maximum width available for converting.
* Can be anything greater than 0.
* @param character_utf
- * The generated character of type f_utf_character_t.
+ * The generated character of type f_utf_char_t.
* This value may be cleared, even on error.
*
* @return
* @see f_utf_unicode_to()
*/
#if !defined(_di_f_utf_char_to_character_) || !defined(_di_f_utf_is_alpha_) || !defined(_di_f_utf_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_numeric_) || !defined(_di_f_utf_is_ascii_) || !defined(_di_f_utf_is_combining_) || !defined(_di_f_utf_is_control_) || !defined(_di_f_utf_is_control_picture_) || !defined(_di_f_utf_is_digit_) || !defined(_di_f_utf_is_emoji_) || !defined(_di_f_utf_is_graph_) || !defined(_di_f_utf_is_numeric_) || !defined(_di_f_utf_is_phonetic_) || !defined(_di_f_utf_is_private_) || !defined(_di_f_utf_is_punctuation_) || !defined(_di_f_utf_is_surrogate_) || !defined(_di_f_utf_is_symbol_) || !defined(_di_f_utf_is_unassigned_) || !defined(_di_f_utf_is_valid_) || !defined(_di_f_utf_is_whitespace_) || !defined(_di_f_utf_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_other_) || !defined(_di_f_utf_is_wide_) || !defined(_di_f_utf_is_word_) || !defined(_di_f_utf_is_word_dash_) || !defined(_di_f_utf_is_word_dash_plus_) || !defined(_di_f_utf_is_zero_width_) || !defined(f_utf_unicode_to)
- extern f_status_t private_f_utf_char_to_character(const f_string_t character, const f_array_length_t width_max, f_utf_character_t *character_utf) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_char_to_character(const f_string_t character, const f_array_length_t width_max, f_utf_char_t *character_utf) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_char_to_character_) || !defined(_di_f_utf_is_alpha_) || !defined(_di_f_utf_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_numeric_) || !defined(_di_f_utf_is_ascii_) || !defined(_di_f_utf_is_combining_) || !defined(_di_f_utf_is_control_) || !defined(_di_f_utf_is_control_picture_) || !defined(_di_f_utf_is_digit_) || !defined(_di_f_utf_is_emoji_) || !defined(_di_f_utf_is_graph_) || !defined(_di_f_utf_is_numeric_) || !defined(_di_f_utf_is_phonetic_) || !defined(_di_f_utf_is_private_) || !defined(_di_f_utf_is_punctuation_) || !defined(_di_f_utf_is_surrogate_) || !defined(_di_f_utf_is_symbol_) || !defined(_di_f_utf_is_unassigned_) || !defined(_di_f_utf_is_valid_) || !defined(_di_f_utf_is_whitespace_) || !defined(_di_f_utf_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_other_) || !defined(_di_f_utf_is_wide_) || !defined(_di_f_utf_is_word_) || !defined(_di_f_utf_is_word_dash_) || !defined(_di_f_utf_is_word_dash_plus_) || !defined(_di_f_utf_is_zero_width_) || !defined(f_utf_unicode_to)
/**
* @see f_utf_is_alpha()
*/
#if !defined(_di_f_utf_character_is_alpha_) || !defined(_di_f_utf_is_alpha_)
- extern f_status_t private_f_utf_character_is_alpha(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_alpha(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_alpha_) || !defined(_di_f_utf_is_alpha_)
/**
* @see f_utf_is_alpha_digit()
*/
#if !defined(_di_f_utf_character_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_digit_)
- extern f_status_t private_f_utf_character_is_alpha_digit(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_alpha_digit(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_alpha_digit_) || !defined(_di_f_utf_is_alpha_digit_)
/**
* @see f_utf_is_alpha_numeric()
*/
#if !defined(_di_f_utf_character_is_alpha_numeric_) || !defined(_di_f_utf_is_alpha_numeric_)
- extern f_status_t private_f_utf_character_is_alpha_numeric(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_alpha_numeric(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_alpha_numeric_) || !defined(_di_f_utf_is_alpha_numeric_)
/**
* @see f_utf_is_ascii()
*/
#if !defined(_di_f_utf_character_is_ascii_) || !defined(_di_f_utf_is_ascii_)
- extern f_status_t private_f_utf_character_is_ascii(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_ascii(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_ascii_) || !defined(_di_f_utf_is_ascii_)
/**
* @see f_utf_is_combining()
*/
#if !defined(_di_f_utf_character_is_combining_) || !defined(_di_f_utf_is_combining_)
- extern f_status_t private_f_utf_character_is_combining(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_combining(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_combining_) || !defined(_di_f_utf_is_combining_)
/**
* @see f_utf_is_control()
*/
#if !defined(_di_f_utf_character_is_control_) || !defined(_di_f_utf_is_control_)
- extern f_status_t private_f_utf_character_is_control(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_control(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_control_) || !defined(_di_f_utf_is_control_)
/**
* @see f_utf_is_control_code()
*/
#if !defined(_di_f_utf_character_is_control_code_) || !defined(_di_f_utf_is_control_code_)
- extern f_status_t private_f_utf_character_is_control_code(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_control_code(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_control_code_) || !defined(_di_f_utf_is_control_code_)
/**
* @see f_utf_is_control_format()
*/
#if !defined(_di_f_utf_character_is_control_format_) || !defined(_di_f_utf_is_control_format_)
- extern f_status_t private_f_utf_character_is_control_format(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_control_format(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_control_format_) || !defined(_di_f_utf_is_control_format_)
/**
* @see f_utf_is_control_picture()
*/
#if !defined(_di_f_utf_character_is_control_picture_) || !defined(_di_f_utf_is_control_picture_)
- extern f_status_t private_f_utf_character_is_control_picture(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_control_picture(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_control_picture_) || !defined(_di_f_utf_is_control_picture_)
/**
* @see f_utf_is_digit()
*/
#if !defined(_di_f_utf_character_is_digit_) || !defined(_di_f_utf_is_digit_)
- extern f_status_t private_f_utf_character_is_digit(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_digit(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_digit_) || !defined(_di_f_utf_is_digit_)
/**
* @see f_utf_is_emoji()
*/
#if !defined(_di_f_utf_character_is_emoji_) || !defined(_di_f_utf_is_emoji_)
- extern f_status_t private_f_utf_character_is_emoji(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_emoji(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_emoji_) || !defined(_di_f_utf_is_emoji_)
/**
* @see f_utf_is_numeric()
*/
#if !defined(_di_f_utf_character_is_numeric_) || !defined(_di_f_utf_is_numeric_)
- extern f_status_t private_f_utf_character_is_numeric(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_numeric(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_numeric_) || !defined(_di_f_utf_is_numeric_)
/**
* @see f_utf_is_phonetic()
*/
#if !defined(_di_f_utf_character_is_phonetic_) || !defined(_di_f_utf_is_phonetic_)
- extern f_status_t private_f_utf_character_is_phonetic(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_phonetic(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_phonetic_) || !defined(_di_f_utf_is_phonetic_)
/**
* @see f_utf_is_private()
*/
#if !defined(_di_f_utf_character_is_private_) || !defined(_di_f_utf_is_private_)
- extern f_status_t private_f_utf_character_is_private(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_private(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_private_) || !defined(_di_f_utf_is_private_)
/**
* @see f_utf_is_punctuation()
*/
#if !defined(_di_f_utf_character_is_punctuation_) || !defined(_di_f_utf_is_punctuation_)
- extern f_status_t private_f_utf_character_is_punctuation(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_punctuation(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_punctuation_) || !defined(_di_f_utf_is_punctuation_)
/**
* @see f_utf_is_surrogate()
*/
#if !defined(_di_f_utf_character_is_surrogate_) || !defined(_di_f_utf_is_surrogate_)
- extern f_status_t private_f_utf_character_is_surrogate(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_surrogate(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_surrogate_) || !defined(_di_f_utf_is_surrogate_)
/**
* @see f_utf_is_symbol()
*/
#if !defined(_di_f_utf_character_is_symbol_) || !defined(_di_f_utf_is_symbol_)
- extern f_status_t private_f_utf_character_is_symbol(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_symbol(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_symbol_) || !defined(_di_f_utf_is_symbol_)
/**
* @see f_utf_is_valid()
*/
#if !defined(_di_f_utf_character_is_valid_) || !defined(_di_f_utf_is_valid_)
- extern f_status_t private_f_utf_character_is_valid(const f_utf_character_t characterh) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_valid(const f_utf_char_t characterh) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_valid_) || !defined(_di_f_utf_is_valid_)
/**
* @see f_utf_is_whitespace()
*/
#if !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_)
- extern f_status_t private_f_utf_character_is_whitespace(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_whitespace(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_)
/**
* @see f_utf_is_whitespace_modifier()
*/
#if !defined(_di_f_utf_character_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_modifier_)
- extern f_status_t private_f_utf_character_is_whitespace_modifier(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_whitespace_modifier(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_whitespace_modifier_) || !defined(_di_f_utf_is_whitespace_modifier_)
/**
* @see f_utf_is_whitespace_other()
*/
#if !defined(_di_f_utf_character_is_whitespace_other_) || !defined(_di_f_utf_is_whitespace_other_)
- extern f_status_t private_f_utf_character_is_whitespace_other(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_whitespace_other(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_whitespace_other_) || !defined(_di_f_utf_is_whitespace_other_)
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#if !defined(_di_f_utf_character_is_wide_) || !defined(_di_f_utf_is_wide_)
- extern f_status_t private_f_utf_character_is_wide(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_wide(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_wide_) || !defined(_di_f_utf_is_wide_)
/**
* @see f_utf_is_word()
*/
#if !defined(_di_f_utf_character_is_word_) || !defined(_di_f_utf_is_word_)
- extern f_status_t private_f_utf_character_is_word(const f_utf_character_t character, const bool strict) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_word(const f_utf_char_t character, const bool strict) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_word_) || !defined(_di_f_utf_is_word_)
/**
* @see f_utf_is_word_dash()
*/
#if !defined(_di_f_utf_character_is_word_dash_) || !defined(_di_f_utf_is_word_dash_)
- extern f_status_t private_f_utf_character_is_word_dash(const f_utf_character_t character, const bool strict) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_word_dash(const f_utf_char_t character, const bool strict) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_word_dash_) || !defined(_di_f_utf_is_word_dash_)
/**
* @see f_utf_is_word_dash_plus()
*/
#if !defined(_di_f_utf_character_is_word_dash_plus_) || !defined(_di_f_utf_is_word_dash_plus_)
- extern f_status_t private_f_utf_character_is_word_dash_plus(const f_utf_character_t character, const bool strict) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_word_dash_plus(const f_utf_char_t character, const bool strict) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_word_dash_plus_) || !defined(_di_f_utf_is_word_dash_plus_)
/**
* @see f_utf_is_zero_width()
*/
#if !defined(_di_f_utf_character_is_zero_width_) || !defined(_di_f_utf_is_zero_width_)
- extern f_status_t private_f_utf_character_is_zero_width(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_zero_width(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_zero_width_) || !defined(_di_f_utf_is_zero_width_)
/**
*
* @param character
* The (UTF-8) character to convert to the Unicode representation.
- * The f_utf_character_t is a 32-bit integer containing UTF-8 sequences, unchanged.
+ * The f_utf_char_t is a 32-bit integer containing UTF-8 sequences, unchanged.
* @param unicode
* A 32-bit integer representing the Unicode (such as U+0001).
* Does not need to be interpretted like UTF-8, this is a number from 0 onto max supported Unicode integer value (U+10FFFF).
* @see f_utf_unicode_to()
*/
#if !defined(_di_f_utf_character_unicode_to_) || !defined(_di_f_utf_unicode_to_)
- extern f_status_t private_f_utf_character_unicode_to(const f_utf_character_t character, uint32_t *unicode) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_unicode_to(const f_utf_char_t character, uint32_t *unicode) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_unicode_to_) || !defined(_di_f_utf_unicode_to_)
#ifdef __cplusplus
#endif // _di_f_utf_substitute_
/**
- * Defines type for representing the UTF-8 code as a 32-bit unsigned integer.
- */
-#ifndef _di_f_utf_t_
- typedef uint32_t f_utf_t;
-
- #define f_utf_t_initialize 0
-
- #define macro_f_utf_initialize(code) code
-#endif // _di_f_utf_t_
-
-/**
* Provide a basic UTF-8 character as a single 4-byte variable.
*
* This is intended to be used when a single variable is desired to represent a 1-byte, 2-byte, 3-byte, or even 4-byte character.
* This "character" type is stored as a big-endian 4-byte integer (32-bits).
* A helper function, f_utf_is_big_endian(), is provided to detect system endianness so that character arrays (uint8_t []) can be correctly processed.
*
- * The byte structure is intended to be read left to right.
+ * The byte structure is intended to be read left to right in memory regardless of system endianness.
+ * This is done so that the first character (the left most) can be read naturally as a string, such as string[0] = first character.
*
- * The macro_f_utf_character_t_mask_byte_* are used to get the entire character set fo a given width.
+ * The macro_f_utf_char_t_mask_byte_* are used to get the entire character set fo a given width.
*
- * The macro_f_utf_character_t_mask_char_* are used to get a specific UTF-8 block as a single character range.
+ * The macro_f_utf_char_t_mask_char_* are used to get a specific UTF-8 block as a single character range.
*
- * The macro_f_utf_character_t_to_char_* are used to convert a f_utf_character_t into a uint8_t, for a given 8-bit block.
+ * The macro_f_utf_char_t_to_char_* are used to convert a f_utf_char_t into a uint8_t, for a given 8-bit block.
*
- * The macro_f_utf_character_t_from_char_* are used to convert a uint8_t into part of a f_utf_character_t, for a given 8-bit block.
+ * The macro_f_utf_char_t_from_char_* are used to convert a uint8_t into part of a f_utf_char_t, for a given 8-bit block.
*
- * The macro_f_utf_character_t_width is used to determine the width of the UTF-8 character based on macro_f_utf_byte_width.
- * The macro_f_utf_character_t_width_is is used to determine the width of the UTF-8 character based on macro_f_utf_byte_width_is.
+ * The macro_f_utf_char_t_width is used to determine the width of the UTF-8 character based on macro_f_utf_byte_width.
+ * The macro_f_utf_char_t_width_is is used to determine the width of the UTF-8 character based on macro_f_utf_byte_width_is.
*
- * The macro_f_utf_character_t_width macro determines a width of the UTF-8 character based on macro_f_utf_byte_width.
- * The macro_f_utf_character_t_width_is is identical to macro_f_utf_character_t_width, except it returns 0 when character is ASCII.
+ * The macro_f_utf_char_t_width macro determines a width of the UTF-8 character based on macro_f_utf_byte_width.
+ * The macro_f_utf_char_t_width_is is identical to macro_f_utf_char_t_width, except it returns 0 when character is ASCII.
*
* @see f_utf_is_big_endian()
*/
-#ifndef _di_f_utf_character_t_
- typedef uint32_t f_utf_character_t;
-
- #define F_utf_character_mask_byte_1_d 0xff000000u // 1111 1111, 0000 0000, 0000 0000, 0000 0000
- #define F_utf_character_mask_byte_2_d 0xffff0000u // 1111 1111, 1111 1111, 0000 0000, 0000 0000
- #define F_utf_character_mask_byte_3_d 0xffffff00u // 1111 1111, 1111 1111, 1111 1111, 0000 0000
- #define F_utf_character_mask_byte_4_d 0xffffffffu // 1111 1111, 1111 1111, 1111 1111, 1111 1111
-
- #define F_utf_character_mask_char_1_d 0xff000000u // 1111 1111, 0000 0000, 0000 0000, 0000 0000
- #define F_utf_character_mask_char_2_d 0x00ff0000u // 0000 0000, 1111 1111, 0000 0000, 0000 0000
- #define F_utf_character_mask_char_3_d 0x0000ff00u // 0000 0000, 0000 0000, 1111 1111, 0000 0000
- #define F_utf_character_mask_char_4_d 0x000000ffu // 0000 0000, 0000 0000, 0000 0000, 1111 1111
-
- #define macro_f_utf_character_t_to_char_1(character) (((character) & F_utf_character_mask_char_1_d) >> 24u) // grab first byte.
- #define macro_f_utf_character_t_to_char_2(character) (((character) & F_utf_character_mask_char_2_d) >> 16u) // grab second byte.
- #define macro_f_utf_character_t_to_char_3(character) (((character) & F_utf_character_mask_char_3_d) >> 8u) // grab third byte.
- #define macro_f_utf_character_t_to_char_4(character) ((character) & F_utf_character_mask_char_4_d) // grab fourth byte.
-
- #define macro_f_utf_character_t_from_char_1(character) (((character) << 24u) & F_utf_character_mask_char_1_d) // shift to first byte.
- #define macro_f_utf_character_t_from_char_2(character) (((character) << 16u) & F_utf_character_mask_char_2_d) // shift to second byte.
- #define macro_f_utf_character_t_from_char_3(character) (((character) << 8u) & F_utf_character_mask_char_3_d) // shift to third byte.
- #define macro_f_utf_character_t_from_char_4(character) ((character) & F_utf_character_mask_char_4_d) // shift to fourth byte.
-
- #define macro_f_utf_character_t_width(character) (macro_f_utf_byte_width(macro_f_utf_character_t_to_char_1(character)))
- #define macro_f_utf_character_t_width_is(character) (macro_f_utf_byte_width_is(macro_f_utf_character_t_to_char_1(character)))
-#endif // _di_f_utf_character_t_
-
-#ifndef _di_f_utf_character_t_codes_
- #define F_utf_character_t_eol_d 0x0a000000u // 0000 1010, 0000 0000, 0000 0000, 0000 0000
- #define F_utf_character_t_eos_d 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
- #define F_utf_character_t_placeholder_d 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
-#endif // _di_f_utf_character_t_codes_
+#ifndef _di_f_utf_char_t_
+ typedef uint32_t f_utf_char_t;
+
+ #define f_utf_char_t_initialize 0
+
+ #define macro_f_utf_char_t_initialize(code) code
+
+ #ifdef _is_F_endian_big
+ #define F_utf_char_mask_byte_1_d 0xff000000u // 1111 1111, 0000 0000, 0000 0000, 0000 0000
+ #define F_utf_char_mask_byte_2_d 0xffff0000u // 1111 1111, 1111 1111, 0000 0000, 0000 0000
+ #define F_utf_char_mask_byte_3_d 0xffffff00u // 1111 1111, 1111 1111, 1111 1111, 0000 0000
+ #define F_utf_char_mask_byte_4_d 0xffffffffu // 1111 1111, 1111 1111, 1111 1111, 1111 1111
+
+ #define F_utf_char_mask_char_1_d 0xff000000u // 1111 1111, 0000 0000, 0000 0000, 0000 0000
+ #define F_utf_char_mask_char_2_d 0x00ff0000u // 0000 0000, 1111 1111, 0000 0000, 0000 0000
+ #define F_utf_char_mask_char_3_d 0x0000ff00u // 0000 0000, 0000 0000, 1111 1111, 0000 0000
+ #define F_utf_char_mask_char_4_d 0x000000ffu // 0000 0000, 0000 0000, 0000 0000, 1111 1111
+
+ #define macro_f_utf_char_t_to_char_1(character) (((character) & F_utf_char_mask_char_1_d) >> 24u) // Grab first byte.
+ #define macro_f_utf_char_t_to_char_2(character) (((character) & F_utf_char_mask_char_2_d) >> 16u) // Grab second byte.
+ #define macro_f_utf_char_t_to_char_3(character) (((character) & F_utf_char_mask_char_3_d) >> 8u) // Grab third byte.
+ #define macro_f_utf_char_t_to_char_4(character) ((character) & F_utf_char_mask_char_4_d) // Grab fourth byte.
+
+ #define macro_f_utf_char_t_from_char_1(character) (((character) << 24u) & F_utf_char_mask_char_1_d) // Shift to first byte.
+ #define macro_f_utf_char_t_from_char_2(character) (((character) << 16u) & F_utf_char_mask_char_2_d) // Shift to second byte.
+ #define macro_f_utf_char_t_from_char_3(character) (((character) << 8u) & F_utf_char_mask_char_3_d) // Shift to third byte.
+ #define macro_f_utf_char_t_from_char_4(character) ((character) & F_utf_char_mask_char_4_d) // Shift to fourth byte.
+ #else
+ #define F_utf_char_mask_byte_1_d 0x000000ffu // 0000 0000, 0000 0000, 0000 0000, 1111 1111
+ #define F_utf_char_mask_byte_2_d 0x0000ffffu // 0000 0000, 0000 0000, 1111 1111, 1111 1111
+ #define F_utf_char_mask_byte_3_d 0x00ffffffu // 0000 0000, 1111 1111, 1111 1111, 1111 1111
+ #define F_utf_char_mask_byte_4_d 0xffffffffu // 1111 1111, 1111 1111, 1111 1111, 1111 1111
+
+ #define F_utf_char_mask_char_1_d 0x000000ffu // 0000 0000, 0000 0000, 0000 0000, 1111 1111
+ #define F_utf_char_mask_char_2_d 0x0000ff00u // 0000 0000, 0000 0000, 1111 1111, 0000 0000
+ #define F_utf_char_mask_char_3_d 0x00ff0000u // 0000 0000, 1111 1111, 0000 0000, 0000 0000
+ #define F_utf_char_mask_char_4_d 0xff000000u // 1111 1111, 0000 0000, 0000 0000, 0000 0000
+
+ #define macro_f_utf_char_t_to_char_1(character) (((character) & F_utf_char_mask_char_1_d)) // Grab first byte.
+ #define macro_f_utf_char_t_to_char_2(character) (((character) & F_utf_char_mask_char_2_d) >> 8u) // Grab second byte.
+ #define macro_f_utf_char_t_to_char_3(character) (((character) & F_utf_char_mask_char_3_d) >> 16u) // Grab third byte.
+ #define macro_f_utf_char_t_to_char_4(character) (((character) & F_utf_char_mask_char_4_d) >> 24u) // Grab fourth byte.
+
+ #define macro_f_utf_char_t_from_char_1(character) (((character)) & F_utf_char_mask_char_1_d) // Shift to first byte.
+ #define macro_f_utf_char_t_from_char_2(character) (((character) << 8u) & F_utf_char_mask_char_2_d) // Shift to second byte.
+ #define macro_f_utf_char_t_from_char_3(character) (((character) << 16u) & F_utf_char_mask_char_3_d) // Shift to third byte.
+ #define macro_f_utf_char_t_from_char_4(character) (((character) << 24u) & F_utf_char_mask_char_4_d) // Shift to fourth byte.
+ #endif // _is_F_endian_big
+
+ #define macro_f_utf_char_t_width(character) (macro_f_utf_byte_width(macro_f_utf_char_t_to_char_1(character)))
+ #define macro_f_utf_char_t_width_is(character) (macro_f_utf_byte_width_is(macro_f_utf_char_t_to_char_1(character)))
+#endif // _di_f_utf_char_t_
+
+/**
+ * Provide an integer that represents special characters.
+ *
+ * Because this is an integer, the byte order matters.
+ */
+#ifndef _di_f_utf_char_t_codes_
+ #ifdef _is_F_endian_big
+ #define F_utf_char_t_eol_d 0x0a000000u // 0000 1010, 0000 0000, 0000 0000, 0000 0000
+ #define F_utf_char_t_eos_d 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
+ #define F_utf_char_t_placeholder_d 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
+ #else
+ #define F_utf_char_t_eol_d 0x0000000au // 0000 0000, 0000 0000, 0000 0000, 0000 1010
+ #define F_utf_char_t_eos_d 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
+ #define F_utf_char_t_placeholder_d 0x00000000u // 0000 0000, 0000 0000, 0000 0000, 0000 0000
+ #endif // _is_F_endian_big
+#endif // _di_f_utf_char_t_codes_
/**
* Define the basic string type.
* Dynamic allocation macros are provided, but it is recommended to utilize the f_utf_string_dynamic_t for dynamic allocation.
*/
#ifndef _di_f_utf_string_t_
- typedef f_utf_character_t *f_utf_string_t;
+ typedef f_utf_char_t *f_utf_string_t;
#define f_utf_string_t_initialize 0
#endif
#ifndef _di_f_utf_char_to_character_
- f_status_t f_utf_char_to_character(const f_string_t character, const f_array_length_t width_max, f_utf_character_t *character_utf) {
+ f_status_t f_utf_char_to_character(const f_string_t character, const f_array_length_t width_max, f_utf_char_t *character_utf) {
#ifndef _di_level_0_parameter_checking_
if (width_max < 1) return F_status_set_error(F_parameter);
if (!character_utf) return F_status_set_error(F_parameter);
}
#endif // _di_f_utf_char_to_character_
-#ifndef _di_f_utf_character_to_char_
- f_status_t f_utf_character_to_char(const f_utf_character_t utf_character, f_string_t *character, f_array_length_t *width_max) {
+#ifndef _di_f_utf_char_to_char_
+ f_status_t f_utf_char_to_char(const f_utf_char_t utf_character, f_string_t *character, f_array_length_t *width_max) {
#ifndef _di_level_0_parameter_checking_
if (!utf_character) return F_status_set_error(F_parameter);
if (!character) return F_status_set_error(F_parameter);
if (!*width_max) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (macro_f_utf_character_t_width_is(utf_character)) {
- if (macro_f_utf_character_t_width_is(utf_character) == 1) {
+ if (macro_f_utf_char_t_width_is(utf_character)) {
+ if (macro_f_utf_char_t_width_is(utf_character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#if __BYTE_ORDER == __LITTLE_ENDIAN
- f_utf_t utf = 0;
+ f_utf_char_t utf = 0;
- switch (macro_f_utf_character_t_width_is(utf_character)) {
+ switch (macro_f_utf_char_t_width_is(utf_character)) {
case 1:
- utf = macro_f_utf_character_t_to_char_1(utf_character) << 24;
+ utf = macro_f_utf_char_t_to_char_1(utf_character) << 24;
break;
case 2:
- utf = (macro_f_utf_character_t_to_char_2(utf_character) << 24) | (macro_f_utf_character_t_to_char_1(utf_character) << 16);
+ utf = (macro_f_utf_char_t_to_char_2(utf_character) << 24) | (macro_f_utf_char_t_to_char_1(utf_character) << 16);
break;
case 3:
- utf = (macro_f_utf_character_t_to_char_3(utf_character) << 24) | (macro_f_utf_character_t_to_char_2(utf_character) << 16) | (macro_f_utf_character_t_to_char_1(utf_character) << 8);
+ utf = (macro_f_utf_char_t_to_char_3(utf_character) << 24) | (macro_f_utf_char_t_to_char_2(utf_character) << 16) | (macro_f_utf_char_t_to_char_1(utf_character) << 8);
break;
case 4:
- utf = (macro_f_utf_character_t_to_char_4(utf_character) << 24) | (macro_f_utf_character_t_to_char_3(utf_character) << 16) | (macro_f_utf_character_t_to_char_2(utf_character) << 8) | macro_f_utf_character_t_to_char_1(utf_character);
+ utf = (macro_f_utf_char_t_to_char_4(utf_character) << 24) | (macro_f_utf_char_t_to_char_3(utf_character) << 16) | (macro_f_utf_char_t_to_char_2(utf_character) << 8) | macro_f_utf_char_t_to_char_1(utf_character);
break;
default:
return F_status_set_error(F_failure);
}
- memcpy(*character, &utf, sizeof(f_char_t) * macro_f_utf_character_t_width_is(utf_character));
+ memcpy(*character, &utf, sizeof(f_char_t) * macro_f_utf_char_t_width_is(utf_character));
#else
- memcpy(*character, &utf_character, sizeof(f_char_t) * macro_f_utf_character_t_width_is(utf_character));
+ memcpy(*character, &utf_character, sizeof(f_char_t) * macro_f_utf_char_t_width_is(utf_character));
#endif // __BYTE_ORDER == __LITTLE_ENDIAN
return F_none;
}
#if __BYTE_ORDER == __LITTLE_ENDIAN
- f_utf_t utf = macro_f_utf_character_t_to_char_1(utf_character) << 24;
+ f_utf_char_t utf = macro_f_utf_char_t_to_char_1(utf_character) << 24;
memcpy(*character, &utf, sizeof(f_char_t));
#else
return F_none;
}
-#endif // _di_f_utf_character_to_char_
+#endif // _di_f_utf_char_to_char_
#ifndef _di_f_utf_character_unicode_to_
- f_status_t f_utf_character_unicode_to(const f_utf_character_t character, f_utf_t *unicode) {
+ f_status_t f_utf_character_unicode_to(const f_utf_char_t character, f_utf_char_t *unicode) {
#ifndef _di_level_0_parameter_checking_
if (!unicode) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_utf_character_unicode_to_
#ifndef _di_f_utf_character_unicode_from_
- f_status_t f_utf_character_unicode_from(const f_utf_t unicode, f_utf_character_t *character) {
+ f_status_t f_utf_character_unicode_from(const f_utf_char_t unicode, f_utf_char_t *character) {
#ifndef _di_level_0_parameter_checking_
if (!character) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_utf_character_unicode_from_
#ifndef _di_f_utf_character_unicode_string_to_
- f_status_t f_utf_character_unicode_string_to(const f_utf_string_t string, const f_array_length_t length, f_utf_t *unicode) {
+ f_status_t f_utf_character_unicode_string_to(const f_utf_string_t string, const f_array_length_t length, f_utf_char_t *unicode) {
#ifndef _di_level_0_parameter_checking_
if (!string) return F_status_set_error(F_parameter);
if (!unicode) return F_status_set_error(F_parameter);
} // while
if (i < length) {
- if (macro_f_utf_character_t_width_is(string[i])) {
+ if (macro_f_utf_char_t_width_is(string[i])) {
i = length;
}
else {
- if (macro_f_utf_character_t_to_char_1(string[i]) == f_string_ascii_u_s.string[0] || macro_f_utf_character_t_to_char_1(string[i]) == f_string_ascii_U_s.string[0]) {
+ if (macro_f_utf_char_t_to_char_1(string[i]) == f_string_ascii_u_s.string[0] || macro_f_utf_char_t_to_char_1(string[i]) == f_string_ascii_U_s.string[0]) {
do {
++i;
} while (i < length && !string[i]);
- if (i < length && !macro_f_utf_character_t_width_is(string[i]) && macro_f_utf_character_t_to_char_1(string[i]) == f_string_ascii_plus_s.string[0]) {
+ if (i < length && !macro_f_utf_char_t_width_is(string[i]) && macro_f_utf_char_t_to_char_1(string[i]) == f_string_ascii_plus_s.string[0]) {
++i;
}
else {
return F_status_set_error(F_valid_not);
}
- f_utf_t value = 0;
+ f_utf_char_t value = 0;
uint8_t character = 0;
for (; i < length; ++i) {
if (!string[i]) continue;
// Only ASCII character numbers are allowed to represent
- if (macro_f_utf_character_t_width_is(string[i])) {
+ if (macro_f_utf_char_t_width_is(string[i])) {
return F_status_set_error(F_valid_not);
}
value *= 16;
- character = macro_f_utf_character_t_to_char_1(string[i]);
+ character = macro_f_utf_char_t_to_char_1(string[i]);
if (character > 0x2f && character < 0x3a) {
value += character - 0x30;
#endif // _di_f_utf_character_unicode_string_to_
#ifndef _di_f_utf_unicode_from_
- f_status_t f_utf_unicode_from(const f_utf_t unicode, const f_array_length_t width_max, f_string_t *character) {
+ f_status_t f_utf_unicode_from(const f_utf_char_t unicode, const f_array_length_t width_max, f_string_t *character) {
#ifndef _di_level_0_parameter_checking_
if (width_max < 1) return F_status_set_error(F_parameter);
if (!unicode) return F_status_set_error(F_parameter);
#endif // _di_f_utf_unicode_from_
#ifndef _di_f_utf_unicode_to_
- f_status_t f_utf_unicode_to(const f_string_t character, const f_array_length_t width_max, f_utf_t *unicode) {
+ f_status_t f_utf_unicode_to(const f_string_t character, const f_array_length_t width_max, f_utf_char_t *unicode) {
#ifndef _di_level_0_parameter_checking_
if (width_max < 1) return F_status_set_error(F_parameter);
if (!unicode) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
#endif // _di_f_utf_unicode_to_
#ifndef _di_f_utf_unicode_string_to_f_
- f_status_t f_utf_unicode_string_to(const f_string_t string, const f_array_length_t length, f_utf_t *unicode) {
+ f_status_t f_utf_unicode_string_to(const f_string_t string, const f_array_length_t length, f_utf_char_t *unicode) {
#ifndef _di_level_0_parameter_checking_
if (!unicode) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
return F_status_set_error(F_valid_not);
}
- f_utf_t value = 0;
+ f_utf_char_t value = 0;
for (; i < length; ++i) {
#endif
/**
- * Convert a specialized f_utf_character_t type to a uint8_t, stored as a string (character buffer).
+ * Convert a specialized f_utf_char_t type to a uint8_t, stored as a string (character buffer).
*
* This will also convert ASCII characters stored in the utf_character array.
* This will not resize character.
* F_utf (with error bit) if unicode is an invalid Unicode character.
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
-#ifndef _di_f_utf_character_to_char_
- extern f_status_t f_utf_character_to_char(const f_utf_character_t utf_character, f_string_t *character, f_array_length_t *width_max);
-#endif // _di_f_utf_character_to_char_
+#ifndef _di_f_utf_char_to_char_
+ extern f_status_t f_utf_char_to_char(const f_utf_char_t utf_character, f_string_t *character, f_array_length_t *width_max);
+#endif // _di_f_utf_char_to_char_
/**
* Convert a given (UTF-8) character into Unicode.
*
- * The f_utf_character_t is a 32-bit integer containing UTF-8 sequences, unchanged.
+ * The f_utf_char_t is a 32-bit integer containing UTF-8 sequences, unchanged.
* The Unicode is a 32-bit integer representing the Unicode (such as U+0001).
* The Unciode does not need to be interpretted like UTF-8, it simple is a sequence of number from 0 onto max supported Unicode integer value (U+10FFFF).
*
* @see f_utf_character_is_valid()
*/
#ifndef _di_f_utf_character_unicode_to_
- extern f_status_t f_utf_character_unicode_to(const f_utf_character_t character, f_utf_t *unicode);
+ extern f_status_t f_utf_character_unicode_to(const f_utf_char_t character, f_utf_char_t *unicode);
#endif // _di_f_utf_character_unicode_to_
/**
* Convert a given Unicode into (UTF-8) character.
*
- * The f_utf_character_t is a 32-bit integer containing UTF-8 sequences, unchanged.
+ * The f_utf_char_t is a 32-bit integer containing UTF-8 sequences, unchanged.
* The Unicode is a 32-bit integer representing the Unicode (such as U+0001).
* The Unciode does not need to be interpretted like UTF-8, it simple is a sequence of number from 0 onto max supported Unicode integer value (U+10FFFF).
*
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_unicode_from_
- extern f_status_t f_utf_character_unicode_from(const f_utf_t unicode, f_utf_character_t *character);
+ extern f_status_t f_utf_character_unicode_from(const f_utf_char_t unicode, f_utf_char_t *character);
#endif // _di_f_utf_character_unicode_from_
/**
* F_valid_not (with error bit) if string is not a valid Unicode string.
*/
#ifndef _di_f_utf_character_unicode_string_to_
- extern f_status_t f_utf_character_unicode_string_to(const f_utf_string_t string, const f_array_length_t length, f_utf_t *unicode);
+ extern f_status_t f_utf_character_unicode_string_to(const f_utf_string_t string, const f_array_length_t length, f_utf_char_t *unicode);
#endif // _di_f_utf_character_unicode_string_to_
/**
- * Convert an ASCII or UTF-8 character, stored as a string (character buffer), to the specialized f_utf_character_t type.
+ * Convert an ASCII or UTF-8 character, stored as a string (character buffer), to the specialized f_utf_char_t type.
*
* @param character
- * The character string to be converted to the f_utf_character_t type.
+ * The character string to be converted to the f_utf_char_t type.
* There must be enough space allocated to convert against, as limited by width_max.
* @param width_max
* The maximum width available for converting.
* Can be anything greater than 0.
* @param character_utf
- * The generated character of type f_utf_character_t.
+ * The generated character of type f_utf_char_t.
* This value may be cleared, even on error.
*
* @return
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_char_to_character_
- extern f_status_t f_utf_char_to_character(const f_string_t character, const f_array_length_t width_max, f_utf_character_t *character_utf);
+ extern f_status_t f_utf_char_to_character(const f_string_t character, const f_array_length_t width_max, f_utf_char_t *character_utf);
#endif // _di_f_utf_char_to_character_
/**
*
* @param character
* The (UTF-8) character.
- * The f_utf_character_t is a 32-bit integer containing UTF-8 sequences, unchanged.
+ * The f_utf_char_t is a 32-bit integer containing UTF-8 sequences, unchanged.
* @param width_max
* The max width available for representing the UTF-8 character.
* There must be enough space in the character buffer to handle the Unicode width.
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_unicode_from_
- extern f_status_t f_utf_unicode_from(const f_utf_t unicode, const f_array_length_t width_max, f_string_t *character);
+ extern f_status_t f_utf_unicode_from(const f_utf_char_t unicode, const f_array_length_t width_max, f_string_t *character);
#endif // _di_f_utf_unicode_from_
/**
*
* @param character
* The (UTF-8) character to convert to the Unicode representation.
- * The f_utf_character_t is a 32-bit integer containing UTF-8 sequences, unchanged.
+ * The f_utf_char_t is a 32-bit integer containing UTF-8 sequences, unchanged.
* @param width_max
* The max width available for representing the UTF-8 character.
* There must be enough space in the character buffer to handle the Unicode width.
* @see f_utf_character_is_valid()
*/
#ifndef _di_f_utf_unicode_to_
- extern f_status_t f_utf_unicode_to(const f_string_t character, const f_array_length_t width_max, f_utf_t *unicode);
+ extern f_status_t f_utf_unicode_to(const f_string_t character, const f_array_length_t width_max, f_utf_char_t *unicode);
#endif // _di_f_utf_unicode_to_
/**
* F_valid_not (with error bit) if string is not a valid Unicode string.
*/
#ifndef _di_f_utf_unicode_string_to_
- extern f_status_t f_utf_unicode_string_to(const f_string_t string, const f_array_length_t length, f_utf_t *unicode);
+ extern f_status_t f_utf_unicode_string_to(const f_string_t string, const f_array_length_t length, f_utf_char_t *unicode);
#endif // _di_f_utf_unicode_string_to_
#ifdef __cplusplus
if (!buffer.used) return F_data_not;
if (range->start > range->stop) return F_data_not_stop;
- while (buffer.string[range->start] != F_utf_character_t_eol_d) {
+ while (buffer.string[range->start] != F_utf_char_t_eol_d) {
- if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
while (buffer.string[range->start] != seek_to_this) {
- if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
- if (buffer.string[range->start] == F_utf_character_t_eol_d) return F_none_eol;
+ if (buffer.string[range->start] == F_utf_char_t_eol_d) return F_none_eol;
++range->start;
while (buffer.string[range->start] != seek_to_this) {
- if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_false;
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
return F_status_set_error(F_utf_fragment);
}
- f_utf_character_t character_utf = 0;
+ f_utf_char_t character_utf = 0;
{
const f_status_t status = private_f_utf_char_to_character(character, width_max, &character_utf);
#endif
#ifndef _di_f_utf_character_is_
- f_status_t f_utf_character_is(const f_utf_character_t character) {
+ f_status_t f_utf_character_is(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_utf_fragment;
}
#endif // _di_f_utf_character_is_
#ifndef _di_f_utf_character_is_alpha_
- f_status_t f_utf_character_is_alpha(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_alpha(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_alpha(character);
}
- if (isalpha(macro_f_utf_character_t_to_char_1(character))) {
+ if (isalpha(macro_f_utf_char_t_to_char_1(character))) {
return F_true;
}
#endif // _di_f_utf_character_is_alpha_
#ifndef _di_f_utf_character_is_alpha_digit_
- f_status_t f_utf_character_is_alpha_digit(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_alpha_digit(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_alpha_digit(character);
}
- if (isalnum(macro_f_utf_character_t_to_char_1(character))) {
+ if (isalnum(macro_f_utf_char_t_to_char_1(character))) {
return F_true;
}
#endif // _di_f_utf_character_is_alpha_digit_
#ifndef _di_f_utf_character_is_alpha_numeric_
- f_status_t f_utf_character_is_alpha_numeric(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_alpha_numeric(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_alpha_numeric(character);
}
- if (isalnum(macro_f_utf_character_t_to_char_1(character))) {
+ if (isalnum(macro_f_utf_char_t_to_char_1(character))) {
return F_true;
}
#endif // _di_f_utf_character_is_alpha_numeric_
#ifndef _di_f_utf_character_is_ascii_
- f_status_t f_utf_character_is_ascii(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_ascii(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character)) {
return F_false;
}
#endif // _di_f_utf_character_is_ascii_
#ifndef _di_f_utf_character_is_combining_
- f_status_t f_utf_character_is_combining(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_combining(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_combining_
#ifndef _di_f_utf_character_is_control_
- f_status_t f_utf_character_is_control(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_control(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_control(character);
}
- if (iscntrl(macro_f_utf_character_t_to_char_1(character))) {
+ if (iscntrl(macro_f_utf_char_t_to_char_1(character))) {
return F_true;
}
#endif // _di_f_utf_character_is_control_
#ifndef _di_f_utf_character_is_control_code_
- f_status_t f_utf_character_is_control_code(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_control_code(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_control_code(character);
}
- if (iscntrl(macro_f_utf_character_t_to_char_1(character))) {
+ if (iscntrl(macro_f_utf_char_t_to_char_1(character))) {
return F_true;
}
#endif // _di_f_utf_character_is_control_code_
#ifndef _di_f_utf_character_is_control_picture_
- f_status_t character_is_control_format(const f_utf_character_t character) {
+ f_status_t character_is_control_format(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_control_format_
#ifndef _di_f_utf_character_is_control_picture_
- f_status_t f_utf_character_is_control_picture(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_control_picture(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_control_picture_
#ifndef _di_f_utf_character_is_digit_
- f_status_t f_utf_character_is_digit(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_digit(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_digit(character);
}
- if (isdigit(macro_f_utf_character_t_to_char_1(character))) {
+ if (isdigit(macro_f_utf_char_t_to_char_1(character))) {
return F_true;
}
#endif // _di_f_utf_character_is_digit_
#ifndef _di_f_utf_character_is_emoji_
- f_status_t f_utf_character_is_emoji(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_emoji(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_emoji(character);
}
- if (isdigit(macro_f_utf_character_t_to_char_1(character))) {
+ if (isdigit(macro_f_utf_char_t_to_char_1(character))) {
return F_true;
}
#endif // _di_f_utf_character_is_emoji_
#ifndef _di_f_utf_character_is_fragment_
- f_status_t f_utf_character_is_fragment(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_fragment(const f_utf_char_t character) {
- return macro_f_utf_character_t_width_is(character) == 1;
+ return macro_f_utf_char_t_width_is(character) == 1;
}
#endif // _di_f_utf_character_is_fragment_
#ifndef _di_f_utf_character_is_graph_
- f_status_t f_utf_character_is_graph(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_graph(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return F_true;
}
- if (isgraph(macro_f_utf_character_t_to_char_1(character))) {
+ if (isgraph(macro_f_utf_char_t_to_char_1(character))) {
return F_true;
}
#endif // _di_f_utf_character_is_graph_
#ifndef _di_f_utf_character_is_numeric_
- f_status_t f_utf_character_is_numeric(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_numeric(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_numeric(character);
}
- if (isdigit(macro_f_utf_character_t_to_char_1(character))) {
+ if (isdigit(macro_f_utf_char_t_to_char_1(character))) {
return F_true;
}
#endif // _di_f_utf_character_is_numeric_
#ifndef _di_f_utf_character_is_phonetic_
- f_status_t f_utf_character_is_phonetic(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_phonetic(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_phonetic_
#ifndef _di_f_utf_character_is_private_
- f_status_t f_utf_character_is_private(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_private(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_phonetic_
#ifndef _di_f_utf_character_is_punctuation_
- f_status_t f_utf_character_is_punctuation(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_punctuation(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_punctuation_
#ifndef _di_f_utf_character_is_symbol_
- f_status_t f_utf_character_is_symbol(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_symbol(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_symbol_
#ifndef _di_f_utf_character_is_unassigned_
- f_status_t f_utf_character_is_unassigned(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_unassigned(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_unassigned_
#ifndef _di_f_utf_character_is_valid_
- f_status_t f_utf_character_is_valid(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_valid(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_valid_
#ifndef _di_f_utf_character_is_whitespace_
- f_status_t f_utf_character_is_whitespace(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_whitespace(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_whitespace(character);
}
- if (isspace(macro_f_utf_character_t_to_char_1(character))) {
+ if (isspace(macro_f_utf_char_t_to_char_1(character))) {
return F_true;
}
#endif // _di_f_utf_character_is_whitespace_
#ifndef _di_f_utf_character_is_whitespace_modifier_
- f_status_t f_utf_character_is_whitespace_modifier(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_whitespace_modifier(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_whitespace_modifier_
#ifndef _di_f_utf_character_is_whitespace_other_
- f_status_t f_utf_character_is_whitespace_other(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_whitespace_other(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_whitespace_other_
#ifndef _di_f_utf_character_is_wide_
- f_status_t f_utf_character_is_wide(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_wide(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
#endif // _di_f_utf_character_is_wide_
#ifndef _di_f_utf_character_is_word_
- f_status_t f_utf_character_is_word(const f_utf_character_t character, const bool strict) {
+ f_status_t f_utf_character_is_word(const f_utf_char_t character, const bool strict) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_word(character, strict);
}
- if (isalnum(macro_f_utf_character_t_to_char_1(character)) || character == f_string_ascii_underscore_s.string[0]) {
+ if (isalnum(macro_f_utf_char_t_to_char_1(character)) || character == f_string_ascii_underscore_s.string[0]) {
return F_true;
}
#endif // _di_f_utf_character_is_word_
#ifndef _di_f_utf_character_is_word_dash_
- f_status_t f_utf_character_is_word_dash(const f_utf_character_t character, const bool strict) {
+ f_status_t f_utf_character_is_word_dash(const f_utf_char_t character, const bool strict) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_word_dash(character, strict);
}
- if (isalnum(macro_f_utf_character_t_to_char_1(character)) || character == f_string_ascii_underscore_s.string[0] || character == f_string_ascii_minus_s.string[0]) {
+ if (isalnum(macro_f_utf_char_t_to_char_1(character)) || character == f_string_ascii_underscore_s.string[0] || character == f_string_ascii_minus_s.string[0]) {
return F_true;
}
#endif // _di_f_utf_character_is_word_dash_
#ifndef _di_f_utf_character_is_word_dash_plus_
- f_status_t f_utf_character_is_word_dash_plus(const f_utf_character_t character, const bool strict) {
+ f_status_t f_utf_character_is_word_dash_plus(const f_utf_char_t character, const bool strict) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_word_dash_plus(character, strict);
}
- if (isalnum(macro_f_utf_character_t_to_char_1(character)) || character == f_string_ascii_underscore_s.string[0] || character == f_string_ascii_minus_s.string[0] || character == f_string_ascii_plus_s.string[0]) {
+ if (isalnum(macro_f_utf_char_t_to_char_1(character)) || character == f_string_ascii_underscore_s.string[0] || character == f_string_ascii_minus_s.string[0] || character == f_string_ascii_plus_s.string[0]) {
return F_true;
}
#endif // _di_f_utf_character_is_word_dash_plus_
#ifndef _di_f_utf_character_is_zero_width_
- f_status_t f_utf_character_is_zero_width(const f_utf_character_t character) {
+ f_status_t f_utf_character_is_zero_width(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character)) {
- if (macro_f_utf_character_t_width_is(character) == 1) {
+ if (macro_f_utf_char_t_width_is(character)) {
+ if (macro_f_utf_char_t_width_is(character) == 1) {
return F_status_set_error(F_utf_fragment);
}
return private_f_utf_character_is_zero_width(character);
}
- const uint8_t ascii = macro_f_utf_character_t_to_char_1(character);
+ const uint8_t ascii = macro_f_utf_char_t_to_char_1(character);
// These control characters are considered zero-width spaces.
if (ascii >= 0x00 && ascii <= 0x08) {
* @see f_utf_character_is_valid()
*/
#ifndef _di_f_utf_character_is_
- extern f_status_t f_utf_character_is(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is(const f_utf_char_t character);
#endif // _di_f_utf_character_is_
/**
* @see isalpha()
*/
#ifndef _di_f_utf_character_is_alpha_
- extern f_status_t f_utf_character_is_alpha(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_alpha(const f_utf_char_t character);
#endif // _di_f_utf_character_is_alpha_
/**
* @see isalnum()
*/
#ifndef _di_f_utf_character_is_alpha_digit_
- extern f_status_t f_utf_character_is_alpha_digit(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_alpha_digit(const f_utf_char_t character);
#endif // _di_f_utf_character_is_alpha_digit_
/**
* @see isalnum()
*/
#ifndef _di_f_utf_character_is_alpha_numeric_
- extern f_status_t f_utf_character_is_alpha_numeric(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_alpha_numeric(const f_utf_char_t character);
#endif // _di_f_utf_character_is_alpha_numeric_
/**
* F_false if not an ASCII character.
*/
#ifndef _di_f_utf_character_is_ascii_
- extern f_status_t f_utf_character_is_ascii(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_ascii(const f_utf_char_t character);
#endif // _di_f_utf_character_is_ascii_
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_is_combining_
- extern f_status_t f_utf_character_is_combining(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_combining(const f_utf_char_t character);
#endif // _di_f_utf_character_is_combining_
/**
* @see iscntrl()
*/
#ifndef _di_f_utf_character_is_control_
- extern f_status_t f_utf_character_is_control(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_control(const f_utf_char_t character);
#endif // _di_f_utf_character_is_control_
/**
* @see iscntrl()
*/
#ifndef _di_f_utf_character_is_control_code_
- extern f_status_t f_utf_character_is_control_code(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_control_code(const f_utf_char_t character);
#endif // _di_f_utf_character_is_control_code_
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_is_control_format_
- extern f_status_t f_utf_character_is_control_format(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_control_format(const f_utf_char_t character);
#endif // _di_f_utf_character_is_control_format_
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_is_control_picture_
- extern f_status_t f_utf_character_is_control_picture(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_control_picture(const f_utf_char_t character);
#endif // _di_f_utf_character_is_control_picture_
/**
* @see isdigit()
*/
#ifndef _di_f_utf_character_is_digit_
- extern f_status_t f_utf_character_is_digit(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_digit(const f_utf_char_t character);
#endif // _di_f_utf_character_is_digit_
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_is_emoji_
- extern f_status_t f_utf_character_is_emoji(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_emoji(const f_utf_char_t character);
#endif // _di_f_utf_character_is_emoji_
/**
* @see f_utf_character_is_valid()
*/
#ifndef _di_f_utf_character_is_fragment_
- extern f_status_t f_utf_character_is_fragment(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_fragment(const f_utf_char_t character);
#endif // _di_f_utf_character_is_fragment_
/**
* @see isgraph()
*/
#ifndef _di_f_utf_character_is_graph_
- extern f_status_t f_utf_character_is_graph(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_graph(const f_utf_char_t character);
#endif // _di_f_utf_character_is_graph_
/**
* @see isdigit()
*/
#ifndef _di_f_utf_character_is_numeric_
- extern f_status_t f_utf_character_is_numeric(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_numeric(const f_utf_char_t character);
#endif // _di_f_utf_character_is_numeric_
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_is_phonetic_
- extern f_status_t f_utf_character_is_phonetic(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_phonetic(const f_utf_char_t character);
#endif // _di_f_utf_character_is_phonetic_
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_is_private_
- extern f_status_t f_utf_character_is_private(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_private(const f_utf_char_t character);
#endif // _di_f_utf_character_is_private_
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_is_punctuation_
- extern f_status_t f_utf_character_is_punctuation(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_punctuation(const f_utf_char_t character);
#endif // _di_f_utf_character_is_punctuation_
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_is_symbol_
- extern f_status_t f_utf_character_is_symbol(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_symbol(const f_utf_char_t character);
#endif // _di_f_utf_character_is_symbol_
/**
* @see f_utf_character_is_fragment()
*/
#ifndef _di_f_utf_character_is_unassigned_
- extern f_status_t f_utf_character_is_unassigned(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_unassigned(const f_utf_char_t character);
#endif // _di_f_utf_character_is_value_
/**
* @see f_utf_character_is_fragment()
*/
#ifndef _di_f_utf_character_is_valid_
- extern f_status_t f_utf_character_is_valid(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_valid(const f_utf_char_t character);
#endif // _di_f_utf_character_is_value_
/**
* @see isspace()
*/
#ifndef _di_f_utf_character_is_whitespace_
- extern f_status_t f_utf_character_is_whitespace(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_whitespace(const f_utf_char_t character);
#endif // _di_f_utf_character_is_whitespace_
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_is_whitespace_modifier_
- extern f_status_t f_utf_character_is_whitespace_modifier(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_whitespace_modifier(const f_utf_char_t character);
#endif // _di_f_utf_character_is_whitespace_modifier_
/**
* @see isspace()
*/
#ifndef _di_f_utf_character_is_whitespace_other_
- extern f_status_t f_utf_character_is_whitespace_other(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_whitespace_other(const f_utf_char_t character);
#endif // _di_f_utf_character_is_whitespace_other_
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_is_wide_
- extern f_status_t f_utf_character_is_wide(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_wide(const f_utf_char_t character);
#endif // _di_f_utf_character_is_wide_
/**
* @see isalnum()
*/
#ifndef _di_f_utf_character_is_word_
- extern f_status_t f_utf_character_is_word(const f_utf_character_t character, const bool strict);
+ extern f_status_t f_utf_character_is_word(const f_utf_char_t character, const bool strict);
#endif // _di_f_utf_character_is_word_
/**
* @see isalnum()
*/
#ifndef _di_f_utf_character_is_word_dash_
- extern f_status_t f_utf_character_is_word_dash(const f_utf_character_t character, const bool strict);
+ extern f_status_t f_utf_character_is_word_dash(const f_utf_char_t character, const bool strict);
#endif // _di_f_utf_character_is_word_dash_
/**
* @see isalnum()
*/
#ifndef _di_f_utf_character_is_word_dash_plus_
- extern f_status_t f_utf_character_is_word_dash_plus(const f_utf_character_t character, const bool strict);
+ extern f_status_t f_utf_character_is_word_dash_plus(const f_utf_char_t character, const bool strict);
#endif // _di_f_utf_character_is_word_dash_plus_
/**
* F_utf_fragment (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_character_is_zero_width_
- extern f_status_t f_utf_character_is_zero_width(const f_utf_character_t character);
+ extern f_status_t f_utf_character_is_zero_width(const f_utf_char_t character);
#endif // _di_f_utf_character_is_zero_width_
#ifdef __cplusplus
#if !defined(_di_f_utf_string_dynamic_adjust_) || !defined(_di_f_utf_string_dynamic_decimate_by_) || !defined(_di_f_utf_string_dynamics_adjust_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_dynamics_decimate_by_) || !defined(_di_f_utf_string_map_multis_adjust_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_triples_adjust_) || !defined(_di_f_utf_string_triples_decimate_by_)
f_status_t private_f_utf_string_dynamic_adjust(const f_array_length_t length, f_utf_string_dynamic_t * const dynamic) {
- const f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(f_char_t), (void **) & dynamic->string);
+ const f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(f_utf_char_t), (void **) & dynamic->string);
if (F_status_is_error(status)) return status;
dynamic->size = length;
#if !defined(_di_f_utf_string_append_) || !defined(_di_f_utf_string_append_assure_) || !defined(_di_f_utf_string_append_mash_) || !defined(_di_f_utf_string_append_nulless_) || !defined(_di_f_utf_string_dynamic_append_) || !defined(_di_f_utf_string_dynamic_append_assure_) || !defined(_di_f_utf_string_dynamic_append_nulless_) || !defined(_di_f_utf_string_dynamic_decrease_by_) || !defined(_di_f_utf_string_dynamic_increase_) || !defined(_di_f_utf_string_dynamic_increase_by_) || !defined(_di_f_utf_string_dynamic_mash_) || !defined(_di_f_utf_string_dynamic_mash_nulless_) || !defined(f_utf_string_dynamic_partial_append) || !defined(_di_f_utf_string_dynamic_partial_append_assure_) || !defined(_di_f_utf_string_dynamic_partial_mash_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_nulless_) || !defined(_di_f_utf_string_dynamic_terminate_) || !defined(_di_f_utf_string_dynamic_terminate_after_) || !defined(_di_f_utf_string_dynamics_append_) || !defined(_di_f_utf_string_map_multis_append_) || !defined(_di_f_utf_string_mash_nulless_) || !defined(_di_f_utf_string_mash_) || !defined(_di_f_utf_string_maps_append_) || !defined(_di_f_utf_string_prepend_) || !defined(_di_f_utf_string_prepend_nulless_) || !defined(_di_f_utf_string_triples_append_)
f_status_t private_f_utf_string_dynamic_resize(const f_array_length_t length, f_utf_string_dynamic_t * const dynamic) {
- const f_status_t status = f_memory_resize(dynamic->size, length, sizeof(f_char_t), (void **) & dynamic->string);
+ const f_status_t status = f_memory_resize(dynamic->size, length, sizeof(f_utf_char_t), (void **) & dynamic->string);
if (F_status_is_error(status)) return status;
dynamic->size = length;
#endif
#if !defined(_di_f_utf_character_is_unassigned_) || !defined(_di_f_utf_is_unassigned_)
- f_status_t private_f_utf_character_is_unassigned(const f_utf_character_t character) {
+ f_status_t private_f_utf_character_is_unassigned(const f_utf_char_t character) {
- if (macro_f_utf_character_t_width_is(character) < 2) {
+ if (macro_f_utf_char_t_width_is(character) < 2) {
return F_false;
}
- if (macro_f_utf_character_t_width_is(character) == 2) {
+ if (macro_f_utf_char_t_width_is(character) == 2) {
// Greek and Coptic: U+0378 to U+0379.
if (character >= 0xcdb80000 && character <= 0xcdb90000) {
return F_false;
}
- if (macro_f_utf_character_t_width_is(character) == 3) {
+ if (macro_f_utf_char_t_width_is(character) == 3) {
// Samaritan: U+082E, U+082F, U+083F.
if (character == 0xe0a0ae00 || character == 0xe0a0af00 || character == 0xe0a0bf00) {
* @see f_utf_is_unassigned()
*/
#if !defined(_di_f_utf_character_is_unassigned_) || !defined(_di_f_utf_is_unassigned_)
- extern f_status_t private_f_utf_character_is_unassigned(const f_utf_character_t character) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_utf_character_is_unassigned(const f_utf_char_t character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_utf_character_is_unassigned_) || !defined(_di_f_utf_is_unassigned_)
#ifdef __cplusplus
if (F_status_is_error(status)) return status;
}
- memcpy(destination->string + destination->used, source, sizeof(f_utf_character_t) * length);
+ memcpy(destination->string + destination->used, source, sizeof(f_utf_char_t) * length);
destination->used += length;
destination->string[destination->used] = 0;
if (i && i > first) {
size = i - first;
- memcpy(destination->string + destination->used, source + first, sizeof(f_utf_character_t) * size);
+ memcpy(destination->string + destination->used, source + first, sizeof(f_utf_char_t) * size);
destination->used += size;
}
if (i > first) {
size = i - first;
- memcpy(destination->string + destination->used, source + first, sizeof(f_utf_character_t) * size);
+ memcpy(destination->string + destination->used, source + first, sizeof(f_utf_char_t) * size);
destination->used += size;
}
}
if (destination->used) {
- memmove(destination->string + length, destination->string, destination->used);
- memcpy(destination->string, source, sizeof(f_utf_character_t) * length);
+ memmove(destination->string + length, destination->string, sizeof(f_utf_char_t) * destination->used);
+ memcpy(destination->string, source, sizeof(f_utf_char_t) * length);
}
else {
- memcpy(destination->string, source, sizeof(f_utf_character_t) * length);
+ memcpy(destination->string, source, sizeof(f_utf_char_t) * length);
}
destination->used += length;
+
return F_none;
}
#endif // !defined(_di_f_utf_string_dynamic_mish_) || !defined(_di_f_utf_string_dynamic_partial_mish_) || !defined(_di_f_utf_string_dynamic_partial_prepend_assure_) || !defined(_di_f_utf_string_dynamic_partial_prepend_) || !defined(_di_f_utf_string_dynamic_prepend_assure_) || !defined(_di_f_utf_string_dynamic_prepend_) || !defined(_di_f_utf_string_mish_) || !defined(_di_f_utf_string_prepend_assure_) || !defined(_di_f_utf_string_prepend_)
if (F_status_is_error(status)) return status;
}
- memmove(destination->string + offset + size, destination->string + offset, destination->used - offset);
- memcpy(destination->string + offset, source + first, size);
+ memmove(destination->string + offset + size, destination->string + offset, sizeof(f_utf_char_t) * (destination->used - offset));
+ memcpy(destination->string + offset, source + first, sizeof(f_utf_char_t) * size);
destination->used += size;
offset += size;
if (F_status_is_error(status)) return status;
}
- memmove(destination->string + offset + size, destination->string + offset, destination->used - offset);
- memcpy(destination->string + offset, source + first, sizeof(f_utf_character_t) * size);
+ memmove(destination->string + offset + size, destination->string + offset, sizeof(f_utf_char_t) * (destination->used - offset));
+ memcpy(destination->string + offset, source + first, sizeof(f_utf_char_t) * size);
destination->used += size;
offset += size;
} // while
first = i + 1;
+
continue;
}
} // for
return F_data_not_stop;
}
- while (string[range->start] != F_utf_character_t_eol_d) {
+ while (string[range->start] != F_utf_char_t_eol_d) {
- if (macro_f_utf_character_t_width_is(string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf_fragment);
}
while (string[range->start] != seek_to) {
- if (macro_f_utf_character_t_width_is(string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf_fragment);
}
- if (string[range->start] == F_utf_character_t_eol_d) {
+ if (string[range->start] == F_utf_char_t_eol_d) {
return F_none_eol;
}
while (string[range->start] != seek_to) {
- if (macro_f_utf_character_t_width_is(string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf_fragment);
}
void test__f_utf_append__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_append_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_append_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_append_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_append__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_append_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_append_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_append_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_mash__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
- assert_string_equal(destination.string + 3, expected.string + 3);
- assert_string_equal(destination.string + 9, expected.string + 9);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_mash__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
{
const f_status_t status = f_utf_string_dynamic_mash(glue, source, 0);
void test__f_utf_dynamic_mash_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected1.used);
- assert_string_equal(destination.string, expected1.string);
+ for (f_array_length_t i = 0; i < expected1.used; ++i) {
+ assert_int_equal(destination.string[i], expected1.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected2.used);
- assert_string_equal(destination.string, expected2.string);
+ for (f_array_length_t i = 0; i < expected2.used; ++i) {
+ assert_int_equal(destination.string[i], expected2.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_mash_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
{
const f_status_t status = f_utf_string_dynamic_mash_nulless(glue, source, 0);
void test__f_utf_dynamic_mish__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
- assert_string_equal(destination.string + 3, expected.string + 3);
- assert_string_equal(destination.string + 9, expected.string + 9);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_mish__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
{
const f_status_t status = f_utf_string_dynamic_mish(glue, source, 0);
void test__f_utf_dynamic_mish_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected1.used);
- assert_string_equal(destination.string, expected1.string);
+ for (f_array_length_t i = 0; i < expected1.used; ++i) {
+ assert_int_equal(destination.string[i], expected1.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected2.used);
- assert_string_equal(destination.string, expected2.string);
+ for (f_array_length_t i = 0; i < expected2.used; ++i) {
+ assert_int_equal(destination.string[i], expected2.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_mish_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
{
const f_status_t status = f_utf_string_dynamic_mish_nulless(glue, source, 0);
void test__f_utf_dynamic_partial_append__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
- assert_string_equal(destination.string + 3, expected.string + 3);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_append__parameter_checking(void **state) {
const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_append(data, partial, 0);
void test__f_utf_dynamic_partial_append_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
- assert_string_equal(destination.string + 3, expected.string + 3);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
- assert_string_equal(destination.string + 3, expected.string + 3);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_append_assure__parameter_checking(void **state) {
const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_append_assure(data, partial, 0);
void test__f_utf_dynamic_partial_append_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_append_assure_nulless__parameter_checking(void **state) {
const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_append_assure_nulless(data, partial, 0);
void test__f_utf_dynamic_partial_append_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_append_nulless__parameter_checking(void **state) {
const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_append_nulless(data, partial, 0);
void test__f_utf_dynamic_partial_mash__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected1.used);
- assert_string_equal(destination.string, expected1.string);
- assert_string_equal(destination.string + 3, expected1.string + 3);
+ for (f_array_length_t i = 0; i < expected1.used; ++i) {
+ assert_int_equal(destination.string[i], expected1.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected2.used);
- assert_string_equal(destination.string, expected2.string);
- assert_string_equal(destination.string + 3, expected2.string + 3);
- assert_string_equal(destination.string + 9, expected2.string + 9);
+ for (f_array_length_t i = 0; i < expected2.used; ++i) {
+ assert_int_equal(destination.string[i], expected2.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_mash__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_mash(glue, source, partial, 0);
void test__f_utf_dynamic_partial_mash_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected1.used);
- assert_string_equal(destination.string, expected1.string);
+ for (f_array_length_t i = 0; i < expected1.used; ++i) {
+ assert_int_equal(destination.string[i], expected1.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected2.used);
- assert_string_equal(destination.string, expected2.string);
+ for (f_array_length_t i = 0; i < expected2.used; ++i) {
+ assert_int_equal(destination.string[i], expected2.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_mash_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_mash_nulless(glue, source, partial, 0);
void test__f_utf_dynamic_partial_mish__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected1.used);
- assert_string_equal(destination.string, expected1.string);
- assert_string_equal(destination.string + 3, expected1.string + 3);
+ for (f_array_length_t i = 0; i < expected1.used; ++i) {
+ assert_int_equal(destination.string[i], expected1.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected2.used);
- assert_string_equal(destination.string, expected2.string);
- assert_string_equal(destination.string + 3, expected2.string + 3);
- assert_string_equal(destination.string + 9, expected2.string + 9);
+ for (f_array_length_t i = 0; i < expected2.used; ++i) {
+ assert_int_equal(destination.string[i], expected2.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_mish__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_mish(glue, source, partial, 0);
void test__f_utf_dynamic_partial_mish_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected1.used);
- assert_string_equal(destination.string, expected1.string);
+ for (f_array_length_t i = 0; i < expected1.used; ++i) {
+ assert_int_equal(destination.string[i], expected1.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected2.used);
- assert_string_equal(destination.string, expected2.string);
+ for (f_array_length_t i = 0; i < expected2.used; ++i) {
+ assert_int_equal(destination.string[i], expected2.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_mish_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_mish_nulless(glue, source, partial, 0);
void test__f_utf_dynamic_partial_prepend__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
- assert_string_equal(destination.string + 3, expected.string + 3);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_prepend__parameter_checking(void **state) {
const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_prepend(data, partial, 0);
void test__f_utf_dynamic_partial_prepend_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
- assert_string_equal(destination.string + 3, expected.string + 3);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
- assert_string_equal(destination.string + 3, expected.string + 3);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_prepend_assure__parameter_checking(void **state) {
const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_prepend_assure(data, partial, 0);
void test__f_utf_dynamic_partial_prepend_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_prepend_assure_nulless__parameter_checking(void **state) {
const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_prepend_assure_nulless(data, partial, 0);
void test__f_utf_dynamic_partial_prepend_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("_te\0st_", 0, 7);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
- const f_string_range_t partial = macro_f_utf_string_range_t_initialize(1, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "_\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0_\0\0\0", 0, 7);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_string_range_t partial = macro_f_string_range_t_initialize(1, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_partial_prepend_nulless__parameter_checking(void **state) {
const f_utf_string_dynamic_t data = f_utf_string_dynamic_t_initialize;
- const f_string_range_t partial = f_utf_string_range_t_initialize;
+ const f_string_range_t partial = f_string_range_t_initialize;
{
const f_status_t status = f_utf_string_dynamic_partial_prepend_nulless(data, partial, 0);
void test__f_utf_dynamic_prepend__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_prepend_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_prepend_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_prepend_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_dynamic_seek_line__returns_data_not_stop(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
{
- f_string_range_t range = f_utf_string_range_t_initialize;
+ f_string_range_t range = f_string_range_t_initialize;
const f_status_t status = f_utf_string_dynamic_seek_line(source, &range);
void test__f_utf_dynamic_seek_line__returns_none_eos(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_dynamic_seek_line(source, &range);
void test__f_utf_dynamic_seek_line__returns_none_stop(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 2);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 2);
const f_status_t status = f_utf_string_dynamic_seek_line(source, &range);
void test__f_utf_dynamic_seek_line__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_dynamic_seek_line(source, &range);
void test__f_utf_dynamic_seek_line__parameter_checking(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
const f_status_t status = f_utf_string_dynamic_seek_line(source, 0);
void test__f_utf_dynamic_seek_line_to__at_newline(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\nXst", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
void test__f_utf_dynamic_seek_line_to__returns_data_not_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
{
- f_string_range_t range = f_utf_string_range_t_initialize;
+ f_string_range_t range = f_string_range_t_initialize;
const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
void test__f_utf_dynamic_seek_line_to__returns_none_eos(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
void test__f_utf_dynamic_seek_line_to__returns_none_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 2);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 2);
const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
void test__f_utf_dynamic_seek_line_to__works(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], &range);
void test__f_utf_dynamic_seek_line_to__parameter_checking(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
const f_status_t status = f_utf_string_dynamic_seek_line_to(source, to.string[0], 0);
void test__f_utf_dynamic_seek_to__returns_data_not_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
{
- f_string_range_t range = f_utf_string_range_t_initialize;
+ f_string_range_t range = f_string_range_t_initialize;
const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
void test__f_utf_dynamic_seek_to__returns_none_eos(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
void test__f_utf_dynamic_seek_to__returns_none_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 2);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 2);
const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
void test__f_utf_dynamic_seek_to__works(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\nXst", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], &range);
void test__f_utf_dynamic_seek_to__parameter_checking(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
const f_status_t status = f_utf_string_dynamic_seek_to(source, to.string[0], 0);
assert_int_equal(status, F_none);
- data.string[0] = 'X';
+ data.string[0] = (f_utf_char_t) 'X';
}
{
assert_int_equal(status, F_none);
- data.string[0] = 'X';
+ data.string[0] = (f_utf_char_t) 'X';
}
{
void test__f_utf_dynamics_append__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
f_utf_string_dynamics_t destination = f_utf_string_dynamics_t_initialize;
{
assert_int_equal(destination.used, 1);
assert_int_equal(destination.array[0].used, source.used);
- assert_string_equal(destination.array[0].string, source.string);
- assert_string_equal(destination.array[0].string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.array[0].string[i], source.string[i]);
+ } // for
}
free((void *) destination.array[0].string);
f_utf_string_dynamics_t destination = f_utf_string_dynamics_t_initialize;
const f_utf_string_static_t test_sources[] = {
- macro_f_utf_string_static_t_initialize("te\0st1", 0, 6),
- macro_f_utf_string_static_t_initialize("test2", 0, 5),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\01\0\0\0", 0, 6),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\02\0\0\0", 0, 5),
};
{
assert_int_equal(status, F_none);
assert_int_equal(source.array[source.used].used, test_sources[source.used].used);
- assert_string_equal(source.array[source.used].string, test_sources[source.used].string);
- assert_string_equal(source.array[source.used].string + 3, test_sources[source.used].string + 3);
+ for (f_array_length_t i = 0; i < source.array[source.used].used; ++i) {
+ assert_int_equal(source.array[source.used].string[i], test_sources[source.used].string[i]);
+ } // for
} // for
}
assert_int_equal(destination.used, source.used);
assert_int_equal(destination.size, source.used);
- for (f_array_length_t i = 0; i < length_inner; ++i) {
+ for (f_array_length_t i = 0; i < source.used; ++i) {
assert_int_equal(destination.array[i].used, source.array[i].used);
- assert_string_equal(destination.array[i].string, source.array[i].string);
+ for (f_array_length_t j = 0; j < destination.array[i].used; ++j) {
+ assert_int_equal(destination.array[i].string[j], source.array[i].string[j]);
+ } // for
} // for
}
f_utf_string_dynamicss_t destination = f_utf_string_dynamicss_t_initialize;
const f_utf_string_static_t test_names[] = {
- macro_f_utf_string_static_t_initialize("test1", 0, 5),
- macro_f_utf_string_static_t_initialize("test2", 0, 5),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\01\0\0\0", 0, 5),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\02\0\0\0", 0, 5),
};
{
status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used]);
assert_int_equal(status, F_none);
- assert_string_equal(source.array[source.used].string, test_names[source.used].string);
assert_int_equal(source.array[source.used].used, test_names[source.used].used);
+
+ for (f_array_length_t i = 0; i < source.array[source.used].used; ++i) {
+ assert_int_equal(source.array[source.used].string[i], test_names[source.used].string[i]);
+ } // for
} // for
}
for (f_array_length_t i = 0; i < length_inner; ++i) {
assert_int_equal(destination.array[0].array[i].used, test_names[i].used);
- assert_string_equal(destination.array[0].array[i].string, test_names[i].string);
+
+ for (f_array_length_t j = 0; j < destination.array[0].array[i].used; ++j) {
+ assert_int_equal(destination.array[0].array[i].string[j], test_names[i].string[j]);
+ } // for
} // for
}
free((void *) source.array[i].string);
} // for
-
for (f_array_length_t i = 0; i < destination.array[0].used; ++i) {
free((void *) destination.array[0].array[i].string);
} // for
f_utf_string_dynamicss_t destination = f_utf_string_dynamicss_t_initialize;
const f_utf_string_static_t test_names[] = {
- macro_f_utf_string_static_t_initialize("test1", 0, 5),
- macro_f_utf_string_static_t_initialize("test2", 0, 5),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\01\0\0\0", 0, 5),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\02\0\0\0", 0, 5),
};
{
status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i]);
assert_int_equal(status, F_none);
- assert_string_equal(source.array[source.used].array[i].string, test_names[i].string);
assert_int_equal(source.array[source.used].array[i].used, test_names[i].used);
+
+ for (f_array_length_t j = 0; j < source.array[source.used].array[i].used; ++j) {
+ assert_int_equal(source.array[source.used].array[i].string[j], test_names[i].string[j]);
+ } // for
} // for
source.array[source.used].used = length_inner;
assert_int_equal(destination.array[j].array[i].used, test_names[i].used);
- assert_string_equal(destination.array[j].array[i].string, test_names[i].string);
+ for (f_array_length_t k = 0; k < destination.array[j].array[i].used; ++k) {
+ assert_int_equal(destination.array[j].array[i].string[k], test_names[i].string[k]);
+ } // for
} // for
} // for
}
f_utf_string_map_multis_t destination = f_utf_string_map_multis_t_initialize;
f_utf_string_static_t test_value_array[] = {
- macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
- macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\01\0\0\0", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11),
};
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize("test_name", 0, 9);
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\0", 0, 9);
const f_utf_string_statics_t test_value = macro_f_utf_string_statics_t_initialize(test_value_array, 0, length_values);
{
assert_int_equal(status, F_none);
assert_int_equal(source.name.used, test_name.used);
- assert_string_equal(source.name.string, test_name.string);
+
+ for (f_array_length_t i = 0; i < source.name.used; ++i) {
+ assert_int_equal(source.name.string[i], test_name.string[i]);
+ } // for
status = f_utf_string_dynamics_append_all(test_value, &source.value);
assert_int_equal(source.value.array[0].used, test_value.array[0].used);
assert_int_equal(source.value.array[1].used, test_value.array[1].used);
- assert_string_equal(source.value.array[0].string, test_value.array[0].string);
- assert_string_equal(source.value.array[1].string, test_value.array[1].string);
+ for (f_array_length_t i = 0; i < source.value.array[0].used; ++i) {
+ assert_int_equal(source.value.array[0].string[i], test_value.array[0].string[i]);
+ } // for
+
+ for (f_array_length_t i = 0; i < source.value.array[1].used; ++i) {
+ assert_int_equal(source.value.array[1].string[i], test_value.array[1].string[i]);
+ } // for
}
{
assert_string_equal(destination.array[0].name.string, source.name.string);
assert_string_equal(destination.array[0].value.array[0].string, source.value.array[0].string);
assert_string_equal(destination.array[0].value.array[1].string, source.value.array[1].string);
+
+ for (f_array_length_t j = 0; j < destination.array[0].name.used; ++j) {
+ assert_int_equal(destination.array[0].name.string[j], source.name.string[j]);
+ } // for
+
+ for (f_array_length_t j = 0; j < destination.array[0].value.array[0].used; ++j) {
+ assert_int_equal(destination.array[0].value.array[0].string[j], source.value.array[0].string[j]);
+ } // for
+
+ for (f_array_length_t j = 0; j < destination.array[0].value.array[1].used; ++j) {
+ assert_int_equal(destination.array[0].value.array[1].string[j], source.value.array[1].string[j]);
+ } // for
}
free((void *) source.name.string);
f_utf_string_map_multis_t destination = f_utf_string_map_multis_t_initialize;
f_utf_string_static_t test_value_array[] = {
- macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
- macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\01\0\0\0", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11),
};
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize("test_name", 0, 9);
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\0", 0, 9);
const f_utf_string_statics_t test_value = macro_f_utf_string_statics_t_initialize(test_value_array, 0, length_values);
{
f_utf_string_map_multiss_t destination = f_utf_string_map_multiss_t_initialize;
f_utf_string_static_t test_value_array1[] = {
- macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
- macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\01\0\0\0", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11),
};
f_utf_string_static_t test_value_array2[] = {
- macro_f_utf_string_static_t_initialize("test_value3", 0, 11),
- macro_f_utf_string_static_t_initialize("test_value4", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\03\0\0\0", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\04\0\0\0", 0, 11),
};
const f_utf_string_static_t test_names[] = {
- macro_f_utf_string_static_t_initialize("test_name1", 0, 10),
- macro_f_utf_string_static_t_initialize("test_name2", 0, 10),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\01\0\0\0", 0, 10),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\02\0\0\0", 0, 10),
};
const f_utf_string_statics_t test_values[] = {
f_utf_string_map_multiss_t destination = f_utf_string_map_multiss_t_initialize;
f_utf_string_static_t test_value_array1[] = {
- macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
- macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\01\0\0\0", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11),
};
f_utf_string_static_t test_value_array2[] = {
- macro_f_utf_string_static_t_initialize("test_value3", 0, 11),
- macro_f_utf_string_static_t_initialize("test_value4", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\03\0\0\0", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\04\0\0\0", 0, 11),
};
const f_utf_string_static_t test_names[] = {
- macro_f_utf_string_static_t_initialize("test_name1", 0, 10),
- macro_f_utf_string_static_t_initialize("test_name2", 0, 10),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\01\0\0\0", 0, 10),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\02\0\0\0", 0, 10),
};
const f_utf_string_statics_t test_values[] = {
f_utf_string_map_t source = f_utf_string_map_t_initialize;
f_utf_string_maps_t destination = f_utf_string_maps_t_initialize;
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize("test_name", 0, 9);
- const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize("test_value", 0, 10);
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\0", 0, 9);
+ const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\0", 0, 10);
{
f_status_t status = f_utf_string_dynamic_append(test_name, &source.name);
f_utf_string_maps_t source = f_utf_string_maps_t_initialize;
f_utf_string_maps_t destination = f_utf_string_maps_t_initialize;
- const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize("test_name", 0, 9);
- const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize("test_value", 0, 10);
+ const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\0", 0, 9);
+ const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\0", 0, 10);
{
f_status_t status = f_utf_string_maps_resize(length_inner, &source);
f_utf_string_mapss_t destination = f_utf_string_mapss_t_initialize;
const f_utf_string_static_t test_names[] = {
- macro_f_utf_string_static_t_initialize("test_name1", 0, 10),
- macro_f_utf_string_static_t_initialize("test_name2", 0, 10),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\01\0\0\0", 0, 10),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\02\0\0\0", 0, 10),
};
const f_utf_string_static_t test_values[] = {
- macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
- macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\01\0\0\0", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11),
};
{
f_utf_string_mapss_t destination = f_utf_string_mapss_t_initialize;
const f_utf_string_static_t test_names[] = {
- macro_f_utf_string_static_t_initialize("test_name1", 0, 10),
- macro_f_utf_string_static_t_initialize("test_name2", 0, 10),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\01\0\0\0", 0, 10),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e\0\0\02\0\0\0", 0, 10),
};
const f_utf_string_static_t test_values[] = {
- macro_f_utf_string_static_t_initialize("test_value1", 0, 11),
- macro_f_utf_string_static_t_initialize("test_value2", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\01\0\0\0", 0, 11),
+ macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11),
};
{
void test__f_utf_mash__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
- assert_string_equal(destination.string + 3, expected.string + 3);
- assert_string_equal(destination.string + 9, expected.string + 9);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_mash__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
{
const f_status_t status = f_utf_string_mash(glue.string, glue.used, source.string, source.used, 0);
void test__f_utf_mash_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected1.used);
- assert_string_equal(destination.string, expected1.string);
+ for (f_array_length_t i = 0; i < expected1.used; ++i) {
+ assert_int_equal(destination.string[i], expected1.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected2.used);
- assert_string_equal(destination.string, expected2.string);
+ for (f_array_length_t i = 0; i < expected2.used; ++i) {
+ assert_int_equal(destination.string[i], expected2.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_mash_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
{
const f_status_t status = f_utf_string_mash_nulless(glue.string, glue.used, source.string, source.used, 0);
void test__f_utf_mish__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("te\0st:te\0st", 0, 11);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 11);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
- assert_string_equal(destination.string + 3, expected.string + 3);
- assert_string_equal(destination.string + 9, expected.string + 9);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_mish__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
{
const f_status_t status = f_utf_string_mish(glue.string, glue.used, source.string, source.used, 0);
void test__f_utf_mish_nulless__works(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize("test", 0, 4);
- const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize("test:test", 0, 9);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected1 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
+ const f_utf_string_static_t expected2 = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0:\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 9);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected1.used);
- assert_string_equal(destination.string, expected1.string);
+ for (f_array_length_t i = 0; i < expected1.used; ++i) {
+ assert_int_equal(destination.string[i], expected1.string[i]);
+ } // for
}
// Check that the glue is added.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected2.used);
- assert_string_equal(destination.string, expected2.string);
+ for (f_array_length_t i = 0; i < expected2.used; ++i) {
+ assert_int_equal(destination.string[i], expected2.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_mish_nulless__parameter_checking(void **state) {
- const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize(":", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t glue = macro_f_utf_string_static_t_initialize((f_utf_string_t) ":\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
{
const f_status_t status = f_utf_string_mish_nulless(glue.string, glue.used, source.string, source.used, 0);
void test__f_utf_prepend__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_prepend_assure__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, source.used);
- assert_string_equal(destination.string, source.string);
- assert_string_equal(destination.string + 3, source.string + 3);
+ for (f_array_length_t i = 0; i < source.used; ++i) {
+ assert_int_equal(destination.string[i], source.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_prepend_assure_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
// The string already exists, so destination should be unchanged.
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_prepend_nulless__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\0st", 0, 5);
- const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\0\0\0\0s\0\0\0t\0\0\0", 0, 5);
+ const f_utf_string_static_t expected = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
f_utf_string_dynamic_t destination = f_utf_string_dynamic_t_initialize;
{
assert_int_equal(status, F_none);
assert_int_equal(destination.used, expected.used);
- assert_string_equal(destination.string, expected.string);
+ for (f_array_length_t i = 0; i < expected.used; ++i) {
+ assert_int_equal(destination.string[i], expected.string[i]);
+ } // for
}
free((void *) destination.string);
void test__f_utf_seek_line__returns_data_not_stop(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
{
- f_string_range_t range = f_utf_string_range_t_initialize;
+ f_string_range_t range = f_string_range_t_initialize;
const f_status_t status = f_utf_string_seek_line(source.string, &range);
void test__f_utf_seek_line__returns_none_stop(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_line(source.string, &range);
void test__f_utf_seek_line__works(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_line(source.string, &range);
void test__f_utf_seek_line__parameter_checking(void **state) {
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
const f_status_t status = f_utf_string_seek_line(source.string, 0);
void test__f_utf_seek_line_to__at_newline(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\nXst", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], &range);
void test__f_utf_seek_line_to__returns_data_not_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
{
- f_string_range_t range = f_utf_string_range_t_initialize;
+ f_string_range_t range = f_string_range_t_initialize;
const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], &range);
void test__f_utf_seek_line_to__returns_none_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test", 0, 4);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0", 0, 4);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], &range);
void test__f_utf_seek_line_to__works(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], &range);
void test__f_utf_seek_line_to__parameter_checking(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
const f_status_t status = f_utf_string_seek_line_to(source.string, to.string[0], 0);
void test__f_utf_seek_to__returns_data_not_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
{
- f_string_range_t range = f_utf_string_range_t_initialize;
+ f_string_range_t range = f_string_range_t_initialize;
const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], &range);
void test__f_utf_seek_to__returns_none_stop(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("test\nafter", 0, 10);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0\n\0\0\0a\0\0\0f\0\0\0t\0\0\0e\0\0\0r\0\0\0", 0, 10);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], &range);
void test__f_utf_seek_to__works(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("te\nXst", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0\n\0\0\0X\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
- f_string_range_t range = macro_f_utf_string_range_t_initialize(0, source.used - 1);
+ f_string_range_t range = macro_f_string_range_t_initialize(0, source.used - 1);
const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], &range);
void test__f_utf_seek_to__parameter_checking(void **state) {
- const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize("X", 0, 1);
- const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize("teX\nst", 0, 6);
+ const f_utf_string_static_t to = macro_f_utf_string_static_t_initialize((f_utf_string_t) "X\0\0\0", 0, 1);
+ const f_utf_string_static_t source = macro_f_utf_string_static_t_initialize((f_utf_string_t) "t\0\0\0e\0\0\0X\0\0\0\n\0\0\0s\0\0\0t\0\0\0", 0, 6);
{
const f_status_t status = f_utf_string_seek_to(source.string, to.string[0], 0);
void test__f_utf_triples_append__works(void **state) {
- const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize("a", 0, 1);
- const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize("b", 0, 1);
- const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize("c", 0, 1);
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "a\0\0\0", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "b\0\0\0", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "c\0\0\0", 0, 1);
const f_utf_string_triple_t source = macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c);
f_utf_string_triples_t destination = f_utf_string_triples_t_initialize;
const int length_sources = 2;
- const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize("a", 0, 1);
- const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize("b", 0, 1);
- const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize("c", 0, 1);
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "a\0\0\0", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "b\0\0\0", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "c\0\0\0", 0, 1);
- const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize("d", 0, 1);
- const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize("e", 0, 1);
- const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize("f", 0, 1);
+ const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize((f_utf_string_t) "d\0\0\0", 0, 1);
+ const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize((f_utf_string_t) "e\0\0\0", 0, 1);
+ const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize((f_utf_string_t) "f\0\0\0", 0, 1);
f_utf_string_triple_t sources_array[] = {
macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c),
const int length_sources = 2;
- const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize("a", 0, 1);
- const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize("b", 0, 1);
- const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize("c", 0, 1);
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "a\0\0\0", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "b\0\0\0", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "c\0\0\0", 0, 1);
- const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize("d", 0, 1);
- const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize("e", 0, 1);
- const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize("f", 0, 1);
+ const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize((f_utf_string_t) "d\0\0\0", 0, 1);
+ const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize((f_utf_string_t) "e\0\0\0", 0, 1);
+ const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize((f_utf_string_t) "f\0\0\0", 0, 1);
f_utf_string_triple_t sources_array[] = {
macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c),
const int length_sources = 2;
const int length_sources_set = 2;
- const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize("a", 0, 1);
- const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize("b", 0, 1);
- const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize("c", 0, 1);
+ const f_utf_string_static_t test_a = macro_f_utf_string_static_t_initialize((f_utf_string_t) "a\0\0\0", 0, 1);
+ const f_utf_string_static_t test_b = macro_f_utf_string_static_t_initialize((f_utf_string_t) "b\0\0\0", 0, 1);
+ const f_utf_string_static_t test_c = macro_f_utf_string_static_t_initialize((f_utf_string_t) "c\0\0\0", 0, 1);
- const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize("d", 0, 1);
- const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize("e", 0, 1);
- const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize("f", 0, 1);
+ const f_utf_string_static_t test_d = macro_f_utf_string_static_t_initialize((f_utf_string_t) "d\0\0\0", 0, 1);
+ const f_utf_string_static_t test_e = macro_f_utf_string_static_t_initialize((f_utf_string_t) "e\0\0\0", 0, 1);
+ const f_utf_string_static_t test_f = macro_f_utf_string_static_t_initialize((f_utf_string_t) "f\0\0\0", 0, 1);
- const f_utf_string_static_t test_g = macro_f_utf_string_static_t_initialize("g", 0, 1);
- const f_utf_string_static_t test_h = macro_f_utf_string_static_t_initialize("h", 0, 1);
- const f_utf_string_static_t test_i = macro_f_utf_string_static_t_initialize("i", 0, 1);
+ const f_utf_string_static_t test_g = macro_f_utf_string_static_t_initialize((f_utf_string_t) "g\0\0\0", 0, 1);
+ const f_utf_string_static_t test_h = macro_f_utf_string_static_t_initialize((f_utf_string_t) "h\0\0\0", 0, 1);
+ const f_utf_string_static_t test_i = macro_f_utf_string_static_t_initialize((f_utf_string_t) "i\0\0\0", 0, 1);
- const f_utf_string_static_t test_j = macro_f_utf_string_static_t_initialize("j", 0, 1);
- const f_utf_string_static_t test_k = macro_f_utf_string_static_t_initialize("k", 0, 1);
- const f_utf_string_static_t test_l = macro_f_utf_string_static_t_initialize("l", 0, 1);
+ const f_utf_string_static_t test_j = macro_f_utf_string_static_t_initialize((f_utf_string_t) "j\0\0\0", 0, 1);
+ const f_utf_string_static_t test_k = macro_f_utf_string_static_t_initialize((f_utf_string_t) "k\0\0\0", 0, 1);
+ const f_utf_string_static_t test_l = macro_f_utf_string_static_t_initialize((f_utf_string_t) "l\0\0\0", 0, 1);
f_utf_string_triple_t sources_array1[] = {
macro_f_utf_string_triple_t_initialize(test_a, test_b, test_c),
#endif // _di_fl_string_dynamic_rip_nulless_
#ifndef _di_fl_string_dynamic_seek_line_to_utf_character_
- f_status_t fl_string_dynamic_seek_line_to_utf_character(const f_string_static_t buffer, const f_utf_character_t seek_to_this, f_string_range_t * const range) {
+ f_status_t fl_string_dynamic_seek_line_to_utf_character(const f_string_static_t buffer, const f_utf_char_t seek_to_this, f_string_range_t * const range) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
return F_data_not_stop;
}
- const unsigned short seek_width = macro_f_utf_character_t_width(seek_to_this);
+ const unsigned short seek_width = macro_f_utf_char_t_width(seek_to_this);
f_status_t status = F_none;
}
if (width == seek_width) {
- f_utf_character_t character = 0;
+ f_utf_char_t character = 0;
status = f_utf_char_to_character(buffer.string + range->start, width_max, &character);
if (F_status_is_error(status)) return status;
#endif // _di_fl_string_dynamic_seek_line_until_graph_non_
#ifndef _di_fl_string_dynamic_seek_to_utf_character_
- f_status_t fl_string_dynamic_seek_to_utf_character(const f_string_static_t buffer, const f_utf_character_t seek_to_this, f_string_range_t * const range) {
+ f_status_t fl_string_dynamic_seek_to_utf_character(const f_string_static_t buffer, const f_utf_char_t seek_to_this, f_string_range_t * const range) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
return F_data_not_stop;
}
- const unsigned short seek_width = macro_f_utf_character_t_width(seek_to_this);
+ const unsigned short seek_width = macro_f_utf_char_t_width(seek_to_this);
f_status_t status = F_none;
}
if (width == seek_width) {
- f_utf_character_t character = 0;
+ f_utf_char_t character = 0;
status = f_utf_char_to_character(buffer.string + range->start, width_max, &character);
if (F_status_is_error(status)) return status;
#endif // _di_fl_string_rip_nulless_
#ifndef _di_fl_string_seek_line_to_utf_character_
- f_status_t fl_string_seek_line_to_utf_character(const f_string_t string, const f_utf_character_t seek_to, f_string_range_t * const range) {
+ f_status_t fl_string_seek_line_to_utf_character(const f_string_t string, const f_utf_char_t seek_to, f_string_range_t * const range) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
return F_data_not_stop;
}
- const unsigned short seek_width = macro_f_utf_character_t_width(seek_to);
+ const unsigned short seek_width = macro_f_utf_char_t_width(seek_to);
f_status_t status = F_none;
}
if (width == seek_width) {
- f_utf_character_t character = 0;
+ f_utf_char_t character = 0;
status = f_utf_char_to_character(string + range->start, width_max, &character);
if (F_status_is_error(status)) return status;
#endif // _di_fl_string_seek_line_until_graph_non_
#ifndef _di_fl_string_seek_to_utf_character_
- f_status_t fl_string_seek_to_utf_character(const f_string_t string, const f_utf_character_t seek_to, f_string_range_t * const range) {
+ f_status_t fl_string_seek_to_utf_character(const f_string_t string, const f_utf_char_t seek_to, f_string_range_t * const range) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
return F_data_not_stop;
}
- const unsigned short seek_width = macro_f_utf_character_t_width(seek_to);
+ const unsigned short seek_width = macro_f_utf_char_t_width(seek_to);
f_status_t status = F_none;
}
if (width == seek_width) {
- f_utf_character_t character = 0;
+ f_utf_char_t character = 0;
status = f_utf_char_to_character(string + range->start, width_max, &character);
if (F_status_is_error(status)) return status;
* @see f_utf_char_to_character()
*/
#ifndef _di_fl_string_dynamic_seek_line_to_utf_character_
- extern f_status_t fl_string_dynamic_seek_line_to_utf_character(const f_string_static_t buffer, const f_utf_character_t seek_to_this, f_string_range_t * const range);
+ extern f_status_t fl_string_dynamic_seek_line_to_utf_character(const f_string_static_t buffer, const f_utf_char_t seek_to_this, f_string_range_t * const range);
#endif // _di_fl_string_dynamic_seek_line_to_utf_character_
/**
* @see f_utf_char_to_character()
*/
#ifndef _di_fl_string_dynamic_seek_to_utf_character_
- extern f_status_t fl_string_dynamic_seek_to_utf_character(const f_string_static_t buffer, const f_utf_character_t seek_to_this, f_string_range_t * const range);
+ extern f_status_t fl_string_dynamic_seek_to_utf_character(const f_string_static_t buffer, const f_utf_char_t seek_to_this, f_string_range_t * const range);
#endif // _di_fl_string_dynamic_seek_to_utf_character_
/**
* @see f_utf_char_to_character()
*/
#ifndef _di_fl_string_seek_line_to_utf_character_
- extern f_status_t fl_string_seek_line_to_utf_character(const f_string_t string, const f_utf_character_t seek_to, f_string_range_t * const range);
+ extern f_status_t fl_string_seek_line_to_utf_character(const f_string_t string, const f_utf_char_t seek_to, f_string_range_t * const range);
#endif // _di_fl_string_seek_line_to_utf_character_
/**
* @see f_utf_char_to_character()
*/
#ifndef _di_fl_string_seek_to_utf_character_
- extern f_status_t fl_string_seek_to_utf_character(const f_string_t string, const f_utf_character_t seek_to, f_string_range_t * const range);
+ extern f_status_t fl_string_seek_to_utf_character(const f_string_t string, const f_utf_char_t seek_to, f_string_range_t * const range);
#endif // _di_fl_string_seek_to_utf_character_
#ifdef __cplusplus
return F_data_not_stop;
}
- f_utf_character_t seek_to_character = seek_to_this << 24;
+ f_utf_char_t seek_to_character = seek_to_this << 24;
- if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
while (buffer.string[range->start] != seek_to_character) {
- if (buffer.string[range->start++] == F_utf_character_t_eol_d) {
+ if (buffer.string[range->start++] == F_utf_char_t_eol_d) {
return F_none_eol;
}
- if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
#endif // _di_fl_utf_string_dynamic_seek_line_to_char_
#ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_
- f_status_t fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_static_t buffer, f_string_range_t * const range, const f_utf_character_t placeholder) {
+ f_status_t fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_static_t buffer, f_string_range_t * const range, const f_utf_char_t placeholder) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
if (buffer.used <= range->start) return F_status_set_error(F_parameter);
f_status_t status = F_none;
- if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
return status;
}
- if (buffer.string[range->start++] == F_utf_character_t_eol_d) {
+ if (buffer.string[range->start++] == F_utf_char_t_eol_d) {
return F_none_eol;
}
- if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
#endif // _di_fl_utf_string_dynamic_seek_line_until_graph_
#ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_non_
- f_status_t fl_utf_string_dynamic_seek_line_until_graph_non(const f_utf_string_static_t buffer, f_string_range_t * const range, const f_utf_character_t placeholder) {
+ f_status_t fl_utf_string_dynamic_seek_line_until_graph_non(const f_utf_string_static_t buffer, f_string_range_t * const range, const f_utf_char_t placeholder) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
if (buffer.used <= range->start) return F_status_set_error(F_parameter);
f_status_t status = F_none;
- if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_whitespace(buffer.string[range->start])) == F_false) {
if (F_status_is_error(status)) return status;
- if (buffer.string[range->start] == F_utf_character_t_eol_d) return F_none_eol;
+ if (buffer.string[range->start] == F_utf_char_t_eol_d) return F_none_eol;
++range->start;
- if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
return F_data_not_stop;
}
- f_utf_character_t seek_to_character = seek_to_this << 24;
+ f_utf_char_t seek_to_character = seek_to_this << 24;
- if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
++range->start;
- if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
return F_data_not_stop;
}
- f_utf_character_t seek_to_character = seek_to_this << 24;
+ f_utf_char_t seek_to_character = seek_to_this << 24;
for (; range->start <= range->stop; ++range->start) {
- if (macro_f_utf_character_t_width_is(string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
- if (string[range->start] == F_utf_character_t_eol_d) {
+ if (string[range->start] == F_utf_char_t_eol_d) {
return F_none_eol;
}
#endif // _di_fl_utf_string_seek_line_to_char_
#ifndef _di_fl_utf_string_seek_line_until_graph_
- f_status_t fl_utf_string_seek_line_until_graph(const f_utf_string_t string, f_string_range_t * const range, const f_utf_character_t placeholder) {
+ f_status_t fl_utf_string_seek_line_until_graph(const f_utf_string_t string, f_string_range_t * const range, const f_utf_char_t placeholder) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
f_status_t status = F_none;
- if (macro_f_utf_character_t_width_is(string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
return status;
}
- if (string[range->start++] == F_utf_character_t_eol_d) {
+ if (string[range->start++] == F_utf_char_t_eol_d) {
return F_none_eol;
}
- if (macro_f_utf_character_t_width_is(string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
#endif // _di_fl_utf_string_seek_line_until_graph_
#ifndef _di_fl_utf_string_seek_line_until_graph_non_
- f_status_t fl_utf_string_seek_line_until_graph_non(const f_utf_string_t string, f_string_range_t * const range, const f_utf_character_t placeholder) {
+ f_status_t fl_utf_string_seek_line_until_graph_non(const f_utf_string_t string, f_string_range_t * const range, const f_utf_char_t placeholder) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
f_status_t status = F_none;
- if (macro_f_utf_character_t_width_is(string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
return status;
}
- if (string[range->start++] == F_utf_character_t_eol_d) {
+ if (string[range->start++] == F_utf_char_t_eol_d) {
return F_none_eol;
}
- if (macro_f_utf_character_t_width_is(string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
return F_data_not_stop;
}
- const f_utf_character_t seek_to_character = seek_to_this << 24;
+ const f_utf_char_t seek_to_character = seek_to_this << 24;
- if (macro_f_utf_character_t_width_is(string[0]) == 1) {
+ if (macro_f_utf_char_t_width_is(string[0]) == 1) {
return F_status_set_error(F_utf);
}
return F_none;
}
- if (macro_f_utf_character_t_width_is(string[range->start]) == 1) {
+ if (macro_f_utf_char_t_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
} // while
* @see f_utf_character_is_graph()
*/
#ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_
- extern f_status_t fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_static_t buffer, f_string_range_t * const range, const f_utf_character_t placeholder);
+ extern f_status_t fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_static_t buffer, f_string_range_t * const range, const f_utf_char_t placeholder);
#endif // _di_fl_utf_string_dynamic_seek_line_until_graph_
/**
* @see f_utf_character_is_graph()
*/
#ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_non_
- extern f_status_t fl_utf_string_dynamic_seek_line_until_graph_non(const f_utf_string_static_t buffer, f_string_range_t * const range, const f_utf_character_t placeholder);
+ extern f_status_t fl_utf_string_dynamic_seek_line_until_graph_non(const f_utf_string_static_t buffer, f_string_range_t * const range, const f_utf_char_t placeholder);
#endif // _di_fl_utf_string_dynamic_seek_line_until_graph_non_
/**
* @see f_utf_character_is_graph()
*/
#ifndef _di_fl_utf_string_seek_line_until_graph_
- extern f_status_t fl_utf_string_seek_line_until_graph(const f_utf_string_t string, f_string_range_t * const range, const f_utf_character_t placeholder);
+ extern f_status_t fl_utf_string_seek_line_until_graph(const f_utf_string_t string, f_string_range_t * const range, const f_utf_char_t placeholder);
#endif // _di_fl_utf_string_seek_line_until_graph_
/**
* @see f_utf_character_is_graph()
*/
#ifndef _di_fl_utf_string_seek_line_until_graph_non_
- extern f_status_t fl_utf_string_seek_line_until_graph_non(const f_utf_string_t string, f_string_range_t * const range, const f_utf_character_t placeholder);
+ extern f_status_t fl_utf_string_seek_line_until_graph_non(const f_utf_string_t string, f_string_range_t * const range, const f_utf_char_t placeholder);
#endif // _di_fl_utf_string_seek_line_until_graph_non_
/**
}
if (*width_last == *width) {
- buffer->string[buffer->used] = macro_f_utf_character_t_from_char_1((buffer_char[0]));
+ buffer->string[buffer->used] = macro_f_utf_char_t_from_char_1((buffer_char[0]));
if (*width > 1) {
- buffer->string[buffer->used] |= macro_f_utf_character_t_from_char_2((buffer_char[1]));
+ buffer->string[buffer->used] |= macro_f_utf_char_t_from_char_2((buffer_char[1]));
if (*width > 2) {
- buffer->string[buffer->used] |= macro_f_utf_character_t_from_char_3((buffer_char[2]));
+ buffer->string[buffer->used] |= macro_f_utf_char_t_from_char_3((buffer_char[2]));
if (*width > 3) {
- buffer->string[buffer->used] |= macro_f_utf_character_t_from_char_4((buffer_char[3]));
+ buffer->string[buffer->used] |= macro_f_utf_char_t_from_char_4((buffer_char[3]));
}
}
}
if (width_written < width) {
if (width_written < 2) {
- buffer_write[used] = macro_f_utf_character_t_to_char_2(string[*written + i]);
+ buffer_write[used] = macro_f_utf_char_t_to_char_2(string[*written + i]);
++width_written;
++used;
}
if (width > 2 && width_written < 3) {
- buffer_write[used + 1] = macro_f_utf_character_t_to_char_3(string[*written + i]);
+ buffer_write[used + 1] = macro_f_utf_char_t_to_char_3(string[*written + i]);
++width_written;
++used;
}
if (width == 4 && width_written < 4) {
- buffer_write[used + 2] = macro_f_utf_character_t_to_char_4(string[*written + i]);
+ buffer_write[used + 2] = macro_f_utf_char_t_to_char_4(string[*written + i]);
++width_written;
++used;
}
width = 0;
}
else {
- width = macro_f_utf_character_t_width(string[*written + i]);
+ width = macro_f_utf_char_t_width(string[*written + i]);
width_written = width;
if (*written + width > write_max) {
return F_complete_not_utf_stop;
}
- buffer_write[used] = macro_f_utf_character_t_to_char_1(string[*written + i]);
+ buffer_write[used] = macro_f_utf_char_t_to_char_1(string[*written + i]);
if (width > 1) {
if (used == write_size) {
break;
}
- buffer_write[used + 1] = macro_f_utf_character_t_to_char_2(string[*written + i]);
+ buffer_write[used + 1] = macro_f_utf_char_t_to_char_2(string[*written + i]);
if (width > 2) {
if (used + 2 > write_size) {
break;
}
- buffer_write[used + 2] = macro_f_utf_character_t_to_char_3(string[*written + i]);
+ buffer_write[used + 2] = macro_f_utf_char_t_to_char_3(string[*written + i]);
if (width == 4) {
if (used + 3 > write_size) {
break;
}
- buffer_write[used + 3] = macro_f_utf_character_t_to_char_4(string[*written + i]);
+ buffer_write[used + 3] = macro_f_utf_char_t_to_char_4(string[*written + i]);
}
}
}
// Store the current character main until it can be printed.
f_utf_string_dynamic_t characters = f_utf_string_dynamic_t_initialize;
- f_utf_character_t character_array[main->width];
+ f_utf_char_t character_array[main->width];
f_array_length_t character_current = 0;
// The row starts based on the first byte starting point and how many columns of bytes are displayed per row.
}
}
- memset(&character_array, 0, sizeof(f_utf_character_t) * main->width);
+ memset(&character_array, 0, sizeof(f_utf_char_t) * main->width);
characters.string = character_array;
characters.used = 0;
characters.size = main->width;
// When width_count == 0, then this is that start of a new character sequence.
if (!width_count) {
- characters.string[character_current] = macro_f_utf_character_t_from_char_1(byte);
+ characters.string[character_current] = macro_f_utf_char_t_from_char_1(byte);
width_count = 1;
// The first character in a UTF-8 sequence cannot have a width of 1.
width_current = macro_f_utf_byte_width_is(byte);
if (width_count == 1) {
- characters.string[character_current] |= macro_f_utf_character_t_from_char_2(byte);
+ characters.string[character_current] |= macro_f_utf_char_t_from_char_2(byte);
}
else if (width_count == 2) {
- characters.string[character_current] |= macro_f_utf_character_t_from_char_3(byte);
+ characters.string[character_current] |= macro_f_utf_char_t_from_char_3(byte);
}
else if (width_count == 3) {
- characters.string[character_current] |= macro_f_utf_character_t_from_char_4(byte);
+ characters.string[character_current] |= macro_f_utf_char_t_from_char_4(byte);
}
++width_count;
f_array_length_t character_current = characters.used - 1;
if (byte_current == 1) {
- byte = macro_f_utf_character_t_to_char_1(characters.string[character_current]);
+ byte = macro_f_utf_char_t_to_char_1(characters.string[character_current]);
}
else if (byte_current == 2) {
- byte = macro_f_utf_character_t_to_char_2(characters.string[character_current]);
+ byte = macro_f_utf_char_t_to_char_2(characters.string[character_current]);
}
else if (byte_current == 3) {
- byte = macro_f_utf_character_t_to_char_3(characters.string[character_current]);
+ byte = macro_f_utf_char_t_to_char_3(characters.string[character_current]);
}
else if (byte_current == 4) {
- byte = macro_f_utf_character_t_to_char_4(characters.string[character_current]);
+ byte = macro_f_utf_char_t_to_char_4(characters.string[character_current]);
}
if (!cell->column) {
if (width_utf < 2) {
// 1 == U+0000 -> U+007F.
- unicode = macro_f_utf_character_t_to_char_1(characters.string[character_current]) & 0x7f;
+ unicode = macro_f_utf_char_t_to_char_1(characters.string[character_current]) & 0x7f;
}
else if (width_utf == 2) {
// 2 == U+0080 -> U+07FF.
- unicode = (macro_f_utf_character_t_to_char_1(characters.string[character_current]) & 0x1f) << 6;
- unicode |= macro_f_utf_character_t_to_char_2(characters.string[character_current]) & 0x3f;
+ unicode = (macro_f_utf_char_t_to_char_1(characters.string[character_current]) & 0x1f) << 6;
+ unicode |= macro_f_utf_char_t_to_char_2(characters.string[character_current]) & 0x3f;
}
else if (width_utf == 3) {
// 3 == U+0800 -> U+FFFF.
- unicode = (macro_f_utf_character_t_to_char_1(characters.string[character_current]) & 0xf) << 12;
- unicode |= (macro_f_utf_character_t_to_char_2(characters.string[character_current]) & 0x3f) << 6;
- unicode |= macro_f_utf_character_t_to_char_3(characters.string[character_current]) & 0x3f;
+ unicode = (macro_f_utf_char_t_to_char_1(characters.string[character_current]) & 0xf) << 12;
+ unicode |= (macro_f_utf_char_t_to_char_2(characters.string[character_current]) & 0x3f) << 6;
+ unicode |= macro_f_utf_char_t_to_char_3(characters.string[character_current]) & 0x3f;
}
else if (width_utf == 4) {
// 4 == U+10000 -> U+10FFFF.
- unicode = (macro_f_utf_character_t_to_char_1(characters.string[character_current]) & 0x7) << 18;
- unicode |= (macro_f_utf_character_t_to_char_2(characters.string[character_current]) & 0x3f) << 12;
- unicode |= (macro_f_utf_character_t_to_char_2(characters.string[character_current]) & 0x3f) << 6;
- unicode |= macro_f_utf_character_t_to_char_4(characters.string[character_current]) & 0x3f;
+ unicode = (macro_f_utf_char_t_to_char_1(characters.string[character_current]) & 0x7) << 18;
+ unicode |= (macro_f_utf_char_t_to_char_2(characters.string[character_current]) & 0x3f) << 12;
+ unicode |= (macro_f_utf_char_t_to_char_2(characters.string[character_current]) & 0x3f) << 6;
+ unicode |= macro_f_utf_char_t_to_char_4(characters.string[character_current]) & 0x3f;
}
if (width_utf < 4) {
for (uint8_t i = 0; i < characters.used && at < main->width; ++i, ++at) {
- c = macro_f_utf_character_t_to_char_1(characters.string[i]);
+ c = macro_f_utf_char_t_to_char_1(characters.string[i]);
width_utf = macro_f_utf_byte_width_is(c);
if (invalid[i]) {
byte[0] = c;
if (width_utf > 1) {
- byte[1] = macro_f_utf_character_t_to_char_2(characters.string[i]);
+ byte[1] = macro_f_utf_char_t_to_char_2(characters.string[i]);
if (width_utf > 2) {
- byte[2] = macro_f_utf_character_t_to_char_3(characters.string[i]);
+ byte[2] = macro_f_utf_char_t_to_char_3(characters.string[i]);
if (width_utf > 3) {
- byte[3] = macro_f_utf_character_t_to_char_4(characters.string[i]);
+ byte[3] = macro_f_utf_char_t_to_char_4(characters.string[i]);
}
else {
byte[3] = 0;
f_print_character(c, main->output.to.stream);
if (width_utf > 1) {
- f_print_character(macro_f_utf_character_t_to_char_2(characters.string[i]), main->output.to.stream);
+ f_print_character(macro_f_utf_char_t_to_char_2(characters.string[i]), main->output.to.stream);
if (width_utf > 2) {
- f_print_character(macro_f_utf_character_t_to_char_3(characters.string[i]), main->output.to.stream);
+ f_print_character(macro_f_utf_char_t_to_char_3(characters.string[i]), main->output.to.stream);
if (width_utf > 3) {
- f_print_character(macro_f_utf_character_t_to_char_4(characters.string[i]), main->output.to.stream);
+ f_print_character(macro_f_utf_char_t_to_char_4(characters.string[i]), main->output.to.stream);
}
}
}