~ubuntu-branches/ubuntu/precise/sitecopy/precise

« back to all changes in this revision

Viewing changes to intl/gettextP.h

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2008-07-22 07:31:05 UTC
  • mfrom: (1.1.4 upstream) (4.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080722073105-cbqs1hnc2wvqejfd
Tags: 1:0.16.6-1
* New upstream release
  - fix a crash with progress bar enabled; Closes: #486378
* debian/control
  - set myself as maintainer, Kartik as uploader
  - set Vcs-{Browser,Git} fields
  - bump Standards-Version to 3.8.0
    + debian/README.source added
  - added DM-Upload-Allowed flag
* debian/patches/05_libneon27_transition.dpatch
  - removed since merged upstream
* debian/copyrightdebian/copyright
  - updated upstream email and copyright years
* debian/patches/10_bts410703_preserve_storage_files_sigint.dpatch
  - added to preserve storage files if SIGINT (Ctrl+C) is sent to sitecopy;
    thanks to Andreas Henriksson for the patch; Closes: #410703

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Header describing internals of libintl library.
2
 
   Copyright (C) 1995-1999, 2000-2005 Free Software Foundation, Inc.
 
2
   Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
3
3
   Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
4
4
 
5
5
   This program is free software; you can redistribute it and/or modify it
14
14
 
15
15
   You should have received a copy of the GNU Library General Public
16
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,
 
17
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
18
18
   USA.  */
19
19
 
20
20
#ifndef _GETTEXTP_H
30
30
# endif
31
31
#endif
32
32
 
 
33
/* Handle multi-threaded applications.  */
 
34
#ifdef _LIBC
 
35
# include <bits/libc-lock.h>
 
36
# define gl_rwlock_define __libc_rwlock_define
 
37
#else
 
38
# include "lock.h"
 
39
#endif
 
40
 
 
41
#ifdef _LIBC
 
42
extern char *__gettext (const char *__msgid);
 
43
extern char *__dgettext (const char *__domainname, const char *__msgid);
 
44
extern char *__dcgettext (const char *__domainname, const char *__msgid,
 
45
                          int __category);
 
46
extern char *__ngettext (const char *__msgid1, const char *__msgid2,
 
47
                         unsigned long int __n);
 
48
extern char *__dngettext (const char *__domainname,
 
49
                          const char *__msgid1, const char *__msgid2,
 
50
                          unsigned long int n);
 
51
extern char *__dcngettext (const char *__domainname,
 
52
                           const char *__msgid1, const char *__msgid2,
 
53
                           unsigned long int __n, int __category);
 
54
extern char *__dcigettext (const char *__domainname,
 
55
                           const char *__msgid1, const char *__msgid2,
 
56
                           int __plural, unsigned long int __n,
 
57
                           int __category);
 
58
extern char *__textdomain (const char *__domainname);
 
59
extern char *__bindtextdomain (const char *__domainname,
 
60
                               const char *__dirname);
 
61
extern char *__bind_textdomain_codeset (const char *__domainname,
 
62
                                        const char *__codeset);
 
63
extern void _nl_finddomain_subfreeres (void) attribute_hidden;
 
64
extern void _nl_unload_domain (struct loaded_domain *__domain)
 
65
     internal_function attribute_hidden;
 
66
#else
 
67
/* Declare the exported libintl_* functions, in a way that allows us to
 
68
   call them under their real name.  */
 
69
# undef _INTL_REDIRECT_INLINE
 
70
# undef _INTL_REDIRECT_MACROS
 
71
# define _INTL_REDIRECT_MACROS
 
72
# include "libgnuintl.h"
 
73
# ifdef IN_LIBGLOCALE
 
74
extern char *gl_dcigettext (const char *__domainname,
 
75
                            const char *__msgid1, const char *__msgid2,
 
76
                            int __plural, unsigned long int __n,
 
77
                            int __category,
 
78
                            const char *__localename, const char *__encoding);
 
79
# else
 
80
extern char *libintl_dcigettext (const char *__domainname,
 
81
                                 const char *__msgid1, const char *__msgid2,
 
82
                                 int __plural, unsigned long int __n,
 
83
                                 int __category);
 
84
# endif
 
85
#endif
 
86
 
33
87
#include "loadinfo.h"
34
88
 
35
89
#include "gmo.h"                /* Get nls_uint32.  */
60
114
# define SWAP(i) bswap_32 (i)
61
115
#else
62
116
static inline nls_uint32
 
117
# ifdef __cplusplus
 
118
SWAP (nls_uint32 i)
 
119
# else
63
120
SWAP (i)
64
121
     nls_uint32 i;
 
122
# endif
65
123
{
66
124
  return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
67
125
}
77
135
  const char *pointer;
78
136
};
79
137
 
 
138
/* Cache of translated strings after charset conversion.
 
139
   Note: The strings are converted to the target encoding only on an as-needed
 
140
   basis.  */
 
