diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclInt.decls | 12 | ||||
-rw-r--r-- | generic/tclIntPlatDecls.h | 45 | ||||
-rw-r--r-- | generic/tclStubInit.c | 47 |
3 files changed, 67 insertions, 37 deletions
diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 3d84cb2..0595050 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -941,11 +941,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, @@ -1038,6 +1040,12 @@ declare 28 unix { 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) +} # Local Variables: diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index 3c967b0..297895f 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -13,6 +13,7 @@ #ifndef _TCLINTPLATDECLS #define _TCLINTPLATDECLS +#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ EXTERN int TclpCreateProcess _ANSI_ARGS_((Tcl_Interp *interp, int argc, CONST char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr)); @@ -20,6 +21,7 @@ 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 @@ -35,10 +37,10 @@ EXTERN TclFile TclpOpenFile _ANSI_ARGS_((CONST char *fname, #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ /* 0 */ -EXTERN void TclGetAndDetachPids _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Channel chan)); +EXTERN void TclWinConvertError _ANSI_ARGS_((unsigned int errCode)); /* 1 */ -EXTERN int TclpCloseFile _ANSI_ARGS_((TclFile file)); +EXTERN void TclWinConvertWSAError _ANSI_ARGS_(( + unsigned int errCode)); /* 2 */ EXTERN Tcl_Channel TclpCreateCommandChannel _ANSI_ARGS_(( TclFile readFile, TclFile writeFile, @@ -104,6 +106,11 @@ EXTERN void TclWinResetInterfaces _ANSI_ARGS_((void)); /* 29 */ EXTERN int TclWinCPUID _ANSI_ARGS_((unsigned int index, unsigned int *regs)); +/* 30 */ +EXTERN void TclGetAndDetachPids _ANSI_ARGS_((Tcl_Interp *interp, + Tcl_Channel chan)); +/* 31 */ +EXTERN int TclpCloseFile _ANSI_ARGS_((TclFile file)); #endif /* UNIX */ #ifdef __WIN32__ /* 0 */ @@ -255,8 +262,8 @@ typedef struct TclIntPlatStubs { struct TclIntPlatStubHooks *hooks; #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - void (*tclGetAndDetachPids) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan)); /* 0 */ - int (*tclpCloseFile) _ANSI_ARGS_((TclFile file)); /* 1 */ + void (*tclWinConvertError) _ANSI_ARGS_((unsigned int errCode)); /* 0 */ + void (*tclWinConvertWSAError) _ANSI_ARGS_((unsigned int errCode)); /* 1 */ Tcl_Channel (*tclpCreateCommandChannel) _ANSI_ARGS_((TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr)); /* 2 */ int (*tclpCreatePipe) _ANSI_ARGS_((TclFile *readPipe, TclFile *writePipe)); /* 3 */ int (*tclWinGetTclInstance) _ANSI_ARGS_((void)); /* 4 */ @@ -285,6 +292,8 @@ typedef struct TclIntPlatStubs { void (*tclWinFlushDirtyChannels) _ANSI_ARGS_((void)); /* 27 */ void (*tclWinResetInterfaces) _ANSI_ARGS_((void)); /* 28 */ int (*tclWinCPUID) _ANSI_ARGS_((unsigned int index, unsigned int *regs)); /* 29 */ + void (*tclGetAndDetachPids) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Channel chan)); /* 30 */ + int (*tclpCloseFile) _ANSI_ARGS_((TclFile file)); /* 31 */ #endif /* UNIX */ #ifdef __WIN32__ void (*tclWinConvertError) _ANSI_ARGS_((DWORD errCode)); /* 0 */ @@ -364,13 +373,13 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr; */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ -#ifndef TclGetAndDetachPids -#define TclGetAndDetachPids \ - (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */ +#ifndef TclWinConvertError +#define TclWinConvertError \ + (tclIntPlatStubsPtr->tclWinConvertError) /* 0 */ #endif -#ifndef TclpCloseFile -#define TclpCloseFile \ - (tclIntPlatStubsPtr->tclpCloseFile) /* 1 */ +#ifndef TclWinConvertWSAError +#define TclWinConvertWSAError \ + (tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */ #endif #ifndef TclpCreateCommandChannel #define TclpCreateCommandChannel \ @@ -466,6 +475,14 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr; #define TclWinCPUID \ (tclIntPlatStubsPtr->tclWinCPUID) /* 29 */ #endif +#ifndef TclGetAndDetachPids +#define TclGetAndDetachPids \ + (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 30 */ +#endif +#ifndef TclpCloseFile +#define TclpCloseFile \ + (tclIntPlatStubsPtr->tclpCloseFile) /* 31 */ +#endif #endif /* UNIX */ #ifdef __WIN32__ #ifndef TclWinConvertError @@ -706,6 +723,12 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr; #undef TclpOpenFile #define TclpOpenFile ((TclFile (*) _ANSI_ARGS_((CONST char *, int))) \ tclIntPlatStubsPtr->tclWinNToHS) +#undef TclGetAndDetachPids +#define TclGetAndDetachPids ((void (*) _ANSI_ARGS_((Tcl_Interp *, Tcl_Channel))) \ + tclIntPlatStubsPtr->tclWinConvertError) +#undef TclpCloseFile +#define TclpCloseFile ((int (*) _ANSI_ARGS_((TclFile))) \ + tclIntPlatStubsPtr->tclWinConvertWSAError) #endif #endif /* _TCLINTPLATDECLS */ diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 9ca1750..b363f24 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -68,9 +68,9 @@ Tcl_NotifierProcs tclOriginalNotifier = { #define TclWinAddProcess winAddProcess #define TclpGetTZName pGetTZName #define TclWinNoBackslash winNoBackslash -#define TclWinSetInterfaces winSetInterfaces -#define TclWinFlushDirtyChannels winFlushDirtyChannels -#define TclWinResetInterfaces winResetInterfaces +#define TclWinSetInterfaces (void (*) _ANSI_ARGS_((int))) doNothing +#define TclWinFlushDirtyChannels doNothing +#define TclWinResetInterfaces doNothing static Tcl_Encoding winTCharEncoding; @@ -84,60 +84,55 @@ TclWinGetPlatformId() static int TclWinGetTclInstance() { - /* TODO: implementation */ + Tcl_Panic("TclWinGetTclInstance not yet implemented for CYGWIN"); return 0; } static unsigned short TclWinNToHS(unsigned short ns) { - /* TODO: implementation */ + 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) { - /* TODO: implementation */ + Tcl_Panic("TclWinSetSockOpt not yet implemented for CYGWIN"); return -1; } static void TclWinAddProcess(void *hProcess, unsigned long id) { - /* TODO: implementation */ + 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) { - /* TODO: implementation */ - return 0; -} + char *p; -static void -TclWinSetInterfaces(int wide) -{ - /* TODO: implementation */ -} - -static void -TclWinFlushDirtyChannels(void) -{ - /* TODO: implementation */ + for (p = path; *p != '\0'; p++) { + if (*p == '\\') { + *p = '/'; + } + } + return path; } static void -TclWinResetInterfaces(void) +doNothing(void) { - /* TODO: implementation */ + /* dummy implementation, no need to do anything */ } static char * @@ -177,6 +172,8 @@ Tcl_WinTCharToUtf( #define TclMacOSXNotifierAddRunLoopMode (void (*) _ANSI_ARGS_((CONST void *))) TclpOpenFile #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 @@ -437,8 +434,8 @@ TclIntPlatStubs tclIntPlatStubs = { TCL_STUB_MAGIC, NULL, #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - TclGetAndDetachPids, /* 0 */ - TclpCloseFile, /* 1 */ + TclWinConvertError, /* 0 */ + TclWinConvertWSAError, /* 1 */ TclpCreateCommandChannel, /* 2 */ TclpCreatePipe, /* 3 */ TclWinGetTclInstance, /* 4 */ @@ -467,6 +464,8 @@ TclIntPlatStubs tclIntPlatStubs = { TclWinFlushDirtyChannels, /* 27 */ TclWinResetInterfaces, /* 28 */ TclWinCPUID, /* 29 */ + TclGetAndDetachPids, /* 30 */ + TclpCloseFile, /* 31 */ #endif /* UNIX */ #ifdef __WIN32__ TclWinConvertError, /* 0 */ |