netinet/if_ether.h: add ETH_P_DSA_8021Q from linux v5.2
[musl.git] / src / internal / locale_impl.h
blob741a71c4d11efec54f818fb054246b44de231b79
1 #ifndef _LOCALE_IMPL_H
2 #define _LOCALE_IMPL_H
4 #include <locale.h>
5 #include <stdlib.h>
6 #include "libc.h"
7 #include "pthread_impl.h"
9 #define LOCALE_NAME_MAX 23
11 struct __locale_map {
12 const void *map;
13 size_t map_size;
14 char name[LOCALE_NAME_MAX+1];
15 const struct __locale_map *next;
18 extern hidden const struct __locale_map __c_dot_utf8;
19 extern hidden const struct __locale_struct __c_locale;
20 extern hidden const struct __locale_struct __c_dot_utf8_locale;
22 hidden const struct __locale_map *__get_locale(int, const char *);
23 hidden const char *__mo_lookup(const void *, size_t, const char *);
24 hidden const char *__lctrans(const char *, const struct __locale_map *);
25 hidden const char *__lctrans_cur(const char *);
26 hidden const char *__lctrans_impl(const char *, const struct __locale_map *);
27 hidden int __loc_is_allocated(locale_t);
28 hidden char *__gettextdomain(void);
30 #define LOC_MAP_FAILED ((const struct __locale_map *)-1)
32 #define LCTRANS(msg, lc, loc) __lctrans(msg, (loc)->cat[(lc)])
33 #define LCTRANS_CUR(msg) __lctrans_cur(msg)
35 #define C_LOCALE ((locale_t)&__c_locale)
36 #define UTF8_LOCALE ((locale_t)&__c_dot_utf8_locale)
38 #define CURRENT_LOCALE (__pthread_self()->locale)
40 #define CURRENT_UTF8 (!!__pthread_self()->locale->cat[LC_CTYPE])
42 #undef MB_CUR_MAX
43 #define MB_CUR_MAX (CURRENT_UTF8 ? 4 : 1)
45 #endif