diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | generic/tclInt.decls | 180 | ||||
-rw-r--r-- | generic/tclIntPlatDecls.h | 248 | ||||
-rw-r--r-- | generic/tclStubInit.c | 153 |
4 files changed, 447 insertions, 144 deletions
@@ -1,3 +1,13 @@ +2012-03-25 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tclInt.decls: [Bug 3508771] load tclreg.dll in cygwin tclsh + * generic/tclIntPlatDecls.h: Implement TclWinConvertError, TclWinConvertWSAError, + * generic/tclStubInit.c: and various more win32-specific internal functions for + * unix/Makefile.in: Cygwin, so win32 extensions using those can be + * unix/tcl.m4: loaded in the cygwin version of tclsh. + * unix/configure: + * win/tclWinError.c: + 2012-03-23 Jan Nijtmans <nijtmans@users.sf.net> * generic/tclInt.decls Revert some cygwin-related signature changes from diff --git a/generic/tclInt.decls b/generic/tclInt.decls index a476ee8..b0bc73e 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -1012,6 +1012,117 @@ declare 250 { interface tclIntPlat +######################## +# Mac specific internals + +declare 0 mac { + VOID *TclpSysAlloc(long size, int isBin) +} +declare 1 mac { + void TclpSysFree(VOID *ptr) +} +declare 2 mac { + VOID *TclpSysRealloc(VOID *cp, unsigned int size) +} +declare 3 mac { + void TclpExit(int status) +} + +# Prototypes for functions found in the tclMacUtil.c compatability library. + +declare 4 mac { + int FSpGetDefaultDir(FSSpecPtr theSpec) +} +declare 5 mac { + int FSpSetDefaultDir(FSSpecPtr theSpec) +} +declare 6 mac { + OSErr FSpFindFolder(short vRefNum, OSType folderType, + Boolean createFolder, FSSpec *spec) +} +declare 7 mac { + void GetGlobalMouseTcl(Point *mouse) +} + +# The following routines are utility functions in Tcl. They are exported +# here because they are needed in Tk. They are not officially supported, +# however. The first set are from the MoreFiles package. + +declare 8 mac { + pascal OSErr FSpGetDirectoryIDTcl(CONST FSSpec *spec, long *theDirID, + Boolean *isDirectory) +} +declare 9 mac { + pascal short FSpOpenResFileCompatTcl(CONST FSSpec *spec, + SignedByte permission) +} +declare 10 mac { + pascal void FSpCreateResFileCompatTcl(CONST FSSpec *spec, OSType creator, + OSType fileType, ScriptCode scriptTag) +} + +# Like the MoreFiles routines these fix problems in the standard +# Mac calls. These routines are from tclMacUtils.h. + +declare 11 mac { + int FSpLocationFromPath(int length, CONST char *path, FSSpecPtr theSpec) +} +declare 12 mac { + OSErr FSpPathFromLocation(FSSpecPtr theSpec, int *length, + Handle *fullPath) +} + +# Prototypes of Mac only internal functions. + +declare 13 mac { + void TclMacExitHandler(void) +} +declare 14 mac { + void TclMacInitExitToShell(int usePatch) +} +declare 15 mac { + OSErr TclMacInstallExitToShellPatch(ExitToShellProcPtr newProc) +} +declare 16 mac { + int TclMacOSErrorToPosixError(int error) +} +declare 17 mac { + void TclMacRemoveTimer(VOID *timerToken) +} +declare 18 mac { + VOID *TclMacStartTimer(long ms) +} +declare 19 mac { + int TclMacTimerExpired(VOID *timerToken) +} +declare 20 mac { + int TclMacRegisterResourceFork(short fileRef, Tcl_Obj *tokenPtr, + int insert) +} +declare 21 mac { + short TclMacUnRegisterResourceFork(char *tokenPtr, Tcl_Obj *resultPtr) +} +declare 22 mac { + int TclMacCreateEnv(void) +} +declare 23 mac { + FILE *TclMacFOpenHack(CONST char *path, CONST char *mode) +} +# Replaced in 8.1 by TclpReadLink: +# declare 24 mac { +# int TclMacReadlink(char *path, char *buf, int size) +# } +declare 24 mac { + char *TclpGetTZName(int isdst) +} +declare 25 mac { + int TclMacChmod(CONST char *path, int mode) +} +# version of FSpLocationFromPath that doesn't resolve the last path component +declare 26 mac { + int FSpLLocationFromPath(int length, CONST char *path, FSSpecPtr theSpec) +} + ################################ # Windows specific functions @@ -1134,11 +1245,13 @@ declare 29 win { # Pipe channel functions +# On non-cygwin, this is actually a reference to TclGetAndDetachPids declare 0 unix { - void TclGetAndDetachPids(Tcl_Interp *interp, Tcl_Channel chan) + void TclWinConvertError(unsigned int errCode) } +# On non-cygwin, this is actually a reference to TclpCloseFile declare 1 unix { - int TclpCloseFile(TclFile file) + void TclWinConvertWSAError(unsigned int errCode) } declare 2 unix { Tcl_Channel TclpCreateCommandChannel(TclFile readFile, @@ -1147,20 +1260,23 @@ declare 2 unix { declare 3 unix { int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe) } +# On non-cygwin, this is actually a reference to TclpCreateProcess declare 4 unix { - int TclpCreateProcess(Tcl_Interp *interp, int argc, const char **argv, - TclFile inputFile, TclFile outputFile, TclFile errorFile, - Tcl_Pid *pidPtr) + int TclWinGetTclInstance(void) } # Signature changed in 8.1: # declare 5 unix { # TclFile TclpCreateTempFile(char *contents, Tcl_DString *namePtr) # } + +# On non-cygwin, this is actually a reference to TclpMakeFile declare 6 unix { - TclFile TclpMakeFile(Tcl_Channel channel, int direction) + unsigned short TclWinNToHS(unsigned short ns) } +# On non-cygwin, this is actually a reference to TclpOpenFile declare 7 unix { - TclFile TclpOpenFile(const char *fname, int mode) + int TclWinSetSockOpt(int s, int level, int optname, + const char *optval, int optlen) } declare 8 unix { int TclUnixWaitForFile(int fd, int mask, int timeout) @@ -1180,9 +1296,11 @@ declare 10 unix { } # Slots 11 and 12 are forwarders for functions that were promoted to # Stubs +# On cygwin, this is actually a reference to TclGetAndDetachPids declare 11 unix { struct tm *TclpLocaltime_unix(const time_t *clock) } +# On cygwin, this is actually a reference to TclpCloseFile declare 12 unix { struct tm *TclpGmtime_unix(const time_t *clock) } @@ -1197,17 +1315,11 @@ declare 14 unix { const Tcl_StatBuf *statBufPtr, int dontCopyAtts) } -declare 22 unix { - TclFile TclpCreateTempFile(const char *contents) -} -declare 29 unix { - int TclWinCPUID(unsigned int index, unsigned int *regs) -} - ################################ # Mac OS X specific functions -declare 15 macosx { +#On cygwin, TclpCreateProcess is here +declare 15 {unix macosx} { int TclMacOSXGetFileAttribute(Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr) } @@ -1219,13 +1331,45 @@ declare 17 macosx { int TclMacOSXCopyFileAttributes(const char *src, const char *dst, const Tcl_StatBuf *statBufPtr) } -declare 18 macosx { +#On cygwin, TclpMakeFile is here +declare 18 {unix macosx} { int TclMacOSXMatchType(Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types) } -declare 19 macosx { - void TclMacOSXNotifierAddRunLoopMode(const void *runLoopMode) +#On cygwin, TclpOpenFile is here +declare 19 {unix macosx} { + void TclMacOSXNotifierAddRunLoopMode(const void *runLoopMode) +} +declare 20 unix { + void TclWinAddProcess(void *hProcess, unsigned long id) +} +declare 22 unix { + TclFile TclpCreateTempFile(const char *contents) +} +declare 23 unix { + char *TclpGetTZName(int isdst) +} +declare 24 unix { + char *TclWinNoBackslash(char *path) +} +declare 26 unix { + void TclWinSetInterfaces(int wide) +} +declare 27 unix { + void TclWinFlushDirtyChannels(void) +} +declare 28 unix { + void TclWinResetInterfaces(void) +} +declare 29 unix { + int TclWinCPUID(unsigned int index, unsigned int *regs) +} +declare 30 unix { + void TclGetAndDetachPids(Tcl_Interp *interp, Tcl_Channel chan) +} +declare 31 unix { + int TclpCloseFile(TclFile file) } diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index 2169624..f5cece4 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -24,6 +24,16 @@ # endif #endif +#if !defined(__WIN32__) /* UNIX */ +EXTERN int TclpCreateProcess _ANSI_ARGS_((Tcl_Interp *interp, + int argc, CONST char **argv, TclFile inputFile, + TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr)); +EXTERN TclFile TclpMakeFile _ANSI_ARGS_((Tcl_Channel channel, + int direction)); +EXTERN TclFile TclpOpenFile _ANSI_ARGS_((CONST char *fname, + int mode)); +#endif + /* * WARNING: This file is automatically generated by the tools/genStubs.tcl * script. Any modifications to the function declarations below should be made @@ -38,10 +48,9 @@ #if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ /* 0 */ -EXTERN void TclGetAndDetachPids(Tcl_Interp *interp, - Tcl_Channel chan); +EXTERN void TclWinConvertError(unsigned int errCode); /* 1 */ -EXTERN int TclpCloseFile(TclFile file); +EXTERN void TclWinConvertWSAError(unsigned int errCode); /* 2 */ EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile, TclFile writeFile, TclFile errorFile, @@ -49,15 +58,13 @@ EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile, /* 3 */ EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe); /* 4 */ -EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc, - const char **argv, TclFile inputFile, - TclFile outputFile, TclFile errorFile, - Tcl_Pid *pidPtr); +EXTERN int TclWinGetTclInstance(void); /* Slot 5 is reserved */ /* 6 */ -EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction); +EXTERN unsigned short TclWinNToHS(unsigned short ns); /* 7 */ -EXTERN TclFile TclpOpenFile(const char *fname, int mode); +EXTERN int TclWinSetSockOpt(int s, int level, int optname, + const char *optval, int optlen); /* 8 */ EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout); /* 9 */ @@ -74,23 +81,43 @@ EXTERN char * TclpInetNtoa(struct in_addr addr); EXTERN int TclUnixCopyFile(const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); -/* Slot 15 is reserved */ +/* 15 */ +EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp, + int objIndex, Tcl_Obj *fileName, + Tcl_Obj **attributePtrPtr); /* Slot 16 is reserved */ /* Slot 17 is reserved */ -/* Slot 18 is reserved */ -/* Slot 19 is reserved */ -/* Slot 20 is reserved */ +/* 18 */ +EXTERN int TclMacOSXMatchType(Tcl_Interp *interp, + const char *pathName, const char *fileName, + Tcl_StatBuf *statBufPtr, + Tcl_GlobTypeData *types); +/* 19 */ +EXTERN void TclMacOSXNotifierAddRunLoopMode( + const void *runLoopMode); +/* 20 */ +EXTERN void TclWinAddProcess(void *hProcess, unsigned long id); /* Slot 21 is reserved */ /* 22 */ EXTERN TclFile TclpCreateTempFile(const char *contents); -/* Slot 23 is reserved */ -/* Slot 24 is reserved */ +/* 23 */ +EXTERN char * TclpGetTZName(int isdst); +/* 24 */ +EXTERN char * TclWinNoBackslash(char *path); /* Slot 25 is reserved */ -/* Slot 26 is reserved */ -/* Slot 27 is reserved */ -/* Slot 28 is reserved */ +/* 26 */ +EXTERN void TclWinSetInterfaces(int wide); +/* 27 */ +EXTERN void TclWinFlushDirtyChannels(void); +/* 28 */ +EXTERN void TclWinResetInterfaces(void); /* 29 */ EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs); +/* 30 */ +EXTERN void TclGetAndDetachPids(Tcl_Interp *interp, + Tcl_Channel chan); +/* 31 */ +EXTERN int TclpCloseFile(TclFile file); #endif /* UNIX */ #ifdef __WIN32__ /* WIN */ /* 0 */ @@ -159,10 +186,9 @@ EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs); #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ /* 0 */ -EXTERN void TclGetAndDetachPids(Tcl_Interp *interp, - Tcl_Channel chan); +EXTERN void TclWinConvertError(unsigned int errCode); /* 1 */ -EXTERN int TclpCloseFile(TclFile file); +EXTERN void TclWinConvertWSAError(unsigned int errCode); /* 2 */ EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile, TclFile writeFile, TclFile errorFile, @@ -170,15 +196,13 @@ EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile, /* 3 */ EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe); /* 4 */ -EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc, - const char **argv, TclFile inputFile, - TclFile outputFile, TclFile errorFile, - Tcl_Pid *pidPtr); +EXTERN int TclWinGetTclInstance(void); /* Slot 5 is reserved */ /* 6 */ -EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction); +EXTERN unsigned short TclWinNToHS(unsigned short ns); /* 7 */ -EXTERN TclFile TclpOpenFile(const char *fname, int mode); +EXTERN int TclWinSetSockOpt(int s, int level, int optname, + const char *optval, int optlen); /* 8 */ EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout); /* 9 */ @@ -215,18 +239,29 @@ EXTERN int TclMacOSXMatchType(Tcl_Interp *interp, /* 19 */ EXTERN void TclMacOSXNotifierAddRunLoopMode( const void *runLoopMode); -/* Slot 20 is reserved */ +/* 20 */ +EXTERN void TclWinAddProcess(void *hProcess, unsigned long id); /* Slot 21 is reserved */ /* 22 */ EXTERN TclFile TclpCreateTempFile(const char *contents); -/* Slot 23 is reserved */ -/* Slot 24 is reserved */ +/* 23 */ +EXTERN char * TclpGetTZName(int isdst); +/* 24 */ +EXTERN char * TclWinNoBackslash(char *path); /* Slot 25 is reserved */ -/* Slot 26 is reserved */ -/* Slot 27 is reserved */ -/* Slot 28 is reserved */ +/* 26 */ +EXTERN void TclWinSetInterfaces(int wide); +/* 27 */ +EXTERN void TclWinFlushDirtyChannels(void); +/* 28 */ +EXTERN void TclWinResetInterfaces(void); /* 29 */ EXTERN int TclWinCPUID(unsigned int index, unsigned int *regs); +/* 30 */ +EXTERN void TclGetAndDetachPids(Tcl_Interp *interp, + Tcl_Channel chan); +/* 31 */ +EXTERN int TclpCloseFile(TclFile file); #endif /* MACOSX */ typedef struct TclIntPlatStubs { @@ -234,14 +269,14 @@ typedef struct TclIntPlatStubs { const struct TclIntPlatStubHooks *hooks; #if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ - void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */ - int (*tclpCloseFile) (TclFile file); /* 1 */ + void (*tclWinConvertError) (unsigned int errCode); /* 0 */ + void (*tclWinConvertWSAError) (unsigned int errCode); /* 1 */ Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */ int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */ - int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */ + int (*tclWinGetTclInstance) (void); /* 4 */ void (*reserved5)(void); - TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */ - TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */ + unsigned short (*tclWinNToHS) (unsigned short ns); /* 6 */ + int (*tclWinSetSockOpt) (int s, int level, int optname, const char *optval, int optlen); /* 7 */ int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */ int (*tclWinGetPlatformId) (void); /* 9 */ Tcl_DirEntry * (*tclpReaddir) (DIR *dir); /* 10 */ @@ -249,21 +284,23 @@ typedef struct TclIntPlatStubs { struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */ char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */ int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */ - void (*reserved15)(void); + int (*tclMacOSXGetFileAttribute) (Tcl_Interp *interp, int objIndex, Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr); /* 15 */ void (*reserved16)(void); void (*reserved17)(void); - void (*reserved18)(void); - void (*reserved19)(void); - void (*reserved20)(void); + int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */ + void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */ + void (*tclWinAddProcess) (void *hProcess, unsigned long id); /* 20 */ void (*reserved21)(void); TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */ - void (*reserved23)(void); - void (*reserved24)(void); + char * (*tclpGetTZName) (int isdst); /* 23 */ + char * (*tclWinNoBackslash) (char *path); /* 24 */ void (*reserved25)(void); - void (*reserved26)(void); - void (*reserved27)(void); - void (*reserved28)(void); + void (*tclWinSetInterfaces) (int wide); /* 26 */ + void (*tclWinFlushDirtyChannels) (void); /* 27 */ + void (*tclWinResetInterfaces) (void); /* 28 */ int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */ + void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 30 */ + int (*tclpCloseFile) (TclFile file); /* 31 */ #endif /* UNIX */ #ifdef __WIN32__ /* WIN */ void (*tclWinConvertError) (DWORD errCode); /* 0 */ @@ -298,14 +335,14 @@ typedef struct TclIntPlatStubs { int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */ #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ - void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 0 */ - int (*tclpCloseFile) (TclFile file); /* 1 */ + void (*tclWinConvertError) (unsigned int errCode); /* 0 */ + void (*tclWinConvertWSAError) (unsigned int errCode); /* 1 */ Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 2 */ int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 3 */ - int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 4 */ + int (*tclWinGetTclInstance) (void); /* 4 */ void (*reserved5)(void); - TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */ - TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */ + unsigned short (*tclWinNToHS) (unsigned short ns); /* 6 */ + int (*tclWinSetSockOpt) (int s, int level, int optname, const char *optval, int optlen); /* 7 */ int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */ int (*tclWinGetPlatformId) (void); /* 9 */ Tcl_DirEntry * (*tclpReaddir) (DIR *dir); /* 10 */ @@ -318,16 +355,18 @@ typedef struct TclIntPlatStubs { int (*tclMacOSXCopyFileAttributes) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr); /* 17 */ int (*tclMacOSXMatchType) (Tcl_Interp *interp, const char *pathName, const char *fileName, Tcl_StatBuf *statBufPtr, Tcl_GlobTypeData *types); /* 18 */ void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */ - void (*reserved20)(void); + void (*tclWinAddProcess) (void *hProcess, unsigned long id); /* 20 */ void (*reserved21)(void); TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */ - void (*reserved23)(void); - void (*reserved24)(void); + char * (*tclpGetTZName) (int isdst); /* 23 */ + char * (*tclWinNoBackslash) (char *path); /* 24 */ void (*reserved25)(void); - void (*reserved26)(void); - void (*reserved27)(void); - void (*reserved28)(void); + void (*tclWinSetInterfaces) (int wide); /* 26 */ + void (*tclWinFlushDirtyChannels) (void); /* 27 */ + void (*tclWinResetInterfaces) (void); /* 28 */ int (*tclWinCPUID) (unsigned int index, unsigned int *regs); /* 29 */ + void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 30 */ + int (*tclpCloseFile) (TclFile file); /* 31 */ #endif /* MACOSX */ } TclIntPlatStubs; @@ -346,21 +385,21 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr; */ #if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ -#define TclGetAndDetachPids \ - (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */ -#define TclpCloseFile \ - (tclIntPlatStubsPtr->tclpCloseFile) /* 1 */ +#define TclWinConvertError \ + (tclIntPlatStubsPtr->tclWinConvertError) /* 0 */ +#define TclWinConvertWSAError \ + (tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */ #define TclpCreateCommandChannel \ (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */ #define TclpCreatePipe \ (tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */ -#define TclpCreateProcess \ - (tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */ +#define TclWinGetTclInstance \ + (tclIntPlatStubsPtr->tclWinGetTclInstance) /* 4 */ /* Slot 5 is reserved */ -#define TclpMakeFile \ - (tclIntPlatStubsPtr->tclpMakeFile) /* 6 */ -#define TclpOpenFile \ - (tclIntPlatStubsPtr->tclpOpenFile) /* 7 */ +#define TclWinNToHS \ + (tclIntPlatStubsPtr->tclWinNToHS) /* 6 */ +#define TclWinSetSockOpt \ + (tclIntPlatStubsPtr->tclWinSetSockOpt) /* 7 */ #define TclUnixWaitForFile \ (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */ #define TclWinGetPlatformId \ @@ -375,23 +414,36 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr; (tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */ #define TclUnixCopyFile \ (tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */ -/* Slot 15 is reserved */ +#define TclMacOSXGetFileAttribute \ + (tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */ /* Slot 16 is reserved */ /* Slot 17 is reserved */ -/* Slot 18 is reserved */ -/* Slot 19 is reserved */ -/* Slot 20 is reserved */ +#define TclMacOSXMatchType \ + (tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */ +#define TclMacOSXNotifierAddRunLoopMode \ + (tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */ +#define TclWinAddProcess \ + (tclIntPlatStubsPtr->tclWinAddProcess) /* 20 */ /* Slot 21 is reserved */ #define TclpCreateTempFile \ (tclIntPlatStubsPtr->tclpCreateTempFile) /* 22 */ -/* Slot 23 is reserved */ -/* Slot 24 is reserved */ +#define TclpGetTZName \ + (tclIntPlatStubsPtr->tclpGetTZName) /* 23 */ +#define TclWinNoBackslash \ + (tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */ /* Slot 25 is reserved */ -/* Slot 26 is reserved */ -/* Slot 27 is reserved */ -/* Slot 28 is reserved */ +#define TclWinSetInterfaces \ + (tclIntPlatStubsPtr->tclWinSetInterfaces) /* 26 */ +#define TclWinFlushDirtyChannels \ + (tclIntPlatStubsPtr->tclWinFlushDirtyChannels) /* 27 */ +#define TclWinResetInterfaces \ + (tclIntPlatStubsPtr->tclWinResetInterfaces) /* 28 */ #define TclWinCPUID \ (tclIntPlatStubsPtr->tclWinCPUID) /* 29 */ +#define TclGetAndDetachPids \ + (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 30 */ +#define TclpCloseFile \ + (tclIntPlatStubsPtr->tclpCloseFile) /* 31 */ #endif /* UNIX */ #ifdef __WIN32__ /* WIN */ #define TclWinConvertError \ @@ -450,21 +502,21 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr; (tclIntPlatStubsPtr->tclWinCPUID) /* 29 */ #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ -#define TclGetAndDetachPids \ - (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */ -#define TclpCloseFile \ - (tclIntPlatStubsPtr->tclpCloseFile) /* 1 */ +#define TclWinConvertError \ + (tclIntPlatStubsPtr->tclWinConvertError) /* 0 */ +#define TclWinConvertWSAError \ + (tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */ #define TclpCreateCommandChannel \ (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */ #define TclpCreatePipe \ (tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */ -#define TclpCreateProcess \ - (tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */ +#define TclWinGetTclInstance \ + (tclIntPlatStubsPtr->tclWinGetTclInstance) /* 4 */ /* Slot 5 is reserved */ -#define TclpMakeFile \ - (tclIntPlatStubsPtr->tclpMakeFile) /* 6 */ -#define TclpOpenFile \ - (tclIntPlatStubsPtr->tclpOpenFile) /* 7 */ +#define TclWinNToHS \ + (tclIntPlatStubsPtr->tclWinNToHS) /* 6 */ +#define TclWinSetSockOpt \ + (tclIntPlatStubsPtr->tclWinSetSockOpt) /* 7 */ #define TclUnixWaitForFile \ (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */ #define TclWinGetPlatformId \ @@ -489,18 +541,28 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr; (tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */ #define TclMacOSXNotifierAddRunLoopMode \ (tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */ -/* Slot 20 is reserved */ +#define TclWinAddProcess \ + (tclIntPlatStubsPtr->tclWinAddProcess) /* 20 */ /* Slot 21 is reserved */ #define TclpCreateTempFile \ (tclIntPlatStubsPtr->tclpCreateTempFile) /* 22 */ -/* Slot 23 is reserved */ -/* Slot 24 is reserved */ +#define TclpGetTZName \ + (tclIntPlatStubsPtr->tclpGetTZName) /* 23 */ +#define TclWinNoBackslash \ + (tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */ /* Slot 25 is reserved */ -/* Slot 26 is reserved */ -/* Slot 27 is reserved */ -/* Slot 28 is reserved */ +#define TclWinSetInterfaces \ + (tclIntPlatStubsPtr->tclWinSetInterfaces) /* 26 */ +#define TclWinFlushDirtyChannels \ + (tclIntPlatStubsPtr->tclWinFlushDirtyChannels) /* 27 */ +#define TclWinResetInterfaces \ + (tclIntPlatStubsPtr->tclWinResetInterfaces) /* 28 */ #define TclWinCPUID \ (tclIntPlatStubsPtr->tclWinCPUID) /* 29 */ +#define TclGetAndDetachPids \ + (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 30 */ +#define TclpCloseFile \ + (tclIntPlatStubsPtr->tclpCloseFile) /* 31 */ #endif /* MACOSX */ #endif /* defined(USE_TCL_STUBS) */ diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index da899f4..32e9557 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -39,14 +39,21 @@ #undef Tcl_CreateHashEntry #undef Tcl_Panic #undef Tcl_FindExecutable -#define TclpLocaltime_unix TclpLocaltime -#define TclpGmtime_unix TclpGmtime #ifdef __CYGWIN__ #define TclWinGetPlatformId winGetPlatformId #define Tcl_WinUtfToTChar winUtfToTChar #define Tcl_WinTCharToUtf winTCharToUtf +#define TclWinGetTclInstance winGetTclInstance +#define TclWinNToHS winNToHS +#define TclWinSetSockOpt winSetSockOpt +#define TclWinAddProcess winAddProcess +#define TclpGetTZName pGetTZName +#define TclWinNoBackslash winNoBackslash +#define TclWinSetInterfaces (void (*) _ANSI_ARGS_((int))) doNothing +#define TclWinFlushDirtyChannels doNothing +#define TclWinResetInterfaces doNothing static Tcl_Encoding winTCharEncoding; @@ -58,6 +65,59 @@ TclWinGetPlatformId() return 2; /* VER_PLATFORM_WIN32_NT */; } +static int TclWinGetTclInstance() +{ + Tcl_Panic("TclWinGetTclInstance not yet implemented for CYGWIN"); + return 0; +} + +static unsigned short +TclWinNToHS(unsigned short ns) +{ + Tcl_Panic("TclWinNToHS not yet implemented for CYGWIN"); + return (unsigned short) -1; +} +static int +TclWinSetSockOpt(int s, int level, int optname, + const char *optval, int optlen) +{ + Tcl_Panic("TclWinSetSockOpt not yet implemented for CYGWIN"); + return -1; +} + +static void +TclWinAddProcess(void *hProcess, unsigned long id) +{ + Tcl_Panic("TclWinAddProcess not yet implemented for CYGWIN"); +} + +static char * +TclpGetTZName(int isdst) +{ + /* TODO: implementation */ + Tcl_Panic("TclpGetTZName not yet implemented for CYGWIN"); + return 0; +} + +static char * +TclWinNoBackslash(char *path) +{ + char *p; + + for (p = path; *p != '\0'; p++) { + if (*p == '\\') { + *p = '/'; + } + } + return path; +} + +static void +doNothing(void) +{ + /* dummy implementation, no need to do anything */ +} + static char * Tcl_WinUtfToTChar(string, len, dsPtr) CONST char *string; @@ -65,20 +125,20 @@ Tcl_WinUtfToTChar(string, len, dsPtr) Tcl_DString *dsPtr; { if (!winTCharEncoding) { - winTCharEncoding = Tcl_GetEncoding(NULL, "unicode"); + winTCharEncoding = Tcl_GetEncoding(0, "unicode"); } return Tcl_UtfToExternalDString(winTCharEncoding, string, len, dsPtr); } static char * -Tcl_WinTCharToUtf(string, len, dsPtr) - CONST char *string; - int len; - Tcl_DString *dsPtr; +Tcl_WinTCharToUtf( + CONST char *string, + int len, + Tcl_DString *dsPtr) { if (!winTCharEncoding) { - winTCharEncoding = Tcl_GetEncoding(NULL, "unicode"); + winTCharEncoding = Tcl_GetEncoding(0, "unicode"); } return Tcl_ExternalToUtfDString(winTCharEncoding, string, len, dsPtr); @@ -88,13 +148,36 @@ Tcl_WinTCharToUtf(string, len, dsPtr) Tcl_Interp *, CONST char *, int, int, char *))) Tcl_WinUtfToTChar #define Tcl_MacOSXOpenVersionedBundleResources (int (*) _ANSI_ARGS_(( \ Tcl_Interp *, CONST char *, CONST char *, int, int, char *))) Tcl_WinTCharToUtf +#define TclMacOSXGetFileAttribute (int (*) _ANSI_ARGS_((Tcl_Interp *, \ + int, Tcl_Obj *, Tcl_Obj **))) TclpCreateProcess +#define TclMacOSXMatchType (int (*) _ANSI_ARGS_((Tcl_Interp *, CONST char *, \ + CONST char *, Tcl_StatBuf *, Tcl_GlobTypeData *))) TclpMakeFile +#define TclMacOSXNotifierAddRunLoopMode (void (*) _ANSI_ARGS_((CONST void *))) TclpOpenFile +#define TclpLocaltime_unix (struct tm *(*) _ANSI_ARGS_((CONST time_t *))) TclGetAndDetachPids +#define TclpGmtime_unix (struct tm *(*) _ANSI_ARGS_((CONST time_t *))) TclpCloseFile #elif !defined(__WIN32__) /* UNIX and MAC */ +# define TclWinConvertError (void (*) _ANSI_ARGS_((unsigned int))) TclGetAndDetachPids +# define TclWinConvertWSAError (void (*) _ANSI_ARGS_((unsigned int))) TclpCloseFile # define TclWinGetPlatformId (int (*)()) TclpCreateTempFile +# define TclWinGetTclInstance (int (*)()) TclpCreateProcess +# define TclWinNToHS (unsigned short (*) _ANSI_ARGS_((unsigned short ns))) TclpMakeFile +# define TclWinSetSockOpt (int (*) _ANSI_ARGS_((int, int, int, const char *, int))) TclpOpenFile +# define TclWinAddProcess 0 +# define TclpGetTZName 0 +# define TclWinNoBackslash 0 +# define TclWinSetInterfaces 0 +# define TclWinFlushDirtyChannels 0 +# define TclWinResetInterfaces 0 +# define TclMacOSXGetFileAttribute 0 /* Only implemented in Tcl >= 8.5 */ +# define TclMacOSXMatchType 0 /* Only implemented in Tcl >= 8.5 */ +# define TclMacOSXNotifierAddRunLoopMode 0 /* Only implemented in Tcl >= 8.5 */ # ifndef MAC_OSX_TCL # define Tcl_MacOSXOpenBundleResources 0 # define Tcl_MacOSXOpenVersionedBundleResources 0 # endif +# define TclpLocaltime_unix TclpLocaltime +# define TclpGmtime_unix TclpGmtime #endif /* @@ -368,14 +451,14 @@ static const TclIntPlatStubs tclIntPlatStubs = { TCL_STUB_MAGIC, 0, #if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ - TclGetAndDetachPids, /* 0 */ - TclpCloseFile, /* 1 */ + TclWinConvertError, /* 0 */ + TclWinConvertWSAError, /* 1 */ TclpCreateCommandChannel, /* 2 */ TclpCreatePipe, /* 3 */ - TclpCreateProcess, /* 4 */ + TclWinGetTclInstance, /* 4 */ 0, /* 5 */ - TclpMakeFile, /* 6 */ - TclpOpenFile, /* 7 */ + TclWinNToHS, /* 6 */ + TclWinSetSockOpt, /* 7 */ TclUnixWaitForFile, /* 8 */ TclWinGetPlatformId, /* 9 */ TclpReaddir, /* 10 */ @@ -383,21 +466,23 @@ static const TclIntPlatStubs tclIntPlatStubs = { TclpGmtime_unix, /* 12 */ TclpInetNtoa, /* 13 */ TclUnixCopyFile, /* 14 */ - 0, /* 15 */ + TclMacOSXGetFileAttribute, /* 15 */ 0, /* 16 */ 0, /* 17 */ - 0, /* 18 */ - 0, /* 19 */ - 0, /* 20 */ + TclMacOSXMatchType, /* 18 */ + TclMacOSXNotifierAddRunLoopMode, /* 19 */ + TclWinAddProcess, /* 20 */ 0, /* 21 */ TclpCreateTempFile, /* 22 */ - 0, /* 23 */ - 0, /* 24 */ + TclpGetTZName, /* 23 */ + TclWinNoBackslash, /* 24 */ 0, /* 25 */ - 0, /* 26 */ - 0, /* 27 */ - 0, /* 28 */ + TclWinSetInterfaces, /* 26 */ + TclWinFlushDirtyChannels, /* 27 */ + TclWinResetInterfaces, /* 28 */ TclWinCPUID, /* 29 */ + TclGetAndDetachPids, /* 30 */ + TclpCloseFile, /* 31 */ #endif /* UNIX */ #ifdef __WIN32__ /* WIN */ TclWinConvertError, /* 0 */ @@ -432,14 +517,14 @@ static const TclIntPlatStubs tclIntPlatStubs = { TclWinCPUID, /* 29 */ #endif /* WIN */ #ifdef MAC_OSX_TCL /* MACOSX */ - TclGetAndDetachPids, /* 0 */ - TclpCloseFile, /* 1 */ + TclWinConvertError, /* 0 */ + TclWinConvertWSAError, /* 1 */ TclpCreateCommandChannel, /* 2 */ TclpCreatePipe, /* 3 */ - TclpCreateProcess, /* 4 */ + TclWinGetTclInstance, /* 4 */ 0, /* 5 */ - TclpMakeFile, /* 6 */ - TclpOpenFile, /* 7 */ + TclWinNToHS, /* 6 */ + TclWinSetSockOpt, /* 7 */ TclUnixWaitForFile, /* 8 */ TclWinGetPlatformId, /* 9 */ TclpReaddir, /* 10 */ @@ -452,16 +537,18 @@ static const TclIntPlatStubs tclIntPlatStubs = { TclMacOSXCopyFileAttributes, /* 17 */ TclMacOSXMatchType, /* 18 */ TclMacOSXNotifierAddRunLoopMode, /* 19 */ - 0, /* 20 */ + TclWinAddProcess, /* 20 */ 0, /* 21 */ TclpCreateTempFile, /* 22 */ - 0, /* 23 */ - 0, /* 24 */ + TclpGetTZName, /* 23 */ + TclWinNoBackslash, /* 24 */ 0, /* 25 */ - 0, /* 26 */ - 0, /* 27 */ - 0, /* 28 */ + TclWinSetInterfaces, /* 26 */ + TclWinFlushDirtyChannels, /* 27 */ + TclWinResetInterfaces, /* 28 */ TclWinCPUID, /* 29 */ + TclGetAndDetachPids, /* 30 */ + TclpCloseFile, /* 31 */ #endif /* MACOSX */ }; |