X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=intl%2Fintl-compat.c;h=15be09cbcbe70f4850b9732c2b48b227f2267446;hb=896cb74fe2fab71aba57471363196c5332217df0;hp=503efa0fa9c5179f26a8b6cbd57ec36e1398b662;hpb=27de1486ca34aaad446adb798d71a77d6f6304da;p=features.git diff --git a/intl/intl-compat.c b/intl/intl-compat.c index 503efa0fa9..15be09cbcb 100644 --- a/intl/intl-compat.c +++ b/intl/intl-compat.c @@ -1,76 +1,131 @@ /* intl-compat.c - Stub functions to call gettext functions from GNU gettext Library. - Copyright (C) 1995 Software Foundation, Inc. + Copyright (C) 1995, 2000-2003 Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Library General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. */ #ifdef HAVE_CONFIG_H # include #endif -#include "libgettext.h" +#include "gettextP.h" /* @@ end of prolog @@ */ +/* This file redirects the gettext functions (without prefix) to those + defined in the included GNU libintl library (with "libintl_" prefix). + It is compiled into libintl in order to make the AM_GNU_GETTEXT test + of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which + has the redirections primarily in the include file. + It is also compiled into libgnuintl so that libgnuintl.so can be used + as LD_PRELOADable library on glibc systems, to provide the extra + features that the functions in the libc don't have (namely, logging). */ + #undef gettext #undef dgettext #undef dcgettext +#undef ngettext +#undef dngettext +#undef dcngettext #undef textdomain #undef bindtextdomain +#undef bind_textdomain_codeset + + +/* When building a DLL, we must export some functions. Note that because + the functions are only defined for binary backward compatibility, we + don't need to use __declspec(dllimport) in any case. */ +#if defined _MSC_VER && BUILDING_DLL +# define DLL_EXPORTED __declspec(dllexport) +#else +# define DLL_EXPORTED +#endif + + +DLL_EXPORTED +char * +gettext (const char *msgid) +{ + return libintl_gettext (msgid); +} + + +DLL_EXPORTED +char * +dgettext (const char *domainname, const char *msgid) +{ + return libintl_dgettext (domainname, msgid); +} + + +DLL_EXPORTED +char * +dcgettext (const char *domainname, const char *msgid, int category) +{ + return libintl_dcgettext (domainname, msgid, category); +} + + +DLL_EXPORTED +char * +ngettext (const char *msgid1, const char *msgid2, unsigned long int n) +{ + return libintl_ngettext (msgid1, msgid2, n); +} +DLL_EXPORTED char * -bindtextdomain (domainname, dirname) - const char *domainname; - const char *dirname; +dngettext (const char *domainname, + const char *msgid1, const char *msgid2, unsigned long int n) { - return bindtextdomain__ (domainname, dirname); + return libintl_dngettext (domainname, msgid1, msgid2, n); } +DLL_EXPORTED char * -dcgettext (domainname, msgid, category) - const char *domainname; - const char *msgid; - int category; +dcngettext (const char *domainname, + const char *msgid1, const char *msgid2, unsigned long int n, + int category) { - return dcgettext__ (domainname, msgid, category); + return libintl_dcngettext (domainname, msgid1, msgid2, n, category); } +DLL_EXPORTED char * -dgettext (domainname, msgid) - const char *domainname; - const char *msgid; +textdomain (const char *domainname) { - return dgettext__ (domainname, msgid); + return libintl_textdomain (domainname); } +DLL_EXPORTED char * -gettext (msgid) - const char *msgid; +bindtextdomain (const char *domainname, const char *dirname) { - return gettext__ (msgid); + return libintl_bindtextdomain (domainname, dirname); } +DLL_EXPORTED char * -textdomain (domainname) - const char *domainname; +bind_textdomain_codeset (const char *domainname, const char *codeset) { - return textdomain__ (domainname); + return libintl_bind_textdomain_codeset (domainname, codeset); }