3 /* Message catalogs for internationalization.
4 Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Library General Public License as published
8 by the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
26 /* The LC_MESSAGES locale category is the category used by the functions
27 gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
28 On systems that don't define it, use an arbitrary value instead.
29 On Solaris, <locale.h> defines __LOCALE_H then includes <libintl.h> (i.e.
30 this file!) and then only defines LC_MESSAGES. To avoid a redefinition
31 warning, don't define LC_MESSAGES in this case. */
32 #if !defined LC_MESSAGES && !defined __LOCALE_H
33 # define LC_MESSAGES 1729
36 /* We define an additional symbol to signal that we use the GNU
37 implementation of gettext. */
38 #define __USE_GNU_GETTEXT 1
40 /* Resolve a platform specific conflict on DJGPP. GNU gettext takes
41 precedence over _conio_gettext. */
44 # define gettext gettext
47 /* Use _INTL_PARAMS, not PARAMS, in order to avoid clashes with identifiers
48 used by programs. Similarly, test __PROTOTYPES, not PROTOTYPES. */
50 # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
51 # define _INTL_PARAMS(args) args
53 # define _INTL_PARAMS(args) ()
61 /* Look up MSGID in the current default message catalog for the current
62 LC_MESSAGES locale. If not found, returns MSGID itself (the default
64 extern char *gettext
_INTL_PARAMS ((const char *__msgid
));
66 /* Look up MSGID in the DOMAINNAME message catalog for the current
67 LC_MESSAGES locale. */
68 extern char *dgettext
_INTL_PARAMS ((const char *__domainname
,
69 const char *__msgid
));
71 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
73 extern char *dcgettext
_INTL_PARAMS ((const char *__domainname
,
78 /* Similar to `gettext' but select the plural form corresponding to the
80 extern char *ngettext
_INTL_PARAMS ((const char *__msgid1
,
82 unsigned long int __n
));
84 /* Similar to `dgettext' but select the plural form corresponding to the
86 extern char *dngettext
_INTL_PARAMS ((const char *__domainname
,
89 unsigned long int __n
));
91 /* Similar to `dcgettext' but select the plural form corresponding to the
93 extern char *dcngettext
_INTL_PARAMS ((const char *__domainname
,
96 unsigned long int __n
,
100 /* Set the current default message catalog to DOMAINNAME.
101 If DOMAINNAME is null, return the current default.
102 If DOMAINNAME is "", reset to the default of "messages". */
103 extern char *textdomain
_INTL_PARAMS ((const char *__domainname
));
105 /* Specify that the DOMAINNAME message catalog will be found
106 in DIRNAME rather than in the system locale data base. */
107 extern char *bindtextdomain
_INTL_PARAMS ((const char *__domainname
,
108 const char *__dirname
));
110 /* Specify the character encoding in which the messages from the
111 DOMAINNAME message catalog will be returned. */
112 extern char *bind_textdomain_codeset
_INTL_PARAMS ((const char *__domainname
,
113 const char *__codeset
));
116 /* Optimized version of the functions above. */
117 #if defined __OPTIMIZED
118 /* These are macros, but could also be inline functions. */
120 # define gettext(msgid) \
121 dgettext (NULL, msgid)
123 # define dgettext(domainname, msgid) \
124 dcgettext (domainname, msgid, LC_MESSAGES)
126 # define ngettext(msgid1, msgid2, n) \
127 dngettext (NULL, msgid1, msgid2, n)
129 # define dngettext(domainname, msgid1, msgid2, n) \
130 dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
132 #endif /* Optimizing. */
139 #endif /* libintl.h */