1 /* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
19 /* Locale-specific information. */
23 #define _LOCALEINFO_H 1
26 #define __need_wchar_t
31 /* Change these if the `wchar_t' type is changed. */
32 #define WCHAR_MAX ((wchar_t) UCHAR_MAX)
35 /* Used by multibyte char functions. */
38 char *string; /* Bytes. */
39 size_t len; /* # of bytes. */
40 long int shift; /* # of mb_char's to shift. */
43 struct ctype_mbchar_info
45 size_t mb_max; /* Max MB char length. */
46 mb_char *mb_chars; /* MB chars. */
49 struct ctype_ctype_info
51 unsigned short int *ctype_b; /* Characteristics. */
52 short int *ctype_tolower; /* Case mappings. */
53 short int *ctype_toupper; /* Case mappings. */
58 struct ctype_ctype_info *ctype;
59 struct ctype_mbchar_info *mbchar;
62 extern __const struct ctype_info *_ctype_info;
64 /* These are necessary because they are used in a header file. */
65 extern __const unsigned short int *__ctype_b;
66 extern __const short int *__ctype_tolower;
67 extern __const short int *__ctype_toupper;
70 /* Used by strcoll and strxfrm. */
73 unsigned char *values;
81 literal_value literal;
82 /* %%% This may become a regex_t in the future. */
85 unsigned int regexp:1;
93 unsigned char *values;
94 unsigned char *offsets;
97 extern __const struct collate_info *_collate_info;
100 /* Used by strtod, atof. */
108 extern __const struct numeric_info *_numeric_info;
111 /* Used in the return value of localeconv. */
114 char *int_curr_symbol;
115 char *currency_symbol;
116 char *mon_decimal_point;
117 char *mon_thousands_sep;
121 char int_frac_digits;
131 extern __const struct monetary_info *_monetary_info;
134 /* Used by strftime, asctime. */
137 char *abbrev_wkday[7]; /* Short weekday names. */
138 char *full_wkday[7]; /* Full weekday names. */
139 char *abbrev_month[12]; /* Short month names. */
140 char *full_month[12]; /* Full month names. */
141 char *ampm[2]; /* "AM" and "PM" strings. */
143 char *date_time; /* Appropriate date and time format. */
144 char *date; /* Appropriate date format. */
145 char *time; /* Appropriate time format. */
147 char *ut0; /* Name for GMT. */
148 char *tz; /* Default TZ value. */
151 extern __const struct time_info *_time_info;
155 /* Regexp for affirmative answers. */
158 /* Regexp for negative answers. */
162 extern __const struct response_info *_response_info;
164 /* Locale structure. */
170 unsigned int allocated:1;
173 size_t num_sublocales;
174 struct sub_locale *sublocales;
179 typedef struct sub_locale
181 unsigned int pointer:1;
190 /* This is the magic number that localeinfo object files begin with.
191 In case you're wondering why I chose the value 0x051472CA, it's
192 because I was born on 05-14-72 in Oakland, CA. */
193 #define LIMAGIC 0x051472CA
194 /* This is the magic number that precedes each category-specific section
195 of a localeinfo object file. It's the arbitrary magic number above,
196 but modified by the category so that it's different from the per-file
197 magic number and unique for each category. */
198 #define CATEGORY_MAGIC(x) (LIMAGIC ^ (x))
200 extern __const char *__lidir, *__lidefault;
202 extern locale *__find_locale __P ((int categories, __const char *name));
203 extern locale *__new_locale __P ((locale *));
204 extern locale *__localefile __P ((__const char *file));
205 extern void __free_locale __P ((locale *));
208 #endif /* localeinfo.h */