From: Kevin Day Date: Sat, 2 May 2020 04:22:06 +0000 (-0500) Subject: Update: use f_string_length instead of uint8_t for width_max in UTF-8 functions X-Git-Tag: 0.5.0~305 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=decc0f9cc83a564c1a016898f081570e5ad2665e;p=fll Update: use f_string_length instead of uint8_t for width_max in UTF-8 functions --- diff --git a/level_0/f_utf/c/utf.c b/level_0/f_utf/c/utf.c index b7ea77f..08a3c4b 100644 --- a/level_0/f_utf/c/utf.c +++ b/level_0/f_utf/c/utf.c @@ -248,7 +248,7 @@ extern "C" { #endif // _di_f_utf_character_is_zero_width_ #ifndef _di_f_utf_character_to_char_ - f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, uint8_t *width_max) { + f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, f_string_length *width_max) { #ifndef _di_level_0_parameter_checking_ if (utf_character == 0) return f_status_set_error(f_invalid_parameter); if (width_max == 0 && *character != 0) return f_status_set_error(f_invalid_parameter); @@ -317,7 +317,7 @@ extern "C" { #endif // _di_f_utf_is_big_endian_ #ifndef _di_f_utf_is_ - f_return_status f_utf_is(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -337,7 +337,7 @@ extern "C" { #endif // _di_f_utf_is_ #ifndef _di_f_utf_is_alpha_ - f_return_status f_utf_is_alpha(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is_alpha(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -371,7 +371,7 @@ extern "C" { #endif // _di_f_utf_is_alpha_ #ifndef _di_f_utf_is_alpha_numeric_ - f_return_status f_utf_is_alpha_numeric(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is_alpha_numeric(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -405,7 +405,7 @@ extern "C" { #endif // _di_f_utf_is_alpha_numeric_ #ifndef _di_f_utf_is_control_ - f_return_status f_utf_is_control(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is_control(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -439,7 +439,7 @@ extern "C" { #endif // _di_f_utf_is_control_ #ifndef _di_f_utf_is_control_picture_ - f_return_status f_utf_is_control_picture(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is_control_picture(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -470,7 +470,7 @@ extern "C" { #endif // _di_f_utf_is_control_picture_ #ifndef _di_f_utf_is_graph_ - f_return_status f_utf_is_graph(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is_graph(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -517,7 +517,7 @@ extern "C" { #endif // _di_f_utf_is_graph_ #ifndef _di_f_utf_is_numeric_ - f_return_status f_utf_is_numeric(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is_numeric(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -551,7 +551,7 @@ extern "C" { #endif // _di_f_utf_is_numeric_ #ifndef _di_f_utf_is_valid_ - f_return_status f_utf_is_valid(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is_valid(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -577,7 +577,7 @@ extern "C" { #endif // _di_f_utf_is_valid_ #ifndef _di_f_utf_is_whitespace_ - f_return_status f_utf_is_whitespace(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is_whitespace(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -611,7 +611,7 @@ extern "C" { #endif // _di_f_utf_is_whitespace_ #ifndef _di_f_utf_is_word_ - f_return_status f_utf_is_word(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is_word(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -645,7 +645,7 @@ extern "C" { #endif // _di_f_utf_is_word_ #ifndef _di_f_utf_is_word_dash_ - f_return_status f_utf_is_word_dash(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is_word_dash(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -679,7 +679,7 @@ extern "C" { #endif // _di_f_utf_is_word_dash_ #ifndef _di_f_utf_is_zero_width_ - f_return_status f_utf_is_zero_width(const f_string character, const uint8_t width_max) { + f_return_status f_utf_is_zero_width(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -713,7 +713,7 @@ extern "C" { #endif // _di_f_utf_is_zero_width_ #ifndef _di_f_utf_char_to_character_ - f_return_status f_utf_char_to_character(const f_string character, const uint8_t width_max, f_utf_character *character_utf) { + f_return_status f_utf_char_to_character(const f_string character, const f_string_length width_max, f_utf_character *character_utf) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return f_status_set_error(f_invalid_parameter); if (character_utf == 0) return f_status_set_error(f_invalid_parameter); diff --git a/level_0/f_utf/c/utf.h b/level_0/f_utf/c/utf.h index abf79b9..1acf354 100644 --- a/level_0/f_utf/c/utf.h +++ b/level_0/f_utf/c/utf.h @@ -814,7 +814,7 @@ extern "C" { * f_failure (with error bit) if width is not long enough to convert. */ #ifndef _di_f_utf_character_to_char_ - extern f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, uint8_t *width_max); + extern f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, f_string_length *width_max); #endif // _di_f_utf_character_to_char_ /** @@ -852,7 +852,7 @@ extern "C" { * @see f_utf_character_is() */ #ifndef _di_f_utf_is_ - extern f_return_status f_utf_is(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_ /** @@ -876,7 +876,7 @@ extern "C" { * @see f_utf_character_is_alpha() */ #ifndef _di_f_utf_is_alpha_ - extern f_return_status f_utf_is_alpha(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_alpha(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_alpha_ /** @@ -900,7 +900,7 @@ extern "C" { * @see f_utf_character_is_alpha_numeric() */ #ifndef _di_f_utf_is_alpha_numeric_ - extern f_return_status f_utf_is_alpha_numeric(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_alpha_numeric(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_alpha_numeric_ /** @@ -922,7 +922,7 @@ extern "C" { * @see f_utf_character_is_control() */ #ifndef _di_f_utf_is_control_ - extern f_return_status f_utf_is_control(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_control(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_control_ /** @@ -945,7 +945,7 @@ extern "C" { * @see f_utf_character_is_control_picture() */ #ifndef _di_f_utf_is_control_picture_ - extern f_return_status f_utf_is_control_picture(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_control_picture(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_control_picture_ /** @@ -983,7 +983,7 @@ extern "C" { * @see f_utf_character_is_fragment() */ #ifndef _di_f_utf_is_fragment_ - extern f_return_status f_utf_is_fragment(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_fragment(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_fragment_ /** @@ -1008,7 +1008,7 @@ extern "C" { * @see f_utf_character_is_graph() */ #ifndef _di_f_utf_is_graph_ - extern f_return_status f_utf_is_graph(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_graph(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_graph_ /** @@ -1032,7 +1032,7 @@ extern "C" { * @see f_utf_character_is_numeric() */ #ifndef _di_f_utf_is_numeric_ - extern f_return_status f_utf_is_numeric(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_numeric(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_numeric_ /** @@ -1062,7 +1062,7 @@ extern "C" { * @see f_utf_character_is_valid() */ #ifndef _di_f_utf_is_valid_ - extern f_return_status f_utf_is_valid(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_valid(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_valid_ /** @@ -1087,7 +1087,7 @@ extern "C" { * @see f_utf_character_is_whitespace() */ #ifndef _di_f_utf_is_whitespace_ - extern f_return_status f_utf_is_whitespace(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_whitespace(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_whitespace_ /** @@ -1113,7 +1113,7 @@ extern "C" { * @see f_utf_character_is_word() */ #ifndef _di_f_utf_is_word_ - extern f_return_status f_utf_is_word(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_word(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_word_ /** @@ -1139,7 +1139,7 @@ extern "C" { * @see f_utf_character_is_word_dash() */ #ifndef _di_f_utf_is_word_dash_ - extern f_return_status f_utf_is_word_dash(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_word_dash(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_word_dash_ /** @@ -1166,7 +1166,7 @@ extern "C" { * @see f_utf_character_is_zero_width() */ #ifndef _di_f_utf_is_zero_width_ - extern f_return_status f_utf_is_zero_width(const f_string character, const uint8_t width_max); + extern f_return_status f_utf_is_zero_width(const f_string character, const f_string_length width_max); #endif // _di_f_utf_is_zero_width_ /** @@ -1189,7 +1189,7 @@ extern "C" { * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_utf_char_to_character_ - extern f_return_status f_utf_char_to_character(const f_string character, const uint8_t width_max, f_utf_character *character_utf); + extern f_return_status f_utf_char_to_character(const f_string character, const f_string_length width_max, f_utf_character *character_utf); #endif // _di_f_utf_char_to_character_ #ifdef __cplusplus