setjmp.h: add struct tag for sigjmp_buf (GCC C++ compatibility)
[musl] / include / locale.h
1 #ifndef _LOCALE_H
2 #define _LOCALE_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <features.h>
9
10 #undef NULL
11 #ifdef __cplusplus
12 #define NULL 0
13 #else
14 #define NULL ((void*)0)
15 #endif
16
17 #define LC_CTYPE    0
18 #define LC_NUMERIC  1
19 #define LC_TIME     2
20 #define LC_COLLATE  3
21 #define LC_MONETARY 4
22 #define LC_MESSAGES 5
23 #define LC_ALL      6
24
25 struct lconv {
26         char *decimal_point;
27         char *thousands_sep;
28         char *grouping;
29
30         char *int_curr_symbol;
31         char *currency_symbol;
32         char *mon_decimal_point;
33         char *mon_thousands_sep;
34         char *mon_grouping;
35         char *positive_sign;
36         char *negative_sign;
37         char int_frac_digits;
38         char frac_digits;
39         char p_cs_precedes;
40         char p_sep_by_space;
41         char n_cs_precedes;
42         char n_sep_by_space;
43         char p_sign_posn;
44         char n_sign_posn;
45         char int_p_cs_precedes;
46         char int_p_sep_by_space;
47         char int_n_cs_precedes;
48         char int_n_sep_by_space;
49         char int_p_sign_posn;
50         char int_n_sign_posn;
51 };
52
53
54 char *setlocale (int, const char *);
55 struct lconv *localeconv(void);
56
57
58 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
59  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
60
61 #define __NEED_locale_t
62
63 #include <bits/alltypes.h>
64
65 #define LC_GLOBAL_LOCALE ((locale_t)-1)
66
67 #define LC_CTYPE_MASK    (1<<LC_CTYPE)
68 #define LC_NUMERIC_MASK  (1<<LC_NUMERIC)
69 #define LC_TIME_MASK     (1<<LC_TIME)
70 #define LC_COLLATE_MASK  (1<<LC_COLLATE)
71 #define LC_MONETARY_MASK (1<<LC_MONETARY)
72 #define LC_MESSAGES_MASK (1<<LC_MESSAGES)
73 #define LC_ALL_MASK      0x7fffffff
74
75 locale_t duplocale(locale_t);
76 void freelocale(locale_t);
77 locale_t newlocale(int, const char *, locale_t);
78 locale_t uselocale(locale_t);
79
80 #endif
81
82
83 #ifdef __cplusplus
84 }
85 #endif
86
87 #endif