mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-16 18:22:37 +00:00
Add an iswblank compatibility API.
This commit is contained in:
+13
@@ -53,6 +53,19 @@ int ucd_isalpha(codepoint_t c)
|
||||
}
|
||||
}
|
||||
|
||||
int ucd_isblank(codepoint_t c)
|
||||
{
|
||||
switch (ucd_lookup_category(c))
|
||||
{
|
||||
case UCD_CATEGORY_Zs:
|
||||
return 1;
|
||||
case UCD_CATEGORY_Cc:
|
||||
return c == 0x09; // U+0009 : CHARACTER TABULATION
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int ucd_iscntrl(codepoint_t c)
|
||||
{
|
||||
return ucd_lookup_category(c) == UCD_CATEGORY_Cc;
|
||||
|
||||
@@ -339,6 +339,13 @@ int ucd_isalnum(codepoint_t c);
|
||||
*/
|
||||
int ucd_isalpha(codepoint_t c);
|
||||
|
||||
/** @brief Is the codepoint a tab or Unicode whitespace character?
|
||||
*
|
||||
* @param c The Unicode codepoint to check.
|
||||
* @return Non-zero if the codepoint is a whitespace character, zero otherwise.
|
||||
*/
|
||||
int ucd_isblank(codepoint_t c);
|
||||
|
||||
/** @brief Is the codepoint a control character?
|
||||
*
|
||||
* @param c The Unicode codepoint to check.
|
||||
@@ -776,6 +783,16 @@ namespace ucd
|
||||
return ucd_isalpha(c);
|
||||
}
|
||||
|
||||
/** @brief Is the codepoint a tab or Unicode whitespace character?
|
||||
*
|
||||
* @param c The Unicode codepoint to check.
|
||||
* @return Non-zero if the codepoint is a whitespace character, zero otherwise.
|
||||
*/
|
||||
inline int isblank(codepoint_t c)
|
||||
{
|
||||
return ucd_isblank(c);
|
||||
}
|
||||
|
||||
/** @brief Is the codepoint a control character?
|
||||
*
|
||||
* @param c The Unicode codepoint to check.
|
||||
|
||||
Reference in New Issue
Block a user