xref: /openbsd-src/gnu/usr.bin/binutils/intl/loadinfo.h (revision d2201f2f89f0be1a0be6f7568000ed297414a06d)
1*d2201f2fSdrahn /* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
2*d2201f2fSdrahn    This file is part of the GNU C Library.
3*d2201f2fSdrahn    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
4*d2201f2fSdrahn 
5*d2201f2fSdrahn    This program is free software; you can redistribute it and/or modify
6*d2201f2fSdrahn    it under the terms of the GNU General Public License as published by
7*d2201f2fSdrahn    the Free Software Foundation; either version 2, or (at your option)
8*d2201f2fSdrahn    any later version.
9*d2201f2fSdrahn 
10*d2201f2fSdrahn    This program is distributed in the hope that it will be useful,
11*d2201f2fSdrahn    but WITHOUT ANY WARRANTY; without even the implied warranty of
12*d2201f2fSdrahn    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*d2201f2fSdrahn    GNU General Public License for more details.
14*d2201f2fSdrahn 
15*d2201f2fSdrahn    You should have received a copy of the GNU General Public License
16*d2201f2fSdrahn    along with this program; if not, write to the Free Software Foundation,
17*d2201f2fSdrahn    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18*d2201f2fSdrahn 
19f7cc78ecSespie #ifndef PARAMS
20f7cc78ecSespie # if __STDC__
21f7cc78ecSespie #  define PARAMS(args) args
22f7cc78ecSespie # else
23f7cc78ecSespie #  define PARAMS(args) ()
24f7cc78ecSespie # endif
25f7cc78ecSespie #endif
26f7cc78ecSespie 
27f7cc78ecSespie /* Encoding of locale name parts.  */
28f7cc78ecSespie #define CEN_REVISION		1
29f7cc78ecSespie #define CEN_SPONSOR		2
30f7cc78ecSespie #define CEN_SPECIAL		4
31f7cc78ecSespie #define XPG_NORM_CODESET	8
32f7cc78ecSespie #define XPG_CODESET		16
33f7cc78ecSespie #define TERRITORY		32
34f7cc78ecSespie #define CEN_AUDIENCE		64
35f7cc78ecSespie #define XPG_MODIFIER		128
36f7cc78ecSespie 
37f7cc78ecSespie #define CEN_SPECIFIC	(CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
38f7cc78ecSespie #define XPG_SPECIFIC	(XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
39f7cc78ecSespie 
40f7cc78ecSespie 
41f7cc78ecSespie struct loaded_l10nfile
42f7cc78ecSespie {
43f7cc78ecSespie   const char *filename;
44f7cc78ecSespie   int decided;
45f7cc78ecSespie 
46f7cc78ecSespie   const void *data;
47f7cc78ecSespie 
48f7cc78ecSespie   struct loaded_l10nfile *next;
49f7cc78ecSespie   struct loaded_l10nfile *successor[1];
50f7cc78ecSespie };
51f7cc78ecSespie 
52f7cc78ecSespie 
53*d2201f2fSdrahn extern const char *_nl_normalize_codeset PARAMS ((const unsigned char *codeset,
54f7cc78ecSespie 						  size_t name_len));
55f7cc78ecSespie 
56f7cc78ecSespie extern struct loaded_l10nfile *
57f7cc78ecSespie _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
58f7cc78ecSespie 			    const char *dirlist, size_t dirlist_len, int mask,
59f7cc78ecSespie 			    const char *language, const char *territory,
60f7cc78ecSespie 			    const char *codeset,
61f7cc78ecSespie 			    const char *normalized_codeset,
62f7cc78ecSespie 			    const char *modifier, const char *special,
63f7cc78ecSespie 			    const char *sponsor, const char *revision,
64f7cc78ecSespie 			    const char *filename, int do_allocate));
65f7cc78ecSespie 
66f7cc78ecSespie 
67f7cc78ecSespie extern const char *_nl_expand_alias PARAMS ((const char *name));
68f7cc78ecSespie 
69f7cc78ecSespie extern int _nl_explode_name PARAMS ((char *name, const char **language,
70f7cc78ecSespie 				     const char **modifier,
71f7cc78ecSespie 				     const char **territory,
72f7cc78ecSespie 				     const char **codeset,
73f7cc78ecSespie 				     const char **normalized_codeset,
74f7cc78ecSespie 				     const char **special,
75f7cc78ecSespie 				     const char **sponsor,
76f7cc78ecSespie 				     const char **revision));
77