1
/* Message catalogs for internationalization.
2
Copyright (C) 1995-1997, 2000-2002 Free Software Foundation, Inc.
4
This program is free software; you can redistribute it and/or modify it
5
under the terms of the GNU Library General Public License as published
6
by the Free Software Foundation; either version 2, or (at your option)
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public
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,
24
/* The LC_MESSAGES locale category is the category used by the functions
25
gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
26
On systems that don't define it, use an arbitrary value instead.
27
On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
28
then includes <libintl.h> (i.e. this file!) and then only defines
29
LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
31
#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
32
# define LC_MESSAGES 1729
35
/* We define an additional symbol to signal that we use the GNU
36
implementation of gettext. */
37
#define __USE_GNU_GETTEXT 1
39
/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
40
precedence over _conio_gettext. */
43
# define gettext gettext
46
/* Use _INTL_PARAMS, not PARAMS, in order to avoid clashes with identifiers
47
used by programs. Similarly, test __PROTOTYPES, not PROTOTYPES. */
49
# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
50
# define _INTL_PARAMS(args) args
52
# define _INTL_PARAMS(args) ()
60
/* Look up MSGID in the current default message catalog for the current
61
LC_MESSAGES locale. If not found, returns MSGID itself (the default
63
extern char *gettext _INTL_PARAMS ((const char *__msgid));
65
/* Look up MSGID in the DOMAINNAME message catalog for the current
66
LC_MESSAGES locale. */
67
extern char *dgettext _INTL_PARAMS ((const char *__domainname,
68
const char *__msgid));
70
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
72
extern char *dcgettext _INTL_PARAMS ((const char *__domainname,
77
/* Similar to `gettext' but select the plural form corresponding to the
79
extern char *ngettext _INTL_PARAMS ((const char *__msgid1,
81
unsigned long int __n));
83
/* Similar to `dgettext' but select the plural form corresponding to the
85
extern char *dngettext _INTL_PARAMS ((const char *__domainname,
88
unsigned long int __n));
90
/* Similar to `dcgettext' but select the plural form corresponding to the
92
extern char *dcngettext _INTL_PARAMS ((const char *__domainname,
95
unsigned long int __n,
99
/* Set the current default message catalog to DOMAINNAME.
100
If DOMAINNAME is null, return the current default.
101
If DOMAINNAME is "", reset to the default of "messages". */
102
extern char *textdomain _INTL_PARAMS ((const char *__domainname));
104
/* Specify that the DOMAINNAME message catalog will be found
105
in DIRNAME rather than in the system locale data base. */
106
extern char *bindtextdomain _INTL_PARAMS ((const char *__domainname,
107
const char *__dirname));
109
/* Specify the character encoding in which the messages from the
110
DOMAINNAME message catalog will be returned. */
111
extern char *bind_textdomain_codeset _INTL_PARAMS ((const char *__domainname,
112
const char *__codeset));
115
/* Optimized version of the functions above. */
116
#if defined __OPTIMIZED
117
/* These are macros, but could also be inline functions. */
119
# define gettext(msgid) \
120
dgettext (NULL, msgid)
122
# define dgettext(domainname, msgid) \
123
dcgettext (domainname, msgid, LC_MESSAGES)
125
# define ngettext(msgid1, msgid2, n) \
126
dngettext (NULL, msgid1, msgid2, n)
128
# define dngettext(domainname, msgid1, msgid2, n) \
129
dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
131
#endif /* Optimizing. */
138
#endif /* libintl.h */