3 /* Header describing internals of libintl library.
4 Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
5 Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Library General Public License as published
9 by the Free Software Foundation; either version 2, or (at your option)
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
25 #include <stddef.h> /* Get size_t. */
28 # include "../iconv/gconv_int.h"
37 #include "gmo.h" /* Get nls_uint32. */
39 /* @@ end of prolog @@ */
42 # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
43 # define PARAMS(args) args
45 # define PARAMS(args) ()
49 #ifndef internal_function
50 # define internal_function
53 /* Tell the compiler when a conditional or integer expression is
54 almost always true or almost always false. */
55 #ifndef HAVE_BUILTIN_EXPECT
56 # define __builtin_expect(expr, val) (expr)
60 # define W(flag, data) ((flag) ? SWAP (data) : (data))
65 # include <byteswap.h>
66 # define SWAP(i) bswap_32 (i)
68 static inline nls_uint32
72 return (i
<< 24) | ((i
& 0xff00) << 8) | ((i
>> 8) & 0xff00) | (i
>> 24);
77 /* The representation of an opened message catalog. */
85 struct string_desc
*orig_tab
;
86 struct string_desc
*trans_tab
;
99 struct expression
*plural
;
100 unsigned long int nplurals
;
103 /* We want to allocate a string at the end of the struct. But ISO C
104 doesn't allow zero sized arrays. */
111 /* A set of settings bound to a message domain. Used to store settings
112 from bindtextdomain() and bind_textdomain_codeset(). */
115 struct binding
*next
;
117 int codeset_cntr
; /* Incremented each time codeset changes. */
119 char domainname
[ZERO
];
122 /* A counter which is incremented each time some previous translations
124 This variable is part of the external ABI of the GNU libintl. */
125 extern int _nl_msg_cat_cntr
;
128 const char *_nl_locale_name
PARAMS ((int category
, const char *categoryname
));
131 struct loaded_l10nfile
*_nl_find_domain
PARAMS ((const char *__dirname
,
133 const char *__domainname
,
134 struct binding
*__domainbinding
))
136 void _nl_load_domain
PARAMS ((struct loaded_l10nfile
*__domain
,
137 struct binding
*__domainbinding
))
139 void _nl_unload_domain
PARAMS ((struct loaded_domain
*__domain
))
141 const char *_nl_init_domain_conv
PARAMS ((struct loaded_l10nfile
*__domain_file
,
142 struct loaded_domain
*__domain
,
143 struct binding
*__domainbinding
))
145 void _nl_free_domain_conv
PARAMS ((struct loaded_domain
*__domain
))
148 char *_nl_find_msg
PARAMS ((struct loaded_l10nfile
*domain_file
,
149 struct binding
*domainbinding
,
150 const char *msgid
, size_t *lengthp
))
154 extern char *__gettext
PARAMS ((const char *__msgid
));
155 extern char *__dgettext
PARAMS ((const char *__domainname
,
156 const char *__msgid
));
157 extern char *__dcgettext
PARAMS ((const char *__domainname
,
158 const char *__msgid
, int __category
));
159 extern char *__ngettext
PARAMS ((const char *__msgid1
, const char *__msgid2
,
160 unsigned long int __n
));
161 extern char *__dngettext
PARAMS ((const char *__domainname
,
162 const char *__msgid1
, const char *__msgid2
,
163 unsigned long int n
));
164 extern char *__dcngettext
PARAMS ((const char *__domainname
,
165 const char *__msgid1
, const char *__msgid2
,
166 unsigned long int __n
, int __category
));
167 extern char *__dcigettext
PARAMS ((const char *__domainname
,
168 const char *__msgid1
, const char *__msgid2
,
169 int __plural
, unsigned long int __n
,
171 extern char *__textdomain
PARAMS ((const char *__domainname
));
172 extern char *__bindtextdomain
PARAMS ((const char *__domainname
,
173 const char *__dirname
));
174 extern char *__bind_textdomain_codeset
PARAMS ((const char *__domainname
,
175 const char *__codeset
));
177 extern char *gettext__
PARAMS ((const char *__msgid
));
178 extern char *dgettext__
PARAMS ((const char *__domainname
,
179 const char *__msgid
));
180 extern char *dcgettext__
PARAMS ((const char *__domainname
,
181 const char *__msgid
, int __category
));
182 extern char *ngettext__
PARAMS ((const char *__msgid1
, const char *__msgid2
,
183 unsigned long int __n
));
184 extern char *dngettext__
PARAMS ((const char *__domainname
,
185 const char *__msgid1
, const char *__msgid2
,
186 unsigned long int __n
));
187 extern char *dcngettext__
PARAMS ((const char *__domainname
,
188 const char *__msgid1
, const char *__msgid2
,
189 unsigned long int __n
, int __category
));
190 extern char *dcigettext__
PARAMS ((const char *__domainname
,
191 const char *__msgid1
, const char *__msgid2
,
192 int __plural
, unsigned long int __n
,
194 extern char *textdomain__
PARAMS ((const char *__domainname
));
195 extern char *bindtextdomain__
PARAMS ((const char *__domainname
,
196 const char *__dirname
));
197 extern char *bind_textdomain_codeset__
PARAMS ((const char *__domainname
,
198 const char *__codeset
));
201 /* @@ begin of epilog @@ */
203 #endif /* gettextP.h */