Back to index

glibc  2.9
loadinfo.h
Go to the documentation of this file.
00001 /* Copyright (C) 1996-2000, 2002, 2003, 2004 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library 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 GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _LOADINFO_H
00021 #define _LOADINFO_H  1
00022 
00023 /* Declarations of locale dependent catalog lookup functions.
00024    Implemented in
00025 
00026      localealias.c    Possibly replace a locale name by another.
00027      explodename.c    Split a locale name into its various fields.
00028      l10nflist.c      Generate a list of filenames of possible message catalogs.
00029      finddomain.c     Find and open the relevant message catalogs.
00030 
00031    The main function _nl_find_domain() in finddomain.c is declared
00032    in gettextP.h.
00033  */
00034 
00035 #ifndef PARAMS
00036 # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
00037 #  define PARAMS(args) args
00038 # else
00039 #  define PARAMS(args) ()
00040 # endif
00041 #endif
00042 
00043 #ifndef internal_function
00044 # define internal_function
00045 #endif
00046 
00047 /* Tell the compiler when a conditional or integer expression is
00048    almost always true or almost always false.  */
00049 #ifndef HAVE_BUILTIN_EXPECT
00050 # define __builtin_expect(expr, val) (expr)
00051 #endif
00052 
00053 /* Encoding of locale name parts.  */
00054 #define XPG_NORM_CODESET    1
00055 #define XPG_CODESET         2
00056 #define XPG_TERRITORY              4
00057 #define XPG_MODIFIER        8
00058 
00059 
00060 struct loaded_l10nfile
00061 {
00062   const char *filename;
00063   int decided;
00064 
00065   const void *data;
00066 
00067   struct loaded_l10nfile *next;
00068   struct loaded_l10nfile *successor[1];
00069 };
00070 
00071 
00072 /* Normalize codeset name.  There is no standard for the codeset
00073    names.  Normalization allows the user to use any of the common
00074    names.  The return value is dynamically allocated and has to be
00075    freed by the caller.  */
00076 extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
00077                                             size_t name_len));
00078 
00079 extern struct loaded_l10nfile *
00080 _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
00081                          const char *dirlist, size_t dirlist_len, int mask,
00082                          const char *language, const char *territory,
00083                          const char *codeset,
00084                          const char *normalized_codeset,
00085                          const char *modifier, const char *filename,
00086                          int do_allocate));
00087 
00088 
00089 extern const char *_nl_expand_alias PARAMS ((const char *name));
00090 
00091 /* normalized_codeset is dynamically allocated and has to be freed by
00092    the caller.  */
00093 extern int _nl_explode_name PARAMS ((char *name, const char **language,
00094                                  const char **modifier,
00095                                  const char **territory,
00096                                  const char **codeset,
00097                                  const char **normalized_codeset));
00098 
00099 #endif /* loadinfo.h */