Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / include / tclPlatDecls.h
blobb2ebcf30657ed2b846cf0f9662110a534bcaf42d
1 /*
2 * tclPlatDecls.h --
4 * Declarations of platform specific Tcl APIs.
6 * Copyright (c) 1998-1999 by Scriptics Corporation.
7 * All rights reserved.
9 * RCS: @(#) $Id: tclPlatDecls.h,v 1.18.2.5 2004/06/10 17:17:45 andreas_kupries Exp $
12 #ifndef _TCLPLATDECLS
13 #define _TCLPLATDECLS
16 * Pull in the typedef of TCHAR for windows.
18 #if defined(__CYGWIN__)
19 typedef char TCHAR;
20 #elif defined(__WIN32__) && !defined(_TCHAR_DEFINED)
21 # include <tchar.h>
22 # ifndef _TCHAR_DEFINED
23 /* Borland seems to forget to set this. */
24 typedef _TCHAR TCHAR;
25 # define _TCHAR_DEFINED
26 # endif
27 # if defined(_MSC_VER) && defined(__STDC__)
28 /* MSVC++ misses this. */
29 typedef _TCHAR TCHAR;
30 # endif
31 #endif
33 /* !BEGIN!: Do not edit below this line. */
36 * Exported function declarations:
39 #ifdef __WIN32__
40 /* 0 */
41 EXTERN TCHAR * Tcl_WinUtfToTChar _ANSI_ARGS_((CONST char * str,
42 int len, Tcl_DString * dsPtr));
43 /* 1 */
44 EXTERN char * Tcl_WinTCharToUtf _ANSI_ARGS_((CONST TCHAR * str,
45 int len, Tcl_DString * dsPtr));
46 #endif /* __WIN32__ */
47 #ifdef MAC_TCL
48 /* 0 */
49 EXTERN void Tcl_MacSetEventProc _ANSI_ARGS_((
50 Tcl_MacConvertEventPtr procPtr));
51 /* 1 */
52 EXTERN char * Tcl_MacConvertTextResource _ANSI_ARGS_((
53 Handle resource));
54 /* 2 */
55 EXTERN int Tcl_MacEvalResource _ANSI_ARGS_((Tcl_Interp * interp,
56 CONST char * resourceName,
57 int resourceNumber, CONST char * fileName));
58 /* 3 */
59 EXTERN Handle Tcl_MacFindResource _ANSI_ARGS_((Tcl_Interp * interp,
60 long resourceType, CONST char * resourceName,
61 int resourceNumber, CONST char * resFileRef,
62 int * releaseIt));
63 /* 4 */
64 EXTERN int Tcl_GetOSTypeFromObj _ANSI_ARGS_((
65 Tcl_Interp * interp, Tcl_Obj * objPtr,
66 OSType * osTypePtr));
67 /* 5 */
68 EXTERN void Tcl_SetOSTypeObj _ANSI_ARGS_((Tcl_Obj * objPtr,
69 OSType osType));
70 /* 6 */
71 EXTERN Tcl_Obj * Tcl_NewOSTypeObj _ANSI_ARGS_((OSType osType));
72 /* 7 */
73 EXTERN int strncasecmp _ANSI_ARGS_((CONST char * s1,
74 CONST char * s2, size_t n));
75 /* 8 */
76 EXTERN int strcasecmp _ANSI_ARGS_((CONST char * s1,
77 CONST char * s2));
78 #endif /* MAC_TCL */
79 #ifdef MAC_OSX_TCL
80 /* 0 */
81 EXTERN int Tcl_MacOSXOpenBundleResources _ANSI_ARGS_((
82 Tcl_Interp * interp, CONST char * bundleName,
83 int hasResourceFile, int maxPathLen,
84 char * libraryPath));
85 /* 1 */
86 EXTERN int Tcl_MacOSXOpenVersionedBundleResources _ANSI_ARGS_((
87 Tcl_Interp * interp, CONST char * bundleName,
88 CONST char * bundleVersion,
89 int hasResourceFile, int maxPathLen,
90 char * libraryPath));
91 #endif /* MAC_OSX_TCL */
93 typedef struct TclPlatStubs {
94 int magic;
95 struct TclPlatStubHooks *hooks;
97 #ifdef __WIN32__
98 TCHAR * (*tcl_WinUtfToTChar) _ANSI_ARGS_((CONST char * str, int len, Tcl_DString * dsPtr)); /* 0 */
99 char * (*tcl_WinTCharToUtf) _ANSI_ARGS_((CONST TCHAR * str, int len, Tcl_DString * dsPtr)); /* 1 */
100 #endif /* __WIN32__ */
101 #ifdef MAC_TCL
102 void (*tcl_MacSetEventProc) _ANSI_ARGS_((Tcl_MacConvertEventPtr procPtr)); /* 0 */
103 char * (*tcl_MacConvertTextResource) _ANSI_ARGS_((Handle resource)); /* 1 */
104 int (*tcl_MacEvalResource) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * resourceName, int resourceNumber, CONST char * fileName)); /* 2 */
105 Handle (*tcl_MacFindResource) _ANSI_ARGS_((Tcl_Interp * interp, long resourceType, CONST char * resourceName, int resourceNumber, CONST char * resFileRef, int * releaseIt)); /* 3 */
106 int (*tcl_GetOSTypeFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, OSType * osTypePtr)); /* 4 */
107 void (*tcl_SetOSTypeObj) _ANSI_ARGS_((Tcl_Obj * objPtr, OSType osType)); /* 5 */
108 Tcl_Obj * (*tcl_NewOSTypeObj) _ANSI_ARGS_((OSType osType)); /* 6 */
109 int (*strncasecmp) _ANSI_ARGS_((CONST char * s1, CONST char * s2, size_t n)); /* 7 */
110 int (*strcasecmp) _ANSI_ARGS_((CONST char * s1, CONST char * s2)); /* 8 */
111 #endif /* MAC_TCL */
112 #ifdef MAC_OSX_TCL
113 int (*tcl_MacOSXOpenBundleResources) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * bundleName, int hasResourceFile, int maxPathLen, char * libraryPath)); /* 0 */
114 int (*tcl_MacOSXOpenVersionedBundleResources) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * bundleName, CONST char * bundleVersion, int hasResourceFile, int maxPathLen, char * libraryPath)); /* 1 */
115 #endif /* MAC_OSX_TCL */
116 } TclPlatStubs;
118 #ifdef __cplusplus
119 extern "C" {
120 #endif
121 extern TclPlatStubs *tclPlatStubsPtr;
122 #ifdef __cplusplus
124 #endif
126 #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
129 * Inline function declarations:
132 #ifdef __WIN32__
133 #ifndef Tcl_WinUtfToTChar
134 #define Tcl_WinUtfToTChar \
135 (tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */
136 #endif
137 #ifndef Tcl_WinTCharToUtf
138 #define Tcl_WinTCharToUtf \
139 (tclPlatStubsPtr->tcl_WinTCharToUtf) /* 1 */
140 #endif
141 #endif /* __WIN32__ */
142 #ifdef MAC_TCL
143 #ifndef Tcl_MacSetEventProc
144 #define Tcl_MacSetEventProc \
145 (tclPlatStubsPtr->tcl_MacSetEventProc) /* 0 */
146 #endif
147 #ifndef Tcl_MacConvertTextResource
148 #define Tcl_MacConvertTextResource \
149 (tclPlatStubsPtr->tcl_MacConvertTextResource) /* 1 */
150 #endif
151 #ifndef Tcl_MacEvalResource
152 #define Tcl_MacEvalResource \
153 (tclPlatStubsPtr->tcl_MacEvalResource) /* 2 */
154 #endif
155 #ifndef Tcl_MacFindResource
156 #define Tcl_MacFindResource \
157 (tclPlatStubsPtr->tcl_MacFindResource) /* 3 */
158 #endif
159 #ifndef Tcl_GetOSTypeFromObj
160 #define Tcl_GetOSTypeFromObj \
161 (tclPlatStubsPtr->tcl_GetOSTypeFromObj) /* 4 */
162 #endif
163 #ifndef Tcl_SetOSTypeObj
164 #define Tcl_SetOSTypeObj \
165 (tclPlatStubsPtr->tcl_SetOSTypeObj) /* 5 */
166 #endif
167 #ifndef Tcl_NewOSTypeObj
168 #define Tcl_NewOSTypeObj \
169 (tclPlatStubsPtr->tcl_NewOSTypeObj) /* 6 */
170 #endif
171 #ifndef strncasecmp
172 #define strncasecmp \
173 (tclPlatStubsPtr->strncasecmp) /* 7 */
174 #endif
175 #ifndef strcasecmp
176 #define strcasecmp \
177 (tclPlatStubsPtr->strcasecmp) /* 8 */
178 #endif
179 #endif /* MAC_TCL */
180 #ifdef MAC_OSX_TCL
181 #ifndef Tcl_MacOSXOpenBundleResources
182 #define Tcl_MacOSXOpenBundleResources \
183 (tclPlatStubsPtr->tcl_MacOSXOpenBundleResources) /* 0 */
184 #endif
185 #ifndef Tcl_MacOSXOpenVersionedBundleResources
186 #define Tcl_MacOSXOpenVersionedBundleResources \
187 (tclPlatStubsPtr->tcl_MacOSXOpenVersionedBundleResources) /* 1 */
188 #endif
189 #endif /* MAC_OSX_TCL */
191 #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
193 /* !END!: Do not edit above this line. */
195 #endif /* _TCLPLATDECLS */