diff options
| author | Tyge Løvset <[email protected]> | 2023-01-02 13:40:23 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-01-02 13:40:23 +0100 |
| commit | 364b8833cb5d91bbe2c7640869912cde4de12846 (patch) | |
| tree | 9d366de0b847e9910fdaa764eaf01bd76512a362 /include/stc/utf8.h | |
| parent | 5c454e721656618c36674e0df676091106592c2d (diff) | |
| download | STC-modified-364b8833cb5d91bbe2c7640869912cde4de12846.tar.gz STC-modified-364b8833cb5d91bbe2c7640869912cde4de12846.zip | |
Finish regex updates.
Diffstat (limited to 'include/stc/utf8.h')
| -rw-r--r-- | include/stc/utf8.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/stc/utf8.h b/include/stc/utf8.h index da6643ea..3246e654 100644 --- a/include/stc/utf8.h +++ b/include/stc/utf8.h @@ -10,12 +10,13 @@ enum { U8G_Pc, U8G_Pd, U8G_Pf, U8G_Pi, U8G_Sc, U8G_Zl, U8G_Zp, U8G_Zs, }; -extern bool utf8_isspace(uint32_t c); -extern bool utf8_isdigit(uint32_t c); -extern bool utf8_isxdigit(uint32_t c); -extern bool utf8_isalpha(uint32_t c); -extern bool utf8_isalnum(uint32_t c); extern bool utf8_isgroup(int group, uint32_t c); +extern bool utf8_isblank(uint32_t c); +extern bool utf8_iscased(uint32_t c); +extern bool utf8_isalnum(uint32_t c); +extern bool utf8_isdigit(uint32_t c); +extern bool utf8_isspace(uint32_t c); +extern bool utf8_isword(uint32_t c); extern uint32_t utf8_casefold(uint32_t c); extern uint32_t utf8_tolower(uint32_t c); extern uint32_t utf8_toupper(uint32_t c); @@ -24,6 +25,11 @@ extern int utf8_icmp_sv(csview s1, csview s2); extern unsigned utf8_encode(char *out, uint32_t c); extern uint32_t utf8_peek_off(const char *s, int offset); +STC_INLINE bool utf8_isalpha(uint32_t c) { + return utf8_iscased(c) || utf8_isgroup(U8G_Nl, c); +} + + /* following functions uses src/utf8code.c */ STC_INLINE bool utf8_isupper(uint32_t c) { return utf8_tolower(c) != c; } |
