]>
git.ipfire.org Git - thirdparty/glibc.git/blob - locale/programs/locales.h
1 /* Copyright (C) 1996 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If
17 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
25 /* Undefine following line in production version. */
26 /* #define NDEBUG 1 */
29 #include "linereader.h"
30 #include "locfile-token.h"
33 #include "localeinfo.h"
36 /* Header of the locale data files. */
44 /* Handle LC_CTYPE category. */
46 static inline unsigned int
47 charclass_to_bit (enum token_t tok
)
49 static unsigned int lastbit
= _ISalnum
;
53 #define CLASS(name) case tok_##name: return _IS##name
70 /* Exit status 2 means a limitation in the implementation is
72 error (2, 0, _("too many character classes defined"));
80 /* Remember name of newly created charclass. */
81 void ctype_startup (struct linereader
*lr
, struct localedef_t
*locale
,
82 struct charset_t
*charset
);
83 void ctype_finish (struct localedef_t
*locale
, struct charset_t
*charset
);
85 void ctype_output (struct localedef_t
*locale
, struct charset_t
*charset
,
86 const char *output_path
);
88 int ctype_is_charclass (struct linereader
*lr
, struct localedef_t
*locale
,
90 void ctype_class_new (struct linereader
*lr
, struct localedef_t
*locale
,
91 enum token_t tok
, struct token
*code
,
92 struct charset_t
*charset
);
93 void ctype_class_start (struct linereader
*lr
, struct localedef_t
*locale
,
94 enum token_t tok
, const char *name
,
95 struct charset_t
*charset
);
96 void ctype_class_from (struct linereader
*lr
, struct localedef_t
*locale
,
97 struct token
*code
, struct charset_t
*charset
);
98 void ctype_class_to (struct linereader
*lr
, struct localedef_t
*locale
,
99 struct token
*code
, struct charset_t
*charset
);
100 void ctype_class_end (struct linereader
*lr
, struct localedef_t
*locale
);
102 int ctype_is_charconv (struct linereader
*lr
, struct localedef_t
*locale
,
104 void ctype_map_new (struct linereader
*lr
, struct localedef_t
*locale
,
105 enum token_t tok
, struct token
*code
,
106 struct charset_t
*charset
);
107 void ctype_map_start (struct linereader
*lr
, struct localedef_t
*locale
,
108 enum token_t tok
, const char *name
,
109 struct charset_t
*charset
);
110 void ctype_map_from (struct linereader
*lr
, struct localedef_t
*locale
,
111 struct token
*code
, struct charset_t
*charset
);
112 void ctype_map_to (struct linereader
*lr
, struct localedef_t
*locale
,
113 struct token
*code
, struct charset_t
*charset
);
114 void ctype_map_end (struct linereader
*lr
, struct localedef_t
*locale
);
117 /* Handle LC_COLLATE category. */
119 void collate_startup (struct linereader
*lr
, struct localedef_t
*locale
,
120 struct charset_t
*charset
);
122 void collate_finish (struct localedef_t
*locale
,
123 struct charset_t
*charset
);
125 void collate_output (struct localedef_t
*locale
, const char *output_path
);
127 void collate_element_to (struct linereader
*lr
, struct localedef_t
*locale
,
128 struct token
*code
, struct charset_t
*charset
);
129 void collate_element_from (struct linereader
*lr
,
130 struct localedef_t
*locale
, struct token
*code
,
131 struct charset_t
*charset
);
132 void collate_symbol (struct linereader
*lr
, struct localedef_t
*locale
,
133 struct token
*code
, struct charset_t
*charset
);
134 void collate_new_order (struct linereader
*lr
, struct localedef_t
*locale
,
135 enum coll_sort_rule sort_rule
);
136 void collate_build_arrays (struct linereader
*lr
,
137 struct localedef_t
*locale
);
138 int collate_order_elem (struct linereader
*lr
, struct localedef_t
*locale
,
139 struct token
*code
, struct charset_t
*charset
);
140 int collate_weight_bsymbol (struct linereader
*lr
,
141 struct localedef_t
*locale
,
142 struct token
*code
, struct charset_t
*charset
);
143 int collate_next_weight (struct linereader
*lr
,
144 struct localedef_t
*locale
);
145 int collate_simple_weight (struct linereader
*lr
,
146 struct localedef_t
*locale
,
147 struct token
*code
, struct charset_t
*charset
);
148 void collate_end_weight (struct linereader
*lr
,
149 struct localedef_t
*locale
);
152 /* Handle LC_MONETARY category. */
154 void monetary_startup (struct linereader
*lr
, struct localedef_t
*locale
,
155 struct charset_t
*charset
);
157 void monetary_finish (struct localedef_t
*locale
);
159 void monetary_output (struct localedef_t
*locale
, const char *output_path
);
161 void monetary_add (struct linereader
*lr
, struct localedef_t
*locale
,
162 enum token_t tok
, struct token
*code
,
163 struct charset_t
*charset
);
166 /* Handle LC_NUMERIC category. */
168 void numeric_startup (struct linereader
*lr
, struct localedef_t
*locale
,
169 struct charset_t
*charset
);
171 void numeric_finish (struct localedef_t
*locale
);
173 void numeric_output (struct localedef_t
*locale
, const char *output_path
);
175 void numeric_add (struct linereader
*lr
, struct localedef_t
*locale
,
176 enum token_t tok
, struct token
*code
,
177 struct charset_t
*charset
);
180 /* Handle LC_TIME category. */
182 void time_startup (struct linereader
*lr
, struct localedef_t
*locale
,
183 struct charset_t
*charset
);
185 void time_finish (struct localedef_t
*locale
);
187 void time_output (struct localedef_t
*locale
, const char *output_path
);
189 void time_add (struct linereader
*lr
, struct localedef_t
*locale
,
190 enum token_t tok
, struct token
*code
,
191 struct charset_t
*charset
);
194 /* Handle LC_MESSAGES category. */
196 void messages_startup (struct linereader
*lr
, struct localedef_t
*locale
,
197 struct charset_t
*charset
);
199 void messages_finish (struct localedef_t
*locale
);
201 void messages_output (struct localedef_t
*locale
, const char *output_path
);
203 void messages_add (struct linereader
*lr
, struct localedef_t
*locale
,
204 enum token_t tok
, struct token
*code
,
205 struct charset_t
*charset
);
208 #endif /* locales.h */