00001 /* Message catalogs for internationalization.
00002 Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
00003
00004 This program is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation; either version 2, or (at your option)
00007 any later version.
00008
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00012 GNU General Public License for more details.
00013
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software Foundation,
00016 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
00017
00018 #ifndef _LIBINTL_H
00019 #define _LIBINTL_H 1
00020
00021 #include <locale.h>
00022
00023 /* The LC_MESSAGES locale category is the category used by the functions
00024 gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
00025 On systems that don't define it, use an arbitrary value instead.
00026 On Solaris, <locale.h> defines __LOCALE_H then includes <libintl.h> (i.e.
00027 this file!) and then only defines LC_MESSAGES. To avoid a redefinition
00028 warning, don't define LC_MESSAGES in this case. */
00029 #if !defined LC_MESSAGES && !defined __LOCALE_H
00030 # define LC_MESSAGES 1729
00031 #endif
00032
00033 /* We define an additional symbol to signal that we use the GNU
00034 implementation of gettext. */
00035 #define __USE_GNU_GETTEXT 1
00036
00037 /* Resolve a platform specific conflict on DJGPP. GNU gettext takes
00038 precedence over _conio_gettext. */
00039 #ifdef __DJGPP__
00040 # undef gettext
00041 # define gettext gettext
00042 #endif
00043
00044 #ifndef PARAMS
00045 # if __STDC__ || defined __cplusplus
00046 # define PARAMS(args) args
00047 # else
00048 # define PARAMS(args) ()
00049 # endif
00050 #endif
00051
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055
00056 /* Look up MSGID in the current default message catalog for the current
00057 LC_MESSAGES locale. If not found, returns MSGID itself (the default
00058 text). */
00059 extern char *gettext PARAMS ((const char *__msgid));
00060
00061 /* Look up MSGID in the DOMAINNAME message catalog for the current
00062 LC_MESSAGES locale. */
00063 extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
00064
00065 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
00066 locale. */
00067 extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
00068 int __category));
00069
00070
00071 /* Similar to `gettext' but select the plural form corresponding to the
00072 number N. */
00073 extern char *ngettext PARAMS ((const char *__msgid1, const char *__msgid2,
00074 unsigned long int __n));
00075
00076 /* Similar to `dgettext' but select the plural form corresponding to the
00077 number N. */
00078 extern char *dngettext PARAMS ((const char *__domainname, const char *__msgid1,
00079 const char *__msgid2, unsigned long int __n));
00080
00081 /* Similar to `dcgettext' but select the plural form corresponding to the
00082 number N. */
00083 extern char *dcngettext PARAMS ((const char *__domainname, const char *__msgid1,
00084 const char *__msgid2, unsigned long int __n,
00085 int __category));
00086
00087
00088 /* Set the current default message catalog to DOMAINNAME.
00089 If DOMAINNAME is null, return the current default.
00090 If DOMAINNAME is "", reset to the default of "messages". */
00091 extern char *textdomain PARAMS ((const char *__domainname));
00092
00093 /* Specify that the DOMAINNAME message catalog will be found
00094 in DIRNAME rather than in the system locale data base. */
00095 extern char *bindtextdomain PARAMS ((const char *__domainname,
00096 const char *__dirname));
00097
00098 /* Specify the character encoding in which the messages from the
00099 DOMAINNAME message catalog will be returned. */
00100 extern char *bind_textdomain_codeset PARAMS ((const char *__domainname,
00101 const char *__codeset));
00102
00103
00104 /* Optimized version of the functions above. */
00105 #if defined __OPTIMIZED
00106 /* These are macros, but could also be inline functions. */
00107
00108 # define gettext(msgid) \
00109 dgettext (NULL, msgid)
00110
00111 # define dgettext(domainname, msgid) \
00112 dcgettext (domainname, msgid, LC_MESSAGES)
00113
00114 # define ngettext(msgid1, msgid2, n) \
00115 dngettext (NULL, msgid1, msgid2, n)
00116
00117 # define dngettext(domainname, msgid1, msgid2, n) \
00118 dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
00119
00120 #endif /* Optimizing. */
00121
00122
00123 #ifdef __cplusplus
00124 }
00125 #endif
00126
00127 #endif /* libintl.h */
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001