aboutsummaryrefslogtreecommitdiff
path: root/include/unicode/string.h
blob: d80f04c64c9102e0745af79b432a7f2e6f2a37e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef MLIB_UNICODE_STRING_H
#define MLIB_UNICODE_STRING_H

#include <stddef.h>

#include "__charN_t.h"
#include "__u8view.h"

/* clang-format off */

enum [[clang::__flag_enum__]] caseflags {
	CF_LANG_AZ = 1 << 0, /* Azeri; alias for UF_LANG_TR */
	CF_LANG_TR = 1 << 0, /* Turkish; alias for UF_LANG_AZ */
	CF_LANG_LT = 1 << 1, /* Lithuanian */
	CF_ẞ       = 1 << 2, /* Use ‘ẞ’ as the uppercase of ‘ß’ */
};

/* clang-format on */

size_t u8glen(const char8_t *, size_t);
size_t u8gnext(struct u8view *, const char8_t **, size_t *);

size_t u8casefold(char8_t *restrict, size_t, const char8_t *, size_t,
                  enum caseflags);
size_t u8lower(char8_t *restrict, size_t, const char8_t *, size_t,
               enum caseflags);
size_t u8upper(char8_t *restrict, size_t, const char8_t *, size_t,
               enum caseflags);

#endif /* !MLIB_UNICODE_STRING_H */