1 /* 2 * tclPlatDecls.h -- 3 * 4 * Declarations of platform specific Tcl APIs. 5 * 6 * Copyright (c) 1998-1999 by Scriptics Corporation. 7 * All rights reserved. 8 */ 9 10 #ifndef _TCLPLATDECLS 11 #define _TCLPLATDECLS 12 13 #undef TCL_STORAGE_CLASS 14 #ifdef BUILD_tcl 15 # define TCL_STORAGE_CLASS DLLEXPORT 16 #else 17 # ifdef USE_TCL_STUBS 18 # define TCL_STORAGE_CLASS 19 # else 20 # define TCL_STORAGE_CLASS DLLIMPORT 21 # endif 22 #endif 23 24 /* 25 * TCHAR is needed here for win32, so if it is not defined yet do it here. 26 * This way, we don't need to include <tchar.h> just for one define. 27 */ 28 #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(_TCHAR_DEFINED) 29 # if defined(_UNICODE) 30 typedef wchar_t TCHAR; 31 # else 32 typedef char TCHAR; 33 # endif 34 # define _TCHAR_DEFINED 35 #endif 36 37 /* !BEGIN!: Do not edit below this line. */ 38 39 #ifdef __cplusplus 40 extern "C" { 41 #endif 42 43 /* 44 * Exported function declarations: 45 */ 46 47 #if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ 48 #ifndef Tcl_WinUtfToTChar_TCL_DECLARED 49 #define Tcl_WinUtfToTChar_TCL_DECLARED 50 /* 0 */ 51 EXTERN TCHAR * Tcl_WinUtfToTChar(CONST char *str, int len, 52 Tcl_DString *dsPtr); 53 #endif 54 #ifndef Tcl_WinTCharToUtf_TCL_DECLARED 55 #define Tcl_WinTCharToUtf_TCL_DECLARED 56 /* 1 */ 57 EXTERN char * Tcl_WinTCharToUtf(CONST TCHAR *str, int len, 58 Tcl_DString *dsPtr); 59 #endif 60 #endif /* WIN */ 61 #ifdef MAC_OSX_TCL /* MACOSX */ 62 #ifndef Tcl_MacOSXOpenBundleResources_TCL_DECLARED 63 #define Tcl_MacOSXOpenBundleResources_TCL_DECLARED 64 /* 0 */ 65 EXTERN int Tcl_MacOSXOpenBundleResources(Tcl_Interp *interp, 66 CONST char *bundleName, int hasResourceFile, 67 int maxPathLen, char *libraryPath); 68 #endif 69 #ifndef Tcl_MacOSXOpenVersionedBundleResources_TCL_DECLARED 70 #define Tcl_MacOSXOpenVersionedBundleResources_TCL_DECLARED 71 /* 1 */ 72 EXTERN int Tcl_MacOSXOpenVersionedBundleResources( 73 Tcl_Interp *interp, CONST char *bundleName, 74 CONST char *bundleVersion, 75 int hasResourceFile, int maxPathLen, 76 char *libraryPath); 77 #endif 78 #endif /* MACOSX */ 79 80 typedef struct TclPlatStubs { 81 int magic; 82 struct TclPlatStubHooks *hooks; 83 84 #if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ 85 TCHAR * (*tcl_WinUtfToTChar) (CONST char *str, int len, Tcl_DString *dsPtr); /* 0 */ 86 char * (*tcl_WinTCharToUtf) (CONST TCHAR *str, int len, Tcl_DString *dsPtr); /* 1 */ 87 #endif /* WIN */ 88 #ifdef MAC_OSX_TCL /* MACOSX */ 89 int (*tcl_MacOSXOpenBundleResources) (Tcl_Interp *interp, CONST char *bundleName, int hasResourceFile, int maxPathLen, char *libraryPath); /* 0 */ 90 int (*tcl_MacOSXOpenVersionedBundleResources) (Tcl_Interp *interp, CONST char *bundleName, CONST char *bundleVersion, int hasResourceFile, int maxPathLen, char *libraryPath); /* 1 */ 91 #endif /* MACOSX */ 92 } TclPlatStubs; 93 94 extern TclPlatStubs *tclPlatStubsPtr; 95 96 #ifdef __cplusplus 97 } 98 #endif 99 100 #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) 101 102 /* 103 * Inline function declarations: 104 */ 105 106 #if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ 107 #ifndef Tcl_WinUtfToTChar 108 #define Tcl_WinUtfToTChar \ 109 (tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */ 110 #endif 111 #ifndef Tcl_WinTCharToUtf 112 #define Tcl_WinTCharToUtf \ 113 (tclPlatStubsPtr->tcl_WinTCharToUtf) /* 1 */ 114 #endif 115 #endif /* WIN */ 116 #ifdef MAC_OSX_TCL /* MACOSX */ 117 #ifndef Tcl_MacOSXOpenBundleResources 118 #define Tcl_MacOSXOpenBundleResources \ 119 (tclPlatStubsPtr->tcl_MacOSXOpenBundleResources) /* 0 */ 120 #endif 121 #ifndef Tcl_MacOSXOpenVersionedBundleResources 122 #define Tcl_MacOSXOpenVersionedBundleResources \ 123 (tclPlatStubsPtr->tcl_MacOSXOpenVersionedBundleResources) /* 1 */ 124 #endif 125 #endif /* MACOSX */ 126 127 #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ 128 129 /* !END!: Do not edit above this line. */ 130 131 #undef TCL_STORAGE_CLASS 132 #define TCL_STORAGE_CLASS DLLIMPORT 133 134 #endif /* _TCLPLATDECLS */ 135 136 137