2002-08-23 10:02:08 +02:00
|
|
|
/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
|
|
|
|
Library.
|
2015-02-26 19:01:30 +01:00
|
|
|
Copyright (C) 1995, 2000-2003, 2005 Free Software Foundation, Inc.
|
2002-08-23 10:02:08 +02:00
|
|
|
|
2015-02-26 19:01:30 +01:00
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
2002-08-23 10:02:08 +02:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2015-02-26 19:01:30 +01:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
2002-08-23 10:02:08 +02:00
|
|
|
|
2015-02-26 19:01:30 +01:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2002-08-23 10:02:08 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "gettextP.h"
|
|
|
|
|
|
|
|
/* @@ end of prolog @@ */
|
|
|
|
|
2003-10-25 18:34:36 +02:00
|
|
|
/* 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 <libintl.h> 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). */
|
2002-08-23 10:02:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
#undef gettext
|
|
|
|
#undef dgettext
|
|
|
|
#undef dcgettext
|
|
|
|
#undef ngettext
|
|
|
|
#undef dngettext
|
|
|
|
#undef dcngettext
|
|
|
|
#undef textdomain
|
|
|
|
#undef bindtextdomain
|
|
|
|
#undef bind_textdomain_codeset
|
|
|
|
|
|
|
|
|
2003-10-25 18:34:36 +02:00
|
|
|
/* 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. */
|
2007-10-23 12:48:09 +02:00
|
|
|
#if HAVE_VISIBILITY && BUILDING_DLL
|
|
|
|
# define DLL_EXPORTED __attribute__((__visibility__("default")))
|
|
|
|
#elif defined _MSC_VER && BUILDING_DLL
|
2003-10-25 18:34:36 +02:00
|
|
|
# define DLL_EXPORTED __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
# define DLL_EXPORTED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
DLL_EXPORTED
|
2002-08-23 10:02:08 +02:00
|
|
|
char *
|
2004-07-27 17:12:00 +02:00
|
|
|
gettext (const char *msgid)
|
2002-08-23 10:02:08 +02:00
|
|
|
{
|
2003-10-25 18:34:36 +02:00
|
|
|
return libintl_gettext (msgid);
|
2002-08-23 10:02:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-25 18:34:36 +02:00
|
|
|
DLL_EXPORTED
|
2002-08-23 10:02:08 +02:00
|
|
|
char *
|
2004-07-27 17:12:00 +02:00
|
|
|
dgettext (const char *domainname, const char *msgid)
|
2002-08-23 10:02:08 +02:00
|
|
|
{
|
2003-10-25 18:34:36 +02:00
|
|
|
return libintl_dgettext (domainname, msgid);
|
2002-08-23 10:02:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-25 18:34:36 +02:00
|
|
|
DLL_EXPORTED
|
2002-08-23 10:02:08 +02:00
|
|
|
char *
|
2004-07-27 17:12:00 +02:00
|
|
|
dcgettext (const char *domainname, const char *msgid, int category)
|
2002-08-23 10:02:08 +02:00
|
|
|
{
|
2003-10-25 18:34:36 +02:00
|
|
|
return libintl_dcgettext (domainname, msgid, category);
|
2002-08-23 10:02:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-25 18:34:36 +02:00
|
|
|
DLL_EXPORTED
|
2002-08-23 10:02:08 +02:00
|
|
|
char *
|
2004-07-27 17:12:00 +02:00
|
|
|
ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
|
2002-08-23 10:02:08 +02:00
|
|
|
{
|
2003-10-25 18:34:36 +02:00
|
|
|
return libintl_ngettext (msgid1, msgid2, n);
|
2002-08-23 10:02:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-25 18:34:36 +02:00
|
|
|
DLL_EXPORTED
|
2002-08-23 10:02:08 +02:00
|
|
|
char *
|
2004-07-27 17:12:00 +02:00
|
|
|
dngettext (const char *domainname,
|
2012-12-14 16:08:23 +01:00
|
|
|
const char *msgid1, const char *msgid2, unsigned long int n)
|
2002-08-23 10:02:08 +02:00
|
|
|
{
|
2003-10-25 18:34:36 +02:00
|
|
|
return libintl_dngettext (domainname, msgid1, msgid2, n);
|
2002-08-23 10:02:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-25 18:34:36 +02:00
|
|
|
DLL_EXPORTED
|
2002-08-23 10:02:08 +02:00
|
|
|
char *
|
2004-07-27 17:12:00 +02:00
|
|
|
dcngettext (const char *domainname,
|
2012-12-14 16:08:23 +01:00
|
|
|
const char *msgid1, const char *msgid2, unsigned long int n,
|
|
|
|
int category)
|
2002-08-23 10:02:08 +02:00
|
|
|
{
|
2003-10-25 18:34:36 +02:00
|
|
|
return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
|
2002-08-23 10:02:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-25 18:34:36 +02:00
|
|
|
DLL_EXPORTED
|
2002-08-23 10:02:08 +02:00
|
|
|
char *
|
2004-07-27 17:12:00 +02:00
|
|
|
textdomain (const char *domainname)
|
2002-08-23 10:02:08 +02:00
|
|
|
{
|
2003-10-25 18:34:36 +02:00
|
|
|
return libintl_textdomain (domainname);
|
2002-08-23 10:02:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-25 18:34:36 +02:00
|
|
|
DLL_EXPORTED
|
2002-08-23 10:02:08 +02:00
|
|
|
char *
|
2004-07-27 17:12:00 +02:00
|
|
|
bindtextdomain (const char *domainname, const char *dirname)
|
2002-08-23 10:02:08 +02:00
|
|
|
{
|
2003-10-25 18:34:36 +02:00
|
|
|
return libintl_bindtextdomain (domainname, dirname);
|
2002-08-23 10:02:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-25 18:34:36 +02:00
|
|
|
DLL_EXPORTED
|
2002-08-23 10:02:08 +02:00
|
|
|
char *
|
2004-07-27 17:12:00 +02:00
|
|
|
bind_textdomain_codeset (const char *domainname, const char *codeset)
|
2002-08-23 10:02:08 +02:00
|
|
|
{
|
2003-10-25 18:34:36 +02:00
|
|
|
return libintl_bind_textdomain_codeset (domainname, codeset);
|
2002-08-23 10:02:08 +02:00
|
|
|
}
|