1
1
/* Convenience header for conditional use of GNU <libintl.h>.
2
Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc.
2
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software Foundation, Inc.
4
4
This program is free software; you can redistribute it and/or modify it
5
5
under the terms of the GNU General Public License as published
6
by the Free Software Foundation; either version 2, or (at your option)
6
by the Free Software Foundation; either version 3, or (at your option)
9
9
This program is distributed in the hope that it will be useful,
64
64
for invalid uses of the value returned from these functions.
65
65
On pre-ANSI systems without 'const', the config.h file is supposed to
66
66
contain "#define const". */
67
68
# define gettext(Msgid) ((const char *) (Msgid))
68
70
# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
69
72
# define dcgettext(Domainname, Msgid, Category) \
70
73
((void) (Category), dgettext (Domainname, Msgid))
71
75
# define ngettext(Msgid1, Msgid2, N) \
73
77
? ((void) (Msgid2), (const char *) (Msgid1)) \
74
78
: ((void) (Msgid1), (const char *) (Msgid2)))
75
80
# define dngettext(Domainname, Msgid1, Msgid2, N) \
76
81
((void) (Domainname), ngettext (Msgid1, Msgid2, N))
77
83
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
78
84
((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
79
86
# define textdomain(Domainname) ((const char *) (Domainname))
87
# undef bindtextdomain
80
88
# define bindtextdomain(Domainname, Dirname) \
81
89
((void) (Domainname), (const char *) (Dirname))
90
# undef bind_textdomain_codeset
82
91
# define bind_textdomain_codeset(Domainname, Codeset) \
83
92
((void) (Domainname), (const char *) (Codeset))
133
142
static const char *
134
143
pgettext_aux (const char *domain,
135
const char *msg_ctxt_id, const char *msgid,
144
const char *msg_ctxt_id, const char *msgid,
138
147
const char *translation = dcgettext (domain, msg_ctxt_id, category);
139
148
if (translation == msg_ctxt_id)
152
161
static const char *
153
162
npgettext_aux (const char *domain,
154
const char *msg_ctxt_id, const char *msgid,
155
const char *msgid_plural, unsigned long int n,
163
const char *msg_ctxt_id, const char *msgid,
164
const char *msgid_plural, unsigned long int n,
158
167
const char *translation =
159
168
dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
192
201
static const char *
193
202
dcpgettext_expr (const char *domain,
194
const char *msgctxt, const char *msgid,
203
const char *msgctxt, const char *msgid,
197
206
size_t msgctxt_len = strlen (msgctxt) + 1;
198
207
size_t msgid_len = strlen (msgid) + 1;
237
246
static const char *
238
247
dcnpgettext_expr (const char *domain,
239
const char *msgctxt, const char *msgid,
240
const char *msgid_plural, unsigned long int n,
248
const char *msgctxt, const char *msgid,
249
const char *msgid_plural, unsigned long int n,
243
252
size_t msgctxt_len = strlen (msgctxt) + 1;
244
253
size_t msgid_len = strlen (msgid) + 1;
260
269
translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
261
270
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
262
271
if (msg_ctxt_id != buf)
265
274
if (!(translation == msg_ctxt_id || translation == msgid_plural))
268
277
return (n == 1 ? msgid : msgid_plural);