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
45 /* Use _INTL_PARAMS, not PARAMS, in order to avoid clashes with identifiers
46 used by programs. Similarly, test __PROTOTYPES, not PROTOTYPES. */
48 # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
49 # define _INTL_PARAMS(args) args
51 # define _INTL_PARAMS(args) ()
59 /* Look up MSGID in the current default message catalog for the current
60 LC_MESSAGES locale. If not found, returns MSGID itself (the default
62 extern char *gettext _INTL_PARAMS ((const char *__msgid));
64 /* Look up MSGID in the DOMAINNAME message catalog for the current
65 LC_MESSAGES locale. */
66 extern char *dgettext _INTL_PARAMS ((const char *__domainname,
67 const char *__msgid));
69 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
71 extern char *dcgettext _INTL_PARAMS ((const char *__domainname,
76 /* Similar to `gettext' but select the plural form corresponding to the
78 extern char *ngettext _INTL_PARAMS ((const char *__msgid1,
80 unsigned long int __n));
82 /* Similar to `dgettext' but select the plural form corresponding to the
84 extern char *dngettext _INTL_PARAMS ((const char *__domainname,
87 unsigned long int __n));
89 /* Similar to `dcgettext' but select the plural form corresponding to the
91 extern char *dcngettext _INTL_PARAMS ((const char *__domainname,
94 unsigned long int __n,
98 /* Set the current default message catalog to DOMAINNAME.
99 If DOMAINNAME is null, return the current default.
100 If DOMAINNAME is "", reset to the default of "messages". */
101 extern char *textdomain _INTL_PARAMS ((const char *__domainname));
103 /* Specify that the DOMAINNAME message catalog will be found
104 in DIRNAME rather than in the system locale data base. */
105 extern char *bindtextdomain _INTL_PARAMS ((const char *__domainname,
106 const char *__dirname));
108 /* Specify the character encoding in which the messages from the
109 DOMAINNAME message catalog will be returned. */
110 extern char *bind_textdomain_codeset _INTL_PARAMS ((const char *__domainname,
111 const char *__codeset));
114 /* Optimized version of the functions above. */
115 #if defined __OPTIMIZED
116 /* These are macros, but could also be inline functions. */
118 # define gettext(msgid) \
119 dgettext (NULL, msgid)
121 # define dgettext(domainname, msgid) \
122 dcgettext (domainname, msgid, LC_MESSAGES)
124 # define ngettext(msgid1, msgid2, n) \
125 dngettext (NULL, msgid1, msgid2, n)
127 # define dngettext(domainname, msgid1, msgid2, n) \
128 dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
130 #endif /* Optimizing. */
137 #endif /* libintl.h */