⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chnlstack.3

📁 tcl是工具命令语言
💻 3
字号:
'\"'\" Copyright (c) 1999-2000 Ajuba Solutions.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\"'\" RCS: @(#) $Id: ChnlStack.3,v 1.4 2002/01/23 21:22:06 andreas_kupries Exp $.so man.macros.TH Tcl_StackChannel 3 8.3 Tcl "Tcl Library Procedures".BS'\" Note:  do not modify the .SH NAME line immediately below!.SH NAMETcl_StackChannel, Tcl_UnstackChannel, Tcl_GetStackedChannel, Tcl_GetTopChannel \- stack an I/O channel on top of another, and undo it.SH SYNOPSIS.nf.nf\fB#include <tcl.h>\fR.spTcl_Channel\fBTcl_StackChannel\fR(\fIinterp, typePtr, clientData, mask, channel\fR).spint\fBTcl_UnstackChannel\fR(\fIinterp, channel\fR).spTcl_Channel\fBTcl_GetStackedChannel\fR(\fIchannel\fR).spTcl_Channel\fBTcl_GetTopChannel\fR(\fIchannel\fR).sp.SH ARGUMENTS.AS Tcl_ChannelType.AP Tcl_Interp *interp inInterpreter for error reporting - can be NULL..AP Tcl_ChannelType *typePtr inThe new channel I/O procedures to use for \fIchannel\fP..AP ClientData clientData inArbitrary one-word value to pass to channel I/O procedures..AP int mask inConditions under which \fIchannel\fR will be used: OR-ed combination of\fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR and \fBTCL_EXCEPTION\fR.This can be a subset of the operations currently allowed on \fIchannel\fP..AP Tcl_Channel channel inAn existing Tcl channel such as returned by \fBTcl_CreateChannel\fR..BE.SH DESCRIPTION.PPThese functions are for use by extensions that add processing layers to TclI/O channels.  Examples include compression and encryption modules.  Thesefunctions transparently stack and unstack a new channel on top of anexisting one.  Any number of channels can be stacked together..PPThe implementation of the Tcl channel code was rewritten in 8.3.2 tocorrect some problems with the previous implementation with regard tostacked channels.  Anyone using stacked channels or creating stackedchannel drivers should update to the new \fBTCL_CHANNEL_VERSION_2\fR\fBTcl_ChannelType\fR structure.  See \fBTcl_CreateChannel\fR for details..PP\fBTcl_StackChannel\fR stacks a new \fIchannel\fP on an existing channelwith the same name that was registered for \fIchannel\fP by\fBTcl_RegisterChannel\fP..PP\fBTcl_StackChannel\fR works by creating a new channel structure andplacing itself on top of the channel stack.  EOL translation, encoding andbuffering options are shared between all channels in the stack.  The hiddenchannel does no buffering, newline translations, or character set encoding.Instead, the buffering, newline translations, and encoding functions allremain at the top of the channel stack.  A pointer to the new top channelstructure is returned.  If an error occurs when stacking the channel, NULLis returned instead..PPThe \fImask\fP parameter specifies the operations that are allowed on thenew channel.  These can be a subset of the operations allowed on theoriginal channel.  For example, a read-write channel may become read-onlyafter the \fBTcl_StackChannel\fR call..PPClosing a channel closes the channels stacked below it.  The close ofstacked channels is executed in a way that allows buffered data to beproperly flushed..PP\fBTcl_UnstackChannel\fP reverses the process.  The old channel isassociated with the channel name, and the processing module added by\fBTcl_StackChannel\fR is destroyed.  If there is no old channel, then\fBTcl_UnstackChannel\fP is equivalent to \fBTcl_Close\fP.  If an erroroccurs unstacking the channel, \fBTCL_ERROR\fR is returned, otherwise\fBTCL_OK\fR is returned..PP\fBTcl_GetTopChannel\fR returns the top channel in the stack ofchannels the supplied channel is part of..PP\fBTcl_GetStackedChannel\fR returns the channel in the stack ofchannels which is just below the supplied channel..SH "SEE ALSO"Notifier(3), Tcl_CreateChannel(3), Tcl_OpenFileChannel(3), vwait(n)..SH KEYWORDSchannel, compression

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -