xref: /openbsd-src/gnu/usr.bin/binutils-2.17/intl/gettextP.h (revision 3d8817e467ea46cf4772788d6804dd293abfb01a)
1*3d8817e4Smiod /* Header describing internals of gettext library
2*3d8817e4Smiod    Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3*3d8817e4Smiod    Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
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 _GETTEXTP_H
20*3d8817e4Smiod #define _GETTEXTP_H
21*3d8817e4Smiod 
22*3d8817e4Smiod #include "loadinfo.h"
23*3d8817e4Smiod 
24*3d8817e4Smiod /* @@ end of prolog @@ */
25*3d8817e4Smiod 
26*3d8817e4Smiod #ifndef PARAMS
27*3d8817e4Smiod # if __STDC__
28*3d8817e4Smiod #  define PARAMS(args) args
29*3d8817e4Smiod # else
30*3d8817e4Smiod #  define PARAMS(args) ()
31*3d8817e4Smiod # endif
32*3d8817e4Smiod #endif
33*3d8817e4Smiod 
34*3d8817e4Smiod #ifndef internal_function
35*3d8817e4Smiod # define internal_function
36*3d8817e4Smiod #endif
37*3d8817e4Smiod 
38*3d8817e4Smiod #ifndef W
39*3d8817e4Smiod # define W(flag, data) ((flag) ? SWAP (data) : (data))
40*3d8817e4Smiod #endif
41*3d8817e4Smiod 
42*3d8817e4Smiod 
43*3d8817e4Smiod #ifdef _LIBC
44*3d8817e4Smiod # include <byteswap.h>
45*3d8817e4Smiod # define SWAP(i) bswap_32 (i)
46*3d8817e4Smiod #else
47*3d8817e4Smiod static nls_uint32 SWAP PARAMS ((nls_uint32 i));
48*3d8817e4Smiod 
49*3d8817e4Smiod static inline nls_uint32
SWAP(i)50*3d8817e4Smiod SWAP (i)
51*3d8817e4Smiod      nls_uint32 i;
52*3d8817e4Smiod {
53*3d8817e4Smiod   return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
54*3d8817e4Smiod }
55*3d8817e4Smiod #endif
56*3d8817e4Smiod 
57*3d8817e4Smiod 
58*3d8817e4Smiod struct loaded_domain
59*3d8817e4Smiod {
60*3d8817e4Smiod   const char *data;
61*3d8817e4Smiod   int use_mmap;
62*3d8817e4Smiod   size_t mmap_size;
63*3d8817e4Smiod   int must_swap;
64*3d8817e4Smiod   nls_uint32 nstrings;
65*3d8817e4Smiod   struct string_desc *orig_tab;
66*3d8817e4Smiod   struct string_desc *trans_tab;
67*3d8817e4Smiod   nls_uint32 hash_size;
68*3d8817e4Smiod   nls_uint32 *hash_tab;
69*3d8817e4Smiod };
70*3d8817e4Smiod 
71*3d8817e4Smiod struct binding
72*3d8817e4Smiod {
73*3d8817e4Smiod   struct binding *next;
74*3d8817e4Smiod   char *domainname;
75*3d8817e4Smiod   char *dirname;
76*3d8817e4Smiod };
77*3d8817e4Smiod 
78*3d8817e4Smiod struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
79*3d8817e4Smiod 						 char *__locale,
80*3d8817e4Smiod 						 const char *__domainname))
81*3d8817e4Smiod      internal_function;
82*3d8817e4Smiod void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain))
83*3d8817e4Smiod      internal_function;
84*3d8817e4Smiod void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
85*3d8817e4Smiod      internal_function;
86*3d8817e4Smiod 
87*3d8817e4Smiod /* @@ begin of epilog @@ */
88*3d8817e4Smiod 
89*3d8817e4Smiod #endif /* gettextP.h  */
90