1 /* intl-compat.c - Stub functions to call gettext functions from GNU gettext
3 Copyright (C) 1995, 2000-2003, 2005, 2015 Free Software Foundation,
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
25 /* @@ end of prolog @@ */
27 /* This file redirects the gettext functions (without prefix) to those
28 defined in the included GNU libintl library (with "libintl_" prefix).
29 It is compiled into libintl in order to make the AM_GNU_GETTEXT test
30 of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which
31 has the redirections primarily in the <libintl.h> include file.
32 It is also compiled into libgnuintl so that libgnuintl.so can be used
33 as LD_PRELOADable library on glibc systems, to provide the extra
34 features that the functions in the libc don't have (namely, logging). */
45 #undef bind_textdomain_codeset
48 /* When building a DLL, we must export some functions. Note that because
49 the functions are only defined for binary backward compatibility, we
50 don't need to use __declspec(dllimport) in any case. */
51 #if HAVE_VISIBILITY && BUILDING_DLL
52 # define DLL_EXPORTED __attribute__((__visibility__("default")))
53 #elif defined _MSC_VER && BUILDING_DLL
54 # define DLL_EXPORTED __declspec(dllexport)
62 gettext (const char *msgid)
64 return libintl_gettext (msgid);
70 dgettext (const char *domainname, const char *msgid)
72 return libintl_dgettext (domainname, msgid);
78 dcgettext (const char *domainname, const char *msgid, int category)
80 return libintl_dcgettext (domainname, msgid, category);
86 ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
88 return libintl_ngettext (msgid1, msgid2, n);
94 dngettext (const char *domainname,
95 const char *msgid1, const char *msgid2, unsigned long int n)
97 return libintl_dngettext (domainname, msgid1, msgid2, n);
103 dcngettext (const char *domainname,
104 const char *msgid1, const char *msgid2, unsigned long int n,
107 return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
113 textdomain (const char *domainname)
115 return libintl_textdomain (domainname);
121 bindtextdomain (const char *domainname, const char *dirname)
123 return libintl_bindtextdomain (domainname, dirname);
129 bind_textdomain_codeset (const char *domainname, const char *codeset)
131 return libintl_bind_textdomain_codeset (domainname, codeset);