Tcl Source Code

Artifact [6803b6b992]
Login

Artifact 6803b6b99222c25e156e2b84fcd30033aa999e28:

Attachment "414929.diff" to ticket [414929ffff] added by andreas_kupries 2001-09-12 01:23:26.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcl/tcl/ChangeLog,v
retrieving revision 1.601
diff -u -r1.601 ChangeLog
--- ChangeLog	2001/09/11 17:30:44	1.601
+++ ChangeLog	2001/09/11 18:20:45
@@ -1,5 +1,11 @@
 2001-09-11  Andreas Kupries <[email protected]>
 
+	* doc/OpenFileChnl.3: Added documentation for Tcl_WriteRaw and
+	  Tcl_ReadRaw [#414929].
+	
+	* doc/CrtChannel.3: Added documentation for Tcl_ChannelBuffered
+	  and Tcl_GetTopChannel [#414929].
+
 	* The changes below are a fix for [219253].
 
 	* tests/socket.test: Removed _most_ instances of hardwired port
Index: doc/CrtChannel.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/CrtChannel.3,v
retrieving revision 1.10
diff -u -r1.10 CrtChannel.3
--- doc/CrtChannel.3	2001/09/10 21:49:37	1.10
+++ doc/CrtChannel.3	2001/09/11 18:20:45
@@ -11,7 +11,7 @@
 .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_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 \- 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_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, Tcl_GetTopChannel \- procedures for creating and manipulating channels
 .SH SYNOPSIS
 .nf
 \fB#include <tcl.h>\fR
@@ -67,6 +67,12 @@
 .VE
 .VS 8.3.2
 .sp
+int
+\fBTcl_ChannelBuffered\fR(\fIchannel\fR)
+.sp
+Tcl_Channel
+\fBTcl_GetTopChannel\fR(\fIchannel\fR)
+.sp
 char *
 \fBTcl_ChannelName\fR(\fItypePtr\fR)
 .sp
@@ -260,6 +266,16 @@
 .PP
 \fBTcl_BadChannelOption\fR is called from driver specific set or get option
 procs to generate a complete error message.
+.VE
+.PP
+.VS 8.3.2
+\fBTcl_GetTopChannel\fR returns the top channel in the stack of
+channels the supplied channel is part of.
+.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.
 .VE
 .PP
 .VS 8.4
Index: doc/OpenFileChnl.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/OpenFileChnl.3,v
retrieving revision 1.11
diff -u -r1.11 OpenFileChnl.3
--- doc/OpenFileChnl.3	2001/09/10 21:49:37	1.11
+++ doc/OpenFileChnl.3	2001/09/11 18:20:45
@@ -10,7 +10,7 @@
 .BS
 '\" Note:  do not modify the .SH NAME line immediately below!
 .SH NAME
-Tcl_OpenFileChannel, Tcl_OpenCommandChannel, Tcl_MakeFileChannel, Tcl_GetChannel, Tcl_GetChannelNames, Tcl_GetChannelNamesEx, Tcl_RegisterChannel, Tcl_UnregisterChannel, Tcl_DetachChannel, Tcl_IsStandardChannel, Tcl_Close, Tcl_ReadChars, Tcl_Read, Tcl_GetsObj, Tcl_Gets, Tcl_WriteObj, Tcl_WriteChars, Tcl_Write, Tcl_Flush, Tcl_Seek, Tcl_Tell, Tcl_GetChannelOption, Tcl_SetChannelOption, Tcl_Eof, Tcl_InputBlocked, Tcl_InputBuffered, Tcl_Ungets \- buffered I/O facilities using channels
+Tcl_OpenFileChannel, Tcl_OpenCommandChannel, Tcl_MakeFileChannel, Tcl_GetChannel, Tcl_GetChannelNames, Tcl_GetChannelNamesEx, Tcl_RegisterChannel, Tcl_UnregisterChannel, Tcl_DetachChannel, Tcl_IsStandardChannel, Tcl_Close, Tcl_ReadChars, Tcl_Read, Tcl_GetsObj, Tcl_Gets, Tcl_WriteObj, Tcl_WriteChars, Tcl_Write, Tcl_Flush, Tcl_Seek, Tcl_Tell, Tcl_GetChannelOption, Tcl_SetChannelOption, Tcl_Eof, Tcl_InputBlocked, Tcl_InputBuffered, Tcl_Ungets,  Tcl_ReadRaw, Tcl_WriteRaw \- buffered I/O facilities using channels
 .SH SYNOPSIS
 .nf
 \fB#include <tcl.h>\fR
@@ -79,8 +79,16 @@
 int
 \fBTcl_Write\fR(\fIchannel, byteBuf, bytesToWrite\fR)
 .VE
+.VS 8.3.2
 .sp
 int
+\fBTcl_ReadRaw\fR(\fIchannel, bufPtr, bytesToRead\fR)
+.sp
+int
+\fBTcl_WriteRaw\fR(\fIchannel, bufPtr, bytesToWrite\fR)
+.VE
+.sp
+int
 \fBTcl_Eof\fR(\fIchannel\fR)
 .sp
 int
@@ -463,6 +471,15 @@
 \fIbuf\fR.  The buffer produced by \fBTcl_Read\fR is not NULL terminated.
 Its contents are valid from the zeroth position up to and excluding the
 position indicated by the return value.  
+.PP
+\fBTcl_ReadRaw\fR is the same as \fBTcl_Read\fR but does not
+compensate for stacking. While \fBTcl_Read\fR (and the other functions
+in the API) always get their data from the topmost channel in the
+stack the supplied channel is part of, \fBTcl_ReadRaw\fR does
+not. Because of this this function is \fBonly\fR usable for
+transformational channel drivers, i.e. drivers used in the middle of a
+stack of channels, to move data from channel below into the
+transformation.
 
 .SH "TCL_GETSOBJ AND TCL_GETS"
 .PP
@@ -547,6 +564,15 @@
 \fIbyteBuf\fR and queues them for output to \fIchannel\fR.  If
 \fIbytesToWrite\fR is negative, \fBTcl_Write\fR expects \fIbyteBuf\fR to be
 NULL terminated and it outputs everything up to the NULL.
+.PP
+\fBTcl_WriteRaw\fR is the same as \fBTcl_Write\fR but does not
+compensate for stacking. While \fBTcl_Write\fR (and the other
+functions in the API) always feed their input to the topmost channel
+in the stack the supplied channel is part of, \fBTcl_WriteRaw\fR does
+not. Because of this this function is \fBonly\fR usable for
+transformational channel drivers, i.e. drivers used in the middle of a
+stack of channels, to move data from the transformation to the channel
+below.
 .VE
 
 .SH TCL_FLUSH
Index: unix/mkLinks
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/mkLinks,v
retrieving revision 1.30
diff -u -r1.30 mkLinks
--- unix/mkLinks	2001/09/11 03:01:56	1.30
+++ unix/mkLinks	2001/09/11 18:20:46
@@ -170,6 +170,8 @@
     rm -f Tcl_IsChannelExisting.3
     rm -f Tcl_ClearChannelHandlers.3
     rm -f Tcl_GetChannelThread.3
+    rm -f Tcl_ChannelBuffered.3
+    rm -f Tcl_GetTopChannel.3
     ln CrtChannel.3 Tcl_CreateChannel.3
     ln CrtChannel.3 Tcl_GetChannelInstanceData.3
     ln CrtChannel.3 Tcl_GetChannelType.3
@@ -201,6 +203,8 @@
     ln CrtChannel.3 Tcl_IsChannelExisting.3
     ln CrtChannel.3 Tcl_ClearChannelHandlers.3
     ln CrtChannel.3 Tcl_GetChannelThread.3
+    ln CrtChannel.3 Tcl_ChannelBuffered.3
+    ln CrtChannel.3 Tcl_GetTopChannel.3
 fi
 if test -r CrtChnlHdlr.3; then
     rm -f Tcl_CreateChannelHandler.3
@@ -746,6 +750,8 @@
     rm -f Tcl_InputBlocked.3
     rm -f Tcl_InputBuffered.3
     rm -f Tcl_Ungets.3
+    rm -f Tcl_ReadRaw.3
+    rm -f Tcl_WriteRaw.3
     ln OpenFileChnl.3 Tcl_OpenFileChannel.3
     ln OpenFileChnl.3 Tcl_OpenCommandChannel.3
     ln OpenFileChnl.3 Tcl_MakeFileChannel.3
@@ -773,6 +779,8 @@
     ln OpenFileChnl.3 Tcl_InputBlocked.3
     ln OpenFileChnl.3 Tcl_InputBuffered.3
     ln OpenFileChnl.3 Tcl_Ungets.3
+    ln OpenFileChnl.3 Tcl_ReadRaw.3
+    ln OpenFileChnl.3 Tcl_WriteRaw.3
 fi
 if test -r OpenTcp.3; then
     rm -f Tcl_OpenTcpClient.3