xref: /haiku/src/system/libroot/posix/locale/LocaleData.cpp (revision 6a5dacaa3c151047c5854f769e763deef31753ea)
1a3f66598SOliver Tappe /*
2a3f66598SOliver Tappe  * Copyright 2010, Oliver Tappe, zooey@hirschkaefer.de.
3a3f66598SOliver Tappe  * Distributed under the terms of the MIT License.
4a3f66598SOliver Tappe  */
5a3f66598SOliver Tappe 
6a3f66598SOliver Tappe 
7a3f66598SOliver Tappe #include <ctype.h>
8a3f66598SOliver Tappe #include <limits.h>
9a3f66598SOliver Tappe 
10a3f66598SOliver Tappe #include <PosixCtype.h>
11a3f66598SOliver Tappe #include <PosixLocaleConv.h>
12a3f66598SOliver Tappe 
13a3f66598SOliver Tappe #ifndef _KERNEL_MODE
14a3f66598SOliver Tappe #include <langinfo.h>
15a3f66598SOliver Tappe #include <PosixLanginfo.h>
16a3f66598SOliver Tappe #include <PosixLCTimeInfo.h>
17a3f66598SOliver Tappe #endif
18a3f66598SOliver Tappe 
19a3f66598SOliver Tappe 
20a3f66598SOliver Tappe /*
21a3f66598SOliver Tappe  * The values below initialize the structs for the "C"/"POSIX" locale
22a3f66598SOliver Tappe  * which is the default locale (and the only one supported without any locale
23a3f66598SOliver Tappe  * backend).
24a3f66598SOliver Tappe  */
25a3f66598SOliver Tappe 
26a3f66598SOliver Tappe 
27a3f66598SOliver Tappe namespace BPrivate {
28a3f66598SOliver Tappe 
29a3f66598SOliver Tappe 
30a4823efdSOliver Tappe /*
31*6a5dacaaSOliver Tappe  * The following arrays have 384 elements where the elements at index -128..-2
32*6a5dacaaSOliver Tappe  * mirror the elements at index 128..255 (to protect against invocations of
33*6a5dacaaSOliver Tappe  * ctype macros with negative character values).
34*6a5dacaaSOliver Tappe  * The element at index -1 is a dummy element containing the neutral/identity
35*6a5dacaaSOliver Tappe  * value used when the array is accessed as in 'isblank(EOF)' (i.e. with
36*6a5dacaaSOliver Tappe  * index -1).
37a4823efdSOliver Tappe  */
38*6a5dacaaSOliver Tappe const unsigned short gPosixClassInfo[384] = {
39*6a5dacaaSOliver Tappe 	/*-128 */	0, 0, 0, 0, 0, 0, 0, 0,
40*6a5dacaaSOliver Tappe 	/*-120 */	0, 0, 0, 0, 0, 0, 0, 0,
41*6a5dacaaSOliver Tappe 	/*-112 */	0, 0, 0, 0, 0, 0, 0, 0,
42*6a5dacaaSOliver Tappe 	/*-104 */	0, 0, 0, 0, 0, 0, 0, 0,
43*6a5dacaaSOliver Tappe 	/* -96 */	0, 0, 0, 0, 0, 0, 0, 0,
44*6a5dacaaSOliver Tappe 	/* -88 */	0, 0, 0, 0, 0, 0, 0, 0,
45*6a5dacaaSOliver Tappe 	/* -80 */	0, 0, 0, 0, 0, 0, 0, 0,
46*6a5dacaaSOliver Tappe 	/* -72 */	0, 0, 0, 0, 0, 0, 0, 0,
47*6a5dacaaSOliver Tappe 	/* -64 */	0, 0, 0, 0, 0, 0, 0, 0,
48*6a5dacaaSOliver Tappe 	/* -56 */	0, 0, 0, 0, 0, 0, 0, 0,
49*6a5dacaaSOliver Tappe 	/* -48 */	0, 0, 0, 0, 0, 0, 0, 0,
50*6a5dacaaSOliver Tappe 	/* -40 */	0, 0, 0, 0, 0, 0, 0, 0,
51*6a5dacaaSOliver Tappe 	/* -32 */	0, 0, 0, 0, 0, 0, 0, 0,
52*6a5dacaaSOliver Tappe 	/* -24 */	0, 0, 0, 0, 0, 0, 0, 0,
53*6a5dacaaSOliver Tappe 	/* -16 */	0, 0, 0, 0, 0, 0, 0, 0,
54*6a5dacaaSOliver Tappe 	/*  -8 */	0, 0, 0, 0, 0, 0, 0,
55a4823efdSOliver Tappe 	/*  -1 */   0,	// neutral value
56a3f66598SOliver Tappe 	/*   0 */	_IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl,
57a3f66598SOliver Tappe 	/*   8 */	_IScntrl, _ISblank|_IScntrl|_ISspace, _IScntrl|_ISspace, _IScntrl|_ISspace, _IScntrl|_ISspace, _IScntrl|_ISspace, _IScntrl, _IScntrl,
58a3f66598SOliver Tappe 	/*  16 */	_IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl,
59a3f66598SOliver Tappe 	/*  24 */	_IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl, _IScntrl,
60a3f66598SOliver Tappe 	/*  32 */	_ISblank|_ISspace|_ISprint, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph,
61a3f66598SOliver Tappe 	/*  40 */	_ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph,
62a3f66598SOliver Tappe 	/*  48 */	_ISalnum|_ISdigit|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISdigit|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISdigit|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISdigit|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISdigit|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISdigit|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISdigit|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISdigit|_ISxdigit|_ISprint|_ISgraph,
63a3f66598SOliver Tappe 	/*  56 */	_ISalnum|_ISdigit|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISdigit|_ISxdigit|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph,
64a3f66598SOliver Tappe 	/*  64 */	_ISpunct|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph,
65a3f66598SOliver Tappe 	/*  72 */	_ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph,
66a3f66598SOliver Tappe 	/*  80 */	_ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph,
67a3f66598SOliver Tappe 	/*  88 */	_ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISupper|_ISalpha|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph,
68a3f66598SOliver Tappe 	/*  96 */	_ISpunct|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISxdigit|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph,
69a3f66598SOliver Tappe 	/* 104 */	_ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph,
70a3f66598SOliver Tappe 	/* 112 */	_ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph,
71a3f66598SOliver Tappe 	/* 120 */	_ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISalnum|_ISlower|_ISalpha|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _ISpunct|_ISprint|_ISgraph, _IScntrl,
72a3f66598SOliver Tappe 	/* 128 */	0, 0, 0, 0, 0, 0, 0, 0,
73a3f66598SOliver Tappe 	/* 136 */	0, 0, 0, 0, 0, 0, 0, 0,
74a3f66598SOliver Tappe 	/* 144 */	0, 0, 0, 0, 0, 0, 0, 0,
75a3f66598SOliver Tappe 	/* 152 */	0, 0, 0, 0, 0, 0, 0, 0,
76a3f66598SOliver Tappe 	/* 160 */	0, 0, 0, 0, 0, 0, 0, 0,
77a3f66598SOliver Tappe 	/* 168 */	0, 0, 0, 0, 0, 0, 0, 0,
78a3f66598SOliver Tappe 	/* 176 */	0, 0, 0, 0, 0, 0, 0, 0,
79a3f66598SOliver Tappe 	/* 184 */	0, 0, 0, 0, 0, 0, 0, 0,
80a3f66598SOliver Tappe 	/* 192 */	0, 0, 0, 0, 0, 0, 0, 0,
81a3f66598SOliver Tappe 	/* 200 */	0, 0, 0, 0, 0, 0, 0, 0,
82a3f66598SOliver Tappe 	/* 208 */	0, 0, 0, 0, 0, 0, 0, 0,
83a3f66598SOliver Tappe 	/* 216 */	0, 0, 0, 0, 0, 0, 0, 0,
84a3f66598SOliver Tappe 	/* 224 */	0, 0, 0, 0, 0, 0, 0, 0,
85a3f66598SOliver Tappe 	/* 232 */	0, 0, 0, 0, 0, 0, 0, 0,
86a3f66598SOliver Tappe 	/* 240 */	0, 0, 0, 0, 0, 0, 0, 0,
87a3f66598SOliver Tappe 	/* 248 */	0, 0, 0, 0, 0, 0, 0, 0
88a3f66598SOliver Tappe };
89a3f66598SOliver Tappe 
90*6a5dacaaSOliver Tappe const int gPosixToLowerMap[384] = {
91*6a5dacaaSOliver Tappe 	/*-128 */	128, 129, 130, 131, 132, 133, 134, 135,
92*6a5dacaaSOliver Tappe 	/*-120 */	136, 137, 138, 139, 140, 141, 142, 143,
93*6a5dacaaSOliver Tappe 	/*-112 */	144, 145, 146, 147, 148, 149, 150, 151,
94*6a5dacaaSOliver Tappe 	/*-104 */	152, 153, 154, 155, 156, 157, 158, 159,
95*6a5dacaaSOliver Tappe 	/* -96 */	160, 161, 162, 163, 164, 165, 166, 167,
96*6a5dacaaSOliver Tappe 	/* -88 */	168, 169, 170, 171, 172, 173, 174, 175,
97*6a5dacaaSOliver Tappe 	/* -80 */	176, 177, 178, 179, 180, 181, 182, 183,
98*6a5dacaaSOliver Tappe 	/* -72 */	184, 185, 186, 187, 188, 189, 190, 191,
99*6a5dacaaSOliver Tappe 	/* -64 */	192, 193, 194, 195, 196, 197, 198, 199,
100*6a5dacaaSOliver Tappe 	/* -56 */	200, 201, 202, 203, 204, 205, 206, 207,
101*6a5dacaaSOliver Tappe 	/* -48 */	208, 209, 210, 211, 212, 213, 214, 215,
102*6a5dacaaSOliver Tappe 	/* -40 */	216, 217, 218, 219, 220, 221, 222, 223,
103*6a5dacaaSOliver Tappe 	/* -32 */	224, 225, 226, 227, 228, 229, 230, 231,
104*6a5dacaaSOliver Tappe 	/* -24 */	232, 233, 234, 235, 236, 237, 238, 239,
105*6a5dacaaSOliver Tappe 	/* -16 */	240, 241, 242, 243, 244, 245, 246, 247,
106*6a5dacaaSOliver Tappe 	/*  -8 */	248, 249, 250, 251, 252, 253, 254,
107a4823efdSOliver Tappe 	/*  -1 */    -1,	// identity value
108a3f66598SOliver Tappe 	/*   0 */	  0,   1,   2,   3,   4,   5,   6,   7,
109a3f66598SOliver Tappe 	/*   8 */	  8,   9,  10,  11,  12,  13,  14,  15,
110a3f66598SOliver Tappe 	/*  16 */	 16,  17,  18,  19,  20,  21,  22,  23,
111a3f66598SOliver Tappe 	/*  24 */	 24,  25,  26,  27,  28,  29,  30,  31,
112a3f66598SOliver Tappe 	/*  32 */	 32,  33,  34,  35,  36,  37,  38,  39,
113a3f66598SOliver Tappe 	/*  40 */	 40,  41,  42,  43,  44,  45,  46,  47,
114a3f66598SOliver Tappe 	/*  48 */	'0', '1', '2', '3', '4', '5', '6', '7',
115a3f66598SOliver Tappe 	/*  56 */	'8', '9',  58,  59,  60,  61,  62,  63,
116a3f66598SOliver Tappe 	/*  64 */	 64, 'a', 'b', 'c', 'd', 'e', 'f', 'g',
117a3f66598SOliver Tappe 	/*  72 */	'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
118a3f66598SOliver Tappe 	/*  80 */	'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
119a3f66598SOliver Tappe 	/*  88 */	'x', 'y', 'z',  91,  92,  93,  94,  95,
120a3f66598SOliver Tappe 	/*  96 */	 96, 'a', 'b', 'c', 'd', 'e', 'f', 'g',
121a3f66598SOliver Tappe 	/* 104 */	'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
122a3f66598SOliver Tappe 	/* 112 */	'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
123a3f66598SOliver Tappe 	/* 120 */	'x', 'y', 'z', 123, 124, 125, 126, 127,
124a3f66598SOliver Tappe 	/* 128 */	128, 129, 130, 131, 132, 133, 134, 135,
125a3f66598SOliver Tappe 	/* 136 */	136, 137, 138, 139, 140, 141, 142, 143,
126a3f66598SOliver Tappe 	/* 144 */	144, 145, 146, 147, 148, 149, 150, 151,
127a3f66598SOliver Tappe 	/* 152 */	152, 153, 154, 155, 156, 157, 158, 159,
128a3f66598SOliver Tappe 	/* 160 */	160, 161, 162, 163, 164, 165, 166, 167,
129a3f66598SOliver Tappe 	/* 168 */	168, 169, 170, 171, 172, 173, 174, 175,
130a3f66598SOliver Tappe 	/* 176 */	176, 177, 178, 179, 180, 181, 182, 183,
131a3f66598SOliver Tappe 	/* 184 */	184, 185, 186, 187, 188, 189, 190, 191,
132a3f66598SOliver Tappe 	/* 192 */	192, 193, 194, 195, 196, 197, 198, 199,
133a3f66598SOliver Tappe 	/* 200 */	200, 201, 202, 203, 204, 205, 206, 207,
134a3f66598SOliver Tappe 	/* 208 */	208, 209, 210, 211, 212, 213, 214, 215,
135a3f66598SOliver Tappe 	/* 216 */	216, 217, 218, 219, 220, 221, 222, 223,
136a3f66598SOliver Tappe 	/* 224 */	224, 225, 226, 227, 228, 229, 230, 231,
137a3f66598SOliver Tappe 	/* 232 */	232, 233, 234, 235, 236, 237, 238, 239,
138a3f66598SOliver Tappe 	/* 240 */	240, 241, 242, 243, 244, 245, 246, 247,
139a3f66598SOliver Tappe 	/* 248 */	248, 249, 250, 251, 252, 253, 254, 255
140a3f66598SOliver Tappe };
141a3f66598SOliver Tappe 
142a3f66598SOliver Tappe 
143*6a5dacaaSOliver Tappe const int gPosixToUpperMap[384] = {
144*6a5dacaaSOliver Tappe 	/*-128 */	128, 129, 130, 131, 132, 133, 134, 135,
145*6a5dacaaSOliver Tappe 	/*-120 */	136, 137, 138, 139, 140, 141, 142, 143,
146*6a5dacaaSOliver Tappe 	/*-112 */	144, 145, 146, 147, 148, 149, 150, 151,
147*6a5dacaaSOliver Tappe 	/*-104 */	152, 153, 154, 155, 156, 157, 158, 159,
148*6a5dacaaSOliver Tappe 	/* -96 */	160, 161, 162, 163, 164, 165, 166, 167,
149*6a5dacaaSOliver Tappe 	/* -88 */	168, 169, 170, 171, 172, 173, 174, 175,
150*6a5dacaaSOliver Tappe 	/* -80 */	176, 177, 178, 179, 180, 181, 182, 183,
151*6a5dacaaSOliver Tappe 	/* -72 */	184, 185, 186, 187, 188, 189, 190, 191,
152*6a5dacaaSOliver Tappe 	/* -64 */	192, 193, 194, 195, 196, 197, 198, 199,
153*6a5dacaaSOliver Tappe 	/* -56 */	200, 201, 202, 203, 204, 205, 206, 207,
154*6a5dacaaSOliver Tappe 	/* -48 */	208, 209, 210, 211, 212, 213, 214, 215,
155*6a5dacaaSOliver Tappe 	/* -40 */	216, 217, 218, 219, 220, 221, 222, 223,
156*6a5dacaaSOliver Tappe 	/* -32 */	224, 225, 226, 227, 228, 229, 230, 231,
157*6a5dacaaSOliver Tappe 	/* -24 */	232, 233, 234, 235, 236, 237, 238, 239,
158*6a5dacaaSOliver Tappe 	/* -16 */	240, 241, 242, 243, 244, 245, 246, 247,
159*6a5dacaaSOliver Tappe 	/*  -8 */	248, 249, 250, 251, 252, 253, 254,
160a4823efdSOliver Tappe 	/*  -1 */    -1,	// identity value
161a3f66598SOliver Tappe 	/*   0 */	  0,   1,   2,   3,   4,   5,   6,   7,
162a3f66598SOliver Tappe 	/*   8 */	  8,   9,  10,  11,  12,  13,  14,  15,
163a3f66598SOliver Tappe 	/*  16 */	 16,  17,  18,  19,  20,  21,  22,  23,
164a3f66598SOliver Tappe 	/*  24 */	 24,  25,  26,  27,  28,  29,  30,  31,
165a3f66598SOliver Tappe 	/*  32 */	 32,  33,  34,  35,  36,  37,  38,  39,
166a3f66598SOliver Tappe 	/*  40 */	 40,  41,  42,  43,  44,  45,  46,  47,
167a3f66598SOliver Tappe 	/*  48 */	'0', '1', '2', '3', '4', '5', '6', '7',
168a3f66598SOliver Tappe 	/*  56 */	'8', '9',  58,  59,  60,  61,  62,  63,
169a3f66598SOliver Tappe 	/*  64 */	 64, 'A', 'B', 'C', 'D', 'E', 'F', 'G',
170a3f66598SOliver Tappe 	/*  72 */	'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
171a3f66598SOliver Tappe 	/*  80 */	'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
172a3f66598SOliver Tappe 	/*  88 */	'X', 'Y', 'Z',  91,  92,  93,  94,  95,
173a3f66598SOliver Tappe 	/*  96 */	 96, 'A', 'B', 'C', 'D', 'E', 'F', 'G',
174a3f66598SOliver Tappe 	/* 104 */	'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
175a3f66598SOliver Tappe 	/* 112 */	'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
176a3f66598SOliver Tappe 	/* 120 */	'X', 'Y', 'Z', 123, 124, 125, 126, 127,
177a3f66598SOliver Tappe 	/* 128 */	128, 129, 130, 131, 132, 133, 134, 135,
178a3f66598SOliver Tappe 	/* 136 */	136, 137, 138, 139, 140, 141, 142, 143,
179a3f66598SOliver Tappe 	/* 144 */	144, 145, 146, 147, 148, 149, 150, 151,
180a3f66598SOliver Tappe 	/* 152 */	152, 153, 154, 155, 156, 157, 158, 159,
181a3f66598SOliver Tappe 	/* 160 */	160, 161, 162, 163, 164, 165, 166, 167,
182a3f66598SOliver Tappe 	/* 168 */	168, 169, 170, 171, 172, 173, 174, 175,
183a3f66598SOliver Tappe 	/* 176 */	176, 177, 178, 179, 180, 181, 182, 183,
184a3f66598SOliver Tappe 	/* 184 */	184, 185, 186, 187, 188, 189, 190, 191,
185a3f66598SOliver Tappe 	/* 192 */	192, 193, 194, 195, 196, 197, 198, 199,
186a3f66598SOliver Tappe 	/* 200 */	200, 201, 202, 203, 204, 205, 206, 207,
187a3f66598SOliver Tappe 	/* 208 */	208, 209, 210, 211, 212, 213, 214, 215,
188a3f66598SOliver Tappe 	/* 216 */	216, 217, 218, 219, 220, 221, 222, 223,
189a3f66598SOliver Tappe 	/* 224 */	224, 225, 226, 227, 228, 229, 230, 231,
190a3f66598SOliver Tappe 	/* 232 */	232, 233, 234, 235, 236, 237, 238, 239,
191a3f66598SOliver Tappe 	/* 240 */	240, 241, 242, 243, 244, 245, 246, 247,
192a3f66598SOliver Tappe 	/* 248 */	248, 249, 250, 251, 252, 253, 254, 255
193a3f66598SOliver Tappe };
194a3f66598SOliver Tappe 
195a3f66598SOliver Tappe 
196a3f66598SOliver Tappe struct lconv gPosixLocaleConv = {
197a3f66598SOliver Tappe 	(char*)".",	// decimal point
198a3f66598SOliver Tappe 	(char*)"",	// thousands separator
199a3f66598SOliver Tappe 	(char*)"",	// grouping
200a3f66598SOliver Tappe 	(char*)"",	// international currency symbol
201a3f66598SOliver Tappe 	(char*)"",	// local currency symbol
202a3f66598SOliver Tappe 	(char*)"",	// monetary decimal point
203a3f66598SOliver Tappe 	(char*)"",	// monetary thousands separator
204a3f66598SOliver Tappe 	(char*)"",	// monetary grouping
205a3f66598SOliver Tappe 	(char*)"",	// positive sign
206a3f66598SOliver Tappe 	(char*)"",	// negative sign
207a3f66598SOliver Tappe 	CHAR_MAX,	// int_frac_digits
208a3f66598SOliver Tappe 	CHAR_MAX,	// frac_digits
209a3f66598SOliver Tappe 	CHAR_MAX,	// p_cs_precedes
210a3f66598SOliver Tappe 	CHAR_MAX,	// p_sep_by_space
211a3f66598SOliver Tappe 	CHAR_MAX,	// n_cs_precedes
212a3f66598SOliver Tappe 	CHAR_MAX,	// n_sep_by_space
213a3f66598SOliver Tappe 	CHAR_MAX,	// p_sign_posn
214a3f66598SOliver Tappe 	CHAR_MAX,	// n_sign_posn
215a3f66598SOliver Tappe 	CHAR_MAX,	// int_p_cs_precedes
216a3f66598SOliver Tappe 	CHAR_MAX,	// int_p_sep_by_space
217a3f66598SOliver Tappe 	CHAR_MAX,	// int_n_cs_precedes
218a3f66598SOliver Tappe 	CHAR_MAX,	// int_n_sep_by_space
219a3f66598SOliver Tappe 	CHAR_MAX,	// int_p_sign_posn
220a3f66598SOliver Tappe 	CHAR_MAX	// int_n_sign_posn
221a3f66598SOliver Tappe };
222a3f66598SOliver Tappe 
223a3f66598SOliver Tappe 
224a3f66598SOliver Tappe #ifndef _KERNEL_MODE
225a3f66598SOliver Tappe 
226a3f66598SOliver Tappe const struct lc_time_t gPosixLCTimeInfo = {
227a3f66598SOliver Tappe 	{
228a3f66598SOliver Tappe 		"Jan", "Feb", "Mar", "Apr", "May", "Jun",
229a3f66598SOliver Tappe 		"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
230a3f66598SOliver Tappe 	},
231a3f66598SOliver Tappe 	{
232a3f66598SOliver Tappe 		"January", "February", "March", "April", "May", "June",
233a3f66598SOliver Tappe 		"July", "August", "September", "October", "November", "December"
234a3f66598SOliver Tappe 	},
235a3f66598SOliver Tappe 	{
236a3f66598SOliver Tappe 		"Sun", "Mon", "Tue", "Wed",	"Thu", "Fri", "Sat"
237a3f66598SOliver Tappe 	},
238a3f66598SOliver Tappe 	{
239a3f66598SOliver Tappe 		"Sunday", "Monday", "Tuesday", "Wednesday",	"Thursday", "Friday",
240a3f66598SOliver Tappe 		"Saturday"
241a3f66598SOliver Tappe 	},
242a3f66598SOliver Tappe 	"%H:%M:%S",
243a3f66598SOliver Tappe 	"%m/%d/%y",
244a3f66598SOliver Tappe 	"%a %b %e %H:%M:%S %Y",
245a3f66598SOliver Tappe 	"AM",
246a3f66598SOliver Tappe 	"PM",
247a3f66598SOliver Tappe 	"%a %b %e %H:%M:%S %Z %Y",
248a3f66598SOliver Tappe 	{
249a3f66598SOliver Tappe 		"January", "February", "March", "April", "May", "June",
250a3f66598SOliver Tappe 		"July", "August", "September", "October", "November", "December"
251a3f66598SOliver Tappe 	},
252a3f66598SOliver Tappe 	"md",
253a3f66598SOliver Tappe 	"%I:%M:%S %p"
254a3f66598SOliver Tappe };
255a3f66598SOliver Tappe 
256a3f66598SOliver Tappe 
257a3f66598SOliver Tappe const char* gPosixLanginfo[_NL_LANGINFO_LAST] = {
258a3f66598SOliver Tappe 	"US-ASCII",
259a3f66598SOliver Tappe 	gPosixLCTimeInfo.c_fmt,
260a3f66598SOliver Tappe 	gPosixLCTimeInfo.x_fmt,
261a3f66598SOliver Tappe 	gPosixLCTimeInfo.X_fmt,
262a3f66598SOliver Tappe 	gPosixLCTimeInfo.ampm_fmt,
263a3f66598SOliver Tappe 	gPosixLCTimeInfo.am,
264a3f66598SOliver Tappe 	gPosixLCTimeInfo.pm,
265a3f66598SOliver Tappe 
266a3f66598SOliver Tappe 	gPosixLCTimeInfo.weekday[0],
267a3f66598SOliver Tappe 	gPosixLCTimeInfo.weekday[1],
268a3f66598SOliver Tappe 	gPosixLCTimeInfo.weekday[2],
269a3f66598SOliver Tappe 	gPosixLCTimeInfo.weekday[3],
270a3f66598SOliver Tappe 	gPosixLCTimeInfo.weekday[4],
271a3f66598SOliver Tappe 	gPosixLCTimeInfo.weekday[5],
272a3f66598SOliver Tappe 	gPosixLCTimeInfo.weekday[6],
273a3f66598SOliver Tappe 
274a3f66598SOliver Tappe 	gPosixLCTimeInfo.wday[0],
275a3f66598SOliver Tappe 	gPosixLCTimeInfo.wday[1],
276a3f66598SOliver Tappe 	gPosixLCTimeInfo.wday[2],
277a3f66598SOliver Tappe 	gPosixLCTimeInfo.wday[3],
278a3f66598SOliver Tappe 	gPosixLCTimeInfo.wday[4],
279a3f66598SOliver Tappe 	gPosixLCTimeInfo.wday[5],
280a3f66598SOliver Tappe 	gPosixLCTimeInfo.wday[6],
281a3f66598SOliver Tappe 
282a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[0],
283a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[1],
284a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[2],
285a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[3],
286a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[4],
287a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[5],
288a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[6],
289a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[7],
290a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[8],
291a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[9],
292a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[10],
293a3f66598SOliver Tappe 	gPosixLCTimeInfo.month[11],
294a3f66598SOliver Tappe 
295a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[0],
296a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[1],
297a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[2],
298a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[3],
299a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[4],
300a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[5],
301a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[6],
302a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[7],
303a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[8],
304a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[9],
305a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[10],
306a3f66598SOliver Tappe 	gPosixLCTimeInfo.mon[11],
307a3f66598SOliver Tappe 
308a3f66598SOliver Tappe 	"%EC, %Ey, %EY",
309a3f66598SOliver Tappe 	"%Ex",
310a3f66598SOliver Tappe 	"%Ec",
311a3f66598SOliver Tappe 	"%EX",
312a3f66598SOliver Tappe 	"%O",
313a3f66598SOliver Tappe 
314a3f66598SOliver Tappe 	gPosixLocaleConv.decimal_point,
315a3f66598SOliver Tappe 	gPosixLocaleConv.thousands_sep,
316a3f66598SOliver Tappe 
317a3f66598SOliver Tappe 	"^[yY]",
318a3f66598SOliver Tappe 	"^[nN]",
319a3f66598SOliver Tappe 
320a3f66598SOliver Tappe 	gPosixLocaleConv.currency_symbol
321a3f66598SOliver Tappe };
322a3f66598SOliver Tappe 
323a3f66598SOliver Tappe #endif // !_KERNEL_MODE
324a3f66598SOliver Tappe 
325a3f66598SOliver Tappe 
326a3f66598SOliver Tappe }	// namespace BPrivate
327a3f66598SOliver Tappe 
328a3f66598SOliver Tappe 
329*6a5dacaaSOliver Tappe const unsigned short* 	__ctype_b 		= &BPrivate::gPosixClassInfo[128];
330*6a5dacaaSOliver Tappe const int* 				__ctype_tolower = &BPrivate::gPosixToLowerMap[128];
331*6a5dacaaSOliver Tappe const int* 				__ctype_toupper = &BPrivate::gPosixToUpperMap[128];
332