modernc.org/cc@v1.0.1/v2/headers/linux_arm/usr/include/locale.h (about) 1 /* Copyright (C) 1991-2016 Free Software Foundation, Inc. 2 This file is part of the GNU C Library. 3 4 The GNU C Library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 2.1 of the License, or (at your option) any later version. 8 9 The GNU C Library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public 15 License along with the GNU C Library; if not, see 16 <http://www.gnu.org/licenses/>. */ 17 18 /* 19 * ISO C99 Standard: 7.11 Localization <locale.h> 20 */ 21 22 #ifndef _LOCALE_H 23 #define _LOCALE_H 1 24 25 #include <features.h> 26 27 #define __need_NULL 28 #include <stddef.h> 29 #include <bits/locale.h> 30 31 __BEGIN_DECLS 32 /* These are the possibilities for the first argument to setlocale. 33 The code assumes that the lowest LC_* symbol has the value zero. */ 34 #define LC_CTYPE __LC_CTYPE 35 #define LC_NUMERIC __LC_NUMERIC 36 #define LC_TIME __LC_TIME 37 #define LC_COLLATE __LC_COLLATE 38 #define LC_MONETARY __LC_MONETARY 39 #define LC_MESSAGES __LC_MESSAGES 40 #define LC_ALL __LC_ALL 41 #define LC_PAPER __LC_PAPER 42 #define LC_NAME __LC_NAME 43 #define LC_ADDRESS __LC_ADDRESS 44 #define LC_TELEPHONE __LC_TELEPHONE 45 #define LC_MEASUREMENT __LC_MEASUREMENT 46 #define LC_IDENTIFICATION __LC_IDENTIFICATION 47 __BEGIN_NAMESPACE_STD 48 /* Structure giving information about numeric and monetary notation. */ 49 struct lconv { 50 /* Numeric (non-monetary) information. */ 51 52 char *decimal_point; /* Decimal point character. */ 53 char *thousands_sep; /* Thousands separator. */ 54 /* Each element is the number of digits in each group; 55 elements with higher indices are farther left. 56 An element with value CHAR_MAX means that no further grouping is done. 57 An element with value 0 means that the previous element is used 58 for all groups farther left. */ 59 char *grouping; 60 61 /* Monetary information. */ 62 63 /* First three chars are a currency symbol from ISO 4217. 64 Fourth char is the separator. Fifth char is '\0'. */ 65 char *int_curr_symbol; 66 char *currency_symbol; /* Local currency symbol. */ 67 char *mon_decimal_point; /* Decimal point character. */ 68 char *mon_thousands_sep; /* Thousands separator. */ 69 char *mon_grouping; /* Like `grouping' element (above). */ 70 char *positive_sign; /* Sign for positive values. */ 71 char *negative_sign; /* Sign for negative values. */ 72 char int_frac_digits; /* Int'l fractional digits. */ 73 char frac_digits; /* Local fractional digits. */ 74 /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */ 75 char p_cs_precedes; 76 /* 1 iff a space separates currency_symbol from a positive value. */ 77 char p_sep_by_space; 78 /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */ 79 char n_cs_precedes; 80 /* 1 iff a space separates currency_symbol from a negative value. */ 81 char n_sep_by_space; 82 /* Positive and negative sign positions: 83 0 Parentheses surround the quantity and currency_symbol. 84 1 The sign string precedes the quantity and currency_symbol. 85 2 The sign string follows the quantity and currency_symbol. 86 3 The sign string immediately precedes the currency_symbol. 87 4 The sign string immediately follows the currency_symbol. */ 88 char p_sign_posn; 89 char n_sign_posn; 90 #ifdef __USE_ISOC99 91 /* 1 if int_curr_symbol precedes a positive value, 0 if succeeds. */ 92 char int_p_cs_precedes; 93 /* 1 iff a space separates int_curr_symbol from a positive value. */ 94 char int_p_sep_by_space; 95 /* 1 if int_curr_symbol precedes a negative value, 0 if succeeds. */ 96 char int_n_cs_precedes; 97 /* 1 iff a space separates int_curr_symbol from a negative value. */ 98 char int_n_sep_by_space; 99 /* Positive and negative sign positions: 100 0 Parentheses surround the quantity and int_curr_symbol. 101 1 The sign string precedes the quantity and int_curr_symbol. 102 2 The sign string follows the quantity and int_curr_symbol. 103 3 The sign string immediately precedes the int_curr_symbol. 104 4 The sign string immediately follows the int_curr_symbol. */ 105 char int_p_sign_posn; 106 char int_n_sign_posn; 107 #else 108 char __int_p_cs_precedes; 109 char __int_p_sep_by_space; 110 char __int_n_cs_precedes; 111 char __int_n_sep_by_space; 112 char __int_p_sign_posn; 113 char __int_n_sign_posn; 114 #endif 115 }; 116 117 /* Set and/or return the current locale. */ 118 extern char *setlocale(int __category, const char *__locale) __THROW; 119 120 /* Return the numeric/monetary information for the current locale. */ 121 extern struct lconv *localeconv(void) __THROW; 122 123 __END_NAMESPACE_STD 124 #ifdef __USE_XOPEN2K8 125 /* The concept of one static locale per category is not very well 126 thought out. Many applications will need to process its data using 127 information from several different locales. Another application is 128 the implementation of the internationalization handling in the 129 upcoming ISO C++ standard library. To support this another set of 130 the functions using locale data exist which have an additional 131 argument. 132 133 Attention: all these functions are *not* standardized in any form. 134 This is a proof-of-concept implementation. */ 135 /* Get locale datatype definition. */ 136 #include <xlocale.h> 137 /* Return a reference to a data structure representing a set of locale 138 datasets. Unlike for the CATEGORY parameter for `setlocale' the 139 CATEGORY_MASK parameter here uses a single bit for each category, 140 made by OR'ing together LC_*_MASK bits above. */ 141 extern __locale_t newlocale(int __category_mask, const char *__locale, __locale_t __base) __THROW; 142 143 /* These are the bits that can be set in the CATEGORY_MASK argument to 144 `newlocale'. In the GNU implementation, LC_FOO_MASK has the value 145 of (1 << LC_FOO), but this is not a part of the interface that 146 callers can assume will be true. */ 147 #define LC_CTYPE_MASK (1 << __LC_CTYPE) 148 #define LC_NUMERIC_MASK (1 << __LC_NUMERIC) 149 #define LC_TIME_MASK (1 << __LC_TIME) 150 #define LC_COLLATE_MASK (1 << __LC_COLLATE) 151 #define LC_MONETARY_MASK (1 << __LC_MONETARY) 152 #define LC_MESSAGES_MASK (1 << __LC_MESSAGES) 153 #define LC_PAPER_MASK (1 << __LC_PAPER) 154 #define LC_NAME_MASK (1 << __LC_NAME) 155 #define LC_ADDRESS_MASK (1 << __LC_ADDRESS) 156 #define LC_TELEPHONE_MASK (1 << __LC_TELEPHONE) 157 #define LC_MEASUREMENT_MASK (1 << __LC_MEASUREMENT) 158 #define LC_IDENTIFICATION_MASK (1 << __LC_IDENTIFICATION) 159 #define LC_ALL_MASK (LC_CTYPE_MASK \ 160 | LC_NUMERIC_MASK \ 161 | LC_TIME_MASK \ 162 | LC_COLLATE_MASK \ 163 | LC_MONETARY_MASK \ 164 | LC_MESSAGES_MASK \ 165 | LC_PAPER_MASK \ 166 | LC_NAME_MASK \ 167 | LC_ADDRESS_MASK \ 168 | LC_TELEPHONE_MASK \ 169 | LC_MEASUREMENT_MASK \ 170 | LC_IDENTIFICATION_MASK \ 171 ) 172 173 /* Return a duplicate of the set of locale in DATASET. All usage 174 counters are increased if necessary. */ 175 extern __locale_t duplocale(__locale_t __dataset) __THROW; 176 177 /* Free the data associated with a locale dataset previously returned 178 by a call to `setlocale_r'. */ 179 extern void freelocale(__locale_t __dataset) __THROW; 180 181 /* Switch the current thread's locale to DATASET. 182 If DATASET is null, instead just return the current setting. 183 The special value LC_GLOBAL_LOCALE is the initial setting 184 for all threads and can also be installed any time, meaning 185 the thread uses the global settings controlled by `setlocale'. */ 186 extern __locale_t uselocale(__locale_t __dataset) __THROW; 187 188 /* This value can be passed to `uselocale' and may be returned by it. 189 Passing this value to any other function has undefined behavior. */ 190 #define LC_GLOBAL_LOCALE ((__locale_t) -1L) 191 192 #endif 193 194 __END_DECLS 195 #endif /* locale.h */