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