remove redefinition of MB_CUR_MAX in locale_impl.h
[musl] / src / internal / locale_impl.h
1 #include <locale.h>
2 #include <stdlib.h>
3 #include "libc.h"
4 #include "pthread_impl.h"
5
6 #define LOCALE_NAME_MAX 15
7
8 struct __locale_map {
9         const void *map;
10         size_t map_size;
11         char name[LOCALE_NAME_MAX+1];
12         const struct __locale_map *next;
13 };
14
15 extern const struct __locale_map __c_dot_utf8;
16 extern const struct __locale_struct __c_locale;
17 extern const struct __locale_struct __c_dot_utf8_locale;
18
19 const struct __locale_map *__get_locale(int, const char *);
20 const char *__mo_lookup(const void *, size_t, const char *);
21 const char *__lctrans(const char *, const struct __locale_map *);
22 const char *__lctrans_cur(const char *);
23
24 #define LCTRANS(msg, lc, loc) __lctrans(msg, (loc)->cat[(lc)])
25 #define LCTRANS_CUR(msg) __lctrans_cur(msg)
26
27 #define C_LOCALE ((locale_t)&__c_locale)
28 #define UTF8_LOCALE ((locale_t)&__c_dot_utf8_locale)
29
30 #define CURRENT_LOCALE (__pthread_self()->locale)
31
32 #define CURRENT_UTF8 (!!__pthread_self()->locale->cat[LC_CTYPE])