| 1 | /* This file is part of a Windows32 DLL Interface to:\r |
| 2 | GNU gettext - internationalization aids\r |
| 3 | Copyright (C) 1996, 1998 Free Software Foundation, Inc.\r |
| 4 | \r |
| 5 | This file was written by Franco Bez <franco.bez@gmx.de>\r |
| 6 | \r |
| 7 | This program is free software; you can redistribute it and/or modify\r |
| 8 | it under the terms of the GNU Lesser General Public License as published by\r |
| 9 | the Free Software Foundation; either version 2, or (at your option)\r |
| 10 | any later version.\r |
| 11 | \r |
| 12 | This program is distributed in the hope that it will be useful,\r |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of\r |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r |
| 15 | GNU Lesser General Public License for more details.\r |
| 16 | \r |
| 17 | You should have received a copy of the GNU Lesser General Public License\r |
| 18 | along with this program; if not, write to the Free Software\r |
| 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. */\r |
| 20 | \r |
| 21 | /* REPLACEMENT FOR ORIGINAL LIBINTL.H for use with Windows32 */\r |
| 22 | \r |
| 23 | #if !defined(__LIBINTL_H_INCLUDED)\r |
| 24 | #define __LIBINTL_H_INCLUDED\r |
| 25 | \r |
| 26 | #if defined(__cplusplus)\r |
| 27 | extern "C" { \r |
| 28 | #endif\r |
| 29 | \r |
| 30 | /* See if we allready know what we want static or dll linkage or none at all*/\r |
| 31 | #if defined DONT_USE_GETTEXT || ( defined USE_SAFE_GETTEXT_DLL && defined USE_GETTEXT_STATIC ) || ( defined USE_GETTEXT_DLL && defined USE_SAFE_GETTEXT_DLL ) || ( defined USE_GETTEXT_DLL && defined USE_GETTEXT_STATIC ) \r |
| 32 | /* TWO IS HARDLY POSSIBLE */\r |
| 33 | #undef USE_GETTEXT_DLL\r |
| 34 | #undef USE_GETTEXT_STATIC\r |
| 35 | #undef USE_SAFE_GETTEXT_DLL\r |
| 36 | #endif /* MORE THAN ONE - OR NONE AT ALL */\r |
| 37 | \r |
| 38 | #if !defined USE_GETTEXT_DLL && !defined USE_SAFE_GETTEXT_DLL && !defined USE_GETTEXT_STATIC && !defined DONT_USE_GETTEXT\r |
| 39 | /* not explicitly defined so try to guess it - \r |
| 40 | if GNUC is used - we use static linkage by default\r |
| 41 | because at the moment this is the only plattform\r |
| 42 | for which a static lib is available\r |
| 43 | else we use the DLL built with GNUC */ \r |
| 44 | # define USE_GETTEXT_STATIC\r |
| 45 | #endif /* NONE */\r |
| 46 | \r |
| 47 | /* NOW ONLY ONE OF\r |
| 48 | DONT_USE_GETTEXT , USE_GETTEXT_DLL , USE_SAFE_GETTEXT_DLL , USE_GETTEXT_STATIC \r |
| 49 | IS DEFINED */\r |
| 50 | \r |
| 51 | #if defined USE_GETTEXT_DLL\r |
| 52 | /* exported functions in DLL gnu_gettext.dll \r |
| 53 | you should link with import library \r |
| 54 | -lgnu_gettext (for mingw32) OR gnu_gettext.lib (MSVC) */\r |
| 55 | __declspec(dllimport) char *gettext(const char *__msgid);\r |
| 56 | __declspec(dllimport) char *dgettext(const char *__domainname,const char *__msgid);\r |
| 57 | __declspec(dllimport) char *dcgettext(const char *__domainname,const char *__msgid, int __category);\r |
| 58 | __declspec(dllimport) char *textdomain(const char *__domainname);\r |
| 59 | __declspec(dllimport) char *bindtextdomain(const char *__domainname,const char *__dirname);\r |
| 60 | /* calling _putenv from within the DLL */\r |
| 61 | __declspec(dllexport) int gettext_putenv(const char *envstring);\r |
| 62 | #endif /* DLL */\r |
| 63 | \r |
| 64 | #if defined USE_SAFE_GETTEXT_DLL\r |
| 65 | /* Uses DLL gnu_gettext.dll ONLY if present, otherwise NO translation will take place\r |
| 66 | you should link with "safe_gettext_dll.o -lstdc++" see README for safe_gettext_dll for Details */\r |
| 67 | /* The safe gettext functions */\r |
| 68 | extern char *gettext(const char *szMsgId);\r |
| 69 | extern char *dgettext(const char *szDomain,const char *szMsgId);\r |
| 70 | extern char *dcgettext(const char *szDomain,const char *szMsgId,int iCategory);\r |
| 71 | extern char *textdomain(const char *szDomain);\r |
| 72 | extern char *bindtextdomain(const char *szDomain,const char *szDirectory);\r |
| 73 | /* calling _putenv from within the DLL */\r |
| 74 | extern int gettext_putenv(const char *envstring);\r |
| 75 | #endif /* SAFE DLL */\r |
| 76 | \r |
| 77 | #if defined USE_GETTEXT_STATIC\r |
| 78 | /* exported functions in static library libintl.a \r |
| 79 | and supporting macros\r |
| 80 | you should link with -lintl (mingw32) */\r |
| 81 | extern char *gettext__(const char *__msgid);\r |
| 82 | extern char *dgettext__(const char *__domainname,const char *__msgid);\r |
| 83 | extern char *dcgettext__(const char *__domainname,const char *__msgid, int __category);\r |
| 84 | extern char *textdomain__(const char *__domainname);\r |
| 85 | extern char *bindtextdomain__(const char *__domainname,const char *__dirname);\r |
| 86 | #define gettext(szMsgId) gettext__(szMsgId)\r |
| 87 | #define dgettext(szDomain,szMsgId) dgettext__(szDomain,szMsgId)\r |
| 88 | #define dcgettext(szDomain,szMsgId,iCategory) dcgettext__(szDomain,szMsgId,iCategory)\r |
| 89 | #define textdomain(szDomain) textdomain__(szDomain)\r |
| 90 | #define bindtextdomain(szDomain,szDirectory) bindtextdomain__(szDomain,szDirectory)\r |
| 91 | // dummy - for static linkage - calling _putenv from within the DLL\r |
| 92 | #define gettext_putenv(a) _putenv(a)\r |
| 93 | #endif /* STATIC */\r |
| 94 | \r |
| 95 | #if defined DONT_USE_GETTEXT\r |
| 96 | /* DON'T USE GETTEXT AT ALL\r |
| 97 | MAKROS TO MAKE CODE COMPILE WELL, BUT GETTEXT WILL NOT BE USESD\r |
| 98 | */\r |
| 99 | # define gettext(Msgid) (Msgid)\r |
| 100 | # define dgettext(Domainname, Msgid) (Msgid)\r |
| 101 | # define dcgettext(Domainname, Msgid, Category) (Msgid)\r |
| 102 | # define textdomain(Domainname) ((char *) Domainname)\r |
| 103 | # define bindtextdomain(Domainname, Dirname) ((char *) Dirname)\r |
| 104 | // dummy - for static linkage - calling _putenv from within the DLL\r |
| 105 | # define gettext_putenv(a) _putenv(a)\r |
| 106 | #endif /* DON'T USE AT ALL */\r |
| 107 | \r |
| 108 | #if defined(__cplusplus)\r |
| 109 | } /* extern "C" */\r |
| 110 | #endif\r |
| 111 | \r |
| 112 | #endif /*!defined(__LIBINTL_H_INCLUDED)*/\r |