~ubuntu-branches/ubuntu/hardy/gnupg2/hardy-security

« back to all changes in this revision

Viewing changes to intl/libgnuintl.h.in

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia, Michael Bienia, Kees Cook
  • Date: 2006-12-07 00:28:23 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20061207002823-0i7ittrpmsm1nv0i
Tags: 2.0.1-0ubuntu1
[ Michael Bienia ]
* New upstream version.
* Remaining changes:
  - Remove libpcsclite-dev, libopensc2-dev build dependencies (they are in
    universe).
* g10/encr-data.c: remotely controllable function pointer (CVE-2006-6235)
* debian/control: add libcurl3-gnutls-dev to build-depends 
  (Closes Ubuntu: #62864)

[ Kees Cook ]
* debian/rules: include doc/ files as done with gnupg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Message catalogs for internationalization.
2
 
   Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
 
2
   Copyright (C) 1995-1997, 2000-2006 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software; you can redistribute it and/or modify it
5
5
   under the terms of the GNU Library General Public License as published
13
13
 
14
14
   You should have received a copy of the GNU Library General Public
15
15
   License along with this program; if not, write to the Free Software
16
 
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
17
   USA.  */
18
18
 
19
19
#ifndef _LIBINTL_H
39
39
/* Provide information about the supported file formats.  Returns the
40
40
   maximum minor revision number supported for a given major revision.  */
41
41
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
42
 
  ((major) == 0 ? 1 : -1)
 
42
  ((major) == 0 || (major) == 1 ? 1 : -1)
43
43
 
44
44
/* Resolve a platform specific conflict on DJGPP.  GNU gettext takes
45
45
   precedence over _conio_gettext.  */
52
52
#endif
53
53
 
54
54
 
 
55
/* Version number: (major<<16) + (minor<<8) + subminor */
 
56
#define LIBINTL_VERSION 0x000F00
 
57
extern int libintl_version;
 
58
 
 
59
 
55
60
/* We redirect the functions to those prefixed with "libintl_".  This is
56
61
   necessary, because some systems define gettext/textdomain/... in the C
57
62
   library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
83
88
   If he doesn't, we choose the method.  A third possible method is
84
89
   _INTL_REDIRECT_ASM, supported only by GCC.  */
85
90
#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
86
 
# if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
 
91
# if __GNUC__ >= 2 && !(__APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
87
92
#  define _INTL_REDIRECT_ASM
88
93
# else
89
94
#  ifdef __cplusplus
102
107
# define _INTL_ASM(cname)
103
108
#endif
104
109
 
 
110
/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
 
111
   its n-th argument literally.  This enables GCC to warn for example about
 
112
   printf (gettext ("foo %y")).  */
 
113
#if __GNUC__ >= 3 && !(__APPLE_CC__ > 1 && defined __cplusplus)
 
114
# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
 
115
#else
 
116
# define _INTL_MAY_RETURN_STRING_ARG(n)
 
117
#endif
 
118
 
105
119
/* Look up MSGID in the current default message catalog for the current
106
120
   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
107
121
   text).  */
108
122
#ifdef _INTL_REDIRECT_INLINE
109
 
extern char *libintl_gettext (const char *__msgid);
 
123
extern char *libintl_gettext (const char *__msgid)
 
124
       _INTL_MAY_RETURN_STRING_ARG (1);
110
125
static inline char *gettext (const char *__msgid)
111
126
{
112
127
  return libintl_gettext (__msgid);
116
131
# define gettext libintl_gettext
117
132
#endif
118
133
extern char *gettext (const char *__msgid)
119
 
       _INTL_ASM (libintl_gettext);
 
134
       _INTL_ASM (libintl_gettext)
 
135
       _INTL_MAY_RETURN_STRING_ARG (1);
120
136
#endif
121
137
 
122
138
/* Look up MSGID in the DOMAINNAME message catalog for the current
123
139
   LC_MESSAGES locale.  */
124
140
#ifdef _INTL_REDIRECT_INLINE
125
 
extern char *libintl_dgettext (const char *__domainname, const char *__msgid);
 
141
extern char *libintl_dgettext (const char *__domainname, const char *__msgid)
 
142
       _INTL_MAY_RETURN_STRING_ARG (2);
126
143
static inline char *dgettext (const char *__domainname, const char *__msgid)
127
144
{
128
145
  return libintl_dgettext (__domainname, __msgid);
132
149
# define dgettext libintl_dgettext
133
150
#endif
134
151
extern char *dgettext (const char *__domainname, const char *__msgid)
135
 
       _INTL_ASM (libintl_dgettext);
 
152
       _INTL_ASM (libintl_dgettext)
 
153
       _INTL_MAY_RETURN_STRING_ARG (2);
136
154
#endif
137
155
 
138
156
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
139
157
   locale.  */
140
158
#ifdef _INTL_REDIRECT_INLINE
141
159
extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
142
 
                                int __category);
 
160
                                int __category)
 
161
       _INTL_MAY_RETURN_STRING_ARG (2);
143
162
static inline char *dcgettext (const char *__domainname, const char *__msgid,
144
163
                               int __category)
145
164
{
151
170
#endif
152
171
extern char *dcgettext (const char *__domainname, const char *__msgid,
153
172
                        int __category)
154
 
       _INTL_ASM (libintl_dcgettext);
 
173
       _INTL_ASM (libintl_dcgettext)
 
174
       _INTL_MAY_RETURN_STRING_ARG (2);
155
175
#endif
156
176
 
157
177
 
159
179
   number N.  */
160
180
#ifdef _INTL_REDIRECT_INLINE
161
181
extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
162
 
                               unsigned long int __n);
 
182
                               unsigned long int __n)
 
