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