($(inst_libdir)/libndbm.a, $(inst_libdir)/libndbm.so): New targets.
[glibc.git] / locale / langinfo.h
blobc6ad70856590425571ba4e2a7720a7c982c32d82
1 /* nl_langinfo -- Access to locale-dependent parameters.
2 Copyright (C) 1995, 1996, 1998 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 __BEGIN_DECLS
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))
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)
38 /* Enumeration of locale items that can be queried with `nl_langinfo'. */
39 typedef enum
41 /* LC_TIME category: date and time formatting. */
43 /* Abbreviated days of the week. */
44 ABDAY_1 = _NL_ITEM (LC_TIME, 0), /* Sun */
45 #define ABDAY_1 ABDAY_1
46 ABDAY_2,
47 #define ABDAY_2 ABDAY_2
48 ABDAY_3,
49 #define ABDAY_3 ABDAY_3
50 ABDAY_4,
51 #define ABDAY_4 ABDAY_4
52 ABDAY_5,
53 #define ABDAY_5 ABDAY_5
54 ABDAY_6,
55 #define ABDAY_6 ABDAY_6
56 ABDAY_7,
57 #define ABDAY_7 ABDAY_7
59 /* Long-named days of the week. */
60 DAY_1, /* Sunday */
61 #define DAY_1 DAY_1
62 DAY_2, /* Monday */
63 #define DAY_2 DAY_2
64 DAY_3, /* Tuesday */
65 #define DAY_3 DAY_3
66 DAY_4, /* Wednesday */
67 #define DAY_4 DAY_4
68 DAY_5, /* Thursday */
69 #define DAY_5 DAY_5
70 DAY_6, /* Friday */
71 #define DAY_6 DAY_6
72 DAY_7, /* Saturday */
73 #define DAY_7 DAY_7
75 /* Abbreviated month names. */
76 ABMON_1, /* Jan */
77 #define ABMON_1 ABMON_1
78 ABMON_2,
79 #define ABMON_2 ABMON_2
80 ABMON_3,
81 #define ABMON_3 ABMON_3
82 ABMON_4,
83 #define ABMON_4 ABMON_4
84 ABMON_5,
85 #define ABMON_5 ABMON_5
86 ABMON_6,
87 #define ABMON_6 ABMON_6
88 ABMON_7,
89 #define ABMON_7 ABMON_7
90 ABMON_8,
91 #define ABMON_8 ABMON_8
92 ABMON_9,
93 #define ABMON_9 ABMON_9
94 ABMON_10,
95 #define ABMON_10 ABMON_10
96 ABMON_11,
97 #define ABMON_11 ABMON_11
98 ABMON_12,
99 #define ABMON_12 ABMON_12
101 /* Long month names. */
102 MON_1, /* January */
103 #define MON_1 MON_1
104 MON_2,
105 #define MON_2 MON_2
106 MON_3,
107 #define MON_3 MON_3
108 MON_4,
109 #define MON_4 MON_4
110 MON_5,
111 #define MON_5 MON_5
112 MON_6,
113 #define MON_6 MON_6
114 MON_7,
115 #define MON_7 MON_7
116 MON_8,
117 #define MON_8 MON_8
118 MON_9,
119 #define MON_9 MON_9
120 MON_10,
121 #define MON_10 MON_10
122 MON_11,
123 #define MON_11 MON_11
124 MON_12,
125 #define MON_12 MON_12
127 AM_STR, /* Ante meridian string. */
128 #define AM_STR AM_STR
129 PM_STR, /* Post meridian string. */
130 #define PM_STR PM_STR
132 D_T_FMT, /* Date and time format for strftime. */
133 #define D_T_FMT D_T_FMT
134 D_FMT, /* Date format for strftime. */
135 #define D_FMT D_FMT
136 T_FMT, /* Time format for strftime. */
137 #define T_FMT T_FMT
138 T_FMT_AMPM, /* 12-hour time format for strftime. */
139 #define T_FMT_AMPM T_FMT_AMPM
141 ERA, /* Alternate era. */
142 #define ERA ERA
143 ERA_YEAR, /* Year in alternate era format. */
144 #define ERA_YEAR ERA_YEAR
145 ERA_D_FMT, /* Date in alternate era format. */
146 #define ERA_D_FMT ERA_D_FMT
147 ALT_DIGITS, /* Alternate symbols for digits. */
148 #define ALT_DIGITS ALT_DIGITS
149 ERA_D_T_FMT, /* Date and time in alternate era format. */
150 #define ERA_D_T_FMT ERA_D_T_FMT
151 ERA_T_FMT, /* Time in alternate era format. */
152 #define ERA_T_FMT ERA_T_FMT
154 _NL_TIME_NUM_ALT_DIGITS, /* Number entries in the alt_digits arrays. */
156 _NL_TIME_ERA_NUM_ENTRIES, /* Number entries in the era arrays. */
157 _NL_TIME_ERA_ENTRIES_EB, /* Structure with era entries in usable form.*/
158 _NL_TIME_ERA_ENTRIES_EL,
160 _NL_NUM_LC_TIME, /* Number of indices in LC_TIME category. */
162 /* LC_COLLATE category: text sorting.
163 This information is accessed by the strcoll and strxfrm functions.
164 These `nl_langinfo' names are used only internally. */
165 _NL_COLLATE_NRULES = _NL_ITEM (LC_COLLATE, 0),
166 _NL_COLLATE_RULES,
167 _NL_COLLATE_HASH_SIZE,
168 _NL_COLLATE_HASH_LAYERS,
169 _NL_COLLATE_TABLE_EB,
170 _NL_COLLATE_TABLE_EL,
171 _NL_COLLATE_UNDEFINED,
172 _NL_COLLATE_EXTRA_EB,
173 _NL_COLLATE_EXTRA_EL,
174 _NL_COLLATE_ELEM_HASH_SIZE,
175 _NL_COLLATE_ELEM_HASH_EB,
176 _NL_COLLATE_ELEM_HASH_EL,
177 _NL_COLLATE_ELEM_STR_POOL,
178 _NL_COLLATE_ELEM_VAL_EB,
179 _NL_COLLATE_ELEM_VAL_EL,
180 _NL_COLLATE_SYMB_HASH_SIZE,
181 _NL_COLLATE_SYMB_HASH_EB,
182 _NL_COLLATE_SYMB_HASH_EL,
183 _NL_COLLATE_SYMB_STR_POOL,
184 _NL_COLLATE_SYMB_CLASS_EB,
185 _NL_COLLATE_SYMB_CLASS_EL,
186 _NL_NUM_LC_COLLATE,
188 /* LC_CTYPE category: character classification.
189 This information is accessed by the functions in <ctype.h>.
190 These `nl_langinfo' names are used only internally. */
191 _NL_CTYPE_CLASS = _NL_ITEM (LC_CTYPE, 0),
192 _NL_CTYPE_TOUPPER_EB,
193 _NL_CTYPE_TOLOWER_EB,
194 _NL_CTYPE_TOUPPER_EL,
195 _NL_CTYPE_TOLOWER_EL,
196 _NL_CTYPE_CLASS32,
197 _NL_CTYPE_NAMES_EB,
198 _NL_CTYPE_NAMES_EL,
199 _NL_CTYPE_HASH_SIZE,
200 _NL_CTYPE_HASH_LAYERS,
201 _NL_CTYPE_CLASS_NAMES,
202 _NL_CTYPE_MAP_NAMES,
203 _NL_CTYPE_WIDTH,
204 _NL_CTYPE_MB_CUR_MAX,
205 _NL_CTYPE_CODESET_NAME,
206 _NL_NUM_LC_CTYPE,
208 /* LC_MONETARY category: formatting of monetary quantities.
209 These items each correspond to a member of `struct lconv',
210 defined in <locale.h>. */
211 INT_CURR_SYMBOL = _NL_ITEM (LC_MONETARY, 0),
212 #define INT_CURR_SYMBOL INT_CURR_SYMBOL
213 CURRENCY_SYMBOL,
214 #define CURRENCY_SYMBOL CURRENCY_SYMBOL
215 MON_DECIMAL_POINT,
216 #define MON_DECIMAL_POINT MON_DECIMAL_POINT
217 MON_THOUSANDS_SEP,
218 #define MON_THOUSANDS_SEP MON_THOUSANDS_SEP
219 MON_GROUPING,
220 #define MON_GROUPING MON_GROUPING
221 POSITIVE_SIGN,
222 #define POSITIVE_SIGN POSITIVE_SIGN
223 NEGATIVE_SIGN,
224 #define NEGATIVE_SIGN NEGATIVE_SIGN
225 INT_FRAC_DIGITS,
226 #define INT_FRAC_DIGITS INT_FRAC_DIGITS
227 FRAC_DIGITS,
228 #define FRAC_DIGITS FRAC_DIGITS
229 P_CS_PRECEDES,
230 #define P_CS_PRECEDES P_CS_PRECEDES
231 P_SEP_BY_SPACE,
232 #define P_SEP_BY_SPACE P_SEP_BY_SPACE
233 N_CS_PRECEDES,
234 #define N_CS_PRECEDES N_CS_PRECEDES
235 N_SEP_BY_SPACE,
236 #define N_SEP_BY_SPACE N_SEP_BY_SPACE
237 P_SIGN_POSN,
238 #define P_SIGN_POSN P_SIGN_POSN
239 N_SIGN_POSN,
240 #define N_SIGN_POSN N_SIGN_POSN
241 _NL_NUM_LC_MONETARY,
243 /* LC_NUMERIC category: formatting of numbers.
244 These also correspond to members of `struct lconv'; see <locale.h>. */
245 DECIMAL_POINT = _NL_ITEM (LC_NUMERIC, 0),
246 #define DECIMAL_POINT DECIMAL_POINT
247 THOUSANDS_SEP,
248 #define THOUSANDS_SEP THOUSANDS_SEP
249 GROUPING,
250 #define GROUPING GROUPING
251 _NL_NUM_LC_NUMERIC,
253 YESEXPR = _NL_ITEM (LC_MESSAGES, 0), /* Regex matching ``yes'' input. */
254 #define YESEXPR YESEXPR
255 NOEXPR, /* Regex matching ``no'' input. */
256 #define NOEXPR NOEXPR
257 YESSTR, /* Output string for ``yes''. */
258 #define YESSTR YESSTR
259 NOSTR, /* Output string for ``no''. */
260 #define NOSTR NOSTR
261 _NL_NUM_LC_MESSAGES,
263 /* This marks the highest value used. */
264 _NL_NUM
265 } nl_item;
268 /* Return the current locale's value for ITEM.
269 If ITEM is invalid, an empty string is returned.
271 The string returned will not change until `setlocale' is called;
272 it is usually in read-only memory and cannot be modified. */
274 extern char *nl_langinfo __P ((nl_item __item));
277 __END_DECLS
279 #endif /* langinfo.h */