]> sourceware.org Git - glibc.git/blame - intl/gettextP.h
Update.
[glibc.git] / intl / gettextP.h
CommitLineData
c84142e8 1/* Header describing internals of gettext library
abbffdf9 2 Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
6570e194 3 Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
c84142e8
UD
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. */
24906b43
RM
19
20#ifndef _GETTEXTP_H
21#define _GETTEXTP_H
22
c90a2db6
UD
23#ifdef _LIBC
24# include "../iconv/gconv_int.h"
25#else
26# if HAVE_ICONV
27# include <iconv.h>
28# endif
6570e194
UD
29#endif
30
7a12c6bb
RM
31#include "loadinfo.h"
32
24906b43
RM
33/* @@ end of prolog @@ */
34
be10a868 35#ifndef PARAMS
24906b43 36# if __STDC__
be10a868 37# define PARAMS(args) args
24906b43 38# else
be10a868 39# define PARAMS(args) ()
24906b43
RM
40# endif
41#endif
42
d0fc4041
UD
43#ifndef internal_function
44# define internal_function
45#endif
46
24906b43
RM
47#ifndef W
48# define W(flag, data) ((flag) ? SWAP (data) : (data))
49#endif
50
be10a868 51
c3d6c951
UD
52#ifdef _LIBC
53# include <byteswap.h>
54# define SWAP(i) bswap_32 (i)
55#else
be10a868
RM
56static nls_uint32 SWAP PARAMS ((nls_uint32 i));
57
24906b43
RM
58static inline nls_uint32
59SWAP (i)
60 nls_uint32 i;
61{
62 return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
63}
c3d6c951 64#endif
24906b43
RM
65
66
abbffdf9
UD
67/* This is the representation of the expressions to determine the
68 plural form. */
69struct expression
70{
71 enum operator
72 {
73 var, /* The variable "n". */
74 num, /* Decimal number. */
75 mult, /* Multiplication. */
76 divide, /* Division. */
77 module, /* Module operation. */
78 plus, /* Addition. */
79 minus, /* Subtraction. */
80 equal, /* Comparision for equality. */
81 not_equal, /* Comparision for inequality. */
82 land, /* Logical AND. */
83 lor, /* Logical OR. */
84 qmop /* Question mark operator. */
85 } operation;
86 union
87 {
88 unsigned long int num; /* Number value for `num'. */
89 struct
90 {
91 struct expression *left; /* Left expression in binary operation. */
92 struct expression *right; /* Right expression in binary operation. */
93 } args2;
94 struct
95 {
96 struct expression *bexp; /* Boolean expression in ?: operation. */
97 struct expression *tbranch; /* True-branch in ?: operation. */
98 struct expression *fbranch; /* False-branch in ?: operation. */
99 } args3;
100 } val;
101};
102
103/* This is the data structure to pass information to the parser and get
104 the result in a thread-safe way. */
105struct parse_args
106{
107 const char *cp;
108 struct expression *res;
109};
110
111
24906b43
RM
112struct loaded_domain
113{
24906b43 114 const char *data;
a5a0310d
UD
115 int use_mmap;
116 size_t mmap_size;
24906b43
RM
117 int must_swap;
118 nls_uint32 nstrings;
119 struct string_desc *orig_tab;
120 struct string_desc *trans_tab;
121 nls_uint32 hash_size;
122 nls_uint32 *hash_tab;
c90a2db6
UD
123#ifdef _LIBC
124 __gconv_t conv;
125#else
126# if HAVE_ICONV
6570e194 127 iconv_t conv;
c90a2db6 128# endif
6570e194
UD
129#endif
130 char **conv_tab;
abbffdf9
UD
131
132 struct expression *plural;
133 unsigned long int nplurals;
24906b43
RM
134};
135
136struct binding
137{
138 struct binding *next;
139 char *domainname;
140 char *dirname;
141};
142
575b273b
UD
143extern int _nl_msg_cat_cntr;
144
7a12c6bb
RM
145struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
146 char *__locale,
d0fc4041
UD
147 const char *__domainname))
148 internal_function;
149void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain))
150 internal_function;
151void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
152 internal_function;
24906b43 153
abbffdf9
UD
154#ifdef _LIBC
155extern char *__ngettext PARAMS ((const char *msgid1, const char *msgid2,
156 unsigned long int n));
157extern char *__dngettext PARAMS ((const char *domainname, const char *msgid1,
158 const char *msgid2, unsigned long int n));
159extern char *__dcngettext PARAMS ((const char *domainname, const char *msgid1,
160 const char *msgid2, unsigned long int n,
161 int category));
162extern char *__dcigettext PARAMS ((const char *domainname, const char *msgid1,
163 const char *msgid2, int plural,
164 unsigned long int n, int category));
165#else
166extern char *ngettext__ PARAMS ((const char *msgid1, const char *msgid2,
167 unsigned long int n));
168extern char *dngettext__ PARAMS ((const char *domainname, const char *msgid1,
169 const char *msgid2, unsigned long int n));
170extern char *dcngettext__ PARAMS ((const char *domainname, const char *msgid1,
171 const char *msgid2, unsigned long int n,
172 int category));
173extern char *dcigettext__ PARAMS ((const char *domainname, const char *msgid1,
174 const char *msgid2, int plural,
175 unsigned long int n, int category));
176#endif
177
178extern int __gettextdebug;
179extern void __gettext_free_exp (struct expression *exp) internal_function;
180extern int __gettextparse (void *arg);
181
24906b43
RM
182/* @@ begin of epilog @@ */
183
184#endif /* gettextP.h */
This page took 0.120445 seconds and 5 git commands to generate.