1 /* Access to locale-dependent parameters.
2 Copyright (C) 1995, 1996, 1997, 1998, 1999 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. */
23 #include <locale.h> /* Define the LC_* category names. */
25 /* Get the type definition. */
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
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'. */
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
51 #define ABDAY_2 ABDAY_2
53 #define ABDAY_3 ABDAY_3
55 #define ABDAY_4 ABDAY_4
57 #define ABDAY_5 ABDAY_5
59 #define ABDAY_6 ABDAY_6
61 #define ABDAY_7 ABDAY_7
63 /* Long-named days of the week. */
70 DAY_4, /* Wednesday */
79 /* Abbreviated month names. */
81 #define ABMON_1 ABMON_1
83 #define ABMON_2 ABMON_2
85 #define ABMON_3 ABMON_3
87 #define ABMON_4 ABMON_4
89 #define ABMON_5 ABMON_5
91 #define ABMON_6 ABMON_6
93 #define ABMON_7 ABMON_7
95 #define ABMON_8 ABMON_8
97 #define ABMON_9 ABMON_9
99 #define ABMON_10 ABMON_10
101 #define ABMON_11 ABMON_11
103 #define ABMON_12 ABMON_12
105 /* Long month names. */
125 #define MON_10 MON_10
127 #define MON_11 MON_11
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. */
140 T_FMT, /* Time format for strftime. */
142 T_FMT_AMPM, /* 12-hour time format for strftime. */
143 #define T_FMT_AMPM T_FMT_AMPM
145 ERA, /* Alternate 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_ERA_NUM_ENTRIES, /* Number entries in the era arrays. */
159 _NL_TIME_ERA_ENTRIES, /* Structure with era entries in usable form.*/
161 _NL_WABDAY_1, /* Sun */
169 /* Long-named days of the week. */
170 _NL_WDAY_1, /* Sunday */
171 _NL_WDAY_2, /* Monday */
172 _NL_WDAY_3, /* Tuesday */
173 _NL_WDAY_4, /* Wednesday */
174 _NL_WDAY_5, /* Thursday */
175 _NL_WDAY_6, /* Friday */
176 _NL_WDAY_7, /* Saturday */
178 /* Abbreviated month names. */
179 _NL_WABMON_1, /* Jan */
192 /* Long month names. */
193 _NL_WMON_1, /* January */
206 _NL_WAM_STR, /* Ante meridian string. */
207 _NL_WPM_STR, /* Post meridian string. */
209 _NL_WD_T_FMT, /* Date and time format for strftime. */
210 _NL_WD_FMT, /* Date format for strftime. */
211 _NL_WT_FMT, /* Time format for strftime. */
212 _NL_WT_FMT_AMPM, /* 12-hour time format for strftime. */
214 _NL_WERA_YEAR, /* Year in alternate era format. */
215 _NL_WERA_D_FMT, /* Date in alternate era format. */
216 _NL_WALT_DIGITS, /* Alternate symbols for digits. */
217 _NL_WERA_D_T_FMT, /* Date and time in alternate era format. */
218 _NL_WERA_T_FMT, /* Time in alternate era format. */
221 _NL_TIME_WEEK_1STDAY,
222 _NL_TIME_WEEK_1STWEEK,
223 _NL_TIME_FIRST_WEEKDAY,
224 _NL_TIME_FIRST_WORKDAY,
225 _NL_TIME_CAL_DIRECTION,
228 _NL_NUM_LC_TIME, /* Number of indices in LC_TIME category. */
230 /* LC_COLLATE category: text sorting.
231 This information is accessed by the strcoll and strxfrm functions.
232 These `nl_langinfo' names are used only internally. */
233 _NL_COLLATE_NRULES = _NL_ITEM (LC_COLLATE, 0),
235 _NL_COLLATE_HASH_SIZE,
236 _NL_COLLATE_HASH_LAYERS,
239 _NL_COLLATE_UNDEFINED_MB,
240 _NL_COLLATE_UNDEFINED_WC,
243 _NL_COLLATE_ELEM_HASH_SIZE,
244 _NL_COLLATE_ELEM_HASH,
245 _NL_COLLATE_ELEM_STR_POOL,
246 _NL_COLLATE_ELEM_VAL,
247 _NL_COLLATE_ELEM_VALMB,
248 _NL_COLLATE_ELEM_VALWC,
249 _NL_COLLATE_SYMB_HASH_SIZE,
250 _NL_COLLATE_SYMB_HASH,
251 _NL_COLLATE_SYMB_STR_POOL,
252 _NL_COLLATE_SYMB_CLASSMB,
253 _NL_COLLATE_SYMB_CLASSWC,
256 /* LC_CTYPE category: character classification.
257 This information is accessed by the functions in <ctype.h>.
258 These `nl_langinfo' names are used only internally. */
259 _NL_CTYPE_CLASS = _NL_ITEM (LC_CTYPE, 0),
265 _NL_CTYPE_HASH_LAYERS,
266 _NL_CTYPE_CLASS_NAMES,
269 _NL_CTYPE_MB_CUR_MAX,
270 _NL_CTYPE_CODESET_NAME,
272 CODESET = _NL_CTYPE_CODESET_NAME,
276 _NL_CTYPE_INDIGITS_MB_LEN,
277 _NL_CTYPE_INDIGITS0_MB,
278 _NL_CTYPE_INDIGITS1_MB,
279 _NL_CTYPE_INDIGITS2_MB,
280 _NL_CTYPE_INDIGITS3_MB,
281 _NL_CTYPE_INDIGITS4_MB,
282 _NL_CTYPE_INDIGITS5_MB,
283 _NL_CTYPE_INDIGITS6_MB,
284 _NL_CTYPE_INDIGITS7_MB,
285 _NL_CTYPE_INDIGITS8_MB,
286 _NL_CTYPE_INDIGITS9_MB,
287 _NL_CTYPE_INDIGITS_WC_LEN,
288 _NL_CTYPE_INDIGITS0_WC,
289 _NL_CTYPE_INDIGITS1_WC,
290 _NL_CTYPE_INDIGITS2_WC,
291 _NL_CTYPE_INDIGITS3_WC,
292 _NL_CTYPE_INDIGITS4_WC,
293 _NL_CTYPE_INDIGITS5_WC,
294 _NL_CTYPE_INDIGITS6_WC,
295 _NL_CTYPE_INDIGITS7_WC,
296 _NL_CTYPE_INDIGITS8_WC,
297 _NL_CTYPE_INDIGITS9_WC,
298 _NL_CTYPE_OUTDIGIT0_MB,
299 _NL_CTYPE_OUTDIGIT1_MB,
300 _NL_CTYPE_OUTDIGIT2_MB,
301 _NL_CTYPE_OUTDIGIT3_MB,
302 _NL_CTYPE_OUTDIGIT4_MB,
303 _NL_CTYPE_OUTDIGIT5_MB,
304 _NL_CTYPE_OUTDIGIT6_MB,
305 _NL_CTYPE_OUTDIGIT7_MB,
306 _NL_CTYPE_OUTDIGIT8_MB,
307 _NL_CTYPE_OUTDIGIT9_MB,
308 _NL_CTYPE_OUTDIGIT0_WC,
309 _NL_CTYPE_OUTDIGIT1_WC,
310 _NL_CTYPE_OUTDIGIT2_WC,
311 _NL_CTYPE_OUTDIGIT3_WC,
312 _NL_CTYPE_OUTDIGIT4_WC,
313 _NL_CTYPE_OUTDIGIT5_WC,
314 _NL_CTYPE_OUTDIGIT6_WC,
315 _NL_CTYPE_OUTDIGIT7_WC,
316 _NL_CTYPE_OUTDIGIT8_WC,
317 _NL_CTYPE_OUTDIGIT9_WC,
318 _NL_CTYPE_TRANSLIT_HASH_SIZE,
319 _NL_CTYPE_TRANSLIT_HASH_LAYERS,
320 _NL_CTYPE_TRANSLIT_FROM_IDX,
321 _NL_CTYPE_TRANSLIT_FROM_TBL,
322 _NL_CTYPE_TRANSLIT_TO_IDX,
323 _NL_CTYPE_TRANSLIT_TO_TBL,
326 /* LC_MONETARY category: formatting of monetary quantities.
327 These items each correspond to a member of `struct lconv',
328 defined in <locale.h>. */
329 INT_CURR_SYMBOL = _NL_ITEM (LC_MONETARY, 0),
330 #define INT_CURR_SYMBOL INT_CURR_SYMBOL
332 #define CURRENCY_SYMBOL CURRENCY_SYMBOL
334 CRNCYSTR = CURRENCY_SYMBOL,
335 # define CRNCYSTR CRNCYSTR
338 #define MON_DECIMAL_POINT MON_DECIMAL_POINT
340 #define MON_THOUSANDS_SEP MON_THOUSANDS_SEP
342 #define MON_GROUPING MON_GROUPING
344 #define POSITIVE_SIGN POSITIVE_SIGN
346 #define NEGATIVE_SIGN NEGATIVE_SIGN
348 #define INT_FRAC_DIGITS INT_FRAC_DIGITS
350 #define FRAC_DIGITS FRAC_DIGITS
352 #define P_CS_PRECEDES P_CS_PRECEDES
354 #define P_SEP_BY_SPACE P_SEP_BY_SPACE
356 #define N_CS_PRECEDES N_CS_PRECEDES
358 #define N_SEP_BY_SPACE N_SEP_BY_SPACE
360 #define P_SIGN_POSN P_SIGN_POSN
362 #define N_SIGN_POSN N_SIGN_POSN
363 _NL_MONETARY_INT_P_CS_PRECEDES,
364 _NL_MONETARY_INT_P_SEP_BY_SPACE,
365 _NL_MONETARY_INT_N_CS_PRECEDES,
366 _NL_MONETARY_INT_N_SEP_BY_SPACE,
367 _NL_MONETARY_INT_P_SIGN_POSN,
368 _NL_MONETARY_INT_N_SIGN_POSN,
369 _NL_MONETARY_DUO_INT_CURR_SYMBOL,
370 _NL_MONETARY_DUO_CURRENCY_SYMBOL,
371 _NL_MONETARY_DUO_INT_FRAC_DIGITS,
372 _NL_MONETARY_DUO_FRAC_DIGITS,
373 _NL_MONETARY_DUO_P_CS_PRECEDES,
374 _NL_MONETARY_DUO_P_SEP_BY_SPACE,
375 _NL_MONETARY_DUO_N_CS_PRECEDES,
376 _NL_MONETARY_DUO_N_SEP_BY_SPACE,
377 _NL_MONETARY_DUO_INT_P_CS_PRECEDES,
378 _NL_MONETARY_DUO_INT_P_SEP_BY_SPACE,
379 _NL_MONETARY_DUO_INT_N_CS_PRECEDES,
380 _NL_MONETARY_DUO_INT_N_SEP_BY_SPACE,
381 _NL_MONETARY_DUO_P_SIGN_POSN,
382 _NL_MONETARY_DUO_N_SIGN_POSN,
383 _NL_MONETARY_DUO_INT_P_SIGN_POSN,
384 _NL_MONETARY_DUO_INT_N_SIGN_POSN,
385 _NL_MONETARY_UNO_VALID_FROM,
386 _NL_MONETARY_UNO_VALID_TO,
387 _NL_MONETARY_DUO_VALID_FROM,
388 _NL_MONETARY_DUO_VALID_TO,
389 _NL_MONETARY_CONVERSION_RATE,
392 /* LC_NUMERIC category: formatting of numbers.
393 These also correspond to members of `struct lconv'; see <locale.h>. */
394 DECIMAL_POINT = _NL_ITEM (LC_NUMERIC, 0),
395 #define DECIMAL_POINT DECIMAL_POINT
397 RADIXCHAR = DECIMAL_POINT,
398 # define RADIXCHAR RADIXCHAR
401 #define THOUSANDS_SEP THOUSANDS_SEP
403 THOUSEP = THOUSANDS_SEP,
404 # define THOUSANDS_SEP THOUSANDS_SEP
407 #define GROUPING GROUPING
410 YESEXPR = _NL_ITEM (LC_MESSAGES, 0), /* Regex matching ``yes'' input. */
411 #define YESEXPR YESEXPR
412 NOEXPR, /* Regex matching ``no'' input. */
413 #define NOEXPR NOEXPR
414 YESSTR, /* Output string for ``yes''. */
415 #define YESSTR YESSTR
416 NOSTR, /* Output string for ``no''. */
420 _NL_PAPER_HEIGHT = _NL_ITEM (LC_PAPER, 0),
424 _NL_NAME_NAME_FMT = _NL_ITEM (LC_NAME, 0),
432 _NL_ADDRESS_POSTAL_FMT = _NL_ITEM (LC_ADDRESS, 0),
433 _NL_ADDRESS_COUNTRY_NAME,
434 _NL_ADDRESS_COUNTRY_POST,
435 _NL_ADDRESS_COUNTRY_AB2,
436 _NL_ADDRESS_COUNTRY_AB3,
437 _NL_ADDRESS_COUNTRY_CAR,
438 _NL_ADDRESS_COUNTRY_NUM,
439 _NL_ADDRESS_COUNTRY_ISBN,
440 _NL_ADDRESS_LANG_NAME,
442 _NL_ADDRESS_LANG_TERM,
443 _NL_ADDRESS_LANG_LIB,
446 _NL_TELEPHONE_TEL_INT_FMT = _NL_ITEM (LC_TELEPHONE, 0),
447 _NL_TELEPHONE_TEL_DOM_FMT,
448 _NL_TELEPHONE_INT_SELECT,
449 _NL_TELEPHONE_INT_PREFIX,
450 _NL_NUM_LC_TELEPHONE,
452 _NL_MEASUREMENT_MEASUREMENT = _NL_ITEM (LC_MEASUREMENT, 0),
453 _NL_NUM_LC_MEASUREMENT,
455 _NL_IDENTIFICATION_TITLE = _NL_ITEM (LC_IDENTIFICATION, 0),
456 _NL_IDENTIFICATION_SOURCE,
457 _NL_IDENTIFICATION_ADDRESS,
458 _NL_IDENTIFICATION_CONTACT,
459 _NL_IDENTIFICATION_EMAIL,
460 _NL_IDENTIFICATION_TEL,
461 _NL_IDENTIFICATION_FAX,
462 _NL_IDENTIFICATION_LANGUAGE,
463 _NL_IDENTIFICATION_TERRITORY,
464 _NL_IDENTIFICATION_AUDIENCE,
465 _NL_IDENTIFICATION_APPLICATION,
466 _NL_IDENTIFICATION_ABBREVIATION,
467 _NL_IDENTIFICATION_REVISION,
468 _NL_IDENTIFICATION_DATE,
469 _NL_IDENTIFICATION_CATEGORY,
470 _NL_NUM_LC_IDENTIFICATION,
472 /* This marks the highest value used. */
477 /* Return the current locale's value for ITEM.
478 If ITEM is invalid, an empty string is returned.
480 The string returned will not change until `setlocale' is called;
481 it is usually in read-only memory and cannot be modified. */
483 extern char *nl_langinfo __P ((nl_item __item));
488 #endif /* langinfo.h */