Back to index

glibc  2.9
locfile.h
Go to the documentation of this file.
00001 /* Copyright (C) 1996-2001, 2002, 2003, 2005 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published
00007    by the Free Software Foundation; version 2 of the License, or
00008    (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software Foundation,
00017    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00018 
00019 #ifndef _LOCFILE_H
00020 #define _LOCFILE_H   1
00021 
00022 #include <sys/uio.h>
00023 
00024 #include "linereader.h"
00025 #include "localedef.h"
00026 
00027 
00028 /* Header of the locale data files.  */
00029 struct locale_file
00030 {
00031   int magic;
00032   int n;
00033 };
00034 
00035 
00036 /* Macros used in the parser.  */
00037 #define SYNTAX_ERROR(string, args...) \
00038   do                                                                 \
00039     {                                                                \
00040       lr_error (ldfile, string, ## args);                            \
00041       lr_ignore_rest (ldfile, 0);                                    \
00042     }                                                                \
00043   while (0)
00044 
00045 
00046 /* General handling of `copy'.  */
00047 extern void handle_copy (struct linereader *ldfile,
00048                       const struct charmap_t *charmap,
00049                       const char *repertoire_name,
00050                       struct localedef_t *result, enum token_t token,
00051                       int locale, const char *locale_name,
00052                       int ignore_content);
00053 
00054 /* Found in locfile.c.  */
00055 extern int locfile_read (struct localedef_t *result,
00056                       const struct charmap_t *charmap);
00057 
00058 /* Check validity of all the locale data.  */
00059 extern void check_all_categories (struct localedef_t *definitions,
00060                               const struct charmap_t *charmap);
00061 
00062 /* Write out all locale categories.  */
00063 extern void write_all_categories (struct localedef_t *definitions,
00064                               const struct charmap_t *charmap,
00065                               const char *locname,
00066                               const char *output_path);
00067 
00068 /* Write out the data.  */
00069 extern void write_locale_data (const char *output_path, int catidx,
00070                             const char *category, size_t n_elem,
00071                             struct iovec *vec);
00072 
00073 
00074 /* Entrypoints for the parsers of the individual categories.  */
00075 
00076 /* Handle LC_CTYPE category.  */
00077 extern void ctype_read (struct linereader *ldfile,
00078                      struct localedef_t *result,
00079                      const struct charmap_t *charmap,
00080                      const char *repertoire_name,
00081                      int ignore_content);
00082 extern void ctype_finish (struct localedef_t *locale,
00083                        const struct charmap_t *charmap);
00084 extern void ctype_output (struct localedef_t *locale,
00085                        const struct charmap_t *charmap,
00086                        const char *output_path);
00087 extern uint32_t *find_translit (struct localedef_t *locale,
00088                             const struct charmap_t *charmap, uint32_t wch);
00089 
00090 /* Handle LC_COLLATE category.  */
00091 extern void collate_read (struct linereader *ldfile,
00092                        struct localedef_t *result,
00093                        const struct charmap_t *charmap,
00094                        const char *repertoire_name,
00095                        int ignore_content);
00096 extern void collate_finish (struct localedef_t *locale,
00097                          const struct charmap_t *charmap);
00098 extern void collate_output (struct localedef_t *locale,
00099                          const struct charmap_t *charmap,
00100                          const char *output_path);
00101 
00102 /* Handle LC_MONETARY category.  */
00103 extern void monetary_read (struct linereader *ldfile,
00104                         struct localedef_t *result,
00105                         const struct charmap_t *charmap,
00106                         const char *repertoire_name,
00107                         int ignore_content);
00108 extern void monetary_finish (struct localedef_t *locale,
00109                           const struct charmap_t *charmap);
00110 extern void monetary_output (struct localedef_t *locale,
00111                           const struct charmap_t *charmap,
00112                           const char *output_path);
00113 
00114 /* Handle LC_NUMERIC category.  */
00115 extern void numeric_read (struct linereader *ldfile,
00116                        struct localedef_t *result,
00117                        const struct charmap_t *charmap,
00118                        const char *repertoire_name,
00119                        int ignore_content);
00120 extern void numeric_finish (struct localedef_t *locale,
00121                          const struct charmap_t *charmap);
00122 extern void numeric_output (struct localedef_t *locale,
00123                          const struct charmap_t *charmap,
00124                          const char *output_path);
00125 
00126 /* Handle LC_MESSAGES category.  */
00127 extern void messages_read (struct linereader *ldfile,
00128                         struct localedef_t *result,
00129                         const struct charmap_t *charmap,
00130                         const char *repertoire_name,
00131                         int ignore_content);
00132 extern void messages_finish (struct localedef_t *locale,
00133                           const struct charmap_t *charmap);
00134 extern void messages_output (struct localedef_t *locale,
00135                           const struct charmap_t *charmap,
00136                           const char *output_path);
00137 
00138 /* Handle LC_TIME category.  */
00139 extern void time_read (struct linereader *ldfile,
00140                      struct localedef_t *result,
00141                      const struct charmap_t *charmap,
00142                      const char *repertoire_name,
00143                      int ignore_content);
00144 extern void time_finish (struct localedef_t *locale,
00145                       const struct charmap_t *charmap);
00146 extern void time_output (struct localedef_t *locale,
00147                       const struct charmap_t *charmap,
00148                       const char *output_path);
00149 
00150 /* Handle LC_PAPER category.  */
00151 extern void paper_read (struct linereader *ldfile,
00152                      struct localedef_t *result,
00153                      const struct charmap_t *charmap,
00154                      const char *repertoire_name,
00155                      int ignore_content);
00156 extern void paper_finish (struct localedef_t *locale,
00157                        const struct charmap_t *charmap);
00158 extern void paper_output (struct localedef_t *locale,
00159                        const struct charmap_t *charmap,
00160                        const char *output_path);
00161 
00162 /* Handle LC_NAME category.  */
00163 extern void name_read (struct linereader *ldfile,
00164                      struct localedef_t *result,
00165                      const struct charmap_t *charmap,
00166                      const char *repertoire_name,
00167                      int ignore_content);
00168 extern void name_finish (struct localedef_t *locale,
00169                       const struct charmap_t *charmap);
00170 extern void name_output (struct localedef_t *locale,
00171                       const struct charmap_t *charmap,
00172                       const char *output_path);
00173 
00174 /* Handle LC_ADDRESS category.  */
00175 extern void address_read (struct linereader *ldfile,
00176                        struct localedef_t *result,
00177                        const struct charmap_t *charmap,
00178                        const char *repertoire_name,
00179                        int ignore_content);
00180 extern void address_finish (struct localedef_t *locale,
00181                          const struct charmap_t *charmap);
00182 extern void address_output (struct localedef_t *locale,
00183                          const struct charmap_t *charmap,
00184                          const char *output_path);
00185 
00186 /* Handle LC_TELEPHONE category.  */
00187 extern void telephone_read (struct linereader *ldfile,
00188                          struct localedef_t *result,
00189                          const struct charmap_t *charmap,
00190                          const char *repertoire_name,
00191                          int ignore_content);
00192 extern void telephone_finish (struct localedef_t *locale,
00193                            const struct charmap_t *charmap);
00194 extern void telephone_output (struct localedef_t *locale,
00195                            const struct charmap_t *charmap,
00196                            const char *output_path);
00197 
00198 /* Handle LC_MEASUREMENT category.  */
00199 extern void measurement_read (struct linereader *ldfile,
00200                            struct localedef_t *result,
00201                            const struct charmap_t *charmap,
00202                            const char *repertoire_name,
00203                            int ignore_content);
00204 extern void measurement_finish (struct localedef_t *locale,
00205                             const struct charmap_t *charmap);
00206 extern void measurement_output (struct localedef_t *locale,
00207                             const struct charmap_t *charmap,
00208                             const char *output_path);
00209 
00210 /* Handle LC_IDENTIFICATION category.  */
00211 extern void identification_read (struct linereader *ldfile,
00212                              struct localedef_t *result,
00213                              const struct charmap_t *charmap,
00214                              const char *repertoire_name,
00215                              int ignore_content);
00216 extern void identification_finish (struct localedef_t *locale,
00217                                const struct charmap_t *charmap);
00218 extern void identification_output (struct localedef_t *locale,
00219                                const struct charmap_t *charmap,
00220                                const char *output_path);
00221 
00222 #endif /* locfile.h */