ccb8c8f2cca884ab026667d27c67bd60031bdcb3
[msysgit.git] / mingw / include / tclPlatDecls.h
blobccb8c8f2cca884ab026667d27c67bd60031bdcb3
1 /*
2 * tclPlatDecls.h --
4 * Declarations of platform specific Tcl APIs.
6 * Copyright (c) 1998-1999 by Scriptics Corporation.
7 * All rights reserved.
8 */
10 #ifndef _TCLPLATDECLS
11 #define _TCLPLATDECLS
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
25 * Pull in the typedef of TCHAR for windows.
27 #if defined(__WIN32__) && !defined(_TCHAR_DEFINED)
28 # include <tchar.h>
29 # ifndef _TCHAR_DEFINED
30 /* Borland seems to forget to set this. */
31 typedef _TCHAR TCHAR;
32 # define _TCHAR_DEFINED
33 # endif
34 # if defined(_MSC_VER) && defined(__STDC__)
35 /* VS2005 SP1 misses this. See [Bug #3110161] */
36 typedef _TCHAR TCHAR;
37 # endif
38 #endif
40 /* !BEGIN!: Do not edit below this line. */
43 * Exported function declarations:
46 #ifdef __WIN32__ /* WIN */
47 #ifndef Tcl_WinUtfToTChar_TCL_DECLARED
48 #define Tcl_WinUtfToTChar_TCL_DECLARED
49 /* 0 */
50 EXTERN TCHAR * Tcl_WinUtfToTChar(CONST char *str, int len,
51 Tcl_DString *dsPtr);
52 #endif
53 #ifndef Tcl_WinTCharToUtf_TCL_DECLARED
54 #define Tcl_WinTCharToUtf_TCL_DECLARED
55 /* 1 */
56 EXTERN char * Tcl_WinTCharToUtf(CONST TCHAR *str, int len,
57 Tcl_DString *dsPtr);
58 #endif
59 #endif /* WIN */
60 #ifdef MAC_OSX_TCL /* MACOSX */
61 #ifndef Tcl_MacOSXOpenBundleResources_TCL_DECLARED
62 #define Tcl_MacOSXOpenBundleResources_TCL_DECLARED
63 /* 0 */
64 EXTERN int Tcl_MacOSXOpenBundleResources(Tcl_Interp *interp,
65 CONST char *bundleName, int hasResourceFile,
66 int maxPathLen, char *libraryPath);
67 #endif
68 #ifndef Tcl_MacOSXOpenVersionedBundleResources_TCL_DECLARED
69 #define Tcl_MacOSXOpenVersionedBundleResources_TCL_DECLARED
70 /* 1 */
71 EXTERN int Tcl_MacOSXOpenVersionedBundleResources(
72 Tcl_Interp *interp, CONST char *bundleName,
73 CONST char *bundleVersion,
74 int hasResourceFile, int maxPathLen,
75 char *libraryPath);
76 #endif
77 #endif /* MACOSX */
79 typedef struct TclPlatStubs {
80 int magic;
81 struct TclPlatStubHooks *hooks;
83 #ifdef __WIN32__ /* WIN */
84 TCHAR * (*tcl_WinUtfToTChar) (CONST char *str, int len, Tcl_DString *dsPtr); /* 0 */
85 char * (*tcl_WinTCharToUtf) (CONST TCHAR *str, int len, Tcl_DString *dsPtr); /* 1 */
86 #endif /* WIN */
87 #ifdef MAC_OSX_TCL /* MACOSX */
88 int (*tcl_MacOSXOpenBundleResources) (Tcl_Interp *interp, CONST char *bundleName, int hasResourceFile, int maxPathLen, char *libraryPath); /* 0 */
89 int (*tcl_MacOSXOpenVersionedBundleResources) (Tcl_Interp *interp, CONST char *bundleName, CONST char *bundleVersion, int hasResourceFile, int maxPathLen, char *libraryPath); /* 1 */
90 #endif /* MACOSX */
91 } TclPlatStubs;
93 #ifdef __cplusplus
94 extern "C" {
95 #endif
96 extern TclPlatStubs *tclPlatStubsPtr;
97 #ifdef __cplusplus
99 #endif
101 #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
104 * Inline function declarations:
107 #ifdef __WIN32__ /* WIN */
108 #ifndef Tcl_WinUtfToTChar
109 #define Tcl_WinUtfToTChar \
110 (tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */
111 #endif
112 #ifndef Tcl_WinTCharToUtf
113 #define Tcl_WinTCharToUtf \
114 (tclPlatStubsPtr->tcl_WinTCharToUtf) /* 1 */
115 #endif
116 #endif /* WIN */
117 #ifdef MAC_OSX_TCL /* MACOSX */
118 #ifndef Tcl_MacOSXOpenBundleResources
119 #define Tcl_MacOSXOpenBundleResources \
120 (tclPlatStubsPtr->tcl_MacOSXOpenBundleResources) /* 0 */
121 #endif
122 #ifndef Tcl_MacOSXOpenVersionedBundleResources
123 #define Tcl_MacOSXOpenVersionedBundleResources \
124 (tclPlatStubsPtr->tcl_MacOSXOpenVersionedBundleResources) /* 1 */
125 #endif
126 #endif /* MACOSX */
128 #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
130 /* !END!: Do not edit above this line. */
132 #undef TCL_STORAGE_CLASS
133 #define TCL_STORAGE_CLASS DLLIMPORT
135 #endif /* _TCLPLATDECLS */