4 * Declarations of platform specific Tcl APIs.
6 * Copyright (c) 1998-1999 by Scriptics Corporation.
9 * RCS: @(#) $Id: tclPlatDecls.h,v 1.18.2.1 2003/05/13 08:41:26 das Exp $
16 * Pull in the typedef of TCHAR for windows.
18 #if defined(__CYGWIN__)
20 #elif defined(__WIN32__) && !defined(_TCHAR_DEFINED)
22 # ifndef _TCHAR_DEFINED
23 /* Borland seems to forget to set this. */
25 # define _TCHAR_DEFINED
27 # if defined(_MSC_VER) && defined(__STDC__)
28 /* MSVC++ misses this. */
33 /* !BEGIN!: Do not edit below this line. */
36 * Exported function declarations:
41 EXTERN TCHAR * Tcl_WinUtfToTChar _ANSI_ARGS_((CONST char * str,
42 int len, Tcl_DString * dsPtr));
44 EXTERN char * Tcl_WinTCharToUtf _ANSI_ARGS_((CONST TCHAR * str,
45 int len, Tcl_DString * dsPtr));
46 #endif /* __WIN32__ */
49 EXTERN void Tcl_MacSetEventProc _ANSI_ARGS_((
50 Tcl_MacConvertEventPtr procPtr));
52 EXTERN char * Tcl_MacConvertTextResource _ANSI_ARGS_((
55 EXTERN int Tcl_MacEvalResource _ANSI_ARGS_((Tcl_Interp * interp,
56 CONST char * resourceName,
57 int resourceNumber, CONST char * fileName));
59 EXTERN Handle Tcl_MacFindResource _ANSI_ARGS_((Tcl_Interp * interp,
60 long resourceType, CONST char * resourceName,
61 int resourceNumber, CONST char * resFileRef,
64 EXTERN int Tcl_GetOSTypeFromObj _ANSI_ARGS_((
65 Tcl_Interp * interp, Tcl_Obj * objPtr,
68 EXTERN void Tcl_SetOSTypeObj _ANSI_ARGS_((Tcl_Obj * objPtr,
71 EXTERN Tcl_Obj * Tcl_NewOSTypeObj _ANSI_ARGS_((OSType osType));
73 EXTERN int strncasecmp _ANSI_ARGS_((CONST char * s1,
74 CONST char * s2, size_t n));
76 EXTERN int strcasecmp _ANSI_ARGS_((CONST char * s1,
81 EXTERN int Tcl_MacOSXOpenBundleResources _ANSI_ARGS_((
82 Tcl_Interp * interp, CONST char * bundleName,
83 int hasResourceFile, int maxPathLen,
86 EXTERN int Tcl_MacOSXOpenVersionedBundleResources _ANSI_ARGS_((
87 Tcl_Interp * interp, CONST char * bundleName,
88 CONST char * bundleVersion,
89 int hasResourceFile, int maxPathLen,
91 #endif /* MAC_OSX_TCL */
93 typedef struct TclPlatStubs {
95 struct TclPlatStubHooks *hooks;
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__ */
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 */
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 */
121 extern TclPlatStubs *tclPlatStubsPtr;
126 #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
129 * Inline function declarations:
133 #ifndef Tcl_WinUtfToTChar
134 #define Tcl_WinUtfToTChar \
135 (tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */
137 #ifndef Tcl_WinTCharToUtf
138 #define Tcl_WinTCharToUtf \
139 (tclPlatStubsPtr->tcl_WinTCharToUtf) /* 1 */
141 #endif /* __WIN32__ */
143 #ifndef Tcl_MacSetEventProc
144 #define Tcl_MacSetEventProc \
145 (tclPlatStubsPtr->tcl_MacSetEventProc) /* 0 */
147 #ifndef Tcl_MacConvertTextResource
148 #define Tcl_MacConvertTextResource \
149 (tclPlatStubsPtr->tcl_MacConvertTextResource) /* 1 */
151 #ifndef Tcl_MacEvalResource
152 #define Tcl_MacEvalResource \
153 (tclPlatStubsPtr->tcl_MacEvalResource) /* 2 */
155 #ifndef Tcl_MacFindResource
156 #define Tcl_MacFindResource \
157 (tclPlatStubsPtr->tcl_MacFindResource) /* 3 */
159 #ifndef Tcl_GetOSTypeFromObj
160 #define Tcl_GetOSTypeFromObj \
161 (tclPlatStubsPtr->tcl_GetOSTypeFromObj) /* 4 */
163 #ifndef Tcl_SetOSTypeObj
164 #define Tcl_SetOSTypeObj \
165 (tclPlatStubsPtr->tcl_SetOSTypeObj) /* 5 */
167 #ifndef Tcl_NewOSTypeObj
168 #define Tcl_NewOSTypeObj \
169 (tclPlatStubsPtr->tcl_NewOSTypeObj) /* 6 */
172 #define strncasecmp \
173 (tclPlatStubsPtr->strncasecmp) /* 7 */
177 (tclPlatStubsPtr->strcasecmp) /* 8 */
181 #ifndef Tcl_MacOSXOpenBundleResources
182 #define Tcl_MacOSXOpenBundleResources \
183 (tclPlatStubsPtr->tcl_MacOSXOpenBundleResources) /* 0 */
185 #ifndef Tcl_MacOSXOpenVersionedBundleResources
186 #define Tcl_MacOSXOpenVersionedBundleResources \
187 (tclPlatStubsPtr->tcl_MacOSXOpenVersionedBundleResources) /* 1 */
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 */