diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/unicode.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/include/unicode.h b/include/unicode.h new file mode 100644 index 000000000..be64a50e2 --- /dev/null +++ b/include/unicode.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Licensed under the GPL version 2, see the file LICENSE in this tarball. | ||
4 | */ | ||
5 | #ifndef UNICODE_H | ||
6 | #define UNICODE_H 1 | ||
7 | |||
8 | #if !ENABLE_FEATURE_ASSUME_UNICODE | ||
9 | |||
10 | # define check_unicode_in_env() ((void)0) | ||
11 | |||
12 | #else | ||
13 | |||
14 | # if ENABLE_LOCALE_SUPPORT | ||
15 | |||
16 | # include <wchar.h> | ||
17 | # include <wctype.h> | ||
18 | # define check_unicode_in_env() ((void)0) | ||
19 | |||
20 | # else | ||
21 | |||
22 | # if !ENABLE_FEATURE_CHECK_UNICODE_IN_ENV | ||
23 | # define check_unicode_in_env() ((void)0) | ||
24 | # else | ||
25 | void check_unicode_in_env(void) FAST_FUNC; | ||
26 | # endif | ||
27 | |||
28 | # undef MB_CUR_MAX | ||
29 | # define MB_CUR_MAX 6 | ||
30 | |||
31 | /* Prevent name collisions */ | ||
32 | # define wint_t bb_wint_t | ||
33 | # define mbstate_t bb_mbstate_t | ||
34 | # define mbstowcs bb_mbstowcs | ||
35 | # define wcstombs bb_wcstombs | ||
36 | # define wcrtomb bb_wcrtomb | ||
37 | # define iswspace bb_iswspace | ||
38 | # define iswalnum bb_iswalnum | ||
39 | # define iswpunct bb_iswpunct | ||
40 | |||
41 | typedef int32_t wint_t; | ||
42 | typedef struct { | ||
43 | char bogus; | ||
44 | } mbstate_t; | ||
45 | |||
46 | size_t mbstowcs(wchar_t *dest, const char *src, size_t n) FAST_FUNC; | ||
47 | size_t wcstombs(char *dest, const wchar_t *src, size_t n) FAST_FUNC; | ||
48 | size_t wcrtomb(char *s, wchar_t wc, mbstate_t *ps) FAST_FUNC; | ||
49 | int iswspace(wint_t wc) FAST_FUNC; | ||
50 | int iswalnum(wint_t wc) FAST_FUNC; | ||
51 | int iswpunct(wint_t wc) FAST_FUNC; | ||
52 | |||
53 | # endif | ||
54 | |||
55 | #endif | ||
56 | |||
57 | #endif | ||