24
24
/* Get declarations of GNU message catalog functions. */
25
25
# include <libintl.h>
27
/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
28
the gettext() and ngettext() macros. This is an alternative to calling
29
textdomain(), and is useful for libraries. */
30
# ifdef DEFAULT_TEXT_DOMAIN
32
# define gettext(Msgid) \
33
dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
35
# define ngettext(Msgid1, Msgid2, N) \
36
dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
29
41
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
52
64
On pre-ANSI systems without 'const', the config.h file is supposed to
53
65
contain "#define const". */
54
66
# define gettext(Msgid) ((const char *) (Msgid))
55
# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
56
# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
67
# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
68
# define dcgettext(Domainname, Msgid, Category) \
69
((void) (Category), dgettext (Domainname, Msgid))
57
70
# define ngettext(Msgid1, Msgid2, N) \
58
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
72
? ((void) (Msgid2), (const char *) (Msgid1)) \
73
: ((void) (Msgid1), (const char *) (Msgid2)))
59
74
# define dngettext(Domainname, Msgid1, Msgid2, N) \
60
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
75
((void) (Domainname), ngettext (Msgid1, Msgid2, N))
61
76
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
62
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
77
((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
63
78
# define textdomain(Domainname) ((const char *) (Domainname))
64
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
65
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
79
# define bindtextdomain(Domainname, Dirname) \
80
((void) (Domainname), (const char *) (Dirname))
81
# define bind_textdomain_codeset(Domainname, Codeset) \
82
((void) (Domainname), (const char *) (Codeset))
82
99
MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
83
100
short and rarely need to change.
84
101
The letter 'p' stands for 'particular' or 'special'. */
85
#define pgettext(Msgctxt, Msgid) \
86
pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
102
#ifdef DEFAULT_TEXT_DOMAIN
103
# define pgettext(Msgctxt, Msgid) \
104
pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
106
# define pgettext(Msgctxt, Msgid) \
107
pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
87
109
#define dpgettext(Domainname, Msgctxt, Msgid) \
88
110
pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
89
111
#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
90
112
pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
91
#define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
92
npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
113
#ifdef DEFAULT_TEXT_DOMAIN
114
# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
115
npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
117
# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
118
npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
93
120
#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
94
121
npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
95
122
#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \