2 * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * $FreeBSD: src/include/langinfo.h,v 1.5 2002/03/23 17:24:53 imp Exp $
32 #include <sys/cdefs.h>
33 #include <sys/_types.h>
34 #if __POSIX_VISIBLE >= 200809
35 #include <sys/_locale.h>
38 #ifndef _NL_ITEM_DECLARED
39 typedef __nl_item nl_item
;
40 #define _NL_ITEM_DECLARED
45 /* POSIX and BSD defined items have to stick to the original values
46 to maintain backward compatibility. */
47 _NL_CTYPE_CODESET_NAME
= 0, /* codeset name */
48 #define CODESET _NL_CTYPE_CODESET_NAME
49 D_T_FMT
, /* string for formatting date and time */
50 #define D_T_FMT D_T_FMT
51 D_FMT
, /* date format string */
53 T_FMT
, /* time format string */
55 T_FMT_AMPM
, /* a.m. or p.m. time formatting string */
56 #define T_FMT_AMPM T_FMT_AMPM
57 AM_STR
, /* Ante Meridian affix */
59 PM_STR
, /* Post Meridian affix */
78 /* abbreviated week day names */
80 #define ABDAY_1 ABDAY_1
82 #define ABDAY_2 ABDAY_2
84 #define ABDAY_3 ABDAY_3
86 #define ABDAY_4 ABDAY_4
88 #define ABDAY_5 ABDAY_5
90 #define ABDAY_6 ABDAY_6
92 #define ABDAY_7 ABDAY_7
114 #define MON_10 MON_10
116 #define MON_11 MON_11
118 #define MON_12 MON_12
120 /* abbreviated month names */
122 #define ABMON_1 ABMON_1
124 #define ABMON_2 ABMON_2
126 #define ABMON_3 ABMON_3
128 #define ABMON_4 ABMON_4
130 #define ABMON_5 ABMON_5
132 #define ABMON_6 ABMON_6
134 #define ABMON_7 ABMON_7
136 #define ABMON_8 ABMON_8
138 #define ABMON_9 ABMON_9
140 #define ABMON_10 ABMON_10
142 #define ABMON_11 ABMON_11
144 #define ABMON_12 ABMON_12
146 ERA
, /* era description segments */
148 ERA_D_FMT
, /* era date format string */
149 #define ERA_D_FMT ERA_D_FMT
150 ERA_D_T_FMT
, /* era date and time format string */
151 #define ERA_D_T_FMT ERA_D_T_FMT
152 ERA_T_FMT
, /* era time format string */
153 #define ERA_T_FMT ERA_T_FMT
154 ALT_DIGITS
, /* alternative symbols for digits */
155 #define ALT_DIGITS ALT_DIGITS
157 RADIXCHAR
, /* radix char */
158 #define RADIXCHAR RADIXCHAR
159 THOUSEP
, /* separator for thousands */
160 #define THOUSEP THOUSEP
162 YESEXPR
, /* affirmative response expression */
163 #define YESEXPR YESEXPR
164 NOEXPR
, /* negative response expression */
165 #define NOEXPR NOEXPR
166 YESSTR
, /* affirmative response for yes/no queries */
167 #define YESSTR YESSTR
168 NOSTR
, /* negative response for yes/no queries */
171 CRNCYSTR
, /* currency symbol */
172 #define CRNCYSTR CRNCYSTR
174 D_MD_ORDER
, /* month/day order (BSD extension) */
175 #define D_MD_ORDER D_MD_ORDER
177 _NL_TIME_DATE_FMT
= 84, /* date fmt used by date(1) (GNU extension) */
178 #define _DATE_FMT _NL_TIME_DATE_FMT
180 #ifdef __HAVE_LOCALE_INFO__
181 _NL_CTYPE_MB_CUR_MAX
,
182 _NL_MESSAGES_CODESET
,
184 #ifdef __HAVE_LOCALE_INFO_EXTENDED__
188 Always maintain the order and position of existing entries!
189 Always append new entry to the list, prior to the definition
190 of _NL_LOCALE_EXTENDED_LAST_ENTRY. */
192 _NL_LOCALE_EXTENDED_FIRST_ENTRY
,
194 _NL_CTYPE_OUTDIGIT0_MB
,
195 _NL_CTYPE_OUTDIGIT1_MB
,
196 _NL_CTYPE_OUTDIGIT2_MB
,
197 _NL_CTYPE_OUTDIGIT3_MB
,
198 _NL_CTYPE_OUTDIGIT4_MB
,
199 _NL_CTYPE_OUTDIGIT5_MB
,
200 _NL_CTYPE_OUTDIGIT6_MB
,
201 _NL_CTYPE_OUTDIGIT7_MB
,
202 _NL_CTYPE_OUTDIGIT8_MB
,
203 _NL_CTYPE_OUTDIGIT9_MB
,
204 _NL_CTYPE_OUTDIGIT0_WC
,
205 _NL_CTYPE_OUTDIGIT1_WC
,
206 _NL_CTYPE_OUTDIGIT2_WC
,
207 _NL_CTYPE_OUTDIGIT3_WC
,
208 _NL_CTYPE_OUTDIGIT4_WC
,
209 _NL_CTYPE_OUTDIGIT5_WC
,
210 _NL_CTYPE_OUTDIGIT6_WC
,
211 _NL_CTYPE_OUTDIGIT7_WC
,
212 _NL_CTYPE_OUTDIGIT8_WC
,
213 _NL_CTYPE_OUTDIGIT9_WC
,
260 _NL_TIME_WT_FMT_AMPM
,
263 _NL_TIME_WERA_D_T_FMT
,
265 _NL_TIME_WALT_DIGITS
,
268 _NL_NUMERIC_GROUPING
,
269 _NL_NUMERIC_DECIMAL_POINT_WC
,
270 _NL_NUMERIC_THOUSANDS_SEP_WC
,
272 _NL_MONETARY_INT_CURR_SYMBOL
,
273 _NL_MONETARY_CURRENCY_SYMBOL
,
274 _NL_MONETARY_MON_DECIMAL_POINT
,
275 _NL_MONETARY_MON_THOUSANDS_SEP
,
276 _NL_MONETARY_MON_GROUPING
,
277 _NL_MONETARY_POSITIVE_SIGN
,
278 _NL_MONETARY_NEGATIVE_SIGN
,
279 _NL_MONETARY_INT_FRAC_DIGITS
,
280 _NL_MONETARY_FRAC_DIGITS
,
281 _NL_MONETARY_P_CS_PRECEDES
,
282 _NL_MONETARY_P_SEP_BY_SPACE
,
283 _NL_MONETARY_N_CS_PRECEDES
,
284 _NL_MONETARY_N_SEP_BY_SPACE
,
285 _NL_MONETARY_P_SIGN_POSN
,
286 _NL_MONETARY_N_SIGN_POSN
,
287 _NL_MONETARY_INT_P_CS_PRECEDES
,
288 _NL_MONETARY_INT_P_SEP_BY_SPACE
,
289 _NL_MONETARY_INT_N_CS_PRECEDES
,
290 _NL_MONETARY_INT_N_SEP_BY_SPACE
,
291 _NL_MONETARY_INT_P_SIGN_POSN
,
292 _NL_MONETARY_INT_N_SIGN_POSN
,
293 _NL_MONETARY_CODESET
,
294 _NL_MONETARY_WINT_CURR_SYMBOL
,
295 _NL_MONETARY_WCURRENCY_SYMBOL
,
296 _NL_MONETARY_WMON_DECIMAL_POINT
,
297 _NL_MONETARY_WMON_THOUSANDS_SEP
,
298 _NL_MONETARY_WPOSITIVE_SIGN
,
299 _NL_MONETARY_WNEGATIVE_SIGN
,
301 _NL_MESSAGES_WYESEXPR
,
302 _NL_MESSAGES_WNOEXPR
,
303 _NL_MESSAGES_WYESSTR
,
308 /* This MUST be the last entry since it's used to check for an array
309 index in nl_langinfo(). It also must not exceed _NL_LOCALE_NAME_BASE. */
310 _NL_LOCALE_EXTENDED_LAST_ENTRY
312 #endif /* __HAVE_LOCALE_INFO_EXTENDED__ */
313 #endif /* __HAVE_LOCALE_INFO__ */
317 /* As an extension, nl_langinfo can retrive the name of a locale
318 category, with this mapping from setlocale() category (other than
319 LC_ALL) to nl_item. */
320 #define _NL_LOCALE_NAME_BASE 100000
322 #define NL_LOCALE_NAME(category) (_NL_LOCALE_NAME_BASE + (category))
326 char *nl_langinfo (nl_item
);
327 #if __POSIX_VISIBLE >= 200809
328 char *nl_langinfo_l (nl_item
, locale_t
);
332 #endif /* !_LANGINFO_H_ */