Blame


1 6ab857d5 2024-01-23 op /*
2 6ab857d5 2024-01-23 op * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
3 6ab857d5 2024-01-23 op *
4 6ab857d5 2024-01-23 op * Permission to use, copy, modify, and distribute this software for any
5 6ab857d5 2024-01-23 op * purpose with or without fee is hereby granted, provided that the above
6 6ab857d5 2024-01-23 op * copyright notice and this permission notice appear in all copies.
7 6ab857d5 2024-01-23 op *
8 6ab857d5 2024-01-23 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 6ab857d5 2024-01-23 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 6ab857d5 2024-01-23 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 6ab857d5 2024-01-23 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 6ab857d5 2024-01-23 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 6ab857d5 2024-01-23 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 6ab857d5 2024-01-23 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 6ab857d5 2024-01-23 op */
16 6ab857d5 2024-01-23 op
17 6ab857d5 2024-01-23 op #ifndef UTF8_H
18 6ab857d5 2024-01-23 op #define UTF8_H
19 6ab857d5 2024-01-23 op
20 6ab857d5 2024-01-23 op #include <stddef.h>
21 6ab857d5 2024-01-23 op #include <stdint.h>
22 6ab857d5 2024-01-23 op
23 6ab857d5 2024-01-23 op /* utf8.c */
24 6ab857d5 2024-01-23 op uint32_t utf8_decode(uint32_t*restrict, uint32_t*restrict, uint8_t);
25 6ab857d5 2024-01-23 op size_t utf8_encode(uint32_t, char*);
26 6ab857d5 2024-01-23 op char *utf8_nth(char*, size_t);
27 6ab857d5 2024-01-23 op size_t utf8_cplen(char*);
28 6ab857d5 2024-01-23 op size_t utf8_ncplen(const char *, size_t);
29 6ab857d5 2024-01-23 op size_t utf8_chwidth(uint32_t);
30 6ab857d5 2024-01-23 op size_t utf8_snwidth(const char*, size_t);
31 6ab857d5 2024-01-23 op size_t utf8_swidth(const char*);
32 6ab857d5 2024-01-23 op size_t utf8_swidth_between(const char*, const char*);
33 6ab857d5 2024-01-23 op char *utf8_next_cp(const char*);
34 6ab857d5 2024-01-23 op char *utf8_prev_cp(const char*, const char*);
35 6ab857d5 2024-01-23 op int emojied_line(const char *, const char **);
36 6ab857d5 2024-01-23 op
37 6ab857d5 2024-01-23 op /* emoji-matcher.c */
38 6ab857d5 2024-01-23 op int is_emoji(uint32_t);
39 6ab857d5 2024-01-23 op
40 6ab857d5 2024-01-23 op #endif