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