Back to index

cell-binutils  2.17cvs20070401
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., 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 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 (msgid)
00062      const char *msgid;
00063 {
00064   return libintl_gettext (msgid);
00065 }
00066 
00067 
00068 DLL_EXPORTED
00069 char *
00070 dgettext (domainname, msgid)
00071      const char *domainname;
00072      const char *msgid;
00073 {
00074   return libintl_dgettext (domainname, msgid);
00075 }
00076 
00077 
00078 DLL_EXPORTED
00079 char *
00080 dcgettext (domainname, msgid, category)
00081      const char *domainname;
00082      const char *msgid;
00083      int category;
00084 {
00085   return libintl_dcgettext (domainname, msgid, category);
00086 }
00087 
00088 
00089 DLL_EXPORTED
00090 char *
00091 ngettext (msgid1, msgid2, n)
00092      const char *msgid1;
00093      const char *msgid2;
00094      unsigned long int n;
00095 {
00096   return libintl_ngettext (msgid1, msgid2, n);
00097 }
00098 
00099 
00100 DLL_EXPORTED
00101 char *
00102 dngettext (domainname, msgid1, msgid2, n)
00103      const char *domainname;
00104      const char *msgid1;
00105      const char *msgid2;
00106      unsigned long int n;
00107 {
00108   return libintl_dngettext (domainname, msgid1, msgid2, n);
00109 }
00110 
00111 
00112 DLL_EXPORTED
00113 char *
00114 dcngettext (domainname, msgid1, msgid2, n, category)
00115      const char *domainname;
00116      const char *msgid1;
00117      const char *msgid2;
00118      unsigned long int n;
00119      int category;
00120 {
00121   return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
00122 }
00123 
00124 
00125 DLL_EXPORTED
00126 char *
00127 textdomain (domainname)
00128      const char *domainname;
00129 {
00130   return libintl_textdomain (domainname);
00131 }
00132 
00133 
00134 DLL_EXPORTED
00135 char *
00136 bindtextdomain (domainname, dirname)
00137      const char *domainname;
00138      const char *dirname;
00139 {
00140   return libintl_bindtextdomain (domainname, dirname);
00141 }
00142 
00143 
00144 DLL_EXPORTED
00145 char *
00146 bind_textdomain_codeset (domainname, codeset)
00147      const char *domainname;
00148      const char *codeset;
00149 {
00150   return libintl_bind_textdomain_codeset (domainname, codeset);
00151 }