1 /* Message catalogs for internationalization.
2 Copyright (C) 1995-1997, 2000, 2001 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 then includes <libintl.h> (i.e.
28 this file!) and then only defines LC_MESSAGES. To avoid a redefinition
29 warning, don't define LC_MESSAGES in this case. */
30 #if !defined LC_MESSAGES && !defined __LOCALE_H
31 # define LC_MESSAGES 1729
34 /* We define an additional symbol to signal that we use the GNU
35 implementation of gettext. */
36 #define __USE_GNU_GETTEXT 1
38 /* Resolve a platform specific conflict on DJGPP. GNU gettext takes
39 precedence over _conio_gettext. */
42 # define gettext gettext
46 # if __STDC__ || defined __cplusplus
47 # define PARAMS(args) args
49 # define PARAMS(args) ()
57 /* Look up MSGID in the current default message catalog for the current
58 LC_MESSAGES locale. If not found, returns MSGID itself (the default
60 extern char *gettext PARAMS ((const char *__msgid));
62 /* Look up MSGID in the DOMAINNAME message catalog for the current
63 LC_MESSAGES locale. */
64 extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
66 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
68 extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
72 /* Similar to `gettext' but select the plural form corresponding to the
74 extern char *ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
75 unsigned long int __n));
77 /* Similar to `dgettext' but select the plural form corresponding to the
79 extern char *dngettext PARAMS ((const char *__domainname, const char *__msgid1,
80 const char *__msgid2, unsigned long int __n));
82 /* Similar to `dcgettext' but select the plural form corresponding to the
84 extern char *dcngettext PARAMS ((const char *__domainname, const char *__msgid1,
85 const char *__msgid2, unsigned long int __n,
89 /* Set the current default message catalog to DOMAINNAME.
90 If DOMAINNAME is null, return the current default.
91 If DOMAINNAME is "", reset to the default of "messages". */
92 extern char *textdomain PARAMS ((const char *__domainname));
94 /* Specify that the DOMAINNAME message catalog will be found
95 in DIRNAME rather than in the system locale data base. */
96 extern char *bindtextdomain PARAMS ((const char *__domainname,
97 const char *__dirname));
99 /* Specify the character encoding in which the messages from the
100 DOMAINNAME message catalog will be returned. */
101 extern char *bind_textdomain_codeset PARAMS ((const char *__domainname,
102 const char *__codeset));
105 /* Optimized version of the functions above. */
106 #if defined __OPTIMIZED
107 /* These are macros, but could also be inline functions. */
109 # define gettext(msgid) \
110 dgettext (NULL, msgid)
112 # define dgettext(domainname, msgid) \
113 dcgettext (domainname, msgid, LC_MESSAGES)
115 # define ngettext(msgid1, msgid2, n) \
116 dngettext (NULL, msgid1, msgid2, n)
118 # define dngettext(domainname, msgid1, msgid2, n) \
119 dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
121 #endif /* Optimizing. */
128 #endif /* libintl.h */