source: trunk/libs/newlib/src/newlib/libc/include/langinfo.h @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 8.2 KB
Line 
1/*-
2 * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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.
13 *
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
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: src/include/langinfo.h,v 1.5 2002/03/23 17:24:53 imp Exp $
27 */
28
29#ifndef _LANGINFO_H_
30#define _LANGINFO_H_
31
32#include <newlib.h>
33#include <sys/config.h>
34#include <sys/cdefs.h>
35#if __POSIX_VISIBLE >= 200809
36#include <xlocale.h>
37#endif
38
39typedef int nl_item;
40
41enum __nl_item
42{
43  /* POSIX and BSD defined items have to stick to the original values
44     to maintain backward compatibility. */
45  _NL_CTYPE_CODESET_NAME = 0,   /* codeset name */
46#define CODESET _NL_CTYPE_CODESET_NAME
47  D_T_FMT,                      /* string for formatting date and time */
48#define D_T_FMT D_T_FMT
49  D_FMT,                        /* date format string */
50#define D_FMT D_FMT
51  T_FMT,                        /* time format string */
52#define T_FMT T_FMT
53  T_FMT_AMPM,                   /* a.m. or p.m. time formatting string */
54#define T_FMT_AMPM T_FMT_AMPM
55  AM_STR,                       /* Ante Meridian affix */
56#define AM_STR AM_STR
57  PM_STR,                       /* Post Meridian affix */
58#define PM_STR PM_STR
59
60/* week day names */
61  DAY_1,
62#define DAY_1 DAY_1
63  DAY_2,
64#define DAY_2 DAY_2
65  DAY_3,
66#define DAY_3 DAY_3
67  DAY_4,
68#define DAY_4 DAY_4
69  DAY_5,
70#define DAY_5 DAY_5
71  DAY_6,
72#define DAY_6 DAY_6
73  DAY_7,
74#define DAY_7 DAY_7
75
76/* abbreviated week day names */
77  ABDAY_1,
78#define ABDAY_1 ABDAY_1
79  ABDAY_2,
80#define ABDAY_2 ABDAY_2
81  ABDAY_3,
82#define ABDAY_3 ABDAY_3
83  ABDAY_4,
84#define ABDAY_4 ABDAY_4
85  ABDAY_5,
86#define ABDAY_5 ABDAY_5
87  ABDAY_6,
88#define ABDAY_6 ABDAY_6
89  ABDAY_7,
90#define ABDAY_7 ABDAY_7
91
92/* month names */
93  MON_1,
94#define MON_1 MON_1
95  MON_2,
96#define MON_2 MON_2
97  MON_3,
98#define MON_3 MON_3
99  MON_4,
100#define MON_4 MON_4
101  MON_5,
102#define MON_5 MON_5
103  MON_6,
104#define MON_6 MON_6
105  MON_7,
106#define MON_7 MON_7
107  MON_8,
108#define MON_8 MON_8
109  MON_9,
110#define MON_9 MON_9
111  MON_10,
112#define MON_10 MON_10
113  MON_11,
114#define MON_11 MON_11
115  MON_12,
116#define MON_12 MON_12
117
118/* abbreviated month names */
119  ABMON_1,
120#define ABMON_1 ABMON_1
121  ABMON_2,
122#define ABMON_2 ABMON_2
123  ABMON_3,
124#define ABMON_3 ABMON_3
125  ABMON_4,
126#define ABMON_4 ABMON_4
127  ABMON_5,
128#define ABMON_5 ABMON_5
129  ABMON_6,
130#define ABMON_6 ABMON_6
131  ABMON_7,
132#define ABMON_7 ABMON_7
133  ABMON_8,
134#define ABMON_8 ABMON_8
135  ABMON_9,
136#define ABMON_9 ABMON_9
137  ABMON_10,
138#define ABMON_10 ABMON_10
139  ABMON_11,
140#define ABMON_11 ABMON_11
141  ABMON_12,
142#define ABMON_12 ABMON_12
143
144  ERA,                          /* era description segments */
145#define ERA ERA
146  ERA_D_FMT,                    /* era date format string */
147#define ERA_D_FMT ERA_D_FMT
148  ERA_D_T_FMT,                  /* era date and time format string */
149#define ERA_D_T_FMT ERA_D_T_FMT
150  ERA_T_FMT,                    /* era time format string */
151#define ERA_T_FMT ERA_T_FMT
152  ALT_DIGITS,                   /* alternative symbols for digits */
153#define ALT_DIGITS ALT_DIGITS
154
155  RADIXCHAR,                    /* radix char */
156#define RADIXCHAR RADIXCHAR
157  THOUSEP,                      /* separator for thousands */
158#define THOUSEP THOUSEP
159
160  YESEXPR,                      /* affirmative response expression */
161#define YESEXPR YESEXPR
162  NOEXPR,                       /* negative response expression */
163#define NOEXPR NOEXPR
164  YESSTR,                       /* affirmative response for yes/no queries */
165#define YESSTR YESSTR
166  NOSTR,                        /* negative response for yes/no queries */
167#define NOSTR NOSTR
168
169  CRNCYSTR,                     /* currency symbol */
170#define CRNCYSTR CRNCYSTR
171
172  D_MD_ORDER,                   /* month/day order (BSD extension) */
173#define D_MD_ORDER D_MD_ORDER
174
175  _NL_TIME_DATE_FMT = 84,       /* date fmt used by date(1) (GNU extension) */
176#define _DATE_FMT _NL_TIME_DATE_FMT
177
178#ifdef __HAVE_LOCALE_INFO__
179  _NL_CTYPE_MB_CUR_MAX,
180  _NL_MESSAGES_CODESET,
181
182#ifdef __HAVE_LOCALE_INFO_EXTENDED__
183
184  /* NOTE:
185 
186     Always maintain the order and position of existing entries!
187     Always append new entry to the list, prior to the definition
188     of _NL_LOCALE_EXTENDED_LAST_ENTRY. */
189
190  _NL_LOCALE_EXTENDED_FIRST_ENTRY,
191
192  _NL_CTYPE_OUTDIGITS0_MB,
193  _NL_CTYPE_OUTDIGITS1_MB,
194  _NL_CTYPE_OUTDIGITS2_MB,
195  _NL_CTYPE_OUTDIGITS3_MB,
196  _NL_CTYPE_OUTDIGITS4_MB,
197  _NL_CTYPE_OUTDIGITS5_MB,
198  _NL_CTYPE_OUTDIGITS6_MB,
199  _NL_CTYPE_OUTDIGITS7_MB,
200  _NL_CTYPE_OUTDIGITS8_MB,
201  _NL_CTYPE_OUTDIGITS9_MB,
202  _NL_CTYPE_OUTDIGITS0_WC,
203  _NL_CTYPE_OUTDIGITS1_WC,
204  _NL_CTYPE_OUTDIGITS2_WC,
205  _NL_CTYPE_OUTDIGITS3_WC,
206  _NL_CTYPE_OUTDIGITS4_WC,
207  _NL_CTYPE_OUTDIGITS5_WC,
208  _NL_CTYPE_OUTDIGITS6_WC,
209  _NL_CTYPE_OUTDIGITS7_WC,
210  _NL_CTYPE_OUTDIGITS8_WC,
211  _NL_CTYPE_OUTDIGITS9_WC,
212
213  _NL_TIME_CODESET,
214  _NL_TIME_WMON_1,
215  _NL_TIME_WMON_2,
216  _NL_TIME_WMON_3,
217  _NL_TIME_WMON_4,
218  _NL_TIME_WMON_5,
219  _NL_TIME_WMON_6,
220  _NL_TIME_WMON_7,
221  _NL_TIME_WMON_8,
222  _NL_TIME_WMON_9,
223  _NL_TIME_WMON_10,
224  _NL_TIME_WMON_11,
225  _NL_TIME_WMON_12,
226  _NL_TIME_WMONTH_1,
227  _NL_TIME_WMONTH_2,
228  _NL_TIME_WMONTH_3,
229  _NL_TIME_WMONTH_4,
230  _NL_TIME_WMONTH_5,
231  _NL_TIME_WMONTH_6,
232  _NL_TIME_WMONTH_7,
233  _NL_TIME_WMONTH_8,
234  _NL_TIME_WMONTH_9,
235  _NL_TIME_WMONTH_10,
236  _NL_TIME_WMONTH_11,
237  _NL_TIME_WMONTH_12,
238  _NL_TIME_WWDAY_1,
239  _NL_TIME_WWDAY_2,
240  _NL_TIME_WWDAY_3,
241  _NL_TIME_WWDAY_4,
242  _NL_TIME_WWDAY_5,
243  _NL_TIME_WWDAY_6,
244  _NL_TIME_WWDAY_7,
245  _NL_TIME_WWEEKDAY_1,
246  _NL_TIME_WWEEKDAY_2,
247  _NL_TIME_WWEEKDAY_3,
248  _NL_TIME_WWEEKDAY_4,
249  _NL_TIME_WWEEKDAY_5,
250  _NL_TIME_WWEEKDAY_6,
251  _NL_TIME_WWEEKDAY_7,
252  _NL_TIME_WT_FMT,
253  _NL_TIME_WD_FMT,
254  _NL_TIME_WD_T_FMT,
255  _NL_TIME_WAM_STR,
256  _NL_TIME_WPM_STR,
257  _NL_TIME_WDATE_FMT,
258  _NL_TIME_WT_FMT_AMPM,
259  _NL_TIME_WERA,
260  _NL_TIME_WERA_D_FMT,
261  _NL_TIME_WERA_D_T_FMT,
262  _NL_TIME_WERA_T_FMT,
263  _NL_TIME_WALT_DIGITS,
264
265  _NL_NUMERIC_CODESET,
266  _NL_NUMERIC_GROUPING,
267  _NL_NUMERIC_DECIMAL_POINT_WC,
268  _NL_NUMERIC_THOUSANDS_SEP_WC,
269
270  _NL_MONETARY_INT_CURR_SYMBOL,
271  _NL_MONETARY_CURRENCY_SYMBOL,
272  _NL_MONETARY_MON_DECIMAL_POINT,
273  _NL_MONETARY_MON_THOUSANDS_SEP,
274  _NL_MONETARY_MON_GROUPING,
275  _NL_MONETARY_POSITIVE_SIGN,
276  _NL_MONETARY_NEGATIVE_SIGN,
277  _NL_MONETARY_INT_FRAC_DIGITS,
278  _NL_MONETARY_FRAC_DIGITS,
279  _NL_MONETARY_P_CS_PRECEDES,
280  _NL_MONETARY_P_SEP_BY_SPACE,
281  _NL_MONETARY_N_CS_PRECEDES,
282  _NL_MONETARY_N_SEP_BY_SPACE,
283  _NL_MONETARY_P_SIGN_POSN,
284  _NL_MONETARY_N_SIGN_POSN,
285  _NL_MONETARY_INT_P_CS_PRECEDES,
286  _NL_MONETARY_INT_P_SEP_BY_SPACE,
287  _NL_MONETARY_INT_N_CS_PRECEDES,
288  _NL_MONETARY_INT_N_SEP_BY_SPACE,
289  _NL_MONETARY_INT_P_SIGN_POSN,
290  _NL_MONETARY_INT_N_SIGN_POSN,
291  _NL_MONETARY_CODESET,
292  _NL_MONETARY_WINT_CURR_SYMBOL,
293  _NL_MONETARY_WCURRENCY_SYMBOL,
294  _NL_MONETARY_WMON_DECIMAL_POINT,
295  _NL_MONETARY_WMON_THOUSANDS_SEP,
296  _NL_MONETARY_WPOSITIVE_SIGN,
297  _NL_MONETARY_WNEGATIVE_SIGN,
298
299  _NL_MESSAGES_WYESEXPR,
300  _NL_MESSAGES_WNOEXPR,
301  _NL_MESSAGES_WYESSTR,
302  _NL_MESSAGES_WNOSTR,
303
304  _NL_COLLATE_CODESET,
305
306  /* This MUST be the last entry since it's used to check for an array
307     index in nl_langinfo(). It also must not exceed _NL_LOCALE_NAME_BASE. */
308  _NL_LOCALE_EXTENDED_LAST_ENTRY
309
310#endif /* __HAVE_LOCALE_INFO_EXTENDED__ */
311#endif /* __HAVE_LOCALE_INFO__ */
312
313};
314
315/* As an extension, nl_langinfo can retrive the name of a locale
316   category, with this mapping from setlocale() category (other than
317   LC_ALL) to nl_item. */
318#define _NL_LOCALE_NAME_BASE 100000
319#if __GNU_VISIBLE
320#define NL_LOCALE_NAME(category) (_NL_LOCALE_NAME_BASE + (category))
321#endif
322
323__BEGIN_DECLS
324char    *nl_langinfo (nl_item);
325#if __POSIX_VISIBLE >= 200809
326char    *nl_langinfo_l (nl_item, locale_t);
327#endif
328__END_DECLS
329
330#endif /* !_LANGINFO_H_ */
Note: See TracBrowser for help on using the repository browser.