Patch-ID: bash40-030
[bash.git] / lib / intl / intl-compat.c
blob7f32349919777408f45e573c485e1c1db176e48a
1 /* intl-compat.c - Stub functions to call gettext functions from GNU gettext library. */
3 /* Copyright (C) 1995, 2000-2003, 2005-2009 Free Software Foundation, Inc.
5 This file is part of GNU Bash.
7 Bash is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 Bash is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Bash. If not, see <http://www.gnu.org/licenses/>.
21 #ifdef HAVE_CONFIG_H
22 # include <config.h>
23 #endif
25 #include "gettextP.h"
27 /* @@ end of prolog @@ */
29 /* This file redirects the gettext functions (without prefix) to those
30 defined in the included GNU libintl library (with "libintl_" prefix).
31 It is compiled into libintl in order to make the AM_GNU_GETTEXT test
32 of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which
33 has the redirections primarily in the <libintl.h> include file.
34 It is also compiled into libgnuintl so that libgnuintl.so can be used
35 as LD_PRELOADable library on glibc systems, to provide the extra
36 features that the functions in the libc don't have (namely, logging). */
39 #undef gettext
40 #undef dgettext
41 #undef dcgettext
42 #undef ngettext
43 #undef dngettext
44 #undef dcngettext
45 #undef textdomain
46 #undef bindtextdomain
47 #undef bind_textdomain_codeset
50 /* When building a DLL, we must export some functions. Note that because
51 the functions are only defined for binary backward compatibility, we
52 don't need to use __declspec(dllimport) in any case. */
53 #if defined _MSC_VER && BUILDING_DLL
54 # define DLL_EXPORTED __declspec(dllexport)
55 #else
56 # define DLL_EXPORTED
57 #endif
60 DLL_EXPORTED
61 char *
62 gettext (msgid)
63 const char *msgid;
65 return libintl_gettext (msgid);
69 DLL_EXPORTED
70 char *
71 dgettext (domainname, msgid)
72 const char *domainname;
73 const char *msgid;
75 return libintl_dgettext (domainname, msgid);
79 DLL_EXPORTED
80 char *
81 dcgettext (domainname, msgid, category)
82 const char *domainname;
83 const char *msgid;
84 int category;
86 return libintl_dcgettext (domainname, msgid, category);
90 DLL_EXPORTED
91 char *
92 ngettext (msgid1, msgid2, n)
93 const char *msgid1;
94 const char *msgid2;
95 unsigned long int n;
97 return libintl_ngettext (msgid1, msgid2, n);
101 DLL_EXPORTED
102 char *
103 dngettext (domainname, msgid1, msgid2, n)
104 const char *domainname;
105 const char *msgid1;
106 const char *msgid2;
107 unsigned long int n;
109 return libintl_dngettext (domainname, msgid1, msgid2, n);
113 DLL_EXPORTED
114 char *
115 dcngettext (domainname, msgid1, msgid2, n, category)
116 const char *domainname;
117 const char *msgid1;
118 const char *msgid2;
119 unsigned long int n;
120 int category;
122 return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
126 DLL_EXPORTED
127 char *
128 textdomain (domainname)
129 const char *domainname;
131 return libintl_textdomain (domainname);
135 DLL_EXPORTED
136 char *
137 bindtextdomain (domainname, dirname)
138 const char *domainname;
139 const char *dirname;
141 return libintl_bindtextdomain (domainname, dirname);
145 DLL_EXPORTED
146 char *
147 bind_textdomain_codeset (domainname, codeset)
148 const char *domainname;
149 const char *codeset;
151 return libintl_bind_textdomain_codeset (domainname, codeset);