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