VirtualBox

source: kBuild/vendor/sed/current/intl/gettextP.h

Last change on this file was 599, checked in by bird, 18 years ago

GNU sed 4.1.5.

File size: 6.2 KB
Line 
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.
4
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)
8 any later version.
9
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.
14
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
18 USA. */
19
20#ifndef _GETTEXTP_H
21#define _GETTEXTP_H
22
23#include <stddef.h> /* Get size_t. */
24
25#ifdef _LIBC
26# include "../iconv/gconv_int.h"
27#else
28# if HAVE_ICONV
29# include <iconv.h>
30# endif
31#endif
32
33#include "loadinfo.h"
34
35#include "gmo.h" /* Get nls_uint32. */
36
37/* @@ end of prolog @@ */
38
39#ifndef PARAMS
40# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
41# define PARAMS(args) args
42# else
43# define PARAMS(args) ()
44# endif
45#endif
46
47#ifndef internal_function
48# define internal_function
49#endif
50
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)
55#endif
56
57#ifndef W
58# define W(flag, data) ((flag) ? SWAP (data) : (data))
59#endif
60
61
62#ifdef _LIBC
63# include <byteswap.h>
64# define SWAP(i) bswap_32 (i)
65#else
66static inline nls_uint32
67SWAP (i)
68 nls_uint32 i;
69{
70 return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
71}
72#endif
73
74
75/* The representation of an opened message catalog. */
76struct loaded_domain
77{
78 const char *data;
79 int use_mmap;
80 size_t mmap_size;
81 int must_swap;
82 nls_uint32 nstrings;
83 struct string_desc *orig_tab;
84 struct string_desc *trans_tab;
85 nls_uint32 hash_size;
86 nls_uint32 *hash_tab;
87 int codeset_cntr;
88#ifdef _LIBC
89 __gconv_t conv;
90#else
91# if HAVE_ICONV
92 iconv_t conv;
93# endif
94#endif
95 char **conv_tab;
96
97 struct expression *plural;
98 unsigned long int nplurals;
99};
100
101/* We want to allocate a string at the end of the struct. But ISO C
102 doesn't allow zero sized arrays. */
103#ifdef __GNUC__
104# define ZERO 0
105#else
106# define ZERO 1
107#endif
108
109/* A set of settings bound to a message domain. Used to store settings
110 from bindtextdomain() and bind_textdomain_codeset(). */
111struct binding
112{
113 struct binding *next;
114 char *dirname;
115 int codeset_cntr; /* Incremented each time codeset changes. */
116 char *codeset;
117 char domainname[ZERO];
118};
119
120/* A counter which is incremented each time some previous translations
121 become invalid.
122 This variable is part of the external ABI of the GNU libintl. */
123extern int _nl_msg_cat_cntr;
124
125#ifndef _LIBC
126const char *_nl_locale_name PARAMS ((int category, const char *categoryname));
127#endif
128
129struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
130 char *__locale,
131 const char *__domainname,
132 struct binding *__domainbinding))
133 internal_function;
134void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain,
135 struct binding *__domainbinding))
136 internal_function;
137void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
138 internal_function;
139const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file,
140 struct loaded_domain *__domain,
141 struct binding *__domainbinding))
142 internal_function;
143void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain))
144 internal_function;
145
146char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file,
147 struct binding *domainbinding,
148 const char *msgid, size_t *lengthp))
149 internal_function;
150
151#ifdef _LIBC
152extern char *__gettext PARAMS ((const char *__msgid));
153extern char *__dgettext PARAMS ((const char *__domainname,
154 const char *__msgid));
155extern char *__dcgettext PARAMS ((const char *__domainname,
156 const char *__msgid, int __category));
157extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
158 unsigned long int __n));
159extern char *__dngettext PARAMS ((const char *__domainname,
160 const char *__msgid1, const char *__msgid2,
161 unsigned long int n));
162extern char *__dcngettext PARAMS ((const char *__domainname,
163 const char *__msgid1, const char *__msgid2,
164 unsigned long int __n, int __category));
165extern char *__dcigettext PARAMS ((const char *__domainname,
166 const char *__msgid1, const char *__msgid2,
167 int __plural, unsigned long int __n,
168 int __category));
169extern char *__textdomain PARAMS ((const char *__domainname));
170extern char *__bindtextdomain PARAMS ((const char *__domainname,
171 const char *__dirname));
172extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
173 const char *__codeset));
174#else
175extern char *gettext__ PARAMS ((const char *__msgid));
176extern char *dgettext__ PARAMS ((const char *__domainname,
177 const char *__msgid));
178extern char *dcgettext__ PARAMS ((const char *__domainname,
179 const char *__msgid, int __category));
180extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
181 unsigned long int __n));
182extern char *dngettext__ PARAMS ((const char *__domainname,
183 const char *__msgid1, const char *__msgid2,
184 unsigned long int __n));
185extern char *dcngettext__ PARAMS ((const char *__domainname,
186 const char *__msgid1, const char *__msgid2,
187 unsigned long int __n, int __category));
188extern char *dcigettext__ PARAMS ((const char *__domainname,
189 const char *__msgid1, const char *__msgid2,
190 int __plural, unsigned long int __n,
191 int __category));
192extern char *textdomain__ PARAMS ((const char *__domainname));
193extern char *bindtextdomain__ PARAMS ((const char *__domainname,
194 const char *__dirname));
195extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
196 const char *__codeset));
197#endif
198
199/* @@ begin of epilog @@ */
200
201#endif /* gettextP.h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette