2.9
[glibc/nacl-glibc.git] / locale / programs / locfile.h
blob6e5341f36eedf8c7a054d497f8b81d0f2a142c99
1 /* Copyright (C) 1996-2001, 2002, 2003, 2005 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; version 2 of the License, or
8 (at your option) any later version.
10 This program 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
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19 #ifndef _LOCFILE_H
20 #define _LOCFILE_H 1
22 #include <sys/uio.h>
24 #include "linereader.h"
25 #include "localedef.h"
28 /* Header of the locale data files. */
29 struct locale_file
31 int magic;
32 int n;
36 /* Macros used in the parser. */
37 #define SYNTAX_ERROR(string, args...) \
38 do \
39 { \
40 lr_error (ldfile, string, ## args); \
41 lr_ignore_rest (ldfile, 0); \
42 } \
43 while (0)
46 /* General handling of `copy'. */
47 extern void handle_copy (struct linereader *ldfile,
48 const struct charmap_t *charmap,
49 const char *repertoire_name,
50 struct localedef_t *result, enum token_t token,
51 int locale, const char *locale_name,
52 int ignore_content);
54 /* Found in locfile.c. */
55 extern int locfile_read (struct localedef_t *result,
56 const struct charmap_t *charmap);
58 /* Check validity of all the locale data. */
59 extern void check_all_categories (struct localedef_t *definitions,
60 const struct charmap_t *charmap);
62 /* Write out all locale categories. */
63 extern void write_all_categories (struct localedef_t *definitions,
64 const struct charmap_t *charmap,
65 const char *locname,
66 const char *output_path);
68 /* Write out the data. */
69 extern void write_locale_data (const char *output_path, int catidx,
70 const char *category, size_t n_elem,
71 struct iovec *vec);
74 /* Entrypoints for the parsers of the individual categories. */
76 /* Handle LC_CTYPE category. */
77 extern void ctype_read (struct linereader *ldfile,
78 struct localedef_t *result,
79 const struct charmap_t *charmap,
80 const char *repertoire_name,
81 int ignore_content);
82 extern void ctype_finish (struct localedef_t *locale,
83 const struct charmap_t *charmap);
84 extern void ctype_output (struct localedef_t *locale,
85 const struct charmap_t *charmap,
86 const char *output_path);
87 extern uint32_t *find_translit (struct localedef_t *locale,
88 const struct charmap_t *charmap, uint32_t wch);
90 /* Handle LC_COLLATE category. */
91 extern void collate_read (struct linereader *ldfile,
92 struct localedef_t *result,
93 const struct charmap_t *charmap,
94 const char *repertoire_name,
95 int ignore_content);
96 extern void collate_finish (struct localedef_t *locale,
97 const struct charmap_t *charmap);
98 extern void collate_output (struct localedef_t *locale,
99 const struct charmap_t *charmap,
100 const char *output_path);
102 /* Handle LC_MONETARY category. */
103 extern void monetary_read (struct linereader *ldfile,
104 struct localedef_t *result,
105 const struct charmap_t *charmap,
106 const char *repertoire_name,
107 int ignore_content);
108 extern void monetary_finish (struct localedef_t *locale,
109 const struct charmap_t *charmap);
110 extern void monetary_output (struct localedef_t *locale,
111 const struct charmap_t *charmap,
112 const char *output_path);
114 /* Handle LC_NUMERIC category. */
115 extern void numeric_read (struct linereader *ldfile,
116 struct localedef_t *result,
117 const struct charmap_t *charmap,
118 const char *repertoire_name,
119 int ignore_content);
120 extern void numeric_finish (struct localedef_t *locale,
121 const struct charmap_t *charmap);
122 extern void numeric_output (struct localedef_t *locale,
123 const struct charmap_t *charmap,
124 const char *output_path);
126 /* Handle LC_MESSAGES category. */
127 extern void messages_read (struct linereader *ldfile,
128 struct localedef_t *result,
129 const struct charmap_t *charmap,
130 const char *repertoire_name,
131 int ignore_content);
132 extern void messages_finish (struct localedef_t *locale,
133 const struct charmap_t *charmap);
134 extern void messages_output (struct localedef_t *locale,
135 const struct charmap_t *charmap,
136 const char *output_path);
138 /* Handle LC_TIME category. */
139 extern void time_read (struct linereader *ldfile,
140 struct localedef_t *result,
141 const struct charmap_t *charmap,
142 const char *repertoire_name,
143 int ignore_content);
144 extern void time_finish (struct localedef_t *locale,
145 const struct charmap_t *charmap);
146 extern void time_output (struct localedef_t *locale,
147 const struct charmap_t *charmap,
148 const char *output_path);
150 /* Handle LC_PAPER category. */
151 extern void paper_read (struct linereader *ldfile,
152 struct localedef_t *result,
153 const struct charmap_t *charmap,
154 const char *repertoire_name,
155 int ignore_content);
156 extern void paper_finish (struct localedef_t *locale,
157 const struct charmap_t *charmap);
158 extern void paper_output (struct localedef_t *locale,
159 const struct charmap_t *charmap,
160 const char *output_path);
162 /* Handle LC_NAME category. */
163 extern void name_read (struct linereader *ldfile,
164 struct localedef_t *result,
165 const struct charmap_t *charmap,
166 const char *repertoire_name,
167 int ignore_content);
168 extern void name_finish (struct localedef_t *locale,
169 const struct charmap_t *charmap);
170 extern void name_output (struct localedef_t *locale,
171 const struct charmap_t *charmap,
172 const char *output_path);
174 /* Handle LC_ADDRESS category. */
175 extern void address_read (struct linereader *ldfile,
176 struct localedef_t *result,
177 const struct charmap_t *charmap,
178 const char *repertoire_name,
179 int ignore_content);
180 extern void address_finish (struct localedef_t *locale,
181 const struct charmap_t *charmap);
182 extern void address_output (struct localedef_t *locale,
183 const struct charmap_t *charmap,
184 const char *output_path);
186 /* Handle LC_TELEPHONE category. */
187 extern void telephone_read (struct linereader *ldfile,
188 struct localedef_t *result,
189 const struct charmap_t *charmap,
190 const char *repertoire_name,
191 int ignore_content);
192 extern void telephone_finish (struct localedef_t *locale,
193 const struct charmap_t *charmap);
194 extern void telephone_output (struct localedef_t *locale,
195 const struct charmap_t *charmap,
196 const char *output_path);
198 /* Handle LC_MEASUREMENT category. */
199 extern void measurement_read (struct linereader *ldfile,
200 struct localedef_t *result,
201 const struct charmap_t *charmap,
202 const char *repertoire_name,
203 int ignore_content);
204 extern void measurement_finish (struct localedef_t *locale,
205 const struct charmap_t *charmap);
206 extern void measurement_output (struct localedef_t *locale,
207 const struct charmap_t *charmap,
208 const char *output_path);
210 /* Handle LC_IDENTIFICATION category. */
211 extern void identification_read (struct linereader *ldfile,
212 struct localedef_t *result,
213 const struct charmap_t *charmap,
214 const char *repertoire_name,
215 int ignore_content);
216 extern void identification_finish (struct localedef_t *locale,
217 const struct charmap_t *charmap);
218 extern void identification_output (struct localedef_t *locale,
219 const struct charmap_t *charmap,
220 const char *output_path);
222 #endif /* locfile.h */