OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/hostdependX86LINUX64.git] / util / X86LINUX64 / man / man3 / Tcl_ChannelHandlerProc.3
index 1cf5cde..03d7ee3 100644 (file)
@@ -4,76 +4,81 @@
 '\"
 '\" 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.16 2002/07/01 18:24:39 jenglish Exp $
-'\" The definitions below are for supplemental macros used in Tcl/Tk
-'\" manual entries.
-'\"
-'\" .AP type name in/out ?indent?
-'\"    Start paragraph describing an argument to a library procedure.
-'\"    type is type of argument (int, etc.), in/out is either "in", "out",
-'\"    or "in/out" to describe whether procedure reads or modifies arg,
-'\"    and indent is equivalent to second arg of .IP (shouldn't ever be
-'\"    needed;  use .AS below instead)
-'\"
-'\" .AS ?type? ?name?
-'\"    Give maximum sizes of arguments for setting tab stops.  Type and
-'\"    name are examples of largest possible arguments that will be passed
-'\"    to .AP later.  If args are omitted, default tab stops are used.
-'\"
-'\" .BS
-'\"    Start box enclosure.  From here until next .BE, everything will be
-'\"    enclosed in one large box.
-'\"
-'\" .BE
-'\"    End of box enclosure.
-'\"
-'\" .CS
-'\"    Begin code excerpt.
-'\"
-'\" .CE
-'\"    End code excerpt.
-'\"
-'\" .VS ?version? ?br?
-'\"    Begin vertical sidebar, for use in marking newly-changed parts
-'\"    of man pages.  The first argument is ignored and used for recording
-'\"    the version when the .VS was added, so that the sidebars can be
-'\"    found and removed when they reach a certain age.  If another argument
-'\"    is present, then a line break is forced before starting the sidebar.
-'\"
-'\" .VE
-'\"    End of vertical sidebar.
-'\"
-'\" .DS
-'\"    Begin an indented unfilled display.
-'\"
-'\" .DE
-'\"    End of indented unfilled display.
-'\"
-'\" .SO
-'\"    Start of list of standard options for a Tk widget.  The
-'\"    options follow on successive lines, in four columns separated
-'\"    by tabs.
-'\"
-'\" .SE
-'\"    End of list of standard options for a Tk widget.
-'\"
-'\" .OP cmdName dbName dbClass
-'\"    Start of description of a specific option.  cmdName gives the
-'\"    option's name as specified in the class command, dbName gives
-'\"    the option's name in the option database, and dbClass gives
-'\"    the option's class in the option database.
-'\"
-'\" .UL arg1 arg2
-'\"    Print arg1 underlined, then print arg2 normally.
-'\"
-'\" RCS: @(#) $Id: man.macros,v 1.4 2000/08/25 06:18:32 ericm Exp $
-'\"
-'\"    # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
+.TH Tcl_CreateChannel 3 8.4 Tcl "Tcl Library Procedures"
+.\" The -*- nroff -*- definitions below are for supplemental macros used
+.\" in Tcl/Tk manual entries.
+.\"
+.\" .AP type name in/out ?indent?
+.\"    Start paragraph describing an argument to a library procedure.
+.\"    type is type of argument (int, etc.), in/out is either "in", "out",
+.\"    or "in/out" to describe whether procedure reads or modifies arg,
+.\"    and indent is equivalent to second arg of .IP (shouldn't ever be
+.\"    needed;  use .AS below instead)
+.\"
+.\" .AS ?type? ?name?
+.\"    Give maximum sizes of arguments for setting tab stops.  Type and
+.\"    name are examples of largest possible arguments that will be passed
+.\"    to .AP later.  If args are omitted, default tab stops are used.
+.\"
+.\" .BS
+.\"    Start box enclosure.  From here until next .BE, everything will be
+.\"    enclosed in one large box.
+.\"
+.\" .BE
+.\"    End of box enclosure.
+.\"
+.\" .CS
+.\"    Begin code excerpt.
+.\"
+.\" .CE
+.\"    End code excerpt.
+.\"
+.\" .VS ?version? ?br?
+.\"    Begin vertical sidebar, for use in marking newly-changed parts
+.\"    of man pages.  The first argument is ignored and used for recording
+.\"    the version when the .VS was added, so that the sidebars can be
+.\"    found and removed when they reach a certain age.  If another argument
+.\"    is present, then a line break is forced before starting the sidebar.
+.\"
+.\" .VE
+.\"    End of vertical sidebar.
+.\"
+.\" .DS
+.\"    Begin an indented unfilled display.
+.\"
+.\" .DE
+.\"    End of indented unfilled display.
+.\"
+.\" .SO ?manpage?
+.\"    Start of list of standard options for a Tk widget. The manpage
+.\"    argument defines where to look up the standard options; if
+.\"    omitted, defaults to "options". The options follow on successive
+.\"    lines, in three columns separated by tabs.
+.\"
+.\" .SE
+.\"    End of list of standard options for a Tk widget.
+.\"
+.\" .OP cmdName dbName dbClass
+.\"    Start of description of a specific option.  cmdName gives the
+.\"    option's name as specified in the class command, dbName gives
+.\"    the option's name in the option database, and dbClass gives
+.\"    the option's class in the option database.
+.\"
+.\" .UL arg1 arg2
+.\"    Print arg1 underlined, then print arg2 normally.
+.\"
+.\" .QW arg1 ?arg2?
+.\"    Print arg1 in quotes, then arg2 normally (for trailing punctuation).
+.\"
+.\" .PQ arg1 ?arg2?
+.\"    Print an open parenthesis, arg1 in quotes, then arg2 normally
+.\"    (for trailing punctuation) and then a closing parenthesis.
+.\"
+.\"    # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
 .if t .wh -1.3i ^B
 .nr ^l \n(.l
 .ad b
-'\"    # Start an argument description
+.\"    # Start an argument description
 .de AP
 .ie !"\\$4"" .TP \\$4
 .el \{\
@@ -82,7 +87,7 @@
 .\}
 .ta \\n()Au \\n()Bu
 .ie !"\\$3"" \{\
-\&\\$1 \\fI\\$2\\fP    (\\$3)
+\&\\$1 \\fI\\$2\\fP (\\$3)
 .\".b
 .\}
 .el \{\
 .\}
 .\}
 ..
-'\"    # define tabbing values for .AP
+.\"    # define tabbing values for .AP
 .de AS
 .nr )A 10n
 .if !"\\$1"" .nr )A \\w'\\$1'u+3n
 .nr )C \\n()Bu+\\w'(in/out)'u+2n
 ..
 .AS Tcl_Interp Tcl_CreateInterp in/out
