summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2006-03-27 18:08:49 (GMT)
committerandreas_kupries <akupries@shaw.ca>2006-03-27 18:08:49 (GMT)
commitdefe3d84881f228cf76d953096d229f48f4ef832 (patch)
treea21d2be7d2f28c05724ac99fed38fb39a5c427e5 /generic
parentebc6052351a702f64995fa97024d989464aebdc9 (diff)
downloadtcl-defe3d84881f228cf76d953096d229f48f4ef832.zip
tcl-defe3d84881f228cf76d953096d229f48f4ef832.tar.gz
tcl-defe3d84881f228cf76d953096d229f48f4ef832.tar.bz2
* 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:
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.h9
-rw-r--r--generic/tclIO.c6
-rw-r--r--generic/tclIOGT.c6
-rw-r--r--generic/tclIORChan.c34
4 files changed, 33 insertions, 22 deletions
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 <v2 channel versions, the version field is occupied by the
@@ -9953,7 +9955,7 @@ Tcl_DriverTruncateProc *
Tcl_ChannelTruncateProc(
Tcl_ChannelType *chanTypePtr) /* Pointer to channel type. */
{
- if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_4)) {
+ if (HaveVersion(chanTypePtr, TCL_CHANNEL_VERSION_5)) {
return chanTypePtr->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 <tclInt.h>
@@ -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 */
};
/*