Blame


1 3448adb0 2022-11-02 op /* See LICENSE file for copyright and license details. */
2 3448adb0 2022-11-02 op #ifndef GRAPHEME_H
3 3448adb0 2022-11-02 op #define GRAPHEME_H
4 3448adb0 2022-11-02 op
5 3448adb0 2022-11-02 op #include <stdbool.h>
6 3448adb0 2022-11-02 op #include <stddef.h>
7 3448adb0 2022-11-02 op #include <stdint.h>
8 3448adb0 2022-11-02 op
9 3448adb0 2022-11-02 op #define GRAPHEME_INVALID_CODEPOINT UINT32_C(0xFFFD)
10 3448adb0 2022-11-02 op
11 3448adb0 2022-11-02 op size_t grapheme_decode_utf8(const char *, size_t, uint_least32_t *);
12 3448adb0 2022-11-02 op size_t grapheme_encode_utf8(uint_least32_t, char *, size_t);
13 3448adb0 2022-11-02 op
14 3448adb0 2022-11-02 op bool grapheme_is_character_break(uint_least32_t, uint_least32_t, uint_least16_t *);
15 3448adb0 2022-11-02 op
16 3448adb0 2022-11-02 op bool grapheme_is_lowercase(const uint_least32_t *, size_t, size_t *);
17 3448adb0 2022-11-02 op bool grapheme_is_titlecase(const uint_least32_t *, size_t, size_t *);
18 3448adb0 2022-11-02 op bool grapheme_is_uppercase(const uint_least32_t *, size_t, size_t *);
19 3448adb0 2022-11-02 op
20 3448adb0 2022-11-02 op bool grapheme_is_lowercase_utf8(const char *, size_t, size_t *);
21 3448adb0 2022-11-02 op bool grapheme_is_titlecase_utf8(const char *, size_t, size_t *);
22 3448adb0 2022-11-02 op bool grapheme_is_uppercase_utf8(const char *, size_t, size_t *);
23 3448adb0 2022-11-02 op
24 3448adb0 2022-11-02 op size_t grapheme_next_character_break(const uint_least32_t *, size_t);
25 3448adb0 2022-11-02 op size_t grapheme_next_line_break(const uint_least32_t *, size_t);
26 3448adb0 2022-11-02 op size_t grapheme_next_sentence_break(const uint_least32_t *, size_t);
27 3448adb0 2022-11-02 op size_t grapheme_next_word_break(const uint_least32_t *, size_t);
28 3448adb0 2022-11-02 op
29 3448adb0 2022-11-02 op size_t grapheme_next_character_break_utf8(const char *, size_t);
30 3448adb0 2022-11-02 op size_t grapheme_next_line_break_utf8(const char *, size_t);
31 3448adb0 2022-11-02 op size_t grapheme_next_sentence_break_utf8(const char *, size_t);
32 3448adb0 2022-11-02 op size_t grapheme_next_word_break_utf8(const char *, size_t);
33 3448adb0 2022-11-02 op
34 3448adb0 2022-11-02 op size_t grapheme_to_lowercase(const uint_least32_t *, size_t, uint_least32_t *, size_t);
35 3448adb0 2022-11-02 op size_t grapheme_to_titlecase(const uint_least32_t *, size_t, uint_least32_t *, size_t);
36 3448adb0 2022-11-02 op size_t grapheme_to_uppercase(const uint_least32_t *, size_t, uint_least32_t *, size_t);
37 3448adb0 2022-11-02 op
38 3448adb0 2022-11-02 op size_t grapheme_to_lowercase_utf8(const char *, size_t, char *, size_t);
39 3448adb0 2022-11-02 op size_t grapheme_to_titlecase_utf8(const char *, size_t, char *, size_t);
40 3448adb0 2022-11-02 op size_t grapheme_to_uppercase_utf8(const char *, size_t, char *, size_t);
41 3448adb0 2022-11-02 op
42 3448adb0 2022-11-02 op #endif /* GRAPHEME_H */