1 /* Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the 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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25 #include "linereader.h"
26 #include "localedef.h"
29 /* Header of the locale data files. */
37 /* Macros used in the parser. */
38 #define SYNTAX_ERROR(string, args...) \
41 lr_error (ldfile, string, ## args); \
42 lr_ignore_rest (ldfile, 0); \
47 /* General handling of `copy'. */
48 extern void handle_copy (struct linereader
*ldfile
,
49 const struct charmap_t
*charmap
,
50 const char *repertoire_name
,
51 struct localedef_t
*result
, enum token_t token
,
52 int locale
, const char *locale_name
,
55 /* Found in locfile.c. */
56 extern int locfile_read (struct localedef_t
*result
,
57 const struct charmap_t
*charmap
);
59 /* Check validity of all the locale data. */
60 extern void check_all_categories (struct localedef_t
*definitions
,
61 const struct charmap_t
*charmap
);
63 /* Write out all locale categories. */
64 extern void write_all_categories (struct localedef_t
*definitions
,
65 const struct charmap_t
*charmap
,
67 const char *output_path
);
69 /* Write out the data. */
70 extern void write_locale_data (const char *output_path
, int catidx
,
71 const char *category
, size_t n_elem
,
75 /* Entrypoints for the parsers of the individual categories. */
77 /* Handle LC_CTYPE category. */
78 extern void ctype_read (struct linereader
*ldfile
,
79 struct localedef_t
*result
,
80 const struct charmap_t
*charmap
,
81 const char *repertoire_name
,
83 extern void ctype_finish (struct localedef_t
*locale
,
84 const struct charmap_t
*charmap
);
85 extern void ctype_output (struct localedef_t
*locale
,
86 const struct charmap_t
*charmap
,
87 const char *output_path
);
88 extern uint32_t *find_translit (struct localedef_t
*locale
,
89 const struct charmap_t
*charmap
, uint32_t wch
);
91 /* Handle LC_COLLATE category. */
92 extern void collate_read (struct linereader
*ldfile
,
93 struct localedef_t
*result
,
94 const struct charmap_t
*charmap
,
95 const char *repertoire_name
,
97 extern void collate_finish (struct localedef_t
*locale
,
98 const struct charmap_t
*charmap
);
99 extern void collate_output (struct localedef_t
*locale
,
100 const struct charmap_t
*charmap
,
101 const char *output_path
);
103 /* Handle LC_MONETARY category. */
104 extern void monetary_read (struct linereader
*ldfile
,
105 struct localedef_t
*result
,
106 const struct charmap_t
*charmap
,
107 const char *repertoire_name
,
109 extern void monetary_finish (struct localedef_t
*locale
,
110 const struct charmap_t
*charmap
);
111 extern void monetary_output (struct localedef_t
*locale
,
112 const struct charmap_t
*charmap
,
113 const char *output_path
);
115 /* Handle LC_NUMERIC category. */
116 extern void numeric_read (struct linereader
*ldfile
,
117 struct localedef_t
*result
,
118 const struct charmap_t
*charmap
,
119 const char *repertoire_name
,
121 extern void numeric_finish (struct localedef_t
*locale
,
122 const struct charmap_t
*charmap
);
123 extern void numeric_output (struct localedef_t
*locale
,
124 const struct charmap_t
*charmap
,
125 const char *output_path
);
127 /* Handle LC_MESSAGES category. */
128 extern void messages_read (struct linereader
*ldfile
,
129 struct localedef_t
*result
,
130 const struct charmap_t
*charmap
,
131 const char *repertoire_name
,
133 extern void messages_finish (struct localedef_t
*locale
,
134 const struct charmap_t
*charmap
);
135 extern void messages_output (struct localedef_t
*locale
,
136 const struct charmap_t
*charmap
,
137 const char *output_path
);
139 /* Handle LC_TIME category. */
140 extern void time_read (struct linereader
*ldfile
,
141 struct localedef_t
*result
,
142 const struct charmap_t
*charmap
,
143 const char *repertoire_name
,
145 extern void time_finish (struct localedef_t
*locale
,
146 const struct charmap_t
*charmap
);
147 extern void time_output (struct localedef_t
*locale
,
148 const struct charmap_t
*charmap
,
149 const char *output_path
);
151 /* Handle LC_PAPER category. */
152 extern void paper_read (struct linereader
*ldfile
,
153 struct localedef_t
*result
,
154 const struct charmap_t
*charmap
,
155 const char *repertoire_name
,
157 extern void paper_finish (struct localedef_t
*locale
,
158 const struct charmap_t
*charmap
);
159 extern void paper_output (struct localedef_t
*locale
,
160 const struct charmap_t
*charmap
,
161 const char *output_path
);
163 /* Handle LC_NAME category. */
164 extern void name_read (struct linereader
*ldfile
,
165 struct localedef_t
*result
,
166 const struct charmap_t
*charmap
,
167 const char *repertoire_name
,
169 extern void name_finish (struct localedef_t
*locale
,
170 const struct charmap_t
*charmap
);
171 extern void name_output (struct localedef_t
*locale
,
172 const struct charmap_t
*charmap
,
173 const char *output_path
);
175 /* Handle LC_ADDRESS category. */
176 extern void address_read (struct linereader
*ldfile
,
177 struct localedef_t
*result
,
178 const struct charmap_t
*charmap
,
179 const char *repertoire_name
,
181 extern void address_finish (struct localedef_t
*locale
,
182 const struct charmap_t
*charmap
);
183 extern void address_output (struct localedef_t
*locale
,
184 const struct charmap_t
*charmap
,
185 const char *output_path
);
187 /* Handle LC_TELEPHONE category. */
188 extern void telephone_read (struct linereader
*ldfile
,
189 struct localedef_t
*result
,
190 const struct charmap_t
*charmap
,
191 const char *repertoire_name
,
193 extern void telephone_finish (struct localedef_t
*locale
,
194 const struct charmap_t
*charmap
);
195 extern void telephone_output (struct localedef_t
*locale
,
196 const struct charmap_t
*charmap
,
197 const char *output_path
);
199 /* Handle LC_MEASUREMENT category. */
200 extern void measurement_read (struct linereader
*ldfile
,
201 struct localedef_t
*result
,
202 const struct charmap_t
*charmap
,
203 const char *repertoire_name
,
205 extern void measurement_finish (struct localedef_t
*locale
,
206 const struct charmap_t
*charmap
);
207 extern void measurement_output (struct localedef_t
*locale
,
208 const struct charmap_t
*charmap
,
209 const char *output_path
);
211 /* Handle LC_IDENTIFICATION category. */
212 extern void identification_read (struct linereader
*ldfile
,
213 struct localedef_t
*result
,
214 const struct charmap_t
*charmap
,
215 const char *repertoire_name
,
217 extern void identification_finish (struct localedef_t
*locale
,
218 const struct charmap_t
*charmap
);
219 extern void identification_output (struct localedef_t
*locale
,
220 const struct charmap_t
*charmap
,
221 const char *output_path
);
223 #endif /* locfile.h */