-'\"    # BS - start boxed text
-'\"    # ^y = starting y location
-'\"    # ^b = 1
+.\"    # BS - start boxed text
+.\"    # ^y = starting y location
+.\"    # ^b = 1
 .de BS
 .br
 .mk ^y
 .if n \l'\\n(.lu\(ul'
 .if n .fi
 ..
-'\"    # BE - end boxed text (draw box now)
+.\"    # BE - end boxed text (draw box now)
 .de BE
 .nf
 .ti 0
 .br
 .nr ^b 0
 ..
-'\"    # VS - start vertical sidebar
-'\"    # ^Y = starting y location
-'\"    # ^v = 1 (for troff;  for nroff this doesn't matter)
+.\"    # VS - start vertical sidebar
+.\"    # ^Y = starting y location
+.\"    # ^v = 1 (for troff;  for nroff this doesn't matter)
 .de VS
 .if !"\\$2"" .br
 .mk ^Y
 .ie n 'mc \s12\(br\s0
 .el .nr ^v 1u
 ..
-'\"    # VE - end of vertical sidebar
+.\"    # VE - end of vertical sidebar
 .de VE
 .ie n 'mc
 .el \{\
 .\}
 .nr ^v 0
 ..
-'\"    # Special macro to handle page bottom:  finish off current
-'\"    # box/sidebar if in box/sidebar mode, then invoked standard
-'\"    # page bottom macro.
+.\"    # Special macro to handle page bottom:  finish off current
+.\"    # box/sidebar if in box/sidebar mode, then invoked standard
+.\"    # page bottom macro.
 .de ^B
 .ev 2
 'ti 0
 .mk ^Y
 .\}
 ..
-'\"    # DS - begin display
+.\"    # DS - begin display
 .de DS
 .RS
 .nf
 .sp
 ..
-'\"    # DE - end display
+.\"    # DE - end display
 .de DE
 .fi
 .RE
 .sp
 ..
-'\"    # SO - start of list of standard options
+.\"    # SO - start of list of standard options
 .de SO
+'ie '\\$1'' .ds So \\fBoptions\\fR
+'el .ds So \\fB\\$1\\fR
 .SH "STANDARD OPTIONS"
 .LP
 .nf
 .ta 5.5c 11c
 .ft B
 ..
-'\"    # SE - end of list of standard options
+.\"    # SE - end of list of standard options
 .de SE
 .fi
 .ft R
 .LP
