Back to index

tetex-bin  3.0
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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
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 defined _MSC_VER && BUILDING_DLL
00053 # define DLL_EXPORTED __declspec(dllexport)
00054 #else
00055 # define DLL_EXPORTED
00056 #endif
00057 
00058 
00059 DLL_EXPORTED
00060 char *
00061 gettext (const char *msgid)
00062 {
00063   return libintl_gettext (msgid);
00064 }
00065 
00066 
00067 DLL_EXPORTED
00068 char *
00069 dgettext (const char *domainname, const char *msgid)
00070 {
00071   return libintl_dgettext (domainname, msgid);
00072 }
00073 
00074 
00075 DLL_EXPORTED
00076 char *
00077 dcgettext (const char *domainname, const char *msgid, int category)
00078 {
00079   return libintl_dcgettext (domainname, msgid, category);
00080 }
00081 
00082 
00083 DLL_EXPORTED
00084 char *
00085 ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
00086 {
00087   return libintl_ngettext (msgid1, msgid2, n);
00088 }
00089 
00090 
00091 DLL_EXPORTED
00092 char *
00093 dngettext (const char *domainname,
00094           const char *msgid1, const char *msgid2, unsigned long int n)
00095 {
00096   return libintl_dngettext (domainname, msgid1, msgid2, n);
00097 }
00098 
00099 
00100 DLL_EXPORTED
00101 char *
00102 dcngettext (const char *domainname,
00103            const char *msgid1, const char *msgid2, unsigned long int n,
00104            int category)
00105 {
00106   return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
00107 }
00108 
00109 
00110 DLL_EXPORTED
00111 char *
00112 textdomain (const char *domainname)
00113 {
00114   return libintl_textdomain (domainname);
00115 }
00116 
00117 
00118 DLL_EXPORTED
00119 char *
00120 bindtextdomain (const char *domainname, const char *dirname)
00121 {
00122   return libintl_bindtextdomain (domainname, dirname);
00123 }
00124 
00125 
00126 DLL_EXPORTED
00127 char *
00128 bind_textdomain_codeset (const char *domainname, const char *codeset)
00129 {
00130   return libintl_bind_textdomain_codeset (domainname, codeset);
00131 }