Commit | Line | Data |
---|---|---|
46d320ba KW |
1 | /* locale_entry.h |
2 | * | |
3 | * Copyright (C) 2023 by Larry Wall and others | |
4 | * | |
5 | * You may distribute under the terms of either the GNU General Public | |
6 | * License or the Artistic License, as specified in the README file. | |
7 | * | |
8 | * This defines a macro for each individual locale category used on the this | |
9 | * system. (The congomerate category LC_ALL is not included.) This | |
10 | * file will be #included as the interior of various parallel arrays and in | |
11 | * other constructs; each usage will re-#define the macro to generate its | |
12 | * appropriate data. | |
13 | * | |
14 | * This guarantees the arrays will be parallel, and populated in the order | |
15 | * given here. That order is mostly arbitrary. LC_CTYPE is first because when | |
16 | * we are setting multiple categories, CTYPE often needs to match the other(s), | |
17 | * and the way the code is constructed, if we set the other category first, we | |
18 | * might otherwise have to set CTYPE twice. | |
19 | * | |
20 | * Each entry takes the token giving the category name, and either the name of | |
21 | * a function to call that does specialized set up for this category when it is | |
22 | * changed into, or NULL if no such set up is needed | |
23 | */ | |
24 | ||
ee5d3da4 | 25 | #ifdef LC_CTYPE |
4c5edaea | 26 | # ifdef NO_LOCALE_CTYPE |
ee5d3da4 | 27 | |
4c5edaea | 28 | PERL_LOCALE_TABLE_ENTRY(CTYPE, NULL) |
ee5d3da4 | 29 | |
d3966372 KW |
30 | # define HAS_IGNORED_LOCALE_CATEGORIES_ |
31 | # define LC_CTYPE_AVAIL_ false | |
32 | # else | |
4c5edaea KW |
33 | |
34 | PERL_LOCALE_TABLE_ENTRY(CTYPE, S_new_ctype) | |
35 | ||
d3966372 | 36 | # define LC_CTYPE_AVAIL_ true |
ee5d3da4 KW |
37 | # define USE_LOCALE_CTYPE |
38 | # endif | |
46d320ba | 39 | #endif |
ee5d3da4 | 40 | #ifdef LC_NUMERIC |
4c5edaea | 41 | # ifdef NO_LOCALE_NUMERIC |
ee5d3da4 | 42 | |
4c5edaea | 43 | PERL_LOCALE_TABLE_ENTRY(NUMERIC, NULL) |
ee5d3da4 | 44 | |
d3966372 KW |
45 | # define HAS_IGNORED_LOCALE_CATEGORIES_ |
46 | # define LC_NUMERIC_AVAIL_ false | |
47 | # else | |
4c5edaea KW |
48 | |
49 | PERL_LOCALE_TABLE_ENTRY(NUMERIC, S_new_numeric) | |
50 | ||
d3966372 | 51 | # define LC_NUMERIC_AVAIL_ true |
ee5d3da4 KW |
52 | # define USE_LOCALE_NUMERIC |
53 | # endif | |
46d320ba | 54 | #endif |
ee5d3da4 | 55 | #ifdef LC_COLLATE |
d3966372 | 56 | |
ee5d3da4 KW |
57 | /* Perl outsources all its collation efforts to the libc strxfrm(), so |
58 | * if it isn't available on the system, default "C" locale collation | |
59 | * gets used */ | |
d3966372 | 60 | # if defined(NO_LOCALE_COLLATE) || ! defined(HAS_STRXFRM) |
4c5edaea KW |
61 | |
62 | PERL_LOCALE_TABLE_ENTRY(COLLATE, NULL) | |
63 | ||
d3966372 KW |
64 | # define HAS_IGNORED_LOCALE_CATEGORIES_ |
65 | # define LC_COLLATE_AVAIL_ false | |
66 | # else | |
4c5edaea KW |
67 | |
68 | PERL_LOCALE_TABLE_ENTRY(COLLATE, S_new_collate) | |
69 | ||
d3966372 | 70 | # define LC_COLLATE_AVAIL_ true |
ee5d3da4 KW |
71 | # define USE_LOCALE_COLLATE |
72 | # endif | |
46d320ba | 73 | #endif |
ee5d3da4 | 74 | #ifdef LC_TIME |
ee5d3da4 | 75 | |
7c6d23b7 | 76 | PERL_LOCALE_TABLE_ENTRY(TIME, NULL) |
ee5d3da4 | 77 | |
d3966372 KW |
78 | # ifdef NO_LOCALE_TIME |
79 | # define HAS_IGNORED_LOCALE_CATEGORIES_ | |
80 | # define LC_TIME_AVAIL_ false | |
81 | # else | |
82 | # define LC_TIME_AVAIL_ true | |
ee5d3da4 KW |
83 | # define USE_LOCALE_TIME |
84 | # endif | |
46d320ba | 85 | #endif |
ee5d3da4 | 86 | #ifdef LC_MESSAGES |
ee5d3da4 | 87 | |
7c6d23b7 | 88 | PERL_LOCALE_TABLE_ENTRY(MESSAGES, NULL) |
ee5d3da4 | 89 | |
d3966372 KW |
90 | # ifdef NO_LOCALE_MESSAGES |
91 | # define HAS_IGNORED_LOCALE_CATEGORIES_ | |
92 | # define LC_MESSAGES_AVAIL_ false | |
93 | # else | |
94 | # define LC_MESSAGES_AVAIL_ true | |
ee5d3da4 KW |
95 | # define USE_LOCALE_MESSAGES |
96 | # endif | |
46d320ba | 97 | #endif |
ee5d3da4 | 98 | #ifdef LC_MONETARY |
ee5d3da4 | 99 | |
7c6d23b7 | 100 | PERL_LOCALE_TABLE_ENTRY(MONETARY, NULL) |
ee5d3da4 | 101 | |
d3966372 KW |
102 | # ifdef NO_LOCALE_MONETARY |
103 | # define HAS_IGNORED_LOCALE_CATEGORIES_ | |
104 | # define LC_MONETARY_AVAIL_ false | |
105 | # else | |
106 | # define LC_MONETARY_AVAIL_ true | |
ee5d3da4 KW |
107 | # define USE_LOCALE_MONETARY |
108 | # endif | |
46d320ba | 109 | #endif |
ee5d3da4 | 110 | #ifdef LC_ADDRESS |
ee5d3da4 | 111 | |
7c6d23b7 | 112 | PERL_LOCALE_TABLE_ENTRY(ADDRESS, NULL) |
ee5d3da4 | 113 | |
d3966372 KW |
114 | # ifdef NO_LOCALE_ADDRESS |
115 | # define HAS_IGNORED_LOCALE_CATEGORIES_ | |
116 | # define LC_ADDRESS_AVAIL_ false | |
117 | # else | |
118 | # define LC_ADDRESS_AVAIL_ true | |
ee5d3da4 KW |
119 | # define USE_LOCALE_ADDRESS |
120 | # endif | |
46d320ba | 121 | #endif |
ee5d3da4 | 122 | #ifdef LC_IDENTIFICATION |
ee5d3da4 | 123 | |
7c6d23b7 | 124 | PERL_LOCALE_TABLE_ENTRY(IDENTIFICATION, NULL) |
ee5d3da4 | 125 | |
d3966372 KW |
126 | # ifdef NO_LOCALE_IDENTIFICATION |
127 | # define HAS_IGNORED_LOCALE_CATEGORIES_ | |
128 | # define LC_IDENTIFICATION_AVAIL_ false | |
129 | # else | |
130 | # define LC_IDENTIFICATION_AVAIL_ true | |
ee5d3da4 KW |
131 | # define USE_LOCALE_IDENTIFICATION |
132 | # endif | |
46d320ba | 133 | #endif |
ee5d3da4 | 134 | #ifdef LC_MEASUREMENT |
ee5d3da4 | 135 | |
7c6d23b7 | 136 | PERL_LOCALE_TABLE_ENTRY(MEASUREMENT, NULL) |
ee5d3da4 | 137 | |
d3966372 KW |
138 | # ifdef NO_LOCALE_MEASUREMENT |
139 | # define HAS_IGNORED_LOCALE_CATEGORIES_ | |
140 | # define LC_MEASUREMENT_AVAIL_ false | |
141 | # else | |
142 | # define LC_MEASUREMENT_AVAIL_ true | |
ee5d3da4 KW |
143 | # define USE_LOCALE_MEASUREMENT |
144 | # endif | |
46d320ba | 145 | #endif |
ee5d3da4 | 146 | #ifdef LC_PAPER |
ee5d3da4 | 147 | |
7c6d23b7 | 148 | PERL_LOCALE_TABLE_ENTRY(PAPER, NULL) |
ee5d3da4 | 149 | |
d3966372 KW |
150 | # ifdef NO_LOCALE_PAPER |
151 | # define HAS_IGNORED_LOCALE_CATEGORIES_ | |
152 | # define LC_PAPER_AVAIL_ false | |
153 | # else | |
154 | # define LC_PAPER_AVAIL_ true | |
ee5d3da4 KW |
155 | # define USE_LOCALE_PAPER |
156 | # endif | |
46d320ba | 157 | #endif |
ee5d3da4 | 158 | #ifdef LC_TELEPHONE |
ee5d3da4 | 159 | |
7c6d23b7 | 160 | PERL_LOCALE_TABLE_ENTRY(TELEPHONE, NULL) |
ee5d3da4 | 161 | |
d3966372 KW |
162 | # ifdef NO_LOCALE_TELEPHONE |
163 | # define HAS_IGNORED_LOCALE_CATEGORIES_ | |
164 | # define LC_TELEPHONE_AVAIL_ false | |
165 | # else | |
166 | # define LC_TELEPHONE_AVAIL_ true | |
ee5d3da4 KW |
167 | # define USE_LOCALE_TELEPHONE |
168 | # endif | |
46d320ba | 169 | #endif |
ee5d3da4 | 170 | #ifdef LC_NAME |
ee5d3da4 | 171 | |
7c6d23b7 | 172 | PERL_LOCALE_TABLE_ENTRY(NAME, NULL) |
ee5d3da4 | 173 | |
d3966372 KW |
174 | # ifdef NO_LOCALE_NAME |
175 | # define HAS_IGNORED_LOCALE_CATEGORIES_ | |
176 | # define LC_NAME_AVAIL_ false | |
177 | # else | |
178 | # define LC_NAME_AVAIL_ true | |
ee5d3da4 KW |
179 | # define USE_LOCALE_NAME |
180 | # endif | |
46d320ba | 181 | #endif |
ee5d3da4 | 182 | #ifdef LC_SYNTAX |
ee5d3da4 | 183 | |
7c6d23b7 | 184 | PERL_LOCALE_TABLE_ENTRY(SYNTAX, NULL) |
ee5d3da4 | 185 | |
d3966372 KW |
186 | # ifdef NO_LOCALE_SYNTAX |
187 | # define HAS_IGNORED_LOCALE_CATEGORIES_ | |
188 | # define LC_SYNTAX_AVAIL_ false | |
189 | # else | |
190 | # define LC_SYNTAX_AVAIL_ true | |
ee5d3da4 KW |
191 | # define USE_LOCALE_SYNTAX |
192 | # endif | |
46d320ba | 193 | #endif |
ee5d3da4 | 194 | #ifdef LC_TOD |
ee5d3da4 | 195 | |
7c6d23b7 | 196 | PERL_LOCALE_TABLE_ENTRY(TOD, NULL) |
ee5d3da4 | 197 | |
d3966372 KW |
198 | # ifdef NO_LOCALE_TOD |
199 | # define HAS_IGNORED_LOCALE_CATEGORIES_ | |
200 | # define LC_TOD_AVAIL_ false | |
201 | # else | |
202 | # define LC_TOD_AVAIL_ true | |
ee5d3da4 KW |
203 | # define USE_LOCALE_TOD |
204 | # endif | |
46d320ba | 205 | #endif |