]>
Commit | Line | Data |
---|---|---|
933e73fa | 1 | /* nl_langinfo -- Access to locale-dependent parameters. |
19bc17a9 | 2 | Copyright (C) 1995, 1996 Free Software Foundation, Inc. |
933e73fa RM |
3 | This file is part of the GNU C Library. |
4 | ||
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. | |
9 | ||
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. | |
14 | ||
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 | |
17 | not, write to the Free Software Foundation, Inc., 675 Mass Ave, | |
18 | Cambridge, MA 02139, USA. */ | |
19 | ||
20 | #ifndef _LANGINFO_H | |
21 | #define _LANGINFO_H 1 | |
22 | ||
23 | #include <locale.h> /* Define the LC_* category names. */ | |
24 | ||
25 | __BEGIN_DECLS | |
26 | ||
27 | /* Construct an `nl_item' value for `nl_langinfo' from a locale category | |
28 | (LC_*) and an item index within the category. Some code may depend on | |
29 | the item values within a category increasing monotonically with the | |
30 | indices. */ | |
31 | #define _NL_ITEM(category, index) (((category) << 16) | (index)) | |
32 | ||
33 | /* Extract the category and item index from a constructed `nl_item' value. */ | |
34 | #define _NL_ITEM_CATEGORY(item) ((int) (item) >> 16) | |
35 | #define _NL_ITEM_INDEX(item) ((int) (item) & 0xffff) | |
36 | ||
37 | ||
38 | /* Enumeration of locale items that can be queried with `nl_langinfo'. */ | |
39 | typedef enum | |
40 | { | |
41 | /* LC_TIME category: date and time formatting. */ | |
42 | ||
43 | /* Abbreviated days of the week. */ | |
44 | ABDAY_1 = _NL_ITEM (LC_TIME, 0), /* Sun */ | |
45 | ABDAY_2, | |
46 | ABDAY_3, | |
47 | ABDAY_4, | |
48 | ABDAY_5, | |
49 | ABDAY_6, | |
50 | ABDAY_7, | |
51 | ||
52 | /* Long-named days of the week. */ | |
53 | DAY_1, /* Sunday */ | |
54 | DAY_2, /* Monday */ | |
55 | DAY_3, /* Tuesday */ | |
56 | DAY_4, /* Wednesday */ | |
57 | DAY_5, /* Thursday */ | |
58 | DAY_6, /* Friday */ | |
59 | DAY_7, /* Saturday */ | |
60 | ||
61 | /* Abbreviated month names. */ | |
62 | ABMON_1, /* Jan */ | |
63 | ABMON_2, | |
64 | ABMON_3, | |
65 | ABMON_4, | |
66 | ABMON_5, | |
67 | ABMON_6, | |
68 | ABMON_7, | |
69 | ABMON_8, | |
70 | ABMON_9, | |
71 | ABMON_10, | |
72 | ABMON_11, | |
73 | ABMON_12, | |
74 | ||
75 | /* Long month names. */ | |
76 | MON_1, /* January */ | |
77 | MON_2, | |
78 | MON_3, | |
79 | MON_4, | |
80 | MON_5, | |
81 | MON_6, | |
82 | MON_7, | |
83 | MON_8, | |
84 | MON_9, | |
85 | MON_10, | |
86 | MON_11, | |
87 | MON_12, | |
88 | ||
89 | AM_STR, /* Ante meridian string. */ | |
90 | PM_STR, /* Post meridian string. */ | |
91 | ||
92 | D_T_FMT, /* Date and time format for strftime. */ | |
93 | D_FMT, /* Date format for strftime. */ | |
94 | T_FMT, /* Time format for strftime. */ | |
95 | T_FMT_AMPM, /* 12-hour time format for strftime. */ | |
96 | ||
97 | ERA, /* Alternate era. */ | |
98 | ERA_YEAR, /* Year in alternate era format. */ | |
6c2f0507 | 99 | ERA_D_FMT, /* Date in alternate era format. */ |
933e73fa | 100 | ALT_DIGITS, /* Alternate symbols for digits. */ |
19bc17a9 RM |
101 | ERA_D_T_FMT, /* Date and time in alternate era format. */ |
102 | ERA_T_FMT, /* Time in alternate era format. */ | |
933e73fa RM |
103 | |
104 | _NL_NUM_LC_TIME, /* Number of indices in LC_TIME category. */ | |
105 | ||
19bc17a9 RM |
106 | /* LC_COLLATE category: text sorting. |
107 | This information is accessed by the strcoll and strxfrm functions. | |
108 | These `nl_langinfo' names are used only internally. */ | |
109 | _NL_COLLATE_NRULES = _NL_ITEM (LC_COLLATE, 0), | |
110 | _NL_COLLATE_RULES, | |
111 | _NL_COLLATE_HASH_SIZE, | |
112 | _NL_COLLATE_HASH_LAYERS, | |
113 | _NL_COLLATE_TABLE_EB, | |
114 | _NL_COLLATE_TABLE_EL, | |
115 | _NL_COLLATE_UNDEFINED, | |
116 | _NL_COLLATE_EXTRA_EB, | |
117 | _NL_COLLATE_EXTRA_EL, | |
118 | _NL_NUM_LC_COLLATE, | |
119 | ||
933e73fa RM |
120 | /* LC_CTYPE category: character classification. |
121 | This information is accessed by the functions in <ctype.h>. | |
6c2f0507 RM |
122 | These `nl_langinfo' names are used only internally. */ |
123 | _NL_CTYPE_CLASS = _NL_ITEM (LC_CTYPE, 0), | |
933e73fa RM |
124 | _NL_CTYPE_TOUPPER_EB, |
125 | _NL_CTYPE_TOLOWER_EB, | |
933e73fa RM |
126 | _NL_CTYPE_TOUPPER_EL, |
127 | _NL_CTYPE_TOLOWER_EL, | |
19bc17a9 RM |
128 | _NL_CTYPE_CLASS32, |
129 | _NL_CTYPE_NAMES_EB, | |
130 | _NL_CTYPE_NAMES_EL, | |
131 | _NL_CTYPE_HASH_SIZE, | |
132 | _NL_CTYPE_HASH_LAYERS, | |
133 | _NL_CTYPE_CLASS_NAMES, | |
134 | _NL_CTYPE_MAP_NAMES, | |
135 | _NL_CTYPE_WIDTH, | |
933e73fa RM |
136 | _NL_NUM_LC_CTYPE, |
137 | ||
138 | /* LC_MONETARY category: formatting of monetary quantities. | |
139 | These items each correspond to a member of `struct lconv', | |
140 | defined in <locale.h>. */ | |
141 | INT_CURR_SYMBOL = _NL_ITEM (LC_MONETARY, 0), | |
142 | CURRENCY_SYMBOL, | |
143 | MON_DECIMAL_POINT, | |
144 | MON_THOUSANDS_SEP, | |
145 | MON_GROUPING, | |
146 | POSITIVE_SIGN, | |
147 | NEGATIVE_SIGN, | |
148 | INT_FRAC_DIGITS, | |
149 | FRAC_DIGITS, | |
150 | P_CS_PRECEDES, | |
151 | P_SEP_BY_SPACE, | |
152 | N_CS_PRECEDES, | |
153 | N_SEP_BY_SPACE, | |
154 | P_SIGN_POSN, | |
155 | N_SIGN_POSN, | |
156 | _NL_NUM_LC_MONETARY, | |
157 | ||
158 | /* LC_NUMERIC category: formatting of numbers. | |
159 | These also correspond to members of `struct lconv'; see <locale.h>. */ | |
160 | DECIMAL_POINT = _NL_ITEM (LC_NUMERIC, 0), | |
161 | THOUSANDS_SEP, | |
162 | GROUPING, | |
163 | _NL_NUM_LC_NUMERIC, | |
164 | ||
165 | YESEXPR = _NL_ITEM (LC_MESSAGES, 0), /* Regex matching ``yes'' input. */ | |
166 | NOEXPR, /* Regex matching ``no'' input. */ | |
167 | YESSTR, /* Output string for ``yes''. */ | |
168 | NOSTR, /* Output string for ``no''. */ | |
169 | _NL_NUM_LC_MESSAGES, | |
170 | ||
2b83a2a4 RM |
171 | /* This marks the highest value used. */ |
172 | _NL_NUM | |
933e73fa RM |
173 | } nl_item; |
174 | ||
175 | ||
176 | /* Return the current locale's value for ITEM. | |
177 | If ITEM is invalid, an empty string is returned. | |
178 | ||
179 | The string returned will not change until `setlocale' is called; | |
180 | it is usually in read-only memory and cannot be modified. */ | |
181 | ||
182 | extern char *nl_langinfo __P ((nl_item item)); | |
183 | ||
184 | ||
185 | __END_DECLS | |
186 | ||
187 | #endif /* langinfo.h */ |