1 /* Header describing internals of libintl library.
2 Copyright (C) 1995-1999, 2000, 2001 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 /* Tell the compiler when a conditional or integer expression is
52 almost always true or almost always false. */
53 #ifndef HAVE_BUILTIN_EXPECT
54 # define __builtin_expect(expr, val) (expr)
58 # define W(flag, data) ((flag) ? SWAP (data) : (data))
63 # include <byteswap.h>
64 # define SWAP(i) bswap_32 (i)
66 static inline nls_uint32
70 return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
75 /* The representation of an opened message catalog. */
83 struct string_desc *orig_tab;
84 struct string_desc *trans_tab;
97 struct expression *plural;
98 unsigned long int nplurals;
101 /* We want to allocate a string at the end of the struct. But ISO C
102 doesn't allow zero sized arrays. */
109 /* A set of settings bound to a message domain. Used to store settings
110 from bindtextdomain() and bind_textdomain_codeset(). */
113 struct binding *next;
115 int codeset_cntr; /* Incremented each time codeset changes. */
117 char domainname[ZERO];
120 /* A counter which is incremented each time some previous translations
122 This variable is part of the external ABI of the GNU libintl. */
123 extern int _nl_msg_cat_cntr;
126 const char *_nl_locale_name PARAMS ((int category, const char *categoryname));
129 struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
131 const char *__domainname,
132 struct binding *__domainbinding))
134 void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain,
135 struct binding *__domainbinding))
137 void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
139 const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file,
140 struct loaded_domain *__domain,
141 struct binding *__domainbinding))
143 void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain))
146 char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file,
147 struct binding *domainbinding,
148 const char *msgid, size_t *lengthp))
152 extern char *__gettext PARAMS ((const char *__msgid));
153 extern char *__dgettext PARAMS ((const char *__domainname,
154 const char *__msgid));
155 extern char *__dcgettext PARAMS ((const char *__domainname,
156 const char *__msgid, int __category));
157 extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
158 unsigned long int __n));
159 extern char *__dngettext PARAMS ((const char *__domainname,
160 const char *__msgid1, const char *__msgid2,
161 unsigned long int n));
162 extern char *__dcngettext PARAMS ((const char *__domainname,
163 const char *__msgid1, const char *__msgid2,
164 unsigned long int __n, int __category));
165 extern char *__dcigettext PARAMS ((const char *__domainname,
166 const char *__msgid1, const char *__msgid2,
167 int __plural, unsigned long int __n,
169 extern char *__textdomain PARAMS ((const char *__domainname));
170 extern char *__bindtextdomain PARAMS ((const char *__domainname,
171 const char *__dirname));
172 extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
173 const char *__codeset));
175 extern char *gettext__ PARAMS ((const char *__msgid));
176 extern char *dgettext__ PARAMS ((const char *__domainname,
177 const char *__msgid));
178 extern char *dcgettext__ PARAMS ((const char *__domainname,
179 const char *__msgid, int __category));
180 extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
181 unsigned long int __n));
182 extern char *dngettext__ PARAMS ((const char *__domainname,
183 const char *__msgid1, const char *__msgid2,
184 unsigned long int __n));
185 extern char *dcngettext__ PARAMS ((const char *__domainname,
186 const char *__msgid1, const char *__msgid2,
187 unsigned long int __n, int __category));
188 extern char *dcigettext__ PARAMS ((const char *__domainname,
189 const char *__msgid1, const char *__msgid2,
190 int __plural, unsigned long int __n,
192 extern char *textdomain__ PARAMS ((const char *__domainname));
193 extern char *bindtextdomain__ PARAMS ((const char *__domainname,
194 const char *__dirname));
195 extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
196 const char *__codeset));
199 /* @@ begin of epilog @@ */
201 #endif /* gettextP.h */