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