183
       _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
163
184
static inline char *ngettext (const char *__msgid1, const char *__msgid2,
164
185
                              unsigned long int __n)
165
186
{
171
192
#endif
172
193
extern char *ngettext (const char *__msgid1, const char *__msgid2,
173
194
                       unsigned long int __n)
174
 
       _INTL_ASM (libintl_ngettext);
 
195
       _INTL_ASM (libintl_ngettext)
 
196
       _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
175
197
#endif
176
198
 
177
199
/* Similar to `dgettext' but select the plural form corresponding to the
178
200
   number N.  */
179
201
#ifdef _INTL_REDIRECT_INLINE
180
202
extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
181
 
                                const char *__msgid2, unsigned long int __n);
 
203
                                const char *__msgid2, unsigned long int __n)
 
204
       _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
182
205
static inline char *dngettext (const char *__domainname, const char *__msgid1,
183
206
                               const char *__msgid2, unsigned long int __n)
184
207
{
191
214
extern char *dngettext (const char *__domainname,
192
215
                        const char *__msgid1, const char *__msgid2,
193
216
                        unsigned long int __n)
194
 
       _INTL_ASM (libintl_dngettext);
 
217
       _INTL_ASM (libintl_dngettext)
 
218
       _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
195
219
#endif
196
220
 
197
221
/* Similar to `dcgettext' but select the plural form corresponding to the
199
223
#ifdef _INTL_REDIRECT_INLINE
200
224
extern char *libintl_dcngettext (const char *__domainname,
201
225
                                 const char *__msgid1, const char *__msgid2,
202
 
                                 unsigned long int __n, int __category);
 
226
                                 unsigned long int __n, int __category)
 
227
       _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
203
228
static inline char *dcngettext (const char *__domainname,
204
229
                                const char *__msgid1, const char *__msgid2,
205
230
                                unsigned long int __n, int __category)
213
238
extern char *dcngettext (const char *__domainname,
214
239
                         const char *__msgid1, const char *__msgid2,
215
240
                         unsigned long int __n, int __category)
216
 
       _INTL_ASM (libintl_dcngettext);
 
241
       _INTL_ASM (libintl_dcngettext)
 
242
       _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
217
243
#endif
218
244
 
219
245
 
 
246
#ifndef IN_LIBGLOCALE
 
247
 
220
248
/* Set the current default message catalog to DOMAINNAME.
221
249
   If DOMAINNAME is null, return the current default.
222
250
   If DOMAINNAME is "", reset to the default of "messages".  */
271
299
       _INTL_ASM (libintl_bind_textdomain_codeset);
272
300
#endif
273
301
 
 
302
#endif /* IN_LIBGLOCALE */
 
303
 
274
304
 
275
305
/* Support for format strings with positions in *printf(), following the
276
306
   POSIX/XSI specification.
300
330
extern int vfprintf (FILE *, const char *, va_list);
301
331
 
302
332
#undef printf
 
333
#if defined __NetBSD__ || defined __CYGWIN__ || defined __MINGW32__
 
334
/* Don't break __attribute__((format(printf,M,N))).
 
335
   This redefinition is only possible because the libc in NetBSD, Cygwin,
 
336
   mingw does not have a function __printf__.  */
 
337
# define libintl_printf __printf__
 
338
#endif
303
339
#define printf libintl_printf
304
340
extern int printf (const char *, ...);
305
341
#undef vprintf