Update.
[glibc.git] / locale / langinfo.h
blob10e8dd249e459cb1c0c6c48a8489b3e73262c52c
1 /* Access to locale-dependent parameters.
2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #ifndef _LANGINFO_H
21 #define _LANGINFO_H 1
23 #include <locale.h> /* Define the LC_* category names. */
25 /* Get the type definition. */
26 #include <nl_types.h>
29 __BEGIN_DECLS
31 /* Construct an `nl_item' value for `nl_langinfo' from a locale category
32 (LC_*) and an item index within the category. Some code may depend on
33 the item values within a category increasing monotonically with the
34 indices. */
35 #define _NL_ITEM(category, index) (((category) << 16) | (index))
37 /* Extract the category and item index from a constructed `nl_item' value. */
38 #define _NL_ITEM_CATEGORY(item) ((int) (item) >> 16)
39 #define _NL_ITEM_INDEX(item) ((int) (item) & 0xffff)
42 /* Enumeration of locale items that can be queried with `nl_langinfo'. */
43 enum
45 /* LC_TIME category: date and time formatting. */
47 /* Abbreviated days of the week. */
48 ABDAY_1 = _NL_ITEM (LC_TIME, 0), /* Sun */
49 #define ABDAY_1 ABDAY_1
50 ABDAY_2,
51 #define ABDAY_2 ABDAY_2
52 ABDAY_3,
53 #define ABDAY_3 ABDAY_3
54 ABDAY_4,
55 #define ABDAY_4 ABDAY_4
56 ABDAY_5,
57 #define ABDAY_5 ABDAY_5
58 ABDAY_6,
59 #define ABDAY_6 ABDAY_6
60 ABDAY_7,
61 #define ABDAY_7 ABDAY_7
63 /* Long-named days of the week. */
64 DAY_1, /* Sunday */
65 #define DAY_1 DAY_1
66 DAY_2, /* Monday */
67 #define DAY_2 DAY_2
68 DAY_3, /* Tuesday */
69 #define DAY_3 DAY_3
70 DAY_4, /* Wednesday */
71 #define DAY_4 DAY_4
72 DAY_5, /* Thursday */
73 #define DAY_5 DAY_5
74 DAY_6, /* Friday */
75 #define DAY_6 DAY_6
76 DAY_7, /* Saturday */
77 #define DAY_7 DAY_7
79 /* Abbreviated month names. */
80 ABMON_1, /* Jan */
81 #define ABMON_1 ABMON_1
82 ABMON_2,
83 #define ABMON_2 ABMON_2
84 ABMON_3,
85 #define ABMON_3 ABMON_3
86 ABMON_4,
87 #define ABMON_4 ABMON_4
88 ABMON_5,
89 #define ABMON_5 ABMON_5
90 ABMON_6,
91 #define ABMON_6 ABMON_6
92 ABMON_7,
93 #define ABMON_7 ABMON_7
94 ABMON_8,
95 #define ABMON_8 ABMON_8
96 ABMON_9,
97 #define ABMON_9 ABMON_9
98 ABMON_10,
99 #define ABMON_10 ABMON_10
100 ABMON_11,
101 #define ABMON_11 ABMON_11
102 ABMON_12,
103 #define ABMON_12 ABMON_12
105 /* Long month names. */
106 MON_1, /* January */
107 #define MON_1 MON_1
108 MON_2,
109 #define MON_2 MON_2
110 MON_3,
111 #define MON_3 MON_3
112 MON_4,
113 #define MON_4 MON_4
114 MON_5,
115 #define MON_5 MON_5
116 MON_6,
117 #define MON_6 MON_6
118 MON_7,
119 #define MON_7 MON_7
120 MON_8,
121 #define MON_8 MON_8
122 MON_9,
123 #define MON_9 MON_9
124 MON_10,
125 #define MON_10 MON_10
126 MON_11,
127 #define MON_11 MON_11
128 MON_12,
129 #define MON_12 MON_12
131 AM_STR, /* Ante meridian string. */
132 #define AM_STR AM_STR
133 PM_STR, /* Post meridian string. */
134 #define PM_STR PM_STR
136 D_T_FMT, /* Date and time format for strftime. */
137 #define D_T_FMT D_T_FMT
138 D_FMT, /* Date format for strftime. */
139 #define D_FMT D_FMT
140 T_FMT, /* Time format for strftime. */
141 #define T_FMT T_FMT
142 T_FMT_AMPM, /* 12-hour time format for strftime. */
143 #define T_FMT_AMPM T_FMT_AMPM
145 ERA, /* Alternate era. */
146 #define ERA ERA
147 ERA_YEAR, /* Year in alternate era format. */
148 #define ERA_YEAR ERA_YEAR
149 ERA_D_FMT, /* Date in alternate era format. */
150 #define ERA_D_FMT ERA_D_FMT
151 ALT_DIGITS, /* Alternate symbols for digits. */
152 #define ALT_DIGITS ALT_DIGITS
153 ERA_D_T_FMT, /* Date and time in alternate era format. */
154 #define ERA_D_T_FMT ERA_D_T_FMT
155 ERA_T_FMT, /* Time in alternate era format. */
156 #define ERA_T_FMT ERA_T_FMT
158 _NL_TIME_NUM_ALT_DIGITS, /* Number entries in the alt_digits arrays. */
160 _NL_TIME_ERA_NUM_ENTRIES, /* Number entries in the era arrays. */
161 _NL_TIME_ERA_ENTRIES_EB, /* Structure with era entries in usable form.*/
162 _NL_TIME_ERA_ENTRIES_EL,
164 _NL_NUM_LC_TIME, /* Number of indices in LC_TIME category. */
166 /* LC_COLLATE category: text sorting.
167 This information is accessed by the strcoll and strxfrm functions.
168 These `nl_langinfo' names are used only internally. */
169 _NL_COLLATE_NRULES = _NL_ITEM (LC_COLLATE, 0),
170 _NL_COLLATE_RULES,
171 _NL_COLLATE_HASH_SIZE,
172 _NL_COLLATE_HASH_LAYERS,
173 _NL_COLLATE_TABLE_EB,
174 _NL_COLLATE_TABLE_EL,
175 _NL_COLLATE_UNDEFINED,
176 _NL_COLLATE_EXTRA_EB,
177 _NL_COLLATE_EXTRA_EL,
178 _NL_COLLATE_ELEM_HASH_SIZE,
179 _NL_COLLATE_ELEM_HASH_EB,
180 _NL_COLLATE_ELEM_HASH_EL,
181 _NL_COLLATE_ELEM_STR_POOL,
182 _NL_COLLATE_ELEM_VAL_EB,
183 _NL_COLLATE_ELEM_VAL_EL,
184 _NL_COLLATE_SYMB_HASH_SIZE,
185 _NL_COLLATE_SYMB_HASH_EB,
186 _NL_COLLATE_SYMB_HASH_EL,
187 _NL_COLLATE_SYMB_STR_POOL,
188 _NL_COLLATE_SYMB_CLASS_EB,
189 _NL_COLLATE_SYMB_CLASS_EL,
190 _NL_NUM_LC_COLLATE,
192 /* LC_CTYPE category: character classification.
193 This information is accessed by the functions in <ctype.h>.
194 These `nl_langinfo' names are used only internally. */
195 _NL_CTYPE_CLASS = _NL_ITEM (LC_CTYPE, 0),
196 _NL_CTYPE_TOUPPER_EB,
197 _NL_CTYPE_TOLOWER_EB,
198 _NL_CTYPE_TOUPPER_EL,
199 _NL_CTYPE_TOLOWER_EL,
200 _NL_CTYPE_CLASS32,
201 _NL_CTYPE_NAMES_EB,
202 _NL_CTYPE_NAMES_EL,
203 _NL_CTYPE_HASH_SIZE,
204 _NL_CTYPE_HASH_LAYERS,
205 _NL_CTYPE_CLASS_NAMES,
206 _NL_CTYPE_MAP_NAMES,
207 _NL_CTYPE_WIDTH,
208 _NL_CTYPE_MB_CUR_MAX,
209 _NL_CTYPE_CODESET_NAME,
210 #ifdef __USE_UNIX98
211 CODESET = _NL_CTYPE_CODESET_NAME,
212 #endif
213 _NL_NUM_LC_CTYPE,
215 /* LC_MONETARY category: formatting of monetary quantities.
216 These items each correspond to a member of `struct lconv',
217 defined in <locale.h>. */
218 INT_CURR_SYMBOL = _NL_ITEM (LC_MONETARY, 0),
219 #define INT_CURR_SYMBOL INT_CURR_SYMBOL
220 CURRENCY_SYMBOL,
221 #define CURRENCY_SYMBOL CURRENCY_SYMBOL
222 #ifdef __USE_UNIX98
223 CRNCYSTR = CURRENCY_SYMBOL,
224 # define CRNCYSTR CRNCYSTR
225 #endif
226 MON_DECIMAL_POINT,
227 #define MON_DECIMAL_POINT MON_DECIMAL_POINT
228 MON_THOUSANDS_SEP,
229 #define MON_THOUSANDS_SEP MON_THOUSANDS_SEP
230 MON_GROUPING,
231 #define MON_GROUPING MON_GROUPING
232 POSITIVE_SIGN,
233 #define POSITIVE_SIGN POSITIVE_SIGN
234 NEGATIVE_SIGN,
235 #define NEGATIVE_SIGN NEGATIVE_SIGN
236 INT_FRAC_DIGITS,
237 #define INT_FRAC_DIGITS INT_FRAC_DIGITS
238 FRAC_DIGITS,
239 #define FRAC_DIGITS FRAC_DIGITS
240 P_CS_PRECEDES,
241 #define P_CS_PRECEDES P_CS_PRECEDES
242 P_SEP_BY_SPACE,
243 #define P_SEP_BY_SPACE P_SEP_BY_SPACE
244 N_CS_PRECEDES,
245 #define N_CS_PRECEDES N_CS_PRECEDES
246 N_SEP_BY_SPACE,
247 #define N_SEP_BY_SPACE N_SEP_BY_SPACE
248 P_SIGN_POSN,
249 #define P_SIGN_POSN P_SIGN_POSN
250 N_SIGN_POSN,
251 #define N_SIGN_POSN N_SIGN_POSN
252 _NL_NUM_LC_MONETARY,
254 /* LC_NUMERIC category: formatting of numbers.
255 These also correspond to members of `struct lconv'; see <locale.h>. */
256 DECIMAL_POINT = _NL_ITEM (LC_NUMERIC, 0),
257 #define DECIMAL_POINT DECIMAL_POINT
258 #ifdef __USE_UNIX98
259 RADIXCHAR = DECIMAL_POINT,
260 # define RADIXCHAR RADIXCHAR
261 #endif
262 THOUSANDS_SEP,
263 #define THOUSANDS_SEP THOUSANDS_SEP
264 #ifdef __USE_UNIX98
265 THOUSEP = THOUSANDS_SEP,
266 #define THOUSANDS_SEP THOUSANDS_SEP
267 #endif
268 GROUPING,
269 #define GROUPING GROUPING
270 _NL_NUM_LC_NUMERIC,
272 YESEXPR = _NL_ITEM (LC_MESSAGES, 0), /* Regex matching ``yes'' input. */
273 #define YESEXPR YESEXPR
274 NOEXPR, /* Regex matching ``no'' input. */
275 #define NOEXPR NOEXPR
276 YESSTR, /* Output string for ``yes''. */
277 #define YESSTR YESSTR
278 NOSTR, /* Output string for ``no''. */
279 #define NOSTR NOSTR
280 _NL_NUM_LC_MESSAGES,
282 /* This marks the highest value used. */
283 _NL_NUM
287 /* Return the current locale's value for ITEM.
288 If ITEM is invalid, an empty string is returned.
290 The string returned will not change until `setlocale' is called;
291 it is usually in read-only memory and cannot be modified. */
293 extern char *nl_langinfo __P ((nl_item __item));
296 __END_DECLS
298 #endif /* langinfo.h */