-See the \\fBoptions\\fR manual entry for details on the standard options.
+See the \\*(So manual entry for details on the standard options.
 ..
-'\"    # OP - start of full description for a single option
+.\"    # OP - start of full description for a single option
 .de OP
 .LP
 .nf
@@ -228,25 +235,47 @@ Database Class:   \\fB\\$3\\fR
 .fi
 .IP
 ..
-'\"    # CS - begin code excerpt
+.\"    # CS - begin code excerpt
 .de CS
 .RS
 .nf
 .ta .25i .5i .75i 1i
 ..
-'\"    # CE - end code excerpt
+.\"    # CE - end code excerpt
 .de CE
 .fi
 .RE
 ..
+.\"    # UL - underline word
 .de UL
 \\$1\l'|0\(ul'\\$2
 ..
-.TH Tcl_CreateChannel 3 8.3 Tcl "Tcl Library Procedures"
+.\"    # QW - apply quotation marks to word
+.de QW
+.ie '\\*(lq'"' ``\\$1''\\$2
+.\"" fix emacs highlighting
+.el \\*(lq\\$1\\*(rq\\$2
+..
+.\"    # PQ - apply parens and quotation marks to word
+.de PQ
+.ie '\\*(lq'"' (``\\$1''\\$2)\\$3
+.\"" fix emacs highlighting
+.el (\\*(lq\\$1\\*(rq\\$2)\\$3
+..
+.\"    # QR - quoted range
+.de QR
+.ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
+.\"" fix emacs highlighting
+.el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
+..
+.\"    # MT - "empty" string
+.de MT
+.QW ""
+..
 .BS
 '\" Note:  do not modify the .SH NAME line immediately below!
 .SH NAME
-Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChannelName, Tcl_GetChannelHandle, Tcl_GetChannelMode, Tcl_GetChannelBufferSize, Tcl_SetChannelBufferSize, Tcl_NotifyChannel, Tcl_BadChannelOption, Tcl_ChannelName, Tcl_ChannelVersion, Tcl_ChannelBlockModeProc, Tcl_ChannelCloseProc, Tcl_ChannelClose2Proc, Tcl_ChannelInputProc, Tcl_ChannelOutputProc, Tcl_ChannelSeekProc, Tcl_ChannelWideSeekProc, Tcl_ChannelSetOptionProc, Tcl_ChannelGetOptionProc, Tcl_ChannelWatchProc, Tcl_ChannelGetHandleProc, Tcl_ChannelFlushProc, Tcl_ChannelHandlerProc, Tcl_IsChannelShared, Tcl_IsChannelRegistered, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting, Tcl_ClearChannelHandlers, Tcl_GetChannelThread, Tcl_ChannelBuffered \- procedures for creating and manipulating channels
+Tcl_CreateChannel, Tcl_GetChannelInstanceData, Tcl_GetChannelType, Tcl_GetChannelName, Tcl_GetChannelHandle, Tcl_GetChannelMode, Tcl_GetChannelBufferSize, Tcl_SetChannelBufferSize, Tcl_NotifyChannel, Tcl_BadChannelOption, Tcl_ChannelName, Tcl_ChannelVersion, Tcl_ChannelBlockModeProc, Tcl_ChannelCloseProc, Tcl_ChannelClose2Proc, Tcl_ChannelInputProc, Tcl_ChannelOutputProc, Tcl_ChannelSeekProc, Tcl_ChannelWideSeekProc, Tcl_ChannelTruncateProc, Tcl_ChannelSetOptionProc, Tcl_ChannelGetOptionProc, Tcl_ChannelWatchProc, Tcl_ChannelGetHandleProc, Tcl_ChannelFlushProc, Tcl_ChannelHandlerProc, Tcl_ChannelThreadActionProc, Tcl_IsChannelShared, Tcl_IsChannelRegistered, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting, Tcl_ClearChannelHandlers, Tcl_GetChannelThread, Tcl_ChannelBuffered \- procedures for creating and manipulating channels
 .SH SYNOPSIS
 .nf
 \fB#include <tcl.h>\fR
@@ -257,19 +286,20 @@ Tcl_Channel
 ClientData
 \fBTcl_GetChannelInstanceData\fR(\fIchannel\fR)
 .sp
-Tcl_ChannelType *
+const Tcl_ChannelType *
 \fBTcl_GetChannelType\fR(\fIchannel\fR)
 .sp
-CONST char *
+const char *
 \fBTcl_GetChannelName\fR(\fIchannel\fR)
 .sp
 int
 \fBTcl_GetChannelHandle\fR(\fIchannel, direction, handlePtr\fR)
 .sp
-.VS 8.4
 Tcl_ThreadId
 \fBTcl_GetChannelThread\fR(\fIchannel\fR)
-.VE 8.4
+.sp
+int
+\fBTcl_GetChannelMode\fR(\fIchannel\fR)
 .sp
 int
 \fBTcl_GetChannelBufferSize\fR(\fIchannel\fR)
@@ -280,7 +310,6 @@ int
 .sp
 int
 \fBTcl_BadChannelOption\fR(\fIinterp, optionName, optionList\fR)
-.VS 8.4
 .sp
 int
 \fBTcl_IsChannelShared\fR(\fIchannel\fR)
@@ -299,12 +328,11 @@ void
 .sp
 void
 \fBTcl_ClearChannelHandlers\fR(\fIchannel\fR)
-.VE 8.4
 .sp
 int
 \fBTcl_ChannelBuffered\fR(\fIchannel\fR)
 .sp
-CONST char *
+const char *
 \fBTcl_ChannelName\fR(\fItypePtr\fR)
 .sp
 Tcl_ChannelTypeVersion
@@ -328,10 +356,14 @@ Tcl_DriverOutputProc *
 Tcl_DriverSeekProc *
 \fBTcl_ChannelSeekProc\fR(\fItypePtr\fR)
 .sp
-.VS 8.4
 Tcl_DriverWideSeekProc *
 \fBTcl_ChannelWideSeekProc\fR(\fItypePtr\fR)
-.VE 8.4
+.sp
+Tcl_DriverThreadActionProc *
+\fBTcl_ChannelThreadActionProc\fR(\fItypePtr\fR)
+.sp
+Tcl_DriverTruncateProc *
+\fBTcl_ChannelTruncateProc\fR(\fItypePtr\fR)
 .sp
 Tcl_DriverSetOptionProc *
 \fBTcl_ChannelSetOptionProc\fR(\fItypePtr\fR)
@@ -352,14 +384,16 @@ Tcl_DriverHandlerProc *
 \fBTcl_ChannelHandlerProc\fR(\fItypePtr\fR)
 .sp
 .SH ARGUMENTS
-.AS Tcl_ChannelType *channelName in
-.AP Tcl_ChannelType *typePtr in
+.AS "const Tcl_ChannelType" *channelName
+.AP "const Tcl_ChannelType" *typePtr in
 Points to a structure containing the addresses of procedures that
 can be called to perform I/O and other functions on the channel.
-.AP "CONST char" *channelName in
+.AP "const char" *channelName in
 The name of this channel, such as \fBfile3\fR; must not be in use
 by any other channel. Can be NULL, in which case the channel is
-created without a name.
+created without a name. If the created channel is assigned to one
+of the standard channels (\fBstdin\fR, \fBstdout\fR or \fBstderr\fR),
+the assigned channel name will be the name of the standard channel.
 .AP ClientData instanceData in
 Arbitrary one-word value to be associated with this channel.  This
 value is passed to procedures in \fItypePtr\fR when they are invoked.
@@ -382,15 +416,14 @@ and \fBTCL_EXCEPTION\fR that indicates events that have occurred on
 this channel.
 .AP Tcl_Interp *interp in
 Current interpreter. (can be NULL)
-.AP "CONST char" *optionName in
+.AP "const char" *optionName in
 Name of the invalid option.
-.AP "CONST char" *optionList in
-Specific options list (space separated words, without "-") 
+.AP "const char" *optionList in
+Specific options list (space separated words, without
+.QW \- )
 to append to the standard generic options list.
 Can be NULL for generic options error message only.
-
 .BE
-
 .SH DESCRIPTION
 .PP
 Tcl uses a two-layered channel architecture. It provides a generic upper
@@ -409,7 +442,7 @@ driver provides a \fBTcl_ChannelType\fR structure containing pointers to
 functions implementing the various operations used by the generic layer to
 communicate with the channel driver. The \fBTcl_ChannelType\fR structure
 and the functions referenced by it are described in the section
-TCL_CHANNELTYPE, below.
+\fBTCL_CHANNELTYPE\fR, below.
 .PP
 Second, channel drivers usually provide a Tcl command to create
 instances of that type of channel. For example, the Tcl \fBopen\fR
@@ -436,7 +469,7 @@ structure to perform operations on the channel.
 \fItypePtr\fR and \fIinstanceData\fR with it. The channel is opened in the
 mode indicated by \fImask\fR.
 For a discussion of channel drivers, their operations and the
-\fBTcl_ChannelType\fR structure, see the section TCL_CHANNELTYPE, below.
+\fBTcl_ChannelType\fR structure, see the section \fBTCL_CHANNELTYPE\fR, below.
 .PP
 \fBTcl_CreateChannel\fR interacts with the code managing the standard
 channels. Once a standard channel was initialized either through a
@@ -444,7 +477,7 @@ call to \fBTcl_GetStdChannel\fR or a call to \fBTcl_SetStdChannel\fR
 closing this standard channel will cause the next call to
 \fBTcl_CreateChannel\fR to make the new channel the new standard
 channel too. See \fBTcl_StandardChannels\fR for a general treatise
-about standard channels and the behaviour of the Tcl library with
+about standard channels and the behavior of the Tcl library with
 regard to them.
 .PP
 \fBTcl_GetChannelInstanceData\fR returns the instance data associated with
@@ -467,12 +500,10 @@ the channel does not have a device handle for the specified direction,
 then \fBTCL_ERROR\fR is returned instead.  Different channel drivers
 will return different types of handle.  Refer to the manual entries
 for each driver to determine what type of handle is returned.
-.VS 8.4
 .PP
 \fBTcl_GetChannelThread\fR returns the id of the thread currently managing
 the specified \fIchannel\fR. This allows channel drivers to send their file
 events to the correct event queue even for a multi-threaded core.
-.VE 8.4
 .PP
 \fBTcl_GetChannelMode\fR returns an OR-ed combination of \fBTCL_READABLE\fR
 and \fBTCL_WRITABLE\fR, indicating whether the channel is open for input
@@ -485,8 +516,8 @@ the default value of 4096 is returned.
 .PP
 \fBTcl_SetChannelBufferSize\fR sets the size, in bytes, of buffers that
 will be allocated in subsequent operations on the channel to store input or
-output. The \fIsize\fR argument should be between ten and one million,
-allowing buffers of ten bytes to one million bytes. If \fIsize\fR is
+output. The \fIsize\fR argument should be between one and one million,
+allowing buffers of one byte to one million bytes. If \fIsize\fR is
 outside this range, \fBTcl_SetChannelBufferSize\fR sets the buffer size to
 4096.
 .PP
@@ -496,15 +527,15 @@ occurred on the channel.  Channel drivers are responsible for invoking
 this function whenever the channel handlers need to be called for the
 channel.  See \fBWATCHPROC\fR below for more details.
 .PP
-\fBTcl_BadChannelOption\fR is called from driver specific set or get option
-procs to generate a complete error message.
+\fBTcl_BadChannelOption\fR is called from driver specific
+\fIsetOptionProc\fR or \fIgetOptionProc\fR to generate a complete
+error message.
 .PP
 \fBTcl_ChannelBuffered\fR returns the number of bytes of input
 currently buffered in the internal buffer (push back area) of the
 channel itself. It does not report about the data in the overall
 buffers for the stack of channels the supplied channel is part of.
 .PP
-.VS 8.4
 \fBTcl_IsChannelShared\fR checks the refcount of the specified
 \fIchannel\fR and returns whether the \fIchannel\fR was shared among
 multiple interpreters (result == 1) or not (result == 0).
@@ -521,16 +552,20 @@ name is registered in the (thread)-global list of all channels (result
 (thread)global list of all channels (of the current thread).
 Application to a channel still registered in some interpreter
 is not allowed.
+Also notifies the driver if the \fBTcl_ChannelType\fR version is
+\fBTCL_CHANNEL_VERSION_4\fR (or higher), and
+\fBTcl_DriverThreadActionProc\fR is defined for it.
 .PP
 \fBTcl_SpliceChannel\fR adds the specified \fIchannel\fR to the
 (thread)global list of all channels (of the current thread).
 Application to a channel registered in some interpreter is not allowed.
+Also notifies the driver if the \fBTcl_ChannelType\fR version is
+\fBTCL_CHANNEL_VERSION_4\fR (or higher), and
+\fBTcl_DriverThreadActionProc\fR is defined for it.
 .PP
-\fBTcl_ClearChannelHandlers\fR removes all channelhandlers and event
+\fBTcl_ClearChannelHandlers\fR removes all channel handlers and event
 scripts associated with the specified \fIchannel\fR, thus shutting
 down all event processing for this channel.
-.VE 8.4
-
 .SH TCL_CHANNELTYPE
 .PP
 A channel driver provides a \fBTcl_ChannelType\fR structure that contains
@@ -541,33 +576,38 @@ channel drivers.  See the \fBOLD CHANNEL TYPES\fR section below for
 details about the old structure.
 .PP
 The \fBTcl_ChannelType\fR structure contains the following fields:
+.PP
 .CS
 typedef struct Tcl_ChannelType {
-       char *\fItypeName\fR;
-       Tcl_ChannelTypeVersion \fIversion\fR;
-       Tcl_DriverCloseProc *\fIcloseProc\fR;
-       Tcl_DriverInputProc *\fIinputProc\fR;
-       Tcl_DriverOutputProc *\fIoutputProc\fR;
-       Tcl_DriverSeekProc *\fIseekProc\fR;
-       Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
-       Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
-       Tcl_DriverWatchProc *\fIwatchProc\fR;
-       Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
-       Tcl_DriverClose2Proc *\fIclose2Proc\fR;
-       Tcl_DriverBlockModeProc *\fIblockModeProc\fR;   
-       Tcl_DriverFlushProc *\fIflushProc\fR;   
-       Tcl_DriverHandlerProc *\fIhandlerProc\fR;       
-       Tcl_DriverWideSeekProc *\fIwideSeekProc\fR;
-} Tcl_ChannelType;
+        const char *\fItypeName\fR;
+        Tcl_ChannelTypeVersion \fIversion\fR;
+        Tcl_DriverCloseProc *\fIcloseProc\fR;
+        Tcl_DriverInputProc *\fIinputProc\fR;
+        Tcl_DriverOutputProc *\fIoutputProc\fR;
+        Tcl_DriverSeekProc *\fIseekProc\fR;
+        Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
+        Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
+        Tcl_DriverWatchProc *\fIwatchProc\fR;
+        Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
+        Tcl_DriverClose2Proc *\fIclose2Proc\fR;
+        Tcl_DriverBlockModeProc *\fIblockModeProc\fR;
+        Tcl_DriverFlushProc *\fIflushProc\fR;
+        Tcl_DriverHandlerProc *\fIhandlerProc\fR;
+        Tcl_DriverWideSeekProc *\fIwideSeekProc\fR;
+        Tcl_DriverThreadActionProc *\fIthreadActionProc\fR;
+        Tcl_DriverTruncateProc *\fItruncateProc\fR;
+} \fBTcl_ChannelType\fR;
 .CE
 .PP
-The driver must provide implementations for all functions except
-\fIblockModeProc\fR, \fIseekProc\fR, \fIsetOptionProc\fR,
-\fIgetOptionProc\fR, and \fIclose2Proc\fR, which may be specified as
-NULL.  Other functions that can not be implemented for this type of
-device should return \fBEINVAL\fR when invoked to indicate that they
-are not implemented, except in the case of \fIflushProc\fR and
-\fIhandlerProc\fR, which should specified as NULL if not otherwise defined.
+It is not necessary to provide implementations for all channel
+operations.  Those which are not necessary may be set to NULL in the
+struct: \fIblockModeProc\fR, \fIseekProc\fR, \fIsetOptionProc\fR,
+\fIgetOptionProc\fR, \fIgetHandleProc\fR, and \fIclose2Proc\fR, in addition to
+\fIflushProc\fR, \fIhandlerProc\fR, \fIthreadActionProc\fR, and
+\fItruncateProc\fR.  Other functions that cannot be implemented in a
+meaningful way should return \fBEINVAL\fR when called, to indicate
+that the operations they represent are not available. Also note that
+\fIwideSeekProc\fR can be NULL if \fIseekProc\fR is.
 .PP
 The user should only use the above structure for \fBTcl_ChannelType\fR
 instantiation.  When referencing fields in a \fBTcl_ChannelType\fR
@@ -576,19 +616,17 @@ structure, the following functions should be used to obtain the values:
 \fBTcl_ChannelBlockModeProc\fR, \fBTcl_ChannelCloseProc\fR,
 \fBTcl_ChannelClose2Proc\fR, \fBTcl_ChannelInputProc\fR,
 \fBTcl_ChannelOutputProc\fR, \fBTcl_ChannelSeekProc\fR,
-.VS 8.4
-\fBTcl_ChannelWideSeekProc\fR,
-.VE 8.4
+\fBTcl_ChannelWideSeekProc\fR, \fBTcl_ChannelThreadActionProc\fR,
+\fBTcl_ChannelTruncateProc\fR,
 \fBTcl_ChannelSetOptionProc\fR, \fBTcl_ChannelGetOptionProc\fR,
 \fBTcl_ChannelWatchProc\fR, \fBTcl_ChannelGetHandleProc\fR,
 \fBTcl_ChannelFlushProc\fR, or \fBTcl_ChannelHandlerProc\fR.
 .PP
 The change to the structures was made in such a way that standard channel
 types are binary compatible.  However, channel types that use stacked
-channels (ie: TLS, Trf) have new versions to correspond to the above change
+channels (i.e. TLS, Trf) have new versions to correspond to the above change
 since the previous code for stacked channels had problems.
-
-.SH TYPENAME
+.SS TYPENAME
 .PP
 The \fItypeName\fR field contains a null-terminated string that
 identifies the type of the device implemented by this driver, e.g.
@@ -596,32 +634,39 @@ identifies the type of the device implemented by this driver, e.g.
 .PP
 This value can be retrieved with \fBTcl_ChannelName\fR, which returns
 a pointer to the string.
-
-.SH VERSION
+.SS VERSION
 .PP
-The \fIversion\fR field should be set to \fBTCL_CHANNEL_VERSION_2\fR.
-If it is not set to this value \fBTCL_CHANNEL_VERSION_3\fR, then this
-\fBTcl_ChannelType\fR is assumed to have the older structure.  See
+
+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 specify the \fIwideSeekProc\fR member.
+\fBTCL_CHANNEL_VERSION_4\fR must be set to specify the \fIthreadActionProc\fR member
+(includes \fIwideSeekProc\fR).
+\fBTCL_CHANNEL_VERSION_5\fR must be set to specify the
+\fItruncateProc\fR members (includes
+\fIwideSeekProc\fR and \fIthreadActionProc\fR).
+If it is not set to any of these, then this
+\fBTcl_ChannelType\fR is assumed to have the original structure.  See
 \fBOLD CHANNEL TYPES\fR for more details.  While Tcl will recognize
-and function with either structure, stacked channels must be of at
+and function with either structures, stacked channels must be of at
 least \fBTCL_CHANNEL_VERSION_2\fR to function correctly.
 .PP
 This value can be retrieved with \fBTcl_ChannelVersion\fR, which returns
-.VS 8.4
-one of \fBTCL_CHANNEL_VERSION_3\fR,
-.VE 8.4
+one of
+\fBTCL_CHANNEL_VERSION_5\fR,
+\fBTCL_CHANNEL_VERSION_4\fR,
+\fBTCL_CHANNEL_VERSION_3\fR,
 \fBTCL_CHANNEL_VERSION_2\fR or \fBTCL_CHANNEL_VERSION_1\fR.
-
-.SH BLOCKMODEPROC
+.SS BLOCKMODEPROC
 .PP
 The \fIblockModeProc\fR field contains the address of a function called by
 the generic layer to set blocking and nonblocking mode on the device.
 \fIBlockModeProc\fR should match the following prototype:
 .PP
 .CS
-typedef int Tcl_DriverBlockModeProc(
-       ClientData \fIinstanceData\fR,
-       int \fImode\fR);
+typedef int \fBTcl_DriverBlockModeProc\fR(
+        ClientData \fIinstanceData\fR,
+        int \fImode\fR);
 .CE
 .PP
 The \fIinstanceData\fR is the same as the value passed to
@@ -640,17 +685,23 @@ behavior must be emulated in the channel driver.
 .PP
 This value can be retrieved with \fBTcl_ChannelBlockModeProc\fR, which returns
 a pointer to the function.
-
-.SH "CLOSEPROC AND CLOSE2PROC"
+.PP
+A channel driver \fBnot\fR supplying a \fIblockModeProc\fR has to be
+very, very careful. It has to tell the generic layer exactly which
+blocking mode is acceptable to it, and should this also document for
+the user so that the blocking mode of the channel is not changed to an
+unacceptable value. Any confusion here may lead the interpreter into a
+(spurious and difficult to find) deadlock.
+.SS "CLOSEPROC AND CLOSE2PROC"
 .PP
 The \fIcloseProc\fR field contains the address of a function called by the
 generic layer to clean up driver-related information when the channel is
 closed. \fICloseProc\fR must match the following prototype:
 .PP
 .CS
-typedef int Tcl_DriverCloseProc(
-       ClientData \fIinstanceData\fR,
-       Tcl_Interp *\fIinterp\fR);
+typedef int \fBTcl_DriverCloseProc\fR(
+        ClientData \fIinstanceData\fR,
+        Tcl_Interp *\fIinterp\fR);
 .CE
 .PP
 The \fIinstanceData\fR argument is the same as the value provided to
@@ -670,10 +721,10 @@ independently may set \fIcloseProc\fR to \fBTCL_CLOSE2PROC\fR and set
 following prototype:
 .PP
 .CS
-typedef int Tcl_DriverClose2Proc(
-       ClientData \fIinstanceData\fR,
-       Tcl_Interp *\fIinterp\fR,
-       int \fIflags\fR);
+typedef int \fBTcl_DriverClose2Proc\fR(
+        ClientData \fIinstanceData\fR,
+        Tcl_Interp *\fIinterp\fR,
+        int \fIflags\fR);
 .CE
 .PP
 The \fIclose2Proc\fR will be called with \fIflags\fR set to an OR'ed
@@ -691,22 +742,21 @@ return a nonzero POSIX error code. In addition, if an error occurs and
 \fIinterp\fR is not NULL, the procedure should store an error message
 in the interpreter's result.
 .PP
-These value can be retrieved with \fBTcl_ChannelCloseProc\fR or
-\fBTcl_ChannelClose2Proc\fR, which returns a pointer to the respective
-function.
-
-.SH INPUTPROC
+The \fIcloseProc\fR and \fIclose2Proc\fR values can be retrieved with
+\fBTcl_ChannelCloseProc\fR or \fBTcl_ChannelClose2Proc\fR, which
+return a pointer to the respective function.
+.SS INPUTPROC
 .PP
 The \fIinputProc\fR field contains the address of a function called by the
 generic layer to read data from the file or device and store it in an
 internal buffer. \fIInputProc\fR must match the following prototype:
 .PP
 .CS
-typedef int Tcl_DriverInputProc(
-       ClientData \fIinstanceData\fR,
-       char *\fIbuf\fR,
-       int \fIbufSize\fR,
-       int *\fIerrorCodePtr\fR);
+typedef int \fBTcl_DriverInputProc\fR(
+        ClientData \fIinstanceData\fR,
+        char *\fIbuf\fR,
+        int \fIbufSize\fR,
+        int *\fIerrorCodePtr\fR);
 .CE
 .PP
 \fIInstanceData\fR is the same as the value passed to
@@ -739,19 +789,18 @@ blocking.
 .PP
 This value can be retrieved with \fBTcl_ChannelInputProc\fR, which returns
 a pointer to the function.
-
-.SH OUTPUTPROC
+.SS OUTPUTPROC
 .PP
 The \fIoutputProc\fR field contains the address of a function called by the
 generic layer to transfer data from an internal buffer to the output device.
 \fIOutputProc\fR must match the following prototype:
 .PP
 .CS
-typedef int Tcl_DriverOutputProc(
-       ClientData \fIinstanceData\fR,
-       CONST char *\fIbuf\fR,
-       int \fItoWrite\fR,
-       int *\fIerrorCodePtr\fR);
+typedef int \fBTcl_DriverOutputProc\fR(
+        ClientData \fIinstanceData\fR,
+        const char *\fIbuf\fR,
+        int \fItoWrite\fR,
+        int *\fIerrorCodePtr\fR);
 .CE
 .PP
 \fIInstanceData\fR is the same as the value passed to
@@ -778,8 +827,7 @@ without writing any data.
 .PP
 This value can be retrieved with \fBTcl_ChannelOutputProc\fR, which returns
 a pointer to the function.
-
-.SH "SEEKPROC AND WIDESEEKPROC"
+.SS "SEEKPROC AND WIDESEEKPROC"
 .PP
 The \fIseekProc\fR field contains the address of a function called by the
 generic layer to move the access point at which subsequent input or output
@@ -787,11 +835,11 @@ operations will be applied. \fISeekProc\fR must match the following
 prototype:
 .PP
 .CS
-typedef int Tcl_DriverSeekProc(
-       ClientData \fIinstanceData\fR,
-       long \fIoffset\fR,
-       int \fIseekMode\fR,
-       int *\fIerrorCodePtr\fR);
+typedef int \fBTcl_DriverSeekProc\fR(
+        ClientData \fIinstanceData\fR,
+        long \fIoffset\fR,
+        int \fIseekMode\fR,
+        int *\fIerrorCodePtr\fR);
 .CE
 .PP
 The \fIinstanceData\fR argument is the same as the value given to
@@ -808,7 +856,6 @@ does not implement seeking.
 The return value is the new access point or -1 in case of error. If an
 error occurred, the function should not move the access point.
 .PP
-.VS 8.4
 If there is a non-NULL \fIseekProc\fR field, the \fIwideSeekProc\fR
 field may contain the address of an alternative function to use which
 handles wide (i.e. larger than 32-bit) offsets, so allowing seeks
@@ -818,11 +865,11 @@ in preference to the \fIseekProc\fR, but both must be defined if the
 following prototype:
 .PP
 .CS
-typedef Tcl_WideInt Tcl_DriverWideSeekProc(
-       ClientData \fIinstanceData\fR,
-       Tcl_WideInt \fIoffset\fR,
-       int \fIseekMode\fR,
-       int *\fIerrorCodePtr\fR);
+typedef Tcl_WideInt \fBTcl_DriverWideSeekProc\fR(
+        ClientData \fIinstanceData\fR,
+        Tcl_WideInt \fIoffset\fR,
+        int \fIseekMode\fR,
+        int *\fIerrorCodePtr\fR);
 .CE
 .PP
 The arguments and return values mean the same thing as with
@@ -833,20 +880,18 @@ The \fIseekProc\fR value can be retrieved with
 \fBTcl_ChannelSeekProc\fR, which returns a pointer to the function,
 and similarly the \fIwideSeekProc\fR can be retrieved with
 \fBTcl_ChannelWideSeekProc\fR.
-.VE 8.4
-
-.SH SETOPTIONPROC
+.SS SETOPTIONPROC
 .PP
 The \fIsetOptionProc\fR field contains the address of a function called by
 the generic layer to set a channel type specific option on a channel.
 \fIsetOptionProc\fR must match the following prototype:
 .PP
 .CS
-typedef int Tcl_DriverSetOptionProc(
-       ClientData \fIinstanceData\fR,
-       Tcl_Interp *\fIinterp\fR,
-       CONST char *\fIoptionName\fR,
-       CONST char *\fInewValue\fR);
+typedef int \fBTcl_DriverSetOptionProc\fR(
+        ClientData \fIinstanceData\fR,
+        Tcl_Interp *\fIinterp\fR,
+        const char *\fIoptionName\fR,
+        const char *\fInewValue\fR);
 .CE
 .PP
 \fIoptionName\fR is the name of an option to set, and \fInewValue\fR is
@@ -856,7 +901,7 @@ created. The function should do whatever channel type specific action is
 required to implement the new value of the option.
 .PP
 Some options are handled by the generic code and this function is never
-called to set them, e.g. \fB-blockmode\fR. Other options are specific to
+called to set them, e.g. \fB\-blockmode\fR. Other options are specific to
 each channel type and the \fIsetOptionProc\fR procedure of the channel
 driver will get called to implement them. The \fIsetOptionProc\fR field can
 be NULL, which indicates that this channel type supports no type specific
@@ -876,19 +921,18 @@ error code.
 .PP
 This value can be retrieved with \fBTcl_ChannelSetOptionProc\fR, which returns
 a pointer to the function.
-
-.SH GETOPTIONPROC
+.SS GETOPTIONPROC
 .PP
 The \fIgetOptionProc\fR field contains the address of a function called by
 the generic layer to get the value of a channel type specific option on a
 channel. \fIgetOptionProc\fR must match the following prototype:
 .PP
 .CS
-typedef int Tcl_DriverGetOptionProc(
-       ClientData \fIinstanceData\fR,
-       Tcl_Interp *\fIinterp\fR,
-       CONST char *\fIoptionName\fR,
-       Tcl_DString *\fIoptionValue\fR);
+typedef int \fBTcl_DriverGetOptionProc\fR(
+        ClientData \fIinstanceData\fR,
+        Tcl_Interp *\fIinterp\fR,
+        const char *\fIoptionName\fR,
+        Tcl_DString *\fIoptionValue\fR);
 .CE
 .PP
 \fIOptionName\fR is the name of an option supported by this type of
@@ -906,7 +950,7 @@ function should also call \fBTcl_SetErrno\fR to store an appropriate POSIX
 error code.
 .PP
 Some options are handled by the generic code and this function is never
-called to retrieve their value, e.g. \fB-blockmode\fR. Other options are
+called to retrieve their value, e.g. \fB\-blockmode\fR. Other options are
 specific to each channel type and the \fIgetOptionProc\fR procedure of the
 channel driver will get called to implement them. The \fIgetOptionProc\fR
 field can be NULL, which indicates that this channel type supports no type
@@ -914,8 +958,7 @@ specific options.
 .PP
 This value can be retrieved with \fBTcl_ChannelGetOptionProc\fR, which returns
 a pointer to the function.
-
-.SH WATCHPROC
+.SS WATCHPROC
 .PP
 The \fIwatchProc\fR field contains the address of a function called
 by the generic layer to initialize the event notification mechanism to
@@ -923,9 +966,9 @@ notice events of interest on this channel.
 \fIWatchProc\fR should match the following prototype:
 .PP
 .CS
-typedef void Tcl_DriverWatchProc(
-       ClientData \fIinstanceData\fR,
-       int \fImask\fR);
+typedef void \fBTcl_DriverWatchProc\fR(
+        ClientData \fIinstanceData\fR,
+        int \fImask\fR);
 .CE
 .PP
 The \fIinstanceData\fR is the same as the value passed to
@@ -947,18 +990,17 @@ details on how to queue an event.
 .PP
 This value can be retrieved with \fBTcl_ChannelWatchProc\fR, which returns
 a pointer to the function.
-
-.SH GETHANDLEPROC
+.SS GETHANDLEPROC
 .PP
 The \fIgetHandleProc\fR field contains the address of a function called by
 the generic layer to retrieve a device-specific handle from the channel.
 \fIGetHandleProc\fR should match the following prototype:
 .PP
 .CS
-typedef int Tcl_DriverGetHandleProc(
-       ClientData \fIinstanceData\fR,
-       int \fIdirection\fR,
-       ClientData *\fIhandlePtr\fR);
+typedef int \fBTcl_DriverGetHandleProc\fR(
+        ClientData \fIinstanceData\fR,
+        int \fIdirection\fR,
+        ClientData *\fIhandlePtr\fR);
 .CE
 .PP
 \fIInstanceData\fR is the same as the value passed to
@@ -977,22 +1019,20 @@ device handles, the function should return \fBTCL_ERROR\fR.
 .PP
 This value can be retrieved with \fBTcl_ChannelGetHandleProc\fR, which returns
 a pointer to the function.
-
-.SH FLUSHPROC
+.SS FLUSHPROC
 .PP
 The \fIflushProc\fR field is currently reserved for future use.
 It should be set to NULL.
 \fIFlushProc\fR should match the following prototype:
 .PP
 .CS
-typedef int Tcl_DriverFlushProc(
-       ClientData \fIinstanceData\fR);
+typedef int \fBTcl_DriverFlushProc\fR(
+        ClientData \fIinstanceData\fR);
 .CE
 .PP
 This value can be retrieved with \fBTcl_ChannelFlushProc\fR, which returns
 a pointer to the function.
-
-.SH HANDLERPROC
+.SS HANDLERPROC
 .PP
 The \fIhandlerProc\fR field contains the address of a function called by
 the generic layer to notify the channel that an event occurred.  It should
@@ -1001,9 +1041,9 @@ that occur on the underlying (stacked) channel.
 \fIHandlerProc\fR should match the following prototype:
 .PP
 .CS
-typedef int Tcl_DriverHandlerProc(
-       ClientData \fIinstanceData\fR,
-       int \fIinterestMask\fR);
+typedef int \fBTcl_DriverHandlerProc\fR(
+        ClientData \fIinstanceData\fR,
+        int \fIinterestMask\fR);
 .CE
 .PP
 \fIInstanceData\fR is the same as the value passed to \fBTcl_CreateChannel\fR
@@ -1014,52 +1054,106 @@ type of event occurred on this channel.
 This value can be retrieved with \fBTcl_ChannelHandlerProc\fR, which returns
 a pointer to the function.
 
+.SS "THREADACTIONPROC"
+.PP
+The \fIthreadActionProc\fR field contains the address of the function
+called by the generic layer when a channel is created, closed, or
+going to move to a different thread, i.e. whenever thread-specific
+driver state might have to initialized or updated. It can be NULL.
+The action \fITCL_CHANNEL_THREAD_REMOVE\fR is used to notify the
+driver that it should update or remove any thread-specific data it
+might be maintaining for the channel.
+.PP
+The action \fITCL_CHANNEL_THREAD_INSERT\fR is used to notify the
+driver that it should update or initialize any thread-specific data it
+might be maintaining using the calling thread as the associate. See
+\fBTcl_CutChannel\fR and \fBTcl_SpliceChannel\fR for more detail.
+.PP
+.CS
+typedef void \fBTcl_DriverThreadActionProc\fR(
+        ClientData \fIinstanceData\fR,
+        int \fIaction\fR);
+.CE
+.PP
+\fIInstanceData\fR is the same as the value passed to
+\fBTcl_CreateChannel\fR when this channel was created.
+.PP
+These values can be retrieved with \fBTcl_ChannelThreadActionProc\fR,
+which returns a pointer to the function.
+.SS "TRUNCATEPROC"
+.PP
+The \fItruncateProc\fR field contains the address of the function
+called by the generic layer when a channel is truncated to some
+length. It can be NULL.
+.PP
+.CS
+typedef int \fBTcl_DriverTruncateProc\fR(
+        ClientData \fIinstanceData\fR,
+        Tcl_WideInt \fIlength\fR);
+.CE
+.PP
+\fIInstanceData\fR is the same as the value passed to
+\fBTcl_CreateChannel\fR when this channel was created, and
+\fIlength\fR is the new length of the underlying file, which should
+not be negative. The result should be 0 on success or an errno code
+(suitable for use with \fBTcl_SetErrno\fR) on failure.
+.PP
+These values can be retrieved with \fBTcl_ChannelTruncateProc\fR,
+which returns a pointer to the function.
 .SH TCL_BADCHANNELOPTION
 .PP
-This procedure generates a "bad option" error message in an
+This procedure generates a
+.QW "bad option"
+error message in an
 (optional) interpreter.  It is used by channel drivers when 
-a invalid Set/Get option is requested. Its purpose is to concatenate
+an invalid Set/Get option is requested. Its purpose is to concatenate
 the generic options list to the specific ones and factorize
 the generic options error message string.
 .PP
-It always return \fBTCL_ERROR\fR
+It always returns \fBTCL_ERROR\fR
 .PP
-An error message is generated in \fIinterp\fR's result object to
-indicate that a command was invoked with the a bad option
+An error message is generated in \fIinterp\fR's result value to
+indicate that a command was invoked with a bad option.
 The message has the form
 .CS
     bad option "blah": should be one of 
     <...generic options...>+<...specific options...>
+.CE
 so you get for instance:
+.CS
     bad option "-blah": should be one of -blocking,
     -buffering, -buffersize, -eofchar, -translation,
     -peername, or -sockname
-when called with \fIoptionList\fR="peername sockname"
 .CE
-``blah'' is the \fIoptionName\fR argument and ``<specific options>''
+when called with \fIoptionList\fR equal to
+.QW "peername sockname"
+.PP
+.QW blah
+is the \fIoptionName\fR argument and
+.QW "<specific options>"
 is a space separated list of specific option words.
 The function takes good care of inserting minus signs before
-each option, commas after, and an ``or'' before the last option.
-
+each option, commas after, and an
+.QW or
+before the last option.
 .SH "OLD CHANNEL TYPES"
-
 The original (8.3.1 and below) \fBTcl_ChannelType\fR structure contains
 the following fields:
 .PP
 .CS
 typedef struct Tcl_ChannelType {
-       char *\fItypeName\fR;
-       Tcl_DriverBlockModeProc *\fIblockModeProc\fR;   
-       Tcl_DriverCloseProc *\fIcloseProc\fR;
-       Tcl_DriverInputProc *\fIinputProc\fR;
-       Tcl_DriverOutputProc *\fIoutputProc\fR;
-       Tcl_DriverSeekProc *\fIseekProc\fR;
-       Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
-       Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
-       Tcl_DriverWatchProc *\fIwatchProc\fR;
-       Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
-       Tcl_DriverClose2Proc *\fIclose2Proc\fR;
-} Tcl_ChannelType;
+    const char *\fItypeName\fR;
+    Tcl_DriverBlockModeProc *\fIblockModeProc\fR;
+    Tcl_DriverCloseProc *\fIcloseProc\fR;
+    Tcl_DriverInputProc *\fIinputProc\fR;
+    Tcl_DriverOutputProc *\fIoutputProc\fR;
+    Tcl_DriverSeekProc *\fIseekProc\fR;
+    Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
+    Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
+    Tcl_DriverWatchProc *\fIwatchProc\fR;
+    Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
+    Tcl_DriverClose2Proc *\fIclose2Proc\fR;
+} \fBTcl_ChannelType\fR;
 .CE
 .PP
 It is still possible to create channel with the above structure.  The
@@ -1068,36 +1162,33 @@ the new \fBTcl_ChannelType\fR structure if you are creating a stacked
 channel driver, due to problems with the earlier stacked channel
 implementation (in 8.2.0 to 8.3.1).
 .PP
-.VS 8.4
 Prior to 8.4.0 (i.e. during the later releases of 8.3 and early part
 of the 8.4 development cycle) the \fBTcl_ChannelType\fR structure
 contained the following fields:
 .PP
 .CS
 typedef struct Tcl_ChannelType {
-       char *\fItypeName\fR;
-       Tcl_ChannelTypeVersion \fIversion\fR;
-       Tcl_DriverCloseProc *\fIcloseProc\fR;
-       Tcl_DriverInputProc *\fIinputProc\fR;
-       Tcl_DriverOutputProc *\fIoutputProc\fR;
-       Tcl_DriverSeekProc *\fIseekProc\fR;
-       Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
-       Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
-       Tcl_DriverWatchProc *\fIwatchProc\fR;
-       Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
-       Tcl_DriverClose2Proc *\fIclose2Proc\fR;
-       Tcl_DriverBlockModeProc *\fIblockModeProc\fR;   
-       Tcl_DriverFlushProc *\fIflushProc\fR;   
-       Tcl_DriverHandlerProc *\fIhandlerProc\fR;       
-} Tcl_ChannelType;
+    const char *\fItypeName\fR;
+    Tcl_ChannelTypeVersion \fIversion\fR;
+    Tcl_DriverCloseProc *\fIcloseProc\fR;
+    Tcl_DriverInputProc *\fIinputProc\fR;
+    Tcl_DriverOutputProc *\fIoutputProc\fR;
+    Tcl_DriverSeekProc *\fIseekProc\fR;
+    Tcl_DriverSetOptionProc *\fIsetOptionProc\fR;
+    Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
+    Tcl_DriverWatchProc *\fIwatchProc\fR;
+    Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
+    Tcl_DriverClose2Proc *\fIclose2Proc\fR;
+    Tcl_DriverBlockModeProc *\fIblockModeProc\fR;
+    Tcl_DriverFlushProc *\fIflushProc\fR;
+    Tcl_DriverHandlerProc *\fIhandlerProc\fR;
+    Tcl_DriverTruncateProc *\fItruncateProc\fR;
+} \fBTcl_ChannelType\fR;
 .CE
 .PP
 When the above structure is registered as a channel type, the
 \fIversion\fR field should always be \fBTCL_CHANNEL_VERSION_2\fR.
-.VE 8.4
-
 .SH "SEE ALSO"
 Tcl_Close(3), Tcl_OpenFileChannel(3), Tcl_SetErrno(3), Tcl_QueueEvent(3), Tcl_StackChannel(3), Tcl_GetStdChannel(3)
-
 .SH KEYWORDS
 blocking, channel driver, channel registration, channel type, nonblocking