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