summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-12-10 18:32:53 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-12-10 18:32:53 (GMT)
commit81add12060f392c3972d930d0d63dc8eb3f61bf9 (patch)
tree0a5e9b475197e01df5ade8e24af7e21dc3c36cee
parentca999b7a3aa4dbfc85021901f0faa31dbed4cb1c (diff)
downloadtcl-81add12060f392c3972d930d0d63dc8eb3f61bf9.zip
tcl-81add12060f392c3972d930d0d63dc8eb3f61bf9.tar.gz
tcl-81add12060f392c3972d930d0d63dc8eb3f61bf9.tar.bz2
merge updates from HEAD
-rw-r--r--ChangeLog74
-rw-r--r--README6
-rw-r--r--doc/AddErrInfo.320
-rw-r--r--doc/CrtCommand.33
-rw-r--r--doc/CrtMathFnc.38
-rw-r--r--doc/FileSystem.37
-rw-r--r--doc/GetStdChan.33
-rw-r--r--doc/Interp.39
-rw-r--r--doc/OpenFileChnl.34
-rw-r--r--doc/SetChanErr.33
-rw-r--r--doc/StringObj.3120
-rw-r--r--doc/UniCharIsAlpha.34
-rw-r--r--doc/eval.n8
-rw-r--r--doc/expr.n14
-rw-r--r--doc/filename.n6
-rw-r--r--doc/interp.n4
-rw-r--r--doc/mathop.n164
-rw-r--r--doc/namespace.n22
-rw-r--r--doc/string.n5
-rw-r--r--generic/tcl.decls178
-rw-r--r--generic/tclBasic.c4
-rw-r--r--generic/tclCompCmds.c11
-rw-r--r--generic/tclDecls.h186
-rw-r--r--generic/tclExecute.c9
-rw-r--r--generic/tclIO.c16
-rw-r--r--generic/tclIOCmd.c77
-rw-r--r--generic/tclInt.decls72
-rw-r--r--generic/tclInt.h7
-rw-r--r--generic/tclIntDecls.h108
-rw-r--r--generic/tclIntPlatDecls.h184
-rw-r--r--generic/tclPlatDecls.h26
-rw-r--r--generic/tclStubInit.c116
-rw-r--r--generic/tclTomMath.decls5
-rw-r--r--tests/chanio.test7
-rw-r--r--tests/interp.test6
-rw-r--r--tests/io.test7
-rw-r--r--tools/genStubs.tcl372
-rw-r--r--unix/README19
-rw-r--r--win/rules.vc14
39 files changed, 1382 insertions, 526 deletions
diff --git a/ChangeLog b/ChangeLog
index 68f6187..dc09943 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,77 @@
+2007-12-10 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/string.n, doc/UniCharIsAlpha.3: Fix markup errors.
+ * doc/CrtCommand.3, doc/CrtMathFnc.3, doc/FileSystem.3,
+ doc/GetStdChan.3, doc/OpenFileChnl.3, doc/SetChanErr.3,
+ doc/eval.n, doc/filename.n: Consistency: Move "KEYWORDS"
+ section after "SEE ALSO".
+
+2007-12-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * tools/genStubs.tcl: fix numerous issues handling 'macosx',
+ 'aqua' or 'x11' entries interleaved
+ with 'unix' entries [Bug 1834288];
+ add genStubs::export command
+ [Tk FR 1716117]; cleanup formatting.
+
+ * generic/tcl.decls: use new genstubs 'export' command to
+ * generic/tclInt.decls: mark exported symbols not in stubs
+ * generic/tclTomMath.decls: table [Tk FR 1716117]; cleanup
+ formatting.
+
+ * generic/tclDecls.h: regen with new genStubs.tcl.
+ * generic/tclIntDecls.h: [Bug 1834288]
+ * generic/tclIntPlatDecls.h:
+ * generic/tclPlatDecls.h:
+ * generic/tclStubInit.c:
+
+2007-12-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/io.test, tests/chanio.test (io-73.1): Make sure to invalidate
+ * generic/tclIO.c (SetChannelFromAny): internal rep only after
+ validating channel rep. [Bug 1847044]
+
+2007-12-08 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/expr.n, doc/mathop.n: Improved the documentation of the
+ operators. [Bug 1823622]
+
+ * generic/tclBasic.c (builtInCmds): Corrected list of hidden and
+ * doc/interp.n (SAFE INTERPRETERS): exposed commands so that the
+ documentation and reality now match. [Bug 1662436]
+
+2007-12-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tclExecute.c (TclExecuteByteCode INST_REGEXP):
+ * generic/tclCompCmds.c (TclCompileRegexpCmd): Pass correct RE
+ compile flags at compile time, and use TCL_REG_NOSUB.
+
+ * generic/tclIOCmd.c (FinalizeIOCmdTSD, Tcl_PutsObjCmd): cache
+ stdout channel object for [puts $str] calls.
+
+2007-12-06 Don Porter <dgp@users.sourceforge.net>
+
+ * README: Remove mention of dead comp.lang.tcl.announce
+ newsgroup. [Bug 1846433].
+
+ * unix/README: Mention the stub library created by `make` and warn
+ about the effect of embedded paths in the installed binaries.
+ Thanks to Larry Virden. [Bug 1794084]
+
+ * doc/AddErrInfo.3: Documentation for the new routines in TIP 270.
+ * doc/Interp.3:
+ * doc/StringObj.3:
+
+2007-12-06 Don Porter <dgp@users.sourceforge.net>
+
+ * doc/namespace.n: Documentation for zero-argument form of
+ [namespace import] (TIP 261) [Bug 1596416]
+
+2007-12-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tclInt.h: add TclGetChannelFromObj decl
+ (TclMatchIsTrivial): simplify TclMatchIsTrivial to remove ] check.
+
2007-12-06 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
diff --git a/README b/README
index 5dc5408..1eb477c 100644
--- a/README
+++ b/README
@@ -5,7 +5,7 @@ README: Tcl
You can get any source release of Tcl from the file distributions
link at the above URL.
-RCS: @(#) $Id: README,v 1.59.2.5 2007/11/21 06:30:43 dgp Exp $
+RCS: @(#) $Id: README,v 1.59.2.6 2007/12/10 18:32:53 dgp Exp $
Contents
--------
@@ -114,9 +114,7 @@ more. More information can be found at
There is a USENET news group, "comp.lang.tcl", intended for the exchange of
information about Tcl, Tk, and related applications. The newsgroup is a
-great place to ask general information questions. There is also
-a USENET news group, "comp.lang.tcl.announce", intended to announce new
-releases of software, training, and more. For bug reports, please
+great place to ask general information questions. For bug reports, please
see the "Support and bug fixes" section below.
6. Tcl'ers Wiki
diff --git a/doc/AddErrInfo.3 b/doc/AddErrInfo.3
index 26588cb..b22fca7 100644
--- a/doc/AddErrInfo.3
+++ b/doc/AddErrInfo.3
@@ -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.
'\"
-'\" RCS: @(#) $Id: AddErrInfo.3,v 1.15.8.1 2007/11/01 16:25:44 dgp Exp $
+'\" RCS: @(#) $Id: AddErrInfo.3,v 1.15.8.2 2007/12/10 18:32:53 dgp Exp $
'\"
.so man.macros
.TH Tcl_AddErrorInfo 3 8.5 Tcl "Tcl Library Procedures"
.BS
.SH NAME
-Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
+Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -25,6 +25,10 @@ int
.VE 8.5
.sp
\fBTcl_AddErrorInfo\fR(\fIinterp, message\fR)
+.VS 8.5
+.sp
+\fBTcl_AppendObjToErrorInfo\fR(\fIinterp, objPtr\fR)
+.VE 8.5
.sp
\fBTcl_AddObjErrorInfo\fR(\fIinterp, message, length\fR)
.sp
@@ -55,6 +59,11 @@ this points to the first byte of an array of \fIlength\fR bytes
containing a string to append to the \fB\-errorinfo\fR return option.
This byte array may contain embedded null bytes
unless \fIlength\fR is negative.
+.VS 8.5
+.AP Tcl_Obj *objPtr in
+A message to be appended to the \fB\-errorinfo\fR return option
+in the form of a Tcl_Obj value.
+.VE 8.5
.AP int length in
The number of bytes to copy from \fImessage\fR when
appending to the \fB\-errorinfo\fR return option.
@@ -200,6 +209,13 @@ The value of the \fB\-errorline\fR return option (retrieved
via a call to \fBTcl_GetReturnOptions\fR) often makes up
a useful part of the \fImessage\fR passed to \fBTcl_AddErrorInfo\fR.
.PP
+.VS 8.5
+\fBTcl_AppendObjToErrorInfo\fR is an alternative interface to the
+same functionality as \fBTcl_AddErrorInfo\fR. \fBTcl_AppendObjToErrorInfo\fR
+is called when the string value to be appended to the \fB\-errorinfo\fR option
+is available as a \fBTcl_Obj\fR instead of as a \fBchar\fR array.
+.VE 8.5
+.PP
\fBTcl_AddObjErrorInfo\fR is nearly identical
to \fBTcl_AddErrorInfo\fR, except that it has an additional \fIlength\fR
argument. This allows the \fImessage\fR string to contain
diff --git a/doc/CrtCommand.3 b/doc/CrtCommand.3
index c4e042a..682894b 100644
--- a/doc/CrtCommand.3
+++ b/doc/CrtCommand.3
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: CrtCommand.3,v 1.12 2005/05/10 18:33:54 kennykb Exp $
+'\" RCS: @(#) $Id: CrtCommand.3,v 1.12.8.1 2007/12/10 18:32:53 dgp Exp $
'\"
.so man.macros
.TH Tcl_CreateCommand 3 "" Tcl "Tcl Library Procedures"
@@ -137,7 +137,6 @@ typedef void Tcl_CmdDeleteProc(
.CE
The \fIclientData\fR argument will be the same as the \fIclientData\fR
argument passed to \fBTcl_CreateCommand\fR.
-.PP
.SH "SEE ALSO"
Tcl_CreateObjCommand, Tcl_DeleteCommand, Tcl_GetCommandInfo, Tcl_SetCommandInfo, Tcl_GetCommandName, Tcl_SetObjResult
diff --git a/doc/CrtMathFnc.3 b/doc/CrtMathFnc.3
index 55188e6..8eef121 100644
--- a/doc/CrtMathFnc.3
+++ b/doc/CrtMathFnc.3
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: CrtMathFnc.3,v 1.13.8.1 2007/11/01 16:25:45 dgp Exp $
+'\" RCS: @(#) $Id: CrtMathFnc.3,v 1.13.8.2 2007/12/10 18:32:54 dgp Exp $
'\"
.so man.macros
.TH Tcl_CreateMathFunc 3 8.4 Tcl "Tcl Library Procedures"
@@ -151,8 +151,8 @@ pointed to by \fIargTypesPointer\fR.
the math functions defined in the interpreter whose name matches
\fIpattern\fR. The returned object has a reference count of zero.
-.SH KEYWORDS
-expression, mathematical function
-
.SH "SEE ALSO"
expr(n), info(n), Tcl_CreateObjCommand(3), Tcl_Free(3), Tcl_NewListObj(3)
+
+.SH KEYWORDS
+expression, mathematical function
diff --git a/doc/FileSystem.3 b/doc/FileSystem.3
index fa80fc0..825192f 100644
--- a/doc/FileSystem.3
+++ b/doc/FileSystem.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: FileSystem.3,v 1.57.4.1 2007/11/01 16:25:46 dgp Exp $
+'\" RCS: @(#) $Id: FileSystem.3,v 1.57.4.2 2007/12/10 18:32:54 dgp Exp $
'\"
.so man.macros
.TH Filesystem 3 8.4 Tcl "Tcl Library Procedures"
@@ -1550,8 +1550,7 @@ typedef int Tcl_FSChdirProc(
The \fBTcl_FSChdirProc\fR changes the applications current working
directory to the value specified in \fIpathPtr\fR. The function returns
-1 on error or 0 on success.
-
-.SH KEYWORDS
-stat, access, filesystem, vfs, virtual
.SH "SEE ALSO"
cd(n), file(n), load(n), open(n), pwd(n), unload(n)
+.SH KEYWORDS
+stat, access, filesystem, vfs, virtual
diff --git a/doc/GetStdChan.3 b/doc/GetStdChan.3
index ed6adde..80b56fa 100644
--- a/doc/GetStdChan.3
+++ b/doc/GetStdChan.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: GetStdChan.3,v 1.6 2006/06/06 20:06:57 dgp Exp $
+'\" RCS: @(#) $Id: GetStdChan.3,v 1.6.6.1 2007/12/10 18:32:54 dgp Exp $
'\"
.so man.macros
.TH Tcl_GetStdChannel 3 7.5 Tcl "Tcl Library Procedures"
@@ -78,7 +78,6 @@ standard error being last.
.PP
See \fBTcl_StandardChannels\fR for a general treatise about standard
channels and the behaviour of the Tcl library with regard to them.
-.PP
.SH "SEE ALSO"
Tcl_Close(3), Tcl_CreateChannel(3), Tcl_Main(3), tclsh(1)
diff --git a/doc/Interp.3 b/doc/Interp.3
index 450536b..93859b1 100644
--- a/doc/Interp.3
+++ b/doc/Interp.3
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: Interp.3,v 1.9.8.1 2007/11/01 16:25:46 dgp Exp $
+'\" RCS: @(#) $Id: Interp.3,v 1.9.8.2 2007/12/10 18:32:54 dgp Exp $
'\"
.so man.macros
.TH Tcl_Interp 3 7.5 Tcl "Tcl Library Procedures"
@@ -34,8 +34,11 @@ on the interpreter. Interpreter structures contain many fields
that are used by Tcl, but only three that may be accessed by
clients: \fIresult\fR, \fIfreeProc\fR, and \fIerrorLine\fR.
.PP
-\fBNote that access to the \fIresult\fB and \fIfreeProc\fB fields is\fR
-\fBdeprecated.\fR Use \fBTcl_SetResult\fR and \fBTcl_GetResult\fR instead.
+.VS 8.5
+\fBNote that access to all three fields, \fIresult\fB, \fIfreeProc\fB and
+\fIerrorLine\fB is deprecated.\fR Use \fBTcl_SetResult\fR,
+\fBTcl_GetResult\fR, and \fBTcl_GetReturnOptions\fR instead.
+.VE 8.5
.PP
The \fIresult\fR and \fIfreeProc\fR fields are used to return
results or error messages from commands.
diff --git a/doc/OpenFileChnl.3 b/doc/OpenFileChnl.3
index 4615a27..2090e31 100644
--- a/doc/OpenFileChnl.3
+++ b/doc/OpenFileChnl.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: OpenFileChnl.3,v 1.32.8.1 2007/11/01 16:25:46 dgp Exp $
+'\" RCS: @(#) $Id: OpenFileChnl.3,v 1.32.8.2 2007/12/10 18:32:54 dgp Exp $
.so man.macros
.TH Tcl_OpenFileChannel 3 8.3 Tcl "Tcl Library Procedures"
.BS
@@ -247,8 +247,6 @@ leaves an error message in \fIinterp\fR's result after any error.
As of Tcl 8.4, the object-based API \fBTcl_FSOpenFileChannel\fR should
be used in preference to \fBTcl_OpenFileChannel\fR wherever possible.
.PP
-
-.PP
The newly created channel is not registered in the supplied interpreter; to
register it, use \fBTcl_RegisterChannel\fR, described below.
If one of the standard channels, \fBstdin, stdout\fR or \fBstderr\fR was
diff --git a/doc/SetChanErr.3 b/doc/SetChanErr.3
index 11b32ea..d1873fc 100644
--- a/doc/SetChanErr.3
+++ b/doc/SetChanErr.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: SetChanErr.3,v 1.2 2006/04/12 02:35:06 das Exp $
+'\" RCS: @(#) $Id: SetChanErr.3,v 1.2.6.1 2007/12/10 18:32:54 dgp Exp $
.so man.macros
.TH Tcl_SetChannelError 3 8.5 Tcl "Tcl Library Procedures"
.BS
@@ -146,7 +146,6 @@ leave all their error information in the interpreter result.
.IP \fBTcl_Close\fR
.IP \fBTcl_UnregisterChannel\fR
.IP \fBTcl_UnstackChannel\fR
-.PP
.SH "SEE ALSO"
Tcl_Close(3), Tcl_OpenFileChannel(3), Tcl_SetErrno(3)
diff --git a/doc/StringObj.3 b/doc/StringObj.3
index d98a007..7f8bbdb 100644
--- a/doc/StringObj.3
+++ b/doc/StringObj.3
@@ -4,13 +4,13 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: StringObj.3,v 1.20.8.1 2007/11/01 16:25:47 dgp Exp $
+'\" RCS: @(#) $Id: StringObj.3,v 1.20.8.2 2007/12/10 18:32:54 dgp Exp $
'\"
.so man.macros
.TH Tcl_StringObj 3 8.1 Tcl "Tcl Library Procedures"
.BS
.SH NAME
-Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendStringsToObj, Tcl_AppendStringsToObjVA, Tcl_AppendObjToObj, Tcl_SetObjLength, Tcl_ConcatObj, Tcl_AttemptSetObjLength \- manipulate Tcl objects as strings
+Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendObjToObjVA, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl objects as strings
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -62,6 +62,23 @@ void
.sp
void
\fBTcl_AppendStringsToObjVA\fR(\fIobjPtr, argList\fR)
+.VS 8.5
+.sp
+void
+\fBTcl_AppendLimitedToObj\fR(\fIobjPtr, bytes, length, limit, ellipsis\fR)
+.sp
+Tcl_Obj *
+\fBTcl_Format\fR(\fIinterp, format, objc, objv\fR)
+.sp
+int
+\fBTcl_AppendFormatToObj\fR(\fIinterp, objPtr, format, objc, objv\fR)
+.sp
+Tcl_Obj *
+\fBTcl_ObjPrintf\fR(\fIformat, ...\fR)
+.sp
+int
+\fBTcl_AppendPrintfToObj\fR(\fIobjPtr, format, ...)
+.VE 8.5
.sp
void
\fBTcl_SetObjLength\fR(\fIobjPtr, newLength\fR)
@@ -114,13 +131,20 @@ Null-terminated string value to append to \fIobjPtr\fR.
.AP va_list argList in
An argument list which must have been initialised using
\fBva_start\fR, and cleared using \fBva_end\fR.
+.AP int limit in
+Maximum number of bytes to be appended.
+.AP "const char" *ellipsis in
+Suffix to append when the limit leads to string truncation.
+If NULL is passed then the suffix "..." is used.
+.AP "const char" *format in
+Format control string including % conversion specifiers.
+.AP int objc in
+The number of elements to format or concatenate.
+.AP Tcl_Obj *objv[] in
+The array of objects to format or concatenate.
.AP int newLength in
New length for the string value of \fIobjPtr\fR, not including the
final null character.
-.AP int objc in
-The number of elements to concatenate.
-.AP Tcl_Obj *objv[] in
-The array of objects to concatenate.
.BE
.SH DESCRIPTION
@@ -229,6 +253,88 @@ must be a NULL pointer to indicate the end of the list.
except that instead of taking a variable number of arguments it takes an
argument list.
.PP
+.VS 8.5
+\fBTcl_AppendLimitedToObj\fR is similar to \fBTcl_AppendToObj\fR
+except that it imposes a limit on how many bytes are appended.
+This can be handy when the string to be appended might be
+very large, but the value being constructed should not be allowed to grow
+without bound. A common usage is when constructing an error message, where the
+end result should be kept short enough to be read.
+Bytes from \fIbytes\fR are appended to \fIobjPtr\fR, but no more
+than \fIlimit\fR bytes total are to be appended. If the limit prevents
+all \fIlength\fR bytes that are available from being appended, then the
+appending is done so that the last bytes appended are from the
+string \fIellipsis\fR. This allows for an indication of the truncation
+to be left in the string.
+When \fIlength\fR is \fB-1\fR, all bytes up to the first zero byte are appended,
+subject to the limit. When \fIellipsis\fR is NULL, the default
+string \fB...\fR is used. When \fIellipsis\fR is non-NULL, it must point
+to a zero-byte-terminated string in Tcl's internal UTF encoding.
+The number of bytes appended can be less than the lesser
+of \fIlength\fR and \fIlimit\fR when appending fewer
+bytes is necessary to append only whole multi-byte characters.
+.PP
+\fBTcl_Format\fR is the C-level interface to the engine of the \fBformat\fR
+command. The actual command procedure for \fBformat\fR is little more
+than
+.CS
+Tcl_Format(interp, Tcl_GetString(objv[1]), objc-2, objv+2);
+.CE
+The \fIobjc\fR Tcl_Obj values in \fIobjv\fR are formatted into a string
+according to the conversion specification in \fIformat\fR argument, following
+the documentation for the \fBformat\fR command. The resulting formatted
+string is converted to a new Tcl_Obj with refcount of zero and returned.
+If some error happens during production of the formatted string, NULL is
+returned, and an error message is recorded in \fIinterp\fR, if \fIinterp\fR
+is non-NULL.
+.PP
+\fBTcl_AppendFormatToObj\fR is an appending alternative form
+of \fBTcl_Format\fR with functionality equivalent to
+.CS
+Tcl_Obj *newPtr = Tcl_Format(interp, format, objc, objv);
+if (newPtr == NULL) return TCL_ERROR;
+Tcl_AppendObjToObj(objPtr, newPtr);
+return TCL_OK;
+.CE
+but with greater convenience and efficiency when the appending
+functionality is needed.
+.PP
+\fBTcl_ObjPrintf\fR serves as a replacement for the common sequence
+.CS
+char buf[SOME_SUITABLE_LENGTH];
+sprintf(buf, format, ...);
+Tcl_NewStringObj(buf, -1);
+.CE
+but with greater convenience and no need to
+determine \fBSOME_SUITABLE_LENGTH\fR. The formatting is done with the same
+core formatting engine used by \fBTcl_Format\fR. This means the set of
+supported conversion specifiers is that of the \fBformat\fR command and
+not that of the \fBsprintf\fR routine where the two sets differ. When a
+conversion specifier passed to \fBTcl_ObjPrintf\fR includes a precision,
+the value is taken as a number of bytes, as \fBsprintf\fR does, and not
+as a number of characters, as \fBformat\fR does. This is done on the
+assumption that C code is more likely to know how many bytes it is
+passing around than the number of encoded characters those bytes happen
+to represent. The variable number of arguments passed in should be of
+the types that would be suitable for passing to \fBsprintf\fR. Note in
+this example usage, \fIx\fR is of type \fBlong\fR.
+.CS
+long x = 5;
+Tcl_Obj *objPtr = Tcl_ObjPrintf("Value is %d", x);
+.CE
+If the value of \fIformat\fR contains internal inconsistencies or invalid
+specifier formats, the formatted string result produced by
+\fBTcl_ObjPrintf\fR will be an error message describing the error.
+.PP
+\fBTcl_AppendPrintfToObj\fR is an appending alternative form
+of \fBTcl_ObjPrintf\fR with functionality equivalent to
+.CS
+Tcl_AppendObjToObj(objPtr, Tcl_ObjPrintf(format, ...));
+.CE
+but with greater convenience and efficiency when the appending
+functionality is needed.
+.VE 8.5
+.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
@@ -265,7 +371,7 @@ cleaner-looking. \fBTcl_ConcatObj\fR returns a pointer to a
newly-created object whose ref count is zero.
.SH "SEE ALSO"
-Tcl_NewObj, Tcl_IncrRefCount, Tcl_DecrRefCount
+Tcl_NewObj, Tcl_IncrRefCount, Tcl_DecrRefCount, format, sprintf
.SH KEYWORDS
append, internal representation, object, object type, string object,
diff --git a/doc/UniCharIsAlpha.3 b/doc/UniCharIsAlpha.3
index a53cacf..1bb497d 100644
--- a/doc/UniCharIsAlpha.3
+++ b/doc/UniCharIsAlpha.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: UniCharIsAlpha.3,v 1.3 2004/10/07 14:44:35 dkf Exp $
+'\" RCS: @(#) $Id: UniCharIsAlpha.3,v 1.3.12.1 2007/12/10 18:32:54 dgp Exp $
'\"
.so man.macros
.TH Tcl_UniCharIsAlpha 3 "8.1" Tcl "Tcl Library Procedures"
@@ -64,7 +64,7 @@ with the various routines.
Note: A Tcl_UniChar is a Unicode character represented as an unsigned,
fixed-size quantity.
-.SH CHARACTER CLASSES
+.SH "CHARACTER CLASSES"
.PP
\fBTcl_UniCharIsAlnum\fR tests if the character is an alphanumeric Unicode character.
.PP
diff --git a/doc/eval.n b/doc/eval.n
index 139b65d..bfd13c0 100644
--- a/doc/eval.n
+++ b/doc/eval.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: eval.n,v 1.8 2007/02/18 18:42:54 dkf Exp $
+'\" RCS: @(#) $Id: eval.n,v 1.8.2.1 2007/12/10 18:32:54 dgp Exp $
'\"
.so man.macros
.TH eval n "" Tcl "Tcl Built-In Commands"
@@ -77,8 +77,8 @@ set var [linsert $var 0 {*}$args]
.CE
.VE 8.5
-.SH KEYWORDS
-concatenate, evaluate, script
-
.SH "SEE ALSO"
catch(n), concat(n), error(n), interp(n), list(n), namespace(n), subst(n), tclvars(n), uplevel(n)
+
+.SH KEYWORDS
+concatenate, evaluate, script
diff --git a/doc/expr.n b/doc/expr.n
index 27a94e8..c45f4a0 100644
--- a/doc/expr.n
+++ b/doc/expr.n
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: expr.n,v 1.24.2.1 2007/11/01 16:25:48 dgp Exp $
+'\" RCS: @(#) $Id: expr.n,v 1.24.2.2 2007/12/10 18:32:54 dgp Exp $
'\"
.so man.macros
.TH expr n 8.5 Tcl "Tcl Built-In Commands"
@@ -89,7 +89,7 @@ The command will be executed and its result will be used as
the operand.
.IP [7]
As a mathematical function whose arguments have any of the above
-forms for operands, such as \fBsin($x)\fR. See MATH FUNCTIONS below for
+forms for operands, such as \fBsin($x)\fR. See \fBMATH FUNCTIONS\fR below for
a discussion of how mathematical functions are handled.
.LP
Where the above substitutions occur (e.g. inside quoted strings), they
@@ -114,8 +114,9 @@ will produce the value on the right side of the line:
.CE
.SS OPERATORS
.PP
-The valid operators are listed below, grouped in decreasing order
-of precedence:
+The valid operators (most of which are also available as commands in
+the \fBtcl::mathop\fR namespace; see the \fBmathop\fR(n) manual page
+for details) are listed below, grouped in decreasing order of precedence:
.TP 20
\fB\-\0\0+\0\0~\0\0!\fR
Unary minus, unary plus, bit-wise NOT, logical NOT. None of these operators
@@ -350,6 +351,11 @@ The most expensive code is required for
unbraced expressions that contain command substitutions.
These expressions must be implemented by generating new code
each time the expression is executed.
+.VS 8.5
+When the expression is unbraced to allow the substitution of a function or
+operator, consider using the commands documented in the \fBmathfunc\fR(n) or
+\fBmathop\fR(n) manual pages directly instead.
+.VE 8.5
.SH EXAMPLES
Define a procedure that computes an
.QW interesting
diff --git a/doc/filename.n b/doc/filename.n
index 343a5e7..6cb1812 100644
--- a/doc/filename.n
+++ b/doc/filename.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: filename.n,v 1.14.6.2 2007/11/01 16:25:49 dgp Exp $
+'\" RCS: @(#) $Id: filename.n,v 1.14.6.3 2007/12/10 18:32:54 dgp Exp $
'\"
.so man.macros
.TH filename n 7.5 Tcl "Tcl Built-In Commands"
@@ -173,8 +173,8 @@ Furthermore, a file name consisting only of dots
or dots with trailing characters
.QW .....abc
is illegal.
+.SH "SEE ALSO"
+file(n), glob(n)
.SH KEYWORDS
current directory, absolute file name, relative file name,
volume-relative file name, portability
-.SH "SEE ALSO"
-file(n), glob(n)
diff --git a/doc/interp.n b/doc/interp.n
index dfa9961..92b72a9 100644
--- a/doc/interp.n
+++ b/doc/interp.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: interp.n,v 1.27.2.4 2007/11/02 14:49:14 dgp Exp $
+'\" RCS: @(#) $Id: interp.n,v 1.27.2.5 2007/12/10 18:32:55 dgp Exp $
'\"
.so man.macros
.TH interp n 7.6 Tcl "Tcl Built-In Commands"
@@ -489,7 +489,7 @@ built-in commands:
.DS
.ta 1.2i 2.4i 3.6i
\fBafter\fR \fBappend\fR \fBapply\fR \fBarray\fR
-\fBbinary\fR \fBbreak\fR \fBcase\fR \fBcatch\fR
+\fBbinary\fR \fBbreak\fR \fBcatch\fR \fBchan\fR
\fBclock\fR \fBclose\fR \fBconcat\fR \fBcontinue\fR
\fBdict\fR \fBeof\fR \fBerror\fR \fBeval\fR
\fBexpr\fR \fBfblocked\fR \fBfcopy\fR \fBfileevent\fR
diff --git a/doc/mathop.n b/doc/mathop.n
index 169fcf5..4a1042a 100644
--- a/doc/mathop.n
+++ b/doc/mathop.n
@@ -4,7 +4,7 @@
.\" See the file "license.terms" for information on usage and redistribution
.\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
.\"
-.\" RCS: @(#) $Id: mathop.n,v 1.4.4.2 2007/11/16 07:20:52 dgp Exp $
+.\" RCS: @(#) $Id: mathop.n,v 1.4.4.3 2007/12/10 18:32:55 dgp Exp $
.\"
.so man.macros
.TH mathop n 8.5 Tcl "Tcl Mathematical Operator Commands"
@@ -80,41 +80,51 @@ The following operator commands are supported:
\fB!=\fR \fBne\fR \fB<\fR \fB<=\fR \fB>\fR
\fB>=\fR \fBin\fR \fBni\fR
.DE
-The behaviors of the operator commands are as follows:
-.TP
-\fB~\fR \fInumber\fR
-.
-Returns the bit-wise negation of \fInumber\fR. \fINumber\fR may be an integer
-of any size.
+.SS "MATHEMATICAL OPERATORS"
+.PP
+The behaviors of the mathematical operator commands are as follows:
.TP
-\fB!\fR \fInumber\fR
+\fB!\fR \fIboolean\fR
.
-Returns the boolean negation of \fInumber\fR. \fINumber\fR may be any numeric
-value or any other form of boolean value.
+Returns the boolean negation of \fIboolean\fR, where \fIboolean\fR may be any
+numeric value or any other form of boolean value (i.e. it returns truth if the
+argument is falsity or zero, and falsity if the argument is truth or
+non-zero).
.TP
\fB+\fR ?\fInumber\fR ...?
.
-Returns the sum of arbitrarily many arguments. Each \fInumber\fR may be any
-numeric value. If no arguments are given, the result will be zero.
+Returns the sum of arbitrarily many arguments. Each \fInumber\fR argument may
+be any numeric value. If no arguments are given, the result will be zero (the
+summation identity).
.TP
\fB\-\fR \fInumber\fR ?\fInumber\fR ...?
.
-Returns the either the negation of the first argument (if only one argument is
-given) or the result of subtracting arbitrarily many additional arguments from
-the first argument. Each \fInumber\fR may be any numeric value. At least one
-argument must be given.
+If only a single \fInumber\fR argument is given, returns the negation of that
+numeric value. Otherwise returns the number that results when all subsequent
+numeric values are subtracted from the first one. All \fInumber\fR arguments
+must be numeric values. At least one argument must be given.
.TP
\fB*\fR ?\fInumber\fR ...?
.
Returns the product of arbitrarily many arguments. Each \fInumber\fR may be
-any numeric value. If no arguments are given, the result will be one.
+any numeric value. If no arguments are given, the result will be one (the
+multiplicative identity).
.TP
\fB/\fR \fInumber\fR ?\fInumber\fR ...?
.
-Returns the either the reciprocal of the first argument (if only one argument
-is given) or the result of dividing the first argument by arbitrarily many
-additional arguments. Each \fInumber\fR may be any numeric value. At least one
-argument must be given.
+If only a single \fInumber\fR argument is given, returns the reciprocal of that
+numeric value (i.e. the value obtained by dividing 1.0 by that value).
+Otherwise returns the number that results when the first numeric argument is
+divided by all subsequent numeric arguments. All \fInumber\fR arguments must
+be numeric values. At least one argument must be given.
+.RS
+.PP
+Note that when the leading values in the list of arguments are integers,
+integer division will be used for those initial steps (i.e. the intermediate
+results will be as if the functions \fIfloor\fR and \fIint\fR are applied to
+them, in that order). If all values in the operation are integers, the result
+will be an integer.
+.RE
.TP
\fB%\fR \fInumber number\fR
.
@@ -141,35 +151,10 @@ first is negative. If no arguments are given, the result will be one, and if
only one argument is given, the result will be that argument. The
result will have an integral value only when all arguments are
integral values.
-.TP
-\fB&\fR ?\fInumber\fR ...?
-.
-Returns the bit-wise AND of each of the arbitrarily many arguments. Each
-\fInumber\fR must have an integral value. If no arguments are given, the
-result will be minus one.
-.TP
-\fB|\fR ?\fInumber\fR ...?
-.
-Returns the bit-wise OR of each of the arbitrarily many arguments. Each
-\fInumber\fR must have an integral value. If no arguments are given, the
-result will be zero..TP
-\fB^\fR ?\fInumber\fR ...?
-.
-Returns the bit-wise XOR of each of the arbitrarily many arguments. Each
-\fInumber\fR must have an integral value. If no arguments are given, the
-result will be zero.
-.TP
-\fB<<\fR \fInumber number\fR
-.
-Returns the result of bit-wise shifting the first argument left by the
-number of bits specified in the second argument. Each \fInumber\fR
-must have an integral value.
-.TP
-\fB>>\fR \fInumber number\fR
-.
-Returns the result of bit-wise shifting the first argument right by
-the number of bits specified in the second argument. Each \fInumber\fR
-must have an integral value.
+.SS "COMPARISON OPERATORS"
+.PP
+The behaviors of the comparison operator commands (most of which operate
+preferentially on numeric arguments) are as follows:
.TP
\fB==\fR ?\fIarg\fR ...?
.
@@ -187,7 +172,8 @@ operation always returns a true value.
\fB!=\fR \fIarg arg\fR
.
Returns whether the two arguments are not equal to each other, in the sense of
-the \fBexpr\fR != operator (\fIi.e.\fR, numeric comparison if possible).
+the \fBexpr\fR != operator (\fIi.e.\fR, numeric comparison if possible, exact
+string comparison otherwise).
.TP
\fBne\fR \fIarg arg\fR
.
@@ -198,37 +184,93 @@ string comparison.
.
Returns whether the arbitrarily-many arguments are ordered, with each argument
after the first having to be strictly more than the one preceding it.
-Comparisons are performed preferentially on the numeric values. If fewer than
-two arguments are present, this operation always returns a true value.
+Comparisons are performed preferentially on the numeric values, and are
+otherwise performed using UNICODE string comparison. If fewer than two
+arguments are present, this operation always returns a true value. When the
+arguments are numeric but should be compared as strings, the \fBstring
+compare\fR command should be used instead.
.TP
\fB<=\fR ?\fIarg\fR ...?
.
Returns whether the arbitrarily-many arguments are ordered, with each argument
after the first having to be equal to or more than the one preceding it.
-Comparisons are performed preferentially on the numeric values. If fewer than
-two arguments are present, this operation always returns a true value.
+Comparisons are performed preferentially on the numeric values, and are
+otherwise performed using UNICODE string comparison. If fewer than two
+arguments are present, this operation always returns a true value. When the
+arguments are numeric but should be compared as strings, the \fBstring
+compare\fR command should be used instead.
.TP
\fB>\fR ?\fIarg\fR ...?
.
Returns whether the arbitrarily-many arguments are ordered, with each argument
after the first having to be strictly less than the one preceding it.
-Comparisons are performed preferentially on the numeric values. If fewer than
-two arguments are present, this operation always returns a true value.
+Comparisons are performed preferentially on the numeric values, and are
+otherwise performed using UNICODE string comparison. If fewer than two
+arguments are present, this operation always returns a true value. When the
+arguments are numeric but should be compared as strings, the \fBstring
+compare\fR command should be used instead.
.TP
\fB>=\fR ?\fIarg\fR ...?
.
Returns whether the arbitrarily-many arguments are ordered, with each argument
after the first having to be equal to or less than the one preceding it.
-Comparisons are performed preferentially on the numeric values. If fewer than
-two arguments are present, this operation always returns a true value.
+Comparisons are performed preferentially on the numeric values, and are
+otherwise performed using UNICODE string comparison. If fewer than two
+arguments are present, this operation always returns a true value. When the
+arguments are numeric but should be compared as strings, the \fBstring
+compare\fR command should be used instead.
+.SS "BIT-WISE OPERATORS"
+.PP
+The behaviors of the bit-wise operator commands (all of which only operate on
+integral arguments) are as follows:
+.TP
+\fB~\fR \fInumber\fR
+.
+Returns the bit-wise negation of \fInumber\fR. \fINumber\fR may be an integer
+of any size. Note that the result of this operation will always have the
+opposite sign to the input \fInumber\fR.
+.TP
+\fB&\fR ?\fInumber\fR ...?
+.
+Returns the bit-wise AND of each of the arbitrarily many arguments. Each
+\fInumber\fR must have an integral value. If no arguments are given, the
+result will be minus one.
+.TP
+\fB|\fR ?\fInumber\fR ...?
+.
+Returns the bit-wise OR of each of the arbitrarily many arguments. Each
+\fInumber\fR must have an integral value. If no arguments are given, the
+result will be zero..TP
+\fB^\fR ?\fInumber\fR ...?
+.
+Returns the bit-wise XOR of each of the arbitrarily many arguments. Each
+\fInumber\fR must have an integral value. If no arguments are given, the
+result will be zero.
+.TP
+\fB<<\fR \fInumber number\fR
+.
+Returns the result of bit-wise shifting the first argument left by the
+number of bits specified in the second argument. Each \fInumber\fR
+must have an integral value.
+.TP
+\fB>>\fR \fInumber number\fR
+.
+Returns the result of bit-wise shifting the first argument right by
+the number of bits specified in the second argument. Each \fInumber\fR
+must have an integral value.
+.SS "LIST OPERATORS"
+.PP
+The behaviors of the list-oriented operator commands are as follows:
.TP
\fBin\fR \fIarg list\fR
.
-Returns whether the value \fIarg\fR is present in the list \fIlist\fR.
+Returns whether the value \fIarg\fR is present in the list \fIlist\fR
+(according to exact string comparison of elements).
.TP
\fBni\fR \fIarg list\fR
.
-Returns whether the value \fIarg\fR is not present in the list \fIlist\fR.
+Returns whether the value \fIarg\fR is not present in the list \fIlist\fR
+(according to exact string comparison of elements).
.SH EXAMPLES
The simplest way to use the operators is often by using \fBnamespace path\fR
to make the commands available. This has the advantage of not affecting the
diff --git a/doc/namespace.n b/doc/namespace.n
index 4241fc9..3b66c4d 100644
--- a/doc/namespace.n
+++ b/doc/namespace.n
@@ -7,7 +7,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: namespace.n,v 1.21.6.1 2007/11/01 16:25:49 dgp Exp $
+'\" RCS: @(#) $Id: namespace.n,v 1.21.6.2 2007/12/10 18:32:55 dgp Exp $
'\"
.so man.macros
.TH namespace n 8.5 Tcl "Tcl Built-In Commands"
@@ -156,8 +156,18 @@ If so, this command deletes the corresponding imported commands.
In effect, this un-does the action of a \fBnamespace import\fR command.
.TP
\fBnamespace import \fR?\fB\-force\fR? ?\fIpattern\fR \fIpattern ...\fR?
-Imports commands into a namespace.
-Each \fIpattern\fR is a qualified name like
+.VS 8.5
+Imports commands into a namespace, or queries the set of imported
+commands in a namespace. When no arguments are present,
+\fBnamespace import\fR returns the list of commands in
+the current namespace that have been imported from other
+namespaces. The commands in the returned list are in
+the format of simple names, with no namespace qualifiers at all.
+This format is suitable for composition with \fBnamespace forget\fR
+(see \fBEXAMPLES\fR below).
+.VE 8.5
+When \fIpattern\fR arguments are present,
+each \fIpattern\fR is a qualified name like
\fBfoo::x\fR or \fBa::p*\fR.
That is, it includes the name of an exporting namespace
and may have glob-style special characters in the command name
@@ -839,6 +849,12 @@ Look up where the command imported in the previous example came from:
.CS
puts "grill came from [\fBnamespace origin\fR grill]"
.CE
+.PP
+Remove all imported commands from the current namespace:
+.CS
+namespace forget {*}[namespace import]
+.CE
+
.SH "SEE ALSO"
interp(n), upvar(n), variable(n)
.SH KEYWORDS
diff --git a/doc/string.n b/doc/string.n
index 7605f1c..c1b8518 100644
--- a/doc/string.n
+++ b/doc/string.n
@@ -5,7 +5,7 @@
.\" See the file "license.terms" for information on usage and redistribution
.\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
.\"
-.\" RCS: @(#) $Id: string.n,v 1.34.2.2 2007/11/01 16:25:55 dgp Exp $
+.\" RCS: @(#) $Id: string.n,v 1.34.2.3 2007/12/10 18:32:55 dgp Exp $
.\"
.so man.macros
.TH string n 8.1 Tcl "Tcl Built-In Commands"
@@ -272,7 +272,8 @@ when matching case-sensitively (since
falls between the
.QW Z
and
-.QW a ), with \fB\-nocase\fR this is considered like {[A\-Za\-z]} (and
+.QW a ),
+with \fB\-nocase\fR this is considered like {[A\-Za\-z]} (and
probably what was meant in the first place).
.IP \fB\e\fIx\fR 10
Matches the single character \fIx\fR. This provides a way of avoiding
diff --git a/generic/tcl.decls b/generic/tcl.decls
index b0b2cc5..4e2e04b 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -4,14 +4,15 @@
# functions that are exported by the Tcl library via the stubs table.
# This file is used to generate the tclDecls.h, tclPlatDecls.h,
# tclStub.c, and tclPlatStub.c files.
-#
#
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 2001, 2002 by Kevin B. Kenny. All rights reserved.
+# Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
+#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-# RCS: @(#) $Id: tcl.decls,v 1.126.2.1 2007/10/02 20:11:47 dgp Exp $
+#
+# RCS: @(#) $Id: tcl.decls,v 1.126.2.2 2007/12/10 18:32:55 dgp Exp $
library tcl
@@ -32,8 +33,9 @@ declare 0 generic {
CONST char* version, ClientData clientData)
}
declare 1 generic {
- CONST84_RETURN char * Tcl_PkgRequireEx(Tcl_Interp *interp, CONST char *name,
- CONST char *version, int exact, ClientData *clientDataPtr)
+ CONST84_RETURN char * Tcl_PkgRequireEx(Tcl_Interp *interp,
+ CONST char *name, CONST char *version, int exact,
+ ClientData *clientDataPtr)
}
declare 2 generic {
void Tcl_Panic(CONST char *format, ...)
@@ -69,7 +71,6 @@ declare 9 unix {
declare 10 unix {
void Tcl_DeleteFileHandler(int fd)
}
-
declare 11 generic {
void Tcl_SetTimer(Tcl_Time *timePtr)
}
@@ -116,7 +117,7 @@ declare 24 generic {
CONST char *file, int line)
}
declare 25 generic {
- Tcl_Obj * Tcl_DbNewListObj(int objc, Tcl_Obj *CONST *objv,
+ Tcl_Obj * Tcl_DbNewListObj(int objc, Tcl_Obj *CONST *objv,
CONST char *file, int line)
}
declare 26 generic {
@@ -354,7 +355,7 @@ declare 94 generic {
}
declare 95 generic {
void Tcl_CreateMathFunc(Tcl_Interp *interp, CONST char *name,
- int numArgs, Tcl_ValueType *argTypes,
+ int numArgs, Tcl_ValueType *argTypes,
Tcl_MathProc *proc, ClientData clientData)
}
declare 96 generic {
@@ -945,7 +946,6 @@ declare 265 generic {
declare 266 generic {
void Tcl_ValidateAllMemory(CONST char *file, int line)
}
-
declare 267 generic {
void Tcl_AppendResultVA(Tcl_Interp *interp, va_list argList)
}
@@ -964,16 +964,17 @@ declare 271 generic {
CONST char *version, int exact)
}
declare 272 generic {
- CONST84_RETURN char * Tcl_PkgPresentEx(Tcl_Interp *interp, CONST char *name,
- CONST char *version, int exact, ClientData *clientDataPtr)
+ CONST84_RETURN char * Tcl_PkgPresentEx(Tcl_Interp *interp,
+ CONST char *name, CONST char *version, int exact,
+ ClientData *clientDataPtr)
}
declare 273 generic {
- int Tcl_PkgProvide(Tcl_Interp *interp, CONST char *name,
+ int Tcl_PkgProvide(Tcl_Interp *interp, CONST char *name,
CONST char *version)
}
# TIP #268: The internally used new Require function is in slot 573.
declare 274 generic {
- CONST84_RETURN char * Tcl_PkgRequire(Tcl_Interp *interp, CONST char *name,
+ CONST84_RETURN char * Tcl_PkgRequire(Tcl_Interp *interp, CONST char *name,
CONST char *version, int exact)
}
declare 275 generic {
@@ -1137,7 +1138,7 @@ declare 316 generic {
int Tcl_SetSystemEncoding(Tcl_Interp *interp, CONST char *name)
}
declare 317 generic {
- Tcl_Obj * Tcl_SetVar2Ex(Tcl_Interp *interp, CONST char *part1,
+ Tcl_Obj * Tcl_SetVar2Ex(Tcl_Interp *interp, CONST char *part1,
CONST char *part2, Tcl_Obj *newValuePtr, int flags)
}
declare 318 generic {
@@ -1266,7 +1267,6 @@ declare 356 generic {
Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp, Tcl_Obj *patObj,
int flags)
}
-
declare 357 generic {
Tcl_Obj *Tcl_EvalTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr,
int count)
@@ -1288,7 +1288,7 @@ declare 361 generic {
}
declare 362 generic {
int Tcl_ParseExpr(Tcl_Interp *interp, CONST char *start, int numBytes,
- Tcl_Parse *parsePtr)
+ Tcl_Parse *parsePtr)
}
declare 363 generic {
int Tcl_ParseQuotedString(Tcl_Interp *interp, CONST char *start,
@@ -1412,48 +1412,56 @@ declare 398 generic {
CONST84_RETURN char * Tcl_ChannelName(CONST Tcl_ChannelType *chanTypePtr)
}
declare 399 generic {
- Tcl_ChannelTypeVersion Tcl_ChannelVersion(CONST Tcl_ChannelType *chanTypePtr)
+ Tcl_ChannelTypeVersion Tcl_ChannelVersion(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 400 generic {
- Tcl_DriverBlockModeProc * Tcl_ChannelBlockModeProc(CONST Tcl_ChannelType
- *chanTypePtr)
+ Tcl_DriverBlockModeProc * Tcl_ChannelBlockModeProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 401 generic {
- Tcl_DriverCloseProc * Tcl_ChannelCloseProc(CONST Tcl_ChannelType *chanTypePtr)
+ Tcl_DriverCloseProc * Tcl_ChannelCloseProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 402 generic {
- Tcl_DriverClose2Proc * Tcl_ChannelClose2Proc(CONST Tcl_ChannelType *chanTypePtr)
+ Tcl_DriverClose2Proc * Tcl_ChannelClose2Proc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 403 generic {
- Tcl_DriverInputProc * Tcl_ChannelInputProc(CONST Tcl_ChannelType *chanTypePtr)
+ Tcl_DriverInputProc * Tcl_ChannelInputProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 404 generic {
- Tcl_DriverOutputProc * Tcl_ChannelOutputProc(CONST Tcl_ChannelType *chanTypePtr)
+ Tcl_DriverOutputProc * Tcl_ChannelOutputProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 405 generic {
- Tcl_DriverSeekProc * Tcl_ChannelSeekProc(CONST Tcl_ChannelType *chanTypePtr)
+ Tcl_DriverSeekProc * Tcl_ChannelSeekProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 406 generic {
- Tcl_DriverSetOptionProc * Tcl_ChannelSetOptionProc(CONST Tcl_ChannelType
- *chanTypePtr)
+ Tcl_DriverSetOptionProc * Tcl_ChannelSetOptionProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 407 generic {
- Tcl_DriverGetOptionProc * Tcl_ChannelGetOptionProc(CONST Tcl_ChannelType
- *chanTypePtr)
+ Tcl_DriverGetOptionProc * Tcl_ChannelGetOptionProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 408 generic {
- Tcl_DriverWatchProc * Tcl_ChannelWatchProc(CONST Tcl_ChannelType *chanTypePtr)
+ Tcl_DriverWatchProc * Tcl_ChannelWatchProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 409 generic {
- Tcl_DriverGetHandleProc * Tcl_ChannelGetHandleProc(CONST Tcl_ChannelType
- *chanTypePtr)
+ Tcl_DriverGetHandleProc * Tcl_ChannelGetHandleProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 410 generic {
- Tcl_DriverFlushProc * Tcl_ChannelFlushProc(CONST Tcl_ChannelType *chanTypePtr)
+ Tcl_DriverFlushProc * Tcl_ChannelFlushProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
declare 411 generic {
- Tcl_DriverHandlerProc * Tcl_ChannelHandlerProc(CONST Tcl_ChannelType
- *chanTypePtr)
+ Tcl_DriverHandlerProc * Tcl_ChannelHandlerProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
# Introduced in 8.4a2
@@ -1478,7 +1486,6 @@ declare 417 generic {
declare 418 generic {
int Tcl_IsChannelExisting(CONST char* channelName)
}
-
declare 419 generic {
int Tcl_UniCharNcasecmp(CONST Tcl_UniChar *ucs, CONST Tcl_UniChar *uct,
unsigned long numChars)
@@ -1487,21 +1494,17 @@ declare 420 generic {
int Tcl_UniCharCaseMatch(CONST Tcl_UniChar *uniStr,
CONST Tcl_UniChar *uniPattern, int nocase)
}
-
declare 421 generic {
Tcl_HashEntry *Tcl_FindHashEntry(Tcl_HashTable *tablePtr, CONST char *key)
}
-
declare 422 generic {
Tcl_HashEntry *Tcl_CreateHashEntry(Tcl_HashTable *tablePtr,
CONST char *key, int *newPtr)
}
-
declare 423 generic {
void Tcl_InitCustomHashTable(Tcl_HashTable *tablePtr, int keyType,
Tcl_HashKeyType *typePtr)
}
-
declare 424 generic {
void Tcl_InitObjHashTable(Tcl_HashTable *tablePtr)
}
@@ -1697,14 +1700,14 @@ declare 479 generic {
}
declare 480 generic {
void Tcl_FSMountsChanged(Tcl_Filesystem *fsPtr)
-}
+}
# New function due to TIP#56
declare 481 generic {
int Tcl_EvalTokensStandard(Tcl_Interp *interp, Tcl_Token *tokenPtr,
int count)
}
-# New export due to TIP#73
+# New export due to TIP#73
declare 482 generic {
void Tcl_GetTime(Tcl_Time* timeBuf)
}
@@ -1976,36 +1979,37 @@ declare 551 generic {
}
# TIP#233 (Virtualized Time)
declare 552 generic {
- void Tcl_SetTimeProc (Tcl_GetTimeProc* getProc,
+ void Tcl_SetTimeProc(Tcl_GetTimeProc* getProc,
Tcl_ScaleTimeProc* scaleProc,
ClientData clientData)
}
declare 553 generic {
- void Tcl_QueryTimeProc (Tcl_GetTimeProc** getProc,
+ void Tcl_QueryTimeProc(Tcl_GetTimeProc** getProc,
Tcl_ScaleTimeProc** scaleProc,
ClientData* clientData)
}
# TIP#218 (Driver Thread Actions) davygrvy/akupries ChannelType ver 4
declare 554 generic {
- Tcl_DriverThreadActionProc *Tcl_ChannelThreadActionProc(CONST Tcl_ChannelType *chanTypePtr)
+ Tcl_DriverThreadActionProc *Tcl_ChannelThreadActionProc(
+ CONST Tcl_ChannelType *chanTypePtr)
}
# TIP#237 (Arbitrary-precision Integers) kevin kenny
declare 555 generic {
- Tcl_Obj* Tcl_NewBignumObj( mp_int* value )
+ Tcl_Obj* Tcl_NewBignumObj(mp_int* value)
}
declare 556 generic {
- Tcl_Obj* Tcl_DbNewBignumObj( mp_int* value, CONST char* file, int line )
+ Tcl_Obj* Tcl_DbNewBignumObj(mp_int* value, CONST char* file, int line)
}
declare 557 generic {
- void Tcl_SetBignumObj( Tcl_Obj* obj, mp_int* value )
+ void Tcl_SetBignumObj(Tcl_Obj* obj, mp_int* value)
}
declare 558 generic {
- int Tcl_GetBignumFromObj( Tcl_Interp* interp, Tcl_Obj* obj, mp_int* value )
+ int Tcl_GetBignumFromObj(Tcl_Interp* interp, Tcl_Obj* obj, mp_int* value)
}
declare 559 generic {
- int Tcl_TakeBignumFromObj( Tcl_Interp* interp, Tcl_Obj* obj, mp_int* value )
+ int Tcl_TakeBignumFromObj(Tcl_Interp* interp, Tcl_Obj* obj, mp_int* value)
}
# TIP #208 ('chan' Command) jeffh
@@ -2020,22 +2024,22 @@ declare 561 generic {
# TIP#219 (Tcl Channel Reflection API) akupries
declare 562 generic {
- void Tcl_SetChannelErrorInterp (Tcl_Interp* interp, Tcl_Obj* msg)
+ void Tcl_SetChannelErrorInterp(Tcl_Interp* interp, Tcl_Obj* msg)
}
declare 563 generic {
- void Tcl_GetChannelErrorInterp (Tcl_Interp* interp, Tcl_Obj** msg)
+ void Tcl_GetChannelErrorInterp(Tcl_Interp* interp, Tcl_Obj** msg)
}
declare 564 generic {
- void Tcl_SetChannelError (Tcl_Channel chan, Tcl_Obj* msg)
+ void Tcl_SetChannelError(Tcl_Channel chan, Tcl_Obj* msg)
}
declare 565 generic {
- void Tcl_GetChannelError (Tcl_Channel chan, Tcl_Obj** msg)
+ void Tcl_GetChannelError(Tcl_Channel chan, Tcl_Obj** msg)
}
# TIP #237 (Additional conversion functions for bignum support)
declare 566 generic {
- int Tcl_InitBignumFromDouble(Tcl_Interp* interp, double initval,
+ int Tcl_InitBignumFromDouble(Tcl_Interp* interp, double initval,
mp_int *toInit)
}
@@ -2068,7 +2072,7 @@ declare 572 generic {
# TIP#268: Extended version numbers and requirements
declare 573 generic {
- int Tcl_PkgRequireProc(Tcl_Interp *interp, CONST char *name,
+ int Tcl_PkgRequireProc(Tcl_Interp *interp, CONST char *name,
int objc, Tcl_Obj *CONST objv[], ClientData *clientDataPtr)
}
@@ -2102,8 +2106,12 @@ declare 579 generic {
interface tclPlat
-######################
-# Windows declarations
+################################
+# Unix specific functions
+# (none)
+
+################################
+# Windows specific functions
# Added in Tcl 8.1
@@ -2114,9 +2122,8 @@ declare 1 win {
char * Tcl_WinTCharToUtf(CONST TCHAR *str, int len, Tcl_DString *dsPtr)
}
-##################
-# Mac OS X declarations
-#
+################################
+# Mac OS X specific functions
declare 0 macosx {
int Tcl_MacOSXOpenBundleResources(Tcl_Interp *interp,
@@ -2134,27 +2141,40 @@ declare 1 macosx {
char *libraryPath)
}
-
##############################################################################
-# Public functions that are not accessible via the stubs table:
-# (listed here _as comments_ so that the 'checkstubs' make target does not
-# complain about them)
-
-# void Tcl_Main(int argc, char **argv, Tcl_AppInitProc *appInitProc)
-# CONST char *Tcl_InitStubs(Tcl_Interp *interp, CONST char *version, int exact)
-# CONST char *TclTomMathInitializeStubs(Tcl_Interp* interp,
-# CONST char* version, int epoch, int revision
-# CONST char *Tcl_PkgInitStubsCheck(Tcl_Interp *interp, CONST char *version,
-# int exact);
+# Public functions that are not accessible via the stubs table.
+export {
+ void Tcl_Main(int argc, char **argv, Tcl_AppInitProc *appInitProc)
+}
+export {
+ CONST char *Tcl_InitStubs(Tcl_Interp *interp, CONST char *version,
+ int exact)
+}
+export {
+ CONST char *TclTomMathInitializeStubs(Tcl_Interp* interp,
+ CONST char* version, int epoch, int revision
+}
+export {
+ CONST char *Tcl_PkgInitStubsCheck(Tcl_Interp *interp, CONST char *version,
+ int exact);
+}
-# Global variables that need to be exported from the tcl shared library:
-# (listed here _as comments_ so that the 'checkstubs' make target does not
-# complain about them, c.f. tk bug bug 1716117)
+# Global variables that need to be exported from the tcl shared library.
-# TclStubs *tclStubsPtr (fool checkstubs)
-# TclPlatStubs *tclPlatStubsPtr (fool checkstubs)
-# TclIntStubs *tclIntStubsPtr (fool checkstubs)
-# TclIntPlatStubs *tclIntPlatStubsPtr (fool checkstubs)
-# TclTomMathStubs* tclTomMathStubsPtr (fool checkstubs)
+export {
+ TclStubs *tclStubsPtr (fool checkstubs)
+}
+export {
+ TclPlatStubs *tclPlatStubsPtr (fool checkstubs)
+}
+export {
+ TclIntStubs *tclIntStubsPtr (fool checkstubs)
+}
+export {
+ TclIntPlatStubs *tclIntPlatStubsPtr (fool checkstubs)
+}
+export {
+ TclTomMathStubs* tclTomMathStubsPtr (fool checkstubs)
+}
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 57be158..deee6b4 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.244.2.19 2007/12/06 16:27:44 dgp Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.244.2.20 2007/12/10 18:32:55 dgp Exp $
*/
#include "tclInt.h"
@@ -205,7 +205,7 @@ static const CmdInfo builtInCmds[] = {
{"source", Tcl_SourceObjCmd, NULL, 0},
{"tell", Tcl_TellObjCmd, NULL, 1},
{"time", Tcl_TimeObjCmd, NULL, 1},
- {"unload", Tcl_UnloadObjCmd, NULL, 1},
+ {"unload", Tcl_UnloadObjCmd, NULL, 0},
{"update", Tcl_UpdateObjCmd, NULL, 1},
{"vwait", Tcl_VwaitObjCmd, NULL, 1},
{NULL, NULL, NULL, 0}
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 95ae51e..24d72d2 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -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.
*
- * RCS: @(#) $Id: tclCompCmds.c,v 1.109.2.16 2007/12/06 17:05:03 dgp Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.109.2.17 2007/12/10 18:32:55 dgp Exp $
*/
#include "tclInt.h"
@@ -3191,7 +3191,14 @@ TclCompileRegexpCmd(
TclEmitInstInt1(INST_STR_MATCH, nocase, envPtr);
}
} else {
- TclEmitInstInt1(INST_REGEXP, nocase, envPtr);
+ /*
+ * Pass correct RE compile flags. We use only Int1 (8-bit), but
+ * that handles all the flags we want to pass.
+ * Use TCL_REG_NOSUB as we don't have capture vars.
+ */
+ int cflags = TCL_REG_ADVANCED | TCL_REG_NOSUB
+ | (nocase ? TCL_REG_NOCASE : 0);
+ TclEmitInstInt1(INST_REGEXP, cflags, envPtr);
}
return TCL_OK;
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index c1621c0..a45bee8 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDecls.h,v 1.128 2007/02/23 23:02:53 nijtmans Exp $
+ * RCS: @(#) $Id: tclDecls.h,v 1.128.2.1 2007/12/10 18:32:55 dgp Exp $
*/
#ifndef _TCLDECLS
@@ -89,7 +89,7 @@ EXTERN int Tcl_DbCkfree (char * ptr, CONST char * file,
EXTERN char * Tcl_DbCkrealloc (char * ptr, unsigned int size,
CONST char * file, int line);
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_CreateFileHandler_TCL_DECLARED
#define Tcl_CreateFileHandler_TCL_DECLARED
/* 9 */
@@ -97,13 +97,28 @@ EXTERN void Tcl_CreateFileHandler (int fd, int mask,
Tcl_FileProc * proc, ClientData clientData);
#endif
#endif /* UNIX */
-#if !defined(__WIN32__) /* UNIX */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef Tcl_CreateFileHandler_TCL_DECLARED
+#define Tcl_CreateFileHandler_TCL_DECLARED
+/* 9 */
+EXTERN void Tcl_CreateFileHandler (int fd, int mask,
+ Tcl_FileProc * proc, ClientData clientData);
+#endif
+#endif /* MACOSX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_DeleteFileHandler_TCL_DECLARED
#define Tcl_DeleteFileHandler_TCL_DECLARED
/* 10 */
EXTERN void Tcl_DeleteFileHandler (int fd);
#endif
#endif /* UNIX */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef Tcl_DeleteFileHandler_TCL_DECLARED
+#define Tcl_DeleteFileHandler_TCL_DECLARED
+/* 10 */
+EXTERN void Tcl_DeleteFileHandler (int fd);
+#endif
+#endif /* MACOSX */
#ifndef Tcl_SetTimer_TCL_DECLARED
#define Tcl_SetTimer_TCL_DECLARED
/* 11 */
@@ -691,20 +706,27 @@ EXTERN void Tcl_DeleteHashTable (Tcl_HashTable * tablePtr);
/* 110 */
EXTERN void Tcl_DeleteInterp (Tcl_Interp * interp);
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_DetachPids_TCL_DECLARED
#define Tcl_DetachPids_TCL_DECLARED
/* 111 */
EXTERN void Tcl_DetachPids (int numPids, Tcl_Pid * pidPtr);
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+#ifndef Tcl_DetachPids_TCL_DECLARED
+#define Tcl_DetachPids_TCL_DECLARED
+/* 111 */
+EXTERN void Tcl_DetachPids (int numPids, Tcl_Pid * pidPtr);
+#endif
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
#ifndef Tcl_DetachPids_TCL_DECLARED
#define Tcl_DetachPids_TCL_DECLARED
/* 111 */
EXTERN void Tcl_DetachPids (int numPids, Tcl_Pid * pidPtr);
#endif
-#endif /* __WIN32__ */
+#endif /* MACOSX */
#ifndef Tcl_DeleteTimerHandler_TCL_DECLARED
#define Tcl_DeleteTimerHandler_TCL_DECLARED
/* 112 */
@@ -1019,7 +1041,7 @@ EXTERN CONST char * Tcl_GetNameOfExecutable (void);
/* 166 */
EXTERN Tcl_Obj * Tcl_GetObjResult (Tcl_Interp * interp);
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_GetOpenFile_TCL_DECLARED
#define Tcl_GetOpenFile_TCL_DECLARED
/* 167 */
@@ -1028,6 +1050,15 @@ EXTERN int Tcl_GetOpenFile (Tcl_Interp * interp,
int checkUsage, ClientData * filePtr);
#endif
#endif /* UNIX */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef Tcl_GetOpenFile_TCL_DECLARED
+#define Tcl_GetOpenFile_TCL_DECLARED
+/* 167 */
+EXTERN int Tcl_GetOpenFile (Tcl_Interp * interp,
+ CONST char * chanID, int forWriting,
+ int checkUsage, ClientData * filePtr);
+#endif
+#endif /* MACOSX */
#ifndef Tcl_GetPathType_TCL_DECLARED
#define Tcl_GetPathType_TCL_DECLARED
/* 168 */
@@ -1184,7 +1215,7 @@ EXTERN Tcl_Obj * Tcl_ObjSetVar2 (Tcl_Interp * interp,
Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr,
Tcl_Obj * newValuePtr, int flags);
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_OpenCommandChannel_TCL_DECLARED
#define Tcl_OpenCommandChannel_TCL_DECLARED
/* 197 */
@@ -1192,14 +1223,22 @@ EXTERN Tcl_Channel Tcl_OpenCommandChannel (Tcl_Interp * interp,
int argc, CONST84 char ** argv, int flags);
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+#ifndef Tcl_OpenCommandChannel_TCL_DECLARED
+#define Tcl_OpenCommandChannel_TCL_DECLARED
+/* 197 */
+EXTERN Tcl_Channel Tcl_OpenCommandChannel (Tcl_Interp * interp,
+ int argc, CONST84 char ** argv, int flags);
+#endif
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
#ifndef Tcl_OpenCommandChannel_TCL_DECLARED
#define Tcl_OpenCommandChannel_TCL_DECLARED
/* 197 */
EXTERN Tcl_Channel Tcl_OpenCommandChannel (Tcl_Interp * interp,
int argc, CONST84 char ** argv, int flags);
#endif
-#endif /* __WIN32__ */
+#endif /* MACOSX */
#ifndef Tcl_OpenFileChannel_TCL_DECLARED
#define Tcl_OpenFileChannel_TCL_DECLARED
/* 198 */
@@ -1255,20 +1294,27 @@ EXTERN void Tcl_QueueEvent (Tcl_Event * evPtr,
EXTERN int Tcl_Read (Tcl_Channel chan, char * bufPtr,
int toRead);
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_ReapDetachedProcs_TCL_DECLARED
#define Tcl_ReapDetachedProcs_TCL_DECLARED
/* 207 */
EXTERN void Tcl_ReapDetachedProcs (void);
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+#ifndef Tcl_ReapDetachedProcs_TCL_DECLARED
+#define Tcl_ReapDetachedProcs_TCL_DECLARED
+/* 207 */
+EXTERN void Tcl_ReapDetachedProcs (void);
+#endif
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
#ifndef Tcl_ReapDetachedProcs_TCL_DECLARED
#define Tcl_ReapDetachedProcs_TCL_DECLARED
/* 207 */
EXTERN void Tcl_ReapDetachedProcs (void);
#endif
-#endif /* __WIN32__ */
+#endif /* MACOSX */
#ifndef Tcl_RecordAndEval_TCL_DECLARED
#define Tcl_RecordAndEval_TCL_DECLARED
/* 208 */
@@ -3475,18 +3521,24 @@ typedef struct TclStubs {
char * (*tcl_DbCkalloc) (unsigned int size, CONST char * file, int line); /* 6 */
int (*tcl_DbCkfree) (char * ptr, CONST char * file, int line); /* 7 */
char * (*tcl_DbCkrealloc) (char * ptr, unsigned int size, CONST char * file, int line); /* 8 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
void (*tcl_CreateFileHandler) (int fd, int mask, Tcl_FileProc * proc, ClientData clientData); /* 9 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
void *reserved9;
-#endif /* __WIN32__ */
-#if !defined(__WIN32__) /* UNIX */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ void (*tcl_CreateFileHandler) (int fd, int mask, Tcl_FileProc * proc, ClientData clientData); /* 9 */
+#endif /* MACOSX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
void (*tcl_DeleteFileHandler) (int fd); /* 10 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
void *reserved10;
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ void (*tcl_DeleteFileHandler) (int fd); /* 10 */
+#endif /* MACOSX */
void (*tcl_SetTimer) (Tcl_Time * timePtr); /* 11 */
void (*tcl_Sleep) (int ms); /* 12 */
int (*tcl_WaitForEvent) (Tcl_Time * timePtr); /* 13 */
@@ -3587,12 +3639,15 @@ typedef struct TclStubs {
void (*tcl_DeleteHashEntry) (Tcl_HashEntry * entryPtr); /* 108 */
void (*tcl_DeleteHashTable) (Tcl_HashTable * tablePtr); /* 109 */
void (*tcl_DeleteInterp) (Tcl_Interp * interp); /* 110 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
void (*tcl_DetachPids) (int numPids, Tcl_Pid * pidPtr); /* 111 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
void (*tcl_DetachPids) (int numPids, Tcl_Pid * pidPtr); /* 111 */
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ void (*tcl_DetachPids) (int numPids, Tcl_Pid * pidPtr); /* 111 */
+#endif /* MACOSX */
void (*tcl_DeleteTimerHandler) (Tcl_TimerToken token); /* 112 */
void (*tcl_DeleteTrace) (Tcl_Interp * interp, Tcl_Trace trace); /* 113 */
void (*tcl_DontCallWhenDeleted) (Tcl_Interp * interp, Tcl_InterpDeleteProc * proc, ClientData clientData); /* 114 */
@@ -3648,12 +3703,15 @@ typedef struct TclStubs {
Tcl_Interp * (*tcl_GetMaster) (Tcl_Interp * interp); /* 164 */
CONST char * (*tcl_GetNameOfExecutable) (void); /* 165 */
Tcl_Obj * (*tcl_GetObjResult) (Tcl_Interp * interp); /* 166 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
int (*tcl_GetOpenFile) (Tcl_Interp * interp, CONST char * chanID, int forWriting, int checkUsage, ClientData * filePtr); /* 167 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
void *reserved167;
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ int (*tcl_GetOpenFile) (Tcl_Interp * interp, CONST char * chanID, int forWriting, int checkUsage, ClientData * filePtr); /* 167 */
+#endif /* MACOSX */
Tcl_PathType (*tcl_GetPathType) (CONST char * path); /* 168 */
int (*tcl_Gets) (Tcl_Channel chan, Tcl_DString * dsPtr); /* 169 */
int (*tcl_GetsObj) (Tcl_Channel chan, Tcl_Obj * objPtr); /* 170 */
@@ -3683,12 +3741,15 @@ typedef struct TclStubs {
void (*tcl_NotifyChannel) (Tcl_Channel channel, int mask); /* 194 */
Tcl_Obj * (*tcl_ObjGetVar2) (Tcl_Interp * interp, Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, int flags); /* 195 */
Tcl_Obj * (*tcl_ObjSetVar2) (Tcl_Interp * interp, Tcl_Obj * part1Ptr, Tcl_Obj * part2Ptr, Tcl_Obj * newValuePtr, int flags); /* 196 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
Tcl_Channel (*tcl_OpenCommandChannel) (Tcl_Interp * interp, int argc, CONST84 char ** argv, int flags); /* 197 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
Tcl_Channel (*tcl_OpenCommandChannel) (Tcl_Interp * interp, int argc, CONST84 char ** argv, int flags); /* 197 */
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ Tcl_Channel (*tcl_OpenCommandChannel) (Tcl_Interp * interp, int argc, CONST84 char ** argv, int flags); /* 197 */
+#endif /* MACOSX */
Tcl_Channel (*tcl_OpenFileChannel) (Tcl_Interp * interp, CONST char * fileName, CONST char * modeString, int permissions); /* 198 */
Tcl_Channel (*tcl_OpenTcpClient) (Tcl_Interp * interp, int port, CONST char * address, CONST char * myaddr, int myport, int async); /* 199 */
Tcl_Channel (*tcl_OpenTcpServer) (Tcl_Interp * interp, int port, CONST char * host, Tcl_TcpAcceptProc * acceptProc, ClientData callbackData); /* 200 */
@@ -3698,12 +3759,15 @@ typedef struct TclStubs {
CONST84_RETURN char * (*tcl_PosixError) (Tcl_Interp * interp); /* 204 */
void (*tcl_QueueEvent) (Tcl_Event * evPtr, Tcl_QueuePosition position); /* 205 */
int (*tcl_Read) (Tcl_Channel chan, char * bufPtr, int toRead); /* 206 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
void (*tcl_ReapDetachedProcs) (void); /* 207 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+ void (*tcl_ReapDetachedProcs) (void); /* 207 */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
void (*tcl_ReapDetachedProcs) (void); /* 207 */
-#endif /* __WIN32__ */
+#endif /* MACOSX */
int (*tcl_RecordAndEval) (Tcl_Interp * interp, CONST char * cmd, int flags); /* 208 */
int (*tcl_RecordAndEvalObj) (Tcl_Interp * interp, Tcl_Obj * cmdPtr, int flags); /* 209 */
void (*tcl_RegisterChannel) (Tcl_Interp * interp, Tcl_Channel chan); /* 210 */
@@ -4128,18 +4192,30 @@ extern TclStubs *tclStubsPtr;
#define Tcl_DbCkrealloc \
(tclStubsPtr->tcl_DbCkrealloc) /* 8 */
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_CreateFileHandler
#define Tcl_CreateFileHandler \
(tclStubsPtr->tcl_CreateFileHandler) /* 9 */
#endif
#endif /* UNIX */
-#if !defined(__WIN32__) /* UNIX */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef Tcl_CreateFileHandler
+#define Tcl_CreateFileHandler \
+ (tclStubsPtr->tcl_CreateFileHandler) /* 9 */
+#endif
+#endif /* MACOSX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_DeleteFileHandler
#define Tcl_DeleteFileHandler \
(tclStubsPtr->tcl_DeleteFileHandler) /* 10 */
#endif
#endif /* UNIX */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef Tcl_DeleteFileHandler
+#define Tcl_DeleteFileHandler \
+ (tclStubsPtr->tcl_DeleteFileHandler) /* 10 */
+#endif
+#endif /* MACOSX */
#ifndef Tcl_SetTimer
#define Tcl_SetTimer \
(tclStubsPtr->tcl_SetTimer) /* 11 */
@@ -4540,18 +4616,24 @@ extern TclStubs *tclStubsPtr;
#define Tcl_DeleteInterp \
(tclStubsPtr->tcl_DeleteInterp) /* 110 */
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_DetachPids
#define Tcl_DetachPids \
(tclStubsPtr->tcl_DetachPids) /* 111 */
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
#ifndef Tcl_DetachPids
#define Tcl_DetachPids \
(tclStubsPtr->tcl_DetachPids) /* 111 */
#endif
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef Tcl_DetachPids
+#define Tcl_DetachPids \
+ (tclStubsPtr->tcl_DetachPids) /* 111 */
+#endif
+#endif /* MACOSX */
#ifndef Tcl_DeleteTimerHandler
#define Tcl_DeleteTimerHandler \
(tclStubsPtr->tcl_DeleteTimerHandler) /* 112 */
@@ -4772,12 +4854,18 @@ extern TclStubs *tclStubsPtr;
#define Tcl_GetObjResult \
(tclStubsPtr->tcl_GetObjResult) /* 166 */
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_GetOpenFile
#define Tcl_GetOpenFile \
(tclStubsPtr->tcl_GetOpenFile) /* 167 */
#endif
#endif /* UNIX */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef Tcl_GetOpenFile
+#define Tcl_GetOpenFile \
+ (tclStubsPtr->tcl_GetOpenFile) /* 167 */
+#endif
+#endif /* MACOSX */
#ifndef Tcl_GetPathType
#define Tcl_GetPathType \
(tclStubsPtr->tcl_GetPathType) /* 168 */
@@ -4891,18 +4979,24 @@ extern TclStubs *tclStubsPtr;
#define Tcl_ObjSetVar2 \
(tclStubsPtr->tcl_ObjSetVar2) /* 196 */
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_OpenCommandChannel
#define Tcl_OpenCommandChannel \
(tclStubsPtr->tcl_OpenCommandChannel) /* 197 */
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
#ifndef Tcl_OpenCommandChannel
#define Tcl_OpenCommandChannel \
(tclStubsPtr->tcl_OpenCommandChannel) /* 197 */
#endif
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef Tcl_OpenCommandChannel
+#define Tcl_OpenCommandChannel \
+ (tclStubsPtr->tcl_OpenCommandChannel) /* 197 */
+#endif
+#endif /* MACOSX */
#ifndef Tcl_OpenFileChannel
#define Tcl_OpenFileChannel \
(tclStubsPtr->tcl_OpenFileChannel) /* 198 */
@@ -4939,18 +5033,24 @@ extern TclStubs *tclStubsPtr;
#define Tcl_Read \
(tclStubsPtr->tcl_Read) /* 206 */
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef Tcl_ReapDetachedProcs
#define Tcl_ReapDetachedProcs \
(tclStubsPtr->tcl_ReapDetachedProcs) /* 207 */
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+#ifndef Tcl_ReapDetachedProcs
+#define Tcl_ReapDetachedProcs \
+ (tclStubsPtr->tcl_ReapDetachedProcs) /* 207 */
+#endif
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
#ifndef Tcl_ReapDetachedProcs
#define Tcl_ReapDetachedProcs \
(tclStubsPtr->tcl_ReapDetachedProcs) /* 207 */
#endif
-#endif /* __WIN32__ */
+#endif /* MACOSX */
#ifndef Tcl_RecordAndEval
#define Tcl_RecordAndEval \
(tclStubsPtr->tcl_RecordAndEval) /* 208 */
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 8142ba9..5103ce0 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -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.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.285.2.25 2007/11/21 06:30:50 dgp Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.285.2.26 2007/12/10 18:32:55 dgp Exp $
*/
#include "tclInt.h"
@@ -4231,16 +4231,15 @@ TclExecuteByteCode(
}
case INST_REGEXP: {
- int nocase, match;
+ int cflags, match;
Tcl_Obj *valuePtr, *value2Ptr;
Tcl_RegExp regExpr;
- nocase = TclGetInt1AtPtr(pc+1);
+ cflags = TclGetInt1AtPtr(pc+1); /* RE compile flages like NOCASE */
valuePtr = OBJ_AT_TOS; /* String */
value2Ptr = OBJ_UNDER_TOS; /* Pattern */
- regExpr = Tcl_GetRegExpFromObj(interp, value2Ptr,
- TCL_REG_ADVANCED | (nocase ? TCL_REG_NOCASE : 0));
+ regExpr = Tcl_GetRegExpFromObj(interp, value2Ptr, cflags);
if (regExpr == NULL) {
match = -1;
} else {
diff --git a/generic/tclIO.c b/generic/tclIO.c
index eb6b54a..af0055e 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -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.
*
- * RCS: @(#) $Id: tclIO.c,v 1.121.2.7 2007/12/06 07:08:33 dgp Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.121.2.8 2007/12/10 18:32:56 dgp Exp $
*/
#include "tclInt.h"
@@ -208,7 +208,7 @@ static int SetChannelFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
static void UpdateStringOfChannel(Tcl_Obj *objPtr);
static void FreeChannelIntRep(Tcl_Obj *objPtr);
-Tcl_ObjType tclChannelType = {
+static Tcl_ObjType tclChannelType = {
"channel", /* name for this type */
FreeChannelIntRep, /* freeIntRepProc */
DupChannelIntRep, /* dupIntRepProc */
@@ -10618,11 +10618,12 @@ SetChannelFromAny(
if (objPtr->typePtr != &tclChannelType) {
Tcl_Channel chan;
- if (objPtr->typePtr != NULL) {
- if (objPtr->bytes == NULL) {
- objPtr->typePtr->updateStringProc(objPtr);
- }
- TclFreeIntRep(objPtr);
+ /*
+ * We need a valid string with which to check for a valid channel, but
+ * make sure not to free internal rep until validated. [Bug 1847044]
+ */
+ if ((objPtr->typePtr != NULL) && (objPtr->bytes == NULL)) {
+ objPtr->typePtr->updateStringProc(objPtr);
}
chan = Tcl_GetChannel(interp, objPtr->bytes, NULL);
@@ -10630,6 +10631,7 @@ SetChannelFromAny(
return TCL_ERROR;
}
+ TclFreeIntRep(objPtr);
statePtr = ((Channel *)chan)->state;
Tcl_Preserve((ClientData) statePtr);
SET_CHANNELSTATE(objPtr, statePtr);
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index fe16aea..23c3656 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOCmd.c,v 1.40.2.8 2007/12/06 16:27:45 dgp Exp $
+ * RCS: @(#) $Id: tclIOCmd.c,v 1.40.2.9 2007/12/10 18:32:56 dgp Exp $
*/
#include "tclInt.h"
@@ -23,9 +23,22 @@ typedef struct AcceptCallback {
} AcceptCallback;
/*
+ * Thread local storage used to maintain a per-thread stdout channel obj.
+ * It must be per-thread because of std channel limitations.
+ */
+
+typedef struct ThreadSpecificData {
+ int initialized; /* Set to 1 when the module is initialized. */
+ Tcl_Obj *stdoutObjPtr; /* Cached stdout channel Tcl_Obj */
+} ThreadSpecificData;
+
+static Tcl_ThreadDataKey dataKey;
+
+/*
* Static functions for this file:
*/
+static void FinalizeIOCmdTSD(ClientData clientData);
static void AcceptCallbackProc(ClientData callbackData,
Tcl_Channel chan, char *address, int port);
static int ChanPendingObjCmd(ClientData unused,
@@ -46,6 +59,35 @@ static void UnregisterTcpServerInterpCleanupProc(
/*
*----------------------------------------------------------------------
*
+ * FinalizeIOCmdTSD --
+ *
+ * Release the storage associated with the per-thread cache.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+FinalizeIOCmdTSD(
+ ClientData clientData) /* Not used. */
+{
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ if (tsdPtr->stdoutObjPtr != NULL) {
+ Tcl_DecrRefCount(tsdPtr->stdoutObjPtr);
+ tsdPtr->stdoutObjPtr = NULL;
+ }
+ tsdPtr->initialized = 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* Tcl_PutsObjCmd --
*
* This function is invoked to process the "puts" Tcl command. See the
@@ -72,24 +114,21 @@ Tcl_PutsObjCmd(
Tcl_Obj *string; /* String to write. */
Tcl_Obj *chanObjPtr = NULL; /* channel object. */
int newline; /* Add a newline at end? */
- const char *channelId; /* Name of channel for puts. */
int result; /* Result of puts operation. */
int mode; /* Mode in which channel is opened. */
+ ThreadSpecificData *tsdPtr;
switch (objc) {
case 2: /* [puts $x] */
string = objv[1];
newline = 1;
- channelId = "stdout";
break;
case 3: /* [puts -nonewline $x] or [puts $chan $x] */
if (strcmp(TclGetString(objv[1]), "-nonewline") == 0) {
newline = 0;
- channelId = "stdout";
} else {
newline = 1;
- channelId = TclGetString(objv[1]);
chanObjPtr = objv[1];
}
string = objv[2];
@@ -97,7 +136,6 @@ Tcl_PutsObjCmd(
case 4: /* [puts -nonewline $chan $x] or [puts $chan $x nonewline] */
if (strcmp(TclGetString(objv[1]), "-nonewline") == 0) {
- channelId = TclGetString(objv[2]);
chanObjPtr = objv[2];
string = objv[3];
} else {
@@ -117,7 +155,6 @@ Tcl_PutsObjCmd(
"\": should be \"nonewline\"", NULL);
return TCL_ERROR;
}
- channelId = TclGetString(objv[1]);
chanObjPtr = objv[1];
string = objv[2];
}
@@ -130,19 +167,22 @@ Tcl_PutsObjCmd(
return TCL_ERROR;
}
- if (chanObjPtr != NULL) {
- if (TclGetChannelFromObj(interp, chanObjPtr, &chan, &mode, 0)
- != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- chan = Tcl_GetChannel(interp, channelId, &mode);
- if (chan == NULL) {
- return TCL_ERROR;
+ if (chanObjPtr == NULL) {
+ tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ if (!tsdPtr->initialized) {
+ tsdPtr->initialized = 1;
+ TclNewLiteralStringObj(tsdPtr->stdoutObjPtr, "stdout");
+ Tcl_IncrRefCount(tsdPtr->stdoutObjPtr);
+ Tcl_CreateThreadExitHandler(FinalizeIOCmdTSD, NULL);
}
+ chanObjPtr = tsdPtr->stdoutObjPtr;
+ }
+ if (TclGetChannelFromObj(interp, chanObjPtr, &chan, &mode, 0) != TCL_OK) {
+ return TCL_ERROR;
}
if ((mode & TCL_WRITABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", channelId,
+ Tcl_AppendResult(interp, "channel \"", TclGetString(chanObjPtr),
"\" wasn't opened for writing", NULL);
return TCL_ERROR;
}
@@ -168,7 +208,8 @@ Tcl_PutsObjCmd(
error:
if (!TclChanCaughtErrorBypass(interp, chan)) {
- Tcl_AppendResult(interp, "error writing \"", channelId, "\": ",
+ Tcl_AppendResult(interp, "error writing \"",
+ TclGetString(chanObjPtr), "\": ",
Tcl_PosixError(interp), NULL);
}
return TCL_ERROR;
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index 2f24ca0..55274ae 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -8,11 +8,12 @@
#
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 2001 by Kevin B. Kenny. All rights reserved.
+# Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-# RCS: @(#) $Id: tclInt.decls,v 1.108.2.5 2007/11/12 19:18:18 dgp Exp $
+#
+# RCS: @(#) $Id: tclInt.decls,v 1.108.2.6 2007/12/10 18:32:56 dgp Exp $
library tcl
@@ -39,7 +40,7 @@ declare 3 generic {
void TclAllocateFreeObjects(void)
}
# Replaced by TclpChdir in 8.1:
-# declare 4 generic {
+# declare 4 generic {
# int TclChdir(Tcl_Interp *interp, char *dirName)
# }
declare 5 {unix win} {
@@ -65,7 +66,7 @@ declare 9 {unix win} {
TclFile *errFilePtr)
}
declare 10 generic {
- int TclCreateProc(Tcl_Interp *interp, Namespace *nsPtr,
+ int TclCreateProc(Tcl_Interp *interp, Namespace *nsPtr,
CONST char *procName,
Tcl_Obj *argsPtr, Tcl_Obj *bodyPtr, Proc **procPtrPtr)
}
@@ -223,7 +224,8 @@ declare 51 generic {
}
# Removed in Tcl 8.5a2
#declare 52 generic {
-# int TclInvoke(Tcl_Interp *interp, int argc, CONST84 char **argv, int flags)
+# int TclInvoke(Tcl_Interp *interp, int argc, CONST84 char **argv,
+# int flags)
#}
declare 53 generic {
int TclInvokeObjectCommand(ClientData clientData, Tcl_Interp *interp,
@@ -318,7 +320,6 @@ declare 76 generic {
declare 77 generic {
void TclpGetTime(Tcl_Time *time)
}
-
declare 78 generic {
int TclpGetTimeZone(unsigned long time)
}
@@ -517,7 +518,7 @@ declare 128 generic {
declare 129 generic {
int Tcl_PushCallFrame(Tcl_Interp *interp, Tcl_CallFrame *framePtr,
Tcl_Namespace *nsPtr, int isProcCallFrame)
-}
+}
declare 130 generic {
int Tcl_RemoveInterpResolvers(Tcl_Interp *interp, CONST char *name)
}
@@ -576,19 +577,15 @@ declare 144 generic {
declare 145 generic {
struct AuxDataType *TclGetAuxDataType(char *typeName)
}
-
declare 146 generic {
TclHandle TclHandleCreate(VOID *ptr)
}
-
declare 147 generic {
void TclHandleFree(TclHandle handle)
}
-
declare 148 generic {
TclHandle TclHandlePreserve(TclHandle handle)
}
-
declare 149 generic {
void TclHandleRelease(TclHandle handle)
}
@@ -602,7 +599,6 @@ declare 151 generic {
void TclRegExpRangeUniChar(Tcl_RegExp re, int index, int *startPtr,
int *endPtr)
}
-
declare 152 generic {
void TclSetLibraryPath(Tcl_Obj *pathPtr)
}
@@ -635,7 +631,8 @@ declare 159 generic {
}
#declare 160 generic {
# int TclpMatchFilesTypes(Tcl_Interp *interp, char *separators,
-# Tcl_DString *dirPtr, char *pattern, char *tail, GlobTypeData *types)
+# Tcl_DString *dirPtr, char *pattern, char *tail,
+# GlobTypeData *types)
#}
# new in 8.3.2/8.4a2
@@ -671,7 +668,7 @@ declare 165 generic {
# New function due to TIP #33
declare 166 generic {
- int TclListObjSetElement(Tcl_Interp *interp, Tcl_Obj *listPtr,
+ int TclListObjSetElement(Tcl_Interp *interp, Tcl_Obj *listPtr,
int index, Tcl_Obj *valuePtr)
}
@@ -696,7 +693,6 @@ declare 171 generic {
int numChars, Command *cmdPtr, int result, int traceFlags,
int objc, Tcl_Obj *CONST objv[])
}
-
declare 172 generic {
int TclInThreadExit(void)
}
@@ -728,7 +724,6 @@ declare 177 generic {
void TclVarErrMsg(Tcl_Interp *interp, CONST char *part1, CONST char *part2,
CONST char *operation, CONST char *reason)
}
-
declare 178 generic {
void Tcl_SetStartupScript(Tcl_Obj *pathPtr, CONST char* encodingName)
}
@@ -804,10 +799,9 @@ declare 183 generic {
# Added in tcl8.5a5 for compiler/executor experimentation.
#
declare 197 generic {
- int TclCompEvalObj (Tcl_Interp *interp, Tcl_Obj *objPtr,
+ int TclCompEvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
CONST CmdFrame* invoker, int word)
}
-
declare 198 generic {
int TclObjGetFrame(Tcl_Interp *interp, Tcl_Obj *objPtr,
CallFrame **framePtrPtr)
@@ -819,33 +813,33 @@ declare 198 generic {
# 200-208 exported for use by the test suite [Bug 1054748]
declare 200 generic {
- int TclpObjRemoveDirectory (Tcl_Obj *pathPtr, int recursive,
+ int TclpObjRemoveDirectory(Tcl_Obj *pathPtr, int recursive,
Tcl_Obj **errorPtr)
}
declare 201 generic {
- int TclpObjCopyDirectory (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr,
+ int TclpObjCopyDirectory(Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr,
Tcl_Obj **errorPtr)
}
declare 202 generic {
- int TclpObjCreateDirectory (Tcl_Obj *pathPtr)
+ int TclpObjCreateDirectory(Tcl_Obj *pathPtr)
}
declare 203 generic {
- int TclpObjDeleteFile (Tcl_Obj *pathPtr)
+ int TclpObjDeleteFile(Tcl_Obj *pathPtr)
}
declare 204 generic {
- int TclpObjCopyFile (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr)
+ int TclpObjCopyFile(Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr)
}
declare 205 generic {
- int TclpObjRenameFile (Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr)
+ int TclpObjRenameFile(Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr)
}
declare 206 generic {
- int TclpObjStat (Tcl_Obj *pathPtr, Tcl_StatBuf *buf)
+ int TclpObjStat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf)
}
declare 207 generic {
- int TclpObjAccess (Tcl_Obj *pathPtr, int mode)
+ int TclpObjAccess(Tcl_Obj *pathPtr, int mode)
}
declare 208 generic {
- Tcl_Channel TclpOpenFileChannel (Tcl_Interp *interp,
+ Tcl_Channel TclpOpenFileChannel(Tcl_Interp *interp,
Tcl_Obj *pathPtr, int mode, int permissions)
}
# Made public by TIP 258
@@ -891,18 +885,16 @@ declare 225 generic {
Tcl_Obj *TclTraceDictPath(Tcl_Interp *interp, Tcl_Obj *rootPtr,
int keyc, Tcl_Obj *CONST keyv[], int flags)
}
-
declare 226 generic {
int TclObjBeingDeleted(Tcl_Obj *objPtr)
}
-
declare 227 generic {
void TclSetNsPath(Namespace *nsPtr, int pathLength,
Tcl_Namespace *pathAry[])
}
declare 228 generic {
int TclObjInterpProcCore(register Tcl_Interp *interp, Tcl_Obj *procNameObj,
- int skip, ProcErrorProc errorProc)
+ int skip, ProcErrorProc errorProc)
}
declare 229 generic {
int TclPtrMakeUpvar(Tcl_Interp *interp, Var *otherP1Ptr,
@@ -913,7 +905,6 @@ declare 230 generic {
CONST char *part2, int flags, CONST char *msg,
CONST int createPart1, CONST int createPart2, Var **arrayPtrPtr)
}
-
declare 231 generic {
int TclGetNamespaceFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
Tcl_Namespace **nsPtrPtr)
@@ -930,7 +921,7 @@ declare 233 generic {
# Exports for VarReform compat: Itcl, XOTcl like to peek into our varTables :(
declare 234 generic {
- Var *TclVarHashCreateVar(TclVarHashTable *tablePtr, const char *key,
+ Var *TclVarHashCreateVar(TclVarHashTable *tablePtr, const char *key,
int *newPtr)
}
declare 235 generic {
@@ -961,8 +952,8 @@ declare 238 generic {
interface tclIntPlat
-############################
-# Windows specific internals
+################################
+# Windows specific functions
declare 0 win {
void TclWinConvertError(DWORD errCode)
@@ -1074,13 +1065,12 @@ declare 27 win {
declare 28 win {
void TclWinResetInterfaces(void)
}
-
declare 29 win {
int TclWinCPUID( unsigned int index, unsigned int *regs )
}
-#########################
-# Unix specific internals
+################################
+# Unix specific functions
# Pipe channel functions
@@ -1142,25 +1132,25 @@ declare 13 unix {
# Added in 8.5:
declare 14 unix {
- int TclUnixCopyFile (CONST char *src, CONST char *dst,
+ int TclUnixCopyFile(CONST char *src, CONST char *dst,
CONST Tcl_StatBuf *statBufPtr, int dontCopyAtts)
}
+################################
+# Mac OS X specific functions
+
declare 15 macosx {
int TclMacOSXGetFileAttribute(Tcl_Interp *interp, int objIndex,
Tcl_Obj *fileName, Tcl_Obj **attributePtrPtr)
}
-
declare 16 macosx {
int TclMacOSXSetFileAttribute(Tcl_Interp *interp, int objIndex,
Tcl_Obj *fileName, Tcl_Obj *attributePtr)
}
-
declare 17 macosx {
int TclMacOSXCopyFileAttributes(CONST char *src, CONST char *dst,
CONST Tcl_StatBuf *statBufPtr)
}
-
declare 18 macosx {
int TclMacOSXMatchType(Tcl_Interp *interp, CONST char *pathName,
CONST char *fileName, Tcl_StatBuf *statBufPtr,
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 7eb5e59..a06bc2f 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -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.
*
- * RCS: @(#) $Id: tclInt.h,v 1.310.2.21 2007/12/06 16:27:46 dgp Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.310.2.22 2007/12/10 18:32:56 dgp Exp $
*/
#ifndef _TCLINT
@@ -2468,6 +2468,9 @@ MODULE_SCOPE int TclFSFileAttrIndex(Tcl_Obj *pathPtr,
const char *attributeName, int *indexPtr);
MODULE_SCOPE int * TclGetAsyncReadyPtr(void);
MODULE_SCOPE Tcl_Obj * TclGetBgErrorHandler(Tcl_Interp *interp);
+MODULE_SCOPE int TclGetChannelFromObj(Tcl_Interp *interp,
+ Tcl_Obj *objPtr, Tcl_Channel *chanPtr,
+ int *modePtr, int flags);
MODULE_SCOPE int TclGetNumberFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, ClientData *clientDataPtr,
int *typePtr);
@@ -3551,7 +3554,7 @@ MODULE_SCOPE void TclBNInitBignumFromWideUInt(mp_int *bignum,
*----------------------------------------------------------------
*/
-#define TclMatchIsTrivial(pattern) strpbrk((pattern), "*[]]?\\") == NULL
+#define TclMatchIsTrivial(pattern) strpbrk((pattern), "*[?\\") == NULL
/*
*----------------------------------------------------------------
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index afa3807..899e279 100644
--- a/generic/tclIntDecls.h
+++ b/generic/tclIntDecls.h
@@ -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.
*
- * RCS: @(#) $Id: tclIntDecls.h,v 1.99.2.5 2007/11/12 19:18:19 dgp Exp $
+ * RCS: @(#) $Id: tclIntDecls.h,v 1.99.2.6 2007/12/10 18:32:56 dgp Exp $
*/
#ifndef _TCLINTDECLS
@@ -51,7 +51,7 @@
EXTERN void TclAllocateFreeObjects (void);
#endif
/* Slot 4 is reserved */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef TclCleanupChildren_TCL_DECLARED
#define TclCleanupChildren_TCL_DECLARED
/* 5 */
@@ -59,14 +59,22 @@ EXTERN int TclCleanupChildren (Tcl_Interp * interp, int numPids,
Tcl_Pid * pidPtr, Tcl_Channel errorChan);
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
#ifndef TclCleanupChildren_TCL_DECLARED
#define TclCleanupChildren_TCL_DECLARED
/* 5 */
EXTERN int TclCleanupChildren (Tcl_Interp * interp, int numPids,
Tcl_Pid * pidPtr, Tcl_Channel errorChan);
#endif
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef TclCleanupChildren_TCL_DECLARED
+#define TclCleanupChildren_TCL_DECLARED
+/* 5 */
+EXTERN int TclCleanupChildren (Tcl_Interp * interp, int numPids,
+ Tcl_Pid * pidPtr, Tcl_Channel errorChan);
+#endif
+#endif /* MACOSX */
#ifndef TclCleanupCommand_TCL_DECLARED
#define TclCleanupCommand_TCL_DECLARED
/* 6 */
@@ -85,7 +93,7 @@ EXTERN int TclCopyChannel (Tcl_Interp * interp,
Tcl_Channel inChan, Tcl_Channel outChan,
int toRead, Tcl_Obj * cmdPtr);
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef TclCreatePipeline_TCL_DECLARED
#define TclCreatePipeline_TCL_DECLARED
/* 9 */
@@ -95,7 +103,7 @@ EXTERN int TclCreatePipeline (Tcl_Interp * interp, int argc,
TclFile * errFilePtr);
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
#ifndef TclCreatePipeline_TCL_DECLARED
#define TclCreatePipeline_TCL_DECLARED
/* 9 */
@@ -104,7 +112,17 @@ EXTERN int TclCreatePipeline (Tcl_Interp * interp, int argc,
TclFile * inPipePtr, TclFile * outPipePtr,
TclFile * errFilePtr);
#endif
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef TclCreatePipeline_TCL_DECLARED
+#define TclCreatePipeline_TCL_DECLARED
+/* 9 */
+EXTERN int TclCreatePipeline (Tcl_Interp * interp, int argc,
+ CONST char ** argv, Tcl_Pid ** pidArrayPtr,
+ TclFile * inPipePtr, TclFile * outPipePtr,
+ TclFile * errFilePtr);
+#endif
+#endif /* MACOSX */
#ifndef TclCreateProc_TCL_DECLARED
#define TclCreateProc_TCL_DECLARED
/* 10 */
@@ -446,20 +464,27 @@ EXTERN int TclSockGetPort (Tcl_Interp * interp,
CONST char * str, CONST char * proto,
int * portPtr);
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef TclSockMinimumBuffers_TCL_DECLARED
#define TclSockMinimumBuffers_TCL_DECLARED
/* 104 */
EXTERN int TclSockMinimumBuffers (int sock, int size);
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+#ifndef TclSockMinimumBuffers_TCL_DECLARED
+#define TclSockMinimumBuffers_TCL_DECLARED
+/* 104 */
+EXTERN int TclSockMinimumBuffers (int sock, int size);
+#endif
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
#ifndef TclSockMinimumBuffers_TCL_DECLARED
#define TclSockMinimumBuffers_TCL_DECLARED
/* 104 */
EXTERN int TclSockMinimumBuffers (int sock, int size);
#endif
-#endif /* __WIN32__ */
+#endif /* MACOSX */
/* Slot 105 is reserved */
/* Slot 106 is reserved */
/* Slot 107 is reserved */
@@ -1081,21 +1106,27 @@ typedef struct TclIntStubs {
void *reserved2;
void (*tclAllocateFreeObjects) (void); /* 3 */
void *reserved4;
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
int (*tclCleanupChildren) (Tcl_Interp * interp, int numPids, Tcl_Pid * pidPtr, Tcl_Channel errorChan); /* 5 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+ int (*tclCleanupChildren) (Tcl_Interp * interp, int numPids, Tcl_Pid * pidPtr, Tcl_Channel errorChan); /* 5 */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
int (*tclCleanupChildren) (Tcl_Interp * interp, int numPids, Tcl_Pid * pidPtr, Tcl_Channel errorChan); /* 5 */
-#endif /* __WIN32__ */
+#endif /* MACOSX */
void (*tclCleanupCommand) (Command * cmdPtr); /* 6 */
int (*tclCopyAndCollapse) (int count, CONST char * src, char * dst); /* 7 */
int (*tclCopyChannel) (Tcl_Interp * interp, Tcl_Channel inChan, Tcl_Channel outChan, int toRead, Tcl_Obj * cmdPtr); /* 8 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
int (*tclCreatePipeline) (Tcl_Interp * interp, int argc, CONST char ** argv, Tcl_Pid ** pidArrayPtr, TclFile * inPipePtr, TclFile * outPipePtr, TclFile * errFilePtr); /* 9 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
int (*tclCreatePipeline) (Tcl_Interp * interp, int argc, CONST char ** argv, Tcl_Pid ** pidArrayPtr, TclFile * inPipePtr, TclFile * outPipePtr, TclFile * errFilePtr); /* 9 */
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ int (*tclCreatePipeline) (Tcl_Interp * interp, int argc, CONST char ** argv, Tcl_Pid ** pidArrayPtr, TclFile * inPipePtr, TclFile * outPipePtr, TclFile * errFilePtr); /* 9 */
+#endif /* MACOSX */
int (*tclCreateProc) (Tcl_Interp * interp, Namespace * nsPtr, CONST char * procName, Tcl_Obj * argsPtr, Tcl_Obj * bodyPtr, Proc ** procPtrPtr); /* 10 */
void (*tclDeleteCompiledLocalVars) (Interp * iPtr, CallFrame * framePtr); /* 11 */
void (*tclDeleteVars) (Interp * iPtr, TclVarHashTable * tablePtr); /* 12 */
@@ -1190,12 +1221,15 @@ typedef struct TclIntStubs {
char * (*tclSetPreInitScript) (char * string); /* 101 */
void (*tclSetupEnv) (Tcl_Interp * interp); /* 102 */
int (*tclSockGetPort) (Tcl_Interp * interp, CONST char * str, CONST char * proto, int * portPtr); /* 103 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
int (*tclSockMinimumBuffers) (int sock, int size); /* 104 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+ int (*tclSockMinimumBuffers) (int sock, int size); /* 104 */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
int (*tclSockMinimumBuffers) (int sock, int size); /* 104 */
-#endif /* __WIN32__ */
+#endif /* MACOSX */
void *reserved105;
void *reserved106;
void *reserved107;
@@ -1354,18 +1388,24 @@ extern TclIntStubs *tclIntStubsPtr;
(tclIntStubsPtr->tclAllocateFreeObjects) /* 3 */
#endif
/* Slot 4 is reserved */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef TclCleanupChildren
#define TclCleanupChildren \
(tclIntStubsPtr->tclCleanupChildren) /* 5 */
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+#ifndef TclCleanupChildren
+#define TclCleanupChildren \
+ (tclIntStubsPtr->tclCleanupChildren) /* 5 */
+#endif
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
#ifndef TclCleanupChildren
#define TclCleanupChildren \
(tclIntStubsPtr->tclCleanupChildren) /* 5 */
#endif
-#endif /* __WIN32__ */
+#endif /* MACOSX */
#ifndef TclCleanupCommand
#define TclCleanupCommand \
(tclIntStubsPtr->tclCleanupCommand) /* 6 */
@@ -1378,18 +1418,24 @@ extern TclIntStubs *tclIntStubsPtr;
#define TclCopyChannel \
(tclIntStubsPtr->tclCopyChannel) /* 8 */
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef TclCreatePipeline
#define TclCreatePipeline \
(tclIntStubsPtr->tclCreatePipeline) /* 9 */
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
#ifndef TclCreatePipeline
#define TclCreatePipeline \
(tclIntStubsPtr->tclCreatePipeline) /* 9 */
#endif
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef TclCreatePipeline
+#define TclCreatePipeline \
+ (tclIntStubsPtr->tclCreatePipeline) /* 9 */
+#endif
+#endif /* MACOSX */
#ifndef TclCreateProc
#define TclCreateProc \
(tclIntStubsPtr->tclCreateProc) /* 10 */
@@ -1637,18 +1683,24 @@ extern TclIntStubs *tclIntStubsPtr;
#define TclSockGetPort \
(tclIntStubsPtr->tclSockGetPort) /* 103 */
#endif
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef TclSockMinimumBuffers
#define TclSockMinimumBuffers \
(tclIntStubsPtr->tclSockMinimumBuffers) /* 104 */
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+#ifndef TclSockMinimumBuffers
+#define TclSockMinimumBuffers \
+ (tclIntStubsPtr->tclSockMinimumBuffers) /* 104 */
+#endif
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
#ifndef TclSockMinimumBuffers
#define TclSockMinimumBuffers \
(tclIntStubsPtr->tclSockMinimumBuffers) /* 104 */
#endif
-#endif /* __WIN32__ */
+#endif /* MACOSX */
/* Slot 105 is reserved */
/* Slot 106 is reserved */
/* Slot 107 is reserved */
diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h
index a87dad8..655bab8 100644
--- a/generic/tclIntPlatDecls.h
+++ b/generic/tclIntPlatDecls.h
@@ -9,7 +9,7 @@
* Copyright (c) 1998-1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tclIntPlatDecls.h,v 1.30 2006/11/15 14:58:27 dgp Exp $
+ * RCS: @(#) $Id: tclIntPlatDecls.h,v 1.30.2.1 2007/12/10 18:32:56 dgp Exp $
*/
#ifndef _TCLINTPLATDECLS
@@ -38,7 +38,7 @@
* Exported function declarations:
*/
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef TclGetAndDetachPids_TCL_DECLARED
#define TclGetAndDetachPids_TCL_DECLARED
/* 0 */
@@ -120,7 +120,7 @@ EXTERN int TclUnixCopyFile (CONST char * src, CONST char * dst,
int dontCopyAtts);
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
#ifndef TclWinConvertError_TCL_DECLARED
#define TclWinConvertError_TCL_DECLARED
/* 0 */
@@ -257,8 +257,88 @@ EXTERN void TclWinResetInterfaces (void);
/* 29 */
EXTERN int TclWinCPUID (unsigned int index, unsigned int * regs);
#endif
-#endif /* __WIN32__ */
-#ifdef MAC_OSX_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef TclGetAndDetachPids_TCL_DECLARED
+#define TclGetAndDetachPids_TCL_DECLARED
+/* 0 */
+EXTERN void TclGetAndDetachPids (Tcl_Interp * interp,
+ Tcl_Channel chan);
+#endif
+#ifndef TclpCloseFile_TCL_DECLARED
+#define TclpCloseFile_TCL_DECLARED
+/* 1 */
+EXTERN int TclpCloseFile (TclFile file);
+#endif
+#ifndef TclpCreateCommandChannel_TCL_DECLARED
+#define TclpCreateCommandChannel_TCL_DECLARED
+/* 2 */
+EXTERN Tcl_Channel TclpCreateCommandChannel (TclFile readFile,
+ TclFile writeFile, TclFile errorFile,
+ int numPids, Tcl_Pid * pidPtr);
+#endif
+#ifndef TclpCreatePipe_TCL_DECLARED
+#define TclpCreatePipe_TCL_DECLARED
+/* 3 */
+EXTERN int TclpCreatePipe (TclFile * readPipe,
+ TclFile * writePipe);
+#endif
+#ifndef TclpCreateProcess_TCL_DECLARED
+#define TclpCreateProcess_TCL_DECLARED
+/* 4 */
+EXTERN int TclpCreateProcess (Tcl_Interp * interp, int argc,
+ CONST char ** argv, TclFile inputFile,
+ TclFile outputFile, TclFile errorFile,
+ Tcl_Pid * pidPtr);
+#endif
+/* Slot 5 is reserved */
+#ifndef TclpMakeFile_TCL_DECLARED
+#define TclpMakeFile_TCL_DECLARED
+/* 6 */
+EXTERN TclFile TclpMakeFile (Tcl_Channel channel, int direction);
+#endif
+#ifndef TclpOpenFile_TCL_DECLARED
+#define TclpOpenFile_TCL_DECLARED
+/* 7 */
+EXTERN TclFile TclpOpenFile (CONST char * fname, int mode);
+#endif
+#ifndef TclUnixWaitForFile_TCL_DECLARED
+#define TclUnixWaitForFile_TCL_DECLARED
+/* 8 */
+EXTERN int TclUnixWaitForFile (int fd, int mask, int timeout);
+#endif
+#ifndef TclpCreateTempFile_TCL_DECLARED
+#define TclpCreateTempFile_TCL_DECLARED
+/* 9 */
+EXTERN TclFile TclpCreateTempFile (CONST char * contents);
+#endif
+#ifndef TclpReaddir_TCL_DECLARED
+#define TclpReaddir_TCL_DECLARED
+/* 10 */
+EXTERN Tcl_DirEntry * TclpReaddir (DIR * dir);
+#endif
+#ifndef TclpLocaltime_unix_TCL_DECLARED
+#define TclpLocaltime_unix_TCL_DECLARED
+/* 11 */
+EXTERN struct tm * TclpLocaltime_unix (CONST time_t * clock);
+#endif
+#ifndef TclpGmtime_unix_TCL_DECLARED
+#define TclpGmtime_unix_TCL_DECLARED
+/* 12 */
+EXTERN struct tm * TclpGmtime_unix (CONST time_t * clock);
+#endif
+#ifndef TclpInetNtoa_TCL_DECLARED
+#define TclpInetNtoa_TCL_DECLARED
+/* 13 */
+EXTERN char * TclpInetNtoa (struct in_addr addr);
+#endif
+#ifndef TclUnixCopyFile_TCL_DECLARED
+#define TclUnixCopyFile_TCL_DECLARED
+/* 14 */
+EXTERN int TclUnixCopyFile (CONST char * src, CONST char * dst,
+ CONST Tcl_StatBuf * statBufPtr,
+ int dontCopyAtts);
+#endif
#ifndef TclMacOSXGetFileAttribute_TCL_DECLARED
#define TclMacOSXGetFileAttribute_TCL_DECLARED
/* 15 */
@@ -288,13 +368,13 @@ EXTERN int TclMacOSXMatchType (Tcl_Interp * interp,
Tcl_StatBuf * statBufPtr,
Tcl_GlobTypeData * types);
#endif
-#endif /* MAC_OSX_TCL */
+#endif /* MACOSX */
typedef struct TclIntPlatStubs {
int magic;
struct TclIntPlatStubHooks *hooks;
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
void (*tclGetAndDetachPids) (Tcl_Interp * interp, Tcl_Channel chan); /* 0 */
int (*tclpCloseFile) (TclFile file); /* 1 */
Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid * pidPtr); /* 2 */
@@ -311,7 +391,7 @@ typedef struct TclIntPlatStubs {
char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
int (*tclUnixCopyFile) (CONST char * src, CONST char * dst, CONST Tcl_StatBuf * statBufPtr, int dontCopyAtts); /* 14 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
void (*tclWinConvertError) (DWORD errCode); /* 0 */
void (*tclWinConvertWSAError) (DWORD errCode); /* 1 */
struct servent * (*tclWinGetServByName) (CONST char * nm, CONST char * proto); /* 2 */
@@ -342,13 +422,28 @@ typedef struct TclIntPlatStubs {
void (*tclWinFlushDirtyChannels) (void); /* 27 */
void (*tclWinResetInterfaces) (void); /* 28 */
int (*tclWinCPUID) (unsigned int index, unsigned int * regs); /* 29 */
-#endif /* __WIN32__ */
-#ifdef MAC_OSX_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ void (*tclGetAndDetachPids) (Tcl_Interp * interp, Tcl_Channel chan); /* 0 */
+ int (*tclpCloseFile) (TclFile file); /* 1 */
+ Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid * pidPtr); /* 2 */
+ int (*tclpCreatePipe) (TclFile * readPipe, TclFile * writePipe); /* 3 */
+ int (*tclpCreateProcess) (Tcl_Interp * interp, int argc, CONST char ** argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid * pidPtr); /* 4 */
+ void *reserved5;
+ TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 6 */
+ TclFile (*tclpOpenFile) (CONST char * fname, int mode); /* 7 */
+ int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
+ TclFile (*tclpCreateTempFile) (CONST char * contents); /* 9 */
+ Tcl_DirEntry * (*tclpReaddir) (DIR * dir); /* 10 */
+ struct tm * (*tclpLocaltime_unix) (CONST time_t * clock); /* 11 */
+ struct tm * (*tclpGmtime_unix) (CONST time_t * clock); /* 12 */
+ char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
+ int (*tclUnixCopyFile) (CONST char * src, CONST char * dst, CONST Tcl_StatBuf * statBufPtr, int dontCopyAtts); /* 14 */
int (*tclMacOSXGetFileAttribute) (Tcl_Interp * interp, int objIndex, Tcl_Obj * fileName, Tcl_Obj ** attributePtrPtr); /* 15 */
int (*tclMacOSXSetFileAttribute) (Tcl_Interp * interp, int objIndex, Tcl_Obj * fileName, Tcl_Obj * attributePtr); /* 16 */
int (*tclMacOSXCopyFileAttributes) (CONST char * src, CONST char * dst, CONST Tcl_StatBuf * statBufPtr); /* 17 */
int (*tclMacOSXMatchType) (Tcl_Interp * interp, CONST char * pathName, CONST char * fileName, Tcl_StatBuf * statBufPtr, Tcl_GlobTypeData * types); /* 18 */
-#endif /* MAC_OSX_TCL */
+#endif /* MACOSX */
} TclIntPlatStubs;
#ifdef __cplusplus
@@ -365,7 +460,7 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
* Inline function declarations:
*/
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#ifndef TclGetAndDetachPids
#define TclGetAndDetachPids \
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
@@ -424,7 +519,7 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
#endif
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
#ifndef TclWinConvertError
#define TclWinConvertError \
(tclIntPlatStubsPtr->tclWinConvertError) /* 0 */
@@ -527,8 +622,65 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclWinCPUID \
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
#endif
-#endif /* __WIN32__ */
-#ifdef MAC_OSX_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#ifndef TclGetAndDetachPids
+#define TclGetAndDetachPids \
+ (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
+#endif
+#ifndef TclpCloseFile
+#define TclpCloseFile \
+ (tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
+#endif
+#ifndef TclpCreateCommandChannel
+#define TclpCreateCommandChannel \
+ (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
+#endif
+#ifndef TclpCreatePipe
+#define TclpCreatePipe \
+ (tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
+#endif
+#ifndef TclpCreateProcess
+#define TclpCreateProcess \
+ (tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
+#endif
+/* Slot 5 is reserved */
+#ifndef TclpMakeFile
+#define TclpMakeFile \
+ (tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
+#endif
+#ifndef TclpOpenFile
+#define TclpOpenFile \
+ (tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
+#endif
+#ifndef TclUnixWaitForFile
+#define TclUnixWaitForFile \
+ (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
+#endif
+#ifndef TclpCreateTempFile
+#define TclpCreateTempFile \
+ (tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
+#endif
+#ifndef TclpReaddir
+#define TclpReaddir \
+ (tclIntPlatStubsPtr->tclpReaddir) /* 10 */
+#endif
+#ifndef TclpLocaltime_unix
+#define TclpLocaltime_unix \
+ (tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */
+#endif
+#ifndef TclpGmtime_unix
+#define TclpGmtime_unix \
+ (tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
+#endif
+#ifndef TclpInetNtoa
+#define TclpInetNtoa \
+ (tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
+#endif
+#ifndef TclUnixCopyFile
+#define TclUnixCopyFile \
+ (tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
+#endif
#ifndef TclMacOSXGetFileAttribute
#define TclMacOSXGetFileAttribute \
(tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
@@ -545,7 +697,7 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr;
#define TclMacOSXMatchType \
(tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
#endif
-#endif /* MAC_OSX_TCL */
+#endif /* MACOSX */
#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h
index edd3799..3d7838d 100644
--- a/generic/tclPlatDecls.h
+++ b/generic/tclPlatDecls.h
@@ -6,7 +6,7 @@
* Copyright (c) 1998-1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tclPlatDecls.h,v 1.25 2006/11/15 14:58:27 dgp Exp $
+ * RCS: @(#) $Id: tclPlatDecls.h,v 1.25.2.1 2007/12/10 18:32:56 dgp Exp $
*/
#ifndef _TCLPLATDECLS
@@ -47,7 +47,7 @@
* Exported function declarations:
*/
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
#ifndef Tcl_WinUtfToTChar_TCL_DECLARED
#define Tcl_WinUtfToTChar_TCL_DECLARED
/* 0 */
@@ -60,8 +60,8 @@ EXTERN TCHAR * Tcl_WinUtfToTChar (CONST char * str, int len,
EXTERN char * Tcl_WinTCharToUtf (CONST TCHAR * str, int len,
Tcl_DString * dsPtr);
#endif
-#endif /* __WIN32__ */
-#ifdef MAC_OSX_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
#ifndef Tcl_MacOSXOpenBundleResources_TCL_DECLARED
#define Tcl_MacOSXOpenBundleResources_TCL_DECLARED
/* 0 */
@@ -78,20 +78,20 @@ EXTERN int Tcl_MacOSXOpenVersionedBundleResources (
int hasResourceFile, int maxPathLen,
char * libraryPath);
#endif
-#endif /* MAC_OSX_TCL */
+#endif /* MACOSX */
typedef struct TclPlatStubs {
int magic;
struct TclPlatStubHooks *hooks;
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
TCHAR * (*tcl_WinUtfToTChar) (CONST char * str, int len, Tcl_DString * dsPtr); /* 0 */
char * (*tcl_WinTCharToUtf) (CONST TCHAR * str, int len, Tcl_DString * dsPtr); /* 1 */
-#endif /* __WIN32__ */
-#ifdef MAC_OSX_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
int (*tcl_MacOSXOpenBundleResources) (Tcl_Interp * interp, CONST char * bundleName, int hasResourceFile, int maxPathLen, char * libraryPath); /* 0 */
int (*tcl_MacOSXOpenVersionedBundleResources) (Tcl_Interp * interp, CONST char * bundleName, CONST char * bundleVersion, int hasResourceFile, int maxPathLen, char * libraryPath); /* 1 */
-#endif /* MAC_OSX_TCL */
+#endif /* MACOSX */
} TclPlatStubs;
#ifdef __cplusplus
@@ -108,7 +108,7 @@ extern TclPlatStubs *tclPlatStubsPtr;
* Inline function declarations:
*/
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
#ifndef Tcl_WinUtfToTChar
#define Tcl_WinUtfToTChar \
(tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */
@@ -117,8 +117,8 @@ extern TclPlatStubs *tclPlatStubsPtr;
#define Tcl_WinTCharToUtf \
(tclPlatStubsPtr->tcl_WinTCharToUtf) /* 1 */
#endif
-#endif /* __WIN32__ */
-#ifdef MAC_OSX_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
#ifndef Tcl_MacOSXOpenBundleResources
#define Tcl_MacOSXOpenBundleResources \
(tclPlatStubsPtr->tcl_MacOSXOpenBundleResources) /* 0 */
@@ -127,7 +127,7 @@ extern TclPlatStubs *tclPlatStubsPtr;
#define Tcl_MacOSXOpenVersionedBundleResources \
(tclPlatStubsPtr->tcl_MacOSXOpenVersionedBundleResources) /* 1 */
#endif
-#endif /* MAC_OSX_TCL */
+#endif /* MACOSX */
#endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index b149cd0..37d1a2e 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStubInit.c,v 1.140.2.4 2007/11/12 19:18:20 dgp Exp $
+ * RCS: @(#) $Id: tclStubInit.c,v 1.140.2.5 2007/12/10 18:32:56 dgp Exp $
*/
#include "tclInt.h"
@@ -79,21 +79,27 @@ TclIntStubs tclIntStubs = {
NULL, /* 2 */
TclAllocateFreeObjects, /* 3 */
NULL, /* 4 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
TclCleanupChildren, /* 5 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+ TclCleanupChildren, /* 5 */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
TclCleanupChildren, /* 5 */
-#endif /* __WIN32__ */
+#endif /* MACOSX */
TclCleanupCommand, /* 6 */
TclCopyAndCollapse, /* 7 */
TclCopyChannel, /* 8 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
TclCreatePipeline, /* 9 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
TclCreatePipeline, /* 9 */
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ TclCreatePipeline, /* 9 */
+#endif /* MACOSX */
TclCreateProc, /* 10 */
TclDeleteCompiledLocalVars, /* 11 */
TclDeleteVars, /* 12 */
@@ -188,12 +194,15 @@ TclIntStubs tclIntStubs = {
TclSetPreInitScript, /* 101 */
TclSetupEnv, /* 102 */
TclSockGetPort, /* 103 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
TclSockMinimumBuffers, /* 104 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
TclSockMinimumBuffers, /* 104 */
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ TclSockMinimumBuffers, /* 104 */
+#endif /* MACOSX */
NULL, /* 105 */
NULL, /* 106 */
NULL, /* 107 */
@@ -333,7 +342,7 @@ TclIntStubs tclIntStubs = {
TclIntPlatStubs tclIntPlatStubs = {
TCL_STUB_MAGIC,
NULL,
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
TclGetAndDetachPids, /* 0 */
TclpCloseFile, /* 1 */
TclpCreateCommandChannel, /* 2 */
@@ -350,7 +359,7 @@ TclIntPlatStubs tclIntPlatStubs = {
TclpInetNtoa, /* 13 */
TclUnixCopyFile, /* 14 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
TclWinConvertError, /* 0 */
TclWinConvertWSAError, /* 1 */
TclWinGetServByName, /* 2 */
@@ -381,26 +390,41 @@ TclIntPlatStubs tclIntPlatStubs = {
TclWinFlushDirtyChannels, /* 27 */
TclWinResetInterfaces, /* 28 */
TclWinCPUID, /* 29 */
-#endif /* __WIN32__ */
-#ifdef MAC_OSX_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ TclGetAndDetachPids, /* 0 */
+ TclpCloseFile, /* 1 */
+ TclpCreateCommandChannel, /* 2 */
+ TclpCreatePipe, /* 3 */
+ TclpCreateProcess, /* 4 */
+ NULL, /* 5 */
+ TclpMakeFile, /* 6 */
+ TclpOpenFile, /* 7 */
+ TclUnixWaitForFile, /* 8 */
+ TclpCreateTempFile, /* 9 */
+ TclpReaddir, /* 10 */
+ TclpLocaltime_unix, /* 11 */
+ TclpGmtime_unix, /* 12 */
+ TclpInetNtoa, /* 13 */
+ TclUnixCopyFile, /* 14 */
TclMacOSXGetFileAttribute, /* 15 */
TclMacOSXSetFileAttribute, /* 16 */
TclMacOSXCopyFileAttributes, /* 17 */
TclMacOSXMatchType, /* 18 */
-#endif /* MAC_OSX_TCL */
+#endif /* MACOSX */
};
TclPlatStubs tclPlatStubs = {
TCL_STUB_MAGIC,
NULL,
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
Tcl_WinUtfToTChar, /* 0 */
Tcl_WinTCharToUtf, /* 1 */
-#endif /* __WIN32__ */
-#ifdef MAC_OSX_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
Tcl_MacOSXOpenBundleResources, /* 0 */
Tcl_MacOSXOpenVersionedBundleResources, /* 1 */
-#endif /* MAC_OSX_TCL */
+#endif /* MACOSX */
};
TclTomMathStubs tclTomMathStubs = {
@@ -487,18 +511,24 @@ TclStubs tclStubs = {
Tcl_DbCkalloc, /* 6 */
Tcl_DbCkfree, /* 7 */
Tcl_DbCkrealloc, /* 8 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
Tcl_CreateFileHandler, /* 9 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
NULL, /* 9 */
-#endif /* __WIN32__ */
-#if !defined(__WIN32__) /* UNIX */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ Tcl_CreateFileHandler, /* 9 */
+#endif /* MACOSX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
Tcl_DeleteFileHandler, /* 10 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
NULL, /* 10 */
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ Tcl_DeleteFileHandler, /* 10 */
+#endif /* MACOSX */
Tcl_SetTimer, /* 11 */
Tcl_Sleep, /* 12 */
Tcl_WaitForEvent, /* 13 */
@@ -599,12 +629,15 @@ TclStubs tclStubs = {
Tcl_DeleteHashEntry, /* 108 */
Tcl_DeleteHashTable, /* 109 */
Tcl_DeleteInterp, /* 110 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
Tcl_DetachPids, /* 111 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+ Tcl_DetachPids, /* 111 */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
Tcl_DetachPids, /* 111 */
-#endif /* __WIN32__ */
+#endif /* MACOSX */
Tcl_DeleteTimerHandler, /* 112 */
Tcl_DeleteTrace, /* 113 */
Tcl_DontCallWhenDeleted, /* 114 */
@@ -660,12 +693,15 @@ TclStubs tclStubs = {
Tcl_GetMaster, /* 164 */
Tcl_GetNameOfExecutable, /* 165 */
Tcl_GetObjResult, /* 166 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
Tcl_GetOpenFile, /* 167 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
NULL, /* 167 */
-#endif /* __WIN32__ */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+ Tcl_GetOpenFile, /* 167 */
+#endif /* MACOSX */
Tcl_GetPathType, /* 168 */
Tcl_Gets, /* 169 */
Tcl_GetsObj, /* 170 */
@@ -695,12 +731,15 @@ TclStubs tclStubs = {
Tcl_NotifyChannel, /* 194 */
Tcl_ObjGetVar2, /* 195 */
Tcl_ObjSetVar2, /* 196 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
Tcl_OpenCommandChannel, /* 197 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+ Tcl_OpenCommandChannel, /* 197 */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
Tcl_OpenCommandChannel, /* 197 */
-#endif /* __WIN32__ */
+#endif /* MACOSX */
Tcl_OpenFileChannel, /* 198 */
Tcl_OpenTcpClient, /* 199 */
Tcl_OpenTcpServer, /* 200 */
@@ -710,12 +749,15 @@ TclStubs tclStubs = {
Tcl_PosixError, /* 204 */
Tcl_QueueEvent, /* 205 */
Tcl_Read, /* 206 */
-#if !defined(__WIN32__) /* UNIX */
+#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
Tcl_ReapDetachedProcs, /* 207 */
#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+ Tcl_ReapDetachedProcs, /* 207 */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
Tcl_ReapDetachedProcs, /* 207 */
-#endif /* __WIN32__ */
+#endif /* MACOSX */
Tcl_RecordAndEval, /* 208 */
Tcl_RecordAndEvalObj, /* 209 */
Tcl_RegisterChannel, /* 210 */
diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls
index d68f512..cc1d0ec 100644
--- a/generic/tclTomMath.decls
+++ b/generic/tclTomMath.decls
@@ -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.
#
-# RCS: @(#) $Id: tclTomMath.decls,v 1.1 2005/12/13 22:43:18 kennykb Exp $
+# RCS: @(#) $Id: tclTomMath.decls,v 1.1.10.1 2007/12/10 18:32:57 dgp Exp $
library tcl
@@ -161,7 +161,8 @@ declare 44 generic {
int TclBN_mp_to_unsigned_bin(mp_int* a, unsigned char* b)
}
declare 45 generic {
- int TclBN_mp_to_unsigned_bin_n(mp_int* a, unsigned char* b, unsigned long* outlen)
+ int TclBN_mp_to_unsigned_bin_n(mp_int* a, unsigned char* b,
+ unsigned long* outlen)
}
declare 46 generic {
int TclBN_mp_toradix_n(mp_int* a, char* str, int radix, int maxlen)
diff --git a/tests/chanio.test b/tests/chanio.test
index b7a9676..3a8dab1 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -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.
#
-# RCS: @(#) $Id: chanio.test,v 1.1.2.2 2007/11/16 07:20:56 dgp Exp $
+# RCS: @(#) $Id: chanio.test,v 1.1.2.3 2007/12/10 18:32:57 dgp Exp $
if {[catch {package require tcltest 2}]} {
chan puts stderr "Skipping tests in [info script]. tcltest 2 required."
@@ -7451,6 +7451,11 @@ foreach {n msg expected} {
} [lrange $expected 0 end]
}
+test chan-io-73.1 {channel Tcl_Obj SetChannelFromAny} {} {
+ # Test for Bug 1847044 - don't spoil type unless we have a valid channel
+ catch {chan close [lreplace [list a] 0 end]}
+} {1}
+
# ### ### ### ######### ######### #########
# cleanup
diff --git a/tests/interp.test b/tests/interp.test
index d55ac73..7409993 100644
--- a/tests/interp.test
+++ b/tests/interp.test
@@ -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.
#
-# RCS: @(#) $Id: interp.test,v 1.51 2006/11/03 00:34:52 hobbs Exp $
+# RCS: @(#) $Id: interp.test,v 1.51.2.1 2007/12/10 18:32:57 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2.1
@@ -19,7 +19,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
testConstraint testinterpdelete [llength [info commands testinterpdelete]]
-set hidden_cmds {cd encoding exec exit fconfigure file glob load open pwd socket source}
+set hidden_cmds {cd encoding exec exit fconfigure file glob load open pwd socket source unload}
foreach i [interp slaves] {
interp delete $i
@@ -1795,7 +1795,7 @@ test interp-23.2 {testing hiding vs aliases} {unixOrPc} {
lappend l [lsort [interp hidden a]]
interp delete a
set l
-} {{cd encoding exec exit fconfigure file glob load open pwd socket source} {bar clock} {cd encoding exec exit fconfigure file glob load open pwd socket source} {bar clock} {bar cd encoding exec exit fconfigure file glob load open pwd socket source} clock {cd encoding exec exit fconfigure file glob load open pwd socket source}}
+} {{cd encoding exec exit fconfigure file glob load open pwd socket source unload} {bar clock} {cd encoding exec exit fconfigure file glob load open pwd socket source unload} {bar clock} {bar cd encoding exec exit fconfigure file glob load open pwd socket source unload} clock {cd encoding exec exit fconfigure file glob load open pwd socket source unload}}
test interp-24.1 {result resetting on error} {
catch {interp delete a}
diff --git a/tests/io.test b/tests/io.test
index f6d7d3d..490fa97 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -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.
#
-# RCS: @(#) $Id: io.test,v 1.76.2.2 2007/11/16 07:20:56 dgp Exp $
+# RCS: @(#) $Id: io.test,v 1.76.2.3 2007/12/10 18:32:58 dgp Exp $
if {[catch {package require tcltest 2}]} {
puts stderr "Skipping tests in [info script]. tcltest 2 required."
@@ -7451,6 +7451,11 @@ foreach {n msg expected} {
} [lrange $expected 0 end]
}
+test io-73.1 {channel Tcl_Obj SetChannelFromAny} {} {
+ # Test for Bug 1847044 - don't spoil type unless we have a valid channel
+ catch {close [lreplace [list a] 0 end]}
+} {1}
+
# ### ### ### ######### ######### #########
# cleanup
diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl
index a332ede..17f8383 100644
--- a/tools/genStubs.tcl
+++ b/tools/genStubs.tcl
@@ -1,16 +1,18 @@
# genStubs.tcl --
#
# This script generates a set of stub files for a given
-# interface.
-#
+# interface.
+#
#
# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
+#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-# RCS: @(#) $Id: genStubs.tcl,v 1.20 2007/02/23 23:02:54 nijtmans Exp $
+#
+# RCS: @(#) $Id: genStubs.tcl,v 1.20.2.1 2007/12/10 18:33:38 dgp Exp $
-package require Tcl 8
+package require Tcl 8.4
namespace eval genStubs {
# libraryName --
@@ -161,6 +163,30 @@ proc genStubs::declare {args} {
return
}
+# genStubs::export --
+#
+# This function is used in the declarations file to declare a symbol
+# that is exported from the library but is not in the stubs table.
+#
+# Arguments:
+# decl The C function declaration, or {} for an undefined
+# entry.
+#
+# Results:
+# None.
+
+proc genStubs::export {args} {
+ variable stubs
+ variable curName
+
+ if {[llength $args] != 1} {
+ puts stderr "wrong # args: export $args"
+ }
+ lassign $args decl
+
+ return
+}
+
# genStubs::rewriteFile --
#
# This function replaces the machine generated portion of the
@@ -215,25 +241,51 @@ proc genStubs::rewriteFile {file text} {
# Results:
# Returns the original text inside an appropriate #ifdef.
-proc genStubs::addPlatformGuard {plat text} {
+proc genStubs::addPlatformGuard {plat iftxt {eltxt {}}} {
+ set text ""
switch $plat {
win {
- return "#ifdef __WIN32__\n${text}#endif /* __WIN32__ */\n"
+ append text "#ifdef __WIN32__ /* WIN */\n${iftxt}"
+ if {$eltxt ne ""} {
+ append text "#else /* WIN */\n${eltxt}"
+ }
+ append text "#endif /* WIN */\n"
}
unix {
- return "#if !defined(__WIN32__) /* UNIX */\n${text}#endif /* UNIX */\n"
- }
+ append text "#if !defined(__WIN32__) && !defined(MAC_OSX_TCL)\
+ /* UNIX */\n${iftxt}"
+ if {$eltxt ne ""} {
+ append text "#else /* UNIX */\n${eltxt}"
+ }
+ append text "#endif /* UNIX */\n"
+ }
macosx {
- return "#ifdef MAC_OSX_TCL\n${text}#endif /* MAC_OSX_TCL */\n"
+ append text "#ifdef MAC_OSX_TCL /* MACOSX */\n${iftxt}"
+ if {$eltxt ne ""} {
+ append text "#else /* MACOSX */\n${eltxt}"
+ }
+ append text "#endif /* MACOSX */\n"
}
aqua {
- return "#ifdef MAC_OSX_TK\n${text}#endif /* MAC_OSX_TK */\n"
+ append text "#ifdef MAC_OSX_TK /* AQUA */\n${iftxt}"
+ if {$eltxt ne ""} {
+ append text "#else /* AQUA */\n${eltxt}"
+ }
+ append text "#endif /* AQUA */\n"
}
x11 {
- return "#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */\n${text}#endif /* X11 */\n"
+ append text "#if !(defined(__WIN32__) || defined(MAC_OSX_TK))\
+ /* X11 */\n${iftxt}"
+ if {$eltxt ne ""} {
+ append text "#else /* X11 */\n${eltxt}"
+ }
+ append text "#endif /* X11 */\n"
+ }
+ default {
+ append text "${iftxt}${eltxt}"
}
}
- return "$text"
+ return $text
}
# genStubs::emitSlots --
@@ -416,9 +468,7 @@ proc genStubs::makeDecl {name decl index} {
append line ")"
}
}
- append text $line
-
- append text ";"
+ append text $line ";"
format "#ifndef %s_TCL_DECLARED\n#define %s_TCL_DECLARED\n%s\n#endif\n" \
$fname $fname $text
}
@@ -475,7 +525,7 @@ proc genStubs::makeStub {name decl index} {
set arg1 [lindex $args 0]
if {![string compare $arg1 "TCL_VARARGS"]} {
- lassign [lindex $args 1] type argName
+ lassign [lindex $args 1] type argName
append text " ($type$argName, ...)\n\{\n"
append text " " $type " var;\n va_list argList;\n"
if {[string compare $rtype "void"]} {
@@ -566,7 +616,7 @@ proc genStubs::makeSlot {name decl index} {
append text ")"
}
}
-
+
append text "; /* $index */\n"
return $text
}
@@ -632,110 +682,227 @@ proc genStubs::forAllStubs {name slotProc onAll textVar \
set emit 0
if {[info exists stubs($name,generic,$i)]} {
if {[llength $slots] > 1} {
- puts stderr "platform entry duplicates generic entry: $i"
+ puts stderr "conflicting generic and platform entries:\
+ $name $i"
}
append text [$slotProc $name $stubs($name,generic,$i) $i]
set emit 1
} elseif {[llength $slots] > 0} {
- foreach plat {unix win} {
- if {[info exists stubs($name,$plat,$i)]} {
- append text [addPlatformGuard $plat \
- [$slotProc $name $stubs($name,$plat,$i) $i]]
- set emit 1
+ array set slot {unix 0 x11 0 win 0 macosx 0 aqua 0}
+ foreach s $slots {
+ set slot([lindex [split $s ,] 1]) 1
+ }
+ # "aqua", "macosx" and "x11" are special cases:
+ # "macosx" implies "unix", "aqua" implies "macosx" and "x11"
+ # implies "unix", so we need to be careful not to emit
+ # duplicate stubs entries:
+ if {($slot(unix) && $slot(macosx)) || (
+ ($slot(unix) || $slot(macosx)) &&
+ ($slot(x11) || $slot(aqua)))} {
+ puts stderr "conflicting platform entries: $name $i"
+ }
+ ## unix ##
+ set temp {}
+ set plat unix
+ if {!$slot(aqua) && !$slot(x11)} {
+ if {$slot($plat)} {
+ append temp [$slotProc $name $stubs($name,$plat,$i) $i]
} elseif {$onAll} {
- append text [eval {addPlatformGuard $plat} $skipString]
- set emit 1
+ eval {append temp} $skipString
}
}
- #
- # "aqua" and "macosx" and "x11" are special cases,
- # since "macosx" always implies "unix" and "aqua",
- # "macosx", so we need to be careful not to
- # emit duplicate stubs entries for the two.
- #
- if {[info exists stubs($name,aqua,$i)]
- && ![info exists stubs($name,macosx,$i)]
- && ![info exists stubs($name,unix,$i)]} {
- append text [addPlatformGuard aqua \
- [$slotProc $name $stubs($name,aqua,$i) $i]]
+ if {$temp ne ""} {
+ append text [addPlatformGuard $plat $temp]
set emit 1
}
- if {[info exists stubs($name,macosx,$i)]
- && ![info exists stubs($name,unix,$i)]} {
- append text [addPlatformGuard macosx \
- [$slotProc $name $stubs($name,macosx,$i) $i]]
+ ## x11 ##
+ set temp {}
+ set plat x11
+ if {!$slot(unix) && !$slot(macosx)} {
+ if {$slot($plat)} {
+ append temp [$slotProc $name $stubs($name,$plat,$i) $i]
+ } elseif {$onAll} {
+ eval {append temp} $skipString
+ }
+ }
+ if {$temp ne ""} {
+ append text [addPlatformGuard $plat $temp]
set emit 1
}
- if {[info exists stubs($name,x11,$i)]
- && ![info exists stubs($name,unix,$i)]} {
- append text [addPlatformGuard x11 \
- [$slotProc $name $stubs($name,x11,$i) $i]]
+ ## win ##
+ set temp {}
+ set plat win
+ if {$slot($plat)} {
+ append temp [$slotProc $name $stubs($name,$plat,$i) $i]
+ } elseif {$onAll} {
+ eval {append temp} $skipString
+ }
+ if {$temp ne ""} {
+ append text [addPlatformGuard $plat $temp]
+ set emit 1
+ }
+ ## macosx ##
+ set temp {}
+ set plat macosx
+ if {!$slot(aqua) && !$slot(x11)} {
+ if {$slot($plat)} {
+ append temp [$slotProc $name $stubs($name,$plat,$i) $i]
+ } elseif {$slot(unix)} {
+ append temp [$slotProc $name $stubs($name,unix,$i) $i]
+ } elseif {$onAll} {
+ eval {append temp} $skipString
+ }
+ }
+ if {$temp ne ""} {
+ append text [addPlatformGuard $plat $temp]
+ set emit 1
+ }
+ ## aqua ##
+ set temp {}
+ set plat aqua
+ if {!$slot(unix) && !$slot(macosx)} {
+ if {[string range $skipString 1 2] ne "/*"} {
+ # genStubs.tcl previously had a bug here causing it to
+ # erroneously generate both a unix entry and an aqua
+ # entry for a given stubs table slot. To preserve
+ # backwards compatibility, generate a dummy stubs entry
+ # before every aqua entry (note that this breaks the
+ # correspondence between emitted entry number and
+ # actual position of the entry in the stubs table, e.g.
+ # TkIntStubs entry 113 for aqua is in fact at position
+ # 114 in the table, entry 114 at position 116 etc).
+ eval {append temp} $skipString
+ set temp "[string range $temp 0 end-1] /*\
+ Dummy entry for stubs table backwards\
+ compatibility */\n"
+ }
+ if {$slot($plat)} {
+ append temp [$slotProc $name $stubs($name,$plat,$i) $i]
+ } elseif {$onAll} {
+ eval {append temp} $skipString
+ }
+ }
+ if {$temp ne ""} {
+ append text [addPlatformGuard $plat $temp]
set emit 1
}
}
- if {$emit == 0} {
+ if {!$emit} {
eval {append text} $skipString
}
}
-
} else {
# Emit separate stubs blocks per platform
- foreach plat {unix win} {
- if {[info exists stubs($name,$plat,lastNum)]} {
- set lastNum $stubs($name,$plat,lastNum)
- set temp {}
- for {set i 0} {$i <= $lastNum} {incr i} {
- if {![info exists stubs($name,$plat,$i)]} {
- eval {append temp} $skipString
- } else {
- append temp [$slotProc $name $stubs($name,$plat,$i) $i]
- }
+ array set block {unix 0 x11 0 win 0 macosx 0 aqua 0}
+ foreach s [array names stubs $name,*,lastNum] {
+ set block([lindex [split $s ,] 1]) 1
+ }
+ ## unix ##
+ if {$block(unix) && !$block(x11)} {
+ set temp {}
+ set plat unix
+ set lastNum $stubs($name,$plat,lastNum)
+ for {set i 0} {$i <= $lastNum} {incr i} {
+ if {[info exists stubs($name,$plat,$i)]} {
+ append temp [$slotProc $name $stubs($name,$plat,$i) $i]
+ } else {
+ eval {append temp} $skipString
}
- append text [addPlatformGuard $plat $temp]
}
+ append text [addPlatformGuard $plat $temp]
}
- if {[info exists stubs($name,unix,lastNum)]} {
- set afterUnixNum [expr $stubs($name,unix,lastNum) + 1]
- } else {
- set afterUnixNum 0
+ ## win ##
+ if {$block(win)} {
+ set temp {}
+ set plat win
+ set lastNum $stubs($name,$plat,lastNum)
+ for {set i 0} {$i <= $lastNum} {incr i} {
+ if {[info exists stubs($name,$plat,$i)]} {
+ append temp [$slotProc $name $stubs($name,$plat,$i) $i]
+ } else {
+ eval {append temp} $skipString
+ }
+ }
+ append text [addPlatformGuard $plat $temp]
}
- if {[info exists stubs($name,aqua,lastNum)]} {
- set lastNum $stubs($name,aqua,lastNum)
+ ## macosx ##
+ if {$block(macosx) && !$block(aqua) && !$block(x11)} {
set temp {}
- # Again, make sure you don't duplicate entries for macosx & unix & aqua.
- for {set i $afterUnixNum} {$i <= $lastNum} {incr i} {
- if {![info exists stubs($name,macosx,$i)]} {
- if {![info exists stubs($name,aqua,$i)]} {
- eval {append temp} $skipString
- } else {
- append temp [$slotProc $name $stubs($name,aqua,$i) $i]
+ set lastNum -1
+ foreach plat {unix macosx} {
+ if {$block($plat)} {
+ set lastNum [expr {$lastNum > $stubs($name,$plat,lastNum)
+ ? $lastNum : $stubs($name,$plat,lastNum)}]
+ }
+ }
+ for {set i 0} {$i <= $lastNum} {incr i} {
+ set emit 0
+ foreach plat {unix macosx} {
+ if {[info exists stubs($name,$plat,$i)]} {
+ append temp [$slotProc $name $stubs($name,$plat,$i) $i]
+ set emit 1
+ break
}
}
+ if {!$emit} {
+ eval {append temp} $skipString
+ }
}
- append text [addPlatformGuard aqua $temp]
+ append text [addPlatformGuard macosx $temp]
}
- if {[info exists stubs($name,macosx,lastNum)]} {
- set lastNum $stubs($name,macosx,lastNum)
+ ## aqua ##
+ if {$block(aqua)} {
set temp {}
- # Again, make sure you don't duplicate entries for macosx & unix.
- for {set i $afterUnixNum} {$i <= $lastNum} {incr i} {
- if {![info exists stubs($name,macosx,$i)]} {
+ set lastNum -1
+ foreach plat {unix macosx aqua} {
+ if {$block($plat)} {
+ set lastNum [expr {$lastNum > $stubs($name,$plat,lastNum)
+ ? $lastNum : $stubs($name,$plat,lastNum)}]
+ }
+ }
+ for {set i 0} {$i <= $lastNum} {incr i} {
+ set emit 0
+ foreach plat {unix macosx aqua} {
+ if {[info exists stubs($name,$plat,$i)]} {
+ append temp [$slotProc $name $stubs($name,$plat,$i) $i]
+ set emit 1
+ break
+ }
+ }
+ if {!$emit} {
eval {append temp} $skipString
- } else {
- append temp [$slotProc $name $stubs($name,macosx,$i) $i]
}
}
- append text [addPlatformGuard macosx $temp]
+ append text [addPlatformGuard aqua $temp]
}
- if {[info exists stubs($name,x11,lastNum)]} {
- set lastNum $stubs($name,x11,lastNum)
+ ## x11 ##
+ if {$block(x11)} {
set temp {}
- # Again, make sure you don't duplicate entries for x11 & unix.
- for {set i $afterUnixNum} {$i <= $lastNum} {incr i} {
- if {![info exists stubs($name,x11,$i)]} {
+ set lastNum -1
+ foreach plat {unix macosx x11} {
+ if {$block($plat)} {
+ set lastNum [expr {$lastNum > $stubs($name,$plat,lastNum)
+ ? $lastNum : $stubs($name,$plat,lastNum)}]
+ }
+ }
+ for {set i 0} {$i <= $lastNum} {incr i} {
+ set emit 0
+ foreach plat {unix macosx x11} {
+ if {[info exists stubs($name,$plat,$i)]} {
+ if {$plat ne "macosx"} {
+ append temp [$slotProc $name \
+ $stubs($name,$plat,$i) $i]
+ } else {
+ eval {set etxt} $skipString
+ append temp [addPlatformGuard $plat [$slotProc \
+ $name $stubs($name,$plat,$i) $i] $etxt]
+ }
+ set emit 1
+ break
+ }
+ }
+ if {!$emit} {
eval {append temp} $skipString
- } else {
- append temp [$slotProc $name $stubs($name,x11,$i) $i]
}
}
append text [addPlatformGuard x11 $temp]
@@ -780,12 +947,14 @@ proc genStubs::emitMacros {name textVar} {
upvar $textVar text
set upName [string toupper $libraryName]
- append text "\n#if defined(USE_${upName}_STUBS) && !defined(USE_${upName}_STUB_PROCS)\n"
+ append text "\n#if defined(USE_${upName}_STUBS) &&\
+ !defined(USE_${upName}_STUB_PROCS)\n"
append text "\n/*\n * Inline function declarations:\n */\n\n"
-
+
forAllStubs $name makeMacro 0 text
- append text "\n#endif /* defined(USE_${upName}_STUBS) && !defined(USE_${upName}_STUB_PROCS) */\n"
+ append text "\n#endif /* defined(USE_${upName}_STUBS) &&\
+ !defined(USE_${upName}_STUB_PROCS) */\n"
return
}
@@ -854,7 +1023,7 @@ proc genStubs::emitStubs {name} {
forAllStubs $name makeStub 0 text
rewriteFile [file join $outDir ${name}Stubs.c] $text
- return
+ return
}
# genStubs::emitInit --
@@ -877,7 +1046,7 @@ proc genStubs::emitInit {name textVar} {
append capName [string range $name 1 end]
if {[info exists hooks($name)]} {
- append text "\nstatic ${capName}StubHooks ${name}StubHooks = \{\n"
+ append text "\nstatic ${capName}StubHooks ${name}StubHooks = \{\n"
set sep " "
foreach sub $hooks($name) {
append text $sep "&${sub}Stubs"
@@ -892,7 +1061,7 @@ proc genStubs::emitInit {name textVar} {
} else {
append text " NULL,\n"
}
-
+
forAllStubs $name makeInit 1 text {" NULL, /* $i */\n"}
append text "\};\n"
@@ -984,14 +1153,13 @@ proc genStubs::init {} {
# Returns any values that were not assigned to variables.
if {[string length [namespace which lassign]] == 0} {
-proc lassign {valueList args} {
- if {[llength $args] == 0} {
- error "wrong # args: lassign list varname ?varname..?"
- }
-
- uplevel [list foreach $args $valueList {break}]
- return [lrange $valueList [llength $args] end]
-}
+ proc lassign {valueList args} {
+ if {[llength $args] == 0} {
+ error "wrong # args: lassign list varname ?varname..?"
+ }
+ uplevel [list foreach $args $valueList {break}]
+ return [lrange $valueList [llength $args] end]
+ }
}
-
+
genStubs::init
diff --git a/unix/README b/unix/README
index 3fc8212..5ab2263 100644
--- a/unix/README
+++ b/unix/README
@@ -1,7 +1,7 @@
Tcl UNIX README
---------------
-RCS: @(#) $Id: README,v 1.26.8.1 2007/10/02 20:12:00 dgp Exp $
+RCS: @(#) $Id: README,v 1.26.8.2 2007/12/10 18:33:38 dgp Exp $
This is the directory where you configure, compile, test, and install
UNIX versions of Tcl. This directory also contains source files for Tcl
@@ -104,7 +104,9 @@ How To Compile And Install Tcl:
(d) Type "make". This will create a library archive called
"libtcl<version>.a" or "libtcl<version>.so" and an interpreter
application called "tclsh" that allows you to type Tcl commands
- interactively or execute script files.
+ interactively or execute script files. It will also create
+ a stub library archive "libtclstub<version>.a" that developers
+ may link against other C code to produce loadable extensions for Tcl.
(e) If the make fails then you'll have to personalize the Makefile
for your site or possibly modify the distribution in other ways.
@@ -120,10 +122,15 @@ How To Compile And Install Tcl:
the --prefix and --exec-prefix options to "configure". See the
Makefile for information on what directories were chosen; you
can override these choices by modifying the "prefix" and
- "exec_prefix" variables in the Makefile.
-
-(g) At this point you can play with Tcl by running "make shell"
- and typing Tcl commands at the prompt.
+ "exec_prefix" variables in the Makefile. The installed binaries
+ have embedded within them path values relative to the install
+ directory. If you change your mind about where Tcl should be
+ installed, start this procedure over again from step (a) so that
+ the path embedded in the binaries agrees with the install location.
+
+(g) At this point you can play with Tcl by running the installed "tclsh"
+ executable, or via the "make shell" target, and typing Tcl commands
+ at the interactive prompt.
If you have trouble compiling Tcl, see the URL noted above about working
platforms. It contains information that people have provided about changes
diff --git a/win/rules.vc b/win/rules.vc
index 04a07a1..2c9ad20 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -11,7 +11,7 @@
# Copyright (c) 2003-2007 Patrick Thoyts
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: rules.vc,v 1.29.2.3 2007/11/01 16:25:58 dgp Exp $
+# RCS: @(#) $Id: rules.vc,v 1.29.2.4 2007/12/10 18:33:38 dgp Exp $
#------------------------------------------------------------------------------
!ifndef _RULES_VC
@@ -189,10 +189,10 @@ VCVER=0
!if ![echo VCVERSION=_MSC_VER > vercl.x] \
&& ![cl -nologo -TC -P vercl.x $(ERRNULL)]
!include vercl.i
-!if $(VCVERSION) >= 1400
+!if $(VCVERSION) >= 1500
+VCVER=9
+!elseif $(VCVERSION) >= 1400
VCVER=8
-_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1
-_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
!elseif $(VCVERSION) >= 1300
VCVER=7
!elseif $(VCVERSION) >= 1200
@@ -200,6 +200,12 @@ VCVER=6
!endif
!endif
+# Since MSVC8 we must deal with manifest resources.
+!if $(VCVERSION) >= 1400
+_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1
+_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
+!endif
+
#----------------------------------------------------------
# Decode the options requested.
#----------------------------------------------------------