(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[glibc.git] / locale / programs / locfile.h
blobdb34f462e3b0d191ab3d2d37b22f121efb0f5938
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
18 02111-1307 USA. */
20 #ifndef _LOCFILE_H
21 #define _LOCFILE_H 1
23 #include <sys/uio.h>
25 #include "linereader.h"
26 #include "localedef.h"
29 /* Header of the locale data files. */
30 struct locale_file
32 int magic;
33 int n;
37 /* Macros used in the parser. */
38 #define SYNTAX_ERROR(string, args...) \
39 do \
40 { \
41 lr_error (ldfile, string, ## args); \
42 lr_ignore_rest (ldfile, 0); \
43 } \
44 while (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,
53 int ignore_content);
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,
66 const char *locname,
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,
72 struct iovec *vec);
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,
82 int ignore_content);
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,
96 int ignore_content);
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,
108 int ignore_content);
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,
120 int ignore_content);
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,
132 int ignore_content);
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,
144 int ignore_content);
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,
156 int ignore_content);
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,
168 int ignore_content);
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,
180 int ignore_content);
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,
192 int ignore_content);
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,
204 int ignore_content);
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,
216 int ignore_content);
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 */