OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/hostdependX86LINUX64.git] / util / X86LINUX64 / man / man3 / Tcl_GetTopChannel.3
1 '\"
2 '\" Copyright (c) 1999-2000 Ajuba Solutions.
3 '\"
4 '\" See the file "license.terms" for information on usage and redistribution
5 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6 .TH Tcl_StackChannel 3 8.3 Tcl "Tcl Library Procedures"
7 .\" The -*- nroff -*- definitions below are for supplemental macros used
8 .\" in Tcl/Tk manual entries.
9 .\"
10 .\" .AP type name in/out ?indent?
11 .\"     Start paragraph describing an argument to a library procedure.
12 .\"     type is type of argument (int, etc.), in/out is either "in", "out",
13 .\"     or "in/out" to describe whether procedure reads or modifies arg,
14 .\"     and indent is equivalent to second arg of .IP (shouldn't ever be
15 .\"     needed;  use .AS below instead)
16 .\"
17 .\" .AS ?type? ?name?
18 .\"     Give maximum sizes of arguments for setting tab stops.  Type and
19 .\"     name are examples of largest possible arguments that will be passed
20 .\"     to .AP later.  If args are omitted, default tab stops are used.
21 .\"
22 .\" .BS
23 .\"     Start box enclosure.  From here until next .BE, everything will be
24 .\"     enclosed in one large box.
25 .\"
26 .\" .BE
27 .\"     End of box enclosure.
28 .\"
29 .\" .CS
30 .\"     Begin code excerpt.
31 .\"
32 .\" .CE
33 .\"     End code excerpt.
34 .\"
35 .\" .VS ?version? ?br?
36 .\"     Begin vertical sidebar, for use in marking newly-changed parts
37 .\"     of man pages.  The first argument is ignored and used for recording
38 .\"     the version when the .VS was added, so that the sidebars can be
39 .\"     found and removed when they reach a certain age.  If another argument
40 .\"     is present, then a line break is forced before starting the sidebar.
41 .\"
42 .\" .VE
43 .\"     End of vertical sidebar.
44 .\"
45 .\" .DS
46 .\"     Begin an indented unfilled display.
47 .\"
48 .\" .DE
49 .\"     End of indented unfilled display.
50 .\"
51 .\" .SO ?manpage?
52 .\"     Start of list of standard options for a Tk widget. The manpage
53 .\"     argument defines where to look up the standard options; if
54 .\"     omitted, defaults to "options". The options follow on successive
55 .\"     lines, in three columns separated by tabs.
56 .\"
57 .\" .SE
58 .\"     End of list of standard options for a Tk widget.
59 .\"
60 .\" .OP cmdName dbName dbClass
61 .\"     Start of description of a specific option.  cmdName gives the
62 .\"     option's name as specified in the class command, dbName gives
63 .\"     the option's name in the option database, and dbClass gives
64 .\"     the option's class in the option database.
65 .\"
66 .\" .UL arg1 arg2
67 .\"     Print arg1 underlined, then print arg2 normally.
68 .\"
69 .\" .QW arg1 ?arg2?
70 .\"     Print arg1 in quotes, then arg2 normally (for trailing punctuation).
71 .\"
72 .\" .PQ arg1 ?arg2?
73 .\"     Print an open parenthesis, arg1 in quotes, then arg2 normally
74 .\"     (for trailing punctuation) and then a closing parenthesis.
75 .\"
76 .\"     # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
77 .if t .wh -1.3i ^B
78 .nr ^l \n(.l
79 .ad b
80 .\"     # Start an argument description
81 .de AP
82 .ie !"\\$4"" .TP \\$4
83 .el \{\
84 .   ie !"\\$2"" .TP \\n()Cu
85 .   el          .TP 15
86 .\}
87 .ta \\n()Au \\n()Bu
88 .ie !"\\$3"" \{\
89 \&\\$1 \\fI\\$2\\fP (\\$3)
90 .\".b
91 .\}
92 .el \{\
93 .br
94 .ie !"\\$2"" \{\
95 \&\\$1  \\fI\\$2\\fP
96 .\}
97 .el \{\
98 \&\\fI\\$1\\fP
99 .\}
100 .\}
101 ..
102 .\"     # define tabbing values for .AP
103 .de AS
104 .nr )A 10n
105 .if !"\\$1"" .nr )A \\w'\\$1'u+3n
106 .nr )B \\n()Au+15n
107 .\"
108 .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
109 .nr )C \\n()Bu+\\w'(in/out)'u+2n
110 ..
111 .AS Tcl_Interp Tcl_CreateInterp in/out
112 .\"     # BS - start boxed text
113 .\"     # ^y = starting y location
114 .\"     # ^b = 1
115 .de BS
116 .br
117 .mk ^y
118 .nr ^b 1u
119 .if n .nf
120 .if n .ti 0
121 .if n \l'\\n(.lu\(ul'
122 .if n .fi
123 ..
124 .\"     # BE - end boxed text (draw box now)
125 .de BE
126 .nf
127 .ti 0
128 .mk ^t
129 .ie n \l'\\n(^lu\(ul'
130 .el \{\
131 .\"     Draw four-sided box normally, but don't draw top of
132 .\"     box if the box started on an earlier page.
133 .ie !\\n(^b-1 \{\
134 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
135 .\}
136 .el \}\
137 \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
138 .\}
139 .\}
140 .fi
141 .br
142 .nr ^b 0
143 ..
144 .\"     # VS - start vertical sidebar
145 .\"     # ^Y = starting y location
146 .\"     # ^v = 1 (for troff;  for nroff this doesn't matter)
147 .de VS
148 .if !"\\$2"" .br
149 .mk ^Y
150 .ie n 'mc \s12\(br\s0
151 .el .nr ^v 1u
152 ..
153 .\"     # VE - end of vertical sidebar
154 .de VE
155 .ie n 'mc
156 .el \{\
157 .ev 2
158 .nf
159 .ti 0
160 .mk ^t
161 \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
162 .sp -1
163 .fi
164 .ev
165 .\}
166 .nr ^v 0
167 ..
168 .\"     # Special macro to handle page bottom:  finish off current
169 .\"     # box/sidebar if in box/sidebar mode, then invoked standard
170 .\"     # page bottom macro.
171 .de ^B
172 .ev 2
173 'ti 0
174 'nf
175 .mk ^t
176 .if \\n(^b \{\
177 .\"     Draw three-sided box if this is the box's first page,
178 .\"     draw two sides but no top otherwise.
179 .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
180 .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
181 .\}
182 .if \\n(^v \{\
183 .nr ^x \\n(^tu+1v-\\n(^Yu
184 \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
185 .\}
186 .bp
187 'fi
188 .ev
189 .if \\n(^b \{\
190 .mk ^y
191 .nr ^b 2
192 .\}
193 .if \\n(^v \{\
194 .mk ^Y
195 .\}
196 ..
197 .\"     # DS - begin display
198 .de DS
199 .RS
200 .nf
201 .sp
202 ..
203 .\"     # DE - end display
204 .de DE
205 .fi
206 .RE
207 .sp
208 ..
209 .\"     # SO - start of list of standard options
210 .de SO
211 'ie '\\$1'' .ds So \\fBoptions\\fR
212 'el .ds So \\fB\\$1\\fR
213 .SH "STANDARD OPTIONS"
214 .LP
215 .nf
216 .ta 5.5c 11c
217 .ft B
218 ..
219 .\"     # SE - end of list of standard options
220 .de SE
221 .fi
222 .ft R
223 .LP
224 See the \\*(So manual entry for details on the standard options.
225 ..
226 .\"     # OP - start of full description for a single option
227 .de OP
228 .LP
229 .nf
230 .ta 4c
231 Command-Line Name:      \\fB\\$1\\fR
232 Database Name:  \\fB\\$2\\fR
233 Database Class: \\fB\\$3\\fR
234 .fi
235 .IP
236 ..
237 .\"     # CS - begin code excerpt
238 .de CS
239 .RS
240 .nf
241 .ta .25i .5i .75i 1i
242 ..
243 .\"     # CE - end code excerpt
244 .de CE
245 .fi
246 .RE
247 ..
248 .\"     # UL - underline word
249 .de UL
250 \\$1\l'|0\(ul'\\$2
251 ..
252 .\"     # QW - apply quotation marks to word
253 .de QW
254 .ie '\\*(lq'"' ``\\$1''\\$2
255 .\"" fix emacs highlighting
256 .el \\*(lq\\$1\\*(rq\\$2
257 ..
258 .\"     # PQ - apply parens and quotation marks to word
259 .de PQ
260 .ie '\\*(lq'"' (``\\$1''\\$2)\\$3
261 .\"" fix emacs highlighting
262 .el (\\*(lq\\$1\\*(rq\\$2)\\$3
263 ..
264 .\"     # QR - quoted range
265 .de QR
266 .ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
267 .\"" fix emacs highlighting
268 .el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
269 ..
270 .\"     # MT - "empty" string
271 .de MT
272 .QW ""
273 ..
274 .BS
275 '\" Note:  do not modify the .SH NAME line immediately below!
276 .SH NAME
277 Tcl_StackChannel, Tcl_UnstackChannel, Tcl_GetStackedChannel, Tcl_GetTopChannel \- manipulate stacked I/O channels
278 .SH SYNOPSIS
279 .nf
280 .nf
281 \fB#include <tcl.h>\fR
282 .sp
283 Tcl_Channel
284 \fBTcl_StackChannel\fR(\fIinterp, typePtr, clientData, mask, channel\fR)
285 .sp
286 int
287 \fBTcl_UnstackChannel\fR(\fIinterp, channel\fR)
288 .sp
289 Tcl_Channel
290 \fBTcl_GetStackedChannel\fR(\fIchannel\fR)
291 .sp
292 Tcl_Channel
293 \fBTcl_GetTopChannel\fR(\fIchannel\fR)
294 .sp
295 .SH ARGUMENTS
296 .AS Tcl_ChannelType clientData
297 .AP Tcl_Interp *interp in
298 Interpreter for error reporting.
299 .AP "const Tcl_ChannelType" *typePtr in
300 The new channel I/O procedures to use for \fIchannel\fR.
301 .AP ClientData clientData in
302 Arbitrary one-word value to pass to channel I/O procedures.
303 .AP int mask in
304 Conditions under which \fIchannel\fR will be used: OR-ed combination of
305 \fBTCL_READABLE\fR, \fBTCL_WRITABLE\fR and \fBTCL_EXCEPTION\fR.
306 This can be a subset of the operations currently allowed on \fIchannel\fR.
307 .AP Tcl_Channel channel in
308 An existing Tcl channel such as returned by \fBTcl_CreateChannel\fR.
309 .BE
310
311 .SH DESCRIPTION
312 .PP
313 These functions are for use by extensions that add processing layers to Tcl
314 I/O channels.  Examples include compression and encryption modules.  These
315 functions transparently stack and unstack a new channel on top of an
316 existing one.  Any number of channels can be stacked together.
317 .PP
318 The implementation of the Tcl channel code was rewritten in 8.3.2 to
319 correct some problems with the previous implementation with regard to
320 stacked channels.  Anyone using stacked channels or creating stacked
321 channel drivers should update to the new \fBTCL_CHANNEL_VERSION_2\fR
322 \fBTcl_ChannelType\fR structure.  See \fBTcl_CreateChannel\fR for details.
323 .PP
324 \fBTcl_StackChannel\fR stacks a new \fIchannel\fR on an existing channel
325 with the same name that was registered for \fIchannel\fR by
326 \fBTcl_RegisterChannel\fR.
327 .PP
328 \fBTcl_StackChannel\fR works by creating a new channel structure and
329 placing itself on top of the channel stack.  EOL translation, encoding and
330 buffering options are shared between all channels in the stack.  The hidden
331 channel does no buffering, newline translations, or character set encoding.
332 Instead, the buffering, newline translations, and encoding functions all
333 remain at the top of the channel stack.  A pointer to the new top channel
334 structure is returned.  If an error occurs when stacking the channel, NULL
335 is returned instead.
336 .PP
337 The \fImask\fR parameter specifies the operations that are allowed on the
338 new channel.  These can be a subset of the operations allowed on the
339 original channel.  For example, a read-write channel may become read-only
340 after the \fBTcl_StackChannel\fR call.
341 .PP
342 Closing a channel closes the channels stacked below it.  The close of
343 stacked channels is executed in a way that allows buffered data to be
344 properly flushed.
345 .PP
346 \fBTcl_UnstackChannel\fR reverses the process.  The old channel is
347 associated with the channel name, and the processing module added by
348 \fBTcl_StackChannel\fR is destroyed.  If there is no old channel, then
349 \fBTcl_UnstackChannel\fR is equivalent to \fBTcl_Close\fR.  If an error
350 occurs unstacking the channel, \fBTCL_ERROR\fR is returned, otherwise
351 \fBTCL_OK\fR is returned.
352 .PP
353 \fBTcl_GetTopChannel\fR returns the top channel in the stack of
354 channels the supplied channel is part of.
355 .PP
356 \fBTcl_GetStackedChannel\fR returns the channel in the stack of
357 channels which is just below the supplied channel.
358
359 .SH "SEE ALSO"
360 Notifier(3), Tcl_CreateChannel(3), Tcl_OpenFileChannel(3), vwait(n).
361
362 .SH KEYWORDS
363 channel, compression