| 1 |
'\" |
| 2 |
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. |
| 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 |
'\" |
| 7 |
.TH Tcl_CreateCloseHandler 3 7.5 Tcl "Tcl Library Procedures" |
| 8 |
.so man.macros |
| 9 |
.BS |
| 10 |
'\" Note: do not modify the .SH NAME line immediately below! |
| 11 |
.SH NAME |
| 12 |
Tcl_CreateCloseHandler, Tcl_DeleteCloseHandler \- arrange for callbacks when channels are closed |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
\fB#include <tcl.h>\fR |
| 16 |
.sp |
| 17 |
void |
| 18 |
\fBTcl_CreateCloseHandler\fR(\fIchannel, proc, clientData\fR) |
| 19 |
.sp |
| 20 |
void |
| 21 |
\fBTcl_DeleteCloseHandler\fR(\fIchannel, proc, clientData\fR) |
| 22 |
.sp |
| 23 |
.SH ARGUMENTS |
| 24 |
.AS Tcl_CloseProc clientData |
| 25 |
.AP Tcl_Channel channel in |
| 26 |
The channel for which to create or delete a close callback. |
| 27 |
.AP Tcl_CloseProc *proc in |
| 28 |
The procedure to call as the callback. |
| 29 |
.AP ClientData clientData in |
| 30 |
Arbitrary one-word value to pass to \fIproc\fR. |
| 31 |
.BE |
| 32 |
.SH DESCRIPTION |
| 33 |
.PP |
| 34 |
\fBTcl_CreateCloseHandler\fR arranges for \fIproc\fR to be called when |
| 35 |
\fIchannel\fR is closed with \fBTcl_Close\fR or |
| 36 |
\fBTcl_UnregisterChannel\fR, or using the Tcl \fBclose\fR command. |
| 37 |
\fIProc\fR should match the following prototype: |
| 38 |
.PP |
| 39 |
.CS |
| 40 |
typedef void \fBTcl_CloseProc\fR( |
| 41 |
ClientData \fIclientData\fR); |
| 42 |
.CE |
| 43 |
.PP |
| 44 |
The \fIclientData\fR is the same as the value provided in the call to |
| 45 |
\fBTcl_CreateCloseHandler\fR. |
| 46 |
.PP |
| 47 |
\fBTcl_DeleteCloseHandler\fR removes a close callback for \fIchannel\fR. |
| 48 |
The \fIproc\fR and \fIclientData\fR identify which close callback to |
| 49 |
remove; \fBTcl_DeleteCloseHandler\fR does nothing if its \fIproc\fR and |
| 50 |
\fIclientData\fR arguments do not match the \fIproc\fR and \fIclientData\fR |
| 51 |
for a close handler for \fIchannel\fR. |
| 52 |
.SH "SEE ALSO" |
| 53 |
close(n), Tcl_Close(3), Tcl_UnregisterChannel(3) |
| 54 |
.SH KEYWORDS |
| 55 |
callback, channel closing |