Back to index

courier  0.68.2
intl-compat.c
Go to the documentation of this file.
00001 /* intl-compat.c - Stub functions to call gettext functions from GNU gettext
00002    Library.
00003    Copyright (C) 1995, 2000-2003, 2005 Software Foundation, Inc.
00004 
00005    This program is free software; you can redistribute it and/or modify it
00006    under the terms of the GNU Library General Public License as published
00007    by the Free Software Foundation; either version 2, or (at your option)
00008    any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public
00016    License along with this program; if not, write to the Free Software
00017    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00018    USA.  */
00019 
00020 #ifdef HAVE_CONFIG_H
00021 # include <config.h>
00022 #endif
00023 
00024 #include "gettextP.h"
00025 
00026 /* @@ end of prolog @@ */
00027 
00028 /* This file redirects the gettext functions (without prefix) to those
00029    defined in the included GNU libintl library (with "libintl_" prefix).
00030    It is compiled into libintl in order to make the AM_GNU_GETTEXT test
00031    of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which
00032    has the redirections primarily in the <libintl.h> include file.
00033    It is also compiled into libgnuintl so that libgnuintl.so can be used
00034    as LD_PRELOADable library on glibc systems, to provide the extra
00035    features that the functions in the libc don't have (namely, logging).  */
00036 
00037 
00038 #undef gettext
00039 #undef dgettext
00040 #undef dcgettext
00041 #undef ngettext
00042 #undef dngettext
00043 #undef dcngettext
00044 #undef textdomain
00045 #undef bindtextdomain
00046 #undef bind_textdomain_codeset
00047 
00048 
00049 /* When building a DLL, we must export some functions.  Note that because
00050    the functions are only defined for binary backward compatibility, we
00051    don't need to use __declspec(dllimport) in any case.  */
00052 #if HAVE_VISIBILITY && BUILDING_DLL
00053 # define DLL_EXPORTED __attribute__((__visibility__("default")))
00054 #elif defined _MSC_VER && BUILDING_DLL
00055 # define DLL_EXPORTED __declspec(dllexport)
00056 #else
00057 # define DLL_EXPORTED
00058 #endif
00059 
00060 
00061 DLL_EXPORTED
00062 char *
00063 gettext (const char *msgid)
00064 {
00065   return libintl_gettext (msgid);
00066 }
00067 
00068 
00069 DLL_EXPORTED
00070 char *
00071 dgettext (const char *domainname, const char *msgid)
00072 {
00073   return libintl_dgettext (domainname, msgid);
00074 }
00075 
00076 
00077 DLL_EXPORTED
00078 char *
00079 dcgettext (const char *domainname, const char *msgid, int category)
00080 {
00081   return libintl_dcgettext (domainname, msgid, category);
00082 }
00083 
00084 
00085 DLL_EXPORTED
00086 char *
00087 ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
00088 {
00089   return libintl_ngettext (msgid1, msgid2, n);
00090 }
00091 
00092 
00093 DLL_EXPORTED
00094 char *
00095 dngettext (const char *domainname,
00096            const char *msgid1, const char *msgid2, unsigned long int n)
00097 {
00098   return libintl_dngettext (domainname, msgid1, msgid2, n);
00099 }
00100 
00101 
00102 DLL_EXPORTED
00103 char *
00104 dcngettext (const char *domainname,
00105             const char *msgid1, const char *msgid2, unsigned long int n,
00106             int category)
00107 {
00108   return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
00109 }
00110 
00111 
00112 DLL_EXPORTED
00113 char *
00114 textdomain (const char *domainname)
00115 {
00116   return libintl_textdomain (domainname);
00117 }
00118 
00119 
00120 DLL_EXPORTED
00121 char *
00122 bindtextdomain (const char *domainname, const char *dirname)
00123 {
00124   return libintl_bindtextdomain (domainname, dirname);
00125 }
00126 
00127 
00128 DLL_EXPORTED
00129 char *
00130 bind_textdomain_codeset (const char *domainname, const char *codeset)
00131 {
00132   return libintl_bind_textdomain_codeset (domainname, codeset);
00133 }