Compare commits
185
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca11682e19 | ||
|
|
415b73ff44 | ||
|
|
c4c493e5f2 | ||
|
|
b4bdb891fe | ||
|
|
a52024a17c | ||
|
|
8474f2dc18 | ||
|
|
ab34b8e6a1 | ||
|
|
39ad39f537 | ||
|
|
711fca7fb3 | ||
|
|
36f0cc8cf9 | ||
|
|
9cde7f36b7 | ||
|
|
09938be67a | ||
|
|
37a3fb96e6 | ||
|
|
ec8f3223ae | ||
|
|
4c38d4b4a2 | ||
|
|
c7fe5c0d02 | ||
|
|
31c41e6ed9 | ||
|
|
e3e07eaf70 | ||
|
|
d995344efa | ||
|
|
f378932c9d | ||
|
|
0769c87128 | ||
|
|
37c5e7707b | ||
|
|
3619055308 | ||
|
|
9baa5bff02 | ||
|
|
22a6cb8d88 | ||
|
|
a3ecf97f67 | ||
|
|
928b0c7e25 | ||
|
|
8cc2992b26 | ||
|
|
d4fb7db9ce | ||
|
|
2e31c04f99 | ||
|
|
6ac2b4f4e0 | ||
|
|
53f8ec2a7e | ||
|
|
09cb3cc475 | ||
|
|
af535080eb | ||
|
|
97e68e5d3d | ||
|
|
07d6012fb4 | ||
|
|
4a327a6afd | ||
|
|
b78a73949a | ||
|
|
2f77e817ac | ||
|
|
da3b0b4ffd | ||
|
|
0ad8a310e8 | ||
|
|
5ad98cd80b | ||
|
|
06132e01bd | ||
|
|
7ab0e6539e | ||
|
|
4fe06ea480 | ||
|
|
bf8e816d75 | ||
|
|
746921d00f | ||
|
|
2efea334f7 | ||
|
|
65176c976e | ||
|
|
46464da386 | ||
|
|
398a1c31d7 | ||
|
|
6cfca53bfa | ||
|
|
a31e921dab | ||
|
|
526a53c1a5 | ||
|
|
bcc73119d3 | ||
|
|
346e62b0d3 | ||
|
|
b26ce3f57d | ||
|
|
698e7bfaf6 | ||
|
|
3e2cd02657 | ||
|
|
6d46f4f3c7 | ||
|
|
d997436a1e | ||
|
|
541dd4615b | ||
|
|
06d587bda2 | ||
|
|
bf267eaa86 | ||
|
|
7c11d032bd | ||
|
|
505b7b3bc3 | ||
|
|
37105aacb7 | ||
|
|
13ad376162 | ||
|
|
b1ca3e82e2 | ||
|
|
1f575c1498 | ||
|
|
17a007a4ff | ||
|
|
c58df5f5c5 | ||
|
|
b6a0d48d42 | ||
|
|
58102fbcdd | ||
|
|
addad7778f | ||
|
|
b506f6289f | ||
|
|
18da38f7b3 | ||
|
|
521d137825 | ||
|
|
f833269061 | ||
|
|
60e1f6f58d | ||
|
|
2adb58166d | ||
|
|
5460711e37 | ||
|
|
6a46f40c6d | ||
|
|
b58512a153 | ||
|
|
b9e91fd27a | ||
|
|
258e6048c1 | ||
|
|
e443a842dd | ||
|
|
8ce56aea8a | ||
|
|
09c54c4387 | ||
|
|
082e3f3ed0 | ||
|
|
3dcc2202e1 | ||
|
|
089113d8b4 | ||
|
|
045414500d | ||
|
|
00546bc09f | ||
|
|
e17613ce38 | ||
|
|
3b933d4940 | ||
|
|
41603e59a5 | ||
|
|
fc86111f66 | ||
|
|
e9e2cf245d | ||
|
|
9f44097409 | ||
|
|
004161fd11 | ||
|
|
805f1dc81d | ||
|
|
dd7cbbe3e8 | ||
|
|
2d2fe384df | ||
|
|
d201ec5631 | ||
|
|
6e3a2c4e2d | ||
|
|
ace1071dfb | ||
|
|
be81b7e508 | ||
|
|
5c7d9e8473 | ||
|
|
79cb1aee0f | ||
|
|
d69d6e0f74 | ||
|
|
30395d1e2d | ||
|
|
0ba05b173f | ||
|
|
32a79b2ff9 | ||
|
|
268b0e0536 | ||
|
|
29c7bc7ff7 | ||
|
|
0b40088619 | ||
|
|
60ff70bcf8 | ||
|
|
9ff5ba8793 | ||
|
|
dfc1f4c5ee | ||
|
|
d96f4346b5 | ||
|
|
6994267dbf | ||
|
|
7b77765a9a | ||
|
|
cc59134689 | ||
|
|
658c80afa4 | ||
|
|
e93d75d3f9 | ||
|
|
159c298805 | ||
|
|
9a335d2e41 | ||
|
|
21aa86543d | ||
|
|
4224f721e4 | ||
|
|
71c6e41fe9 | ||
|
|
2caa969570 | ||
|
|
9fc62ede7e | ||
|
|
07651b136a | ||
|
|
3a2bd56771 | ||
|
|
77d75ab2fc | ||
|
|
1b2722f2f6 | ||
|
|
96c82d7028 | ||
|
|
9146dba483 | ||
|
|
c0fd219230 | ||
|
|
131c68d850 | ||
|
|
0a41c61107 | ||
|
|
3774776e7b | ||
|
|
a9095128af | ||
|
|
0b45193000 | ||
|
|
b17ee109b9 | ||
|
|
8ce87de919 | ||
|
|
89fbe663ad | ||
|
|
cb753ddd70 | ||
|
|
7e7056e21d | ||
|
|
966ff87724 | ||
|
|
1b1daa56cc | ||
|
|
a6a3243931 | ||
|
|
d6641aab89 | ||
|
|
aea8306abb | ||
|
|
69ed9634ca | ||
|
|
300730f642 | ||
|
|
c91239e588 | ||
|
|
dea1447fbb | ||
|
|
0f8b9130ec | ||
|
|
6c3b9fbc8d | ||
|
|
78bed4fed5 | ||
|
|
1e1d1adc5f | ||
|
|
0521f3d7f2 | ||
|
|
f668a90576 | ||
|
|
07cabd057d | ||
|
|
131dfa9354 | ||
|
|
a20edf3e5b | ||
|
|
11eb151d29 | ||
|
|
cb8a44f6d6 | ||
|
|
6f9be304e9 | ||
|
|
44b9661877 | ||
|
|
45940ece47 | ||
|
|
99b0d4173b | ||
|
|
835885adda | ||
|
|
deef9702e6 | ||
|
|
2a91498d67 | ||
|
|
11d2da71fa | ||
|
|
1049595477 | ||
|
|
1acbb9ec28 | ||
|
|
f7c09d63b8 | ||
|
|
94b67f615e | ||
|
|
9995355714 | ||
|
|
e13392595f | ||
|
|
494c2de3a7 |
@@ -0,0 +1,580 @@
|
||||
1999-03-14 <stanton@GASPODE>
|
||||
|
||||
* win/tclWinConsole.c:
|
||||
* win/tclWinPipe.c:
|
||||
* win/tclWinSerial.c: Changed so channel drivers wait for the
|
||||
reader/writer threads to exit before returning during a close
|
||||
operation. This ensures that the main thread is the last thread
|
||||
to exit, so the process return value is set properly.
|
||||
|
||||
* generic/tclIntDecls.h:
|
||||
* generic/tclIntPlatDecls.h:
|
||||
* generic/tclIntPlatStubs.c:
|
||||
* generic/tclIntStubs.c:
|
||||
* generic/tclPlatDecls.h:
|
||||
* generic/tclPlatStubs.c:
|
||||
* generic/tclStubInit.c:
|
||||
* generic/tclStubs.c: Fixed bad eol characters.
|
||||
|
||||
* generic/tclInt.decls: Changed "const" to "CONST" in
|
||||
declarations for better portability.
|
||||
|
||||
* generic/tcl.decls: Renamed panic and panicVA to Tcl_Panic and
|
||||
Tcl_PanicVA in the stub files.
|
||||
|
||||
* generic/tclInterp.c (Tcl_MakeSafe): Remove tcl_platform(user)
|
||||
from safe interps.
|
||||
|
||||
1999-03-11 <stanton@GASPODE>
|
||||
|
||||
* unix/Makefile.in:
|
||||
* unix/configure.in: Include compat files in the stub library in
|
||||
addition to the main library. Compat files are now built for
|
||||
dynamic use in all cases.
|
||||
|
||||
* generic/tcl.h: Changed magic number so it doesn't match the plus
|
||||
patch, at Jan's request.
|
||||
|
||||
* unix/tclConfig.sh.in:
|
||||
* unix/dltest/Makefile.in:
|
||||
* unix/dltest/configure.in:
|
||||
* unix/dltest/pkga.c:
|
||||
* unix/dltest/pkgb.c:
|
||||
* unix/dltest/pkgc.c:
|
||||
* unix/dltest/pkgd.c:
|
||||
* unix/dltest/pkge.c:
|
||||
* unix/dltest/pkgf.c: Changed package tests to build against the
|
||||
stubs library.
|
||||
|
||||
1999-03-10 <stanton@GASPODE>
|
||||
|
||||
* generic/tcl.h:
|
||||
* generic/tcl.decls: Changed Tcl_ReleaseType from an enum to
|
||||
macros so it can be used in .rc files.
|
||||
Added Tcl_GetString.
|
||||
|
||||
* mac/tclMacNotify.c:
|
||||
* generic/tclNotify.c:
|
||||
* generic/tclInt.h:
|
||||
* win/tclWinNotify.c:
|
||||
* generic/tcl.h: Renamed Tcl_AlertNotifier to TclpAlertNotifier.
|
||||
|
||||
* generic/tclInt.decls: Added TclWinAddProcess to make it possible
|
||||
for expect to use Tcl_WaitForPid(). This patch is from Gordon
|
||||
Chaffee.
|
||||
|
||||
* mac/tclMacPort.h:
|
||||
* win/tclWinInit.c:
|
||||
* unix/tclUnixPort.h:
|
||||
* generic/tclAsync.c: Added TclpAsyncMark to fix bug in async
|
||||
handling on Windows where async events don't wake up the event
|
||||
loop. This patch comes from Gordon Chaffee.
|
||||
|
||||
* generic/tcl.decls: Fixed declarations of reserved slots.
|
||||
|
||||
1999-03-10 <redman@scriptic.com>
|
||||
|
||||
* generic/tclCompile.h: Ensure that the ByteCode struct is binary
|
||||
compatible with the version in 8.0.6.
|
||||
|
||||
* generic/tcl.h:
|
||||
* generic/tclBasic.c: Add Tcl_GetVersion() function to the public
|
||||
C API to allow programs to check the version number of the Tcl
|
||||
library at runtime. Also added an enum to clarify the release
|
||||
level (alpha, beta, final).
|
||||
|
||||
1999-03-09 <stanton@GASPODE>
|
||||
|
||||
* Integrated changes from Tcl 8.0 including:
|
||||
stubs mechanism
|
||||
configure patches from Jan Nijtmans
|
||||
rename of panic to Tcl_Panic
|
||||
|
||||
1999-03-08 <lfb@scriptics.com>
|
||||
|
||||
* win/tclWin32Dll.c: Removed Dll instance from thread-local
|
||||
storage.
|
||||
|
||||
1999-03-08 <stanton@GASPODE>
|
||||
|
||||
* generic/tcl.h: Moved Tcl_Mutex, etc. macros above the inclusion
|
||||
of tclDecls.h to avoid macro conflicts.
|
||||
|
||||
* generic/tclInt.h:
|
||||
* generic/regc_color.c:
|
||||
* generic/regcomp.c:
|
||||
* generic/tclCmdIL.c:
|
||||
* generic/tclCmdAH.c:
|
||||
* generic/tclIOCmd.c:
|
||||
* generic/tclParse.c:
|
||||
* generic/tclStringObj.c:
|
||||
* unix/tclUnixNotfy.c: Cleaned up various compiler warnings,
|
||||
eliminated UCHAR bugs.
|
||||
|
||||
* unix/tclUnixNotfy.c:
|
||||
* unix/tclUnixThrd.c:
|
||||
* generic/tclThreadTest.c:
|
||||
* mac/tclMacThrd.c: Changed TclpCondition*() to Tcl_Condition*().
|
||||
|
||||
* INTEGRATED PATCHES FROM 8.0.6:
|
||||
|
||||
* generic/tcl.decls:
|
||||
* generic/tcl.h:
|
||||
* generic/tclBasic.c:
|
||||
* generic/tclDecls.h:
|
||||
* generic/tclInt.decls:
|
||||
* generic/tclInt.h:
|
||||
* generic/tclIntDecls.h:
|
||||
* generic/tclIntPlatDecls.h:
|
||||
* generic/tclIntPlatStubs.c:
|
||||
* generic/tclIntStubs.c:
|
||||
* generic/tclPlatDecls.h:
|
||||
* generic/tclPlatStubs.c:
|
||||
* generic/tclStubInit.c:
|
||||
* generic/tclStubLib.c:
|
||||
* generic/tclStubs.c:
|
||||
* tools/genStubs.tcl:
|
||||
* unix/configure.in:
|
||||
* unix/Makefile.in:
|
||||
* unix/tclConfig.sh.in:
|
||||
* win/makefile.vc:
|
||||
* win/tclWinPort.h: Added Tcl stubs implementation. There are
|
||||
now two new macros USE_TCL_STUBS and USE_TCL_STUB_PROCS that
|
||||
enable use of stubs and disable stub macros respectively. All of
|
||||
the public and private function declarations from tcl.h and
|
||||
tclInt.h have moved into the *.decls files and the *Stubs.c and
|
||||
*Decls.h files are generated using the genStubs.tcl script.
|
||||
|
||||
* unix/Makefile.in:
|
||||
* unix/configure.in:
|
||||
* unix/ldAix: Enhanced AIX shared library support.
|
||||
|
||||
* win/tclWinSock.c: Removed a bunch of extraneous PASCAL FAR
|
||||
attributes from internal functions.
|
||||
|
||||
* win/tclWinReg.c: Changed registry package to use stubs mechanism
|
||||
so it no longer depends on the specific version of Tcl.
|
||||
|
||||
* doc/AddErrInfo.3:
|
||||
* doc/Eval.3:
|
||||
* doc/PkgRequire.3:
|
||||
* doc/SetResult.3:
|
||||
* doc/StringObj.3:
|
||||
* generic/tcl.h:
|
||||
* generic/tclBasic.c:
|
||||
* generic/tclPanic.c:
|
||||
* generic/tclStringObj.c:
|
||||
* generic/tclUtil.c:
|
||||
* unix/mkLinks: Added va_list versions of all VARARGS
|
||||
functions so they can be invoked from the stub functions.
|
||||
|
||||
* doc/package.n:
|
||||
* doc/PkgRequire.3:
|
||||
* generic/tclPkg.c: Added Tcl_PkgProvideEx, Tcl_RequireEx,
|
||||
Tcl_PresentEx, and Tcl_PkgPresent. Added "package present"
|
||||
command.
|
||||
|
||||
* generic/tclFileName.c:
|
||||
* mac/tclMacFile.c:
|
||||
* mac/tclMacShLib.exp:
|
||||
* unix/tclUnixFile.c:
|
||||
* win/tclWinFile.c: Changed so TclGetUserHome is defined on
|
||||
all platforms, even though it is currently a noop on mac and
|
||||
windows, and renamed it to TclpGetUserHome.
|
||||
|
||||
* generic/tclPanic.c:
|
||||
* generic/panic.c: Renamed panic to Tcl_Panic.
|
||||
|
||||
1999-02-25 <redman@scriptics.com>
|
||||
|
||||
* win/makefile.vc: Added tclWinConsole.c and tclWinSerial.c
|
||||
|
||||
* win/tclWinConsole.c: New code to properly deal with fileevents
|
||||
and nonblocking mode on consoles.
|
||||
|
||||
* win/tclWinSerial.c: New code to properly deal with fileevents
|
||||
and nonblocking mode on serial ports.
|
||||
|
||||
* win/tclWinPipe.c:
|
||||
* win/tclWinPort.h: Exported functions to allow creation of pipe
|
||||
channels from tclWinChan.c
|
||||
|
||||
* win/tclWinChan.c: Check the type of a channel, including for the
|
||||
standard (stdin/stdout/stderr), and use the correct channel type
|
||||
to create the channel (file, serial, console, or pipe).
|
||||
|
||||
1999-02-11 <stanton@GASPODE>
|
||||
|
||||
* README:
|
||||
* generic/tcl.h:
|
||||
* win/README.binary:
|
||||
* win/README:
|
||||
* unix/configure.in:
|
||||
* mac/README: Updated version numbers to 8.1b2.
|
||||
|
||||
1999-02-10 <stanton@GASPODE>
|
||||
|
||||
* library/auto.tcl: Fixed auto_mkindex so it handles .tbc files.
|
||||
Did some general cleanup to handle bad eval statements that didn't
|
||||
use "list".
|
||||
|
||||
* unix/mkLinks:
|
||||
* doc/SetVar.3:
|
||||
* generic/tcl.h:
|
||||
* generic/tclVar.c: Restored Tcl_ObjGetVar2 and Tcl_ObjSetVar2
|
||||
from 8.0. Renamed Tcl_Get/SetObjVar2 to Tcl_GetVar2Ex and
|
||||
Tcl_SetVar2Ex.
|
||||
|
||||
1999-02-10 <stanton@GASPODE>
|
||||
|
||||
INTEGRATED PATCHES FROM 8.0.5b2:
|
||||
|
||||
* test/winPipe.test: Changed to remove echoArgs.tcl temporary file
|
||||
when done.
|
||||
|
||||
* tests/cmdAH.test:
|
||||
* generic/tclFileName.c (TclGetExtension): Changed behavior so the
|
||||
split happens at the last period in the name instead of the first
|
||||
period of the last run of periods. So, "foo..o" is split into
|
||||
"foo." and ".o" now. [Bug: 1126]
|
||||
|
||||
* win/makefile.vc: Added better support for paths with spaces in
|
||||
the name. Added .lib and support .dlls to the install-binaries
|
||||
target. Added generate of a pkgIndex.tcl script to the
|
||||
install-libraries target.
|
||||
|
||||
* win/tclAppInit.c:
|
||||
* unix/tclAppInit.c:
|
||||
* mac/tclMacAppInit.c:
|
||||
* generic/tclTest.c: Changed some EXTERN declarations to extern
|
||||
since they are not defining exported interfaces. This avoids
|
||||
generating useless declspec() attributes and makes the windows
|
||||
makefile simpler.
|
||||
|
||||
* generic/tcl.h: Moved Tcl_AppInit declaration to end and cleared
|
||||
out TCL_STORAGE_CLASS so it is not declared with a declspec().
|
||||
|
||||
* tests/interp.test:
|
||||
* generic/tclInterp.c (DeleteAlias): Changed to use
|
||||
Tcl_DeleteCommandFromToken so we handle renames properly. This
|
||||
avoids senseless panic. [Bug: 736]
|
||||
|
||||
* unix/tclUnixChan.c:
|
||||
* win/tclWinSock.c:
|
||||
* doc/socket.n: Applied Gordon Chaffee's patch to handle failures
|
||||
during asynchronous socket connection operations. This adds a new
|
||||
"-error" fconfgure option to socket channels. [Bug: 893]
|
||||
|
||||
* generic/tclProc.c:
|
||||
* generic/tclNamesp.c:
|
||||
* generic/tclInt.h:
|
||||
* generic/tclCmdIL.c:
|
||||
* generic/tclBasic.c:
|
||||
* generic/tclVar.c: Applied patch from Viktor Dukhovni to
|
||||
rationalize TCL_LEAVE_ERR_MSG behavior when creating variables.
|
||||
|
||||
* generic/tclVar.c: Fixed bug in namespace tail computation.
|
||||
Fixed bug where upvar could resurrect a namespace variable whose
|
||||
namespace had been deleted.
|
||||
|
||||
* generic/tclCompile.c (TclCompileExprCmd): Eliminated yet another
|
||||
bogus optimization in expression compilation.
|
||||
|
||||
* unix/configure.in: Added branch for BSD/OS-4* to shared library
|
||||
case statement. [Bug: 975]
|
||||
Fixed to correctly handle IRIX 6.5 n32 library support. [Bug: 1117]
|
||||
|
||||
* win/winDumpExts.c: Patched to be pickier about stripping
|
||||
@'s. [Bug: 920]
|
||||
|
||||
* library/http2.0/http.tcl: Added catch around eof test in
|
||||
CopyDone since the user may have already called http::reset.
|
||||
[Bug: 1108]
|
||||
|
||||
* unix/configure.in: Changed Linux and IRIX to set SHLIB_LIBS to
|
||||
LIBS so shared libraries are linked with the system
|
||||
libraries. [Bug: 1018]
|
||||
|
||||
* generic/tclCompile.c (CompileExprWord): Fixed exception stack
|
||||
overflow bug caused by missing statement. [Bug: 928]
|
||||
|
||||
* generic/tclIOCmd.c:
|
||||
* generic/tclBasic.c: Objectified the "open" command. [Bug: 1113]
|
||||
|
||||
* generic/tclPosixStr.c (Tcl_ErrnoId, Tcl_ErrnoMsg): When using
|
||||
egcs, ENOTSUP and EOPNOTSUPP are the same, so now we handle that
|
||||
case. [Bug: 1137]
|
||||
|
||||
* library/init.tcl: Various small changes requested by Jan Nijtmans.
|
||||
- If the variable $tcl_library contains the empty string, this
|
||||
empty string will be put in $auto_path. This is not useful at all,
|
||||
it only slows down later package processing.
|
||||
- If the variable tcl_pkgPath is not set, the "unset __dir"
|
||||
fails. Thich makes init.tcl totally unusable. Better put a "catch"
|
||||
around it.
|
||||
- In the function tcl_findLibraries, the "string match" function
|
||||
only works correctly if $tcl_patchLevel is in one of the forms
|
||||
"?.?a?", "?.?b?" or "?.?.?". Could a "regexp" be used instead,
|
||||
then it allows anything to be appended to the patchLevel
|
||||
string. And it is more efficient.
|
||||
- The tclPkgSetup function assumes that if $type != "load" then
|
||||
the type must be "source". This needn't be true. Some users want
|
||||
to add their own setup types.
|
||||
[RFE: 1138] [Bug: 978]
|
||||
|
||||
* win/tclWinReg.c:
|
||||
* doc/registry.n: Added support for HKEY_PERFORMANCE_DATA and
|
||||
HKEY_DYN_DATA keys. [Bug: 1109]
|
||||
|
||||
* win/tclWinInit.c (TclPlatformInit): Added code to ensure
|
||||
tcl_pkgPath is set to "" when no registry entry is found. [Bug: 978]
|
||||
|
||||
1999-02-01 <stanton@GASPODE>
|
||||
|
||||
* generic/tclBasic.c:
|
||||
* generic/tclCmdAH.c:
|
||||
* generic/tclCmdIL.c:
|
||||
* generic/tclCmdMZ.c:
|
||||
* generic/tclExecute.c:
|
||||
* generic/tclHistory.c:
|
||||
* generic/tclIO.c:
|
||||
* generic/tclIOUtil.c:
|
||||
* generic/tclInterp.c:
|
||||
* generic/tclMain.c:
|
||||
* generic/tclNamesp.c:
|
||||
* generic/tclParse.c:
|
||||
* generic/tclProc.c:
|
||||
* generic/tclTest.c:
|
||||
* generic/tclTimer.c:
|
||||
* generic/tcl.h: Made eval interfaces compatible with 8.0 by
|
||||
renaming Tcl_EvalObj to Tcl_EvalObjEx, renaming Tcl_Eval2 to
|
||||
Tcl_EvalEx and restoring Tcl_EvalObj and Tcl_GlobalEvalObj
|
||||
interfaces so they match Tcl 8.0.
|
||||
|
||||
1999-01-28 <stanton@GASPODE>
|
||||
|
||||
* Merged Tcl 8.0.5b1 changes.
|
||||
|
||||
* generic/tclUtil.c (Tcl_DStringSetLength): Changed so the buffer
|
||||
overallocates in a manner similar to Tcl_DStringAppend. This
|
||||
should improve performance for TclUniCharToUtfDString.
|
||||
|
||||
1998-12-11 === Tcl 8.1b1 Release ===
|
||||
|
||||
1998-12-10 <stanton@GASPODE>
|
||||
|
||||
* Fixed lots of files that used TCL_THREAD instead of TCL_THREADS.
|
||||
|
||||
* generic/tclEncoding.c (Tcl_FreeEncoding): Moved most of the code
|
||||
into a static FreeEncoding routine that does not grab the
|
||||
encodingMutex to avoid deadlocks/races when called from other
|
||||
routines that already have the mutex.
|
||||
|
||||
1998-12-09 <stanton@GASPODE>
|
||||
|
||||
* library/msgcat1.0/msgcat.tcl: Fixed bad export list, fixed so
|
||||
all locale strings are converted to lower case, including file
|
||||
names.
|
||||
|
||||
* generic/regcomp.c (makescan): Fixed bug in longest match case
|
||||
that caused anchored patterns to fail. [Bug: 897]
|
||||
|
||||
1998-12-08 <stanton@GASPODE>
|
||||
|
||||
* library/msgcat1.0/msgcat.tcl: changed mc to invoke mcunknown in
|
||||
the calling context, changed locale lookups to be case insensitive
|
||||
|
||||
1998-12-07 <stanton@GASPODE>
|
||||
|
||||
* generic/tclAlloc.c (TclpRealloc): Fixed a memory allocation bug
|
||||
where big blocks that were reallocated into a different heap
|
||||
location were not being placed into the bigBlocks list. [Bug: 933]
|
||||
|
||||
* tests/msgcat.test: Added message catalog test suite.
|
||||
|
||||
* library/msgcat1.0/msgcat.tcl: minor bug fixes, integrated latest
|
||||
changes from Mark Harrison.
|
||||
|
||||
1998-12-04 <stanton@GASPODE>
|
||||
|
||||
* library/msgcat1.0/msgcat.tcl: Changed code to conform to Tcl
|
||||
coding standards. Changed to use file join for portability.
|
||||
|
||||
* library/msgcat1.0: Added initial implementaion of Tcl message
|
||||
catalog package contributed by Mark Harrison.
|
||||
|
||||
1998-12-03 <stanton@GASPODE>
|
||||
|
||||
* win/tclWinPipe.c (BuildCommandLine): Fixed bug that kept
|
||||
arguments containing spaces from being properly quoted.
|
||||
|
||||
* tests/defs: Changed so auto_path is set to only contain the Tcl
|
||||
library directory. This keeps the tests from accidentally picking
|
||||
up stuff in installed packages.
|
||||
|
||||
* generic/tclUtil.c (Tcl_StringMatch): Changed to match 8.0
|
||||
behavior in corner case where there is no closing bracket.
|
||||
|
||||
1998-12-02 <stanton@GASPODE>
|
||||
|
||||
* win/tclWinPipe.c (TclpCreateCommandChannel): Changed
|
||||
reader/writer threads to have THREAD_PRIORITY_HIGHEST so they will
|
||||
have a chance to run whenever there is something to do.
|
||||
|
||||
* generic/tclIO.c (WriteBytes, WriteChars): Fixed so extraneous
|
||||
flushes do not happen in line mode.
|
||||
(TranslateOutputEOL): Made translation more efficient in line mode
|
||||
and fixed a buffer overflow bug in CRLF translation. [Bug: 887]
|
||||
|
||||
1998-12-02 <welch@SAGE>
|
||||
|
||||
* Updated patchlevel to 8.1b1
|
||||
|
||||
1998-12-02 <stanton@GASPODE>
|
||||
|
||||
* generic/regc_color.c (subcolor): Added check for error case to
|
||||
avoid an out of bounds array reference.
|
||||
|
||||
* generic/tclCmdAH.c (Tcl_EncodingObjCmd): Changed to avoid using
|
||||
Tcl_DStringResult because it is not binary clean.
|
||||
|
||||
* generic/tclParse.c (Tcl_ParseCommand): Fixed bug in comment
|
||||
parsing where a trailing comment looked like an incomplete
|
||||
command.
|
||||
|
||||
1998-12-02 <welch@SAGE>
|
||||
|
||||
* Merged changes from 8.0.4, especially the new pkg_mkIndex
|
||||
|
||||
1998-12-01 <stanton@GASPODE>
|
||||
|
||||
* generic/tclIO.c (Tcl_ReadChars): Added a call to UpdateInterest
|
||||
so we don't block when there is data sitting in the buffers.
|
||||
|
||||
* generic/tclTest.c (TestevalobjvObjCmd): Updated for EvalObjv
|
||||
change.
|
||||
|
||||
* tests/parse.test: Updated tests for EvalObjv change.
|
||||
|
||||
* generic/tclParse.c (EvalObjv, Tcl_EvalObjv): Changed
|
||||
Tcl_EvalObjv interface to remove string and length arguments,
|
||||
preserved original interface as EvalObjv for internal use.
|
||||
|
||||
* generic/tcl.h: Changed Tcl_EvalObjv interface to remove string
|
||||
and length arguments.
|
||||
|
||||
* doc/Eval.3: Updated documentation for Tcl_EvalObjv to remove
|
||||
string and length arguments.
|
||||
|
||||
* generic/tclCompCmds.c (TclCompileForeachCmd): Fixed code that
|
||||
corrupted the exceptDepth value in the compile environment when
|
||||
foreach failed to compile inline. [Bug: 884]
|
||||
|
||||
* library/encoding/euc-kr.enc:
|
||||
* library/encoding/ksc5601.enc:
|
||||
* tools/encoding/ksc5601.txt:
|
||||
* unix/tclUnixInit.c: Added support for Korean EUC.
|
||||
|
||||
* win/tclWinChan.c (TclpGetDefaultStdChannel): added check for a
|
||||
failure during Tcl_MakeFileChannel.
|
||||
|
||||
1998-11-30 <stanton@GASPODE>
|
||||
|
||||
* unix/tclUnixNotfy.c (Tcl_WaitForEvent): Fixed hang that occurs
|
||||
when trying to close a pipe that is currently being waited on by
|
||||
the notifier thread. [Bug: 607]
|
||||
|
||||
* unix/tclUnixFCmd.c (GetPermissionsAttribute): Increase size of
|
||||
returnString buffer to avoid overflow. [Bug: 584]
|
||||
|
||||
* generic/tclThreadTest.c (TclThreadSend): Fixed memory leak due
|
||||
to use of TCL_VOLATILE instead of TCL_DYNAMIC.
|
||||
|
||||
* generic/tclThread.c (TclRememberSyncObject): Fixed memory leak
|
||||
caused by failure to reuse condition variables.
|
||||
|
||||
* unix/tclUnixNotfy.c: (Tcl_AlertNotifier, Tcl_WaitForEvent,
|
||||
NotifierThreadProc, Tcl_InitNotifier): Fixed race condition caused
|
||||
by incorrect use of condition variables when sending messages
|
||||
between threads.. [Bug: 607]
|
||||
|
||||
* generic/tclTestObj.c (TeststringobjCmd): MAX_STRINGS was off by one
|
||||
so the strings array was too small.
|
||||
|
||||
* generic/tclCkalloc.c (Tcl_DbCkfree): Moved mutex lock so
|
||||
ValidateMemory is done inside the mutex to avoid a race condition
|
||||
when validate_memory is enabled. [Bug: 880]
|
||||
|
||||
1998-11-23 <stanton@GASPODE>
|
||||
|
||||
* regexec.c: more performance tuning from Henry Spencer.
|
||||
|
||||
1998-11-17 <stanton@GASPODE>
|
||||
|
||||
* tclScan.c: moved "scan" implementation out of tclCmdMZ.c and
|
||||
added Unicode support. This required a complete reimplementation
|
||||
of the command to avoid using scanf(), which isn't Unicode aware.
|
||||
Two new features were added in the process: %n to return the
|
||||
current number of characters consumed, and XPG3-style %n$ argument
|
||||
order specifiers similar to those provided by the "format"
|
||||
command. [Bug: 833]
|
||||
|
||||
* tclAlloc.c: changed so allocated memory is always 8-byte aligned
|
||||
to improve memory performance and to ensure that it will work on
|
||||
systems that don't like accessing 4-byte aligned values
|
||||
(e.g. Solaris and HP-UX). [Bug: 834]
|
||||
|
||||
1998-11-06 <stanton@GASPODE>
|
||||
|
||||
* tclVar.c (TclGetIndexedScalar): Fixed bug 796, var name was
|
||||
getting lost before being passed to CallTraces.
|
||||
|
||||
1998-10-21 <stanton@GASPODE>
|
||||
|
||||
* added "encoding" command
|
||||
|
||||
* Moved internal regexp declarations from tclInt.h to tclRegexp.h
|
||||
|
||||
* integrated regexp updates from Henry Spencer
|
||||
|
||||
1998-10-15 <stanton@GASPODE>
|
||||
|
||||
* tclUtf.c: added Unicode character table support
|
||||
|
||||
* tclInt.h: added TclUniCharIsWordChar
|
||||
|
||||
* tclCmdMZ.c (Tcl_StringObjCmd): added "totitle" subcommand,
|
||||
changed "wordend" and "wordstart" to properly handle Unicode word
|
||||
characters and connector punctuation
|
||||
|
||||
1998-10-05 <stanton@GASPODE>
|
||||
|
||||
* auto.tcl, package.tcl: fixed SCCS strings
|
||||
|
||||
* tclIndex: updated index to reflect 8.1 files
|
||||
|
||||
* tclCompile.c (TclCompileScript): changed to avoid modifying the
|
||||
input string in place because name lookup operations could have
|
||||
arbitrary side effects
|
||||
|
||||
* tclInterp.c: added guard against deleting current interpreter
|
||||
|
||||
* tclMacFile.c, tclUnixFile.c, tclWinFile.c, tclFileName.c: added
|
||||
warnings around code that modifies strings in place
|
||||
|
||||
* tclExecute.c: fixed off-by-one copying error, fixed merge bugs
|
||||
|
||||
* tclEvent.c: changed so USE_TCLALLOC is tested for value instead
|
||||
of definition
|
||||
|
||||
* tclCompCmds.c: replaced SCCS strings, added warnings around code
|
||||
that modifies strings in place
|
||||
|
||||
* interp.test: added test for interp deleting itself
|
||||
|
||||
1998-09-30 <stanton@GASPODE>
|
||||
|
||||
* makefile.vc: fixed so TCL_LIBRARY is set before running tcltest
|
||||
|
||||
* tclWin32Dll.c: removed TclpFinalize, cleanup of merges
|
||||
|
||||
@@ -1,29 +1,66 @@
|
||||
Tcl
|
||||
README: Tcl
|
||||
|
||||
SCCS: @(#) README 1.52 97/11/20 12:43:16
|
||||
Tcl is maintained, enhanced, and distributed freely as a
|
||||
service to the Tcl community by Scriptics Corporation.
|
||||
|
||||
RCS: @(#) $Id: README,v 1.1.2.9 1999/03/14 00:53:23 rjohnson Exp $
|
||||
|
||||
Contents
|
||||
--------
|
||||
1. Introduction
|
||||
2. Documentation
|
||||
3. Compiling and installing Tcl
|
||||
4. Summary of changes in Tcl 8.1
|
||||
5. Development tools
|
||||
6. Tcl newsgroup
|
||||
7. Tcl contributed archive
|
||||
8. Tcl Resource Center
|
||||
9. Mailing lists
|
||||
10. Support and bug fixes
|
||||
11. Tcl version numbers
|
||||
|
||||
1. Introduction
|
||||
---------------
|
||||
|
||||
This directory and its descendants contain the sources and documentation
|
||||
for Tcl, an embeddable scripting language. The information here
|
||||
corresponds to release 8.0p2, which is the second patch update for Tcl
|
||||
8.0. Tcl 8.0 is a major new release that replaces the core of the
|
||||
interpreter with an on-the-fly bytecode compiler to improve execution
|
||||
speed. It also includes several other new features such as namespaces
|
||||
and binary I/O, plus many bug fixes. The compiler introduces a few
|
||||
incompatibilities that may affect existing Tcl scripts; the
|
||||
incompatibilities are relatively obscure but may require modifications
|
||||
to some old scripts before they can run with this version. The compiler
|
||||
introduces many new C-level APIs, but the old APIs are still supported.
|
||||
See below for more details. This patch release fixes various bugs in
|
||||
Tcl 8.0; there are no feature changes relative to Tcl 8.0.
|
||||
Tcl provides a powerful platform for creating integration
|
||||
applications that tie together diverse applications, protocols,
|
||||
devices, and frameworks. When paired with the Tk toolkit, Tcl
|
||||
provides the fastest and most powerful way to create GUI applications
|
||||
that run on PCs, Unix, and the Macintosh. Tcl can also be used for a
|
||||
variety of web-related tasks and for creating powerful command
|
||||
languages for applications.
|
||||
|
||||
This directory contains the sources and documentation for Tcl. The
|
||||
information here corresponds to release 8.1b2, which is the second
|
||||
beta release for Tcl 8.1. This release is mostly feature complete but
|
||||
may have bugs and be missing some minor features. This release is for
|
||||
early adopters who are willing to help us find and fix problems.
|
||||
Please let us know about any problems you uncover.
|
||||
|
||||
Tcl 8.1 includes four major new features: Unicode support (all internal
|
||||
strings are now stored in UTF-8 form), a new regular expression matcher
|
||||
with most of the Perl features, support for multithreading, and a new
|
||||
message catalog package. For details on features, incompatibilities, and
|
||||
potential problems with this release, see the Tcl/Tk 8.1 Web page at
|
||||
http://www.scriptics.com/software/8.1.html or refer to the "changes" file
|
||||
in this directory, which contains a historical record of all changes to
|
||||
Tcl.
|
||||
|
||||
Tcl is a freely available open source package. You can do virtually
|
||||
anything you like with it, such as modifying it, redistributing it,
|
||||
and selling it either in whole or in part. See the file
|
||||
"license.terms" for complete information.
|
||||
|
||||
2. Documentation
|
||||
----------------
|
||||
|
||||
The best way to get started with Tcl is to read one of the introductory
|
||||
books on Tcl:
|
||||
The best way to get started with Tcl is to read about Tcl on the
|
||||
Scriptics Web site at:
|
||||
|
||||
http://www.scriptics.com/scripting
|
||||
|
||||
Another good way to get started with Tcl is to read one of the
|
||||
introductory books on Tcl:
|
||||
|
||||
Practical Programming in Tcl and Tk, 2nd Edition, by Brent Welch,
|
||||
Prentice-Hall, 1997, ISBN 0-13-616830-2
|
||||
@@ -34,13 +71,29 @@ books on Tcl:
|
||||
Exploring Expect, by Don Libes,
|
||||
O'Reilly and Associates, 1995, ISBN 1-56592-090-2
|
||||
|
||||
The "doc" subdirectory in this release contains a complete set of reference
|
||||
manual entries for Tcl. Files with extension ".1" are for programs (for
|
||||
example, tclsh.1); files with extension ".3" are for C library procedures;
|
||||
and files with extension ".n" describe Tcl commands. The file "doc/Tcl.n"
|
||||
gives a quick summary of the Tcl language syntax. To print any of the man
|
||||
pages, cd to the "doc" directory and invoke your favorite variant of
|
||||
troff using the normal -man macros, for example
|
||||
Other books are listed at
|
||||
http://www.scriptics.com/resource/doc/books/
|
||||
|
||||
There is also an official home for Tcl and Tk on the Scriptics Web site:
|
||||
|
||||
http://www.scriptics.com
|
||||
|
||||
These Web pages include information about the latest releases, products
|
||||
related to Tcl and Tk, reports on bug fixes and porting issues, HTML
|
||||
versions of the manual pages, and pointers to many other Tcl/Tk Web
|
||||
pages at other sites. Check them out!
|
||||
|
||||
2a. Unix Documentation
|
||||
----------------------
|
||||
|
||||
The "doc" subdirectory in this release contains a complete set of
|
||||
reference manual entries for Tcl. Files with extension ".1" are for
|
||||
programs (for example, tclsh.1); files with extension ".3" are for C
|
||||
library procedures; and files with extension ".n" describe Tcl
|
||||
commands. The file "doc/Tcl.n" gives a quick summary of the Tcl
|
||||
language syntax. To print any of the man pages on Unix, cd to the
|
||||
"doc" directory and invoke your favorite variant of troff using the
|
||||
normal -man macros, for example
|
||||
|
||||
ditroff -man Tcl.n
|
||||
|
||||
@@ -50,19 +103,22 @@ using the normal "man" mechanisms, such as
|
||||
|
||||
man Tcl
|
||||
|
||||
There is also an official home for Tcl and Tk on the Web:
|
||||
http://sunscript.sun.com
|
||||
These Web pages include information about the latest releases, products
|
||||
related to Tcl and Tk, reports on bug fixes and porting issues, HTML
|
||||
versions of the manual pages, and pointers to many other Tcl/Tk Web
|
||||
pages at other sites. Check them out!
|
||||
2b. Windows Documentation
|
||||
-------------------------
|
||||
|
||||
The "doc/help" subdirectory in this release contains a complete set of
|
||||
Windows help files for TclPro. Once you install this Tcl release, a
|
||||
shortcut to the Windows help Tcl documentation will appear in the
|
||||
"Start" menu:
|
||||
|
||||
Start | Programs | Tcl | Tcl Help
|
||||
|
||||
3. Compiling and installing Tcl
|
||||
-------------------------------
|
||||
|
||||
This release contains everything you should need to compile and run
|
||||
Tcl under UNIX, Macintoshes, and PCs (either Windows NT, Windows 95,
|
||||
or Win 3.1 with Win32s).
|
||||
Tcl under UNIX, PCs (either Windows NT, Windows 95, or Win 3.1 with
|
||||
Win32s), and Macintoshes.
|
||||
|
||||
Before trying to compile Tcl you should do the following things:
|
||||
|
||||
@@ -70,46 +126,16 @@ Before trying to compile Tcl you should do the following things:
|
||||
available now for PCs, Macintoshes, and several flavors of UNIX.
|
||||
Binary releases are much easier to install than source releases.
|
||||
To find out whether a binary release is available for your
|
||||
platform, check the home page for SunScript
|
||||
(http://sunscript.sun.com) under "Tech Corner". Also, check in
|
||||
platform, check the Scriptics Tcl Resource Center
|
||||
(http://www.scriptics.com/resource). Also, check in
|
||||
the FTP directory from which you retrieved the base
|
||||
distribution. Some of the binary releases are available freely,
|
||||
while others are for sale.
|
||||
distribution.
|
||||
|
||||
(b) Make sure you have the most recent patch release. Look in the
|
||||
FTP directory from which you retrieved this distribution to see
|
||||
if it has been updated with patches. Patch releases fix bugs
|
||||
without changing any features, so you should normally use the
|
||||
latest patch release for the version of Tcl that you want.
|
||||
Patch releases are available in two forms. A file like
|
||||
tcl8.0p2.tar.Z is a complete release for patch level 2 of Tcl
|
||||
version 8.0. If there is a file with a higher patch level than
|
||||
this release, just fetch the file with the highest patch level
|
||||
and use it.
|
||||
|
||||
Patches are also available in the form of patch files that just
|
||||
contain the changes from one patch level to another. These
|
||||
files will have names like tcl8.0p1.patch, tcl8.0p2.patch, etc. They
|
||||
may also have .gz or .Z extensions to indicate compression. To
|
||||
use one of these files, you apply it to an existing release with
|
||||
the "patch" program. Patches must be applied in order:
|
||||
tcl8.0p1.patch must be applied to an unpatched Tcl 8.0 release
|
||||
to produce a Tcl 8.0p1 release; tcl8.0p2.patch can then be
|
||||
applied to Tcl8.0p1 to produce Tcl 8.0p2, and so on. To apply an
|
||||
uncompressed patch file such as tcl8.0p1.patch, invoke a shell
|
||||
command like the following from the directory containing this
|
||||
file:
|
||||
patch -p < tcl8.0p1.patch
|
||||
If the patch file has a .gz extension, invoke a command like the
|
||||
following:
|
||||
gunzip -c tcl8.0p1.patch.gz | patch -p
|
||||
If the patch file has a .Z extension, it was compressed with
|
||||
compress. To apply it, invoke a command like the following:
|
||||
zcat tcl8.0p1.patch.Z | patch -p
|
||||
If you're applying a patch to a release that has already been
|
||||
compiled, then before applying the patch you should cd to the
|
||||
"unix" subdirectory and type "make distclean" to restore the
|
||||
directory to a pristine state.
|
||||
|
||||
Once you've done this, change to the "unix" subdirectory if you're
|
||||
compiling under UNIX, "win" if you're compiling under Windows, or
|
||||
@@ -117,154 +143,110 @@ compiling under UNIX, "win" if you're compiling under Windows, or
|
||||
in the README file in that directory for compiling Tcl, installing it,
|
||||
and running the test suite.
|
||||
|
||||
4. Summary of changes in Tcl 8.0
|
||||
4. Summary of changes in Tcl 8.1
|
||||
--------------------------------
|
||||
|
||||
Here are the most significant changes in Tcl 8.0. In addition to these
|
||||
Here are the most significant changes in Tcl 8.1. In addition to these
|
||||
changes, there are several smaller changes and bug fixes. See the file
|
||||
"changes" for a complete list of all changes.
|
||||
|
||||
1. Bytecode compiler. The core of the Tcl interpreter has been
|
||||
replaced with an on-the-fly compiler that translates Tcl scripts to
|
||||
byte codes; a new interpreter then executes the byte codes. In
|
||||
earlier versions of Tcl, strings were used as a universal
|
||||
representation; in Tcl 8.0 strings are replaced with Tcl_Obj
|
||||
structures ("objects") that can hold both a string value and an
|
||||
internal form such as a binary integer or compiled bytecodes. The
|
||||
new objects make it possible to store information in efficient
|
||||
internal forms and avoid the constant translations to and from
|
||||
strings that occurred with the old interpreter. We have not yet
|
||||
converted all of Tcl to take full advantage of the compiler and
|
||||
objects and have not converted any of Tk yet, but even so you
|
||||
should see speedups of 2-3x on many programs and you may see
|
||||
speedups as much as 10-20x in some cases (such as code that
|
||||
manipulates long lists). Future releases should achieve even
|
||||
greater speedups. The compiler introduces only a few minor changes
|
||||
at the level of Tcl scripts, but it introduces many new C APIs for
|
||||
managing objects. See, for example, the manual entries doc/*Obj*.3.
|
||||
1. Internationalization. Tcl has undergone a major revision to
|
||||
support international character sets:
|
||||
|
||||
2. Namespaces. There is a new namespace mechanism based on the
|
||||
namespace implementation by Michael McLennan of Lucent Technologies.
|
||||
This includes new "namespace" and "variable" commands. There are
|
||||
many new C APIs associated with namespaces, but they will not be
|
||||
exported until Tcl 8.1. Note: the syntax of the namespace command
|
||||
has been changed slightly since the b1 release. See the changes
|
||||
file for details.
|
||||
All strings in Tcl are now represented in UTF-8 instead of ASCII,
|
||||
so that Tcl now supports the full Unicode character set. The
|
||||
representation of ASCII characters is unchanged (in UTF-8 anything
|
||||
that looks like an ASCII character is an ASCII character), but
|
||||
characters with the high-order bit set, such as those in ISO-8859,
|
||||
are represented with multi-byte sequences, as are all Unicode
|
||||
characters with values greater than 127. This change does not
|
||||
affect Tcl scripts but it does affect C code that parses strings.
|
||||
Tcl automatically translates between UTF-8 and the normal encoding
|
||||
for the platform during interactions with the system.
|
||||
|
||||
3. Binary I/O. The new object system in Tcl 8.0 supports binary
|
||||
strings (internally, strings are counted in addition to being null
|
||||
terminated). There is a new "binary" command for inserting and
|
||||
extracting data to/from binary strings. Commands such as "puts",
|
||||
"gets", and "read" commands now operate correctly on binary data.
|
||||
There is a new variable tcl_platform(byteOrder) to identify the
|
||||
native byte order for the current host.
|
||||
In Tcl scripts the backslash sequence \u can be used to enter
|
||||
16-bit Unicode characters. \o and \x generate only 8-bit
|
||||
characters as before.
|
||||
|
||||
4. Random numbers. The "expr" command now contains a random number
|
||||
generator, which can be accessed via the "rand()" and "srand()" math
|
||||
functions.
|
||||
There is a new "encoding" command that allows scripts to determine
|
||||
what encodings are available as well as to convert strings between
|
||||
different encodings. The fconfigure command now supports a
|
||||
-encoding option for specifying the encoding of an open file or
|
||||
socket. Tcl will automatically translate between the specified
|
||||
encoding and UTF-8 during I/O.
|
||||
|
||||
5. Safe-Tcl enhancements. There is a new "hidden command"
|
||||
mechanism, implemented with the Tcl commands "interp hide", "interp
|
||||
expose", "interp invokehidden", and "interp hidden" and the C APIs
|
||||
Tcl_HideCommand and Tcl_ExposeCommand. There is now support for
|
||||
safe packages and extension loading, including new library
|
||||
procedures such as safe::interpCreate (see the manual entry safe.n
|
||||
for details).
|
||||
There are several new C APIs that support UTF-8 and various
|
||||
encodings. See the manual entry Utf.3 for procedures that
|
||||
translate between Unicode and UTF-8 and manipulate UTF-8 strings.
|
||||
See Encoding.3 for procedures that create new encodings and
|
||||
translate between encodings. See ToUpper.3 for procedures that
|
||||
perform case conversions on UTF-8 strings.
|
||||
|
||||
6. There is a new package "registry" available under Windows for
|
||||
accessing the Windows registry.
|
||||
2. Binary data. Binary data is handled differently in Tcl 8.1
|
||||
than in Tcl 8.0. Tcl 8.1 uses the UTF-8 facilities to represent
|
||||
binary data: the character value zero is represented with a
|
||||
multi-byte sequence, so that (once again) strings in Tcl 8.1 never
|
||||
contain null bytes. This means that binary data is now accepted
|
||||
everywhere in Tcl and Tk (in Tcl 8.0 the support for binary data
|
||||
was incomplete). If you have C code that needs to manipulate the
|
||||
bytes of binary data (as opposed to just passing the data through)
|
||||
you should use a new object type called "byte array". See the
|
||||
manual entry ByteArrObj.3 for information about procedures such as
|
||||
Tcl_GetByteArrayFromObj.
|
||||
|
||||
7. There is a new command "file attributes" for getting and setting
|
||||
things like permissions and owner. There is also a new command
|
||||
"file nativename" for getting back the platform-specific name for a
|
||||
particular file.
|
||||
3. Regular expressions. Tcl 8.1 contains a brand new
|
||||
implementation of regular expressions from Henry Spencer. The
|
||||
regular expression syntax has been greatly expanded to include
|
||||
most of the features in Perl. In addition, the regexp engine
|
||||
supports Unicode and binary data. See the doc/regexp.n manual
|
||||
entry for more details.
|
||||
|
||||
8. There is a new "fcopy" command to copy data between channels.
|
||||
This replaces and improves upon the not-so-secret unsupported old
|
||||
command "unsupported0".
|
||||
4. Threads. If configured with the --enable-threads flag, Tcl can
|
||||
now be compiled for use in a multi-threaded application.
|
||||
Individual threads are allowed to use one or more interpreters as
|
||||
long as each interpreter (and any slave interpreters) is only
|
||||
accessed by one thread. Each thread runs its own event loop, and
|
||||
you can post events to other threads. There are new C APIs for
|
||||
mutexes, condition variables, and thread local storage. See the
|
||||
doc/Thread.3 manual entry for more details. Tk 8.1 is not yet
|
||||
multi-thread safe. There is not yet support for tcl level use of
|
||||
threading except for a test command. (Compile tcltest and try
|
||||
testthread.)
|
||||
|
||||
9. There is a new package "http" for doing GET, POST, and HEAD
|
||||
requests via the HTTP/1.0 protocol. See the manual entry http.n
|
||||
for details.
|
||||
5. Message catalog. There is a new message catalog package which makes
|
||||
it easy to localize the strings in a script. See the doc/msgcat.n
|
||||
manual entry for more details.
|
||||
|
||||
10. There are new library procedures for finding word breaks in
|
||||
strings. See the manual entry library.n for details.
|
||||
6. Stubbs library for building extensions. There is now a new
|
||||
way to build extensions for Tcl. Instead of linking with the
|
||||
tcl shared library you can now link to a stubs library that gets
|
||||
built in this release. By linking with the stubs library it
|
||||
is possible to use dynamically loaded extensions in staticlly
|
||||
built applications. It will also be possible for some extensions
|
||||
to work for both Tcl 8.0 & 8.1 with out having to recompile.
|
||||
|
||||
11. There are new C APIs Tcl_Finalize (for cleaning up before
|
||||
unloading the Tcl DLL) and Tcl_Ungets for pushing bytes back into a
|
||||
channel's input buffer.
|
||||
5. Development tools
|
||||
--------------------
|
||||
|
||||
12. Tcl now supports serial I/O devices on Windows and Unix, with a
|
||||
new fconfigure -mode option. The Windows driver does not yet
|
||||
support event-driven I/O.
|
||||
A high quality set of commercial development tools is now available to
|
||||
accelerate your Tcl application development. Scriptics' TclPro
|
||||
product provides a debugger, static code checker, packaging utility,
|
||||
and bytecode compiler. Visit the Scriptics Web site at:
|
||||
|
||||
13. The lsort command has new options -dictionary and -index. The
|
||||
-index option allows for very rapid sorting based on an element
|
||||
of a list.
|
||||
http://www.scriptics.com/tclpro
|
||||
|
||||
14. The event notifier has been completely rewritten (again). It
|
||||
should now allow Tcl to use an external event loop (like Motif's)
|
||||
when it is embedded in other applications. No script-level
|
||||
interfaces have changed, but many of the C APIs have.
|
||||
for more information on TclPro and for a free 30-day evaluation
|
||||
download.
|
||||
|
||||
Tcl 8.0 introduces the following incompatibilities that may affect Tcl
|
||||
scripts that worked under Tcl 7.6 and earlier releases:
|
||||
6. Tcl newsgroup
|
||||
----------------
|
||||
|
||||
1. Variable and command names may not include the character sequence
|
||||
"::" anymore: this sequence is now used as a namespace separator.
|
||||
There is a network news group "comp.lang.tcl" intended for the
|
||||
exchange of information about Tcl, Tk, and related applications. The
|
||||
newsgroup is a greata place to ask general information questions. For
|
||||
bug reports, please see the "Support and bug fixes" section below.
|
||||
|
||||
2. The semantics of some Tcl commands have been changed slightly to
|
||||
maximize performance under the compiler. These incompatibilities
|
||||
are documented on the Web so that we can keep the list up-to-date.
|
||||
See the URL http://www.sunlabs.com/research/tcl/compiler.html.
|
||||
|
||||
3. 2-digit years are now parsed differently by the "clock" command
|
||||
to handle year 2000 issues better (years 00-38 are treated as
|
||||
2000-2038 instead of 1900-1938).
|
||||
|
||||
4. The old Macintosh commands "cp", "mkdir", "mv", "rm", and "rmdir"
|
||||
are no longer supported; all of these features are now available on
|
||||
all platforms via the "file" command.
|
||||
|
||||
5. The variable tcl_precision is now shared between interpreters
|
||||
and defaults to 12 digits instead of 6; safe interpreters cannot
|
||||
modify tcl_precision. The new object system in Tcl 8.0 causes
|
||||
floating-to-string conversions (and the associated rounding) to
|
||||
occur much less often than in Tcl 7.6, which can sometimes cause
|
||||
behavioral changes.
|
||||
|
||||
6. The C APIs associated with the notifier have changed substantially.
|
||||
|
||||
7. The procedures Tcl_CreateModalTimeout and Tcl_DeleteModalTimeout
|
||||
have been removed.
|
||||
|
||||
8. Tcl_CreateFileHandler and Tcl_DeleteFileHandler now take Unix
|
||||
fd's and are only supported on the Unix platform
|
||||
|
||||
9. The C APIs for creating channel drivers have changed as part of
|
||||
the new notifier implementation. The Tcl_File interfaces have been
|
||||
removed. Tcl_GetChannelFile has been replaced with
|
||||
Tcl_GetChannelHandle. Tcl_MakeFileChannel now takes a platform-
|
||||
specific file handle. Tcl_DriverGetOptionProc procedures now take
|
||||
an additional interp argument.
|
||||
|
||||
5. Tcl newsgroup
|
||||
-----------------
|
||||
|
||||
There is a network news group "comp.lang.tcl" intended for the exchange
|
||||
of information about Tcl, Tk, and related applications. Feel free to use
|
||||
the newsgroup both for general information questions and for bug reports.
|
||||
We read the newsgroup and will attempt to fix bugs and problems reported
|
||||
to it.
|
||||
|
||||
When using comp.lang.tcl, please be sure that your e-mail return address
|
||||
is correctly set in your postings. This allows people to respond directly
|
||||
to you, rather than the entire newsgroup, for answers that are not of
|
||||
general interest. A bad e-mail return address may prevent you from
|
||||
getting answers to your questions. You may have to reconfigure your news
|
||||
reading software to ensure that it is supplying valid e-mail addresses.
|
||||
|
||||
6. Tcl contributed archive
|
||||
7. Tcl contributed archive
|
||||
--------------------------
|
||||
|
||||
Many people have created exciting packages and applications based on Tcl
|
||||
@@ -275,30 +257,30 @@ in the directory "/pub/tcl". The archive also contains several FAQ
|
||||
("frequently asked questions") documents that provide solutions to problems
|
||||
that are commonly encountered by TCL newcomers.
|
||||
|
||||
7. Mailing lists
|
||||
8. Tcl Resource Center
|
||||
----------------------
|
||||
|
||||
Visit http://www.scriptics.com/resource/ to see an annotated index of
|
||||
many Tcl resources available on the World Wide Web. This includes
|
||||
papers, books, and FAQs, as well as development tools, extensions,
|
||||
applications, binary releases, and patches. You can also recommend
|
||||
additional URLs for the resource center using the forms labeled "Add a
|
||||
Resource".
|
||||
|
||||
9. Mailing lists
|
||||
----------------
|
||||
|
||||
A couple of Mailing List have been set up to discuss Macintosh or
|
||||
Windows related Tcl issues. In order to use these Mailing Lists you
|
||||
must have access to the internet. If you have access to the WWW the
|
||||
home pages for these mailing lists are located at the following URLs:
|
||||
|
||||
http://www.sunlabs.com/research/tcl/lists/mactcl-list.html
|
||||
|
||||
-and-
|
||||
|
||||
http://www.sunlabs.com/research/tcl/lists/wintcl-list.html
|
||||
|
||||
The home pages contain information about the lists and an HTML archive
|
||||
of all the past messages on the list. To subscribe send a message to:
|
||||
Windows related Tcl issues. To subscribe send a message to:
|
||||
|
||||
listserv@sunlabs.sun.com
|
||||
wintcl-request@tclconsortium.org
|
||||
mactcl-request@tclconsortium.org
|
||||
|
||||
In the body of the message (the subject will be ignored) put:
|
||||
|
||||
subscribe mactcl Joe Blow
|
||||
subscribe mactcl Joe Smith
|
||||
|
||||
Replacing Joe Blow with your real name, of course. (Use wintcl
|
||||
Replacing Joe Smith with your real name, of course. (Use wintcl
|
||||
instead of mactcl if your interested in the Windows list.) If you
|
||||
would just like to receive more information about the list without
|
||||
subscribing put the line:
|
||||
@@ -307,42 +289,65 @@ subscribing put the line:
|
||||
|
||||
in the body instead (or wintcl).
|
||||
|
||||
8. Support and bug fixes
|
||||
------------------------
|
||||
10. Support and bug fixes
|
||||
-------------------------
|
||||
|
||||
We're very interested in receiving bug reports and suggestions for
|
||||
improvements. We prefer that you send this information to the
|
||||
comp.lang.tcl newsgroup rather than to any of us at Sun. We'll see
|
||||
anything on comp.lang.tcl, and in addition someone else who reads
|
||||
comp.lang.tcl may be able to offer a solution. The normal turn-around
|
||||
time for bugs is 3-6 weeks. Enhancements may take longer and may not
|
||||
happen at all unless there is widespread support for them (we're
|
||||
trying to slow the rate at which Tcl turns into a kitchen sink). It's
|
||||
very difficult to make incompatible changes to Tcl at this point, due
|
||||
to the size of the installed base.
|
||||
Scriptics is very interested in receiving bug reports, patches, and
|
||||
suggestions for improvements. We prefer that you send this
|
||||
information to us via the bug form on the Scriptics Web site, rather
|
||||
than emailing us directly. The bug form is at:
|
||||
|
||||
http://www.scriptics.com/support/bugForm.html
|
||||
|
||||
The bug form was designed to give uniform structure to bug reports as
|
||||
well as to solicit enough information to minimize followup questions.
|
||||
The bug form also includes an option to automatically post your report
|
||||
on comp.lang.tcl. We strongly recommend that you select this option
|
||||
because someone else who reads comp.lang.tcl may be able to offer a
|
||||
solution.
|
||||
|
||||
When reporting bugs, please provide full information about the Tcl/Tk
|
||||
version and the platform on which you are running Tcl/Tk. Also,
|
||||
please include a short tclsh script that we can use to reproduce the
|
||||
bug. Make sure that the script runs with a bare-bones tclsh and
|
||||
doesn't depend on any extensions or other programs, particularly those
|
||||
that exist only at your site. Also, please include three additional
|
||||
pieces of information with the script:
|
||||
|
||||
When reporting bugs, please provide a short tclsh script that we can
|
||||
use to reproduce the bug. Make sure that the script runs with a
|
||||
bare-bones tclsh and doesn't depend on any extensions or other
|
||||
programs, particularly those that exist only at your site. Also,
|
||||
please include three additional pieces of information with the
|
||||
script:
|
||||
(a) how do we use the script to make the problem happen (e.g.
|
||||
what things do we click on, in what order)?
|
||||
(b) what happens when you do these things (presumably this is
|
||||
undesirable)?
|
||||
(c) what did you expect to happen instead?
|
||||
|
||||
The Tcl community is too large for us to provide much individual
|
||||
support for users. If you need help we suggest that you post questions
|
||||
to comp.lang.tcl. We read the newsgroup and will attempt to answer
|
||||
esoteric questions for which no-one else is likely to know the answer.
|
||||
In addition, Tcl support and training are available commercially from
|
||||
NeoSoft (info@neosoft.com), Computerized Processes Unlimited
|
||||
(gwl@cpu.com), and Data Kinetics (education@dkl.com).
|
||||
We will log and follow-up on each bug, although we cannot promise a
|
||||
specific turn-around time. Enhancements may take longer and may not
|
||||
happen at all unless there is widespread support for them (we're
|
||||
trying to slow the rate at which Tcl/Tk turns into a kitchen sink).
|
||||
It's very difficult to make incompatible changes to Tcl/Tk at this
|
||||
point, due to the size of the installed base.
|
||||
|
||||
9. Tcl version numbers
|
||||
----------------------
|
||||
The Tcl community is too large for us to provide much individual
|
||||
support for users. If you need help we suggest that you post
|
||||
questions to comp.lang.tcl. We read the newsgroup and will attempt to
|
||||
answer esoteric questions for which no-one else is likely to know the
|
||||
answer. In addition, Tcl/Tk support and training are available
|
||||
commercially from Scriptics at:
|
||||
|
||||
http://www.scriptics.com/training
|
||||
|
||||
Also see the following Web site for links to other organizations that
|
||||
offer Tcl/Tk training:
|
||||
|
||||
http://www.scriptics.com/resource/commercial/training
|
||||
|
||||
11. Tcl version numbers
|
||||
-----------------------
|
||||
|
||||
You can test the current version of Tcl by examining the
|
||||
tcl_version and tcl_patchLevel variables. The tcl_patchLevel
|
||||
variable follows the naming rules outlined below (e.g., 8.0.5).
|
||||
The tcl_version just has the major.minor numbers in it (e.g., 8.0)
|
||||
|
||||
Each Tcl release is identified by two numbers separated by a dot, e.g.
|
||||
6.7 or 7.0. If a new release contains changes that are likely to break
|
||||
@@ -375,7 +380,22 @@ incompatibility. Once the official release is made then there won't
|
||||
be any more incompatibilities until the next release with a new major
|
||||
version number.
|
||||
|
||||
Patch releases have a suffix such as p1 or p2. These releases contain
|
||||
bug fixes only. A patch release (e.g Tcl 7.6p2) should be completely
|
||||
compatible with the base release from which it is derived (e.g. Tcl
|
||||
7.6), and you should normally use the highest available patch release.
|
||||
(Note: This compatibility is true for Tcl scripts, but historically
|
||||
the Tcl C APIs have changed enough between releases that you may need
|
||||
to work a bit to upgrade extensions.)
|
||||
|
||||
Patch releases now have a suffix such as ".4" or ".5". Prior to
|
||||
version 8.0.3, patch releases had the suffix "p1" or "p2". So, the
|
||||
8.0 release went to 8.0p1, 8.0p2, 8.0.3, 8.0.4, and 8.0.5. The alphas
|
||||
and betas continue to use the 'a' and 'b' letters in their
|
||||
tcl_patchLevel. Patch releases normally contain bug fixes only. A
|
||||
patch release (e.g Tcl 8.0.5) should be completely compatible with the
|
||||
base release from which it is derived (e.g. Tcl 8.0), and you should
|
||||
normally use the highest available patch release.
|
||||
|
||||
12. Thank You
|
||||
-------------
|
||||
|
||||
We'd like to express our thanks to the Tcl community for all the
|
||||
helpful suggestions, bug reports, and patches we have received.
|
||||
Tcl/Tk has improved vastly and will continue to do so with your help.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Recent user-visible changes to Tcl:
|
||||
|
||||
SCCS: @(#) changes 1.338 97/11/25 08:30:52
|
||||
RCS: @(#) $Id: changes,v 1.1.2.22 1999/03/15 16:20:30 hershey Exp $
|
||||
|
||||
1. No more [command1] [command2] construct for grouping multiple
|
||||
commands on a single command line.
|
||||
@@ -2547,7 +2547,7 @@ changes are to expressions and lists.
|
||||
incorrect programs that took advantage of behavior of the old
|
||||
implementation that was not documented in the man pages.
|
||||
Other changes to Tcl scripts are discussed in the web page at
|
||||
http://www.sunlabs.com/research/tcl/compiler.html. (BL)
|
||||
http://www.scriptics.com/doc/compiler.html. (BL)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
10/21/96 (new feature) In earlier versions of Tcl, strings were used as a
|
||||
@@ -3115,7 +3115,7 @@ activity. A refcount bug triggered a panic in Tcl_ListObjAppendElement. (BW)
|
||||
|
||||
7/8/97 (bug fix) Relaxed the pattern matching on http_get so you do not
|
||||
need a trailing path component. You can now get away with just
|
||||
http_get sunscript.sun.com (BW)
|
||||
http_get www.scriptics.com (BW)
|
||||
|
||||
7/9/97 (bug fix) Creating anonymous interpreters no longer smashes existing
|
||||
commands with names similar to the generated name. Previously creating an
|
||||
@@ -3451,3 +3451,747 @@ Universal Headers V.3.0, so that Tcl will compile with CW Pro 2.
|
||||
-gmt flag set. Thanks to Jan Nijtmans for reporting the problem. (RJ)
|
||||
|
||||
----------------- Released 8.0p2, 11/25/97 -----------------------
|
||||
|
||||
12/3/97 (bug fix/optimization) Removed uneeded and potentially dangerous
|
||||
instances of double evaluations if "if" and "expr" statements from
|
||||
the library files. It is recommended that unless you need a double
|
||||
evaluation you always use "expr {...}" instead of "expr ..." and
|
||||
"if {...} ..." instead of "if ... ...". It will also be faster
|
||||
thanks to the byte compiler. (DL)
|
||||
|
||||
---- Shipped as part of the plugin2.0b5 as 8.0p2Plugin1, Dec 8th 97 ----
|
||||
|
||||
12/8/97 (bug fix) Need to protect the newly accepted channel in an
|
||||
accept callback on a socket, otherwise the callback may close it and
|
||||
cause an error, which would cause the C code to attempt to close the
|
||||
now deleted channel. Bumping the refcount assures that the channel sticks
|
||||
around to be really closed in this case. (JL)
|
||||
|
||||
12/8/97 (bug fix) Need to protect the channel in a fileevent so that it
|
||||
is not deleted before the fileevent handler returns. (CS, JL)
|
||||
|
||||
12/18/97 (bug fix) In the opt argument parsing package: if the description
|
||||
had only flags, the "too many arguments" case was not detected. The default
|
||||
value was not used for the special "args" ending argument. (DL)
|
||||
|
||||
1/15/98 (improvement) Moved common part of initScript in common file.
|
||||
Moved windows specific initialization to init.tcl so you can initialize
|
||||
Tcl in windows without having to call Tcl_Init which is now only
|
||||
searching for init.tcl {back ported from 8.1}. (DL)
|
||||
|
||||
---- Shipped as part of the plugin as 8.0p2Plugin2, Jan 15th 98 ----
|
||||
|
||||
5/27/98 (bug fix) Windows socket driver did not notice new data arriving
|
||||
on nonblocking sockets until the event loop was entered. (SS)
|
||||
|
||||
5/27/98 (bug fix) Windows socket driver used FIONREAD, which is not
|
||||
supported correctly by WinSock. (SS)
|
||||
|
||||
6/9/98 (bug fix) Generic channel code failed to report readable file
|
||||
events on buffered data that was left behind by a gets or read that
|
||||
did not consume all available data. (SS)
|
||||
|
||||
6/18/98 (bug fix) Compilation of loop expressions was too aggressive
|
||||
and incorrectly inlined non-literal expressions. (SS)
|
||||
|
||||
6/18/98 (bug fix) "info var" and "info locals" incorrectly reported
|
||||
the existence of compiler temporary variables. (SS)
|
||||
|
||||
6/18/98 (bug fix) Dictionary sorting used signed character
|
||||
comparisons. (SS)
|
||||
|
||||
6/18/98 (bug fix) Compile procs corrupted the exception stack in some
|
||||
cases. (SS)
|
||||
|
||||
6/18/98 (bug fix) Array set had erratic behavior when initializing a
|
||||
variable from an empty value list. (SS)
|
||||
|
||||
6/18/98 (bug fix) The Windows registry package had a bad bounds check
|
||||
that could lead to a crash. (SS)
|
||||
|
||||
6/18/98 (bug fix) The foreach compile proc did not correctly handle
|
||||
non-local variable references. (SS)
|
||||
|
||||
6/25/98 (new features) Added name resolution hooks to support [incr Tcl].
|
||||
There are new internal Tcl_*Resolver* APIs to add, query and remove the hooks.
|
||||
With this changes it should be possible to dynamically load [incr Tcl]
|
||||
as an extension. (MM)
|
||||
|
||||
7/1/97 (bug fix) The commands "info args, body, default, procs" did
|
||||
not correctly handle imported procedures. (RJ)
|
||||
|
||||
7/6/98 (improvement) pkg_mkIndex now implements the "package require"
|
||||
command. This makes it possible to create index files for packages
|
||||
that require another package and then execute code from that package in
|
||||
their file. Previously, this would throw an error because the required
|
||||
package had not been loaded. The -nopkgrequied flag is provided to
|
||||
revert back to the old functionality. (EMS)
|
||||
|
||||
7/6/98 (improvement) back-ported the -direct flag from 8.1 into
|
||||
pkg_mkIndex. This results in pkgIndex.tcl files that contain direct
|
||||
source or load commands instead of tclPkgSetup commands. (EMS)
|
||||
|
||||
7/6/98 (improvement) made changes to the AuxData items structures to support
|
||||
storage of compiled scripts on disk. Also some related minor changes in
|
||||
the compilation and execution engine. (EMS)
|
||||
|
||||
6/4/98 (enhancement) Added new internal routines to support inserting
|
||||
and deleting from the stat, access, and open-file-channel mechanisms.
|
||||
TclAccessInsertProc, TclStatInsertProc, & TclOpenFileChannelInsertProc
|
||||
insert pointers to such routines; TclAccessDeleteProc, TclStatDeleteProc,
|
||||
& TclOpenFileChannelDeleteProc delete pointers to such routines. See
|
||||
the file generic/tclIOUtils.c for more details. (SKS)
|
||||
|
||||
7/1/98 (enhancement) Added a new internal C variable
|
||||
tclPreInitScript. This is a pointer to a string that may hold an
|
||||
initialization script; If this pointer is non-NULL it is evaluated in
|
||||
Tcl_Init() prior to the built-in initialization script defined in the
|
||||
file generic/tclInitScript.h. (SKS)
|
||||
|
||||
7/6/98 (bug fix) Removed dead code in PlatformInitExitHandler so that
|
||||
the TCL_LIBRARY value can be safely patched in binaries. (BW)
|
||||
|
||||
7/24/98 (enhancement) Incorporated a new version of auto_mkindex that
|
||||
can support the [incr Tcl] class structures. This version will index
|
||||
all procedures in a source file, not just those where "proc" starts
|
||||
at the beginning of the line. If you want the old behavior, use the
|
||||
auto_mkindex_old procedure. (MM)
|
||||
|
||||
7/24/98 (feature change) Changed the Windows registry key to be
|
||||
HKEY_LOCAL_MACHINE\Software\Scriptics\Tcl\8.0, and to store the path
|
||||
in the default value instead of "Root". Also, this key can be
|
||||
specified at compile time in case Tcl is being used in a different
|
||||
context where it needs an alternate library path from the standard Tcl
|
||||
installation. (SS)
|
||||
|
||||
7/24/98 (feature change) Changed the search order for init.tcl. The
|
||||
tcl_library variable can now be set before calling Tcl_Init to avoid
|
||||
doing any searches. If it isn't set, then Tcl checks
|
||||
env(TCL_LIBRARY), the static value set at compile time, an install
|
||||
directory relative to the executable, a source directory relative to
|
||||
the executable, and a tcl directory relative to the source heirarchy
|
||||
containing the executable. See the comment at the top of
|
||||
generic/tclInitScript.h for more details. (SS)
|
||||
|
||||
7/27/98 (config change) Changed the use of the DBGX flag in configure.in
|
||||
and the makefile to be TCL_DBGX. Users of tclConfig.sh may need to pass
|
||||
this through their configure files with AC_SUBST. (BW)
|
||||
|
||||
729/98 (bug fix) Changed [info body] to return a copy of the body of a
|
||||
compiled procedure instead of the body itself, to avoid invalidation
|
||||
of the internal rep and loss of the byte-codes. (EMS)
|
||||
|
||||
8/5/98 (bug fix) The platform init code could walk off the end of a
|
||||
buffer when reading the PkgPath registry value on Windows. (SS)
|
||||
|
||||
8/5/98 (Windows makefile change) Introduced a set of macros to deal with
|
||||
exporting symbols when compiling DLLS on Windows. See win/README for
|
||||
details. (EMS)
|
||||
|
||||
8/5/98 (addendum) Added a second Windows registry key under
|
||||
HKEY_LOCAL_MACHINE\Software\Scriptics\Tcl\8.0, named "pkgPath".
|
||||
This is a multi-string value used to initialize the tcl_pkgPath
|
||||
variable. This is required if extension DLLs are in architecture specific
|
||||
subdirectories. (SS)
|
||||
|
||||
8/6/98 (new feature) Added tcl_findLibrary to init.tcl for use by
|
||||
extensions, including Tk. This searches in a canonical way for
|
||||
an extensions library directory and initialization file. (BW)
|
||||
|
||||
8/10/98 (bug fix) Imported commands used to get lost if the target
|
||||
of the import was redefined. Tcl_CreateCommand and Tcl_CreateObjCommand
|
||||
were updated to restore import links. (Note that if you rename a command,
|
||||
the import links move to the new name, and if you delete a command then
|
||||
the import links get lost. These semantics have not changed.) (MC)
|
||||
|
||||
-------- Released 8.0.3 to the Tcl Consortium CD-ROM project, 8/10/98 ------
|
||||
|
||||
9/3/98 (bug fix) Tcl_Realloc was failing under Windows because the
|
||||
GlobalReAlloc API was not correctly re-allocating blocks that were
|
||||
32k+. The fix was to use newer Win32 APIs (HeapAlloc, HeapFree, and
|
||||
HeapReAlloc.) (BS)
|
||||
|
||||
10/5/98 (bug fix) Fixed bug in pkg_mkIndex that caused some files that do
|
||||
a "package require" of packages in the Tcl libraries to give a warning like
|
||||
warning: "xx.tcl" provides more than one package ({xx 2.0} {yy 0.3})
|
||||
and generate a broken pkgIndex.tcl file. (EMS)
|
||||
|
||||
10/5/98 (bug fix) Pkg_mkIndex was not doing a case-insensitive comparison
|
||||
of extensions to determine whether to load or source a file. Thus, under
|
||||
Windows, MYDLLNAME.DLL was sourced, and mydllname.dll loaded. (EMS)
|
||||
|
||||
10/5/98 (new feature) Created a new Tcl_Obj type, "procbody". This object's
|
||||
internal representation holds a pointer to a Proc structure. Extended
|
||||
TclCreateProc to take both strings and "procbody". (EMS)
|
||||
|
||||
10/13/98 (bug fix) The "info complete" command can now handle strings
|
||||
with NULLs embedded. Thanks to colin@field.medicine.adelaide.edu.au
|
||||
for providing this fix. (RJ)
|
||||
|
||||
10/13/98 (bug fix) The "lsort -dictionary" command did not properly
|
||||
handle some numbers starting with 0. Thanks to Richard Hipp
|
||||
<drh@acm.org> for submitting the fix to Scriptics. (RJ)
|
||||
|
||||
10/13/98 (bug fix) The function Tcl_SetListObj was creating an invalid
|
||||
Tcl_Obj if the list had zero elements (despite what the comments said
|
||||
it would do). Thanks to Sebastian Wangnick for reporting the
|
||||
problem. (RJ)
|
||||
|
||||
10/20/98 (new feature) Added tcl_platform(debug) element to the
|
||||
tcl_platform array on Windows platform. The existence of the debug
|
||||
element of the tcl_platform array indicates that the particular Tcl
|
||||
shell has been compiled with debug information. Using
|
||||
"info exists tcl_platform(debug)" a Tcl script can direct the
|
||||
interpreter to load debug versions of DLLs with the load
|
||||
command. (SKS)
|
||||
|
||||
10/20/98 (feature change) The Makefile and configure scripts have been
|
||||
changed for IRIX to build n32 binaries instead of the old 32 abi
|
||||
format. If you have extensions built with the o32 abi's you will need
|
||||
to update them to n32 for them to work with Tcl. (RJ)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
10/23/98 (bug fix) tcl_findLibrary had a stray ] in one of the
|
||||
pathnames it searched for the initialization script. tclInitScript.h
|
||||
was incorrectly adding the parent of tcl_library to tcl_pkgPath. This
|
||||
logic was moved into init.tcl, and the initialization of auto_path was
|
||||
documented. Thanks to Donald Porter and Tom Silva for related
|
||||
patches. (BW)
|
||||
|
||||
10/29/98 (bug fix) Fixed Tcl_NotifyChannel to use Tcl_Preserve instead
|
||||
of Tcl_RegisterChannel so that 1) unregistered channels do not get
|
||||
closed after their first fileevent, and 2) errors that occur during
|
||||
close in a fileevent script are actually reflected by the close
|
||||
command. (BW)
|
||||
|
||||
10/30/98 (bug fix) Overhaul of pkg_mkIndex to deal with transitive
|
||||
package requires and packages split among scripts and binary files.
|
||||
Also fixed ommision of global for errorInfo in tcl_findLibrary. (BW)
|
||||
|
||||
11/08/98 (bug fix) Fixed the resource command to always detect
|
||||
the case where a file is opened a second time with the same
|
||||
permissions. IM claims that this will always cause the same
|
||||
FileRef to be returned, but in MacOS 8.1+, this is no longer the case,
|
||||
so we have to test for this explicitly. (JI)
|
||||
|
||||
11/10/98 (feature change) When compiling with Metrowerk's MSL, use the
|
||||
exit function from MSL rather than ExitToShell. This allows MSL to
|
||||
clean up its temporary files. Thanks to Vince Darley for this
|
||||
improvement. (JI)
|
||||
|
||||
----------------- Released 8.0.4, 11/19/98 -------------------------
|
||||
|
||||
11/20/98 (bug fix) Handle possible NULL return in TclGetStdFiles. (RJ)
|
||||
|
||||
11/20/98 (bug fix) The dltests would not build on SGI. They reported
|
||||
that you could not mix n32 with 032 binaries. The configure script
|
||||
has been modified to get the EXTRA_CFLAGS from the tcl configure
|
||||
script. [Bug id: 840] (RJ)
|
||||
|
||||
12/3/98 (bug fix) Windows NT creates sockets so they are inheritable
|
||||
by default. Fixed socket code so it turns off this bit right after
|
||||
creation so sockets aren't kept open by exec'ed processes. [Bug: 892]
|
||||
Thanks to Kevin Kenny for this fix. (SS)
|
||||
|
||||
1/11/98 (bug fix) On HP, "info sharedlibextension" was returning
|
||||
empty string on static apps. It now always returns ".sl". (RJ)
|
||||
|
||||
1/28/99 (configure change) Now support -pipe option on gcc. (RJ)
|
||||
|
||||
2/2/99 (bug fix) Fixed initialization problem on Windows where no
|
||||
searching for init.tcl would be performed if the registry keys were
|
||||
missing. (stanton)
|
||||
|
||||
2/2/99 (bug fix) Added support for HKEY_PERFORMANCE_DATA and
|
||||
HKEY_DYN_DATA keys in the "registry" command. (stanton)
|
||||
|
||||
2/2/99 (bug fix) ENOTSUP and EOPNOTSUPP clashed on some Linux
|
||||
variants. (stanton)
|
||||
|
||||
2/2/99 (enhancement) The "open" command has been changed to use the
|
||||
object interfaces. (stanton)
|
||||
|
||||
2/2/99 (bug fix) In some cases Tcl would crash due to an overflow of
|
||||
the exception stack resulting from a missing byte code in some
|
||||
expressions. (stanton)
|
||||
|
||||
2/2/99 (bug fix) Changed configure so Linux and IRIX shared libraries
|
||||
are linked with the system libraries. (stanton)
|
||||
|
||||
2/2/99 (bug fix) Added support for BSDI 4.x (BSD/OS-4*) to the
|
||||
configure script. (stanton)
|
||||
|
||||
2/2/99 (bug fix) Fixed bug where upvar could resurrect a namespace
|
||||
variable after the namespace had been deleted. (stanton)
|
||||
|
||||
2/2/99 (bug fix) In some cases when creating variables, the
|
||||
interpreter result was being modified even if the TCL_LEAVE_ERR_MSG
|
||||
flag was set. (stanton)
|
||||
|
||||
2/2/99 (bug fix & new feature) Changed the socket drivers to properly
|
||||
handle failures during an async socket connection. Added a new
|
||||
fconfigure option "-error" to retrieve the failure message. See the
|
||||
socket.n manual entry for details. (stanton)
|
||||
|
||||
2/2/99 (bug fix) Deleting a renamed interp alias could result in a
|
||||
panic. (stanton)
|
||||
|
||||
2/2/99 (feature change/bug fix) Changed the behavior of "file
|
||||
extension" so that it splits at the last period. Now the extension of
|
||||
a file like "foo..o" is ".o" instead of "..o" as in previous versions.
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
----------------- Released 8.0.5, 3/9/99 -------------------------
|
||||
|
||||
======== Changes for 8.0 go above this line ========
|
||||
======== Changes for 8.1 go below this line ========
|
||||
|
||||
6/18/97 (new feature) Tcl now supports international character sets:
|
||||
- All C APIs now accept UTF-8 strings instead of iso8859-1 strings,
|
||||
wherever you see "char *", unless explicitly noted otherwise.
|
||||
- All Tcl strings represented in UTF-8, which is a convenient
|
||||
multi-byte encoding of Unicode. Variable names, procedure names,
|
||||
and all other values in Tcl may include arbitrary Unicode characters.
|
||||
For example, the Tcl command "string length" returns how many
|
||||
Unicode characters are in the argument string.
|
||||
- For Java compatibility, embedded null bytes in C strings are
|
||||
represented as \xC080 in UTF-8 strings, but the null byte at the end
|
||||
of a UTF-8 string remains \0. Thus Tcl strings once again do not
|
||||
contain null bytes, except for termination bytes.
|
||||
- For Java compatibility, "\uXXXX" is used in Tcl to enter a Unicode
|
||||
character. "\u0000" through "\uffff" are acceptable Unicode
|
||||
characters.
|
||||
- "\xXX" is used to enter a small Unicode character (between 0 and 255)
|
||||
in Tcl.
|
||||
- Tcl automatically translates between UTF-8 and the normal encoding for
|
||||
the platform during interactions with the system.
|
||||
- The fconfigure command now supports a -encoding option for specifying
|
||||
the encoding of an open file or socket. Tcl will automatically
|
||||
translate between the specified encoding and UTF-8 during I/O.
|
||||
See the directory library/encoding to find out what encodings are
|
||||
supported (eventually there will be an "encoding" command that
|
||||
makes this information more accessible).
|
||||
- There are several new C APIs that support UTF-8 and various encodings.
|
||||
See Utf.3 for procedures that translate between Unicode and UTF-8
|
||||
and manipulate UTF-8 strings. See Encoding.3 for procedures that
|
||||
create new encodings and translate between encodings. See
|
||||
ToUpper.3 for procedures that perform case conversions on UTF-8
|
||||
strings.
|
||||
|
||||
9/18/97 (enhancement) Literal objects are now shared by the ByteCode
|
||||
structures created when compiled different scripts. This saves up to 45%
|
||||
of the total memory needed for all literals. (BL)
|
||||
|
||||
9/24/97 (bug fixes) Fixed Tcl_ParseCommand parsing of backslash-newline
|
||||
sequences at start of command words. Suppressed Tcl_EvalDirect error logging
|
||||
if non-TCL_OK result wasn't an error. (BL)
|
||||
|
||||
10/17/97 (feature enhancement) "~username" now refers to the users' home
|
||||
directory on Windows (previously always returned failure). (CCS)
|
||||
|
||||
10/20/97 (implementation change) The Tcl parser has been completely rewritten
|
||||
to make it more modular. It can now be used to parse a script without actually
|
||||
executing it. The APIs for the new parser are not correctly exported, but
|
||||
they will eventually be exported and augmented with Tcl commands so that
|
||||
Tcl scripts can parse other Tcl scripts. (JO)
|
||||
|
||||
10/21/97 (API change) Added "flags" argument to Tcl_EvalObj, removed
|
||||
Tcl_GlobalEvalObj procedure. Added new procedures Tcl_Eval2 and
|
||||
Tcl_EvalObjv. (JO)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
10/22/97 (API change) Renamed Tcl_ObjSetVar2 and Tcl_ObjGetVar2 to
|
||||
Tcl_SetObjVar2 and Tcl_GetObjVar2 (for consistency with other C APIs)
|
||||
and changed the name arguments to be strings instead of objects. (JO)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
10/27/97 (enhancement) Bytecode compiler rewritten to use the new Tcl
|
||||
parser. (BL)
|
||||
|
||||
11/3/97 (New routines) Added Tcl_AppendObjToObj, which appends the
|
||||
string rep of one Tcl_Obj to another. Added Tcl_GetIndexFromObjStruct,
|
||||
which is similar to Tcl_GetIndexFromObj, except that you can give an
|
||||
offset between strings. This allows Tcl_GetIndexFromObjStruct to be
|
||||
called with a table of records which have strings in them. (SRP)
|
||||
|
||||
12/4/97 (enhancement) New Tcl expression parser added. Added new procedure
|
||||
Tcl_ParseExpr and new token types TCL_TOKEN_SUB_EXPR and
|
||||
TCL_TOKEN_OPERATOR. Expression compiler is reimplemented to use this
|
||||
parser. (BL)
|
||||
|
||||
12/9/97 (bug fix) Tcl_EvalObj() increments/decrements the refcount of the
|
||||
script object to prevent the object from deleting itself while in the
|
||||
middle of being evaluated. (CCS)
|
||||
|
||||
12/9/97 (bug fix) Memory leak in Tcl_GetsObjCmd(). (CCS)
|
||||
|
||||
12/11/97 (bug fix) Environment array leaked memory when compiled with
|
||||
Visual C++. (SS)
|
||||
|
||||
12/11/97 (bug fix) File events and non-blocking I/O did not work on
|
||||
pipes under Windows. Changed to use threads to achieve non-blocking
|
||||
behavior. (SS)
|
||||
|
||||
12/18/97 (bug fixes) Fixed segfault in "namespace import"; importing a
|
||||
procedure that causes a cycle now returns an error. Modified "info procs",
|
||||
"info args", "info body", and "info default" to return information about
|
||||
imported procedures as well as procedures defined in a namespace. (BL)
|
||||
|
||||
12/19/97 (enhancement) Added new Tcl_GetString() procedure that can be used
|
||||
in place of Tcl_GetStringFromObj() if the string representation's length
|
||||
isn't needed. (BL)
|
||||
|
||||
12/18/97 (bug fix) In the opt argument parsing package: if the description
|
||||
had only flags, the "too many arguments" case was not detected. The default
|
||||
value was not used for the special "args" ending argument. (DL)
|
||||
|
||||
1/7/98 (clean up) Moved everything not absolutly necessary out of init.tcl
|
||||
procs now in auto.tcl and package.tcl can be autoloaded if needed. (DL)
|
||||
|
||||
1/7/98 (enhancement) tcltest made at install time will search for it's
|
||||
init.tcl where it is, even when using virtual path compilation. (DL)
|
||||
|
||||
1/8/98 (os bug workaround) when needed, using a replacement for memcmp so
|
||||
string compare "char with high bit set" "char w/o high bit set" returns
|
||||
the expected value on all platforms. (DL)
|
||||
|
||||
1/8/98 (unix portability/configure) building from .../unix/targetName/
|
||||
subdirectories and simply using "../configure" should now work fine. (DL)
|
||||
|
||||
1/14/98 (enhancement) Added new regular expression package that
|
||||
supports AREs, EREs, and BREs. The new package includes new escape
|
||||
characters, meta-syntax, and character classes inside brackets.
|
||||
Regexps involving backslashes may behave differently. (MH)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
1/16/98 (os workaround) Under windows, "file volume" was causing chatter
|
||||
and/or several seconds of hanging when querying empty floppy drives.
|
||||
Changed implementation to call an empirically-derived function that doesn't
|
||||
cause this. (CCS)
|
||||
|
||||
1/16/98 (enhancement) Converted regular expressions to a Tcl_Obj type so
|
||||
their compiled form gets cached automatically. Reduced NSUBEXP from 100
|
||||
to 20. (BW)
|
||||
|
||||
1/16/98 (documentation) Change unclear documentation and comments for
|
||||
functions like Tcl_TranslateFileName() and Tcl_ExternalToUtfDString(). Now
|
||||
it explicitly says they take an uninitialized or free DString. A DString
|
||||
that is "empty" or "not holding anything" could have been interpreted as one
|
||||
currently with a zero length, but with a large dynamically allocated buffer.
|
||||
(CCS)
|
||||
|
||||
----------------- Released 8.1a1, 1/22/98 -----------------------
|
||||
|
||||
1/28/98 (new feature) Added a "-direct" optional flag to pkg_mkIndex
|
||||
to generate direct loading package indexes (such those you need
|
||||
if you use namespaces and plan on using namespace import just after
|
||||
package require). pkg_mkIndex still has limitations regarding
|
||||
package dependencies but errors are now ignored and with -direct, correct
|
||||
package indexes can be generated even if there are dependencies as long
|
||||
as the "package provide" are done early enough in the files. (DL)
|
||||
|
||||
1/28/98 (enhancement) Performance tuning of regexp and regsub. (CCS)
|
||||
|
||||
1/28/98 (bug fix) regexp and regsub with "-indices" returned the byte-offsets
|
||||
of the characters in the UTF-8 representation, not the character offsets
|
||||
themselves. (CCS)
|
||||
|
||||
1/28/98 (bug fix) "clock format 0 -format %Z -gmt 1" would return the local
|
||||
timezone string instead of "GMT" on Solaris and Windows.
|
||||
|
||||
1/28/98 (bug fix) Restore tty settings when closing serial device on Unix.
|
||||
This is good behavior when closing real serial devices, essential when
|
||||
closing the pseudo-device /dev/tty because the user's terminal settings
|
||||
would be left useless, in raw mode, when tcl quit. (CCS)
|
||||
|
||||
1/28/98 (bug fix) Tcl_OpenCommandChannel() was modifying the contents of the
|
||||
argv array passed to it, causing problems for any caller that wanted to
|
||||
continue to use the argv array after calling Tcl_OpenCommandChannel(). (CCS)
|
||||
|
||||
2/1/98 (bug fix) More bugs with %Z in format string argument to strftime():
|
||||
1. Borland always returned empty string.
|
||||
2. MSVC always returned the timezone string for the current time, not the
|
||||
timezone string for the specified time.
|
||||
3. With MSVC, "clock format 0 -format %Z -gmt 1" would return "GMT" the first
|
||||
time it was called, but would return the current timezone string on all
|
||||
subsequent calls. (CCS)
|
||||
|
||||
2/1/98 (bug fix) "file stat" was broken on Windows.
|
||||
1. "file stat" of a root directory (local or network) or a relative path that
|
||||
resolved to a root directory (c:. when in pwd was c:/) was returning error.
|
||||
2. "file stat" on a regular file (S_IFREG), the st_mode was sign extended to
|
||||
a negative int if the platform-dependant type "mode_t" was declared as a
|
||||
short instead of an unsigned short.
|
||||
3. "file stat" of a network directory, the st_dev was incorrectly reported
|
||||
as the id of the last accessed local drive rather than the id of the
|
||||
network drive. (CCS)
|
||||
|
||||
2/1/98 (bug fix) "file attributes" of a relative path that resolved to a
|
||||
root directory was returning error. (CCS)
|
||||
|
||||
2/1/98 (bug fix) Change error message when "file attribute" could not
|
||||
determine the attributes for a file. Previously it would return different
|
||||
error messages on Unix vs. Windows vs. Mac. (CCS)
|
||||
|
||||
2/4/98 (bug fixes) Fixed several instances of bugs where the parser/compiler
|
||||
would reach outside the range of allocated memory. Improved the array
|
||||
lookup algorithm in set compilation. (DL)
|
||||
|
||||
2/5/98 (change) The TCL_PARSE_PART1 flag for Set/Get(Obj)Var2 C APIs is now
|
||||
deprecated and ignored. The part1 is always parsed when the part2 argument
|
||||
is NULL. This is to avoid a pattern of errors for extension writers converting
|
||||
from string based Tcl_SetVar() to new Tcl_SetObjVar2() and who could easily
|
||||
forget to provide the flag and thus get code working for normal variables
|
||||
but not for array elements. The performance hit is minimal. A side effect
|
||||
of that change is that is is no longer possible to create scalar variables
|
||||
that can't be accessed by tcl scripts because of their invalid name
|
||||
(ending with parenthesis). Likewise it is also parsed and checked to
|
||||
ensure that you don't create array elements of array whose name is a valid
|
||||
array element because they would not be accessible from scripts anyway.
|
||||
Note: There is still duplicate array elements parsing code. (DL)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2/11/98 (bug fix) Sharing objects between interps, such as by "interp
|
||||
eval" or "send" could cause a crash later when dereferencing an interp
|
||||
that had been deleted, given code such as:
|
||||
set a {set x y}
|
||||
interp create foo
|
||||
interp eval foo $a
|
||||
interp delete foo
|
||||
unset a
|
||||
Interp "foo" was gone, but "a" had a internal rep consisting of bytecodes
|
||||
containing a dangling pointer to "foo". Unsetting "a" would attempt to
|
||||
return resources back to "foo", causing a crash as random memory was
|
||||
accessed. The lesson is that that if an object's internal rep depends on
|
||||
an interp (or any other data structure) it must preserve that data in
|
||||
some fashion. (CCS)
|
||||
|
||||
2/11/98 (enhancement) The "interp" command was returning inconsistent error
|
||||
messages when the specified slave interp could not be found. (CCS)
|
||||
|
||||
2/11/98 (bug fix) Result codes like TCL_BREAK and TCL_CONTINUE were not
|
||||
propagating through the master/slave interp boundaries, such as "interp
|
||||
eval" and "interp alias". TCL_OK, TCL_ERROR, and non-standard codes like
|
||||
teh integer 57 work. There is still a question as to whether TCL_RETURN
|
||||
can/should propagate. (CCS)
|
||||
|
||||
2/11/98 (bug fix) TclCompileScript() was derefering memory 1 byte before
|
||||
start of the string to compile, looking for ']'. (CCS,DL)
|
||||
|
||||
2/11/98 (bug fix) Tcl_Eval2() was derefering memory 1 byte before start
|
||||
of the string to eval, looking for ']'. (CCS,DL)
|
||||
|
||||
2/11/98 (bug fix) Compiling "set a(b" was running off end of string. (CCS,DL)
|
||||
|
||||
2/11/98 (bug fix) Windows initialization code was dereferencing
|
||||
uninitialized memory if TCL_LIBRARY environment didn't exist. (CCS)
|
||||
|
||||
2/11/98 (bug fix) Windows "registry" command was dereferencing
|
||||
uninitialized memory when constructing the $errorCode for a failed
|
||||
registry call. (CCS)
|
||||
|
||||
2/11/98 (enhancement) Eliminate the TCL_USE_TIMEZONE_VAR definition from
|
||||
configure.in, because it was the same information as the already existing
|
||||
HAVE_TM_ZONE definition. The lack of HAVE_TM_ZONE is used to work around a
|
||||
Solaris and Windows bug where "clock format [clock sec] -format %Z -gmt 1"
|
||||
produces the local timezone string instead of "GMT". (CCS)
|
||||
|
||||
2/11/98 (bug fix) Memleaks and dereferencing of uninitialized memory in
|
||||
regexp if an error occurred while compiling a regular expression. (CCS).
|
||||
|
||||
2/18/98 (new feature) Added mutexes and thread local storage in order
|
||||
to make Tcl thread safe. For testing purposes, there is a testthread
|
||||
command that creates a new thread and an interpreter inside it. See
|
||||
thread.test for examples, but this script-level interface is not fixed.
|
||||
Each thread has its own notifier instance to manage its own events,
|
||||
and threads can post messages to each other's message queue.
|
||||
This uses pthreads on UNIX, and native thread support on other platforms.
|
||||
You enable this by configuring with --enable-threads. Note that at
|
||||
this time *Tk* is still not thread safe. Special thanks to
|
||||
Richard Hipp: his earlier implementation inspired this work. (BW, SS, JI)
|
||||
|
||||
2/18/98 (hidden feature change) The way the env() array is shared among
|
||||
interpreters changed. Updates to env used to trigger write traces in
|
||||
other interpreters. This undocumented feature is no longer implemented.
|
||||
Instead, variable tracing is used to keep the C-level environ array in sync
|
||||
with the Tcl-level env array. This required adding TCL_TRACE_ARRAY support
|
||||
to Tcl_TraceVar2 so that array names works properly. (BW)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2/18/98 (enhancement) Conditional compilation for unix systems (e.g.,
|
||||
IRIX, SCO) that use f_bsize instead of st_blksize to determine disk block
|
||||
size. (CCS)
|
||||
|
||||
2/23/98 (bug fix) Fixed the emulation of polling selects in the threaded
|
||||
version of the Unix notifier. The bug was showing up on a multiprocessor
|
||||
as starvation of the notifier thread. (BW)
|
||||
|
||||
----------------- Released 8.1a2, Feb 23 1998 -----------------------
|
||||
|
||||
9/22/98 (bug fix) Changed the value of TCL_TRACE_ARRAY so it no longer
|
||||
conflicts with the deprecated TCL_PARSE_PART1 flag. This should
|
||||
improve portability of C code. (stanton)
|
||||
|
||||
10/6/98 (bug fix) The compile procedure for "if" incorrectly attempted
|
||||
to match against the literal string "if", resulting in a stack
|
||||
overflow when "::if" was compiled. It also would incorrectly accept
|
||||
"if" instead of "elsif" in later clauses. (stanton)
|
||||
|
||||
10/15/98 (new feature) Added a "totitle" subcommand to the "string"
|
||||
command to convert strings to capitalize the first character of a string
|
||||
and lowercase all of the other characters. (stanton)
|
||||
|
||||
10/15/98 (bug fix) Changed regexp and string commands to properly
|
||||
handle case folding according to the Unicode character
|
||||
tables. (stanton)
|
||||
|
||||
10/21/98 (new feature) Added an "encoding" command to facilitate
|
||||
translations of strings between different character encodings. See
|
||||
the encoding.n manual entry for more details. (stanton)
|
||||
|
||||
11/3/98 (bug fix) The regular expression character classification
|
||||
syntax now includes Unicode characters in the supported
|
||||
classes. (stanton)
|
||||
|
||||
11/6/98 (bug fix) Variable traces were causing crashes when upvar
|
||||
variables went out of scope. [Bug: 796] (stanton)
|
||||
|
||||
11/9/98 (bug fix) "format" now correctly handles multibyte characters
|
||||
in %s format strings. (stanton)
|
||||
|
||||
11/10/98 (new feature) "regexp" now accepts three new switches
|
||||
("-line", "-lineanchor", and "-linestop") that control how regular
|
||||
expressions treat line breaks. See the regexp manual entry for more
|
||||
details. (stanton)
|
||||
|
||||
11/17/98 (bug fix) "scan" now correctly handles Unicode
|
||||
characters. (stanton)
|
||||
|
||||
11/17/98 (new feature) "scan" now supports XPG3 position specifiers
|
||||
and the "%n" conversion character. See the "scan" manual entry for
|
||||
more details. (stanton)
|
||||
|
||||
11/17/98 (bug fix) The Tcl memory allocator now returns 8-byte aligned
|
||||
chunks of memory which improves performance on Windows and avoids
|
||||
crashes on other platforms. [Bug: 834] (stanton)
|
||||
|
||||
11/23/98 (bug fix) Applied various regular expression performance bug
|
||||
fixes supplied by Henry Spencer. (stanton)
|
||||
|
||||
11/30/98 (bug fix) Fixed various thread related race conditions. [Bug:
|
||||
880 & 607] (stanton)
|
||||
|
||||
11/30/98 (bug fix) Fixed a number of memory overflow and leak
|
||||
bugs. [Bug: 584] (stanton)
|
||||
|
||||
12/1/98 (new feaure) Added support for Korean encodings. (stanton)
|
||||
|
||||
12/1/98 (feature change) Changed the Tcl_EvalObjv interface to remove
|
||||
the string and length arguments.
|
||||
*** POTENTIAL INCOMPATIBILITY with previous alpha releases ***
|
||||
|
||||
12/2/98 (bug fix) Fixed various bugs related to line feed
|
||||
translation. [Bug: 887] (stanton)
|
||||
|
||||
12/4/98 (new feature) Added a message catalog facility to help with
|
||||
localizing Tcl scripts. Thanks to Mark Harrison for contributing the
|
||||
initial implementation of the "msgcat" package. (stanton)
|
||||
|
||||
12/7/98 (bug fix) The memory allocator was failing to update the
|
||||
block list for large memory blocks that were reallocated into a
|
||||
different address. [Bug: 933] (stanton)
|
||||
|
||||
----------------- Released 8.1b1, Dec 10 1998 -----------------------
|
||||
|
||||
12/22/98 (performance improvement) Improved the -command option of the
|
||||
lsort command to better use the object system for improved
|
||||
performance (about 5x speed up). Thanks to Syd Polk for suppling the
|
||||
patch. [RFE: 726] (rjohnson)
|
||||
|
||||
2/10/99 (bug fix) Restored the Tcl_ObjSetVar2/Tcl_ObjGetVar2
|
||||
interfaces from 8.0 and renamed the Tcl_GetObjVar2/Tcl_SetObjVar2
|
||||
interfaces to Tcl_GetVar2Ex and Tcl_SetVar2Ex. This should provide
|
||||
better compatibility with 8.0. (stanton)
|
||||
*** POTENTIAL INCOMPATIBILITY with previous alpha/beta releases ***
|
||||
|
||||
2/10/99 (bug fix) Made the eval interfaces compatible with 8.0 by
|
||||
renaming Tcl_EvalObj to Tcl_EvalObjEx, renaming Tcl_Eval2 to
|
||||
Tcl_EvalEx and restoring Tcl_EvalObj and Tcl_GlobalEvalObj interfaces
|
||||
so they match Tcl 8.0. (stanton)
|
||||
*** POTENTIAL INCOMPATIBILITY with previous alpha/beta releases ***
|
||||
|
||||
2/25/99 (bug fix/new feature) On Windows, the channel drivers for
|
||||
consoles and serial ports now completely support file events. (redman)
|
||||
|
||||
3/5/99 (bug fix) Integrated patches to fix various configure problems
|
||||
that affected HP-UX-11, 64-bit IRIX, Linux, and Solaris. (stanton)
|
||||
|
||||
3/9/99 (bug fix) Integrated various AIX related patches to improve
|
||||
support for shared libraries. (stanton)
|
||||
|
||||
3/9/99 (new feature) Added tcl_platform(user) to provide a portable
|
||||
way to get the name of the current user. (welch)
|
||||
|
||||
3/9/99 (new feature) Integrated the stub library mechanism contributed
|
||||
by Jan Nijtmans, Paul Duffin, and Jean-Claude Wippler. This feature
|
||||
should make it possible to write extensions that support multiple
|
||||
versions of Tcl simultaneously. It also makes it possible to
|
||||
dynamically load extensions into statically linked interpreters. This
|
||||
patch includes the following changes:
|
||||
- Added a Tcl_InitStubs() interface
|
||||
- Added Tcl_PkgProvideEx, Tcl_PkgRequireEx, Tcl_PkgPresentEx,
|
||||
and Tcl_PkgPresent.
|
||||
- Added va_list versions of all VARARGS functions so they can be
|
||||
invoked from wrapper functions.
|
||||
See the manual for more information. (stanton)
|
||||
|
||||
|
||||
3/10/99 (feature change) Replaced Tcl_AlertNotifier with
|
||||
Tcl_ThreadAlert since the Tcl_AlertNotifier function relied on passing
|
||||
internal data structures. (stanton)
|
||||
*** POTENTIAL INCOMPATIBILITY with previous alpha/beta releases ***
|
||||
|
||||
3/10/99 (new feature) Added a Tcl_GetVersion API to make it easier to
|
||||
check the Tcl version and patch level from C. (redman)
|
||||
|
||||
3/14/99 (feature change) Tried to unify the TclpInitLibrary path
|
||||
routines to look in similar places from Windows to UNIX. The new
|
||||
library search path is: TCL_LIBRARY, TCL_LIBRARY/../tcl8.1, relative
|
||||
to DLL (Windows Only) relative to installed executable, relative to
|
||||
develop executable, and relative to compiled-in in location (UNIX
|
||||
Only.) This fix included:
|
||||
- Defining a TclpFindExecutable
|
||||
- Moving Tcl_FindExecutable to a common area in tclEncoding.c
|
||||
- Modifying the TclpInitLibraryPath routines.
|
||||
(surles)
|
||||
|
||||
3/14/99 (feature change) Added hooks for TclPro Wrapper to initialize
|
||||
the location of the encoding files and libraries. This fix included:
|
||||
- Adding the TclSetPerInitScript routine.
|
||||
- Modifying the Tcl_Init routines to evaluate the non-NULL
|
||||
pre-init script.
|
||||
- Adding the Tcl_SetdefaultEncodingDir and Tcl_GetDefaultEncodingDir
|
||||
routines.
|
||||
- Modifying the TclpInitLibrary routines to append the default
|
||||
encoding dir.
|
||||
(surles)
|
||||
|
||||
3/14/99 (feature change) Test suite now uses "test" namespace to
|
||||
define the test procedure and other auxiliary procedures as well as
|
||||
global variables.
|
||||
- Global array testConfige is now called ::test::testConfig.
|
||||
- Global variable VERBOSE is now called ::test::verbose, and
|
||||
::test::verbose no longer works with numerical values. We've
|
||||
switched to a bitwise character string. You can set
|
||||
::test::verbose by using the -verbose option on the Tcl command
|
||||
line.
|
||||
- Global variable TESTS is now called ::test::matchingTests, and
|
||||
can be set on the Tcl command line via the -match option.
|
||||
- There is now a ::test::skipTests variable (works similarly to
|
||||
::test::matchTests) that can be set on the Tcl command line via
|
||||
the -match option.
|
||||
- The test suite can now be run in any working directory. When
|
||||
you run "make test", the working directory is nolonger switched
|
||||
to ../tests.
|
||||
(hirschl)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ Tcl when a system doesn't contain the corresponding files or when
|
||||
they are known to be incorrect. When the whole world becomes POSIX-
|
||||
compliant this directory should be unnecessary.
|
||||
|
||||
sccsid = SCCS: @(#) README 1.3 96/02/16 08:56:51
|
||||
RCS: @(#) $Id: README,v 1.1.2.1 1998/09/24 23:58:16 stanton Exp $
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) dirent.h 1.4 96/02/15 14:43:50
|
||||
* RCS: @(#) $Id: dirent.h,v 1.1.2.1 1998/09/24 23:58:16 stanton Exp $
|
||||
*/
|
||||
|
||||
#ifndef _DIRENT
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) dirent2.h 1.4 96/02/15 14:43:51
|
||||
* RCS: @(#) $Id: dirent2.h,v 1.1.2.1 1998/09/24 23:58:16 stanton Exp $
|
||||
*/
|
||||
|
||||
#ifndef _DIRENT
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
* for any results of using the software, alterations are clearly marked
|
||||
* as such, and this notice is not modified.
|
||||
*
|
||||
* SCCS: @(#) dlfcn.h 1.4 96/09/17 09:05:59
|
||||
* RCS: @(#) $Id: dlfcn.h,v 1.1.2.1 1998/09/24 23:58:16 stanton Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) fixstrtod.c 1.5 96/02/15 12:08:21
|
||||
* RCS: @(#) $Id: fixstrtod.c,v 1.1.2.1 1998/09/24 23:58:17 stanton Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
+1
-1
@@ -12,5 +12,5 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) float.h 1.3 96/02/15 14:43:52
|
||||
* RCS: @(#) $Id: float.h,v 1.1.2.1 1998/09/24 23:58:17 stanton Exp $
|
||||
*/
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) gettod.c 1.2 96/02/15 12:08:26
|
||||
* RCS: @(#) $Id: gettod.c,v 1.1.2.1 1998/09/24 23:58:17 stanton Exp $
|
||||
*/
|
||||
|
||||
#include "tcl.h"
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) limits.h 1.8 96/07/08 18:00:13
|
||||
* RCS: @(#) $Id: limits.h,v 1.1.2.1 1998/09/24 23:58:17 stanton Exp $
|
||||
*/
|
||||
|
||||
#define LONG_MIN 0x80000000
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* memcmp.c --
|
||||
*
|
||||
* Source code for the "memcmp" library routine.
|
||||
*
|
||||
* Copyright (c) 1998 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) memcmp.c 1.2 98/01/19 10:48:58
|
||||
*/
|
||||
|
||||
#include "tcl.h"
|
||||
#include "tclPort.h"
|
||||
|
||||
/*
|
||||
* Here is the prototype just in case it is not included
|
||||
* in tclPort.h.
|
||||
*/
|
||||
|
||||
int memcmp _ANSI_ARGS_((CONST VOID *s1,
|
||||
CONST VOID *s2, size_t n));
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* memcmp --
|
||||
*
|
||||
* Compares two bytes sequences.
|
||||
*
|
||||
* Results:
|
||||
* compares its arguments, looking at the first n
|
||||
* bytes (each interpreted as an unsigned char), and returns
|
||||
* an integer less than, equal to, or greater than 0, accord-
|
||||
* ing as s1 is less than, equal to, or
|
||||
* greater than s2 when taken to be unsigned 8 bit numbers.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
memcmp(s1, s2, n)
|
||||
CONST VOID *s1; /* First string. */
|
||||
CONST VOID *s2; /* Second string. */
|
||||
size_t n; /* Length to compare. */
|
||||
{
|
||||
unsigned char u1, u2;
|
||||
|
||||
for ( ; n-- ; s1++, s2++) {
|
||||
u1 = * (unsigned char *) s1;
|
||||
u2 = * (unsigned char *) s2;
|
||||
if ( u1 != u2) {
|
||||
return (u1-u2);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* originally from Larry Wall.
|
||||
*
|
||||
*
|
||||
* SCCS: @(#) opendir.c 1.3 96/02/15 12:08:21
|
||||
* RCS: @(#) $Id: opendir.c,v 1.1.2.1 1998/09/24 23:58:17 stanton Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+2
-2
@@ -9,12 +9,12 @@
|
||||
* declare all the procedures needed here (such as strtod).
|
||||
*
|
||||
* Copyright (c) 1991 The Regents of the University of California.
|
||||
* Copyright (c) 1994 Sun Microsystems, Inc.
|
||||
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) stdlib.h 1.10 96/02/15 14:43:54
|
||||
* RCS: @(#) $Id: stdlib.h,v 1.1.2.2 1998/09/24 23:58:17 stanton Exp $
|
||||
*/
|
||||
|
||||
#ifndef _STDLIB
|
||||
|
||||
+6
-7
@@ -8,7 +8,7 @@
|
||||
* source. See the copyright notice below for details on redistribution
|
||||
* restrictions. The "license.terms" file does not apply to this file.
|
||||
*
|
||||
* SCCS: @(#) strftime.c 1.4 97/08/07 17:17:02
|
||||
* RCS: @(#) $Id: strftime.c,v 1.1.2.3 1999/03/10 06:49:09 stanton Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -44,10 +44,9 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
/*static char *sccsid = "from: @(#)strftime.c 5.11 (Berkeley) 2/24/91";*/
|
||||
static char *rcsid = "$Id: strftime.c,v 1.1 1998/03/26 14:46:31 rjohnson Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#if defined(LIBC_SCCS)
|
||||
static char *rcsid = "$Id: strftime.c,v 1.1.2.3 1999/03/10 06:49:09 stanton Exp $";
|
||||
#endif /* LIBC_SCCS */
|
||||
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
@@ -106,7 +105,7 @@ static size_t _fmt _ANSI_ARGS_((const char *format,
|
||||
const struct tm *t));
|
||||
|
||||
size_t
|
||||
TclStrftime(s, maxsize, format, t)
|
||||
TclpStrftime(s, maxsize, format, t)
|
||||
char *s;
|
||||
size_t maxsize;
|
||||
const char *format;
|
||||
@@ -316,7 +315,7 @@ _fmt(format, t)
|
||||
continue;
|
||||
#ifndef MAC_TCL
|
||||
case 'Z': {
|
||||
char *name = TclpGetTZName();
|
||||
char *name = TclpGetTZName(t->tm_isdst);
|
||||
if (name && !_add(name)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+5
-1
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) string.h 1.13 96/04/09 22:14:53
|
||||
* RCS: @(#) $Id: string.h,v 1.1.2.2 1998/09/24 23:58:17 stanton Exp $
|
||||
*/
|
||||
|
||||
#ifndef _STRING
|
||||
@@ -32,8 +32,12 @@ extern char * memchr _ANSI_ARGS_((CONST VOID *s, int c, size_t n));
|
||||
extern int memcmp _ANSI_ARGS_((CONST VOID *s1, CONST VOID *s2,
|
||||
size_t n));
|
||||
extern char * memcpy _ANSI_ARGS_((VOID *t, CONST VOID *f, size_t n));
|
||||
#ifdef NO_MEMMOVE
|
||||
#define memmove(d, s, n) bcopy ((s), (d), (n))
|
||||
#else
|
||||
extern char * memmove _ANSI_ARGS_((VOID *t, CONST VOID *f,
|
||||
size_t n));
|
||||
#endif
|
||||
extern char * memset _ANSI_ARGS_((VOID *s, int c, size_t n));
|
||||
|
||||
extern int strcasecmp _ANSI_ARGS_((CONST char *s1,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) strncasecmp.c 1.7 96/10/24 15:23:36
|
||||
* RCS: @(#) $Id: strncasecmp.c,v 1.1.2.1 1998/09/24 23:58:17 stanton Exp $
|
||||
*/
|
||||
|
||||
#include "tclPort.h"
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) strstr.c 1.4 96/02/15 12:08:22
|
||||
* RCS: @(#) $Id: strstr.c,v 1.1.2.1 1998/09/24 23:58:18 stanton Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) strtod.c 1.9 96/12/13 15:02:46
|
||||
* RCS: @(#) $Id: strtod.c,v 1.1.2.1 1998/09/24 23:58:18 stanton Exp $
|
||||
*/
|
||||
|
||||
#include "tcl.h"
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) strtol.c 1.4 96/02/15 12:08:23
|
||||
* RCS: @(#) $Id: strtol.c,v 1.1.2.1 1998/09/24 23:58:18 stanton Exp $
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) strtoul.c 1.5 96/02/15 12:08:24
|
||||
* RCS: @(#) $Id: strtoul.c,v 1.1.2.1 1998/09/24 23:58:18 stanton Exp $
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) tclErrno.h 1.1 96/04/29 15:25:31
|
||||
* RCS: @(#) $Id: tclErrno.h,v 1.1.2.1 1998/09/24 23:58:18 stanton Exp $
|
||||
*/
|
||||
|
||||
extern int errno; /* global error number */
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
* software without specific written prior permission. This software
|
||||
* is provided ``as is'' without express or implied warranty.
|
||||
*
|
||||
* SCCS: @(#) tmpnam.c 1.3 96/02/15 12:08:25
|
||||
* RCS: @(#) $Id: tmpnam.c,v 1.1.2.1 1998/09/24 23:58:18 stanton Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
* software for any purpose. It is provided "as is" without
|
||||
* express or implied warranty.
|
||||
*
|
||||
* SCCS: @(#) unistd.h 1.7 96/02/15 14:43:57
|
||||
* RCS: @(#) $Id: unistd.h,v 1.1.2.1 1998/09/24 23:58:18 stanton Exp $
|
||||
*/
|
||||
|
||||
#ifndef _UNISTD
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) waitpid.c 1.9 96/02/15 12:08:26
|
||||
* RCS: @(#) $Id: waitpid.c,v 1.1.2.1 1998/09/24 23:58:18 stanton Exp $
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
+10
-2
@@ -5,13 +5,13 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" SCCS: @(#) AddErrInfo.3 1.28 97/06/12 13:39:53
|
||||
'\" RCS: @(#) $Id: AddErrInfo.3,v 1.1.2.2 1999/03/10 06:49:10 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_AddErrorInfo 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_AddObjErrorInfo, Tcl_AddErrorInfo, Tcl_SetErrorCode, Tcl_PosixError \- record information about errors
|
||||
Tcl_AddObjErrorInfo, Tcl_AddErrorInfo, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_PosixError \- record information about errors
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -24,6 +24,8 @@ Tcl_AddObjErrorInfo, Tcl_AddErrorInfo, Tcl_SetErrorCode, Tcl_PosixError \- recor
|
||||
.sp
|
||||
\fBTcl_SetErrorCode\fR(\fIinterp, element, element, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
\fBTcl_SetErrorCodeVA\fR(\fIinterp, argList\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_PosixError\fR(\fIinterp\fR)
|
||||
.SH ARGUMENTS
|
||||
@@ -47,6 +49,9 @@ This variable \fBerrorCode\fR will be set to this value.
|
||||
.AP char *element in
|
||||
String to record as one element of \fBerrorCode\fR variable.
|
||||
Last \fIelement\fR argument must be NULL.
|
||||
.AP va_list argList in
|
||||
An argument list which must have been initialised using
|
||||
\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
@@ -118,6 +123,9 @@ The procedure \fBTcl_SetErrorCode\fR is also used to set the
|
||||
record instead of an object. Otherwise, it is similar to
|
||||
\fBTcl_SetObjErrorCode\fR in behavior.
|
||||
.PP
|
||||
\fBTcl_SetErrorCodeVA\fR is the same as \fBTcl_SetErrorCode\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument list.
|
||||
.PP
|
||||
\fBTcl_PosixError\fR
|
||||
sets the \fBerrorCode\fR variable after an error in a POSIX kernel call.
|
||||
It reads the value of the \fBerrno\fR C variable and calls
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Alloc.3 1.2 96/06/05 18:00:19
|
||||
'\" RCS: @(#) $Id: Alloc.3,v 1.1.2.1 1998/09/24 23:58:19 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Alloc 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) AllowExc.3 1.5 96/03/25 19:55:47
|
||||
'\" RCS: @(#) $Id: AllowExc.3,v 1.1.2.1 1998/09/24 23:58:19 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_AllowExceptions 3 7.4 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) AppInit.3 1.10 96/08/26 12:59:40
|
||||
'\" RCS: @(#) $Id: AppInit.3,v 1.1.2.1 1998/09/24 23:58:19 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_AppInit 3 7.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
'\" SCCS: @(#) AssocData.3 1.8 96/03/25 19:56:17
|
||||
'\" RCS: @(#) $Id: AssocData.3,v 1.1.2.1 1998/09/24 23:58:19 stanton Exp $
|
||||
.so man.macros
|
||||
.TH Tcl_SetAssocData 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Async.3 1.14 96/08/26 12:59:41
|
||||
'\" RCS: @(#) $Id: Async.3,v 1.1.2.1 1998/09/24 23:58:19 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_AsyncCreate 3 7.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) BackgdErr.3 1.3 96/03/25 19:56:51
|
||||
'\" RCS: @(#) $Id: BackgdErr.3,v 1.1.2.1 1998/09/24 23:58:19 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_BackgroundError 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+19
-11
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Backslash.3 1.16 96/03/25 19:57:09
|
||||
'\" RCS: @(#) $Id: Backslash.3,v 1.1.2.2 1998/09/24 23:58:20 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Backslash 3 "" Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_Backslash 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_Backslash \- parse a backslash sequence
|
||||
@@ -30,16 +30,24 @@ the backslash character.
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This is a utility procedure used by several of the Tcl
|
||||
commands. It parses a backslash sequence and returns
|
||||
the single character corresponding to the sequence.
|
||||
\fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number
|
||||
of characters in the backslash sequence.
|
||||
.VS 8.1
|
||||
The use of \fBTcl_Backslash\fR is deprecated in favor of
|
||||
\fBTcl_UtfBackslash\fR.
|
||||
.PP
|
||||
See the Tcl manual entry for information on the valid
|
||||
backslash sequences.
|
||||
All of the sequences described in the Tcl
|
||||
manual entry are supported by \fBTcl_Backslash\fR.
|
||||
This is a utility procedure provided for backwards compatibilty with
|
||||
non-internationalized Tcl extensions. It parses a backslash sequence and
|
||||
returns the low byte of the Unicode character corresponding to the sequence.
|
||||
.VE
|
||||
\fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number of
|
||||
characters in the backslash sequence.
|
||||
.PP
|
||||
See the Tcl manual entry for information on the valid backslash sequences.
|
||||
All of the sequences described in the Tcl manual entry are supported by
|
||||
\fBTcl_Backslash\fR.
|
||||
.VS 8.1 br
|
||||
.SH "SEE ALSO"
|
||||
Tcl(n), Tcl_UtfBackslash(3)
|
||||
.VE
|
||||
|
||||
.SH KEYWORDS
|
||||
backslash, parse
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) @(#) BoolObj.3 1.7 97/05/08 19:50:57
|
||||
'\" RCS: @(#) $Id: BoolObj.3,v 1.1.2.1 1998/09/24 23:58:20 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_BooleanObj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1997 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: ByteArrObj.3,v 1.1.2.2 1998/10/21 20:21:31 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_ByteArrayObj 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate Tcl objects as a arrays of bytes
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_NewByteArrayObj\fR(\fIbytes, length\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_SetByteArrayObj\fR(\fIobjPtr, bytes, length\fR)
|
||||
.sp
|
||||
unsigned char *
|
||||
\fBTcl_GetByteArrayFromObj\fR(\fIobjPtr, lengthPtr\fR)
|
||||
.sp
|
||||
unsigned char *
|
||||
\fBTcl_SetByteArrayLength\fR(\fIobjPtr, length\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "unsigned char" *lengthPtr in/out
|
||||
.AP "unsigned char" *bytes in
|
||||
The array of bytes used to initialize or set a byte-array object.
|
||||
.AP int length in
|
||||
The length of the array of bytes. It must be >= 0.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
For \fBTcl_SetByteArrayObj\fR, this points to the object to be converted to
|
||||
byte-array type. For \fBTcl_GetByteArrayFromObj\fR and
|
||||
\fBTcl_SetByteArrayLength\fR, this points to the object from which to get
|
||||
the byte-array value; if \fIobjPtr\fR does not already point to a byte-array
|
||||
object, it will be converted to one.
|
||||
.AP int *lengthPtr out
|
||||
If non-NULL, filled with the length of the array of bytes in the object.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are used to create, modify, and read Tcl byte-array objects
|
||||
from C code. Byte-array objects are typically used to hold the
|
||||
results of binary IO operations or data structures created with the
|
||||
\fBbinary\fR command. In Tcl, an array of bytes is not equivalent to a
|
||||
string. Conceptually, a string is an array of Unicode characters, while a
|
||||
byte-array is an array of 8-bit quantities with no implicit meaning.
|
||||
Accesser functions are provided to get the string representation of a
|
||||
byte-array or to convert an arbitrary object to a byte-array. Obtaining the
|
||||
string representation of a byte-array object (by calling
|
||||
\fBTcl_GetStringFromObj\fR) produces a properly formed UTF-8 sequence with a
|
||||
one-to-one mapping between the bytes in the internal representation and the
|
||||
UTF-8 characters in the string representation.
|
||||
.PP
|
||||
\fBTcl_NewByteArrayObj\fR and \fBTcl_SetByteArrayObj\fR will
|
||||
create a new object of byte-array type or modify an existing object to have a
|
||||
byte-array type. Both of these procedures set the object's type to be
|
||||
byte-array and set the object's internal representation to a copy of the
|
||||
array of bytes given by \fIbytes\fR. \fBTcl_NewByteArrayObj\fR returns a
|
||||
pointer to a newly allocated object with a reference count of zero.
|
||||
\fBTcl_SetByteArrayObj\fR invalidates any old string representation and, if
|
||||
the object is not already a byte-array object, frees any old internal
|
||||
representation.
|
||||
.PP
|
||||
\fBTcl_GetByteArrayFromObj\fR converts a Tcl object to byte-array type and
|
||||
returns a pointer to the object's new internal representation as an array of
|
||||
bytes. The length of this array is stored in \fIlengthPtr\fR if
|
||||
\fIlengthPtr\fR is non-NULL. The storage for the array of bytes is owned by
|
||||
the object and should not be freed. The contents of the array may be
|
||||
modified by the caller only if the object is not shared and the caller
|
||||
invalidates the string representation.
|
||||
.PP
|
||||
\fBTcl_SetByteArrayLength\fR converts the Tcl object to byte-array type
|
||||
and changes the length of the object's internal representation as an
|
||||
array of bytes. If \fIlength\fR is greater than the space currently
|
||||
allocated for the array, the array is reallocated to the new length; the
|
||||
newly allocated bytes at the end of the array have arbitrary values. If
|
||||
\fIlength\fR is less than the space currently allocated for the array,
|
||||
the length of array is reduced to the new length. The return value is a
|
||||
pointer to the object's new array of bytes.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_GetStringFromObj, Tcl_NewObj, Tcl_IncrRefCount, Tcl_DecrRefCount
|
||||
|
||||
.SH KEYWORDS
|
||||
object, byte array, utf, unicode, internationalization
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CallDel.3 1.11 96/03/25 19:57:25
|
||||
'\" RCS: @(#) $Id: CallDel.3,v 1.1.2.1 1998/09/24 23:58:20 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_CallWhenDeleted 3 7.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CmdCmplt.3 1.6 96/03/25 19:57:46
|
||||
'\" RCS: @(#) $Id: CmdCmplt.3,v 1.1.2.1 1998/09/24 23:58:20 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_CommandComplete 3 "" Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Concat.3 1.12 97/06/11 17:54:12
|
||||
'\" RCS: @(#) $Id: Concat.3,v 1.1.2.1 1998/09/24 23:58:20 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Concat 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+39
-7
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CrtChannel.3 1.29 97/06/20 13:37:45
|
||||
'\" RCS: @(#) $Id: CrtChannel.3,v 1.1.2.2 1998/09/24 23:58:20 stanton Exp $
|
||||
.so man.macros
|
||||
.TH Tcl_CreateChannel 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
@@ -221,16 +221,19 @@ typedef struct Tcl_ChannelType {
|
||||
Tcl_DriverGetOptionProc *\fIgetOptionProc\fR;
|
||||
Tcl_DriverWatchProc *\fIwatchProc\fR;
|
||||
Tcl_DriverGetHandleProc *\fIgetHandleProc\fR;
|
||||
Tcl_DriverClose2Proc *\fIclose2Proc\fR;
|
||||
} Tcl_ChannelType;
|
||||
.CE
|
||||
.VE
|
||||
.PP
|
||||
The driver must provide implementations for all functions except
|
||||
\fIblockModeProc\fR, \fIseekProc\fR, \fIsetOptionProc\fR, and
|
||||
\fIgetOptionProc\fR, which may be specified as NULL to indicate that the
|
||||
channel does not support seeking. Other functions that can not be
|
||||
implemented for this type of device should return \fBEINVAL\fR when invoked
|
||||
to indicate that they are not implemented.
|
||||
\fIblockModeProc\fR, \fIseekProc\fR, \fIsetOptionProc\fR,
|
||||
.VS
|
||||
\fIgetOptionProc\fR, and \fIclose2Proc\fR, which may be specified as
|
||||
.VE
|
||||
NULL. Other functions that can not be implemented for this type of
|
||||
device should return \fBEINVAL\fR when invoked to indicate that they
|
||||
are not implemented.
|
||||
|
||||
.SH TYPENAME
|
||||
.PP
|
||||
@@ -264,7 +267,7 @@ For some device types, the blocking and nonblocking behavior can be
|
||||
implemented by the underlying operating system; for other device types, the
|
||||
behavior must be emulated in the channel driver.
|
||||
|
||||
.SH CLOSEPROC
|
||||
.SH CLOSEPROC AND CLOSE2PROC
|
||||
.PP
|
||||
The \fIcloseProc\fR field contains the address of a function called by the
|
||||
generic layer to clean up driver-related information when the channel is
|
||||
@@ -286,6 +289,35 @@ calling the \fIcloseProc\fR. If the close operation is successful, the
|
||||
procedure should return zero; otherwise it should return a nonzero POSIX
|
||||
error code. In addition, if an error occurs and \fIinterp\fR is not NULL,
|
||||
the procedure should store an error message in \fIinterp->result\fR.
|
||||
.PP
|
||||
.VS
|
||||
Alternatively, channels that support closing the read and write sides
|
||||
independently may set \fIcloseProc\fR to \fBTCL_CLOSE2PROC\fR and set
|
||||
\fIclose2Proc\fR to the address of a function that matches the
|
||||
following prototype:
|
||||
.PP
|
||||
.CS
|
||||
typedef int Tcl_DriverClose2Proc(
|
||||
ClientData \fIinstanceData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
int \fIflags\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fIclose2Proc\fR will be called with \fIflags\fR set to an OR'ed
|
||||
combination of \fBTCL_CLOSE_READ\fR or \fBTCL_CLOSE_WRITE\fR to
|
||||
indicate that the driver should close the read and/or write side of
|
||||
the channel. The channel driver may be invoked to perform
|
||||
additional operations on the channel after \fIclose2Proc\fR is
|
||||
called to close one or both sides of the channel. If \fIflags\fR is
|
||||
\fB0\fR (zero), the driver should close the channel in the manner
|
||||
described above for \fIcloseProc\fR. No further operations will be
|
||||
invoked on this instance after \fIclose2Proc\fR is called with all
|
||||
flags cleared. In all cases, the \fIclose2Proc\fR function should
|
||||
return zero if the close operation was successful; otherwise it should
|
||||
return a nonzero POSIX error code. In addition, if an error occurs and
|
||||
\fIinterp\fR is not NULL, the procedure should store an error message
|
||||
in \fIinterp->result\fR.
|
||||
.VE
|
||||
|
||||
.SH INPUTPROC
|
||||
.PP
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CrtChnlHdlr.3 1.10 96/03/14 10:54:43
|
||||
'\" RCS: @(#) $Id: CrtChnlHdlr.3,v 1.1.2.1 1998/09/24 23:58:20 stanton Exp $
|
||||
.so man.macros
|
||||
.TH Tcl_CreateChannelHandler 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CrtCloseHdlr.3 1.7 96/04/15 13:08:19
|
||||
'\" RCS: @(#) $Id: CrtCloseHdlr.3,v 1.1.2.1 1998/09/24 23:58:21 stanton Exp $
|
||||
.so man.macros
|
||||
.TH Tcl_CreateCloseHandler 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
|
||||
+7
-2
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CrtCommand.3 1.29 97/06/04 17:23:53
|
||||
'\" RCS: @(#) $Id: CrtCommand.3,v 1.1.2.2 1998/10/06 02:59:03 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_CreateCommand 3 "" Tcl "Tcl Library Procedures"
|
||||
@@ -94,7 +94,12 @@ the command, \fIargc\fR giving the number of arguments (including
|
||||
the command name) and \fIargv\fR giving the values of the arguments
|
||||
as strings. The \fIargv\fR array will contain \fIargc\fR+1 values;
|
||||
the first \fIargc\fR values point to the argument strings, and the
|
||||
last value is NULL.
|
||||
last value is NULL.
|
||||
.VS
|
||||
Note that the argument strings should not be modified as they may
|
||||
point to constant strings or may be shared with other parts of the
|
||||
interpreter.
|
||||
.VE
|
||||
.PP
|
||||
\fIProc\fR must return an integer code that is either \fBTCL_OK\fR, \fBTCL_ERROR\fR,
|
||||
\fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR. See the Tcl overview man page
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CrtFileHdlr.3 1.7 97/04/23 16:11:17
|
||||
'\" RCS: @(#) $Id: CrtFileHdlr.3,v 1.1.2.1 1998/09/24 23:58:21 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_CreateFileHandler 3 8.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CrtInterp.3 1.17 97/10/31 13:05:51
|
||||
'\" RCS: @(#) $Id: CrtInterp.3,v 1.1.2.1 1998/09/24 23:58:21 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_CreateInterp 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CrtMathFnc.3 1.9 96/08/26 12:59:43
|
||||
'\" RCS: @(#) $Id: CrtMathFnc.3,v 1.1.2.1 1998/09/24 23:58:21 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_CreateMathFunc 3 7.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+16
-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.
|
||||
'\"
|
||||
'\" SCCS: @(#) @(#) CrtObjCmd.3 1.10 97/07/31 14:10:38
|
||||
'\" RCS: @(#) $Id: CrtObjCmd.3,v 1.1.2.2 1998/09/24 23:58:22 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_CreateObjCommand 3 8.0 Tcl "Tcl Library Procedures"
|
||||
@@ -62,8 +62,10 @@ such that whenever \fIname\fR is
|
||||
invoked as a Tcl command (e.g., via a call to \fBTcl_EvalObj\fR)
|
||||
the Tcl interpreter will call \fIproc\fR to process the command.
|
||||
.PP
|
||||
\fBTcl_CreateObjCommand\fR will delete any command \fIname\fR
|
||||
already associated with the interpreter.
|
||||
\fBTcl_CreateObjCommand\fR deletes any existing command
|
||||
\fIname\fR already associated with the interpreter
|
||||
(however see below for an exception where the existing command
|
||||
is not deleted).
|
||||
It returns a token that may be used to refer
|
||||
to the command in subsequent calls to \fBTcl_GetCommandName\fR.
|
||||
If \fIname\fR contains any \fB::\fR namespace qualifiers,
|
||||
@@ -128,6 +130,17 @@ not modify them.
|
||||
Call \fBTcl_SetObjResult\fR if you want
|
||||
to return something from the \fIobjv\fR array.
|
||||
.PP
|
||||
Ordinarily, \fBTcl_CreateObjCommand\fR deletes any existing command
|
||||
\fIname\fR already associated with the interpreter.
|
||||
However, if the existing command was created by a previous call to
|
||||
\fBTcl_CreateCommand\fR,
|
||||
\fBTcl_CreateObjCommand\fR does not delete the command
|
||||
but instead arranges for the Tcl interpreter to call the
|
||||
\fBTcl_ObjCmdProc\fR \fIproc\fR in the future.
|
||||
The old string-based \fBTcl_CmdProc\fR associated with the command
|
||||
is retained and its address can be obtained by subsequent
|
||||
\fBTcl_GetCommandInfo\fR calls. This is done for backwards compatibility.
|
||||
.PP
|
||||
\fIDeleteProc\fR will be invoked when (if) \fIname\fR is deleted.
|
||||
This can occur through a call to \fBTcl_DeleteCommand\fR,
|
||||
\fBTcl_DeleteCommandFromToken\fR, or \fBTcl_DeleteInterp\fR,
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CrtSlave.3 1.26 97/07/31 18:00:14
|
||||
'\" RCS: @(#) $Id: CrtSlave.3,v 1.1.2.1 1998/09/24 23:58:22 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_CreateSlave 3 7.6 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CrtTimerHdlr.3 1.4 96/09/17 10:54:58
|
||||
'\" RCS: @(#) $Id: CrtTimerHdlr.3,v 1.1.2.1 1998/09/24 23:58:22 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_CreateTimerHandler 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) CrtTrace.3 1.14 96/03/25 20:01:10
|
||||
'\" RCS: @(#) $Id: CrtTrace.3,v 1.1.2.1 1998/09/24 23:58:22 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_CreateTrace 3 "" Tcl "Tcl Library Procedures"
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1999 Scriptics Corporation
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: CrtVersion.3,v 1.1.2.1 1999/03/11 19:28:48 redman Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_GetVersion 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_GetVersion \- get the version of the library at runtime
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
\fBTcl_GetVersion\fR(\fmajor, minor, patchLevel, type\fR)
|
||||
.SH ARGUMENTS
|
||||
.AP int *major out
|
||||
Major version number of the Tcl library.
|
||||
.AP int *minor out
|
||||
Minor version number of the Tcl library.
|
||||
.AP int *patchLevel out
|
||||
The patch level of the Tcl library (or alpha or beta number).
|
||||
.AP Tcl_ReleaseType *type out
|
||||
The type of release, also indicates the type of patch level. Can be
|
||||
one of \fBTCL_ALPHA_RELEASE\fR, \fBTCL_BETA_RELEASE\fR, or
|
||||
\fBTCL_FINAL_RELEASE\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTcl_GetVersion\fR should be used to query the version number
|
||||
of the Tcl library at runtime. This is useful when using a
|
||||
dynamically loaded Tcl library or when writing a stubs-aware
|
||||
extension. For instance, if you write an extension that is
|
||||
linked against the Tcl stubs library, it could be loaded into
|
||||
a program linked to an older version of Tcl than you expected.
|
||||
Use \fBTcl_GetVersion\fR to verify that fact, and possibly to
|
||||
change the behavior of your extension.
|
||||
.PP
|
||||
If may pass a NULL for any of the arguments. For instance if
|
||||
you do not care about the \fIpatchLevel\fI of the library, pass
|
||||
a NULL for the \fIpatchLevel\fI argument.
|
||||
|
||||
.SH KEYWORDS
|
||||
version, patchlevel, major, minor, alpha, beta, release
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) DString.3 1.20 96/08/26 12:59:44
|
||||
'\" RCS: @(#) $Id: DString.3,v 1.1.2.1 1998/09/24 23:58:22 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_DString 3 7.4 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) DetachPids.3 1.15 96/08/26 12:59:44
|
||||
'\" RCS: @(#) $Id: DetachPids.3,v 1.1.2.1 1998/09/24 23:58:22 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_DetachPids 3 "" Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) DoOneEvent.3 1.6 97/05/09 18:12:05
|
||||
'\" RCS: @(#) $Id: DoOneEvent.3,v 1.1.2.1 1998/09/24 23:58:22 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_DoOneEvent 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) DoWhenIdle.3 1.6 97/05/09 18:18:33
|
||||
'\" RCS: @(#) $Id: DoWhenIdle.3,v 1.1.2.1 1998/09/24 23:58:23 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_DoWhenIdle 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) @(#) DoubleObj.3 1.6 97/05/08 19:50:07
|
||||
'\" RCS: @(#) $Id: DoubleObj.3,v 1.1.2.1 1998/09/24 23:58:23 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_DoubleObj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+480
@@ -0,0 +1,480 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1997-1998 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: Encoding.3,v 1.1.2.4 1999/03/12 23:47:00 surles Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_GetEncoding 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_ExternalToUtfDString, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternal, Tcl_GetEncodingName, Tcl_SetSystemEncoding, Tcl_GetEncodingNames, Tcl_CreateEncoding \- procedures for creating and using encodings.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
Tcl_Encoding
|
||||
\fBTcl_GetEncoding\fR(\fIinterp, name\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_FreeEncoding\fR(\fIencoding\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_ExternalToUtfDString\fR(\fIencoding, src, srcLen, dstPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_ExternalToUtf\fR(\fIinterp, encoding, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr,
|
||||
dstCharsPtr\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_UtfToExternalDString\fR(\fIencoding, src, srcLen, dstPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfToExternal\fR(\fIinterp, encoding, src, srcLen, flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr,
|
||||
dstCharsPtr\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_GetEncodingName\fR(\fIencoding\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_SetSystemEncoding\fR(\fIinterp, name\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_GetEncodingNames\fR(\fIinterp\fR)
|
||||
.sp
|
||||
Tcl_Encoding
|
||||
\fBTcl_CreateEncoding\fR(\fItypePtr\fR)
|
||||
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_GetDefaultEncodingDir\fR(\fIvoid\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_SetDefaultEncodingDir\fR(\fIpath\fR)
|
||||
|
||||
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_EncodingState *dstWrotePtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter to use for error reporting, or NULL if no error reporting is
|
||||
desired.
|
||||
.AP "CONST char" *name in
|
||||
Name of encoding to load.
|
||||
.AP Tcl_Encoding encoding in
|
||||
The encoding to query, free, or use for converting text. If \fIencoding\fR is
|
||||
NULL, the current system encoding is used.
|
||||
.AP "CONST char" *src in
|
||||
For the \fBTcl_ExternalToUtf\fR functions, an array of bytes in the
|
||||
specified encoding that are to be converted to UTF-8. For the
|
||||
\fBTcl_UtfToExternal\fR functions, an array of UTF-8 characters to be
|
||||
converted to the specified encoding.
|
||||
.AP int srcLen in
|
||||
Length of \fIsrc\fR in bytes. If the length is negative, the
|
||||
encoding-specific length of the string is used.
|
||||
.AP Tcl_DString *dstPtr out
|
||||
Pointer to an uninitialized or free \fBTcl_DString\fR in which the converted
|
||||
result will be stored.
|
||||
.AP int flags in
|
||||
Various flag bits OR-ed together.
|
||||
TCL_ENCODING_START signifies that the
|
||||
source buffer is the first block in a (potentially multi-block) input
|
||||
stream, telling the conversion routine to reset to an initial state and
|
||||
perform any initialization that needs to occur before the first byte is
|
||||
converted. TCL_ENCODING_END signifies that the source buffer is the last
|
||||
block in a (potentially multi-block) input stream, telling the conversion
|
||||
routine to perform any finalization that needs to occur after the last
|
||||
byte is converted and then to reset to an initial state.
|
||||
TCL_ENCODING_STOPONERROR signifies that the conversion routine should
|
||||
return immediately upon reading a source character that doesn't exist in
|
||||
the target encoding; otherwise a default fallback character will
|
||||
automatically be substituted.
|
||||
.AP Tcl_EncodingState *statePtr in/out
|
||||
Used when converting a (generally long or indefinite length) byte stream
|
||||
in a piece by piece fashion. The conversion routine stores its current
|
||||
state in \fI*statePtr\fR after \fIsrc\fR (the buffer containing the
|
||||
current piece) has been converted; that state information must be passed
|
||||
back when converting the next piece of the stream so the conversion
|
||||
routine knows what state it was in when it left off at the end of the
|
||||
last piece. May be NULL, in which case the value specified for \fIflags\fR
|
||||
is ignored and the source buffer is assumed to contain the complete string to
|
||||
convert.
|
||||
.AP char *dst out
|
||||
Buffer in which the converted result will be stored. No more than
|
||||
\fIdstLen\fR bytes will be stored in \fIdst\fR.
|
||||
.AP int dstLen in
|
||||
The maximum length of the output buffer \fIdst\fR in bytes.
|
||||
.AP int *srcReadPtr out
|
||||
Filled with the number of bytes from \fIsrc\fR that were actually
|
||||
converted. This may be less than the original source length if there was
|
||||
a problem converting some source characters. May be NULL.
|
||||
.AP int *dstWrotePtr out
|
||||
Filled with the number of bytes that were actually stored in the output
|
||||
buffer as a result of the conversion. May be NULL.
|
||||
.AP int *dstCharsPtr out
|
||||
Filled with the number of characters that correspond to the number of bytes
|
||||
stored in the output buffer. May be NULL.
|
||||
.AP Tcl_EncodingType *typePtr in
|
||||
Structure that defines a new type of encoding.
|
||||
.AP char *path in
|
||||
A path to the location of the encoding file.
|
||||
.BE
|
||||
.SH INTRODUCTION
|
||||
.PP
|
||||
These routines convert between Tcl's internal character representation,
|
||||
UTF-8, and character representations used by various operating systems or
|
||||
file systems, such as Unicode, ASCII, or Shift-JIS. When operating on
|
||||
strings, such as such as obtaining the names of files or displaying
|
||||
characters using international fonts, the strings must be translated into
|
||||
one or possibly multiple formats that the various system calls can use. For
|
||||
instance, on a Japanese Unix workstation, a user might obtain a filename
|
||||
represented in the EUC-JP file encoding and then translate the characters to
|
||||
the jisx0208 font encoding in order to display the filename in a Tk widget.
|
||||
The purpose of the encoding package is to help bridge the translation gap.
|
||||
UTF-8 provides an intermediate staging ground for all the various
|
||||
encodings. In the example above, text would be translated into UTF-8 from
|
||||
whatever file encoding the operating system is using. Then it would be
|
||||
translated from UTF-8 into whatever font encoding the display routines
|
||||
require.
|
||||
.PP
|
||||
Some basic encodings are compiled into Tcl. Others can be defined by the
|
||||
user or dynamically loaded from encoding files in a
|
||||
platform-independent manner.
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTcl_GetEncoding\fR finds an encoding given its \fIname\fR. The name may
|
||||
refer to a builtin Tcl encoding, a user-defined encoding registered by
|
||||
calling \fBTcl_CreateEncoding\fR, or a dynamically-loadable encoding
|
||||
file. The return value is a token that represents the encoding and can be
|
||||
used in subsequent calls to procedures such as \fBTcl_GetEncodingName\fR,
|
||||
\fBTcl_FreeEncoding\fR, and \fBTcl_UtfToExternal\fR. If the name did not
|
||||
refer to any known or loadable encoding, NULL is returned and an error
|
||||
message is returned in \fIinterp\fR.
|
||||
.PP
|
||||
The encoding package maintains a database of all encodings currently in use.
|
||||
The first time \fIname\fR is seen, \fBTcl_GetEncoding\fR returns an
|
||||
encoding with a reference count of 1. If the same \fIname\fR is requested
|
||||
further times, then the reference count for that encoding is incremented
|
||||
without the overhead of allocating a new encoding and all its associated
|
||||
data structures.
|
||||
.PP
|
||||
When an \fIencoding\fR is no longer needed, \fBTcl_FreeEncoding\fR
|
||||
should be called to release it. When an \fIencoding\fR is no longer in use
|
||||
anywhere (i.e., it has been freed as many times as it has been gotten)
|
||||
\fBTcl_FreeEncoding\fR will release all storage the encoding was using
|
||||
and delete it from the database.
|
||||
.PP
|
||||
\fBTcl_ExternalToUtfDString\fR converts a source buffer \fIsrc\fR from the
|
||||
specified \fIencoding\fR into UTF-8. The converted bytes are stored in
|
||||
\fIdstPtr\fR, which is then NULL terminated. The caller should eventually
|
||||
call \fBTcl_DStringFree\fR to free any information stored in \fIdstPtr\fR.
|
||||
When converting, if any of the characters in the source buffer cannot be
|
||||
represented in the target encoding, a default fallback character will be
|
||||
used.
|
||||
.PP
|
||||
\fBTcl_ExternalToUtf\fR converts a source buffer \fIsrc\fR from the specified
|
||||
\fIencoding\fR into UTF-8. Up to \fIsrcLen\fR bytes are converted from the
|
||||
source buffer and up to \fIdstLen\fR converted bytes are stored in \fIdst\fR.
|
||||
In all cases, \fI*srcReadPtr\fR is filled with the number of bytes that were
|
||||
successfully converted from \fIsrc\fR and \fI*dstWrotePtr\fR is filled with
|
||||
the corresponding number of bytes that were stored in \fIdst\fR. The return
|
||||
value is one of the following:
|
||||
.RS
|
||||
.IP \fBTCL_OK\fR 29
|
||||
All bytes of \fIsrc\fR were converted.
|
||||
.IP \fBTCL_CONVERT_NOSPACE\fR 29
|
||||
The destination buffer was not large enough for all of the converted data; as
|
||||
many characters as could fit were converted though.
|
||||
.IP \fBTCL_CONVERT_MULTIBYTE\fR 29
|
||||
The last fews bytes in the source buffer were the beginning of a multibyte
|
||||
sequence, but more bytes were needed to complete this sequence. A
|
||||
subsequent call to the conversion routine should pass a buffer containing
|
||||
the unconverted bytes that remained in \fIsrc\fR plus some further bytes
|
||||
from the source stream to properly convert the formerly split-up multibyte
|
||||
sequence.
|
||||
.IP \fBTCL_CONVERT_SYNTAX\fR 29
|
||||
The source buffer contained an invalid character sequence. This may occur
|
||||
if the input stream has been damaged or if the input encoding method was
|
||||
misidentified.
|
||||
.IP \fBTCL_CONVERT_UNKNOWN\fR 29
|
||||
The source buffer contained a character that could not be represented in
|
||||
the target encoding and TCL_ENCODING_STOPONERROR was specified.
|
||||
.RE
|
||||
.LP
|
||||
\fBTcl_UtfToExternalDString\fR converts a source buffer \fIsrc\fR from UTF-8
|
||||
into the specified \fIencoding\fR. The converted bytes are stored in
|
||||
\fIdstPtr\fR, which is then terminated with the appropriate encoding-specific
|
||||
NULL. The caller should eventually call \fBTcl_DStringFree\fR to free any
|
||||
information stored in \fIdstPtr\fR. When converting, if any of the
|
||||
characters in the source buffer cannot be represented in the target
|
||||
encoding, a default fallback character will be used.
|
||||
.PP
|
||||
\fBTcl_UtfToExternal\fR converts a source buffer \fIsrc\fR from UTF-8 into
|
||||
the specified \fIencoding\fR. Up to \fIsrcLen\fR bytes are converted from
|
||||
the source buffer and up to \fIdstLen\fR converted bytes are stored in
|
||||
\fIdst\fR. In all cases, \fI*srcReadPtr\fR is filled with the number of
|
||||
bytes that were successfully converted from \fIsrc\fR and \fI*dstWrotePtr\fR
|
||||
is filled with the corresponding number of bytes that were stored in
|
||||
\fIdst\fR. The return values are the same as the return values for
|
||||
\fBTcl_ExternalToUtf\fR.
|
||||
.PP
|
||||
\fBTcl_GetEncodingName\fR is roughly the inverse of \fBTk_GetEncoding\fR.
|
||||
Given an \fIencoding\fR, the return value is the \fIname\fR argument that
|
||||
was used to create the encoding. The string returned by
|
||||
\fBTcl_GetEncodingName\fR is only guaranteed to persist until the
|
||||
\fIencoding\fR is deleted. The caller must not modify this string.
|
||||
.PP
|
||||
\fBTcl_SetSystemEncoding\fR sets the default encoding that should be used
|
||||
whenever the user passes a NULL value for the \fIencoding\fR argument to
|
||||
any of the other encoding functions. If \fIname\fR is NULL, the system
|
||||
encoding is reset to the default system encoding, \fBbinary\fR. If the
|
||||
name did not refer to any known or loadable encoding, TCL_ERROR is
|
||||
returned and an error message is left in \fIinterp\fR. Otherwise, this
|
||||
procedure increments the reference count of the new system encoding,
|
||||
decrements the reference count of the old system encoding, and returns
|
||||
TCL_OK.
|
||||
.PP
|
||||
\fBTcl_GetEncodingNames\fR sets the \fIinterp\fR result to a list
|
||||
consisting of the names of all the encodings that are currently defined
|
||||
or can be dynamically loaded, searching the encoding path specified by
|
||||
\fBTcl_SetEncodingPath\fR. This procedure does not ensure that the
|
||||
dynamically-loadable encoding files contain valid data, but merely that they
|
||||
exist.
|
||||
.PP
|
||||
\fBTcl_CreateEncoding\fR defines a new encoding and registers the C
|
||||
procedures that are called back to convert between the encoding and
|
||||
UTF-8. Encodings created by \fBTcl_CreateEncodingType\fR are thereafter
|
||||
visible in the database used by \fBTcl_GetEncoding\fR. Just as with the
|
||||
\fBTcl_GetEncoding\fR procedure, the return value is a token that
|
||||
represents the encoding and can be used in subsequent calls to other
|
||||
encoding functions. \fBTcl_CreateEncoding\fR returns an encoding with a
|
||||
reference count of 1. If an encoding with the specified \fIname\fR
|
||||
already exists, then its entry in the database is replaced with the new
|
||||
encoding; the token for the old encoding will remain valid and continue
|
||||
to behave as before, but users of the new token will now call the new
|
||||
encoding procedures.
|
||||
.PP
|
||||
The \fItypePtr\fR argument to \fBTcl_CreateEncoding\fR contains information
|
||||
about the name of the encoding and the procedures that will be called to
|
||||
convert between this encoding and UTF-8. It is defined as follows:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tcl_EncodingType {
|
||||
CONST char *\fIencodingName\fR;
|
||||
Tcl_EncodingConvertProc *\fItoUtfProc\fR;
|
||||
Tcl_EncodingConvertProc *\fIfromUtfProc\fR;
|
||||
Tcl_EncodingFreeProc *\fIfreeProc\fR;
|
||||
ClientData \fIclientData\fR;
|
||||
int \fInullSize\fR;
|
||||
} Tcl_EncodingType;
|
||||
.CE
|
||||
.PP
|
||||
The \fIencodingName\fR provides a string name for the encoding, by
|
||||
which it can be referred in other procedures such as
|
||||
\fBTcl_GetEncoding\fR. The \fItoUtfProc\fR refers to a callback
|
||||
procedure to invoke to convert text from this encoding into UTF-8.
|
||||
The \fIfromUtfProc\fR refers to a callback procedure to invoke to
|
||||
convert text from UTF-8 into this encoding. The \fIfreeProc\fR refers
|
||||
to a callback procedure to invoke when this encoding is deleted. The
|
||||
\fIfreeProc\fR field may be NULL. The \fIclientData\fR contains an
|
||||
arbitrary one-word value passed to \fItoUtfProc\fR, \fIfromUtfProc\fR,
|
||||
and \fIfreeProc\fR whenever they are called. Typically, this is a
|
||||
pointer to a data structure containing encoding-specific information
|
||||
that can be used by the callback procedures. For instance, two very
|
||||
similar encodings such as \fBascii\fR and \fBmacRoman\fR may use the
|
||||
same callback procedure, but use different values of \fIclientData\fR
|
||||
to control its behavior. The \fInullSize\fR specifies the number of
|
||||
zero bytes that signify end-of-string in this encoding. It must be
|
||||
\fB1\fR (for single-byte or multi-byte encodings like ASCII or
|
||||
Shift-JIS) or \fB2\fR (for double-byte encodings like Unicode).
|
||||
Constant-sized encodings with 3 or more bytes per character (such as
|
||||
CNS11643) are not accepted.
|
||||
.PP
|
||||
The callback procedures \fItoUtfProc\fR and \fIfromUtfProc\fR should match the
|
||||
type \fBTcl_EncodingConvertProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef int Tcl_EncodingConvertProc(
|
||||
ClientData \fIclientData\fR,
|
||||
CONST char *\fIsrc\fR,
|
||||
int \fIsrcLen\fR,
|
||||
int \fIflags\fR,
|
||||
Tcl_Encoding *\fIstatePtr\fR,
|
||||
char *\fIdst\fR,
|
||||
int \fIdstLen\fR,
|
||||
int *\fIsrcReadPtr\fR,
|
||||
int *\fIdstWrotePtr\fR,
|
||||
int *\fIdstCharsPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
The \fItoUtfProc\fR and \fIfromUtfProc\fR procedures are called by the
|
||||
\fBTcl_ExternalToUtf\fR or \fBTcl_UtfToExternal\fR family of functions to
|
||||
perform the actual conversion. The \fIclientData\fR parameter to these
|
||||
procedures is the same as the \fIclientData\fR field specified to
|
||||
\fBTcl_CreateEncoding\fR when the encoding was created. The remaining
|
||||
arguments to the callback procedures are the same as the arguments,
|
||||
documented at the top, to \fBTcl_ExternalToUtf\fR or
|
||||
\fBTcl_UtfToExternal\fR, with the following exceptions. If the
|
||||
\fIsrcLen\fR argument to one of those high-level functions is negative,
|
||||
the value passed to the callback procedure will be the appropriate
|
||||
encoding-specific string length of \fIsrc\fR. If any of the \fIsrcReadPtr\fR,
|
||||
\fIdstWrotePtr\fR, or \fIdstCharsPtr\fR arguments to one of the high-level
|
||||
functions is NULL, the corresponding value passed to the callback
|
||||
procedure will be a non-NULL location.
|
||||
.PP
|
||||
The callback procedure \fIfreeProc\fR, if non-NULL, should match the type
|
||||
\fBTcl_EncodingFreeProc\fR:
|
||||
.CS
|
||||
typedef void Tcl_EncodingFreeProc(
|
||||
ClientData \fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
This \fIfreeProc\fR function is called when the encoding is deleted. The
|
||||
\fIclientData\fR parameter is the same as the \fIclientData\fR field
|
||||
specified to \fBTcl_CreateEncoding\fR when the encoding was created.
|
||||
.PP
|
||||
|
||||
\fBTcl_GetDefaultEncodingDir\fR and \fBTcl_SetDefaultEncodingDir\fR
|
||||
access and set the directory to use when locating the default encoding
|
||||
files. If this value is not NULL, the \fBTclpInitLibraryPath\fR routine
|
||||
appends the path to the head of the search path, and uses this path as
|
||||
the first place to look into when trying to locate the encoding file.
|
||||
|
||||
.SH ENCODING FILES
|
||||
Space would prohibit precompiling into Tcl every possible encoding
|
||||
algorithm, so many encodings are stored on disk as dynamically-loadable
|
||||
encoding files. This behavior also allows the user to create additional
|
||||
encoding files that can be loaded using the same mechanism. These
|
||||
encoding files contain information about the tables and/or escape
|
||||
sequences used to map between an external encoding and Unicode. The
|
||||
external encoding may consist of single-byte, multi-byte, or double-byte
|
||||
characters.
|
||||
.PP
|
||||
Each dynamically-loadable encoding is represented as a text file. The
|
||||
initial line of the file, beginning with a ``#'' symbol, is a comment
|
||||
that provides a human-readable description of the file. The next line
|
||||
identifies the type of encoding file. It can be one of the following
|
||||
letters:
|
||||
.IP "[1] \fBS\fR"
|
||||
A single-byte encoding, where one character is always one byte long in the
|
||||
encoding. An example is \fBiso8859-1\fR, used by many European languages.
|
||||
.IP "[2] \fBD\fR"
|
||||
A double-byte encoding, where one character is always two bytes long in the
|
||||
encoding. An example is \fBbig5\fR, used for Chinese text.
|
||||
.IP "[3] \fBM\fR"
|
||||
A multi-byte encoding, where one character may be either one or two bytes long.
|
||||
Certain bytes are a lead bytes, indicating that another byte must follow
|
||||
and that together the two bytes represent one character. Other bytes are not
|
||||
lead bytes and represent themselves. An example is \fBshiftjis\fR, used by
|
||||
many Japanese computers.
|
||||
.IP "[4] \fBE\fR"
|
||||
An escape-sequence encoding, specifying that certain sequences of bytes
|
||||
do not represent characters, but commands that describe how following bytes
|
||||
should be interpreted.
|
||||
.PP
|
||||
The rest of the lines in the file depend on the type.
|
||||
.PP
|
||||
Cases [1], [2], and [3] are collectively referred to as table-based encoding
|
||||
files. The lines in a table-based encoding file are in the same
|
||||
format as this example taken from the \fBshiftjis\fR encoding (this is not
|
||||
the complete file):
|
||||
.CS
|
||||
# Encoding file: shiftjis, multi-byte
|
||||
M
|
||||
003F 0 40
|
||||
00
|
||||
0000000100020003000400050006000700080009000A000B000C000D000E000F
|
||||
0010001100120013001400150016001700180019001A001B001C001D001E001F
|
||||
0020002100220023002400250026002700280029002A002B002C002D002E002F
|
||||
0030003100320033003400350036003700380039003A003B003C003D003E003F
|
||||
0040004100420043004400450046004700480049004A004B004C004D004E004F
|
||||
0050005100520053005400550056005700580059005A005B005C005D005E005F
|
||||
0060006100620063006400650066006700680069006A006B006C006D006E006F
|
||||
0070007100720073007400750076007700780079007A007B007C007D203E007F
|
||||
0080000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000FF61FF62FF63FF64FF65FF66FF67FF68FF69FF6AFF6BFF6CFF6DFF6EFF6F
|
||||
FF70FF71FF72FF73FF74FF75FF76FF77FF78FF79FF7AFF7BFF7CFF7DFF7EFF7F
|
||||
FF80FF81FF82FF83FF84FF85FF86FF87FF88FF89FF8AFF8BFF8CFF8DFF8EFF8F
|
||||
FF90FF91FF92FF93FF94FF95FF96FF97FF98FF99FF9AFF9BFF9CFF9DFF9EFF9F
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
81
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
300030013002FF0CFF0E30FBFF1AFF1BFF1FFF01309B309C00B4FF4000A8FF3E
|
||||
FFE3FF3F30FD30FE309D309E30034EDD30053006300730FC20152010FF0F005C
|
||||
301C2016FF5C2026202520182019201C201DFF08FF0930143015FF3BFF3DFF5B
|
||||
FF5D30083009300A300B300C300D300E300F30103011FF0B221200B100D70000
|
||||
00F7FF1D2260FF1CFF1E22662267221E22342642264000B0203220332103FFE5
|
||||
FF0400A200A3FF05FF03FF06FF0AFF2000A72606260525CB25CF25CE25C725C6
|
||||
25A125A025B325B225BD25BC203B301221922190219121933013000000000000
|
||||
000000000000000000000000000000002208220B2286228722822283222A2229
|
||||
000000000000000000000000000000002227222800AC21D221D4220022030000
|
||||
0000000000000000000000000000000000000000222022A52312220222072261
|
||||
2252226A226B221A223D221D2235222B222C0000000000000000000000000000
|
||||
212B2030266F266D266A2020202100B6000000000000000025EF000000000000
|
||||
.CE
|
||||
.PP
|
||||
The third line of the file is three numbers. The first number is the
|
||||
fallback character (in base 16) to use when converting from UTF-8 to this
|
||||
encoding. The second number is a \fB1\fR if this file represents the
|
||||
encoding for a symbol font, or \fB0\fR otherwise. The last number (in base
|
||||
10) is how many pages of data follow.
|
||||
.PP
|
||||
Subsequent lines in the example above are pages that describe how to map
|
||||
from the encoding into 2-byte Unicode. The first line in a page identifies
|
||||
the page number. Following it are 256 double-byte numbers, arranged as 16
|
||||
rows of 16 numbers. Given a character in the encoding, the high byte of
|
||||
that character is used to select which page, and the low byte of that
|
||||
character is used as an index to select one of the double-byte numbers in
|
||||
that page \- the value obtained being the corresponding Unicode character.
|
||||
By examination of the example above, one can see that the characters 0x7E
|
||||
and 0x8163 in \fBshiftjis\fR map to 203E and 2026 in Unicode, respectively.
|
||||
.PP
|
||||
Following the first page will be all the other pages, each in the same
|
||||
format as the first: one number identifying the page followed by 256
|
||||
double-byte Unicode characters. If a character in the encoding maps to the
|
||||
Unicode character 0000, it means that the character doesn't actually exist.
|
||||
If all characters on a page would map to 0000, that page can be omitted.
|
||||
.PP
|
||||
Case [4] is the escape-sequence encoding file. The lines in an this type of
|
||||
file are in the same format as this example taken from the \fBiso2022-jp\fR
|
||||
encoding:
|
||||
.CS
|
||||
.ta 1.5i
|
||||
# Encoding file: iso2022-jp, escape-driven
|
||||
E
|
||||
init {}
|
||||
final {}
|
||||
iso8859-1 \\x1b(B
|
||||
jis0201 \\x1b(J
|
||||
jis0208 \\x1b$@
|
||||
jis0208 \\x1b$B
|
||||
jis0212 \\x1b$(D
|
||||
gb2312 \\x1b$A
|
||||
ksc5601 \\x1b$(C
|
||||
.CE
|
||||
.PP
|
||||
In the file, the first column represents an option and the second column
|
||||
is the associated value. \fBinit\fR is a string to emit or expect before
|
||||
the first character is converted, while \fBfinal\fR is a string to emit
|
||||
or expect after the last character. All other options are names of
|
||||
table-based encodings; the associated value is the escape-sequence that
|
||||
marks that encoding. Tcl syntax is used for the values; in the above
|
||||
example, for instance, ``\fB{}\fR'' represents the empty string and
|
||||
``\fB\\x1b\fR'' represents character 27.
|
||||
.PP
|
||||
When \fBTcl_GetEncoding\fR encounters an encoding \fIname\fR that has not
|
||||
been loaded, it attempts to load an encoding file called \fIname\fB.enc\fR
|
||||
from the \fBencoding\fR subdirectory of each directory specified in the
|
||||
library path \fB$tcl_libPath\fR. If the encoding file exists, but is
|
||||
malformed, an error message will be left in \fIinterp\fR.
|
||||
.SH KEYWORDS
|
||||
utf, encoding, convert
|
||||
|
||||
|
||||
|
||||
+137
-55
@@ -5,88 +5,173 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" SCCS: @(#) Eval.3 1.21 97/01/22 14:22:03
|
||||
'\" RCS: @(#) $Id: Eval.3,v 1.1.2.5 1999/03/10 06:49:10 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Eval 3 7.0 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_Eval 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_Eval, Tcl_VarEval, Tcl_EvalFile, Tcl_GlobalEval \- execute Tcl commands
|
||||
Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval, Tcl_VarEvalVA \- execute Tcl scripts
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
.VS
|
||||
int
|
||||
\fBTcl_Eval\fR(\fIinterp, cmd\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_VarEval\fR(\fIinterp, string, string, ... \fB(char *) NULL\fR)
|
||||
\fBTcl_EvalObjEx\fR(\fIinterp, objPtr, flags\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_EvalFile\fR(\fIinterp, fileName\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GlobalEval\fR(\fIinterp, cmd\fR)
|
||||
\fBTcl_EvalObjv\fR(\fIinterp, objc, objv, flags\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_Eval\fR(\fIinterp, script\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_EvalEx\fR(\fIinterp, script, numBytes, flags\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GlobalEval\fR(\fIinterp, script\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GlobalEvalObj\fR(\fIinterp, objPtr, flags\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_VarEval\fR(\fIinterp, string, string, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_VarEvalVA\fR(\fIinterp, argList\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp **termPtr;
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which to execute the command.
|
||||
A string result will be stored in \fIinterp->result\fR.
|
||||
.AP char *cmd in
|
||||
Command (or sequence of commands) to execute. Must be in writable
|
||||
memory (\fBTcl_Eval\fR makes temporary modifications to the command).
|
||||
.AP char *string in
|
||||
String forming part of Tcl command.
|
||||
Interpreter in which to execute the script. The interpreter's result is
|
||||
modified to hold the result or error message from the script.
|
||||
.AP Tcl_Obj *objPtr in
|
||||
A Tcl object containing the script to execute.
|
||||
.AP int flags in
|
||||
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 file containing Tcl command string.
|
||||
Name of a file containing a Tcl script.
|
||||
.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
|
||||
Points to an array of pointers to objects; each object holds the
|
||||
value of a single word in the command to execute.
|
||||
.AP int numBytes in
|
||||
The number of bytes in \fIscript\fR, not including any
|
||||
null terminating character. If \-1, then all characters up to the
|
||||
first null byte are used.
|
||||
.AP char *script in
|
||||
Points to first byte of script to execute. This script must be in
|
||||
writable memory: temporary modifications are made to it during
|
||||
parsing.
|
||||
.AP char *string in
|
||||
String forming part of a Tcl script.
|
||||
.AP va_list argList in
|
||||
An argument list which must have been initialised using
|
||||
\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
All four of these procedures execute Tcl commands.
|
||||
\fBTcl_Eval\fR is the core procedure and is used by all the others.
|
||||
It executes the commands in the script held by \fIcmd\fR
|
||||
until either an error occurs or it reaches the end of the script.
|
||||
The procedures described here are invoked to execute Tcl scripts in
|
||||
various forms.
|
||||
\fBTcl_EvalObjEx\fR is the core procedure and is used by many of the others.
|
||||
It executes the commands in the script stored in \fIobjPtr\fR
|
||||
until either an error occurs or the end of the script is reached.
|
||||
If this is the first time \fIobjPtr\fR has been executed,
|
||||
its commands are compiled into bytecode instructions
|
||||
which are then executed. The
|
||||
bytecodes are saved in \fIobjPtr\fR so that the compilation step
|
||||
can be skipped if the object is evaluated again in the future.
|
||||
.PP
|
||||
Note that \fBTcl_Eval\fR and \fBTcl_GlobalEval\fR
|
||||
have been largely replaced by the
|
||||
object-based procedures \fBTcl_EvalObj\fR and \fBTcl_GlobalEvalObj\fR.
|
||||
Those object-based procedures evaluate a script held in a Tcl object
|
||||
instead of a string.
|
||||
The object argument can retain the bytecode instructions for the script
|
||||
and so avoid reparsing the script each time it is executed.
|
||||
\fBTcl_Eval\fR is implemented using \fBTcl_EvalObj\fR
|
||||
but is slower because it must reparse the script each time
|
||||
since there is no object to retain the bytecode instructions.
|
||||
The return value from \fBTcl_EvalObjEx\fR (and all the other procedures
|
||||
described here) is a Tcl completion code with
|
||||
one of the values \fBTCL_OK\fR, \fBTCL_ERROR\fR, \fBTCL_RETURN\fR,
|
||||
\fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR.
|
||||
In addition, a result value or error message is left in \fIinterp\fR's
|
||||
result; it can be retrieved using \fBTcl_GetObjResult\fR.
|
||||
.PP
|
||||
The return value from \fBTcl_Eval\fR is one of the Tcl return codes
|
||||
\fBTCL_OK\fR, \fBTCL_ERROR\fR, \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or
|
||||
\fBTCL_CONTINUE\fR, and \fIinterp->result\fR will point to
|
||||
a string with additional information (a result value or error message).
|
||||
If an error occurs during compilation, this return information
|
||||
describes the error.
|
||||
Otherwise, this return information corresponds to the last command
|
||||
executed from \fIcmd\fR.
|
||||
\fBTcl_EvalFile\fR reads the file given by \fIfileName\fR and evaluates
|
||||
its contents as a Tcl script. It returns the same information as
|
||||
\fBTcl_EvalObjEx\fR.
|
||||
If the file couldn't be read then a Tcl error is returned to describe
|
||||
why the file couldn't be read.
|
||||
.PP
|
||||
\fBTcl_EvalObjv\fR executes a single pre-parsed command instead of a
|
||||
script. The \fIobjc\fR and \fIobjv\fR arguments contain the values
|
||||
of the words for the Tcl command, one word in each object in
|
||||
\fIobjv\fR. \fBTcl_EvalObjv\fR evaluates the command and returns
|
||||
a completion code and result just like \fBTcl_EvalObjEx\fR.
|
||||
.PP
|
||||
\fBTcl_Eval\fR is similar to \fBTcl_EvalObjEx\fR except that
|
||||
the script to be executed is supplied as a string instead of an
|
||||
object and no compilation occurs. The string is parsed and executed
|
||||
directly (using \fBTcl_EvalObjv\fR) instead of compiling it and
|
||||
executing the bytecodes. In situations where it is known that the
|
||||
script will never be executed again, \fBTcl_Eval\fR may be
|
||||
faster than \fBTcl_EvalObjEx\fR. \fBTcl_Eval\fR returns a completion
|
||||
code and result just like \fBTcl_EvalObjEx\fR. Note: for backward
|
||||
compatibility with versions before Tcl 8.0, \fBTcl_Eval\fR
|
||||
copies the object result in \fIinterp\fR to \fIinterp->result\fR
|
||||
where it can be accessed directly. This makes \fBTcl_Eval\fR somewhat
|
||||
slower than \fBTcl_EvalEx\fR, which doesn't do the copy.
|
||||
.PP
|
||||
\fBTcl_EvalEx\fR is an extended version of \fBTcl_Eval\fR that takes
|
||||
additional arguments \fInumBytes\fR and \fIflags\fR. For the
|
||||
efficiency reason given above, \fBTcl_EvalEx\fR is generally preferred
|
||||
over \fBTcl_Eval\fR.
|
||||
.PP
|
||||
\fBTcl_GlobalEval\fR and \fBTcl_GlobalEvalObj\fR are older procedures
|
||||
that are now deprecated. They are similar to \fBTcl_EvalEx\fR and
|
||||
\fBTcl_EvalObjEx\fR except that the script is evaluated in the global
|
||||
namespace and its variable context consists of global variables only
|
||||
(it ignores any Tcl procedures that are active). These functions are
|
||||
equivalent to using the \fBTCL_EVAL_GLOBAL\fR flag (see below).
|
||||
.PP
|
||||
\fBTcl_VarEval\fR takes any number of string arguments
|
||||
of any length, concatenates them into a single string,
|
||||
then calls \fBTcl_Eval\fR to execute that string as a Tcl command.
|
||||
It returns the result of the command and also modifies
|
||||
\fIinterp->result\fR in the usual fashion for Tcl commands.
|
||||
\fIinterp->result\fR in the same way as \fBTcl_Eval\fR.
|
||||
The last argument to \fBTcl_VarEval\fR must be NULL to indicate the end
|
||||
of arguments.
|
||||
of arguments. \fBTcl_VarEval\fR is now deprecated.
|
||||
.PP
|
||||
\fBTcl_EvalFile\fR reads the file given by \fIfileName\fR and evaluates
|
||||
its contents as a Tcl command by calling \fBTcl_Eval\fR. It returns
|
||||
a standard Tcl result that reflects the result of evaluating the file.
|
||||
If the file couldn't be read then a Tcl error is returned to describe
|
||||
why the file couldn't be read.
|
||||
\fBTcl_VarEvalVA\fR is the same as \fBTcl_VarEval\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument
|
||||
list. Like \fBTcl_VarEval\fR, \fBTcl_VarEvalVA\fR is deprecated.
|
||||
|
||||
.SH "FLAG BITS"
|
||||
Any ORed combination of the following values may be used for the
|
||||
\fIflags\fR argument to procedures such as \fBTcl_EvalObjEx\fR:
|
||||
.TP 23
|
||||
\fBTCL_EVAL_DIRECT\fR
|
||||
This flag is only used by \fBTcl_EvalObjEx\fR; it is ignored by
|
||||
other procedures. If this flag bit is set, the script is not
|
||||
compiled to bytecodes; instead it is executed directly
|
||||
as is done by \fBTcl_EvalEx\fR. The
|
||||
\fBTCL_EVAL_DIRECT\fR flag is useful in situations where the
|
||||
contents of an object are going to change immediately, so the
|
||||
bytecodes won't be reused in a future execution. In this case,
|
||||
it's faster to execute the script directly.
|
||||
.TP 23
|
||||
\fBTCL_EVAL_GLOBAL\fR
|
||||
If this flag is set, the script is processed at global level. This
|
||||
means that it is evaluated in the global namespace and its variable
|
||||
context consists of global variables only (it ignores any Tcl
|
||||
procedures at are active).
|
||||
|
||||
.SH "MISCELLANEOUS DETAILS"
|
||||
.PP
|
||||
During the processing of a Tcl command it is legal to make nested
|
||||
calls to evaluate other commands (this is how procedures and
|
||||
some control structures are implemented).
|
||||
If a code other than \fBTCL_OK\fR is returned
|
||||
from a nested \fBTcl_Eval\fR invocation,
|
||||
from a nested \fBTcl_EvalObjEx\fR invocation,
|
||||
then the caller should normally return immediately,
|
||||
passing that same return code back to its caller,
|
||||
and so on until the top-level application is reached.
|
||||
@@ -94,21 +179,18 @@ A few commands, like \fBfor\fR, will check for certain
|
||||
return codes, like \fBTCL_BREAK\fR and \fBTCL_CONTINUE\fR, and process them
|
||||
specially without returning.
|
||||
.PP
|
||||
\fBTcl_Eval\fR keeps track of how many nested \fBTcl_Eval\fR
|
||||
\fBTcl_EvalObjEx\fR keeps track of how many nested \fBTcl_EvalObjEx\fR
|
||||
invocations are in progress for \fIinterp\fR.
|
||||
If a code of \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR is
|
||||
about to be returned from the topmost \fBTcl_Eval\fR
|
||||
about to be returned from the topmost \fBTcl_EvalObjEx\fR
|
||||
invocation for \fIinterp\fR,
|
||||
it converts the return code to \fBTCL_ERROR\fR
|
||||
and sets \fIinterp->result\fR
|
||||
to point to an error message indicating that
|
||||
and sets \fIinterp\fR's result to an error message indicating that
|
||||
the \fBreturn\fR, \fBbreak\fR, or \fBcontinue\fR command was
|
||||
invoked in an inappropriate place.
|
||||
This means that top-level applications should never see a return code
|
||||
from \fBTcl_Eval\fR other then \fBTCL_OK\fR or \fBTCL_ERROR\fR.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_EvalObj, Tcl_GlobalEvalObj
|
||||
from \fBTcl_EvalObjEx\fR other then \fBTCL_OK\fR or \fBTCL_ERROR\fR.
|
||||
.VE
|
||||
|
||||
.SH KEYWORDS
|
||||
command, execute, file, global, object, object result, variable
|
||||
execute, file, global, object, result, script
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1996-1997 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" SCCS: @(#) EvalObj.3 1.4 97/01/22 15:18:44
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_EvalObj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_EvalObj, Tcl_GlobalEvalObj \- execute Tcl commands
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
int
|
||||
\fBTcl_EvalObj\fR(\fIinterp, objPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GlobalEvalObj\fR(\fIinterp, objPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp **termPtr;
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which to execute the command.
|
||||
The command's result will be stored in the interpreter's result object
|
||||
and can be retrieved using \fBTcl_GetObjResult\fR.
|
||||
.AP Tcl_Obj *objPtr in
|
||||
A Tcl object containing a command string
|
||||
(or sequence of commands in a string) to execute.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These two procedures execute Tcl commands.
|
||||
\fBTcl_EvalObj\fR is the core procedure
|
||||
and is used by \fBTcl_GlobalEvalObj\fR.
|
||||
It executes the commands in the script held by \fIobjPtr\fR
|
||||
until either an error occurs or it reaches the end of the script.
|
||||
If this is the first time \fIobjPtr\fR has been executed,
|
||||
its commands are compiled into bytecode instructions
|
||||
that are then executed if there are no compilation errors.
|
||||
.PP
|
||||
The return value from \fBTcl_EvalObj\fR is one of the Tcl return codes
|
||||
\fBTCL_OK\fR, \fBTCL_ERROR\fR, \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or
|
||||
\fBTCL_CONTINUE\fR,
|
||||
and a result object containing additional information
|
||||
(a result value or error message)
|
||||
that can be retrieved using \fBTcl_GetObjResult\fR.
|
||||
If an error occurs during compilation, this return information
|
||||
describes the error.
|
||||
Otherwise, this return information corresponds to the last command
|
||||
executed from \fIobjPtr\fR.
|
||||
.PP
|
||||
\fBTcl_GlobalEvalObj\fR is similar to \fBTcl_EvalObj\fR except that it
|
||||
processes the command at global level.
|
||||
This means that the variable context for the command consists of
|
||||
global variables only (it ignores any Tcl procedure that is active).
|
||||
This produces an effect similar to the Tcl command ``\fBuplevel 0\fR''.
|
||||
.PP
|
||||
During the processing of a Tcl command it is legal to make nested
|
||||
calls to evaluate other commands (this is how procedures and
|
||||
some control structures are implemented).
|
||||
If a code other than \fBTCL_OK\fR is returned
|
||||
from a nested \fBTcl_EvalObj\fR invocation,
|
||||
then the caller should normally return immediately,
|
||||
passing that same return code back to its caller,
|
||||
and so on until the top-level application is reached.
|
||||
A few commands, like \fBfor\fR, will check for certain
|
||||
return codes, like \fBTCL_BREAK\fR and \fBTCL_CONTINUE\fR, and process them
|
||||
specially without returning.
|
||||
.PP
|
||||
\fBTcl_EvalObj\fR keeps track of how many nested \fBTcl_EvalObj\fR
|
||||
invocations are in progress for \fIinterp\fR.
|
||||
If a code of \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR is
|
||||
about to be returned from the topmost \fBTcl_EvalObj\fR
|
||||
invocation for \fIinterp\fR,
|
||||
it converts the return code to \fBTCL_ERROR\fR
|
||||
and sets the interpreter's result object
|
||||
to point to an error message indicating that
|
||||
the \fBreturn\fR, \fBbreak\fR, or \fBcontinue\fR command was
|
||||
invoked in an inappropriate place.
|
||||
This means that top-level applications should never see a return code
|
||||
from \fBTcl_EvalObj\fR other then \fBTCL_OK\fR or \fBTCL_ERROR\fR.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_GetObjResult, Tcl_SetObjResult
|
||||
|
||||
.SH KEYWORDS
|
||||
command, execute, file, global, object, object result, variable
|
||||
+37
-9
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Exit.3 1.8 96/12/10 07:37:23
|
||||
'\" RCS: @(#) $Id: Exit.3,v 1.1.2.2 1998/09/24 23:58:23 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Exit 3 7.7 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_Exit 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_Exit, Tcl_Finalize, Tcl_CreateExitHandler, Tcl_DeleteExitHandler \- end the application (and invoke exit handlers)
|
||||
Tcl_Exit, Tcl_Finalize, Tcl_FinalizeThread, Tcl_CreateExitHandler, Tcl_DeleteExitHandler, Tcl_CreateThreadExitHandler, Tcl_DeleteThreadExitHandler \- end the application or thread (and invoke exit handlers)
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -22,10 +22,19 @@ Tcl_Exit, Tcl_Finalize, Tcl_CreateExitHandler, Tcl_DeleteExitHandler \- end the
|
||||
\fBTcl_CreateExitHandler\fR(\fIproc, clientData\fR)
|
||||
.sp
|
||||
\fBTcl_DeleteExitHandler\fR(\fIproc, clientData\fR)
|
||||
.sp
|
||||
\fBTcl_ExitThread\fR(\fIstatus\fR)
|
||||
.sp
|
||||
\fBTcl_FinalizeThread\fR()
|
||||
.sp
|
||||
\fBTcl_CreateThreadExitHandler\fR(\fIproc, clientData\fR)
|
||||
.sp
|
||||
\fBTcl_DeleteThreadExitHandler\fR(\fIproc, clientData\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_ExitProc clientData
|
||||
.AP int status in
|
||||
Provides information about why application exited. Exact meaning may
|
||||
Provides information about why the application or thread exited.
|
||||
Exact meaning may
|
||||
be platform-specific. 0 usually means a normal exit, any nonzero value
|
||||
usually means that an error occurred.
|
||||
.AP Tcl_ExitProc *proc in
|
||||
@@ -51,7 +60,6 @@ otherwise causes the application to terminate without calling
|
||||
\fBTcl_Exit\fR internally invokes the \fBexit\fR system call, thus it never
|
||||
returns control to its caller.
|
||||
.PP
|
||||
.VS
|
||||
\fBTcl_Finalize\fR is similar to \fBTcl_Exit\fR except that it does not
|
||||
exit from the current process.
|
||||
It is useful for cleaning up when a process is finished using \fBTcl\fR but
|
||||
@@ -64,10 +72,20 @@ However, to ensure portability, your code should always invoke
|
||||
\fBTcl_Finalize\fR when \fBTcl\fR is being unloaded, to ensure that the
|
||||
code will work on all platforms. \fBTcl_Finalize\fR can be safely called
|
||||
more than once.
|
||||
.PP
|
||||
.VS
|
||||
\fBTcl_ExitThread\fR is used to terminate the current thread and invoke
|
||||
per-thread exit handlers. This finalization is done by
|
||||
\fBTcl_FinalizeThread\fR, which you can call if you just want to clean
|
||||
up per-thread state and invoke the thread exit handlers.
|
||||
\fBTcl_Finalize\fR calls \fBTcl_FinalizeThread\fR for the current
|
||||
thread automatically.
|
||||
.VE
|
||||
.PP
|
||||
\fBTcl_CreateExitHandler\fR arranges for \fIproc\fR to be invoked
|
||||
by \fBTcl_Finalize\fR and \fBTcl_Exit\fR.
|
||||
\fBTcl_CreateThreadExitHandler\fR arranges for \fIproc\fR to be invoked
|
||||
by \fBTcl_FinalizeThread\fR and \fBTcl_ExitThread\fR.
|
||||
This provides a hook for cleanup operations such as flushing buffers
|
||||
and freeing global memory.
|
||||
\fIProc\fR should match the type \fBTcl_ExitProc\fR:
|
||||
@@ -76,16 +94,18 @@ typedef void Tcl_ExitProc(ClientData \fIclientData\fR);
|
||||
.CE
|
||||
The \fIclientData\fR parameter to \fIproc\fR is a
|
||||
copy of the \fIclientData\fR argument given to
|
||||
\fBTcl_CreateExitHandler\fR when the callback
|
||||
\fBTcl_CreateExitHandler\fR or \fBTcl_CreateThreadExitHandler\fR when
|
||||
the callback
|
||||
was created. Typically, \fIclientData\fR points to a data
|
||||
structure containing application-specific information about
|
||||
what to do in \fIproc\fR.
|
||||
.PP
|
||||
\fBTcl_DeleteExitHandler\fR may be called to delete a
|
||||
\fBTcl_DeleteExitHandler\fR and \fBTcl_DeleteThreadExitHandler\fR may be
|
||||
called to delete a
|
||||
previously-created exit handler. It removes the handler
|
||||
indicated by \fIproc\fR and \fIclientData\fR so that no call
|
||||
to \fIproc\fR will be made. If no such handler exists then
|
||||
\fBTcl_DeleteExitHandler\fR does nothing.
|
||||
\fBTcl_DeleteExitHandler\fR or \fBTcl_DeleteThreadExitHandler\fR does nothing.
|
||||
.PP
|
||||
.VS
|
||||
.PP
|
||||
@@ -98,6 +118,14 @@ If extension \fBA\fR registers its exit handlers before loading extension
|
||||
\fBB\fR, this ensures that any exit handlers for \fBB\fR will be executed
|
||||
before the exit handlers for \fBA\fR.
|
||||
.VE
|
||||
.VS
|
||||
.PP
|
||||
\fBTcl_Finalize\fR and \fBTcl_Exit\fR call \fBTcl_FinalizeThread\fR
|
||||
and the thread exit handlers \fIafter\fR
|
||||
the process-wide exit handlers. This is because thread finalization shuts
|
||||
down the I/O channel system, so any attempt at I/O by the global exit
|
||||
handlers will vanish into the bitbucket.
|
||||
.VE
|
||||
|
||||
.SH KEYWORDS
|
||||
callback, cleanup, dynamic loading, end application, exit, unloading
|
||||
callback, cleanup, dynamic loading, end application, exit, unloading, thread
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) ExprLong.3 1.26 97/06/26 13:42:47
|
||||
'\" RCS: @(#) $Id: ExprLong.3,v 1.1.2.1 1998/09/24 23:58:23 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_ExprLong 3 7.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) ExprLongObj.3 1.6 97/06/26 13:41:12
|
||||
'\" RCS: @(#) $Id: ExprLongObj.3,v 1.1.2.1 1998/09/24 23:58:23 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_ExprLongObj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+15
-5
@@ -4,19 +4,22 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" SCCS: @(#) FindExec.3 1.4 96/10/09 08:29:29
|
||||
'\" RCS: @(#) $Id: FindExec.3,v 1.1.2.1 1998/09/24 23:58:23 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_FindExecutable 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_FindExecutable \- identify the binary file containing the application
|
||||
Tcl_FindExecutable, Tcl_GetNameOfExecutable \- identify or return the name of the binary file containing the application
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_FindExecutable\fR(\fIargv0\fR)
|
||||
.sp
|
||||
CONST char *
|
||||
\fBTcl_GetNameOfExecutable\fR()
|
||||
.SH ARGUMENTS
|
||||
.AS char *argv0 in
|
||||
.AP char *argv0 in
|
||||
@@ -26,9 +29,9 @@ application's name.
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This procedure computes the full path name of the executable file
|
||||
from which the application was invoked and saves it for Tcl's
|
||||
internal use.
|
||||
The \fBTcl_FindExecutable\fR procedure computes the full path name of
|
||||
the executable file from which the application was invoked and saves
|
||||
it for Tcl's internal use.
|
||||
The executable's path name is needed for several purposes in
|
||||
Tcl. For example, it is needed on some platforms in the
|
||||
implementation of the \fBload\fR command.
|
||||
@@ -41,6 +44,13 @@ along with the \fBPATH\fR environment variable to find the
|
||||
application's executable, if possible. If it fails to find
|
||||
the binary, then future calls to \fBinfo nameofexecutable\fR
|
||||
will return an empty string.
|
||||
.PP
|
||||
\fBTcl_GetNameOfExecutable\fR simply returns a pointer to the
|
||||
internal full path name of the executable file as computed by
|
||||
\fBTcl_FindExecutable\fR. This procedure call is the C API
|
||||
equivalent to the \fBinfo nameofexecutable\fR command. NULL
|
||||
is returned if the internal full path name has not been
|
||||
computed or unknown.
|
||||
|
||||
.SH KEYWORDS
|
||||
binary, executable file
|
||||
|
||||
+27
-4
@@ -4,10 +4,10 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" SCCS: @(#) @(#) GetIndex.3 1.3 97/07/30 16:21:05
|
||||
'\" RCS: @(#) $Id: GetIndex.3,v 1.1.2.2 1998/09/24 23:58:24 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_GetIndexFromObj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_GetIndexFromObj 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_GetIndexFromObj \- lookup string in table of keywords
|
||||
@@ -16,7 +16,14 @@ Tcl_GetIndexFromObj \- lookup string in table of keywords
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetIndexFromObj\fR(\fIinterp, objPtr, tablePtr, msg, flags, indexPtr\fR)
|
||||
\fBTcl_GetIndexFromObj\fR(\fIinterp, objPtr, tablePtr, msg, flags,
|
||||
indexPtr\fR)
|
||||
.VS
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetIndexFromObjStruct\fR(\fIinterp, objPtr, tablePtr, offset,
|
||||
msg, flags, indexPtr\fR)
|
||||
.VE
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp **tablePtr
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -29,6 +36,11 @@ table entry.
|
||||
.AP char **tablePtr in
|
||||
An array of null-terminated strings. The end of the array is marked
|
||||
by a NULL string pointer.
|
||||
.VS
|
||||
.AP int offset in
|
||||
The offset to add to tablePtr to get to the next string in the
|
||||
list. The end of the array is marked by a NULL string pointer.
|
||||
.VE
|
||||
.AP char *msg in
|
||||
Null-terminated string describing what is being looked up, such as
|
||||
\fBoption\fR. This string is included in error messages.
|
||||
@@ -68,7 +80,18 @@ is invoked again with the same \fIobjPtr\fR and \fItablePtr\fR
|
||||
arguments (e.g. during a reinvocation of a Tcl command), it returns
|
||||
the matching index immediately without having to redo the lookup
|
||||
operation. Note: \fBTcl_GetIndexFromObj\fR assumes that the entries
|
||||
in \fItablePtr\fR are static: they must not change between invocations.
|
||||
in \fItablePtr\fR are static: they must not change between
|
||||
invocations.
|
||||
.VS
|
||||
.PP
|
||||
\fBTcl_GetIndexFromObjStruct\fR works just like
|
||||
\fBTcl_GetIndexFromObj\fR, except that instead of treating
|
||||
\fItablePtr\fR as an array of string pointers, it treats it as the
|
||||
first in a series of string ptrs that are spaced apart by \fIoffset\fR
|
||||
bytes. This is particularly useful when processing things like
|
||||
\fBTk_ConfigurationSpec\fR, whose string keys are in the same place in
|
||||
each of several array elements.
|
||||
.VE
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_WrongNumArgs
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) GetInt.3 1.12 96/03/25 20:03:44
|
||||
'\" RCS: @(#) $Id: GetInt.3,v 1.1.2.1 1998/09/24 23:58:24 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_GetInt 3 "" Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) GetOpnFl.3 1.3 97/04/23 16:14:43
|
||||
'\" RCS: @(#) $Id: GetOpnFl.3,v 1.1.2.1 1998/09/24 23:58:24 stanton Exp $
|
||||
.so man.macros
|
||||
.TH Tcl_GetOpenFile 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" @(#) GetStdChan.3 1.2 96/03/08 13:59:57
|
||||
'\" RCS: @(#) $Id: GetStdChan.3,v 1.1.2.1 1998/09/24 23:58:24 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_GetStdChannel 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Hash.3 1.15 96/03/25 20:04:01
|
||||
'\" RCS: @(#) $Id: Hash.3,v 1.1.2.1 1998/09/24 23:58:24 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Hash 3 "" Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) @(#) IntObj.3 1.7 97/05/08 19:49:22
|
||||
'\" RCS: @(#) $Id: IntObj.3,v 1.1.2.1 1998/09/24 23:58:24 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_IntObj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Interp.3 1.16 96/06/06 13:48:02
|
||||
'\" RCS: @(#) $Id: Interp.3,v 1.1.2.1 1998/09/24 23:58:24 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Interp 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) LinkVar.3 1.15 96/09/05 17:16:57
|
||||
'\" RCS: @(#) $Id: LinkVar.3,v 1.1.2.1 1998/09/24 23:58:24 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_LinkVar 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) @(#) ListObj.3 1.10 97/10/08 11:36:58
|
||||
'\" RCS: @(#) $Id: ListObj.3,v 1.1.2.1 1998/09/24 23:58:24 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_ListObj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Notifier.3 1.16 97/05/17 17:03:17
|
||||
'\" RCS: @(#) $Id: Notifier.3,v 1.1.2.1 1998/09/24 23:58:25 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Notifier 3 8.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
-162
@@ -1,162 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1996-1997 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" SCCS: @(#) ObjSetVar.3 1.6 97/05/19 17:35:44
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_ObjSetVar2 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_ObjSetVar2, Tcl_ObjGetVar2 \- manipulate Tcl variables
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_ObjSetVar2\fR(\fIinterp, part1Ptr, part2Ptr, newValuePtr, flags\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_ObjGetVar2\fR(\fIinterp, part1Ptr, part2Ptr, flags\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *newValuePtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter containing variable.
|
||||
.AP Tcl_Obj *part1Ptr in
|
||||
Points to a Tcl object containing the variable's name.
|
||||
The name may include a series of \fB::\fR namespace qualifiers
|
||||
to specify a variable in a particular namespace.
|
||||
May refer to a scalar variable or an element of an array variable.
|
||||
.AP Tcl_Obj *part2Ptr in
|
||||
If non-NULL, points to an object containing the name of an element
|
||||
within an array and \fIpart1Ptr\fR must refer to an array variable.
|
||||
.AP Tcl_Obj *newValuePtr in
|
||||
Points to a Tcl object containing the new value for the variable.
|
||||
.AP int flags in
|
||||
OR-ed combination of bits providing additional information for
|
||||
operation. See below for valid values.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These two procedures may be used to read and modify
|
||||
Tcl variables from C code.
|
||||
\fBTcl_ObjSetVar2\fR will create a new variable or modify an existing one.
|
||||
It sets the specified variable to
|
||||
the object referenced by \fInewValuePtr\fR
|
||||
and returns a pointer to the object which is the variable's new value.
|
||||
The returned object may not be the same one
|
||||
referenced by \fInewValuePtr\fR;
|
||||
this might happen because variable traces may modify the variable's value.
|
||||
The reference count for the variable's old value is decremented
|
||||
and the reference count for its new value is incremented.
|
||||
If the new value for the variable
|
||||
is not the same one referenced by \fInewValuePtr\fR
|
||||
(perhaps as a result of a variable trace),
|
||||
then \fInewValuePtr\fR's reference count is left unchanged.
|
||||
The reference count for the returned object is not incremented
|
||||
to reflect the returned reference.
|
||||
If the caller needs to keep a reference to the object,
|
||||
say in a data structure,
|
||||
it must increment its reference count using \fBTcl_IncrRefCount\fR.
|
||||
If an error occurs in setting the variable
|
||||
(e.g. an array variable is referenced
|
||||
without giving an index into the array),
|
||||
then NULL is returned.
|
||||
.PP
|
||||
The variable name specified to \fBTcl_ObjSetVar2\fR consists of two parts.
|
||||
\fIpart1Ptr\fR contains the name of a scalar or array variable.
|
||||
If \fIpart2Ptr\fR is NULL, the variable must be a scalar.
|
||||
If \fIpart2Ptr\fR is not NULL,
|
||||
it contains the name of an element in the array named by \fIpart2Ptr\fR.
|
||||
As a special case, if the flag TCL_PARSE_PART1 is specified,
|
||||
\fIpart1Ptr\fR may contain both an array and an element name:
|
||||
if the name contains an open parenthesis and ends with a
|
||||
close parenthesis, then the value between the parentheses is
|
||||
treated as an element name (which can have any string value) and
|
||||
the characters before the first open
|
||||
parenthesis are treated as the name of an array variable.
|
||||
If the flag TCL_PARSE_PART1 is given,
|
||||
\fIpart2Ptr\fR should be NULL since the array and element names
|
||||
are taken from \fIpart2Ptr\fR.
|
||||
.PP
|
||||
The \fIflags\fR argument may be used to specify any of several
|
||||
options to the procedures.
|
||||
It consists of an OR-ed combination of any of the following
|
||||
bits:
|
||||
.TP
|
||||
\fBTCL_GLOBAL_ONLY\fR
|
||||
Under normal circumstances the procedures look up variables as follows:
|
||||
If a procedure call is active in \fIinterp\fR,
|
||||
a variable is looked up at the current level of procedure call.
|
||||
Otherwise, a variable is looked up first in the current namespace,
|
||||
then in the global namespace.
|
||||
However, if this bit is set in \fIflags\fR then the variable
|
||||
is looked up only in the global namespace
|
||||
even if there is a procedure call active.
|
||||
If both \fBTCL_GLOBAL_ONLY\fR and \fBTCL_NAMESPACE_ONLY\fR are given,
|
||||
\fBTCL_GLOBAL_ONLY\fR is ignored.
|
||||
.TP
|
||||
\fBTCL_NAMESPACE_ONLY\fR
|
||||
Under normal circumstances the procedures look up variables as follows:
|
||||
If a procedure call is active in \fIinterp\fR,
|
||||
a variable is looked up at the current level of procedure call.
|
||||
Otherwise, a variable is looked up first in the current namespace,
|
||||
then in the global namespace.
|
||||
However, if this bit is set in \fIflags\fR then the variable
|
||||
is looked up only in the current namespace
|
||||
even if there is a procedure call active.
|
||||
.TP
|
||||
\fBTCL_LEAVE_ERR_MSG\fR
|
||||
If an error is returned and this bit is set in \fIflags\fR, then
|
||||
an error message will be left in the interpreter's result,
|
||||
where it can be retrieved with \fBTcl_GetObjResult\fR
|
||||
or \fBTcl_GetStringResult\fR.
|
||||
If this flag bit isn't set then no error message is left
|
||||
and the interpreter's result will not be modified.
|
||||
.TP
|
||||
\fBTCL_APPEND_VALUE\fR
|
||||
If this bit is set then \fInewValuePtr\fR is appended to the current
|
||||
value, instead of replacing it.
|
||||
If the variable is currently undefined, then this bit is ignored.
|
||||
.TP
|
||||
\fBTCL_LIST_ELEMENT\fR
|
||||
If this bit is set, then \fInewValuePtr\fR is converted to a valid
|
||||
Tcl list element before setting (or appending to) the variable.
|
||||
A separator space is appended before the new list element unless
|
||||
the list element is going to be the first element in a list or
|
||||
sublist (i.e. the variable's current value is empty, or contains
|
||||
the single character ``{'', or ends in `` }'').
|
||||
.TP
|
||||
\fBTCL_PARSE_PART1\fR
|
||||
If this bit is set,
|
||||
then \fBTcl_ObjGetVar2\fR and \fBTcl_ObjSetVar2\fR
|
||||
will parse \fIpart1Ptr\fR
|
||||
to obtain both an array name and an element name.
|
||||
If the name in \fIpart1Ptr\fR contains an open parenthesis
|
||||
and ends with a close parenthesis,
|
||||
the name is treated as the name of an element of an array;
|
||||
otherwise, the name in \fIpart1Ptr\fR
|
||||
is interpreted as the name of a scalar variable.
|
||||
When this bit is set,
|
||||
\fIpart2Ptr\fR is ignored.
|
||||
.PP
|
||||
\fBTcl_ObjGetVar2\fR returns the value of the specified variable.
|
||||
Its arguments are treated the same way as those for \fBTcl_ObjSetVar2\fR.
|
||||
It returns a pointer to the object which is the variable's value.
|
||||
The reference count for the returned object is not incremented.
|
||||
If the caller needs to keep a reference to the object,
|
||||
say in a data structure,
|
||||
it must increment the reference count using \fBTcl_IncrRefCount\fR.
|
||||
If an error occurs in setting the variable
|
||||
(e.g. an array variable is referenced
|
||||
without giving an index into the array),
|
||||
then NULL is returned.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_GetObjResult, Tcl_GetStringResult, Tcl_GetVar, Tcl_GetVar2, Tcl_SetVar, Tcl_SetVar2, Tcl_TraceVar, Tcl_UnsetVar, Tcl_UnsetVar2
|
||||
|
||||
.SH KEYWORDS
|
||||
array, interpreter, object, scalar, set, unset, variable
|
||||
+6
-5
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) @(#) Object.3 1.10 97/07/22 11:40:10
|
||||
'\" RCS: @(#) $Id: Object.3,v 1.1.2.2 1998/09/24 23:58:25 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Obj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
@@ -85,7 +85,7 @@ Because of this representation invalidation and regeneration,
|
||||
it is dangerous for extension writers to access
|
||||
\fBTcl_Obj\fR fields directly.
|
||||
It is better to access Tcl_Obj information using
|
||||
procedures like \fBTcl_GetStringFromObj\fR.
|
||||
procedures like \fBTcl_GetStringFromObj\fR and \fBTcl_GetString\fR.
|
||||
.PP
|
||||
Objects are allocated on the heap
|
||||
and are referenced using a pointer to their \fBTcl_Obj\fR structure.
|
||||
@@ -138,7 +138,7 @@ The byte array must always have a null after the last byte,
|
||||
at offset \fIlength\fR;
|
||||
this allows string representations that do not contain nulls
|
||||
to be treated as conventional null-terminated C strings.
|
||||
C programs use \fBTcl_GetStringFromObj\fR to get
|
||||
C programs use \fBTcl_GetStringFromObj\fR and \fBTcl_GetString\fR to get
|
||||
an object's string representation.
|
||||
If \fIbytes\fR is NULL,
|
||||
the string representation is invalid.
|
||||
@@ -177,7 +177,8 @@ An object typically starts out containing only a string representation:
|
||||
it is untyped and has a NULL \fItypePtr\fR.
|
||||
An object containing an empty string or a copy of a specified string
|
||||
is created using \fBTcl_NewObj\fR or \fBTcl_NewStringObj\fR respectively.
|
||||
An object's string value is gotten with \fBTcl_GetStringFromObj\fR
|
||||
An object's string value is gotten with
|
||||
\fBTcl_GetStringFromObj\fR or \fBTcl_GetString\fR
|
||||
and changed with \fBTcl_SetStringObj\fR.
|
||||
If the object is later passed to a procedure like \fBTcl_GetIntFromObj\fR
|
||||
that requires a specific internal representation,
|
||||
@@ -187,7 +188,7 @@ An object's two representations are duals of each other:
|
||||
changes made to one are reflected in the other.
|
||||
For example, \fBTcl_ListObjReplace\fR will modify an object's
|
||||
internal representation and the next call to \fBTcl_GetStringFromObj\fR
|
||||
will reflect that change.
|
||||
or \fBTcl_GetString\fR will reflect that change.
|
||||
.PP
|
||||
Representations are recomputed lazily for efficiency.
|
||||
A change to one representation made by a procedure
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) ObjectType.3 1.8 97/04/30 15:42:29
|
||||
'\" RCS: @(#) $Id: ObjectType.3,v 1.1.2.1 1998/09/24 23:58:25 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_ObjType 3 8.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+188
-121
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) OpenFileChnl.3 1.40 97/09/29 11:22:49
|
||||
'\" RCS: @(#) $Id: OpenFileChnl.3,v 1.1.2.2 1998/09/24 23:58:25 stanton Exp $
|
||||
.so man.macros
|
||||
.TH Tcl_OpenFileChannel 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_OpenFileChannel 3 8.1 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_Read, Tcl_Gets, Tcl_Write, Tcl_Flush, Tcl_Seek, Tcl_Tell, Tcl_Eof, Tcl_InputBlocked, Tcl_InputBuffered, Tcl_GetChannelOption, Tcl_SetChannelOption \- buffered I/O facilities using channels
|
||||
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
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -22,7 +22,7 @@ Tcl_Channel
|
||||
.sp
|
||||
Tcl_Channel
|
||||
\fBTcl_OpenCommandChannel\fR(\fIinterp, argc, argv, flags\fR)
|
||||
.VS
|
||||
.VS 8.0
|
||||
.sp
|
||||
Tcl_Channel
|
||||
\fBTcl_MakeFileChannel\fR(\fIhandle, readOrWrite\fR)
|
||||
@@ -40,17 +40,28 @@ int
|
||||
int
|
||||
\fBTcl_Close\fR(\fIinterp, channel\fR)
|
||||
.sp
|
||||
.VS 8.1
|
||||
int
|
||||
\fBTcl_Read\fR(\fIchannel, buf, toRead\fR)
|
||||
\fBTcl_ReadChars\fR(\fIchannel, readObjPtr, charsToRead, appendFlag\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_Gets\fR(\fIchannel, lineRead\fR)
|
||||
\fBTcl_Read\fR(\fIchannel, byteBuf, bytesToRead\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetsObj\fR(\fIchannel, lineObjPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_Write\fR(\fIchannel, buf, toWrite\fR)
|
||||
\fBTcl_Gets\fR(\fIchannel, lineRead\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_WriteObj\fR(\fIchannel, writeObjPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_WriteChars\fR(\fIchannel, charBuf, bytesToWrite\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_Write\fR(\fIchannel, byteBuf, bytesToWrite\fR)
|
||||
.VE
|
||||
.sp
|
||||
int
|
||||
\fBTcl_Flush\fR(\fIchannel\fR)
|
||||
@@ -83,37 +94,36 @@ Used for error reporting and to look up a channel registered in it.
|
||||
.AP char *fileName in
|
||||
The name of a local or network file.
|
||||
.AP char *mode in
|
||||
Specifies how the file is to be accessed. May have any of the
|
||||
values allowed for the \fImode\fR argument to the Tcl
|
||||
\fBopen\fR command.
|
||||
For \fBTcl_OpenCommandChannel\fR, may be NULL.
|
||||
Specifies how the file is to be accessed. May have any of the values
|
||||
allowed for the \fImode\fR argument to the Tcl \fBopen\fR command. For
|
||||
\fBTcl_OpenCommandChannel\fR, may be NULL.
|
||||
.AP int permissions in
|
||||
POSIX-style permission flags such as 0644.
|
||||
If a new file is created, these permissions will be set on the
|
||||
created file.
|
||||
POSIX-style permission flags such as 0644. If a new file is created, these
|
||||
permissions will be set on the created file.
|
||||
.AP int argc in
|
||||
The number of elements in \fIargv\fR.
|
||||
.AP char **argv in
|
||||
Arguments for constructing a command pipeline.
|
||||
These values have the same meaning as the non-switch arguments
|
||||
to the Tcl \fBexec\fR command.
|
||||
Arguments for constructing a command pipeline. These values have the same
|
||||
meaning as the non-switch arguments to the Tcl \fBexec\fR command.
|
||||
.AP int flags in
|
||||
Specifies the disposition of the stdio handles in pipeline: OR-ed
|
||||
combination of \fBTCL_STDIN\fR, \fBTCL_STDOUT\fR, \fBTCL_STDERR\fR,
|
||||
and \fBTCL_ENFORCE_MODE\fR. If \fBTCL_STDIN\fR is set, stdin for
|
||||
the first child in the pipe is the pipe channel, otherwise it is the same
|
||||
as the standard input of the invoking process; likewise for
|
||||
\fBTCL_STDOUT\fR and \fBTCL_STDERR\fR. If \fBTCL_ENFORCE_MODE\fR is not set,
|
||||
then the pipe can redirect stdio handles to override the stdio handles for
|
||||
which \fBTCL_STDIN\fR, \fBTCL_STDOUT\fR and \fBTCL_STDERR\fR have been set.
|
||||
If it is set, then such redirections cause an error.
|
||||
.VS
|
||||
combination of \fBTCL_STDIN\fR, \fBTCL_STDOUT\fR, \fBTCL_STDERR\fR, and
|
||||
\fBTCL_ENFORCE_MODE\fR. If \fBTCL_STDIN\fR is set, stdin for the first child
|
||||
in the pipe is the pipe channel, otherwise it is the same as the standard
|
||||
input of the invoking process; likewise for \fBTCL_STDOUT\fR and
|
||||
\fBTCL_STDERR\fR. If \fBTCL_ENFORCE_MODE\fR is not set, then the pipe can
|
||||
redirect stdio handles to override the stdio handles for which
|
||||
\fBTCL_STDIN\fR, \fBTCL_STDOUT\fR and \fBTCL_STDERR\fR have been set. If it
|
||||
is set, then such redirections cause an error.
|
||||
.VS 8.0
|
||||
.AP ClientData handle in
|
||||
Operating system specific handle for I/O to a file. For Unix this is a
|
||||
file descriptor, for Windows it is a HANDLE.
|
||||
.AP int readOrWrite in
|
||||
OR-ed combination of \fBTCL_READABLE\fR and \fBTCL_WRITABLE\fR to indicate
|
||||
what operations are valid on \fIhandle\fR.
|
||||
.AP char *channelName in
|
||||
The name of the channel.
|
||||
.VE
|
||||
.AP int *modePtr out
|
||||
Points at an integer variable that will receive an OR-ed combination of
|
||||
@@ -122,26 +132,40 @@ open for reading and writing.
|
||||
.AP Tcl_Channel channel in
|
||||
A Tcl channel for input or output. Must have been the return value
|
||||
from a procedure such as \fBTcl_OpenFileChannel\fR.
|
||||
.AP char *buf in
|
||||
An array of bytes in which to store channel input, or from which
|
||||
to read channel output.
|
||||
.AP int len in
|
||||
The length of the input or output.
|
||||
.AP int atEnd in
|
||||
If nonzero, store the input at the end of the input queue, otherwise store
|
||||
it at the head of the input queue.
|
||||
.AP int toRead in
|
||||
The number of bytes to read from the channel.
|
||||
.AP Tcl_DString *lineRead in
|
||||
A pointer to a Tcl dynamic string in which to store the line read from the
|
||||
channel. Must have been initialized by the caller. The line read
|
||||
will be appended to any data already in the dynamic string.
|
||||
.AP Tcl_Obj *linePtrObj in
|
||||
.VS 8.1 br
|
||||
.AP Tcl_Obj *readObjPtr in/out
|
||||
A pointer to a Tcl Object in which to store the characters read from the
|
||||
channel.
|
||||
.AP int charsToRead in
|
||||
The number of characters to read from the channel. If the channel's encoding
|
||||
is \fBbinary\fR, this is equivalent to the number of bytes to read from the
|
||||
channel.
|
||||
.AP int appendFlag in
|
||||
If non-zero, data read from the channel will be appended to the object.
|
||||
Otherwise, the data will replace the existing contents of the object.
|
||||
.AP char *readBuf out
|
||||
A buffer in which to store the bytes read from the channel.
|
||||
.AP int bytesToRead in
|
||||
The number of bytes to read from the channel. The buffer \fIreadBuf\fR must
|
||||
be large enough to hold this many bytes.
|
||||
.AP Tcl_Obj *lineObjPtr in/out
|
||||
A pointer to a Tcl object in which to store the line read from the
|
||||
channel. The line read will be appended to the current value of the
|
||||
object.
|
||||
.AP int toWrite in
|
||||
The number of bytes to read from \fIbuf\fR and output to the channel.
|
||||
.AP Tcl_DString *lineRead in/out
|
||||
A pointer to a Tcl dynamic string in which to store the line read from the
|
||||
channel. Must have been initialized by the caller. The line read will be
|
||||
appended to any data already in the dynamic string.
|
||||
.AP Tcl_Obj *writeObjPtr in
|
||||
A pointer to a Tcl Object whose contents will be output to the channel.
|
||||
.AP "CONST char" *charBuf in
|
||||
A buffer containing the characters to output to the channel.
|
||||
.AP char *byteBuf in
|
||||
A buffer containing the bytes to output to the channel.
|
||||
.AP int bytesToWrite in
|
||||
The number of bytes to consume from \fIcharBuf\fR or \fIbyteBuf\fR and
|
||||
output to the channel.
|
||||
.VE
|
||||
.AP int offset in
|
||||
How far to move the access point in the channel at which the next input or
|
||||
output operation will be applied, measured in bytes from the position
|
||||
@@ -169,7 +193,7 @@ types.
|
||||
The channel mechanism is extensible to new channel types, by
|
||||
providing a low level channel driver for the new type; the channel driver
|
||||
interface is described in the manual entry for \fBTcl_CreateChannel\fR. The
|
||||
channel mechanism provides a buffering scheme modelled after
|
||||
channel mechanism provides a buffering scheme modeled after
|
||||
Unix's standard I/O, and it also allows for nonblocking I/O on
|
||||
channels.
|
||||
.PP
|
||||
@@ -182,7 +206,7 @@ channels, see the manual entry for \fBTcl_CreateChannel\fR.
|
||||
.PP
|
||||
\fBTcl_OpenFileChannel\fR opens a file specified by \fIfileName\fR and
|
||||
returns a channel handle that can be used to perform input and output on
|
||||
the file. This API is modelled after the \fBfopen\fR procedure of
|
||||
the file. This API is modeled after the \fBfopen\fR procedure of
|
||||
the Unix standard I/O library.
|
||||
The syntax and meaning of all arguments is similar to those
|
||||
given in the Tcl \fBopen\fR command when opening a file.
|
||||
@@ -190,7 +214,7 @@ If an error occurs while opening the channel, \fBTcl_OpenFileChannel\fR
|
||||
returns NULL and records a POSIX error code that can be
|
||||
retrieved with \fBTcl_GetErrno\fR.
|
||||
In addition, if \fIinterp\fR is non-NULL, \fBTcl_OpenFileChannel\fR
|
||||
leaves an error message in \fIinterp->result\fR after any error.
|
||||
leaves an error message in \fIinterp\fR's result after any error.
|
||||
.PP
|
||||
The newly created channel is not registered in the supplied interpreter; to
|
||||
register it, use \fBTcl_RegisterChannel\fR, described below.
|
||||
@@ -310,93 +334,136 @@ left in \fIinterp->result\fR.
|
||||
.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
|
||||
\fBTcl_RegisterChannel\fR, above, for details. If the channel has ever been
|
||||
given as the \fBchan\fR argument in a call to \fBTcl_RegisterChannel\fR,
|
||||
you should instead use \fBTcl_UnregisterChannel\fR, which will internally
|
||||
call \fBTcl_Close\fR when all calls to \fBTcl_RegisterChannel\fR have been
|
||||
matched by corresponding calls to \fBTcl_UnregisterChannel\fR.
|
||||
\fBTcl_RegisterChannel\fR, above, for details. If the channel has ever
|
||||
been given as the \fBchan\fR argument in a call to
|
||||
\fBTcl_RegisterChannel\fR, you should instead use
|
||||
\fBTcl_UnregisterChannel\fR, which will internally call \fBTcl_Close\fR
|
||||
when all calls to \fBTcl_RegisterChannel\fR have been matched by
|
||||
corresponding calls to \fBTcl_UnregisterChannel\fR.
|
||||
|
||||
.SH TCL_READ
|
||||
.VS 8.1 br
|
||||
.SH TCL_READCHARS AND TCL_READ
|
||||
.PP
|
||||
\fBTcl_Read\fR consumes up to \fItoRead\fR bytes of data from
|
||||
\fIchannel\fR and stores it at \fIbuf\fR.
|
||||
The return value of \fBTcl_Read\fR is the number of characters written
|
||||
at \fIbuf\fR.
|
||||
The buffer produced by \fBTcl_Read\fR is not NULL terminated. Its contents
|
||||
are valid from the zeroth position up to and excluding the position
|
||||
indicated by the return value.
|
||||
If an error occurs, the return value is -1 and \fBTcl_Read\fR records
|
||||
a POSIX error code that can be retrieved with \fBTcl_GetErrno\fR.
|
||||
\fBTcl_ReadChars\fR consumes bytes from \fIchannel\fR, converting the bytes
|
||||
to UTF-8 based on the channel's encoding and storing the produced data in
|
||||
\fIreadObjPtr\fR's string representation. The return value of
|
||||
\fBTcl_ReadChars\fR is the number of characters, up to \fIcharsToRead\fR,
|
||||
that were stored in \fIobjPtr\fR. If an error occurs while reading, the
|
||||
return value is \-1 and \fBTcl_ReadChars\fR records a POSIX error code that
|
||||
can be retrieved with \fBTcl_GetErrno\fR.
|
||||
.PP
|
||||
The return value may be smaller than the value of \fItoRead\fR, indicating
|
||||
that less data than requested was available, also called a \fIshort
|
||||
read\fR.
|
||||
In blocking mode, this can only happen on an end-of-file.
|
||||
In nonblocking mode, a short read can also occur if there is not
|
||||
enough input currently available: \fBTcl_Read\fR returns a short
|
||||
count rather than waiting for more data.
|
||||
The return value may be smaller than the value to read, indicating that less
|
||||
data than requested was available. This is called a \fIshort read\fR. In
|
||||
blocking mode, this can only happen on an end-of-file. In nonblocking mode,
|
||||
a short read can also occur if there is not enough input currently
|
||||
available: \fBTcl_ReadChars\fR returns a short count rather than waiting
|
||||
for more data.
|
||||
.PP
|
||||
If the channel is in blocking mode, a return value of zero indicates an end
|
||||
of file condition. If the channel is in nonblocking mode, a return value of
|
||||
zero indicates either that no input is currently available or an end of
|
||||
file condition. Use \fBTcl_Eof\fR and \fBTcl_InputBlocked\fR
|
||||
to tell which of these conditions actually occurred.
|
||||
If the channel is in blocking mode, a return value of zero indicates an
|
||||
end-of-file condition. If the channel is in nonblocking mode, a return
|
||||
value of zero indicates either that no input is currently available or an
|
||||
end-of-file condition. Use \fBTcl_Eof\fR and \fBTcl_InputBlocked\fR to tell
|
||||
which of these conditions actually occurred.
|
||||
.PP
|
||||
\fBTcl_Read\fR translates platform-specific end-of-line representations
|
||||
into the canonical \fB\en\fR internal representation according to the
|
||||
current end-of-line recognition mode. End-of-line recognition and the
|
||||
various platform-specific modes are described in the manual entry for the
|
||||
Tcl \fBfconfigure\fR command.
|
||||
\fBTcl_ReadChars\fR translates the various end-of-line representations into
|
||||
the canonical \fB\en\fR internal representation according to the current
|
||||
end-of-line recognition mode. End-of-line recognition and the various
|
||||
platform-specific modes are described in the manual entry for the Tcl
|
||||
\fBfconfigure\fR command.
|
||||
.PP
|
||||
As a performance optimization, when reading from a channel with the encoding
|
||||
\fBbinary\fR, the bytes are not converted to UTF-8 as they are read.
|
||||
Instead, they are stored in \fIreadObjPtr\fR's internal representation as a
|
||||
byte-array object. The string representation of this object will only be
|
||||
constructed if it is needed (e.g., because of a call to
|
||||
\fBTcl_GetStringFromObj\fR). In this way, byte-oriented data can be read
|
||||
from a channel, manipulated by calling \fBTcl_GetByteArrayFromObj\fR and
|
||||
related functions, and then written to a channel without the expense of ever
|
||||
converting to or from UTF-8.
|
||||
.PP
|
||||
\fBTcl_Read\fR is similar to \fBTcl_ReadChars\fR, except that it doesn't do
|
||||
encoding conversions, regardless of the channel's encoding. It is deprecated
|
||||
and exists for backwards compatibility with non-internationalized Tcl
|
||||
extensions. It consumes bytes from \fIchannel\fR and stores them in
|
||||
\fIbuf\fR, performing end-of-line translations on the way. The return value
|
||||
of \fBTcl_Read\fR is the number of bytes, up to \fItoRead\fR, written in
|
||||
\fIbuf\fR. The buffer produced by \fBTcl_Read\fR is not NULL terminated.
|
||||
Its contents are valid from the zeroth position up to and excluding the
|
||||
position indicated by the return value.
|
||||
|
||||
.SH TCL_GETS AND TCL_GETSOBJ
|
||||
.SH TCL_GETSOBJ AND TCL_GETS
|
||||
.PP
|
||||
\fBTcl_Gets\fR reads a line of input from a channel and appends all of
|
||||
the characters of the line except for the terminating end-of-line character(s)
|
||||
to the dynamic string given by \fIdsPtr\fR.
|
||||
The end-of-line character(s) are read and discarded.
|
||||
\fBTcl_GetsObj\fR consumes bytes from \fIchannel\fR, converting the bytes to
|
||||
UTF-8 based on the channel's encoding, until a full line of input has been
|
||||
seen. If the channel's encoding is \fBbinary\fR, each byte read from the
|
||||
channel is treated as an individual Unicode character. All of the
|
||||
characters of the line except for the terminating end-of-line character(s)
|
||||
are appended to \fIlineObjPtr\fR's string representation. The end-of-line
|
||||
character(s) are read and discarded.
|
||||
.PP
|
||||
If a line was successfully read, the return value is greater than or
|
||||
equal to zero, and it indicates the number of characters stored
|
||||
in the dynamic string.
|
||||
If an error occurs, \fBTcl_Gets\fR returns -1 and records a POSIX error
|
||||
code that can be retrieved with \fBTcl_GetErrno\fR.
|
||||
\fBTcl_Gets\fR also returns -1 if the end of the file is reached;
|
||||
the \fBTcl_Eof\fR procedure can be used to distinguish an error
|
||||
from an end-of-file condition.
|
||||
If a line was successfully read, the return value is greater than or equal
|
||||
to zero and indicates the number of bytes stored in \fIlineObjPtr\fR. If an
|
||||
error occurs, \fBTcl_GetsObj\fR returns \-1 and records a POSIX error code
|
||||
that can be retrieved with \fBTcl_GetErrno\fR. \fBTcl_GetsObj\fR also
|
||||
returns \-1 if the end of the file is reached; the \fBTcl_Eof\fR procedure
|
||||
can be used to distinguish an error from an end-of-file condition.
|
||||
.PP
|
||||
If the channel is in nonblocking mode, the return value can also
|
||||
be -1 if no data was available or the data that was available
|
||||
did not contain an end-of-line character.
|
||||
When -1 is returned, the \fBTcl_InputBlocked\fR procedure may be
|
||||
invoked to determine if the channel is blocked because of input
|
||||
unavailability.
|
||||
If the channel is in nonblocking mode, the return value can also be \-1 if
|
||||
no data was available or the data that was available did not contain an
|
||||
end-of-line character. When \-1 is returned, the \fBTcl_InputBlocked\fR
|
||||
procedure may be invoked to determine if the channel is blocked because
|
||||
of input unavailability.
|
||||
.PP
|
||||
\fBTcl_GetsObj\fR is the same as \fBTcl_Gets\fR except the resulting
|
||||
characters are appended to a Tcl object \fBlineObjPtr\fR rather than a
|
||||
dynamic string.
|
||||
.SH TCL_WRITE
|
||||
\fBTcl_Gets\fR is the same as \fBTcl_GetsObj\fR except the resulting
|
||||
characters are appended to the appended to the dynamic string given by
|
||||
\fIdsPtr\fR rather than a Tcl object.
|
||||
|
||||
.SH TCL_WRITECHARS, TCL_WRITEOBJ, AND TCL_WRITE
|
||||
.PP
|
||||
\fBTcl_Write\fR accepts \fItoWrite\fR bytes of data at \fIbuf\fR for output
|
||||
on \fIchannel\fR. This data may not appear on the output device
|
||||
immediately. If the data should appear immediately, call \fBTcl_Flush\fR
|
||||
after the call to \fBTcl_Write\fR, or set the \fB-buffering\fR option on
|
||||
the channel to \fBnone\fR. If you wish the data to appear as soon as an end
|
||||
of line is accepted for output, set the \fB\-buffering\fR option on the
|
||||
channel to \fBline\fR mode.
|
||||
.PP
|
||||
The \fItoWrite\fR argument specifies how many bytes of data are provided in
|
||||
the \fIbuf\fR argument. If it is negative, \fBTcl_Write\fR expects the data
|
||||
\fBTcl_WriteChars\fR accepts \fIbytesToWrite\fR bytes of character data at
|
||||
\fIcharBuf\fR. The UTF-8 characters in the buffer are converted to the
|
||||
channel's encoding and queued for output to \fIchannel\fR. If
|
||||
\fIbytesToWrite\fR is negative, \fBTcl_WriteChars\fR expects \fIcharBuf\fR
|
||||
to be NULL terminated and it outputs everything up to the NULL.
|
||||
.PP
|
||||
The return value of \fBTcl_Write\fR is a count of how many
|
||||
characters were accepted for output to the channel. This is either equal to
|
||||
\fItoWrite\fR or -1 to indicate that an error occurred.
|
||||
If an error occurs, \fBTcl_Write\fR also records a POSIX error code
|
||||
that may be retrieved with \fBTcl_GetErrno\fR.
|
||||
Data queued for output may not appear on the output device immediately, due
|
||||
to internal buffering. If the data should appear immediately, call
|
||||
\fBTcl_Flush\fR after the call to \fBTcl_WriteChars\fR, or set the
|
||||
\fB\-buffering\fR option on the channel to \fBnone\fR. If you wish the data
|
||||
to appear as soon as a complete line is accepted for output, set the
|
||||
\fB\-buffering\fR option on the channel to \fBline\fR mode.
|
||||
.PP
|
||||
The return value of \fBTcl_WriteChars\fR is a count of how many bytes were
|
||||
accepted for output to the channel. This is either greater than zero to
|
||||
indicate success or \-1 to indicate that an error occurred. If an error
|
||||
occurs, \fBTcl_WriteChars\fR records a POSIX error code that may be
|
||||
retrieved with \fBTcl_GetErrno\fR.
|
||||
.PP
|
||||
Newline characters in the output data are translated to platform-specific
|
||||
end-of-line sequences according to the \fB\-translation\fR option for
|
||||
the channel.
|
||||
end-of-line sequences according to the \fB\-translation\fR option for the
|
||||
channel. This is done even if the channel has no encoding.
|
||||
.PP
|
||||
\fBTcl_WriteObj\fR is similar to \fBTcl_WriteChars\fR except it
|
||||
accepts a Tcl object whose contents will be output to the channel. The
|
||||
UTF-8 characters in \fIwriteObjPtr\fR's string representation are converted
|
||||
to the channel's encoding and queued for output to \fIchannel\fR.
|
||||
As a performance optimization, when writing to a channel with the encoding
|
||||
\fBbinary\fR, UTF-8 characters are not converted as they are written.
|
||||
Instead, the bytes in \fIwriteObjPtr\fR's internal representation as a
|
||||
byte-array object are written to the channel. The byte-array representation
|
||||
of the object will be constructed if it is needed. In this way,
|
||||
byte-oriented data can be read from a channel, manipulated by calling
|
||||
\fBTcl_GetByteArrayFromObj\fR and related functions, and then written to a
|
||||
channel without the expense of ever converting to or from UTF-8.
|
||||
.PP
|
||||
\fBTcl_Write\fR is similar to \fBTcl_WriteChars\fR except that it doesn't do
|
||||
encoding conversions, regardless of the channel's encoding. It is
|
||||
deprecated and exists for backwards compatibility with non-internationalized
|
||||
Tcl extensions. It accepts \fIbytesToWrite\fR bytes of data at
|
||||
\fIbyteBuf\fR and queues them for output to \fIchannel\fR. If
|
||||
\fIbytesToWrite\fR is negative, \fBTcl_Write\fR expects \fIbyteBuf\fR to be
|
||||
NULL terminated and it outputs everything up to the NULL.
|
||||
.VE
|
||||
|
||||
.SH TCL_FLUSH
|
||||
.PP
|
||||
@@ -419,14 +486,14 @@ data will be read or written. Buffered output is flushed to the channel and
|
||||
buffered input is discarded, prior to the seek operation.
|
||||
.PP
|
||||
\fBTcl_Seek\fR normally returns the new access point.
|
||||
If an error occurs, \fBTcl_Seek\fR returns -1 and records a POSIX error
|
||||
If an error occurs, \fBTcl_Seek\fR returns \-1 and records a POSIX error
|
||||
code that can be retrieved with \fBTcl_GetErrno\fR.
|
||||
After an error, the access point may or may not have been moved.
|
||||
|
||||
.SH TCL_TELL
|
||||
.PP
|
||||
\fBTcl_Tell\fR returns the current access point for a channel. The returned
|
||||
value is -1 if the channel does not support seeking.
|
||||
value is \-1 if the channel does not support seeking.
|
||||
|
||||
.SH TCL_GETCHANNELOPTION
|
||||
.PP
|
||||
@@ -477,7 +544,7 @@ The call always returns zero if the channel is in blocking mode.
|
||||
buffered in the internal buffers for a channel. If the channel is not open
|
||||
for reading, this function always returns zero.
|
||||
|
||||
.VS
|
||||
.VS 8.0
|
||||
.SH "PLATFORM ISSUES"
|
||||
.PP
|
||||
The handles returned from \fBTcl_GetChannelHandle\fR depend on the
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) OpenTcp.3 1.19 97/06/25 14:44:00
|
||||
'\" RCS: @(#) $Id: OpenTcp.3,v 1.1.2.1 1998/09/24 23:58:25 stanton Exp $
|
||||
.so man.macros
|
||||
.TH Tcl_OpenTcpClient 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
|
||||
+426
@@ -0,0 +1,426 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1997 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: ParseCmd.3,v 1.1.2.2 1998/10/21 20:21:31 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_ParseCommand 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_FreeParse, Tcl_EvalTokens \- parse Tcl scripts and expressions
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
int
|
||||
\fBTcl_ParseCommand\fR(\fIinterp, string, numBytes, nested, parsePtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_ParseExpr\fR(\fIinterp, string, numBytes, parsePtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_ParseBraces\fR(\fIinterp, string, numBytes, parsePtr, append, termPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_ParseQuotedString\fR(\fIinterp, string, numBytes, parsePtr, append, termPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_ParseVarName\fR(\fIinterp, string, numBytes, parsePtr, append\fR)
|
||||
.sp
|
||||
\fBTcl_FreeParse\fR(\fIusedParsePtr\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_EvalTokens\fR(\fIinterp, tokenPtr, numTokens\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *usedParsePtr
|
||||
.AP Tcl_Interp *interp out
|
||||
For procedures other than \fBTcl_FreeParse\fR and \fBTcl_EvalTokens\fR,
|
||||
used only for error reporting;
|
||||
if NULL, then no error messages are left after errors.
|
||||
For \fBTcl_EvalTokens\fR, determines the context for evaluating the
|
||||
script and also is used for error reporting; must not be NULL.
|
||||
.AP char *string in
|
||||
Pointer to first character in string to parse.
|
||||
.AP int numBytes in
|
||||
Number of bytes in \fIstring\fR, not including any terminating null
|
||||
character. If less than 0 then the script consists of all characters
|
||||
in \fIstring\fR up to the first null character.
|
||||
.AP int nested in
|
||||
Non-zero means that the script is part of a command substitution so an
|
||||
unquoted close bracket should be treated as a command terminator. If zero,
|
||||
close brackets have no special meaning.
|
||||
.AP int append in
|
||||
Non-zero means that \fI*parsePtr\fR already contains valid tokens; the new
|
||||
tokens should be appended to those already present. Zero means that
|
||||
\fI*parsePtr\fR is uninitialized; any information in it is ignored.
|
||||
This argument is normally 0.
|
||||
.AP Tcl_Parse *parsePtr out
|
||||
Points to structure to fill in with information about the parsed
|
||||
command, expression, variable name, etc.
|
||||
Any previous information in this structure
|
||||
is ignored, unless \fIappend\fR is non-zero in a call to
|
||||
\fBTcl_ParseBraces\fR, \fBTcl_ParseQuotedString\fR,
|
||||
or \fBTcl_ParseVarName\fR.
|
||||
.AP char **termPtr out
|
||||
If not NULL, points to a location where
|
||||
\fBTcl_ParseBraces\fR and \fBTcl_ParseQuotedString\fR
|
||||
will store a pointer to the character
|
||||
just after the terminating close-brace or close-quote (respectively)
|
||||
if the parse was successful.
|
||||
.AP Tcl_Parse *usedParsePtr in
|
||||
Points to structure that was filled in by a previous call to
|
||||
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseVarName\fR, etc.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures parse Tcl commands or portions of Tcl commands such as
|
||||
expressions or references to variables.
|
||||
Each procedure takes a pointer to a script (or portion thereof)
|
||||
and fills in the structure pointed to by \fIparsePtr\fR
|
||||
with a collection of tokens describing the information that was parsed.
|
||||
The procedures normally return \fBTCL_OK\fR.
|
||||
However, if an error occurs then they return \fBTCL_ERROR\fR,
|
||||
leave an error message in \fIinterp's\fR result
|
||||
(if \fIinterp\fR is not NULL),
|
||||
and leave nothing in \fIparsePtr\fR.
|
||||
.PP
|
||||
\fBTcl_ParseCommand\fR is a procedure that parses Tcl
|
||||
scripts. Given a pointer to a script, it
|
||||
parses the first command from the script. If the command was parsed
|
||||
successfully, \fBTcl_ParseCommand\fR returns \fBTCL_OK\fR and fills in the
|
||||
structure pointed to by \fIparsePtr\fR with information about the
|
||||
structure of the command (see below for details).
|
||||
If an error occurred in parsing the command then
|
||||
\fBTCL_ERROR\fR is returned, an error message is left in \fIinterp\fR's
|
||||
result, and no information is left at \fI*parsePtr\fR.
|
||||
.PP
|
||||
\fBTcl_ParseExpr\fR parses Tcl expressions.
|
||||
Given a pointer to a script containing an expression,
|
||||
\fBTcl_ParseCommand\fR parses the expression.
|
||||
If the expression was parsed successfully,
|
||||
\fBTcl_ParseExpr\fR returns \fBTCL_OK\fR and fills in the
|
||||
structure pointed to by \fIparsePtr\fR with information about the
|
||||
structure of the expression (see below for details).
|
||||
If an error occurred in parsing the command then
|
||||
\fBTCL_ERROR\fR is returned, an error message is left in \fIinterp\fR's
|
||||
result, and no information is left at \fI*parsePtr\fR.
|
||||
.PP
|
||||
\fBTcl_ParseBraces\fR parses a string or command argument
|
||||
enclosed in braces such as
|
||||
\fB{hello}\fR or \fB{string \\t with \\t tabs}\fR
|
||||
from the beginning of its argument \fIstring\fR.
|
||||
The first character of \fIstring\fR must be \fB{\fR.
|
||||
If the braced string was parsed successfully,
|
||||
\fBTcl_ParseBraces\fR returns \fBTCL_OK\fR,
|
||||
fills in the structure pointed to by \fIparsePtr\fR
|
||||
with information about the structure of the string
|
||||
(see below for details),
|
||||
and stores a pointer to the character just after the terminating \fB}\fR
|
||||
in the location given by \fI*termPtr\fR.
|
||||
If an error occurrs while parsing the string
|
||||
then \fBTCL_ERROR\fR is returned,
|
||||
an error message is left in \fIinterp\fR's result,
|
||||
and no information is left at \fI*parsePtr\fR or \fI*termPtr\fR.
|
||||
.PP
|
||||
\fBTcl_ParseQuotedString\fR parses a double-quoted string such as
|
||||
\fB"sum is [expr $a+$b]"\fR
|
||||
from the beginning of the argument \fIstring\fR.
|
||||
The first character of \fIstring\fR must be \fB"\fR.
|
||||
If the double-quoted string was parsed successfully,
|
||||
\fBTcl_ParseQuotedString\fR returns \fBTCL_OK\fR,
|
||||
fills in the structure pointed to by \fIparsePtr\fR
|
||||
with information about the structure of the string
|
||||
(see below for details),
|
||||
and stores a pointer to the character just after the terminating \fB"\fR
|
||||
in the location given by \fI*termPtr\fR.
|
||||
If an error occurrs while parsing the string
|
||||
then \fBTCL_ERROR\fR is returned,
|
||||
an error message is left in \fIinterp\fR's result,
|
||||
and no information is left at \fI*parsePtr\fR or \fI*termPtr\fR.
|
||||
.PP
|
||||
\fBTcl_ParseVarName\fR parses a Tcl variable reference such as
|
||||
\fB$abc\fR or \fB$x([expr $index + 1])\fR from the beginning of its
|
||||
\fIstring\fR argument.
|
||||
The first character of \fIstring\fR must be \fB$\fR.
|
||||
If a variable name was parsed successfully, \fBTcl_ParseVarName\fR
|
||||
returns \fBTCL_OK\fR and fills in the structure pointed to by
|
||||
\fIparsePtr\fR with information about the structure of the variable name
|
||||
(see below for details). If an error
|
||||
occurrs while parsing the command then \fBTCL_ERROR\fR is returned, an
|
||||
error message is left in \fIinterp\fR's result (if \fIinterp\fR isn't
|
||||
NULL), and no information is left at \fI*parsePtr\fR.
|
||||
.PP
|
||||
The information left at \fI*parsePtr\fR
|
||||
by \fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
|
||||
\fBTcl_ParseQuotedString\fR, and \fBTcl_ParseVarName\fR
|
||||
may include dynamically allocated memory.
|
||||
If these five parsing procedures return \fBTCL_OK\fR
|
||||
then the caller must invoke \fBTcl_FreeParse\fR to release
|
||||
the storage at \fI*parsePtr\fR.
|
||||
These procedures ignore any existing information in
|
||||
\fI*parsePtr\fR (unless \fIappend\fR is non-zero),
|
||||
so if repeated calls are being made to any of them
|
||||
then \fBTcl_FreeParse\fR must be invoked once after each call.
|
||||
.PP
|
||||
\fBTcl_EvalTokens\fR evaluates a sequence of parse tokens from a Tcl_Parse
|
||||
structure. The tokens typically consist
|
||||
of all the tokens in a word or all the tokens that make up the index for
|
||||
a reference to an array variable. \fBTcl_EvalTokens\fR performs the
|
||||
substitutions requested by the tokens, concatenates the
|
||||
resulting values, and returns the result in a new Tcl_Obj. The
|
||||
reference count of the object returned as result has been
|
||||
incremented, so the caller must
|
||||
invoke \fBTcl_DecrRefCount\fR when it is finished with the object.
|
||||
If an error occurs while evaluating the tokens (such as a reference to
|
||||
a non-existent variable) then the return value is NULL and an error
|
||||
message is left in \fIinterp\fR's result.
|
||||
|
||||
.SH TCL_PARSE STRUCTURE
|
||||
.PP
|
||||
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
|
||||
\fBTcl_ParseQuotedString\fR, and \fBTcl_ParseVarName\fR
|
||||
return parse information in two data structures, Tcl_Parse and Tcl_Token:
|
||||
.CS
|
||||
typedef struct Tcl_Parse {
|
||||
char *\fIcommentStart\fR;
|
||||
int \fIcommentSize\fR;
|
||||
char *\fIcommandStart\fR;
|
||||
int \fIcommandSize\fR;
|
||||
int \fInumWords\fR;
|
||||
Tcl_Token *\fItokenPtr\fR;
|
||||
int \fInumTokens\fR;
|
||||
...
|
||||
} Tcl_Parse;
|
||||
|
||||
typedef struct Tcl_Token {
|
||||
int \fItype\fR;
|
||||
char *\fIstart\fR;
|
||||
int \fIsize\fR;
|
||||
int \fInumComponents\fR;
|
||||
} Tcl_Token;
|
||||
.CE
|
||||
.PP
|
||||
The first five fields of a Tcl_Parse structure
|
||||
are filled in only by \fBTcl_ParseCommand\fR.
|
||||
These fields are not used by the other parsing procedures.
|
||||
.PP
|
||||
\fBTcl_ParseCommand\fR fills in a Tcl_Parse structure
|
||||
with information that describes one Tcl command and any comments that
|
||||
precede the command.
|
||||
If there are comments,
|
||||
the \fIcommentStart\fR field points to the \fB#\fR character that begins
|
||||
the first comment and \fIcommentSize\fR indicates the number of bytes
|
||||
in all of the comments preceding the command, including the newline
|
||||
character that terminates the last comment.
|
||||
If the command is not preceded by any comments, \fIcommentSize\fR is 0.
|
||||
\fBTcl_ParseCommand\fR also sets the \fIcommandStart\fR field
|
||||
to point to the first character of the first
|
||||
word in the command (skipping any comments and leading space) and
|
||||
\fIcommandSize\fR gives the total number of bytes in the command,
|
||||
including the character pointed to by \fIcommandStart\fR up to and
|
||||
including the newline, close bracket, or semicolon character that
|
||||
terminates the command. The \fInumWords\fR field gives the
|
||||
total number of words in the command.
|
||||
.PP
|
||||
All parsing procedures set the remaining fields,
|
||||
\fItokenPtr\fR and \fInumTokens\fR.
|
||||
The \fItokenPtr\fR field points to the first in an array of Tcl_Token
|
||||
structures that describe the components of the entity being parsed.
|
||||
The \fInumTokens\fR field gives the total number of tokens
|
||||
present in the array.
|
||||
Each token contains four fields.
|
||||
The \fItype\fR field selects one of several token types
|
||||
that are described below. The \fIstart\fR field
|
||||
points to the first character in the token and the \fIsize\fR field
|
||||
gives the total number of characters in the token. Some token types,
|
||||
such as \fBTCL_TOKEN_WORD\fR and \fBTCL_TOKEN_VARIABLE\fR, consist of
|
||||
several component tokens, which immediately follow the parent token;
|
||||
the \fInumComponents\fR field describes how many of these there are.
|
||||
The \fItype\fR field has one of the following values:
|
||||
.TP 20
|
||||
\fBTCL_TOKEN_WORD\fR
|
||||
This token ordinarily describes one word of a command
|
||||
but it may also describe a quoted or braced string in an expression.
|
||||
The token describes a component of the script that is
|
||||
the result of concatenating together a sequence of subcomponents,
|
||||
each described by a separate subtoken.
|
||||
The token starts with the first non-blank
|
||||
character of the component (which may be a double-quote or open brace)
|
||||
and includes all characters in the component up to but not including the
|
||||
space, semicolon, close bracket, close quote, or close brace that
|
||||
terminates the component. The \fInumComponents\fR field counts the total
|
||||
number of sub-tokens that make up the word, including sub-tokens
|
||||
of \fBTCL_TOKEN_VARIABLE\fR and \fBTCL_TOKEN_BS\fR tokens.
|
||||
.TP
|
||||
\fBTCL_TOKEN_SIMPLE_WORD\fR
|
||||
This token has the same meaning as \fBTCL_TOKEN_WORD\fR, except that
|
||||
the word is guaranteed to consist of a single \fBTCL_TOKEN_TEXT\fR
|
||||
sub-token. The \fInumComponents\fR field is always 1.
|
||||
.TP
|
||||
\fBTCL_TOKEN_TEXT\fR
|
||||
The token describes a range of literal text that is part of a word.
|
||||
The \fInumComponents\fR field is always 0.
|
||||
.TP
|
||||
\fBTCL_TOKEN_BS\fR
|
||||
The token describes a backslash sequence such as \fB\en\fR or \fB\e0xa3\fR.
|
||||
The \fInumComponents\fR field is always 0.
|
||||
.TP
|
||||
\fBTCL_TOKEN_COMMAND\fR
|
||||
The token describes a command whose result result must be substituted into
|
||||
the word. The token includes the square brackets that surround the
|
||||
command. The \fInumComponents\fR field is always 0 (the nested command
|
||||
is not parsed; call \fBTcl_ParseCommand\fR recursively if you want to
|
||||
see its tokens).
|
||||
.TP
|
||||
\fBTCL_TOKEN_VARIABLE\fR
|
||||
The token describes a variable substitution, including the
|
||||
\fB$\fR, variable name, and array index (if there is one) up through the
|
||||
close parenthesis that terminates the index. This token is followed
|
||||
by one or more additional tokens that describe the variable name and
|
||||
array index. If \fInumComponents\fR is 1 then the variable is a
|
||||
scalar and the next token is a \fBTCL_TOKEN_TEXT\fR token that gives the
|
||||
variable name. If \fInumComponents\fR is greater than 1 then the
|
||||
variable is an array: the first sub-token is a \fBTCL_TOKEN_TEXT\fR
|
||||
token giving the array name and the remaining sub-tokens are
|
||||
\fBTCL_TOKEN_TEXT\fR, \fBTCL_TOKEN_BS\fR, \fBTCL_TOKEN_COMMAND\fR, and
|
||||
\fBTCL_TOKEN_VARIABLE\fR tokens that must be concatenated to produce the
|
||||
array index. The \fInumComponents\fR field includes nested sub-tokens
|
||||
that are part of \fBTCL_TOKEN_VARIABLE\fR tokens in the array index.
|
||||
.TP
|
||||
\fBTCL_TOKEN_SUB_EXPR\fR
|
||||
The token describes one subexpression of an expression
|
||||
(or an entire expression).
|
||||
A subexpression may consist of a value
|
||||
such as an integer literal, variable substitution,
|
||||
or parenthesized subexpression;
|
||||
it may also consist of an operator and its operands.
|
||||
The token starts with the first non-blank character of the subexpression
|
||||
up to but not including the space, brace, close-paren, or bracket
|
||||
that terminates the subexpression.
|
||||
This token is followed by one or more additional tokens
|
||||
that describe the subexpression.
|
||||
If the first sub-token after the \fBTCL_TOKEN_SUB_EXPR\fR token
|
||||
is a \fBTCL_TOKEN_OPERATOR\fR token,
|
||||
the subexpression consists of an operator and its token operands.
|
||||
If the operator has no operands, the subexpression consists of
|
||||
just the \fBTCL_TOKEN_OPERATOR\fR token.
|
||||
Each operand is described by a \fBTCL_TOKEN_SUB_EXPR\fR token.
|
||||
Otherwise, the subexpression is a value described by
|
||||
one of the token types \fBTCL_TOKEN_WORD\fR, \fBTCL_TOKEN_TEXT\fR,
|
||||
\fBTCL_TOKEN_BS\fR, \fBTCL_TOKEN_COMMAND\fR,
|
||||
\fBTCL_TOKEN_VARIABLE\fR, and \fBTCL_TOKEN_SUB_EXPR\fR.
|
||||
The \fInumComponents\fR field
|
||||
counts the total number of sub-tokens that make up the subexpression;
|
||||
this includes the sub-tokens for any nested \fBTCL_TOKEN_SUB_EXPR\fR tokens.
|
||||
.TP
|
||||
\fBTCL_TOKEN_OPERATOR\fR
|
||||
The token describes one operator of an expression
|
||||
such as \fB&&\fR or \fBhypot\fR.
|
||||
An \fBTCL_TOKEN_OPERATOR\fR token is always preceeded by a
|
||||
\fBTCL_TOKEN_SUB_EXPR\fR token
|
||||
that describes the operator and its operands;
|
||||
the \fBTCL_TOKEN_SUB_EXPR\fR token's \fInumComponents\fR field
|
||||
can be used to determine the number of operands.
|
||||
A binary operator such as \fB*\fR
|
||||
is followed by two \fBTCL_TOKEN_SUB_EXPR\fR tokens
|
||||
that describe its operands.
|
||||
A unary operator like \fB-\fR
|
||||
is followed by a single \fBTCL_TOKEN_SUB_EXPR\fR token
|
||||
for its operand.
|
||||
If the operator is a math function such as \fBlog10\fR,
|
||||
the \fBTCL_TOKEN_OPERATOR\fR token will give its name and
|
||||
the following \fBTCL_TOKEN_SUB_EXPR\fR tokens will describe
|
||||
its operands;
|
||||
if there are no operands (as with \fBrand\fR),
|
||||
no \fBTCL_TOKEN_SUB_EXPR\fR tokens follow.
|
||||
There is one trinary operator, \fB?\fR,
|
||||
that appears in if-then-else subexpressions
|
||||
such as \fIx\fB?\fIy\fB:\fIz\fR;
|
||||
in this case, the \fB?\fR \fBTCL_TOKEN_OPERATOR\fR token
|
||||
is followed by three \fBTCL_TOKEN_SUB_EXPR\fR tokens for the operands
|
||||
\fIx\fR, \fIy\fR, and \fIz\fR.
|
||||
The \fInumComponents\fR field for a \fBTCL_TOKEN_OPERATOR\fR token
|
||||
is always 0.
|
||||
.PP
|
||||
After \fBTcl_ParseCommand\fR returns, the first token pointed to by
|
||||
the \fItokenPtr\fR field of the
|
||||
Tcl_Parse structure always has type \fBTCL_TOKEN_WORD\fR or
|
||||
\fBTCL_TOKEN_SIMPLE_WORD\fR. It is followed by the sub-tokens
|
||||
that must be concatenated to produce the value of that word.
|
||||
The next token is the \fBTCL_TOKEN_WORD\fR or \fBTCL_TOKEN_SIMPLE_WORD\fR
|
||||
token for the second word, followed by sub-tokens for that
|
||||
word, and so on until all \fInumWords\fR have been accounted
|
||||
for.
|
||||
.PP
|
||||
After \fBTcl_ParseExpr\fR returns, the first token pointed to by
|
||||
the \fItokenPtr\fR field of the
|
||||
Tcl_Parse structure always has type \fBTCL_TOKEN_SUB_EXPR\fR.
|
||||
It is followed by the sub-tokens that must be evaluated
|
||||
to produce the value of the expression.
|
||||
Only the token information in the Tcl_Parse structure
|
||||
is modified: the \fIcommentStart\fR, \fIcommentSize\fR,
|
||||
\fIcommandStart\fR, and \fIcommandSize\fR fields are not modified
|
||||
by \fBTcl_ParseExpr\fR.
|
||||
.PP
|
||||
After \fBTcl_ParseBraces\fR returns,
|
||||
the array of tokens pointed to by the \fItokenPtr\fR field of the
|
||||
Tcl_Parse structure will contain a single \fBTCL_TOKEN_TEXT\fR token
|
||||
if the braced string does not contain any backslash-newlines.
|
||||
If the string does contain backslash-newlines,
|
||||
the array of tokens will contain one or more
|
||||
\fBTCL_TOKEN_TEXT\fR or \fBTCL_TOKEN_BS\fR sub-tokens
|
||||
that must be concatenated to produce the value of the string.
|
||||
If the braced string was just \fB{}\fR
|
||||
(that is, the string was empty),
|
||||
the single \fBTCL_TOKEN_TEXT\fR token will have a \fIsize\fR field
|
||||
containing zero;
|
||||
this ensures that at least one token appears
|
||||
to describe the braced string.
|
||||
Only the token information in the Tcl_Parse structure
|
||||
is modified: the \fIcommentStart\fR, \fIcommentSize\fR,
|
||||
\fIcommandStart\fR, and \fIcommandSize\fR fields are not modified
|
||||
by \fBTcl_ParseBraces\fR.
|
||||
.PP
|
||||
After \fBTcl_ParseQuotedString\fR returns,
|
||||
the array of tokens pointed to by the \fItokenPtr\fR field of the
|
||||
Tcl_Parse structure depends on the contents of the quoted string.
|
||||
It will consist of one or more \fBTCL_TOKEN_TEXT\fR, \fBTCL_TOKEN_BS\fR,
|
||||
\fBTCL_TOKEN_COMMAND\fR, and \fBTCL_TOKEN_VARIABLE\fR sub-tokens.
|
||||
The array always contains at least one token;
|
||||
for example, if the argument \fIstring\fR is empty,
|
||||
the array returned consists of a single \fBTCL_TOKEN_TEXT\fR token
|
||||
with a zero \fIsize\fR field.
|
||||
Only the token information in the Tcl_Parse structure
|
||||
is modified: the \fIcommentStart\fR, \fIcommentSize\fR,
|
||||
\fIcommandStart\fR, and \fIcommandSize\fR fields are not modified.
|
||||
.PP
|
||||
After \fBTcl_ParseVarName\fR returns, the first token pointed to by
|
||||
the \fItokenPtr\fR field of the
|
||||
Tcl_Parse structure always has type \fBTCL_TOKEN_VARIABLE\fR. It
|
||||
is followed by the sub-tokens that make up the variable name as
|
||||
described above. The total length of the variable name is
|
||||
contained in the \fIsize\fR field of the first token.
|
||||
As in \fBTcl_ParseExpr\fR,
|
||||
only the token information in the Tcl_Parse structure
|
||||
is modified by \fBTcl_ParseVarName\fR:
|
||||
the \fIcommentStart\fR, \fIcommentSize\fR,
|
||||
\fIcommandStart\fR, and \fIcommandSize\fR fields are not modified.
|
||||
.PP
|
||||
All of the character pointers in the
|
||||
Tcl_Parse and Tcl_Token structures refer
|
||||
to characters in the \fIstring\fR argument passed to
|
||||
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
|
||||
\fBTcl_ParseQuotedString\fR, and \fBTcl_ParseVarName\fR.
|
||||
.PP
|
||||
There are additional fields in the Tcl_Parse structure after the
|
||||
\fInumTokens\fR field, but these are for the private use of
|
||||
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
|
||||
\fBTcl_ParseQuotedString\fR, and \fBTcl_ParseVarName\fR; they should not be
|
||||
referenced by code outside of these procedures.
|
||||
|
||||
.SH KEYWORDS
|
||||
backslash substitution, braces, command, expression, parse, token, variable substitution
|
||||
+37
-9
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) PkgRequire.3 1.4 96/02/15 20:03:16
|
||||
'\" RCS: @(#) $Id: PkgRequire.3,v 1.1.2.2 1999/03/10 06:49:10 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_PkgRequire 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_PkgRequire, Tcl_PkgProvide \- package version control
|
||||
Tcl_PkgRequire, Tcl_PkgRequireEx, Tcl_PkgPresent, Tcl_PkgPresentEx, Tcl_PkgProvide, Tcl_PkgProvideEx \- package version control
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -18,10 +18,22 @@ Tcl_PkgRequire, Tcl_PkgProvide \- package version control
|
||||
char *
|
||||
\fBTcl_PkgRequire\fR(\fIinterp, name, version, exact\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_PkgRequireEx\fR(\fIinterp, name, version, exact, clientDataPtr\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_PkgPresent\fR(\fIinterp, name, version, exact\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_PkgPresentEx\fR(\fIinterp, name, version, exact, clientDataPtr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_PkgProvide\fR(\fIinterp, name, version\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_PkgProvideEx\fR(\fIinterp, name, version, clientData\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_FreeProc clientData
|
||||
.AS Tcl_FreeProc clientDataPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter where package is needed or available.
|
||||
.AP char *name in
|
||||
@@ -35,25 +47,41 @@ Non-zero means that only the particular version specified by
|
||||
Zero means that newer versions than \fIversion\fR are also
|
||||
acceptable as long as they have the same major version number
|
||||
as \fIversion\fR.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary value to be associated with the package.
|
||||
.AP ClientData *clientDataPtr out
|
||||
Pointer to place to store the value associated with the matching
|
||||
package. It is only changed if the pointer is not NULL and the
|
||||
function completed successfully.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures provide C-level interfaces to Tcl's package and
|
||||
version management facilities.
|
||||
.PP
|
||||
\fBTcl_PkgRequire\fR is equivalent to the \fBpackage require\fR
|
||||
command, \fBTcl_PkgPresent\fR is equivalent to the \fBpackage present\fR
|
||||
command, and \fBTcl_PkgProvide\fR is equivalent to the
|
||||
\fBpackage provide\fR command.
|
||||
.PP
|
||||
See the documentation for the Tcl commands for details on what these
|
||||
procedures do.
|
||||
If \fBTcl_PkgRequire\fR completes successfully it returns a pointer
|
||||
to the version string for the version of the package that is provided
|
||||
in the interpreter (which may be different than \fIversion\fR); if
|
||||
an error occurs it returns NULL and leaves an error message in
|
||||
\fIinterp->result\fR.
|
||||
.PP
|
||||
If \fBTcl_PkgPresent\fR or \fBTcl_PkgRequire\fR complete successfully
|
||||
they return a pointer to the version string for the version of the package
|
||||
that is provided in the interpreter (which may be different than
|
||||
\fIversion\fR); if an error occurs they return NULL and leave an error
|
||||
message in \fIinterp->result\fR.
|
||||
.PP
|
||||
\fBTcl_PkgProvide\fR returns TCL_OK if it completes successfully;
|
||||
if an error occurs it returns TCL_ERROR and leaves an error message
|
||||
in \fIinterp->result\fR.
|
||||
.PP
|
||||
\fBTcl_PkgProvideEx\fR, \fBTcl_PkgPresentEx\fR and \fBTcl_PkgRequireEx\fR
|
||||
allow the setting and retrieving of the client data associated with
|
||||
the package. In all other respects they are equivalent to the matching
|
||||
functions.
|
||||
|
||||
.SH KEYWORDS
|
||||
package, provide, require, version
|
||||
package, present, provide, require, version
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Preserve.3 1.13 96/05/28 09:26:12
|
||||
'\" RCS: @(#) $Id: Preserve.3,v 1.1.2.1 1998/09/24 23:58:25 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Preserve 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) PrintDbl.3 1.9 97/08/22 13:30:22
|
||||
'\" RCS: @(#) $Id: PrintDbl.3,v 1.1.2.1 1998/09/24 23:58:26 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_PrintDouble 3 8.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: SCCS: @(#) RecEvalObj.3 1.1 97/07/29 18:31:21
|
||||
'\" RCS: @(#) $Id: RecEvalObj.3,v 1.1.2.1 1998/09/24 23:58:26 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_RecordAndEvalObj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) RecordEval.3 1.18 97/07/29 18:25:13
|
||||
'\" RCS: @(#) $Id: RecordEval.3,v 1.1.2.1 1998/09/24 23:58:26 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_RecordAndEval 3 7.4 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) RegExp.3 1.9 96/08/26 12:59:48
|
||||
'\" RCS: @(#) $Id: RegExp.3,v 1.1.2.1 1998/09/24 23:58:26 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_RegExpMatch 3 7.4 Tcl "Tcl Library Procedures"
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1997 by Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: SaveResult.3,v 1.1.2.2 1998/10/21 20:21:31 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_SaveResult 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_SaveResult, Tcl_RestoreResult, Tcl_DiscardResult \- save and restore an interpreter's result
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
\fBTcl_SaveResult(\fIinterp, statePtr\fB)\fR
|
||||
.sp
|
||||
\fBTcl_RestoreResult(\fIinterp, statePtr\fB)\fR
|
||||
.sp
|
||||
\fBTcl_DiscardResult(\fIstatePtr\fB)\fR
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_SavedResult statePtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter for which state should be saved.
|
||||
.AP Tcl_SavedResult *statePtr in
|
||||
Pointer to location where interpreter result should be saved or restored.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These routines allows a C procedure to take a snapshot of the current
|
||||
interpreter result so that it can be restored after a call
|
||||
to \fBTcl_Eval\fR or some other routine that modifies the interpreter
|
||||
result. These routines are passed a pointer to a structure that is
|
||||
used to store enough information to restore the interpreter result
|
||||
state. This structure can be allocated on the stack of the calling
|
||||
procedure. These routines do not save the state of any error
|
||||
information in the interpreter (e.g. the \fBerrorCode\fR or
|
||||
\fBerrorInfo\fR variables).
|
||||
.PP
|
||||
\fBTcl_SaveResult\fR moves the string and object results
|
||||
of \fIinterp\fR into the location specified by \fIstatePtr\fR.
|
||||
\fBTcl_SaveResult\fR clears the result for \fIinterp\fR and
|
||||
leaves the result in its normal empty initialized state.
|
||||
.PP
|
||||
\fBTcl_RestoreResult\fR moves the string and object results from
|
||||
\fIstatePtr\fR back into \fIinterp\fR. Any result or error that was
|
||||
already in the interpreter will be cleared. The \fIstatePtr\fR is left
|
||||
in an uninitialized state and cannot be used until another call to
|
||||
\fBTcl_SaveResult\fR.
|
||||
.PP
|
||||
\fBTcl_DiscardResult\fR releases the saved interpreter state
|
||||
stored at \fBstatePtr\fR. The state structure is left in an
|
||||
uninitialized state and cannot be used until another call to
|
||||
\fBTcl_SaveResult\fR.
|
||||
.PP
|
||||
Once \fBTcl_SaveResult\fR is called to save the interpreter
|
||||
result, either \fBTcl_RestoreResult\fR or
|
||||
\fBTcl_DiscardResult\fR must be called to properly clean up the
|
||||
memory associated with the saved state.
|
||||
|
||||
.SH KEYWORDS
|
||||
result, state, interp
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) SetErrno.3 1.5 96/02/15 20:01:31
|
||||
'\" RCS: @(#) $Id: SetErrno.3,v 1.1.2.1 1998/09/24 23:58:26 stanton Exp $
|
||||
.so man.macros
|
||||
.TH Tcl_SetErrno 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) SetRecLmt.3 1.6 96/03/25 20:06:36
|
||||
'\" RCS: @(#) $Id: SetRecLmt.3,v 1.1.2.1 1998/09/24 23:58:26 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_SetRecursionLimit 3 7.0 Tcl "Tcl Library Procedures"
|
||||
|
||||
+10
-2
@@ -5,13 +5,13 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" SCCS: @(#) SetResult.3 1.23 97/06/26 14:05:57
|
||||
'\" RCS: @(#) $Id: SetResult.3,v 1.1.2.2 1999/03/10 06:49:10 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_SetResult 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendElement, Tcl_ResetResult \- manipulate Tcl result
|
||||
Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendResultVA, Tcl_AppendElement, Tcl_ResetResult \- manipulate Tcl result
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -28,6 +28,8 @@ char *
|
||||
.sp
|
||||
\fBTcl_AppendResult\fR(\fIinterp, string, string, ... , \fB(char *) NULL\fR)
|
||||
.sp
|
||||
\fBTcl_AppendResultVA\fR(\fIinterp, argList\fR)
|
||||
.sp
|
||||
\fBTcl_AppendElement\fR(\fIinterp, string\fR)
|
||||
.sp
|
||||
\fBTcl_ResetResult\fR(\fIinterp\fR)
|
||||
@@ -46,6 +48,9 @@ appended to the existing result.
|
||||
Address of procedure to call to release storage at
|
||||
\fIstring\fR, or \fBTCL_STATIC\fR, \fBTCL_DYNAMIC\fR, or
|
||||
\fBTCL_VOLATILE\fR.
|
||||
.AP va_list argList in
|
||||
An argument list which must have been initialised using
|
||||
\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
@@ -137,6 +142,9 @@ to a string, if necessary, before appending the argument strings.
|
||||
Any number of \fIstring\fR arguments may be passed in a single
|
||||
call; the last argument in the list must be a NULL pointer.
|
||||
.PP
|
||||
\fBTcl_AppendResultVA\fR is the same as \fBTcl_AppendResult\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument list.
|
||||
.PP
|
||||
\fBTcl_AppendElement\fR is similar to \fBTcl_AppendResult\fR in
|
||||
that it allows results to be built up in pieces.
|
||||
However, \fBTcl_AppendElement\fR takes only a single \fIstring\fR
|
||||
|
||||
+134
-77
@@ -5,93 +5,158 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" SCCS: @(#) SetVar.3 1.30 97/10/10 16:10:36
|
||||
'\" RCS: @(#) $Id: SetVar.3,v 1.1.2.3 1999/02/10 23:31:11 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_SetVar 3 7.4 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_SetVar 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_SetVar, Tcl_SetVar2, Tcl_GetVar, Tcl_GetVar2, Tcl_UnsetVar, Tcl_UnsetVar2 \- manipulate Tcl variables
|
||||
Tcl_SetVar2Ex, Tcl_SetVar, Tcl_SetVar2, Tcl_ObjSetVar2, Tcl_GetVar2Ex, Tcl_GetVar, Tcl_GetVar2, Tcl_ObjGetVar2, Tcl_UnsetVar, Tcl_UnsetVar2 \- manipulate Tcl variables
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
.VS 8.1
|
||||
Tcl_Obj *
|
||||
\fBTcl_SetVar2Ex\fR(\fIinterp, name1, name2, newValuePtr, flags\fR)
|
||||
.VE
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_SetVar\fR(\fIinterp, varName, newValue, flags\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_SetVar2\fR(\fIinterp, name1, name2, newValue, flags\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_ObjSetVar2\fR(\fIinterp, part1Ptr, part2Ptr, newValuePtr, flags\fR)
|
||||
.sp
|
||||
.VS 8.1
|
||||
Tcl_Obj *
|
||||
\fBTcl_GetVar2Ex\fR(\fIinterp, name1, name2, flags\fR)
|
||||
.VE
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_GetVar\fR(\fIinterp, varName, flags\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_GetVar2\fR(\fIinterp, name1, name2, flags\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_ObjGetVar2\fR(\fIinterp, part1Ptr, part2Ptr, flags\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UnsetVar\fR(\fIinterp, varName, flags\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UnsetVar2\fR(\fIinterp, name1, name2, flags\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *newValue
|
||||
.AS Tcl_Interp *newValuePtr
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter containing variable.
|
||||
.AP char *name1 in
|
||||
Contains the name of an array variable (if \fIname2\fR is non-NULL)
|
||||
or (if \fIname2\fR is NULL) either the name of a scalar variable
|
||||
or a complete name including both variable name and index.
|
||||
May include \fB::\fR namespace qualifiers
|
||||
to specify a variable in a particular namespace.
|
||||
.AP char *name2 in
|
||||
If non-NULL, gives name of element within array; in this
|
||||
case \fIname1\fR must refer to an array variable.
|
||||
.AP Tcl_Obj *newValuePtr in
|
||||
.VS 8.1
|
||||
Points to a Tcl object containing the new value for the variable.
|
||||
.VE
|
||||
.AP int flags in
|
||||
OR-ed combination of bits providing additional information. See below
|
||||
for valid values.
|
||||
.AP char *varName in
|
||||
Name of variable.
|
||||
May include a series of \fB::\fR namespace qualifiers
|
||||
May include \fB::\fR namespace qualifiers
|
||||
to specify a variable in a particular namespace.
|
||||
May refer to a scalar variable or an element of
|
||||
an array variable.
|
||||
If the name references an element of an array, then it
|
||||
an array.
|
||||
If the name references an element of an array, then the name
|
||||
must be in writable memory: Tcl will make temporary modifications
|
||||
to it while looking up the name.
|
||||
.AP char *newValue in
|
||||
New value for variable.
|
||||
.AP int flags in
|
||||
OR-ed combination of bits providing additional information for
|
||||
operation. See below for valid values.
|
||||
.AP char *name1 in
|
||||
Name of scalar variable, or name of array variable if \fIname2\fR
|
||||
is non-NULL.
|
||||
May include a series of \fB::\fR namespace qualifiers
|
||||
New value for variable, specified as a NULL-terminated string.
|
||||
A copy of this value is stored in the variable.
|
||||
.AP Tcl_Obj *part1Ptr in
|
||||
Points to a Tcl object containing the variable's name.
|
||||
The name may include a series of \fB::\fR namespace qualifiers
|
||||
to specify a variable in a particular namespace.
|
||||
.AP char *name2 in
|
||||
If non-NULL, gives name of element within array and \fIname1\fR
|
||||
must refer to an array variable.
|
||||
May refer to a scalar variable or an element of an array variable.
|
||||
.AP Tcl_Obj *part2Ptr in
|
||||
If non-NULL, points to an object containing the name of an element
|
||||
within an array and \fIpart1Ptr\fR must refer to an array variable.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures may be used to create, modify, read, and delete
|
||||
These procedures are used to create, modify, read, and delete
|
||||
Tcl variables from C code.
|
||||
.PP
|
||||
Note that \fBTcl_GetVar\fR and \fBTcl_SetVar\fR
|
||||
have been largely replaced by the
|
||||
object-based procedures \fBTcl_ObjGetVar2\fR and \fBTcl_ObjSetVar2\fR.
|
||||
Those object-based procedures read, modify, and create
|
||||
a variable whose name is held in a Tcl object instead of a string.
|
||||
They also return a pointer to the object
|
||||
which is the variable's value instead of returning a string.
|
||||
Operations on objects can be faster since objects
|
||||
hold an internal representation that can be manipulated more efficiently.
|
||||
.PP
|
||||
\fBTcl_SetVar\fR and \fBTcl_SetVar2\fR
|
||||
.VS 8.1
|
||||
\fBTcl_SetVar2Ex\fR, \fBTcl_SetVar\fR, \fBTcl_SetVar2\fR, and
|
||||
\fBTcl_ObjSetVar2\fR
|
||||
will create a new variable or modify an existing one.
|
||||
Both of these procedures set the given variable to the value
|
||||
given by \fInewValue\fR, and they return a pointer to a
|
||||
copy of the variable's new value, which is stored in Tcl's
|
||||
These procedures set the given variable to the value
|
||||
given by \fInewValuePtr\fR or \fInewValue\fR and return a
|
||||
pointer to the variable's new value, which is stored in Tcl's
|
||||
variable structure.
|
||||
Tcl keeps a private copy of the variable's value, so the caller
|
||||
may change \fInewValue\fR after these procedures return without
|
||||
affecting the value of the variable.
|
||||
\fBTcl_SetVar2Ex\fR and \fBTcl_ObjSetVar2\fR take the new value as a
|
||||
Tcl_Obj and return
|
||||
a pointer to a Tcl_Obj. \fBTcl_SetVar\fR and \fBTcl_SetVar2\fR
|
||||
take the new value as a string and return a string; they are
|
||||
usually less efficient than \fBTcl_ObjSetVar2\fR. Note that the
|
||||
return value may be different than the \fInewValuePtr\fR or
|
||||
.VE
|
||||
\fInewValue\fR argument, due to modifications made by write traces.
|
||||
If an error occurs in setting the variable (e.g. an array
|
||||
variable is referenced without giving an index into the array),
|
||||
they return NULL.
|
||||
variable is referenced without giving an index into the array)
|
||||
NULL is returned and an error message is left in \fIinterp\fR's
|
||||
result if the \fBTCL_LEAVE_ERR_MSG\fR \fIflag\fR bit is set.
|
||||
.PP
|
||||
The name of the variable may be specified to
|
||||
\fBTcl_SetVar\fR and \fBTcl_SetVar2\fR in either of two ways.
|
||||
If \fBTcl_SetVar\fR is called, the variable name is given as
|
||||
.VS 8.1
|
||||
\fBTcl_GetVar2Ex\fR, \fBTcl_GetVar\fR, \fBTcl_GetVar2\fR, and
|
||||
\fBTcl_ObjGetVar2\fR
|
||||
return the current value of a variable.
|
||||
The arguments to these procedures are treated in the same way
|
||||
as the arguments to the procedures described above.
|
||||
Under normal circumstances, the return value is a pointer
|
||||
to the variable's value. For \fBTcl_GetVar2Ex\fR and
|
||||
\fBTcl_ObjGetVar2\fR the value is
|
||||
returned as a pointer to a Tcl_Obj. For \fBTcl_GetVar\fR and
|
||||
\fBTcl_GetVar2\fR the value is returned as a string; this is
|
||||
usually less efficient, so \fBTcl_GetVar2Ex\fR or \fBTcl_ObjGetVar2\fR
|
||||
are preferred.
|
||||
.VE
|
||||
If an error occurs while reading the variable (e.g. the variable
|
||||
doesn't exist or an array element is specified for a scalar
|
||||
variable), then NULL is returned and an error message is left
|
||||
in \fIinterp\fR's result if the \fBTCL_LEAVE_ERR_MSG\fR \fIflag\fR
|
||||
bit is set.
|
||||
.PP
|
||||
\fBTcl_UnsetVar\fR and \fBTcl_UnsetVar2\fR may be used to remove
|
||||
a variable, so that future attempts to read the variable will return
|
||||
an error.
|
||||
The arguments to these procedures are treated in the same way
|
||||
as the arguments to the procedures above.
|
||||
If the variable is successfully removed then TCL_OK is returned.
|
||||
If the variable cannot be removed because it doesn't exist then
|
||||
TCL_ERROR is returned and an error message is left
|
||||
in \fIinterp\fR's result if the \fBTCL_LEAVE_ERR_MSG\fR \fIflag\fR
|
||||
bit is set.
|
||||
If an array element is specified, the given element is removed
|
||||
but the array remains.
|
||||
If an array name is specified without an index, then the entire
|
||||
array is removed.
|
||||
.PP
|
||||
The name of a variable may be specified to these procedures in
|
||||
four ways:
|
||||
.IP [1]
|
||||
If \fBTcl_SetVar\fR, \fBTcl_GetVar\fR, or \fBTcl_UnsetVar\fR
|
||||
is invoked, the variable name is given as
|
||||
a single string, \fIvarName\fR.
|
||||
If \fIvarName\fR contains an open parenthesis and ends with a
|
||||
close parenthesis, then the value between the parentheses is
|
||||
@@ -100,22 +165,31 @@ the characters before the first open
|
||||
parenthesis are treated as the name of an array variable.
|
||||
If \fIvarName\fR doesn't have parentheses as described above, then
|
||||
the entire string is treated as the name of a scalar variable.
|
||||
If \fBTcl_SetVar2\fR is called, then the array name and index
|
||||
have been separated by the caller into two separate strings,
|
||||
\fIname1\fR and \fIname2\fR respectively; if \fIname2\fR is
|
||||
zero it means that a scalar variable is being referenced.
|
||||
.IP [2]
|
||||
If the \fIname1\fR and \fIname2\fR arguments are provided and
|
||||
\fIname2\fR is non-NULL, then an array element is specified and
|
||||
the array name and index have
|
||||
already been separated by the caller: \fIname1\fR contains the
|
||||
name and \fIname2\fR contains the index.
|
||||
.VS 8.1
|
||||
An error is generated
|
||||
if \fIname1\fR contains an open parenthesis and ends with a
|
||||
close parenthesis (array element) and \fIname2\fR is non-NULL.
|
||||
.IP [3]
|
||||
If \fIname2\fR is NULL, \fIname1\fR is treated just like
|
||||
\fIvarName\fR in case [1] above (it can be either a scalar or an array
|
||||
element variable name).
|
||||
.VE
|
||||
.PP
|
||||
The \fIflags\fR argument may be used to specify any of several
|
||||
options to the procedures.
|
||||
It consists of an OR-ed combination of the following bits.
|
||||
Note that the flag bit TCL_PARSE_PART1 is only meaningful
|
||||
for the procedures Tcl_SetVar2 and Tcl_GetVar2.
|
||||
.TP
|
||||
\fBTCL_GLOBAL_ONLY\fR
|
||||
Under normal circumstances the procedures look up variables as follows:
|
||||
Under normal circumstances the procedures look up variables as follows.
|
||||
If a procedure call is active in \fIinterp\fR,
|
||||
a variable is looked up at the current level of procedure call.
|
||||
Otherwise, a variable is looked up first in the current namespace,
|
||||
the variable is looked up at the current level of procedure call.
|
||||
Otherwise, the variable is looked up first in the current namespace,
|
||||
then in the global namespace.
|
||||
However, if this bit is set in \fIflags\fR then the variable
|
||||
is looked up only in the global namespace
|
||||
@@ -124,14 +198,10 @@ If both \fBTCL_GLOBAL_ONLY\fR and \fBTCL_NAMESPACE_ONLY\fR are given,
|
||||
\fBTCL_GLOBAL_ONLY\fR is ignored.
|
||||
.TP
|
||||
\fBTCL_NAMESPACE_ONLY\fR
|
||||
Under normal circumstances the procedures look up variables as follows:
|
||||
If a procedure call is active in \fIinterp\fR,
|
||||
a variable is looked up at the current level of procedure call.
|
||||
Otherwise, a variable is looked up first in the current namespace,
|
||||
then in the global namespace.
|
||||
However, if this bit is set in \fIflags\fR then the variable
|
||||
is looked up only in the current namespace
|
||||
even if there is a procedure call active.
|
||||
If this bit is set in \fIflags\fR then the variable
|
||||
is looked up only in the current namespace; if a procedure is active
|
||||
its variables are ignored, and the global namespace is also ignored unless
|
||||
it is the current namespace.
|
||||
.TP
|
||||
\fBTCL_LEAVE_ERR_MSG\fR
|
||||
If an error is returned and this bit is set in \fIflags\fR, then
|
||||
@@ -142,9 +212,10 @@ If this flag bit isn't set then no error message is left
|
||||
and the interpreter's result will not be modified.
|
||||
.TP
|
||||
\fBTCL_APPEND_VALUE\fR
|
||||
If this bit is set then \fInewValue\fR is appended to the current
|
||||
value, instead of replacing it.
|
||||
If the variable is currently undefined, then this bit is ignored.
|
||||
If this bit is set then \fInewValuePtr\fR or \fInewValue\fR is
|
||||
appended to the current value instead of replacing it.
|
||||
If the variable is currently undefined, then the bit is ignored.
|
||||
This bit is only used by the \fBTcl_Set*\fR procedures.
|
||||
.TP
|
||||
\fBTCL_LIST_ELEMENT\fR
|
||||
If this bit is set, then \fInewValue\fR is converted to a valid
|
||||
@@ -153,18 +224,6 @@ A separator space is appended before the new list element unless
|
||||
the list element is going to be the first element in a list or
|
||||
sublist (i.e. the variable's current value is empty, or contains
|
||||
the single character ``{'', or ends in `` }'').
|
||||
.TP
|
||||
\fBTCL_PARSE_PART1\fR
|
||||
If this bit is set when calling \fITcl_SetVar2\fR and \fITcl_GetVar2\fR,
|
||||
\fIname1\fR may contain both an array and an element name:
|
||||
if the name contains an open parenthesis and ends with a
|
||||
close parenthesis, then the value between the parentheses is
|
||||
treated as an element name (which can have any string value) and
|
||||
the characters before the first open
|
||||
parenthesis are treated as the name of an array variable.
|
||||
If the flag TCL_PARSE_PART1 is given,
|
||||
\fIname2\fR should be NULL since the array and element names
|
||||
are taken from \fIname1\fR.
|
||||
.PP
|
||||
\fBTcl_GetVar\fR and \fBTcl_GetVar2\fR
|
||||
return the current value of a variable.
|
||||
@@ -178,8 +237,6 @@ or \fBTcl_SetVar2\fR).
|
||||
and TCL_LEAVE_ERR_MSG, both of
|
||||
which have
|
||||
the same meaning as for \fBTcl_SetVar\fR.
|
||||
In addition, \fBTcl_GetVar2\fR uses the bit TCL_PARSE_PART1,
|
||||
which has the same meaning as for \fBTcl_SetVar2\fR.
|
||||
If an error occurs in reading the variable (e.g. the variable
|
||||
doesn't exist or an array element is specified for a scalar
|
||||
variable), then NULL is returned.
|
||||
@@ -198,7 +255,7 @@ If an array name is specified without an index, then the entire
|
||||
array is removed.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_GetObjResult, Tcl_GetStringResult, Tcl_ObjGetVar2, Tcl_ObjSetVar2, Tcl_TraceVar
|
||||
Tcl_GetObjResult, Tcl_GetStringResult, Tcl_TraceVar
|
||||
|
||||
.SH KEYWORDS
|
||||
array, interpreter, object, scalar, set, unset, variable
|
||||
array, get variable, interpreter, object, scalar, set, unset, variable
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Sleep.3 1.3 96/03/25 20:07:21
|
||||
'\" RCS: @(#) $Id: Sleep.3,v 1.1.2.1 1998/09/24 23:58:26 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Sleep 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) SplitList.3 1.21 97/04/29 14:07:10
|
||||
'\" RCS: @(#) $Id: SplitList.3,v 1.1.2.1 1998/09/24 23:58:27 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_SplitList 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) SplitPath.3 1.4 96/08/19 14:59:35
|
||||
'\" RCS: @(#) $Id: SplitPath.3,v 1.1.2.1 1998/09/24 23:58:27 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_SplitPath 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) StaticPkg.3 1.4 96/09/04 11:21:26
|
||||
'\" RCS: @(#) $Id: StaticPkg.3,v 1.1.2.1 1998/09/24 23:58:27 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_StaticPackage 3 7.5 Tcl "Tcl Library Procedures"
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) StrMatch.3 1.11 96/03/25 20:08:06
|
||||
'\" RCS: @(#) $Id: StrMatch.3,v 1.1.2.1 1998/09/24 23:58:27 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_StringMatch 3 "" Tcl "Tcl Library Procedures"
|
||||
|
||||
+35
-6
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) @(#) StringObj.3 1.13 97/06/25 13:40:25
|
||||
'\" RCS: @(#) $Id: StringObj.3,v 1.1.2.3 1999/03/10 06:49:10 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_StringObj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.TH Tcl_StringObj 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_NewStringObj, Tcl_SetStringObj, Tcl_GetStringFromObj, Tcl_AppendToObj, Tcl_AppendStringsToObj, Tcl_SetObjLength, TclConcatObj \- manipulate Tcl objects as strings
|
||||
Tcl_NewStringObj, Tcl_SetStringObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_AppendToObj, Tcl_AppendStringsToObj, Tcl_AppendStringsToObjVA, Tcl_AppendObjToObj, Tcl_SetObjLength, Tcl_ConcatObj \- manipulate Tcl objects as strings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -23,16 +23,25 @@ Tcl_Obj *
|
||||
char *
|
||||
\fBTcl_GetStringFromObj\fR(\fIobjPtr, lengthPtr\fR)
|
||||
.sp
|
||||
char *
|
||||
\fBTcl_GetString\fR(\fIobjPtr\fR)
|
||||
.sp
|
||||
\fBTcl_AppendToObj\fR(\fIobjPtr, bytes, length\fR)
|
||||
.VS
|
||||
.sp
|
||||
\fBTcl_AppendObjToObj\fR(\fIobjPtr, appendObjPtr\fR)
|
||||
.VE
|
||||
.sp
|
||||
\fBTcl_AppendStringsToObj\fR(\fIobjPtr, string, string, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
\fBTcl_AppendStringsToObjVA\fR(\fIobjPtr, argList\fR)
|
||||
.sp
|
||||
\fBTcl_SetObjLength\fR(\fIobjPtr, newLength\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_ConcatObj\fR(\fIobjc, objv\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *lengthPtr out
|
||||
.AS Tcl_Interp *appendObjPtr in/out
|
||||
.AP char *bytes in
|
||||
Points to the first byte of an array of bytes
|
||||
used to set or append to a string object.
|
||||
@@ -44,11 +53,18 @@ initializing, setting, or appending to a string object.
|
||||
If negative, all bytes up to the first null are used.
|
||||
.AP Tcl_Obj *objPtr in/out
|
||||
Points to an object to manipulate.
|
||||
.VS
|
||||
.AP Tcl_Obj *appendObjPtr in
|
||||
The object to append to \fIobjPtr\fR in \fBTcl_AppendObjToObj\fR.
|
||||
.VE
|
||||
.AP int *lengthPtr out
|
||||
If non-NULL, the location where \fBTcl_GetStringFromObj\fR will store
|
||||
the the length of an object's string representation.
|
||||
.AP char *string in
|
||||
Null-terminated string value to append to \fIobjPtr\fR.
|
||||
.AP va_list argList in
|
||||
An argument list which must have been initialised using
|
||||
\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR.
|
||||
.AP int newLength in
|
||||
New length for the string value of \fIobjPtr\fR, not including the
|
||||
final NULL character.
|
||||
@@ -76,21 +92,30 @@ Both procedures set the object to hold a copy of the specified string.
|
||||
\fBTcl_SetStringObj\fR frees any old string representation
|
||||
as well as any old internal representation of the object.
|
||||
.PP
|
||||
\fBTcl_GetStringFromObj\fR returns an object's string representation.
|
||||
\fBTcl_GetStringFromObj\fR and \fBTcl_GetString\fR
|
||||
return an object's string representation.
|
||||
This is given by the returned byte pointer
|
||||
and length, which is stored in \fIlengthPtr\fR if it is non-NULL.
|
||||
and (for \fBTcl_GetStringFromObj\fR) length,
|
||||
which is stored in \fIlengthPtr\fR if it is non-NULL.
|
||||
If the object's string representation is invalid
|
||||
(its byte pointer is NULL),
|
||||
the string representation is regenerated from the
|
||||
object's internal representation.
|
||||
The storage referenced by the returned byte pointer
|
||||
is owned by the object manager and should not be modified by the caller.
|
||||
The procedure \fBTcl_GetString\fR is used in the common case
|
||||
where the caller does not need the length of the string representation.
|
||||
.PP
|
||||
\fBTcl_AppendToObj\fR appends the data given by \fIbytes\fR and
|
||||
\fIlength\fR to the object specified by \fIobjPtr\fR. It does this
|
||||
in a way that handles repeated calls relatively efficiently (it
|
||||
overallocates the string space to avoid repeated reallocations
|
||||
and copies of object's string value).
|
||||
.VS
|
||||
.PP
|
||||
\fBTcl_AppendObjToObj\fR is similar to \fBTcl_AppendToObj\fR, but it
|
||||
appends the string value of \fIappendObjPtr\fR to \fIobjPtr\fR.
|
||||
.VE
|
||||
.PP
|
||||
\fBTcl_AppendStringsToObj\fR is similar to \fBTcl_AppendToObj\fR
|
||||
except that it can be passed more than one value to append and
|
||||
@@ -99,6 +124,10 @@ values may contain internal null characters). Any number of
|
||||
\fIstring\fR arguments may be provided, but the last argument
|
||||
must be a NULL pointer to indicate the end of the list.
|
||||
.PP
|
||||
\fBTcl_AppendStringsToObjVA\fR is the same as \fBTcl_AppendStringsToObj\fR
|
||||
except that instead of taking a variable number of arguments it takes an
|
||||
argument list.
|
||||
.PP
|
||||
The \fBTcl_SetObjLength\fR procedure changes the length of the
|
||||
string value of its \fIobjPtr\fR argument. If the \fInewLength\fR
|
||||
argument is greater than the space allocated for the object's
|
||||
|
||||
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Tcl.n 1.128 96/08/26 12:59:50
|
||||
'
|
||||
'\" RCS: @(#) $Id: Tcl.n,v 1.1.2.2 1998/09/24 23:58:27 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl n "" Tcl "Tcl Built-In Commands"
|
||||
.TH Tcl n "8.1" Tcl "Tcl Built-In Commands"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl \- Summary of Tcl language syntax.
|
||||
@@ -111,47 +111,61 @@ special processing.
|
||||
The following table lists the backslash sequences that are
|
||||
handled specially, along with the value that replaces each sequence.
|
||||
.RS
|
||||
.TP 6
|
||||
.TP 7
|
||||
\e\fBa\fR
|
||||
Audible alert (bell) (0x7).
|
||||
.TP 6
|
||||
.TP 7
|
||||
\e\fBb\fR
|
||||
Backspace (0x8).
|
||||
.TP 6
|
||||
.TP 7
|
||||
\e\fBf\fR
|
||||
Form feed (0xc).
|
||||
.TP 6
|
||||
.TP 7
|
||||
\e\fBn\fR
|
||||
Newline (0xa).
|
||||
.TP 6
|
||||
.TP 7
|
||||
\e\fBr\fR
|
||||
Carriage-return (0xd).
|
||||
.TP 6
|
||||
.TP 7
|
||||
\e\fBt\fR
|
||||
Tab (0x9).
|
||||
.TP 6
|
||||
.TP 7
|
||||
\e\fBv\fR
|
||||
Vertical tab (0xb).
|
||||
.TP 6
|
||||
.TP 7
|
||||
\e\fB<newline>\fIwhiteSpace\fR
|
||||
A single space character replaces the backslash, newline, and all
|
||||
spaces and tabs after the newline.
|
||||
This backslash sequence is unique in that it is replaced in a separate
|
||||
pre-pass before the command is actually parsed.
|
||||
This means that it will be replaced even when it occurs between
|
||||
braces, and the resulting space will be treated as a word separator
|
||||
if it isn't in braces or quotes.
|
||||
.TP 6
|
||||
.
|
||||
A single space character replaces the backslash, newline, and all spaces
|
||||
and tabs after the newline. This backslash sequence is unique in that it
|
||||
is replaced in a separate pre-pass before the command is actually parsed.
|
||||
This means that it will be replaced even when it occurs between braces,
|
||||
and the resulting space will be treated as a word separator if it isn't
|
||||
in braces or quotes.
|
||||
.TP 7
|
||||
\e\e
|
||||
Backslash (``\e'').
|
||||
.TP 6
|
||||
\e\fIooo\fR
|
||||
The digits \fIooo\fR (one, two, or three of them) give the octal value of
|
||||
the character.
|
||||
.TP 6
|
||||
\e\fBx\fIhh\fR
|
||||
The hexadecimal digits \fIhh\fR give the hexadecimal value of
|
||||
the character. Any number of digits may be present.
|
||||
.VS 8.1 br
|
||||
.TP 7
|
||||
\e\fIooo\fR
|
||||
.
|
||||
The digits \fIooo\fR (one, two, or three of them) give an eight-bit octal
|
||||
value for the Unicode character that will be inserted. The upper bits of the
|
||||
Unicode character will be 0.
|
||||
.TP 7
|
||||
\e\fBx\fIhh\fR
|
||||
.
|
||||
The hexadecimal digits \fIhh\fR give an eight-bit hexadecimal value for the
|
||||
Unicode character that will be inserted. Any number of hexadecimal digits
|
||||
may be present; however, all but the last two are ignored (the result is
|
||||
always a one-byte quantity). The upper bits of the Unicode character will
|
||||
be 0.
|
||||
.TP 7
|
||||
\e\fBu\fIhhhh\fR
|
||||
.
|
||||
The hexadecimal digits \fIhhhh\fR (one, two, three, or four of them) give a
|
||||
sixteen-bit hexadecimal value for the Unicode character that will be
|
||||
inserted.
|
||||
.VE
|
||||
.LP
|
||||
Backslash substitution is not performed on words enclosed in braces,
|
||||
except for backslash-newline as described above.
|
||||
|
||||
+1
-1
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) Tcl_Main.3 1.8 96/03/25 20:08:33
|
||||
'\" RCS: @(#) $Id: Tcl_Main.3,v 1.1.2.1 1998/09/24 23:58:27 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_Main 3 7.4 Tcl "Tcl Library Procedures"
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1998 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: Thread.3,v 1.1.2.2 1998/10/21 20:21:31 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_ConditionNotify 3 "" Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_ConditionNotify, Tcl_ConditionWait, Tcl_GetThreadData, Tcl_MutexLock, Tcl_MutexUnlock \- thread synchronization support.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
void
|
||||
\fBTcl_ConditionNotify\fR(\fIcondPtr\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_ConditionWait\fR(\fIcondPtr, mutexPtr, timePtr\fR)
|
||||
.sp
|
||||
VOID *
|
||||
\fBTcl_GetThreadData\fR(\fIkeyPtr, size\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_MutexLock\fR(\fImutexPtr\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_MutexUnlock\fR(\fImutexPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_ThreadDataKey *keyPtr
|
||||
.AP Tcl_Condition *condPtr in
|
||||
A condition variable, which must be associated with a mutex lock.
|
||||
.AP Tcl_Condition *mutexPtr in
|
||||
A mutex lock.
|
||||
.AP Tcl_Time *timePtr in
|
||||
A time limit on the condition wait. NULL to wait forever.
|
||||
Note that a polling value of 0 seconds doesn't make much sense.
|
||||
.AP Tcl_ThreadDataKey *keyPtr in
|
||||
This identifies a block of thread local storage. The key should be
|
||||
static and process-wide, yet each thread will end up associating
|
||||
a different block of storage with this key.
|
||||
.AP int *size in
|
||||
The size of the thread local storage block. This amount of data
|
||||
is allocated and initialized to zero the first time each thread
|
||||
calls \fBTcl_GetThreadData\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
A mutex is a lock that is used to serialize all threads through a piece
|
||||
of code by calling \fBTcl_MutexLock\fR and \fBTcl_MutexUnlock\fR.
|
||||
If one thread holds a mutex, any other thread calling \fBTcl_MutexLock\fR will
|
||||
block until \fBTcl_MutexUnlock\fR is called. A thread can deadlock
|
||||
on itself if it tries to lock the mutex twice.
|
||||
\fBTcl_MutexLock\fR and \fBTcl_MutexUnlock\fR
|
||||
procedures are defined as empty macros if not compiling with threads enabled.
|
||||
.PP
|
||||
A condition variable is used as a signaling mechanism:
|
||||
a thread can lock a mutex and then wait on a condition variable
|
||||
with \fBTcl_ConditionWait\fR. This atomically releases the mutex lock
|
||||
and blocks the waiting thread until another thread calls
|
||||
\fBTcl_ConditionNotify\fR. The caller of \fBTcl_ConditionNotify\fR should
|
||||
have the associated mutex held by previously calling \fBTcl_MutexLock\fR,
|
||||
but this is not enforced. Notifying the
|
||||
condition variable unblocks all threads waiting on the condition variable,
|
||||
but they do not proceed until the mutex is released with \fBTcl_MutexUnlock\fR.
|
||||
The implementation of \fBTcl_ConditionWait\fR automatically locks
|
||||
the mutex before returning.
|
||||
.PP
|
||||
The caller of \fBTcl_ConditionWait\fR should be prepared for spurious
|
||||
notifications by calling \fBTcl_ConditionWait\fR within a while loop
|
||||
that tests some invariant.
|
||||
.PP
|
||||
The \fBTcl_GetThreadData\fR call returns a pointer to a block of
|
||||
thread-private data. Its argument is a key that is shared by all threads
|
||||
and a size for the block of storage. The storage is automatically
|
||||
allocated and initialized to all zeros the first time each thread asks for it.
|
||||
The storage is automatically deallocated by \fBTcl_FinalizeThread\fR
|
||||
.SH INITIALIZATION
|
||||
.PP
|
||||
.PP
|
||||
All of these synchronization objects are self initializing.
|
||||
They are implemented as opaque pointers that should be NULL
|
||||
upon first use.
|
||||
The mutexes and condition variables are
|
||||
cleaned up by process exit handlers. Thread local storage is
|
||||
reclaimed during \fBTcl_FinalizeThread\fR.
|
||||
.SH CREATING THREADS
|
||||
The API to create threads is not finalized at this time.
|
||||
There are private facilities to create threads that contain a new
|
||||
Tcl interpreter, and to send scripts among threads.
|
||||
Dive into tclThreadTest.c and tclThread.c for examples.
|
||||
.SH KEYWORDS
|
||||
thread, mutex, condition variable, thread local storage
|
||||
@@ -0,0 +1,90 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1997 by Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: @(#) $Id: ToUpper.3,v 1.1.2.2 1998/10/21 20:21:31 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_UtfToUpper 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_UniCharToUpper, Tcl_UniCharToLower, Tcl_UniCharToTitle, Tcl_UtfToUpper, Tcl_UtfToLower, Tcl_UtfToTitle \- routines for manipulating the case of Unicode characters and UTF-8 strings.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
Tcl_UniChar
|
||||
\fBTcl_UniCharToUpper\fR(\fIch\fR)
|
||||
.sp
|
||||
Tcl_UniChar
|
||||
\fBTcl_UniCharToLower\fR(\fIch\fR)
|
||||
.sp
|
||||
Tcl_UniChar
|
||||
\fBTcl_UniCharToTitle\fR(\fIch\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfToUpper\fR(\fIstr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfToLower\fR(\fIstr\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_UtfToTitle\fR(\fIstr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS char *str in/out
|
||||
.AP int ch in
|
||||
The Tcl_UniChar to be converted.
|
||||
.AP char *str in/out
|
||||
Pointer to UTF-8 string to be converted in place.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The first three routines convert the case of individual Unicode characters:
|
||||
.PP
|
||||
If \fIch\fR represents a lower-case character,
|
||||
\fBTcl_UniCharToUpper\fR returns the corresponding upper-case
|
||||
character. If no upper-case character is defined, it returns the
|
||||
character unchanged.
|
||||
.PP
|
||||
If \fIch\fR represents an upper-case character,
|
||||
\fBTcl_UniCharToLower\fR returns the corresponding lower-case
|
||||
character. If no lower-case character is defined, it returns the
|
||||
character unchanged.
|
||||
.PP
|
||||
If \fIch\fR represents a lower-case character,
|
||||
\fBTcl_UniCharToTitle\fR returns the corresponding title-case
|
||||
character. If no title-case character is defined, it returns the
|
||||
corresponding upper-case character. If no upper-case character is
|
||||
defined, it returns the character unchanged. Title-case is defined
|
||||
for a small number of characters that have a different appearance when
|
||||
they are at the beginning of a capitalized word.
|
||||
.PP
|
||||
The next three routines convert the case of UTF-8 strings in place in
|
||||
memory:
|
||||
.PP
|
||||
\fBTcl_UtfToUpper\fR changes every UTF-8 character in \fIstr\fR to
|
||||
upper-case. Because changing the case of a character may change its
|
||||
size, the byte offset of each character in the resulting string may
|
||||
differ from its original location. \fBTcl_UtfToUpper\fR writes a null
|
||||
byte at the end of the converted string. \fBTcl_UtfToUpper\fR returns
|
||||
the new length of the string in bytes. This new length is guaranteed
|
||||
to be no longer than the original string length.
|
||||
.PP
|
||||
\fBTcl_UtfToLower\fR is the same as \fBTcl_UtfToUpper\fR except it
|
||||
turns each character in the string into its lower-case equivalent.
|
||||
.PP
|
||||
\fBTcl_UtfToTitle\fR is the same as \fBTcl_UtfToUpper\fR except it
|
||||
turns the first character in the string into its title-case equivalent
|
||||
and all following characters into their lower-case equivalents.
|
||||
|
||||
.SH BUGS
|
||||
.PP
|
||||
At this time, the case conversions are only defined for the ISO8859-1
|
||||
characters. Unicode characters above 0x00ff are not modified by these
|
||||
routines.
|
||||
|
||||
.SH KEYWORDS
|
||||
utf, unicode, toupper, tolower, totitle, case
|
||||
+30
-12
@@ -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.
|
||||
'\"
|
||||
'\" SCCS: @(#) TraceVar.3 1.27 97/10/10 15:05:37
|
||||
'\" RCS: @(#) $Id: TraceVar.3,v 1.1.2.2 1998/09/24 23:58:27 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Tcl_TraceVar 3 7.4 Tcl "Tcl Library Procedures"
|
||||
@@ -44,7 +44,7 @@ must be in writable memory: Tcl will make temporary modifications
|
||||
to it while looking up the name.
|
||||
.AP int flags in
|
||||
OR-ed combination of the values TCL_TRACE_READS, TCL_TRACE_WRITES, and
|
||||
TCL_TRACE_UNSETS, TCL_PARSE_PART1, and TCL_GLOBAL_ONLY.
|
||||
TCL_TRACE_UNSETS, TCL_TRACE_ARRAY, and TCL_GLOBAL_ONLY.
|
||||
Not all flags are used by all
|
||||
procedures. See below for more information.
|
||||
.AP Tcl_VarTraceProc *proc in
|
||||
@@ -96,6 +96,12 @@ A variable may be unset either explicitly by an \fBunset\fR command,
|
||||
or implicitly when a procedure returns (its local variables are
|
||||
automatically unset) or when the interpreter is deleted (all
|
||||
variables are automatically unset).
|
||||
.TP
|
||||
\fBTCL_TRACE_ARRAY\fR
|
||||
Invoke \fIproc\fR whenever the array command is invoked.
|
||||
This gives the trace procedure a chance to update the array before
|
||||
array names or array get is called. Note that this is called
|
||||
before an array set, but that will trigger write traces.
|
||||
.PP
|
||||
Whenever one of the specified operations occurs on the variable,
|
||||
\fIproc\fR will be invoked.
|
||||
@@ -120,7 +126,8 @@ in the normal two-part form (see the description of \fBTcl_TraceVar2\fR
|
||||
below for details).
|
||||
\fIFlags\fR is an OR-ed combination of bits providing several
|
||||
pieces of information.
|
||||
One of the bits TCL_TRACE_READS, TCL_TRACE_WRITES, or TCL_TRACE_UNSETS
|
||||
One of the bits TCL_TRACE_READS, TCL_TRACE_WRITES, TCL_TRACE_ARRAY,
|
||||
or TCL_TRACE_UNSETS
|
||||
will be set in \fIflags\fR to indicate which operation is being performed
|
||||
on the variable.
|
||||
The bit TCL_GLOBAL_ONLY will be set whenever the variable being
|
||||
@@ -175,24 +182,26 @@ The procedures \fBTcl_TraceVar2\fR, \fBTcl_UntraceVar2\fR, and
|
||||
except that the name of the variable consists of two parts.
|
||||
\fIName1\fR gives the name of a scalar variable or array,
|
||||
and \fIname2\fR gives the name of an element within an array.
|
||||
If \fIname2\fR is NULL it means that either the variable is
|
||||
a scalar or the trace is to be set on the entire array rather
|
||||
than an individual element (see WHOLE-ARRAY TRACES below for
|
||||
more information).
|
||||
As a special case, if the flag TCL_PARSE_PART1 is specified,
|
||||
.VS 8.1
|
||||
When \fIname2\fR is NULL,
|
||||
\fIname1\fR may contain both an array and an element name:
|
||||
if the name contains an open parenthesis and ends with a
|
||||
close parenthesis, then the value between the parentheses is
|
||||
treated as an element name (which can have any string value) and
|
||||
the characters before the first open
|
||||
parenthesis are treated as the name of an array variable.
|
||||
If the flag TCL_PARSE_PART1 is given,
|
||||
\fIname2\fR should be NULL since the array and element names
|
||||
are taken from \fIname1\fR.
|
||||
If \fIname2\fR is NULL and \fIname1\fR does not refer
|
||||
to an array element
|
||||
.VE
|
||||
it means that either the variable is
|
||||
a scalar or the trace is to be set on the entire array rather
|
||||
than an individual element (see WHOLE-ARRAY TRACES below for
|
||||
more information).
|
||||
|
||||
|
||||
.SH "ACCESSING VARIABLES DURING TRACES"
|
||||
.PP
|
||||
During read and write traces, the
|
||||
During read, write, and array traces, the
|
||||
trace procedure can read, write, or unset the traced
|
||||
variable using \fBTcl_GetVar2\fR, \fBTcl_SetVar2\fR, and
|
||||
other procedures.
|
||||
@@ -245,6 +254,12 @@ access.
|
||||
If it deletes the variable then the traced access will return
|
||||
an empty string.
|
||||
.PP
|
||||
When array tracing has been specified, the trace procedure
|
||||
will be invoked at the beginning of the array command implementation,
|
||||
before any of the operations like get, set, or names have been invoked.
|
||||
The trace procedure can modify the array elements with \fBTcl_SetVar\fR
|
||||
and \fBTcl_SetVar2\fR.
|
||||
.PP
|
||||
When unset tracing has been specified, the trace procedure
|
||||
will be invoked whenever the variable is destroyed.
|
||||
The traces will be called after the variable has been
|
||||
@@ -343,6 +358,9 @@ to clean up and free their own internal data structures.
|
||||
Tcl doesn't do any error checking to prevent trace procedures
|
||||
from misusing the interpreter during traces with TCL_INTERP_DESTROYED
|
||||
set.
|
||||
.PP
|
||||
Array traces are not yet integrated with the Tcl "info exists" command,
|
||||
nor is there Tcl-level access to array traces.
|
||||
|
||||
.SH KEYWORDS
|
||||
clientData, trace, variable
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user