3 * Copyright (C) 2023 by Larry Wall and others
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.
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
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.
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
26 # ifdef NO_LOCALE_CTYPE
28 PERL_LOCALE_TABLE_ENTRY(CTYPE, NULL)
30 # define HAS_IGNORED_LOCALE_CATEGORIES_
31 # define LC_CTYPE_AVAIL_ false
34 PERL_LOCALE_TABLE_ENTRY(CTYPE, S_new_ctype)
36 # define LC_CTYPE_AVAIL_ true
37 # define USE_LOCALE_CTYPE
41 # ifdef NO_LOCALE_NUMERIC
43 PERL_LOCALE_TABLE_ENTRY(NUMERIC, NULL)
45 # define HAS_IGNORED_LOCALE_CATEGORIES_
46 # define LC_NUMERIC_AVAIL_ false
49 PERL_LOCALE_TABLE_ENTRY(NUMERIC, S_new_numeric)
51 # define LC_NUMERIC_AVAIL_ true
52 # define USE_LOCALE_NUMERIC
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
60 # if defined(NO_LOCALE_COLLATE) || ! defined(HAS_STRXFRM)
62 PERL_LOCALE_TABLE_ENTRY(COLLATE, NULL)
64 # define HAS_IGNORED_LOCALE_CATEGORIES_
65 # define LC_COLLATE_AVAIL_ false
68 PERL_LOCALE_TABLE_ENTRY(COLLATE, S_new_collate)
70 # define LC_COLLATE_AVAIL_ true
71 # define USE_LOCALE_COLLATE
76 PERL_LOCALE_TABLE_ENTRY(TIME, NULL)
78 # ifdef NO_LOCALE_TIME
79 # define HAS_IGNORED_LOCALE_CATEGORIES_
80 # define LC_TIME_AVAIL_ false
82 # define LC_TIME_AVAIL_ true
83 # define USE_LOCALE_TIME
88 PERL_LOCALE_TABLE_ENTRY(MESSAGES, NULL)
90 # ifdef NO_LOCALE_MESSAGES
91 # define HAS_IGNORED_LOCALE_CATEGORIES_
92 # define LC_MESSAGES_AVAIL_ false
94 # define LC_MESSAGES_AVAIL_ true
95 # define USE_LOCALE_MESSAGES
100 PERL_LOCALE_TABLE_ENTRY(MONETARY, NULL)
102 # ifdef NO_LOCALE_MONETARY
103 # define HAS_IGNORED_LOCALE_CATEGORIES_
104 # define LC_MONETARY_AVAIL_ false
106 # define LC_MONETARY_AVAIL_ true
107 # define USE_LOCALE_MONETARY
112 PERL_LOCALE_TABLE_ENTRY(ADDRESS, NULL)
114 # ifdef NO_LOCALE_ADDRESS
115 # define HAS_IGNORED_LOCALE_CATEGORIES_
116 # define LC_ADDRESS_AVAIL_ false
118 # define LC_ADDRESS_AVAIL_ true
119 # define USE_LOCALE_ADDRESS
122 #ifdef LC_IDENTIFICATION
124 PERL_LOCALE_TABLE_ENTRY(IDENTIFICATION, NULL)
126 # ifdef NO_LOCALE_IDENTIFICATION
127 # define HAS_IGNORED_LOCALE_CATEGORIES_
128 # define LC_IDENTIFICATION_AVAIL_ false
130 # define LC_IDENTIFICATION_AVAIL_ true
131 # define USE_LOCALE_IDENTIFICATION
134 #ifdef LC_MEASUREMENT
136 PERL_LOCALE_TABLE_ENTRY(MEASUREMENT, NULL)
138 # ifdef NO_LOCALE_MEASUREMENT
139 # define HAS_IGNORED_LOCALE_CATEGORIES_
140 # define LC_MEASUREMENT_AVAIL_ false
142 # define LC_MEASUREMENT_AVAIL_ true
143 # define USE_LOCALE_MEASUREMENT
148 PERL_LOCALE_TABLE_ENTRY(PAPER, NULL)
150 # ifdef NO_LOCALE_PAPER
151 # define HAS_IGNORED_LOCALE_CATEGORIES_
152 # define LC_PAPER_AVAIL_ false
154 # define LC_PAPER_AVAIL_ true
155 # define USE_LOCALE_PAPER
160 PERL_LOCALE_TABLE_ENTRY(TELEPHONE, NULL)
162 # ifdef NO_LOCALE_TELEPHONE
163 # define HAS_IGNORED_LOCALE_CATEGORIES_
164 # define LC_TELEPHONE_AVAIL_ false
166 # define LC_TELEPHONE_AVAIL_ true
167 # define USE_LOCALE_TELEPHONE
172 PERL_LOCALE_TABLE_ENTRY(NAME, NULL)
174 # ifdef NO_LOCALE_NAME
175 # define HAS_IGNORED_LOCALE_CATEGORIES_
176 # define LC_NAME_AVAIL_ false
178 # define LC_NAME_AVAIL_ true
179 # define USE_LOCALE_NAME
184 PERL_LOCALE_TABLE_ENTRY(SYNTAX, NULL)
186 # ifdef NO_LOCALE_SYNTAX
187 # define HAS_IGNORED_LOCALE_CATEGORIES_
188 # define LC_SYNTAX_AVAIL_ false
190 # define LC_SYNTAX_AVAIL_ true
191 # define USE_LOCALE_SYNTAX
196 PERL_LOCALE_TABLE_ENTRY(TOD, NULL)
198 # ifdef NO_LOCALE_TOD
199 # define HAS_IGNORED_LOCALE_CATEGORIES_
200 # define LC_TOD_AVAIL_ false
202 # define LC_TOD_AVAIL_ true
203 # define USE_LOCALE_TOD