From defe3d84881f228cf76d953096d229f48f4ef832 Mon Sep 17 00:00:00 2001 From: andreas_kupries Date: Mon, 27 Mar 2006 18:08:49 +0000 Subject: * doc/CrtChannel.3: Added TCL_CHANNEL_VERSION_5, made it * generic/tcl.h: the version where the "truncateProc" * generic/tclIO.c: is defined at, and moved all channel * generic/tclIOGT.c: drivers of Tcl to v5. * generic/tclIORChan.c: * unix/tclUnixChan.c: * unix/tclUnixPipe.c: * win/tclWinChan.c: * win/tclWinConsole.c: * win/tclWinPipe.c: * win/tclWinSerial.c: * win/tclWinSock.c: --- ChangeLog | 15 +++++++++++++++ doc/CrtChannel.3 | 13 ++++++++----- generic/tcl.h | 9 +++++++-- generic/tclIO.c | 6 ++++-- generic/tclIOGT.c | 6 ++++-- generic/tclIORChan.c | 34 ++++++++++++++++++---------------- unix/tclUnixChan.c | 8 ++++---- unix/tclUnixPipe.c | 5 +++-- win/tclWinChan.c | 4 ++-- win/tclWinConsole.c | 5 +++-- win/tclWinPipe.c | 5 +++-- win/tclWinSerial.c | 5 +++-- win/tclWinSock.c | 5 +++-- 13 files changed, 77 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 983c378..1b7fa30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2006-03-27 Andreas Kupries + + * doc/CrtChannel.3: Added TCL_CHANNEL_VERSION_5, made it + * generic/tcl.h: the version where the "truncateProc" + * generic/tclIO.c: is defined at, and moved all channel + * generic/tclIOGT.c: drivers of Tcl to v5. + * generic/tclIORChan.c: + * unix/tclUnixChan.c: + * unix/tclUnixPipe.c: + * win/tclWinChan.c: + * win/tclWinConsole.c: + * win/tclWinPipe.c: + * win/tclWinSerial.c: + * win/tclWinSock.c: + 2006-03-27 Don Porter *** 8.5a4 TAGGED FOR RELEASE *** diff --git a/doc/CrtChannel.3 b/doc/CrtChannel.3 index f4ff280..f23ea6d 100644 --- a/doc/CrtChannel.3 +++ b/doc/CrtChannel.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtChannel.3,v 1.32 2005/10/05 20:36:16 andreas_kupries Exp $ +'\" RCS: @(#) $Id: CrtChannel.3,v 1.33 2006/03/27 18:08:50 andreas_kupries Exp $ .so man.macros .TH Tcl_CreateChannel 3 8.4 Tcl "Tcl Library Procedures" .BS @@ -384,10 +384,12 @@ a pointer to the string. The \fIversion\fR field should be set to the version of the structure that you require. \fBTCL_CHANNEL_VERSION_2\fR is the minimum recommended. \fBTCL_CHANNEL_VERSION_3\fR must be set to specifiy the \fIwideSeekProc\fR member. +\fBTCL_CHANNEL_VERSION_4\fR must be set to specifiy the \fIthreadActionProc\fR member +(includes \fIwideSeekProc\fR). .VS 8.5 -\fBTCL_CHANNEL_VERSION_4\fR must be set to specifiy the -\fIthreadActionProc\fR and \fItruncateProc\fR members (includes -\fIwideSeekProc\fR). +\fBTCL_CHANNEL_VERSION_5\fR must be set to specifiy the +\fItruncateProc\fR members (includes +\fIwideSeekProc\fR and \fIthreadActionProc\fR). .VE 8.5 If it is not set to any of these, then this \fBTcl_ChannelType\fR is assumed to have the original structure. See @@ -398,8 +400,9 @@ least \fBTCL_CHANNEL_VERSION_2\fR to function correctly. This value can be retrieved with \fBTcl_ChannelVersion\fR, which returns one of .VS 8.5 -\fBTCL_CHANNEL_VERSION_4\fR, +\fBTCL_CHANNEL_VERSION_5\fR, .VE 8.5 +\fBTCL_CHANNEL_VERSION_4\fR, \fBTCL_CHANNEL_VERSION_3\fR, \fBTCL_CHANNEL_VERSION_2\fR or \fBTCL_CHANNEL_VERSION_1\fR. .SS BLOCKMODEPROC diff --git a/generic/tcl.h b/generic/tcl.h index fb20564..3c2c22c 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tcl.h,v 1.210 2005/12/27 17:39:01 kennykb Exp $ + * RCS: @(#) $Id: tcl.h,v 1.211 2006/03/27 18:08:50 andreas_kupries Exp $ */ #ifndef _TCL @@ -1516,6 +1516,7 @@ typedef void (Tcl_ScaleTimeProc) _ANSI_ARGS_ ((Tcl_Time* timebuf, ClientData cli #define TCL_CHANNEL_VERSION_2 ((Tcl_ChannelTypeVersion) 0x2) #define TCL_CHANNEL_VERSION_3 ((Tcl_ChannelTypeVersion) 0x3) #define TCL_CHANNEL_VERSION_4 ((Tcl_ChannelTypeVersion) 0x4) +#define TCL_CHANNEL_VERSION_5 ((Tcl_ChannelTypeVersion) 0x5) /* * TIP #218: Channel Actions, Ids for Tcl_DriverThreadActionProc @@ -1667,12 +1668,16 @@ typedef struct Tcl_ChannelType { /* * Only valid in TCL_CHANNEL_VERSION_4 channels or later * TIP #218, Channel Thread Actions - * TIP #208 (part relating to truncation) */ Tcl_DriverThreadActionProc *threadActionProc; /* Function to call to notify the driver of * thread specific activity for a channel. May * be NULL. */ + + /* + * Only valid in TCL_CHANNEL_VERSION_5 channels or later + * TIP #208, File Truncation + */ Tcl_DriverTruncateProc *truncateProc; /* Function to call to truncate the underlying * file to a particular length. May be NULL if diff --git a/generic/tclIO.c b/generic/tclIO.c index 0c4fed8..dc1f48c 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.c,v 1.105 2006/03/10 17:32:51 vasiljevic Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.106 2006/03/27 18:08:50 andreas_kupries Exp $ */ #include "tclInt.h" @@ -9263,6 +9263,8 @@ Tcl_ChannelVersion( return TCL_CHANNEL_VERSION_3; } else if (chanTypePtr->version == TCL_CHANNEL_VERSION_4) { return TCL_CHANNEL_VERSION_4; + } else if (chanTypePtr->version == TCL_CHANNEL_VERSION_5) { + return TCL_CHANNEL_VERSION_5; } else { /* * In truncateProc; } else { return NULL; diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c index c708bb1..bd01d8c 100644 --- a/generic/tclIOGT.c +++ b/generic/tclIOGT.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * CVS: $Id: tclIOGT.c,v 1.14 2005/11/01 15:30:52 dkf Exp $ + * CVS: $Id: tclIOGT.c,v 1.15 2006/03/27 18:08:50 andreas_kupries Exp $ */ #include "tclInt.h" @@ -120,7 +120,7 @@ static void ResultAdd(ResultBuffer *r, unsigned char *buf, static Tcl_ChannelType transformChannelType = { "transform", /* Type name. */ - TCL_CHANNEL_VERSION_3, + TCL_CHANNEL_VERSION_5, /* v5 channel */ TransformCloseProc, /* Close proc. */ TransformInputProc, /* Input proc. */ TransformOutputProc, /* Output proc. */ @@ -134,6 +134,8 @@ static Tcl_ChannelType transformChannelType = { NULL, /* Flush proc. */ TransformNotifyProc, /* Handling of events bubbling up */ TransformWideSeekProc, /* Wide seek proc */ + NULL, /* thread action */ + NULL, /* truncate */ }; /* diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 28bc175..a69ea2e 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIORChan.c,v 1.14 2006/02/17 16:16:47 dgp Exp $ + * RCS: @(#) $Id: tclIORChan.c,v 1.15 2006/03/27 18:08:51 andreas_kupries Exp $ */ #include @@ -58,21 +58,23 @@ static int ReflectSetOption(ClientData clientData, */ static Tcl_ChannelType tclRChannelType = { - "tclrchannel", /* Type name. */ - TCL_CHANNEL_VERSION_3, - ReflectClose, /* Close channel, clean instance data */ - ReflectInput, /* Handle read request */ - ReflectOutput, /* Handle write request */ - ReflectSeek, /* Move location of access point. NULL'able */ - ReflectSetOption, /* Set options. NULL'able */ - ReflectGetOption, /* Get options. NULL'able */ - ReflectWatch, /* Initialize notifier */ - NULL, /* Get OS handle from the channel. NULL'able */ - NULL, /* No close2 support. NULL'able */ - ReflectBlock, /* Set blocking/nonblocking. NULL'able */ - NULL, /* Flush channel. Not used by core. NULL'able */ - NULL, /* Handle events. NULL'able */ - ReflectSeekWide /* Move access point (64 bit). NULL'able */ + "tclrchannel", /* Type name. */ + TCL_CHANNEL_VERSION_5, /* v5 channel */ + ReflectClose, /* Close channel, clean instance data */ + ReflectInput, /* Handle read request */ + ReflectOutput, /* Handle write request */ + ReflectSeek, /* Move location of access point. NULL'able */ + ReflectSetOption, /* Set options. NULL'able */ + ReflectGetOption, /* Get options. NULL'able */ + ReflectWatch, /* Initialize notifier */ + NULL, /* Get OS handle from the channel. NULL'able */ + NULL, /* No close2 support. NULL'able */ + ReflectBlock, /* Set blocking/nonblocking. NULL'able */ + NULL, /* Flush channel. Not used by core. NULL'able */ + NULL, /* Handle events. NULL'able */ + ReflectSeekWide, /* Move access point (64 bit). NULL'able */ + NULL, /* thread action */ + NULL, /* truncate */ }; /* diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 098510c..aacb889 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixChan.c,v 1.68 2006/03/25 03:18:55 das Exp $ + * RCS: @(#) $Id: tclUnixChan.c,v 1.69 2006/03/27 18:08:51 andreas_kupries Exp $ */ #include "tclInt.h" /* Internal definitions for Tcl. */ @@ -298,7 +298,7 @@ static Tcl_Channel MakeTcpClientChannelMode(ClientData tcpSocket, static Tcl_ChannelType fileChannelType = { "file", /* Type name. */ - TCL_CHANNEL_VERSION_4, /* v4 channel */ + TCL_CHANNEL_VERSION_5, /* v5 channel */ FileCloseProc, /* Close proc. */ FileInputProc, /* Input proc. */ FileOutputProc, /* Output proc. */ @@ -328,7 +328,7 @@ static Tcl_ChannelType fileChannelType = { static Tcl_ChannelType ttyChannelType = { "tty", /* Type name. */ - TCL_CHANNEL_VERSION_4, /* v4 channel */ + TCL_CHANNEL_VERSION_5, /* v5 channel */ TtyCloseProc, /* Close proc. */ FileInputProc, /* Input proc. */ #if BAD_TIP35_FLUSH @@ -358,7 +358,7 @@ static Tcl_ChannelType ttyChannelType = { static Tcl_ChannelType tcpChannelType = { "tcp", /* Type name. */ - TCL_CHANNEL_VERSION_4, /* v4 channel */ + TCL_CHANNEL_VERSION_5, /* v5 channel */ TcpCloseProc, /* Close proc. */ TcpInputProc, /* Input proc. */ TcpOutputProc, /* Output proc. */ diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index c41c1be..dc8087d 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixPipe.c,v 1.32 2005/11/02 23:26:50 dkf Exp $ + * RCS: @(#) $Id: tclUnixPipe.c,v 1.33 2006/03/27 18:08:51 andreas_kupries Exp $ */ #include "tclInt.h" @@ -70,7 +70,7 @@ static int SetupStdFile(TclFile file, int type); static Tcl_ChannelType pipeChannelType = { "pipe", /* Type name. */ - TCL_CHANNEL_VERSION_4, /* v4 channel */ + TCL_CHANNEL_VERSION_5, /* v5 channel */ PipeCloseProc, /* Close proc. */ PipeInputProc, /* Input proc. */ PipeOutputProc, /* Output proc. */ @@ -85,6 +85,7 @@ static Tcl_ChannelType pipeChannelType = { NULL, /* handler proc. */ NULL, /* wide seek proc */ NULL, /* thread action proc */ + NULL, /* truncation */ }; /* diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 94efd2f..7752d31 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinChan.c,v 1.46 2005/12/13 22:43:18 kennykb Exp $ + * RCS: @(#) $Id: tclWinChan.c,v 1.47 2006/03/27 18:08:51 andreas_kupries Exp $ */ #include "tclWinInt.h" @@ -103,7 +103,7 @@ static int FileTruncateProc(ClientData instanceData, static Tcl_ChannelType fileChannelType = { "file", /* Type name. */ - TCL_CHANNEL_VERSION_4, /* v4 channel */ + TCL_CHANNEL_VERSION_5, /* v5 channel */ FileCloseProc, /* Close proc. */ FileInputProc, /* Input proc. */ FileOutputProc, /* Output proc. */ diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index f859593..1480199 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinConsole.c,v 1.18 2005/12/13 22:43:18 kennykb Exp $ + * RCS: @(#) $Id: tclWinConsole.c,v 1.19 2006/03/27 18:08:51 andreas_kupries Exp $ */ #include "tclWinInt.h" @@ -165,7 +165,7 @@ static void ConsoleThreadActionProc(ClientData instanceData, static Tcl_ChannelType consoleChannelType = { "console", /* Type name. */ - TCL_CHANNEL_VERSION_4, /* v4 channel */ + TCL_CHANNEL_VERSION_5, /* v5 channel */ ConsoleCloseProc, /* Close proc. */ ConsoleInputProc, /* Input proc. */ ConsoleOutputProc, /* Output proc. */ @@ -180,6 +180,7 @@ static Tcl_ChannelType consoleChannelType = { NULL, /* handler proc. */ NULL, /* wide seek proc */ ConsoleThreadActionProc, /* thread action proc */ + NULL, /* truncation */ }; /* diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index 9046305..11a180d 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinPipe.c,v 1.62 2006/03/10 17:34:35 vasiljevic Exp $ + * RCS: @(#) $Id: tclWinPipe.c,v 1.63 2006/03/27 18:08:51 andreas_kupries Exp $ */ #include "tclWinInt.h" @@ -210,7 +210,7 @@ static void PipeThreadActionProc(ClientData instanceData, static Tcl_ChannelType pipeChannelType = { "pipe", /* Type name. */ - TCL_CHANNEL_VERSION_4, /* v4 channel */ + TCL_CHANNEL_VERSION_5, /* v5 channel */ TCL_CLOSE2PROC, /* Close proc. */ PipeInputProc, /* Input proc. */ PipeOutputProc, /* Output proc. */ @@ -225,6 +225,7 @@ static Tcl_ChannelType pipeChannelType = { NULL, /* handler proc. */ NULL, /* wide seek proc */ PipeThreadActionProc, /* thread action proc */ + NULL, /* truncate */ }; /* diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index a4557ee..a2846b3 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -11,7 +11,7 @@ * * Serial functionality implemented by Rolf.Schroedter@dlr.de * - * RCS: @(#) $Id: tclWinSerial.c,v 1.33 2005/10/31 13:53:33 dkf Exp $ + * RCS: @(#) $Id: tclWinSerial.c,v 1.34 2006/03/27 18:08:51 andreas_kupries Exp $ */ #include "tclWinInt.h" @@ -205,7 +205,7 @@ static int SerialBlockingWrite(SerialInfo *infoPtr, LPVOID buf, static Tcl_ChannelType serialChannelType = { "serial", /* Type name. */ - TCL_CHANNEL_VERSION_4, /* v4 channel */ + TCL_CHANNEL_VERSION_5, /* v5 channel */ SerialCloseProc, /* Close proc. */ SerialInputProc, /* Input proc. */ SerialOutputProc, /* Output proc. */ @@ -220,6 +220,7 @@ static Tcl_ChannelType serialChannelType = { NULL, /* handler proc. */ NULL, /* wide seek proc */ SerialThreadActionProc, /* thread action proc */ + NULL, /* truncate */ }; /* diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 553f4a2..c2bfc2c 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinSock.c,v 1.52 2006/03/10 17:34:35 vasiljevic Exp $ + * RCS: @(#) $Id: tclWinSock.c,v 1.53 2006/03/27 18:08:51 andreas_kupries Exp $ */ #include "tclWinInt.h" @@ -265,7 +265,7 @@ static Tcl_DriverGetHandleProc TcpGetHandleProc; static Tcl_ChannelType tcpChannelType = { "tcp", /* Type name. */ - TCL_CHANNEL_VERSION_4, /* v4 channel */ + TCL_CHANNEL_VERSION_5, /* v5 channel */ TcpCloseProc, /* Close proc. */ TcpInputProc, /* Input proc. */ TcpOutputProc, /* Output proc. */ @@ -280,6 +280,7 @@ static Tcl_ChannelType tcpChannelType = { NULL, /* handler proc. */ NULL, /* wide seek proc */ TcpThreadActionProc, /* thread action proc */ + NULL, /* truncate */ }; /* -- cgit v0.12