141
struct converted_domain
 
142
{
 
143
  /* The target encoding name.  */
 
144
  const char *encoding;
 
145
  /* The descriptor for conversion from the message catalog's encoding to
 
146
     this target encoding.  */
 
147
#ifdef _LIBC
 
148
  __gconv_t conv;
 
149
#else
 
150
# if HAVE_ICONV
 
151
  iconv_t conv;
 
152
# endif
 
153
#endif
 
154
  /* The table of translated strings after charset conversion.  */
 
155
  char **conv_tab;
 
156
};
 
157
 
80
158
/* The representation of an opened message catalog.  */
81
159
struct loaded_domain
82
160
{
112
190
  /* 1 if the hash table uses a different endianness than this machine.  */
113
191
  int must_swap_hash_tab;
114
192
 
115
 
  int codeset_cntr;
116
 
#ifdef _LIBC
117
 
  __gconv_t conv;
118
 
#else
119
 
# if HAVE_ICONV
120
 
  iconv_t conv;
121
 
# endif
122
 
#endif
123
 
  char **conv_tab;
 
193
  /* Cache of charset conversions of the translated strings.  */
 
194
  struct converted_domain *conversions;
 
195
  size_t nconversions;
 
196
  gl_rwlock_define (, conversions_lock)
124
197
 
125
 
  struct expression *plural;
 
198
  const struct expression *plural;
126
199
  unsigned long int nplurals;
127
200
};
128
201
 
140
213
{
141
214
  struct binding *next;
142
215
  char *dirname;
143
 
  int codeset_cntr;     /* Incremented each time codeset changes.  */
144
216
  char *codeset;
145
217
  char domainname[ZERO];
146
218
};
148
220
/* A counter which is incremented each time some previous translations
149
221
   become invalid.
150
222
   This variable is part of the external ABI of the GNU libintl.  */
151
 
extern int _nl_msg_cat_cntr;
 
223
#ifdef IN_LIBGLOCALE
 
224
# include <glocale/config.h>
 
225
extern LIBGLOCALE_DLL_EXPORTED int _nl_msg_cat_cntr;
 
226
#else
 
227
extern LIBINTL_DLL_EXPORTED int _nl_msg_cat_cntr;
 
228
#endif
152
229
 
153
230
#ifndef _LIBC
154
 
const char *_nl_language_preferences_default (void);
155
 
const char *_nl_locale_name_posix (int category, const char *categoryname);
156
 
const char *_nl_locale_name_default (void);
157
 
const char *_nl_locale_name (int category, const char *categoryname);
 
231
extern const char *_nl_language_preferences_default (void);
 
232
# define gl_locale_name_canonicalize _nl_locale_name_canonicalize
 
233
extern void _nl_locale_name_canonicalize (char *name);
 
234
# define gl_locale_name_posix _nl_locale_name_posix
 
235
extern const char *_nl_locale_name_posix (int category,
 
236
                                          const char *categoryname);
 
237
# define gl_locale_name_default _nl_locale_name_default
 
238
extern const char *_nl_locale_name_default (void);
 
239
# define gl_locale_name _nl_locale_name
 
240
extern const char *_nl_locale_name (int category, const char *categoryname);
158
241
#endif
159
242
 
160
243
struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
164
247
void _nl_load_domain (struct loaded_l10nfile *__domain,
165
248
                      struct binding *__domainbinding)
166
249
     internal_function;
167
 
void _nl_unload_domain (struct loaded_domain *__domain)
168
 
     internal_function;
169
 
