2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: Setlocale.h /main/3 1995/10/26 15:27:34 rswiston $ */
25 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
26 * (c) Copyright 1993, 1994 International Business Machines Corp. *
27 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
28 * (c) Copyright 1993, 1994 Novell, Inc. *
30 /* Hp DT's version of an 8.0 include file; needed for Fnmatch */
32 #ifndef DtSETLOCALE_INCLUDED /* allow multiple inclusions */
33 #define DtSETLOCALE_INCLUDED
35 #ifdef _NAMESPACE_CLEAN
36 #define _1kanji __1kanji
37 #define _2kanji __2kanji
38 #define _downshift __downshift
39 #define _upshift __upshift
40 #endif /* _NAMESPACE_CLEAN */
46 #include <Dt/Collate.h>
58 typedef int nl_outdgt;
61 #define MAXLNAMELEN 14
65 struct _era_data { /* defines an Emperor/Era time period */
66 short start_year; /* starting date of era */
67 unsigned short start_month;
68 unsigned short start_day;
69 short end_year; /* ending date of era */
70 unsigned short end_month;
71 unsigned short end_day;
72 short origin_year; /* time axis origin for era (one of start_year or end_year) */
73 short offset; /* offset from 0 for 1st year of era */
74 short signflag; /* adjusts sign of (year - origin_year) value */
75 unsigned short reserved;
76 unsigned char *name; /* name of era */
77 unsigned char *format; /* instead of nl_langinfo(ERA_FMT) */
80 extern int __nl_langid[]; /* langid of currently loaded language */
81 extern unsigned char *__ctype; /* pointer to ctype table */
82 extern unsigned char *_1kanji; /* pointer to 1st of 2 kanji table */
83 extern unsigned char *_2kanji; /* pointer to 2nd of 2 kanji table */
84 extern unsigned char *_upshift; /* pointer to up shift table */
85 extern unsigned char *_downshift; /* pointer to down shift table */
87 extern unsigned char *__e_cset; /* pointer to expanded char set table */
88 extern unsigned char *__ein_csize; /* pointer to expanded in_csize table */
89 extern unsigned char *__eout_csize; /* pointer to expanded out_csize table*/
91 extern struct _era_data *_nl_era[]; /* array of era info str pointer */
92 extern int _nl_radix; /* radix character */
93 extern int _sh_low; /* lowest char in shift table domain */
94 extern int _sh_high; /* highest char in shift table domain */
95 extern int __nl_char_size; /* size of characters */
97 extern int __nl_code_scheme;/* flag for char code scheme */
98 extern int __cs_SBYTE; /* flag for 1 byte char code scheme */
99 extern int __cs_HP15; /* flag for HP15 char code scheme */
100 extern int __cs_EUC; /* flag for EUC char code scheme */
101 extern unsigned char __in_csize[]; /* input char size */
102 extern unsigned char __out_csize[]; /* output char size */
103 extern unsigned int __euc_template[]; /* euc process code template */
105 extern nl_direct _nl_direct; /* direction flag */
106 extern int _nl_context; /* directionality context flag */
107 extern nl_order _nl_order; /* order flag */
108 extern nl_mode _nl_mode; /* mode flag; Latin or non-Latin */
109 extern nl_outdgt _nl_outdigit; /* digit output : ascii or alt digit */
111 extern int _nl_space_alt; /* value of alternative space */
112 extern unsigned char *_nl_dgt_alt; /* buffer for alt digit string */
113 extern unsigned char *_nl_punct_alt; /* buffer for alt punctuation string */
114 extern unsigned char *_nl_pascii; /* buffer for ascii punctuation string */
115 extern unsigned char *_nl_dascii; /* buffer for ascii digits string */
116 extern int _nl_map21; /* non-zero if 2-to-1 mappings */
117 extern int _nl_onlyseq; /* true if only 1-to-1 char w no pri */
118 extern int _nl_collate_on; /* true if collation table loaded */
119 extern int _nl_mb_collate; /* true if collation is multibyte */
121 extern unsigned char *_seqtab; /* dictionary sequence number table */
122 extern unsigned char *_pritab; /* 1to2/2to1 flag + priority table */
123 extern struct col_21tab *_tab21; /* 2-to-1 mapping table */
124 extern struct col_12tab *_tab12; /* 1-to-2 mapping table */
126 extern unsigned char *__errptr; /* pointer to an area _errlocale() can use as a buffer */
128 extern struct lconv *_lconv;
129 extern unsigned char *__category_name[];
131 extern unsigned char **__nl_info; /* pointers to locale langinfo strings */
132 extern unsigned char *__C_langinfo[];/* default langinfo strings for the C locale */
133 #define _NL_MAX_MSG ERA_FMT /* last nl_langinfo item */
135 /***************************************************************************
137 The remainder of this file includes structures for the language files.
138 The files are built by buildlang(1M).
140 The structure of the files is as follows :
142 ----------------------------------
144 ----------------------------------
145 | Category/Modifier Structures(B)|
146 ==================================
147 | LC_ALL Table Header (C) |
150 ----------------------------------
151 | LC_COLLATE Table Header (D) |
154 ----------------------------------
155 | LC_CTYPE Table Header (E) |
158 ----------------------------------
159 | LC_MONETARY Table Header (F)
162 ----------------------------------
163 | LC_NUMERIC Table Header (G) |
166 ----------------------------------
167 | LC_TIME Table Header (H) |
170 ----------------------------------
172 *****************************************************************************/
178 /* Table Header (A) */
180 struct table_header {
181 unsigned int size; /* size of table header and category
182 structure. (A) + (B) */
183 unsigned short nl_langid; /* _nl_langid */
184 unsigned char lang[3*MAXLNAMELEN+2+1]; /* language name */
185 unsigned short cat_no; /* number of categories defined */
186 unsigned short mod_no; /* number of modifiers defined */
187 unsigned short rev_flag; /* true if HP defined */
188 unsigned char rev_str[36]; /* Revision String */
189 unsigned short codeset; /* 0 if 1 byte, 1 if 2 byte */
190 unsigned int reserved1;
191 unsigned int reserved2;
192 unsigned int reserved3;
195 /* Category/Modifier Structure (B)
197 Catinfotype structure describes a category/modifier table
198 There is one structure for each category and modifier defined.
199 These entries follow the table header */
204 int size; /* size of category table */
205 int address; /* address of category table -
206 offset from the beginning of
207 the category tables () */
208 short catid; /* category id */
209 unsigned char mod_name[MAXLNAMELEN+1]; /* name of modifier */
210 short mod_addr; /* address of category table
211 for modifier - offset from
216 /* Below are the category headers for each of the defined categories
217 All addresses are offset from the beginning of the category information */
219 /* LC_ALL Table (C) */
222 unsigned short yes_addr; /* msg_index[YESSTR] */
223 unsigned short no_addr; /* msg_index[NOSTR] */
224 unsigned short direct_addr; /* msg_index[DIRECTION] */
226 unsigned short context_addr; /* _nl_context */
229 /* LC_COLLATE Tables (D) */
232 unsigned int seqtab_addr; /* _seqtab */
233 unsigned int pritab_addr; /* _pritab */
234 unsigned short nl_map21; /* not an address */
235 unsigned short nl_onlyseq; /* not an address */
236 unsigned int tab21_addr;
237 unsigned int tab12_addr;
241 /* LC_CTYPE Tables (E) */
243 struct ctype_header {
244 unsigned int _sh_high; /* _sh_high */
245 int _sh_low; /* _sh_low */
246 unsigned int _ctype_addr; /* __ctype */
247 unsigned int kanji1_addr; /* _1kanji */
248 unsigned int kanji2_addr; /* _2kanji */
249 unsigned int upshift_addr; /* _upshift */
250 unsigned int downshift_addr; /* _downshift */
251 unsigned short byte_char_addr; /* msg_index[BYTES_CHAR] */
252 unsigned short alt_punct_addr; /* msg_index[ALT_PUNCT] */
253 /* _nl_punct_alt[] */
256 unsigned int io_csize_addr; /* __io_csize[] */
257 unsigned int e_cset_addr; /* __e_cset */
258 unsigned int ein_csize_addr; /* __ein_csize */
259 unsigned int eout_csize_addr; /* __eout_csize */
265 /* LC_MONETARY Tables (F) */
268 struct monetary_header {
269 unsigned short int_frac_digits; /* _lconv->short_frac_digits */
270 unsigned short frac_digits; /* _lconv->frac_digits */
271 unsigned short p_cs_precedes; /* _lconv->p_cs_precedes */
272 unsigned short p_sep_by_space; /* _lconv->p_sep_by_space */
273 unsigned short n_cs_precedes; /* _lconv->n_cs_precedes */
274 unsigned short n_sep_by_space; /* _lconv->n_sep_by_space */
275 unsigned short p_sign_posn; /* _lconv->p_sign_posn */
276 unsigned short n_sign_posn; /* _lconv->n_sign_posn */
277 unsigned short curr_symbol_lconv; /* _lconv->currency_symbol */
278 unsigned short curr_symbol_li; /* msg_index[CRNCYSTR] */
279 unsigned short mon_decimal_point; /* _lconv->mon_decimal_point */
280 unsigned short int_curr_symbol; /* _lconv->short_curr_symbol */
281 unsigned short mon_thousands_sep; /* _lconv->mon_thousands_sep */
282 unsigned short mon_grouping; /* _lconv->mon_grouping */
283 unsigned short positive_sign; /* _lconv->positive_sign */
284 unsigned short negative_sign; /* _lconv->negative_sign */
289 /* LC_NUMERIC Tables (G) */
292 struct numeric_header {
293 unsigned short grouping; /* _lconv->grouping */
294 unsigned short decimal_point; /* _lconv->decimal_point */
295 /* msg_index[RADIXCHAR] */
297 unsigned short thousands_sep; /* _lconv->thousands_sep */
298 /* msg_index[THOUSEP] */
299 unsigned short alt_digit_addr; /* msg_index[ALT_DIGIT] */
304 /* LC_TIME Tables (H) */
307 unsigned short d_t_fmt; /* msg_index[D_T_FMT] */
308 unsigned short d_fmt; /* msg_index[D_FMT] */
309 unsigned short t_fmt; /* msg_index[T_FMT] */
310 unsigned short day_1; /* msg_index[DAY_1] */
311 unsigned short day_2; /* msg_index[DAY_2] */
312 unsigned short day_3; /* msg_index[DAY_3] */
313 unsigned short day_4; /* msg_index[DAY_4] */
314 unsigned short day_5; /* msg_index[DAY_5] */
315 unsigned short day_6; /* msg_index[DAY_6] */
316 unsigned short day_7; /* msg_index[DAY_7] */
317 unsigned short abday_1; /* msg_index[ABDAY_1] */
318 unsigned short abday_2; /* msg_index[ABDAY_2] */
319 unsigned short abday_3; /* msg_index[ABDAY_3] */
320 unsigned short abday_4; /* msg_index[ABDAY_4] */
321 unsigned short abday_5; /* msg_index[ABDAY_5] */
322 unsigned short abday_6; /* msg_index[ABDAY_6] */
323 unsigned short abday_7; /* msg_index[ABDAY_7] */
324 unsigned short mon_1; /* msg_index[MON_1] */
325 unsigned short mon_2; /* msg_index[MON_2] */
326 unsigned short mon_3; /* msg_index[MON_3] */
327 unsigned short mon_4; /* msg_index[MON_4] */
328 unsigned short mon_5; /* msg_index[MON_5] */
329 unsigned short mon_6; /* msg_index[MON_6] */
330 unsigned short mon_7; /* msg_index[MON_7] */
331 unsigned short mon_8; /* msg_index[MON_8] */
332 unsigned short mon_9; /* msg_index[MON_9] */
333 unsigned short mon_10; /* msg_index[MON_10] */
334 unsigned short mon_11; /* msg_index[MON_11] */
335 unsigned short mon_12; /* msg_index[MON_12] */
336 unsigned short abmon_1; /* msg_index[ABMON_1] */
337 unsigned short abmon_2; /* msg_index[ABMON_2] */
338 unsigned short abmon_3; /* msg_index[ABMON_3] */
339 unsigned short abmon_4; /* msg_index[ABMON_4] */
340 unsigned short abmon_5; /* msg_index[ABMON_5] */
341 unsigned short abmon_6; /* msg_index[ABMON_6] */
342 unsigned short abmon_7; /* msg_index[ABMON_7] */
343 unsigned short abmon_8; /* msg_index[ABMON_8] */
344 unsigned short abmon_9; /* msg_index[ABMON_9] */
345 unsigned short abmon_10; /* msg_index[ABMON_10] */
346 unsigned short abmon_11; /* msg_index[ABMON_11] */
347 unsigned short abmon_12; /* msg_index[ABMON_12] */
348 unsigned short am_str; /* msg_index[AM_STR] */
349 unsigned short pm_str; /* msg_index[PM_STR] */
350 unsigned short year_unit; /* msg_index[YEAR_UNIT] */
351 unsigned short mon_unit; /* msg_index[MON_UNIT] */
352 unsigned short day_unit; /* msg_index[DAY_UNIT] */
353 unsigned short hour_unit; /* msg_index[HOUR_UNIT] */
354 unsigned short min_unit; /* msg_index[MIN_UNIT] */
355 unsigned short sec_unit; /* msg_index[SEC_UNIT] */
356 unsigned short era_fmt; /* msg_index[ERA_FMT] */
357 unsigned short era_count; /* number of era entries */
358 unsigned short era_names; /* address of era name and format strings */
359 unsigned short era_addr; /* address of era data structure entries */
360 unsigned short reserved; /* address of era data structure entries */
363 #endif /* DtSETLOCALE_INCLUDED */