1 /* Header describing internals of libintl library.
2 Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc.
3 Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published
7 by the Free Software Foundation; either version 2, or (at your option)
10 This program 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.
15 You should have received a copy of the GNU Library General Public
16 License along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23 #include <stddef.h> /* Get size_t. */
26 # include "../iconv/gconv_int.h"
35 #include "gmo.h" /* Get nls_uint32. */
37 /* @@ end of prolog @@ */
40 # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
41 # define PARAMS(args) args
43 # define PARAMS(args) ()
47 #ifndef internal_function
48 # define internal_function
51 #ifndef attribute_hidden
52 # define attribute_hidden
55 /* Tell the compiler when a conditional or integer expression is
56 almost always true or almost always false. */
57 #ifndef HAVE_BUILTIN_EXPECT
58 # define __builtin_expect(expr, val) (expr)
62 # define W(flag, data) ((flag) ? SWAP (data) : (data))
67 # include <byteswap.h>
68 # define SWAP(i) bswap_32 (i)
70 static inline nls_uint32
74 return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
79 /* The representation of an opened message catalog. */
87 struct string_desc *orig_tab;
88 struct string_desc *trans_tab;
101 struct expression *plural;
102 unsigned long int nplurals;
105 /* We want to allocate a string at the end of the struct. But ISO C
106 doesn't allow zero sized arrays. */
113 /* A set of settings bound to a message domain. Used to store settings
114 from bindtextdomain() and bind_textdomain_codeset(). */
117 struct binding *next;
119 int codeset_cntr; /* Incremented each time codeset changes. */
121 char domainname[ZERO];
124 /* A counter which is incremented each time some previous translations
126 This variable is part of the external ABI of the GNU libintl. */
127 extern int _nl_msg_cat_cntr;
130 const char *_nl_locale_name PARAMS ((int category, const char *categoryname));
133 struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
135 const char *__domainname,
136 struct binding *__domainbinding))
138 void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain,
139 struct binding *__domainbinding))
141 void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
143 const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file,
144 struct loaded_domain *__domain,
145 struct binding *__domainbinding))
147 void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain))
150 char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file,
151 struct binding *domainbinding,
152 const char *msgid, size_t *lengthp))
156 extern char *__gettext PARAMS ((const char *__msgid));
157 extern char *__dgettext PARAMS ((const char *__domainname,
158 const char *__msgid));
159 extern char *__dcgettext PARAMS ((const char *__domainname,
160 const char *__msgid, int __category));
161 extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
162 unsigned long int __n));
163 extern char *__dngettext PARAMS ((const char *__domainname,
164 const char *__msgid1, const char *__msgid2,
165 unsigned long int n));
166 extern char *__dcngettext PARAMS ((const char *__domainname,
167 const char *__msgid1, const char *__msgid2,
168 unsigned long int __n, int __category));
169 extern char *__dcigettext PARAMS ((const char *__domainname,
170 const char *__msgid1, const char *__msgid2,
171 int __plural, unsigned long int __n,
173 extern char *__textdomain PARAMS ((const char *__domainname));
174 extern char *__bindtextdomain PARAMS ((const char *__domainname,
175 const char *__dirname));
176 extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
177 const char *__codeset));
179 extern char *gettext__ PARAMS ((const char *__msgid));
180 extern char *dgettext__ PARAMS ((const char *__domainname,
181 const char *__msgid));
182 extern char *dcgettext__ PARAMS ((const char *__domainname,
183 const char *__msgid, int __category));
184 extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
185 unsigned long int __n));
186 extern char *dngettext__ PARAMS ((const char *__domainname,
187 const char *__msgid1, const char *__msgid2,
188 unsigned long int __n));
189 extern char *dcngettext__ PARAMS ((const char *__domainname,
190 const char *__msgid1, const char *__msgid2,
191 unsigned long int __n, int __category));
192 extern char *dcigettext__ PARAMS ((const char *__domainname,
193 const char *__msgid1, const char *__msgid2,
194 int __plural, unsigned long int __n,
196 extern char *textdomain__ PARAMS ((const char *__domainname));
197 extern char *bindtextdomain__ PARAMS ((const char *__domainname,
198 const char *__dirname));
199 extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
200 const char *__codeset));
203 /* @@ begin of epilog @@ */
205 #endif /* gettextP.h */