const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file,
170
 
                                  struct loaded_domain *__domain,
171
 
                                  struct binding *__domainbinding)
172
 
     internal_function;
173
 
void _nl_free_domain_conv (struct loaded_domain *__domain)
174
 
     internal_function;
175
250
 
 
251
#ifdef IN_LIBGLOCALE
 
252
char *_nl_find_msg (struct loaded_l10nfile *domain_file,
 
253
                    struct binding *domainbinding, const char *encoding,
 
254
                    const char *msgid,
 
255
                    size_t *lengthp)
 
256
     internal_function;
 
257
#else
176
258
char *_nl_find_msg (struct loaded_l10nfile *domain_file,
177
259
                    struct binding *domainbinding, const char *msgid,
178
 
                    size_t *lengthp)
 
260
                    int convert, size_t *lengthp)
179
261
     internal_function;
180
 
 
 
262
#endif
 
263
 
 
264
/* The internal variables in the standalone libintl.a must have different
 
265
   names than the internal variables in GNU libc, otherwise programs
 
266
   using libintl.a cannot be linked statically.  */
 
267
#if !defined _LIBC
 
268
# define _nl_default_dirname libintl_nl_default_dirname
 
269
# define _nl_domain_bindings libintl_nl_domain_bindings
 
270
#endif
 
271
 
 
272
/* Contains the default location of the message catalogs.  */
 
273
extern const char _nl_default_dirname[];
181
274
#ifdef _LIBC
182
 
extern char *__gettext (const char *__msgid);
183
 
extern char *__dgettext (const char *__domainname, const char *__msgid);
184
 
extern char *__dcgettext (const char *__domainname, const char *__msgid,
185
 
                          int __category);
186
 
extern char *__ngettext (const char *__msgid1, const char *__msgid2,
187
 
                         unsigned long int __n);
188
 
extern char *__dngettext (const char *__domainname,
189
 
                          const char *__msgid1, const char *__msgid2,
190
 
                          unsigned long int n);
191
 
extern char *__dcngettext (const char *__domainname,
192
 
                           const char *__msgid1, const char *__msgid2,
193
 
                           unsigned long int __n, int __category);
194
 
extern char *__dcigettext (const char *__domainname,
195
 
                           const char *__msgid1, const char *__msgid2,
196
 
                           int __plural, unsigned long int __n,
197
 
                           int __category);
198
 
extern char *__textdomain (const char *__domainname);
199
 
extern char *__bindtextdomain (const char *__domainname,
200
 
                               const char *__dirname);
201
 
extern char *__bind_textdomain_codeset (const char *__domainname,
202
 
                                        const char *__codeset);
203
 
#else
204
 
/* Declare the exported libintl_* functions, in a way that allows us to
205
 
   call them under their real name.  */
206
 
# undef _INTL_REDIRECT_INLINE
207
 
# undef _INTL_REDIRECT_MACROS
208
 
# define _INTL_REDIRECT_MACROS
209
 
# include "libgnuintl.h"
210
 
extern char *libintl_dcigettext (const char *__domainname,
211
 
                                 const char *__msgid1, const char *__msgid2,
212
 
                                 int __plural, unsigned long int __n,
213
 
                                 int __category);
214
 
#endif
 
275
libc_hidden_proto (_nl_default_dirname)
 
276
#endif
 
277
 
 
278
/* List with bindings of specific domains.  */
 
279
extern struct binding *_nl_domain_bindings;
 
280
 
 
281
/* The internal variables in the standalone libintl.a must have different
 
282
   names than the internal variables in GNU libc, otherwise programs
 
283
   using libintl.a cannot be linked statically.  */
 
284
#if !defined _LIBC
 
285
# define _nl_default_default_domain libintl_nl_default_default_domain
 
286
# define _nl_current_default_domain libintl_nl_current_default_domain
 
287
#endif
 
288
 
 
289
/* Name of the default text domain.  */
 
290
extern const char _nl_default_default_domain[] attribute_hidden;
 
291
 
 
292
/* Default text domain in which entries for gettext(3) are to be found.  */
 
293
extern const char *_nl_current_default_domain attribute_hidden;
215
294
 
216
295
/* @@ begin of epilog @@ */
217
296