Bump to release 1.4.0
[smenu.git] / utf8.h
blob0457455c555d7e0560e55a8dce9c4e30c272b8a0
1 /* ################################################################### */
2 /* Copyright 2015, Pierre Gentile (p.gen.progs@gmail.com) */
3 /* */
4 /* This Source Code Form is subject to the terms of the Mozilla Public */
5 /* License, v. 2.0. If a copy of the MPL was not distributed with this */
6 /* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
7 /* ################################################################### */
9 #ifndef UTF8_H
10 #define UTF8_H
12 #include <stdint.h>
14 typedef struct langinfo_s langinfo_t;
16 /* Locale information. */
17 /* """"""""""""""""""" */
18 struct langinfo_s
20 int utf8; /* charset is UTF-8 */
21 int bits; /* number of bits in the charset */
24 int
25 utf8_get_length(unsigned char c);
27 size_t
28 utf8_offset(char const *, size_t);
30 char *
31 utf8_strprefix(char *d, char const *s, long n, long *pos);
33 size_t
34 utf8_strlen(char const *str);
36 wchar_t *
37 utf8_strtowcs(char *s);
39 void
40 utf8_sanitize(char *s, char sc);
42 int
43 cptoutf8(char *utf8_str, uint32_t c);
45 int
46 utf8_interpret(char *s, char sc);
48 char *
49 utf8_validate(char *str);
51 char *
52 utf8_prev(const char *str, const char *p);
54 char *
55 utf8_next(char *p);
57 void
58 utf8_strtolower(char *dst, char *src);
60 #endif