Blame


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