mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
Add an iswblank compatibility API.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Change Log
|
||||
|
||||
## 9.0.0.1 - (In Progress)
|
||||
|
||||
* Add `iswblank` compatibility.
|
||||
|
||||
## 9.0.0 - 2016-12-28
|
||||
|
||||
* Update to Unicode Character Data 9.0.0.
|
||||
|
||||
@@ -96,6 +96,7 @@ The following character classification functions are provided:
|
||||
|---------------|----------------|
|
||||
| `ucd_isalnum` | `ucd::isalnum` |
|
||||
| `ucd_isalpha` | `ucd::isalpha` |
|
||||
| `ucd_isblank` | `ucd::isblank` |
|
||||
| `ucd_iscntrl` | `ucd::iscntrl` |
|
||||
| `ucd_isdigit` | `ucd::isdigit` |
|
||||
| `ucd_isgraph` | `ucd::isgraph` |
|
||||
@@ -105,7 +106,7 @@ The following character classification functions are provided:
|
||||
| `ucd_isspace` | `ucd::isspace` |
|
||||
| `ucd_isupper` | `ucd::isupper` |
|
||||
|
||||
__NOTE:__ Equivalents for `isblank` and `isxdigit` are not provided.
|
||||
__NOTE:__ An equivalent for `isxdigit` is not provided.
|
||||
|
||||
## Build Dependencies
|
||||
|
||||
|
||||
+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.
|
||||
|
||||
@@ -114,6 +114,9 @@ void uprintf_is(FILE *out, codepoint_t c, char mode)
|
||||
case 'a': // alpha
|
||||
fputc(iswalpha(c) ? '1' : '0', out);
|
||||
break;
|
||||
case 'b': // blank
|
||||
fputc(iswblank(c) ? '1' : '0', out);
|
||||
break;
|
||||
case 'c': // control
|
||||
fputc(iswcntrl(c) ? '1' : '0', out);
|
||||
break;
|
||||
|
||||
@@ -111,6 +111,9 @@ void uprintf_is(FILE *out, codepoint_t c, char mode)
|
||||
case 'a': // alpha
|
||||
fputc(ucd_isalpha(c) ? '1' : '0', out);
|
||||
break;
|
||||
case 'b': // blank
|
||||
fputc(ucd_isblank(c) ? '1' : '0', out);
|
||||
break;
|
||||
case 'c': // control
|
||||
fputc(ucd_iscntrl(c) ? '1' : '0', out);
|
||||
break;
|
||||
|
||||
@@ -111,6 +111,9 @@ void uprintf_is(FILE *out, ucd::codepoint_t c, char mode)
|
||||
case 'a': // alpha
|
||||
fputc(ucd::isalpha(c) ? '1' : '0', out);
|
||||
break;
|
||||
case 'b': // blank
|
||||
fputc(ucd::isblank(c) ? '1' : '0', out);
|
||||
break;
|
||||
case 'c': // control
|
||||
fputc(ucd::iscntrl(c) ? '1' : '0', out);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user