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