add locale framework
[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 int __setlocalecat(locale_t, int, const char *);
9
10 #define CURRENT_LOCALE \
11         (libc.uselocale_cnt ? __pthread_self()->locale : &libc.global_locale)
12
13 #define CURRENT_UTF8 \
14         (libc.bytelocale_cnt_minus_1<0 || __pthread_self()->locale->ctype_utf8)
15
16 #undef MB_CUR_MAX
17 #define MB_CUR_MAX (CURRENT_UTF8 ? 4 : 1)