]>
git.saurik.com Git - bison.git/blob - intl/libgnuintl.h
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
5 it under the terms of the GNU General Public License as published by
6 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
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23 /* The LC_MESSAGES locale category is the category used by the functions
24 gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
25 On systems that don't define it, use an arbitrary value instead.
26 On Solaris, <locale.h> defines __LOCALE_H then includes <libintl.h> (i.e.
27 this file!) and then only defines LC_MESSAGES. To avoid a redefinition
28 warning, don't define LC_MESSAGES in this case. */
29 #if !defined LC_MESSAGES && !defined __LOCALE_H
30 # define LC_MESSAGES 1729
33 /* We define an additional symbol to signal that we use the GNU
34 implementation of gettext. */
35 #define __USE_GNU_GETTEXT 1
37 /* Resolve a platform specific conflict on DJGPP. GNU gettext takes
38 precedence over _conio_gettext. */
41 # define gettext gettext
45 # if __STDC__ || defined __cplusplus
46 # define PARAMS(args) args
48 # define PARAMS(args) ()
56 /* Look up MSGID in the current default message catalog for the current
57 LC_MESSAGES locale. If not found, returns MSGID itself (the default
59 extern char *gettext
PARAMS ((const char *__msgid
));
61 /* Look up MSGID in the DOMAINNAME message catalog for the current
62 LC_MESSAGES locale. */
63 extern char *dgettext
PARAMS ((const char *__domainname
, const char *__msgid
));
65 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
67 extern char *dcgettext
PARAMS ((const char *__domainname
, const char *__msgid
,
71 /* Similar to `gettext' but select the plural form corresponding to the
73 extern char *ngettext
PARAMS ((const char *__msgid1
, const char *__msgid2
,
74 unsigned long int __n
));
76 /* Similar to `dgettext' but select the plural form corresponding to the
78 extern char *dngettext
PARAMS ((const char *__domainname
, const char *__msgid1
,
79 const char *__msgid2
, unsigned long int __n
));
81 /* Similar to `dcgettext' but select the plural form corresponding to the
83 extern char *dcngettext
PARAMS ((const char *__domainname
, const char *__msgid1
,
84 const char *__msgid2
, unsigned long int __n
,
88 /* Set the current default message catalog to DOMAINNAME.
89 If DOMAINNAME is null, return the current default.
90 If DOMAINNAME is "", reset to the default of "messages". */
91 extern char *textdomain
PARAMS ((const char *__domainname
));
93 /* Specify that the DOMAINNAME message catalog will be found
94 in DIRNAME rather than in the system locale data base. */
95 extern char *bindtextdomain
PARAMS ((const char *__domainname
,
96 const char *__dirname
));
98 /* Specify the character encoding in which the messages from the
99 DOMAINNAME message catalog will be returned. */
100 extern char *bind_textdomain_codeset
PARAMS ((const char *__domainname
,
101 const char *__codeset
));
104 /* Optimized version of the functions above. */
105 #if defined __OPTIMIZED
106 /* These are macros, but could also be inline functions. */
108 # define gettext(msgid) \
109 dgettext (NULL, msgid)
111 # define dgettext(domainname, msgid) \
112 dcgettext (domainname, msgid, LC_MESSAGES)
114 # define ngettext(msgid1, msgid2, n) \
115 dngettext (NULL, msgid1, msgid2, n)
117 # define dngettext(domainname, msgid1, msgid2, n) \
118 dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
120 #endif /* Optimizing. */
127 #endif /* libintl.h */