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