diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 13:04:32 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 13:04:32 +0300 |
| commit | bdaedce69b17b654bd0060579dd9b9ff120009b5 (patch) | |
| tree | 0e9cd8597652263a96c48ba678fb0b66e1fc131b /include/wsap_vtcore/unicode/grapheme.h | |
| parent | ba75c8b0a1bba03ad92c53375432f122ddb4cb98 (diff) | |
| parent | dcebf9c7f954a55350b68d0ead1935612c4e2e05 (diff) | |
Merge branch 'wt/rename' into api-hardening
# Conflicts:
# README.md
Diffstat (limited to 'include/wsap_vtcore/unicode/grapheme.h')
| -rw-r--r-- | include/wsap_vtcore/unicode/grapheme.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/wsap_vtcore/unicode/grapheme.h b/include/wsap_vtcore/unicode/grapheme.h new file mode 100644 index 0000000..6146239 --- /dev/null +++ b/include/wsap_vtcore/unicode/grapheme.h @@ -0,0 +1,26 @@ +#ifndef WSAP_VTCORE_UNICODE_GRAPHEME_H +#define WSAP_VTCORE_UNICODE_GRAPHEME_H + +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> + +#define WSAP_VTCORE_GRAPHEME_MAX_LEN 20 +#define WSAP_VTCORE_GRAPHEME_HANDLE_BASE 0x7F000000u + +static inline bool wsap_vtcore_grapheme_is_handle(uint32_t c) +{ + return c >= WSAP_VTCORE_GRAPHEME_HANDLE_BASE; +} + +static inline bool wsap_vtcore_grapheme_regional_indicator(uint32_t cp) +{ + return cp >= 0x1F1E6 && cp <= 0x1F1FF; +} + +static inline bool wsap_vtcore_grapheme_emoji_modifier(uint32_t cp) +{ + return cp >= 0x1F3FB && cp <= 0x1F3FF; +} + +#endif |
