diff options
author | dgp <dgp@users.sourceforge.net> | 2003-09-05 21:52:11 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2003-09-05 21:52:11 (GMT) |
commit | c024a2de4b3868a69fd48901c50a0beedb49ed9d (patch) | |
tree | d3430b36c25b01800aa40d815fadb9629ef33770 /doc/FileSystem.3 | |
parent | 4383bd1bfc3daa1d69ddcb095a35c5e723f1ba6b (diff) | |
download | tcl-c024a2de4b3868a69fd48901c50a0beedb49ed9d.zip tcl-c024a2de4b3868a69fd48901c50a0beedb49ed9d.tar.gz tcl-c024a2de4b3868a69fd48901c50a0beedb49ed9d.tar.bz2 |
* doc/FileSystem.3: Implementation of
* doc/source.n: TIPs 137/151. Adds
* doc/tclsh.1: a -encoding option to
* generic/tcl.decls: the [source] command
* generic/tclCmdMZ.c (Tcl_SourceObjCmd): and a new C routine,
* generic/tclIOUtil.c (Tcl_FSEvalFileEx): Tcl_FSEvalFileEx(),
* generic/tclMain.c (Tcl_Main): that provides C access
* mac/tclMacResource.c (Tcl_MacSourceObjCmd): to the same function.
* tests/cmdMZ.test: Also adds command line
* tests/main.test: option handling in Tcl_Main() so that tclsh
* tests/source.test: and other apps built on Tcl_Main() respect
a -encoding command line option before a script filename. Docs and
tests updated as well. [Patch 742683]
This is a ***POTENTIAL INCOMPATIBILITY*** only for those C programs
that embed Tcl, build on Tcl_Main(), and make use of Tcl_Main's former
ability to pass a leading "-encoding" option to interactive shell
operations.
* generic/tclInt.decls: Added internal stub
* generic/tclMain.c (Tcl*StartupScript*): table entries for
two new functions Tcl_SetStartupScript() and Tcl_GetStartupScript()
that set/get the path and encoding for the startup script to be
evaluated by either Tcl_Main() or Tk_Main(). Given public names in
anticipation of their exposure by a followup TIP.
* generic/tclDecls.h: make genstubs
* generic/tclIntDecls.h:
* generic/tclStubInit.c:
Diffstat (limited to 'doc/FileSystem.3')
-rw-r--r-- | doc/FileSystem.3 | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/doc/FileSystem.3 b/doc/FileSystem.3 index c7113b9..acfb093 100644 --- a/doc/FileSystem.3 +++ b/doc/FileSystem.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: FileSystem.3,v 1.34 2003/07/28 12:16:02 vincentdarley Exp $ +'\" RCS: @(#) $Id: FileSystem.3,v 1.35 2003/09/05 21:52:11 dgp Exp $ '\" .so man.macros .TH Filesystem 3 8.4 Tcl "Tcl Library Procedures" @@ -28,10 +28,10 @@ void \fBTcl_FSMountsChanged\fR(\fIfsPtr\fR) .sp Tcl_Filesystem* -\fBTcl_FSGetFileSystemForPath\fR(\fIpathObjPtr\fR) +\fBTcl_FSGetFileSystemForPath\fR(\fIpathPtr\fR) .sp Tcl_PathType -\fBTcl_FSGetPathType\fR(\fIpathObjPtr\fR) +\fBTcl_FSGetPathType\fR(\fIpathPtr\fR) .sp int \fBTcl_FSCopyFile\fR(\fIsrcPathPtr, destPathPtr\fR) @@ -54,6 +54,11 @@ int Tcl_Obj* \fBTcl_FSListVolumes\fR(\fIvoid\fR) .sp +.VS 8.5 +int +\fBTcl_FSEvalFileEx\fR(\fIinterp, pathPtr, encodingName\fR) +.VE 8.5 +.sp int \fBTcl_FSEvalFile\fR(\fIinterp, pathPtr\fR) .sp @@ -138,7 +143,7 @@ Tcl_Obj* Tcl_StatBuf* \fBTcl_AllocStatBuf\fR() .SH ARGUMENTS -.AS Tcl_Filesystem *fsPtr in +.AS "CONST char" *encodingName in .AP Tcl_Filesystem *fsPtr in Points to a structure containing the addresses of procedures that can be called to perform the various filesystem operations. @@ -152,6 +157,9 @@ rename operation. .AP Tcl_Obj *destPathPtr in As for \fBpathPtr\fR, but used for the destination filename for a copy or rename operation. +.AP "CONST char" *encodingName in +The encoding of the data stored in the +file identified by \fBpathPtr\fR and to be evaluted. .AP "CONST char" *pattern in Only files or directories matching this pattern will be returned by \fBTcl_FSMatchInDirectory\fR. @@ -314,15 +322,23 @@ volumes' function and asks them to return their list of root volumes. It accumulates the return values in a list which is returned to the caller (with a refCount of 0). .PP -\fBTcl_FSEvalFile\fR reads the file given by \fIpathPtr\fR and evaluates +.VS 8.5 +\fBTcl_FSEvalFileEx\fR reads the file given by \fIpathPtr\fR using +the encoding identified by \fBencodingName\fR and evaluates its contents as a Tcl script. It returns the same information as \fBTcl_EvalObjEx\fR. +If \fBencodingName\fR is NULL, the system encoding is used for +reading the file contents. If the file couldn't be read then a Tcl error is returned to describe why the file couldn't be read. The eofchar for files is '\\32' (^Z) for all platforms. If you require a ``^Z'' in code for string comparison, you can use ``\\032'' or ``\\u001a'', which will be safely substituted by the Tcl interpreter into ``^Z''. +\fBTcl_FSEvalFile\fR is a simpler version of +\fBTcl_FSEvalFileEx\fR that always uses the system encoding +when reading the file. +.VE 8.5 .PP \fBTcl_FSLoadFile\fR dynamically loads a binary code file into memory and returns the addresses of two procedures within that file, if they are |