summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>1999-08-19 02:58:34 (GMT)
committerhobbs <hobbs>1999-08-19 02:58:34 (GMT)
commit5e5c7d8418d3fbd50e237bc02c7c8d65618f5235 (patch)
tree49bf18aa83c6c1205456d77a135d092f673458c0
parent7070ed9f344d7a29c2c774b776937744b0da7a3e (diff)
downloadtcl-5e5c7d8418d3fbd50e237bc02c7c8d65618f5235.zip
tcl-5e5c7d8418d3fbd50e237bc02c7c8d65618f5235.tar.gz
tcl-5e5c7d8418d3fbd50e237bc02c7c8d65618f5235.tar.bz2
1999-08-18 Jeff Hobbs <hobbs@scriptics.com>
* doc/Eval.3: fixed doc on input args [Bug: 2114] * doc/OpenFileChnl.3: * doc/file.n: * tests/cmdAH.test: * tclIO.c: * tclCmdAH.c: added "file channels ?pattern?" tcl command, with associated Tcl_GetChannelNames and Tcl_GetChannelNamesEx public C APIs (added to tcl.decls as well), with docs and tests.
-rw-r--r--doc/Eval.34
-rw-r--r--doc/OpenFileChnl.328
-rw-r--r--doc/file.n17
3 files changed, 37 insertions, 12 deletions
diff --git a/doc/Eval.3 b/doc/Eval.3
index bc0effc..de4540e 100644
--- a/doc/Eval.3
+++ b/doc/Eval.3
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: Eval.3,v 1.4 1999/04/16 00:46:31 stanton Exp $
+'\" RCS: @(#) $Id: Eval.3,v 1.5 1999/08/19 02:58:34 hobbs Exp $
'\"
.so man.macros
.TH Tcl_Eval 3 8.1 Tcl "Tcl Library Procedures"
@@ -55,7 +55,7 @@ ORed combination of flag bits that specify additional options.
\fBTCL_EVAL_GLOBAL\fR and \fBTCL_EVAL_DIRECT\fR are currently supported.
.AP char *fileName in
Name of a file containing a Tcl script.
-.AP int *objc in
+.AP int objc in
The number of objects in the array pointed to by \fIobjPtr\fR;
this is also the number of words in the command.
.AP Tcl_Obj **objv in
diff --git a/doc/OpenFileChnl.3 b/doc/OpenFileChnl.3
index dbcb472..42d3d0e 100644
--- a/doc/OpenFileChnl.3
+++ b/doc/OpenFileChnl.3
@@ -4,13 +4,13 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: OpenFileChnl.3,v 1.5 1999/05/06 19:14:41 stanton Exp $
+'\" RCS: @(#) $Id: OpenFileChnl.3,v 1.6 1999/08/19 02:58:34 hobbs Exp $
.so man.macros
-.TH Tcl_OpenFileChannel 3 8.1 Tcl "Tcl Library Procedures"
+.TH Tcl_OpenFileChannel 3 8.3 Tcl "Tcl Library Procedures"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
-Tcl_OpenFileChannel, Tcl_OpenCommandChannel, Tcl_MakeFileChannel, Tcl_GetChannel, Tcl_RegisterChannel, Tcl_UnregisterChannel, 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 \- buffered I/O facilities using channels
+Tcl_OpenFileChannel, Tcl_OpenCommandChannel, Tcl_MakeFileChannel, Tcl_GetChannel, Tcl_GetChannelNames, Tcl_GetChannelNamesEx, Tcl_RegisterChannel, Tcl_UnregisterChannel, 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 \- buffered I/O facilities using channels
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -30,6 +30,14 @@ Tcl_Channel
.sp
Tcl_Channel
\fBTcl_GetChannel\fR(\fIinterp, channelName, modePtr\fR)
+.VS 8.3
+.sp
+int
+\fBTcl_GetChannelNames\fR(\fIinterp\fR)
+.sp
+int
+\fBTcl_GetChannelNamesEx\fR(\fIinterp, pattern\fR)
+.VE
.sp
void
\fBTcl_RegisterChannel\fR(\fIinterp, channel\fR)
@@ -182,6 +190,10 @@ Where to store the value of an option or a list of all options and their
values. Must have been initialized by the caller.
.AP char *newValue in
New value for the option given by \fIoptionName\fR.
+.VS 8.3
+.AP char *pattern in
+The pattern to match on, passed to Tcl_StringMatch, or NULL.
+.VE
.BE
.SH DESCRIPTION
@@ -279,6 +291,14 @@ the procedure returns NULL. If the \fImode\fR argument is not NULL, it
points at an integer variable that will receive an OR-ed combination of
\fBTCL_READABLE\fR and \fBTCL_WRITABLE\fR describing whether the channel is
open for reading and writing.
+.PP
+\fBTcl_GetChannelNames\fR and \fBTcl_GetChannelNamesEx\fR write the
+names of the registered channels to the interpreter's result as a
+list object. \fBTcl_GetChannelNamesEx\fR will filter these names
+according to the \fIpattern\fR. If \fIpattern\fR is NULL, then it
+will not do any filtering. The return value is \fBTCL_OK\fR if no
+errors occured writing to the result, otherwise it is \fBTCL_ERROR\fR,
+and the error message is left in the interpreter's result.
.SH TCL_REGISTERCHANNEL
.PP
@@ -330,7 +350,7 @@ If an error occurs, \fBTcl_Close\fR returns \fBTCL_ERROR\fR and records a
POSIX error code that can be retrieved with \fBTcl_GetErrno\fR.
If the channel is being closed synchronously and an error occurs during
closing of the channel and \fIinterp\fR is not NULL, an error message is
-left in \fIinterp->result\fR.
+left in the interpreter's result.
.PP
Note: it is not safe to call \fBTcl_Close\fR on a channel that has been
registered using \fBTcl_RegisterChannel\fR; see the documentation for
diff --git a/doc/file.n b/doc/file.n
index 79644e9..11e599b 100644
--- a/doc/file.n
+++ b/doc/file.n
@@ -5,10 +5,10 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: file.n,v 1.2 1998/09/14 18:39:52 stanton Exp $
+'\" RCS: @(#) $Id: file.n,v 1.3 1999/08/19 02:58:34 hobbs Exp $
'\"
.so man.macros
-.TH file n 7.6 Tcl "Tcl Built-In Commands"
+.TH file n 8.3 Tcl "Tcl Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -33,7 +33,6 @@ was last accessed. The time is measured in the standard POSIX
fashion as seconds from a fixed starting time (often January 1, 1970).
If the file doesn't exist or its access time cannot be queried then an
error is generated.
-.VS
.TP
\fBfile attributes \fIname\fR
.br
@@ -72,8 +71,16 @@ attribute of the file. Note that directories can only be locked if
File Sharing is turned on. \fB-type\fR gives or sets the Finder file
type for the file.
.RE
+.VS
+.TP
+\fBfile channels ?\fIpattern\fR?
+.
+If \fIpattern\fR isn't specified, returns a list of names of all
+registered open channels in this interpreter. If \fIpattern\fR is
+specified, only those names matching \fIpattern\fR are returned. Matching
+is determined using the same rules as for \fBstring match\fR.
.VE
-.PP
+.TP
\fBfile copy \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource\fR \fItarget\fR
.br
\fBfile copy \fR?\fB\-force\fR? ?\fB\-\|\-\fR? \fIsource\fR ?\fIsource\fR ...? \fItargetDir\fR
@@ -195,14 +202,12 @@ last modified. The time is measured in the standard POSIX fashion as
seconds from a fixed starting time (often January 1, 1970). If the file
doesn't exist or its modified time cannot be queried then an error is
generated.
-.VS
.TP
\fBfile nativename \fIname\fR
.
Returns the platform-specific name of the file. This is useful if the
filename is needed to pass to a platform-specific call, such as exec
under Windows or AppleScript on the Macintosh.
-.VE
.TP
\fBfile owned \fIname\fR
.