xref: /openbsd-src/gnu/usr.bin/binutils/intl/gettextP.h (revision d2201f2f89f0be1a0be6f7568000ed297414a06d)
1f7cc78ecSespie /* Header describing internals of gettext library
2*d2201f2fSdrahn    Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3*d2201f2fSdrahn    Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
4f7cc78ecSespie 
5f7cc78ecSespie    This program is free software; you can redistribute it and/or modify
6f7cc78ecSespie    it under the terms of the GNU General Public License as published by
7f7cc78ecSespie    the Free Software Foundation; either version 2, or (at your option)
8f7cc78ecSespie    any later version.
9f7cc78ecSespie 
10f7cc78ecSespie    This program is distributed in the hope that it will be useful,
11f7cc78ecSespie    but WITHOUT ANY WARRANTY; without even the implied warranty of
12f7cc78ecSespie    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13f7cc78ecSespie    GNU General Public License for more details.
14f7cc78ecSespie 
15f7cc78ecSespie    You should have received a copy of the GNU General Public License
16f7cc78ecSespie    along with this program; if not, write to the Free Software Foundation,
17f7cc78ecSespie    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18f7cc78ecSespie 
19f7cc78ecSespie #ifndef _GETTEXTP_H
20f7cc78ecSespie #define _GETTEXTP_H
21f7cc78ecSespie 
22f7cc78ecSespie #include "loadinfo.h"
23f7cc78ecSespie 
24f7cc78ecSespie /* @@ end of prolog @@ */
25f7cc78ecSespie 
26f7cc78ecSespie #ifndef PARAMS
27f7cc78ecSespie # if __STDC__
28f7cc78ecSespie #  define PARAMS(args) args
29f7cc78ecSespie # else
30f7cc78ecSespie #  define PARAMS(args) ()
31f7cc78ecSespie # endif
32f7cc78ecSespie #endif
33f7cc78ecSespie 
34*d2201f2fSdrahn #ifndef internal_function
35*d2201f2fSdrahn # define internal_function
36*d2201f2fSdrahn #endif
37*d2201f2fSdrahn 
38f7cc78ecSespie #ifndef W
39f7cc78ecSespie # define W(flag, data) ((flag) ? SWAP (data) : (data))
40f7cc78ecSespie #endif
41f7cc78ecSespie 
42f7cc78ecSespie 
43*d2201f2fSdrahn #ifdef _LIBC
44*d2201f2fSdrahn # include <byteswap.h>
45*d2201f2fSdrahn # define SWAP(i) bswap_32 (i)
46*d2201f2fSdrahn #else
47f7cc78ecSespie static nls_uint32 SWAP PARAMS ((nls_uint32 i));
48f7cc78ecSespie 
49f7cc78ecSespie static inline nls_uint32
SWAP(i)50f7cc78ecSespie SWAP (i)
51f7cc78ecSespie      nls_uint32 i;
52f7cc78ecSespie {
53f7cc78ecSespie   return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
54f7cc78ecSespie }
55*d2201f2fSdrahn #endif
56f7cc78ecSespie 
57f7cc78ecSespie 
58f7cc78ecSespie struct loaded_domain
59f7cc78ecSespie {
60f7cc78ecSespie   const char *data;
61*d2201f2fSdrahn   int use_mmap;
62*d2201f2fSdrahn   size_t mmap_size;
63f7cc78ecSespie   int must_swap;
64f7cc78ecSespie   nls_uint32 nstrings;
65f7cc78ecSespie   struct string_desc *orig_tab;
66f7cc78ecSespie   struct string_desc *trans_tab;
67f7cc78ecSespie   nls_uint32 hash_size;
68f7cc78ecSespie   nls_uint32 *hash_tab;
69f7cc78ecSespie };
70f7cc78ecSespie 
71f7cc78ecSespie struct binding
72f7cc78ecSespie {
73f7cc78ecSespie   struct binding *next;
74f7cc78ecSespie   char *domainname;
75f7cc78ecSespie   char *dirname;
76f7cc78ecSespie };
77f7cc78ecSespie 
78f7cc78ecSespie struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
79f7cc78ecSespie 						 char *__locale,
80*d2201f2fSdrahn 						 const char *__domainname))
81*d2201f2fSdrahn      internal_function;
82*d2201f2fSdrahn void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain))
83*d2201f2fSdrahn      internal_function;
84*d2201f2fSdrahn void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
85*d2201f2fSdrahn      internal_function;
86f7cc78ecSespie 
87f7cc78ecSespie /* @@ begin of epilog @@ */
88f7cc78ecSespie 
89f7cc78ecSespie #endif /* gettextP.h  */
90