summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2022-11-09 13:45:46 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2022-11-09 13:45:46 (GMT)
commit973b944b33b10b6644cd90148dd53931ccd7f881 (patch)
tree2b8cf91646452a35a6b21feedb59e1ed03fd1770
parentc8a85bbc05960b91123999e18cdf1c872896dec7 (diff)
parente18b1490d5ec61c9b02def910eed94626e6d3231 (diff)
downloadtcl-973b944b33b10b6644cd90148dd53931ccd7f881.zip
tcl-973b944b33b10b6644cd90148dd53931ccd7f881.tar.gz
tcl-973b944b33b10b6644cd90148dd53931ccd7f881.tar.bz2
Merge trunk. Also update Tcl_ObjType.version to match TIP 644
-rw-r--r--ChangeLog.20002
-rw-r--r--ChangeLog.20082
-rw-r--r--changes4
-rw-r--r--doc/BoolObj.312
-rw-r--r--doc/CrtObjCmd.32
-rw-r--r--doc/CrtTrace.316
-rw-r--r--doc/Encoding.36
-rw-r--r--doc/FileSystem.32
-rw-r--r--doc/OpenTcp.34
-rw-r--r--doc/chan.n13
-rw-r--r--doc/encoding.n102
-rw-r--r--doc/fconfigure.n47
-rw-r--r--doc/http.n51
-rw-r--r--doc/safe.n5
-rw-r--r--generic/regc_locale.c2
-rw-r--r--generic/tcl.decls243
-rw-r--r--generic/tcl.h144
-rwxr-xr-xgeneric/tclArithSeries.c30
-rw-r--r--generic/tclArithSeries.h4
-rw-r--r--generic/tclBasic.c4
-rw-r--r--generic/tclBinary.c4
-rw-r--r--generic/tclCmdMZ.c7
-rw-r--r--generic/tclCompCmdsGR.c224
-rw-r--r--generic/tclCompile.c7
-rw-r--r--generic/tclCompile.h150
-rw-r--r--generic/tclDecls.h686
-rw-r--r--generic/tclDisassemble.c2
-rw-r--r--generic/tclEncoding.c27
-rw-r--r--generic/tclExecute.c103
-rw-r--r--generic/tclIO.c101
-rw-r--r--generic/tclIO.h4
-rw-r--r--generic/tclIOCmd.c39
-rw-r--r--generic/tclIOSock.c4
-rw-r--r--generic/tclIOUtil.c12
-rw-r--r--generic/tclInt.decls63
-rw-r--r--generic/tclInt.h165
-rw-r--r--generic/tclIntDecls.h114
-rw-r--r--generic/tclIntPlatDecls.h574
-rw-r--r--generic/tclInterp.c2
-rw-r--r--generic/tclListObj.c180
-rw-r--r--generic/tclOOScript.h4
-rw-r--r--generic/tclObj.c2
-rw-r--r--generic/tclPkg.c4
-rw-r--r--generic/tclPlatDecls.h102
-rw-r--r--generic/tclProc.c114
-rw-r--r--generic/tclStringObj.c44
-rw-r--r--generic/tclStringRep.h14
-rw-r--r--generic/tclStubInit.c10
-rw-r--r--generic/tclTest.c29
-rw-r--r--generic/tclTrace.c138
-rw-r--r--generic/tclUtil.c12
-rw-r--r--library/auto.tcl4
-rw-r--r--library/http/http.tcl335
-rw-r--r--library/init.tcl2
-rw-r--r--library/install.tcl6
-rw-r--r--library/manifest.txt2
-rw-r--r--library/platform/pkgIndex.tcl2
-rw-r--r--library/platform/platform.tcl13
-rw-r--r--library/safe.tcl2
-rw-r--r--library/tzdata/America/Bahia_Banderas154
-rw-r--r--library/tzdata/America/Chihuahua156
-rw-r--r--library/tzdata/America/Mazatlan154
-rw-r--r--library/tzdata/America/Merida154
-rw-r--r--library/tzdata/America/Mexico_City154
-rw-r--r--library/tzdata/America/Monterrey154
-rw-r--r--library/tzdata/America/Nipigon265
-rw-r--r--library/tzdata/America/Ojinaga156
-rw-r--r--library/tzdata/America/Rainy_River265
-rw-r--r--library/tzdata/America/Thunder_Bay273
-rw-r--r--library/tzdata/Pacific/Fiji155
-rw-r--r--tests/binary.test83
-rw-r--r--tests/chan.test12
-rw-r--r--tests/chanio.test32
-rw-r--r--tests/encoding.test11
-rw-r--r--tests/env.test4
-rw-r--r--tests/http.test372
-rw-r--r--tests/http11.test98
-rw-r--r--tests/httpPipeline.test2
-rw-r--r--tests/httpProxy.test456
-rw-r--r--tests/httpProxySquidConfigForEL8.tar.gzbin0 -> 2266 bytes
-rw-r--r--tests/io.test36
-rw-r--r--tests/ioCmd.test12
-rw-r--r--tests/load.test2
-rw-r--r--tests/lreplace.test2
-rw-r--r--tests/lseq.test39
-rw-r--r--tests/main.test2
-rw-r--r--tests/scan.test2
-rw-r--r--tests/socket.test20
-rw-r--r--tools/regexpTestLib.tcl4
-rw-r--r--tools/tclOOScript.tcl4
-rw-r--r--unix/Makefile.in6
-rw-r--r--unix/README4
-rwxr-xr-xunix/configure8
-rw-r--r--unix/configure.ac8
-rw-r--r--unix/dltest/Makefile.in35
-rw-r--r--unix/tcl.pc.in2
-rw-r--r--unix/tclUnixSock.c29
-rw-r--r--win/Makefile.in26
-rwxr-xr-xwin/configure4
-rw-r--r--win/configure.ac4
-rw-r--r--win/rules.vc36
-rw-r--r--win/tclWinChan.c2
-rw-r--r--win/tclWinConsole.c1
-rw-r--r--win/tclWinPipe.c7
-rw-r--r--win/tclWinSerial.c6
-rw-r--r--win/tclWinSock.c237
106 files changed, 3639 insertions, 4011 deletions
diff --git a/ChangeLog.2000 b/ChangeLog.2000
index 7e78c19..8abe6c2 100644
--- a/ChangeLog.2000
+++ b/ChangeLog.2000
@@ -1356,7 +1356,7 @@
* doc/source.n:
* doc/Eval.3:
* tests/source.test:
- * generic/tclIOUtil.c (Tcl_EvalFile): added explicit \32 (^Z) eofchar
+ * generic/tclIOUtil.c (Tcl_EvalFile): added explicit \x1A (^Z) eofchar
(affects Tcl_EvalFile in C, "source" in Tcl). This was implicit on
Windows already, and is now cross-platform to allow for scripted
documents.
diff --git a/ChangeLog.2008 b/ChangeLog.2008
index 9c4e951..53690e4 100644
--- a/ChangeLog.2008
+++ b/ChangeLog.2008
@@ -1939,7 +1939,7 @@
2008-07-28 Jan Nijtmans <nijtmans@users.sf.net>
* doc/FileSystem.3: CONSTified many functions using
- * generic/tcl.decls: Tcl_FileSystem which all are supposed
+ * generic/tcl.decls: Tcl_Filesystem which all are supposed
* generic/tclDecls.h: to be a constant, but this was not
* generic/tclFileSystem.h: reflected in the API: Tcl_FSData,
* generic/tclIOUtil.c: Tcl_FSGetInternalRep, Tcl_FSRegister,
diff --git a/changes b/changes
index 611bf7d..d6347f1 100644
--- a/changes
+++ b/changes
@@ -4976,7 +4976,7 @@ msgcat package (duperval, krone, nelson)
trace {add|remove|list} {variable|command} name ops command
(darley, melski)
-2000-09-06 (cross-platform feature) Set ^Z (\32) as default EOF char. (hobbs)
+2000-09-06 (cross-platform feature) Set ^Z (\x1A) as default EOF char. (hobbs)
2000-09-07 partial fix for bug 2460 to prevent exec mem leak on Windows for the
common case (gravereaux)
@@ -9252,7 +9252,7 @@ See RFC 2045
2020-09-17 (bug)[835c93] Support TIP 525 exit code for -singleproc 1 (nijtmans)
=> tcltest 2.5.3
-2020-09-25 (new) force -eofchar \032 when evaluating library scripts (nijtmans)
+2020-09-25 (new) force -eofchar \x1A when evaluating library scripts (nijtmans)
*** POTENTIAL INCOMPATIBILITY ***
2020-09-29 (bug)[0063cb] http::geturl -headers must be dict (oehlmann,nijtmans)
diff --git a/doc/BoolObj.3 b/doc/BoolObj.3
index 47a2189..71580af 100644
--- a/doc/BoolObj.3
+++ b/doc/BoolObj.3
@@ -20,7 +20,7 @@ Tcl_Obj *
\fBTcl_SetBooleanObj\fR(\fIobjPtr, intValue\fR)
.sp
int
-\fBTcl_GetBooleanFromObj\fR(\fIinterp, objPtr, intPtr\fR)
+\fBTcl_GetBooleanFromObj\fR(\fIinterp, objPtr, boolPtr\fR)
.sp
int
\fBTcl_GetBoolFromObj\fR(\fIinterp, objPtr, flags. charPtr\fR)
@@ -35,7 +35,7 @@ retrieve a boolean value.
If a boolean value cannot be retrieved,
an error message is left in the interpreter's result value
unless \fIinterp\fR is NULL.
-.AP int *intPtr out
+.AP "bool \&| int" *boolPtr out
Points to place where \fBTcl_GetBooleanFromObj\fR
stores the boolean value (0 or 1) obtained from \fIobjPtr\fR.
.AP char *charPtr out
@@ -71,13 +71,13 @@ any former value stored in \fI*objPtr\fR.
from the value stored in \fI*objPtr\fR.
If \fIobjPtr\fR holds a string value recognized by \fBTcl_GetBoolean\fR,
then the recognized boolean value is written at the address given
-by \fIintPtr\fR.
+by \fIboolPtr\fR.
If \fIobjPtr\fR holds any value recognized as
a number by Tcl, then if that value is zero a 0 is written at
-the address given by \fIintPtr\fR and if that
-value is non-zero a 1 is written at the address given by \fIintPtr\fR.
+the address given by \fIboolPtr\fR and if that
+value is non-zero a 1 is written at the address given by \fIboolPtr\fR.
In all cases where a value is written at the address given
-by \fIintPtr\fR, \fBTcl_GetBooleanFromObj\fR returns \fBTCL_OK\fR.
+by \fIboolPtr\fR, \fBTcl_GetBooleanFromObj\fR returns \fBTCL_OK\fR.
If the value of \fIobjPtr\fR does not meet any of the conditions
above, then \fBTCL_ERROR\fR is returned and an error message is
left in the interpreter's result unless \fIinterp\fR is NULL.
diff --git a/doc/CrtObjCmd.3 b/doc/CrtObjCmd.3
index 012c46c..ffd9e27 100644
--- a/doc/CrtObjCmd.3
+++ b/doc/CrtObjCmd.3
@@ -224,7 +224,7 @@ pointed to by \fIinfoPtr\fR and returns 1.
A \fBTcl_CmdInfo\fR structure has the following fields:
.PP
.CS
-typedef struct Tcl_CmdInfo {
+typedef struct {
int \fIisNativeObjectProc\fR;
Tcl_ObjCmdProc *\fIobjProc\fR;
void *\fIobjClientData\fR;
diff --git a/doc/CrtTrace.3 b/doc/CrtTrace.3
index 6833fc5..e4d1a43 100644
--- a/doc/CrtTrace.3
+++ b/doc/CrtTrace.3
@@ -29,7 +29,7 @@ Tcl_Trace
.AS Tcl_CmdObjTraceDeleteProc *deleteProc
.AP Tcl_Interp *interp in
Interpreter containing command to be traced or untraced.
-.AP int level in
+.AP size_t level in
Only commands at or below this nesting level will be traced unless
0 is specified. 1 means
top-level commands only, 2 means top-level commands or those that are
@@ -81,6 +81,20 @@ typedef int \fBTcl_CmdObjTraceProc\fR(
\fBTcl_Obj\fR *const \fIobjv\fR[]);
.CE
.PP
+\fIobjProc2\fR should have arguments and result that match the type,
+\fBTcl_CmdObjTraceProc2\fR:
+.PP
+.CS
+typedef int \fBTcl_CmdObjTraceProc2\fR(
+ \fBvoid *\fR \fIclientData\fR,
+ \fBTcl_Interp\fR* \fIinterp\fR,
+ size_t \fIlevel\fR,
+ const char *\fIcommand\fR,
+ \fBTcl_Command\fR \fIcommandToken\fR,
+ size_t \fIobjc\fR,
+ \fBTcl_Obj\fR *const \fIobjv\fR[]);
+.CE
+.PP
The \fIclientData\fR and \fIinterp\fR parameters are copies of the
corresponding arguments given to \fBTcl_CreateTrace\fR.
\fIclientData\fR typically points to an application-specific data
diff --git a/doc/Encoding.3 b/doc/Encoding.3
index f37452d..974e70e 100644
--- a/doc/Encoding.3
+++ b/doc/Encoding.3
@@ -46,6 +46,9 @@ const char *
\fBTcl_GetEncodingName\fR(\fIencoding\fR)
.sp
int
+\fBTcl_GetEncodingNulLength\fR(\fIencoding\fR)
+.sp
+int
\fBTcl_SetSystemEncoding\fR(\fIinterp, name\fR)
.sp
const char *
@@ -270,6 +273,9 @@ was used to create the encoding. The string returned by
\fBTcl_GetEncodingName\fR is only guaranteed to persist until the
\fIencoding\fR is deleted. The caller must not modify this string.
.PP
+\fBTcl_GetEncodingNulLength\fR returns the length of the terminating
+nul byte sequence for strings in the specified encoding.
+.PP
\fBTcl_SetSystemEncoding\fR sets the default encoding that should be used
whenever the user passes a NULL value for the \fIencoding\fR argument to
any of the other encoding functions. If \fIname\fR is NULL, the system
diff --git a/doc/FileSystem.3 b/doc/FileSystem.3
index 239ff0f..469af22 100644
--- a/doc/FileSystem.3
+++ b/doc/FileSystem.3
@@ -850,7 +850,7 @@ The \fBTcl_Filesystem\fR structure contains the following fields:
.CS
typedef struct Tcl_Filesystem {
const char *\fItypeName\fR;
- int \fIstructureLength\fR;
+ size_t \fIstructureLength\fR;
Tcl_FSVersion \fIversion\fR;
Tcl_FSPathInFilesystemProc *\fIpathInFilesystemProc\fR;
Tcl_FSDupInternalRepProc *\fIdupInternalRepProc\fR;
diff --git a/doc/OpenTcp.3 b/doc/OpenTcp.3
index fbaa04f..5a0f559 100644
--- a/doc/OpenTcp.3
+++ b/doc/OpenTcp.3
@@ -24,7 +24,7 @@ Tcl_Channel
\fBTcl_OpenTcpServer\fR(\fIinterp, port, myaddr, proc, clientData\fR)
.sp
Tcl_Channel
-\fBTcl_OpenTcpServerEx\fR(\fIinterp, service, myaddr, flags, proc, clientData\fR)
+\fBTcl_OpenTcpServerEx\fR(\fIinterp, service, myaddr, flags, backlog, proc, clientData\fR)
.sp
.SH ARGUMENTS
.AS Tcl_TcpAcceptProc clientData
@@ -47,6 +47,8 @@ for the local end of the connection. If NULL, a default interface is
chosen.
.AP int async in
If nonzero, the client socket is connected asynchronously to the server.
+.AP int backlog in
+Length of OS listen backlog queue. Use -1 for default value.
.AP "unsigned int" flags in
ORed combination of \fBTCL_TCPSERVER\fR flags that specify additional
informations about the socket being created.
diff --git a/doc/chan.n b/doc/chan.n
index 9589f98..584f0c5 100644
--- a/doc/chan.n
+++ b/doc/chan.n
@@ -143,19 +143,12 @@ interface with the operating system,
.RE
.TP
\fB\-eofchar\fR \fIchar\fR
-.TP
-\fB\-eofchar\fR \fB{\fIinChar outChar\fB}\fR
.
\fIchar\fR signals the end of the data when it is encountered in the input.
-For output, the character is added when the channel is closed. If \fIchar\fR
-is the empty string, there is no special character that marks the end of the
-data. For read-write channels, one end-of-file character for input and another
-for output may be given. When only one end-of-file character is given it is
-applied to both input and output. For a read-write channel two values are
-returned even if they are are identical.
+If \fIchar\fR is the empty string, there is no special character that marks
+the end of the data.
-The default value is the empty string, except that under Windows the default
-value for reading is Control-z (\ex1A). The acceptable range is \ex01 -
+The default value is the empty string. The acceptable range is \ex01 -
\ex7f. A value outside this range results in an error.
.TP
\fB\-translation\fR \fItranslation\fR
diff --git a/doc/encoding.n b/doc/encoding.n
index c1dbf27..4e18798 100644
--- a/doc/encoding.n
+++ b/doc/encoding.n
@@ -28,30 +28,37 @@ formats.
Performs one of several encoding related operations, depending on
\fIoption\fR. The legal \fIoption\fRs are:
.TP
-\fBencoding convertfrom\fR ?\fB-nocomplain\fR? ?\fB-failindex var\fR?
-?\fIencoding\fR? \fIdata\fR
+\fBencoding convertfrom\fR ?\fB-nocomplain\fR? ?\fB-failindex var\fR? ?\fB-strict\fR? ?\fIencoding\fR? \fIdata\fR
.
Convert \fIdata\fR to a Unicode string from the specified \fIencoding\fR. The
characters in \fIdata\fR are 8 bit binary data. The resulting
sequence of bytes is a string created by applying the given \fIencoding\fR
to the data. If \fIencoding\fR is not specified, the current
system encoding is used.
-.
-The call fails on convertion errors, like an incomplete utf-8 sequence.
-The option \fB-failindex\fR is followed by a variable name. The variable
-is set to \fI-1\fR if no conversion error occured. It is set to the
-first error location in \fIdata\fR in case of a conversion error. All data
-until this error location is transformed and retured. This option may not
-be used together with \fB-nocomplain\fR.
-.
-The call does not fail on conversion errors, if the option
-\fB-nocomplain\fR is given. In this case, any error locations are replaced
-by \fB?\fR. Incomplete sequences are written verbatim to the output string.
-The purpose of this switch is to gain compatibility to prior versions of TCL.
-It is not recommended for any other usage.
+.VS "TCL8.7 TIP346, TIP607, TIP601"
+.PP
+.RS
+If the option \fB-nocomplain\fR is given, the command does not fail on
+encoding errors. Instead, any not convertable bytes (like incomplete UTF-8
+ sequences, see example below) are put as byte values into the output stream.
+If the option \fB-nocomplain\fR is not given, the command will fail with an
+appropriate error message.
+.PP
+If the option \fB-failindex\fR with a variable name is given, the error reporting
+is changed in the following manner:
+in case of a conversion error, the position of the input byte causing the error
+is returned in the given variable. The return value of the command are the
+converted characters until the first error position. No error condition is raised.
+In case of no error, the value \fI-1\fR is written to the variable. This option
+may not be used together with \fB-nocomplain\fR.
+.PP
+The \fB-strict\fR option followes more strict rules in conversion. Currently, only
+the sequence \fB\\xC0\\x80\fR in \fButf-8\fR encoding is disallowed. Additional rules
+may follow.
+.VE "TCL8.7 TIP346, TIP607, TIP601"
+.RE
.TP
-\fBencoding convertto\fR ?\fB-nocomplain\fR? ?\fB-failindex var\fR?
-?\fIencoding\fR? \fIstring\fR
+\fBencoding convertto\fR ?\fB-nocomplain\fR? ?\fB-failindex var\fR? ?\fB-strict\fR? ?\fIencoding\fR? \fIstring\fR
.
Convert \fIstring\fR from Unicode to the specified \fIencoding\fR.
The result is a sequence of bytes that represents the converted
@@ -59,21 +66,28 @@ string. Each byte is stored in the lower 8-bits of a Unicode
character (indeed, the resulting string is a binary string as far as
Tcl is concerned, at least initially). If \fIencoding\fR is not
specified, the current system encoding is used.
-.
-The call fails on convertion errors, like a Unicode character not representable
-in the given \fIencoding\fR.
-.
-The option \fB-failindex\fR is followed by a variable name. The variable
-is set to \fI-1\fR if no conversion error occured. It is set to the
-first error location in \fIdata\fR in case of a conversion error. All data
-until this error location is transformed and retured. This option may not
-be used together with \fB-nocomplain\fR.
-.
-The call does not fail on conversion errors, if the option
-\fB-nocomplain\fR is given. In this case, any error locations are replaced
-by \fB?\fR. Incomplete sequences are written verbatim to the output string.
-The purpose of this switch is to gain compatibility to prior versions of TCL.
-It is not recommended for any other usage.
+.VS "TCL8.7 TIP346, TIP607, TIP601"
+.PP
+.RS
+If the option \fB-nocomplain\fR is given, the command does not fail on
+encoding errors. Instead, the replacement character \fB?\fR is output
+for any not representable character (like the dot \fB\\U2022\fR
+in \fBiso-8859-1\fR encoding, see example below).
+If the option \fB-nocomplain\fR is not given, the command will fail with an
+appropriate error message.
+.PP
+If the option \fB-failindex\fR with a variable name is given, the error reporting
+is changed in the following manner:
+in case of a conversion error, the position of the input character causing the error
+is returned in the given variable. The return value of the command are the
+converted bytes until the first error position. No error condition is raised.
+In case of no error, the value \fI-1\fR is written to the variable. This option
+may not be used together with \fB-nocomplain\fR.
+.PP
+The \fB-strict\fR option followes more strict rules in conversion. Currently, it has
+no effect but may be used in future to add additional encoding checks.
+.VE "TCL8.7 TIP346, TIP607, TIP601"
+.RE
.TP
\fBencoding dirs\fR ?\fIdirectoryList\fR?
.
@@ -104,7 +118,7 @@ omitted then the command returns the current system encoding. The
system encoding is used whenever Tcl passes strings to system calls.
.SH EXAMPLE
.PP
-The following example converts a byte sequence in Japanese euc-jp encoding to a TCL string:
+Example 1: convert a byte sequence in Japanese euc-jp encoding to a TCL string:
.PP
.CS
set s [\fBencoding convertfrom\fR euc-jp "\exA4\exCF"]
@@ -113,8 +127,9 @@ set s [\fBencoding convertfrom\fR euc-jp "\exA4\exCF"]
The result is the unicode codepoint:
.QW "\eu306F" ,
which is the Hiragana letter HA.
+.VS "TCL8.7 TIP346, TIP607, TIP601"
.PP
-The following example detects the error location in an incomplete UTF-8 sequence:
+Example 2: detect the error location in an incomplete UTF-8 sequence:
.PP
.CS
% set s [\fBencoding convertfrom\fR -failindex i utf-8 "A\exC3"]
@@ -123,7 +138,14 @@ A
1
.CE
.PP
-The following example detects the error location while transforming to ISO8859-1
+Example 3: return the incomplete UTF-8 sequence by raw bytes:
+.PP
+.CS
+% set s [\fBencoding convertfrom\fR -nocomplain utf-8 "A\exC3"]
+.CE
+The result is "A" followed by the byte \exC3.
+.PP
+Example 4: detect the error location while transforming to ISO8859-1
(ISO-Latin 1):
.PP
.CS
@@ -133,8 +155,16 @@ A
1
.CE
.PP
+Example 5: replace a not representable character by the replacement character:
+.PP
+.CS
+% set s [\fBencoding convertto\fR -nocomplain utf-8 "A\eu0141"]
+A?
+.CE
+.VE "TCL8.7 TIP346, TIP607, TIP601"
+.PP
.SH "SEE ALSO"
-Tcl_GetEncoding(3)
+Tcl_GetEncoding(3), fconfigure(n)
.SH KEYWORDS
encoding, unicode
.\" Local Variables:
diff --git a/doc/fconfigure.n b/doc/fconfigure.n
index 2926777..912702f 100644
--- a/doc/fconfigure.n
+++ b/doc/fconfigure.n
@@ -102,26 +102,43 @@ system, as returned by \fBencoding system\fR.
.RE
.TP
\fB\-eofchar\fR \fIchar\fR
-.TP
-\fB\-eofchar\fR \fB{\fIinChar outChar\fB}\fR
.
This option supports DOS file systems that use Control-z (\ex1A) as an
end of file marker. If \fIchar\fR is not an empty string, then this
-character signals end-of-file when it is encountered during input. For
-output, the end-of-file character is output when the channel is closed.
+character signals end-of-file when it is encountered during input.
If \fIchar\fR is the empty string, then there is no special end of file
-character marker. For read-write channels, a two-element list specifies
-the end of file marker for input and output, respectively. As a
-convenience, when setting the end-of-file character for a read-write
-channel you can specify a single value that will apply to both reading
-and writing. When querying the end-of-file character of a read-write
-channel, a two-element list will always be returned. The default value
-for \fB\-eofchar\fR is the empty string in all cases except for files
-under Windows. In that case the \fB\-eofchar\fR is Control-z (\ex1A) for
-reading and the empty string for writing.
+character marker. The default value for \fB\-eofchar\fR is the empty
+string.
The acceptable range for \fB\-eofchar\fR values is \ex01 - \ex7F;
attempting to set \fB\-eofchar\fR to a value outside of this range will
generate an error.
+.VS "TCL9.0 TIP633"
+.TP
+\fB\-nocomplainencoding\fR \fIbool\fR
+.
+Reporting mode of encoding errors.
+If set to a \fItrue\fR value, encoding errors are resolved by a replacement
+character (output) or verbatim bytes (input). No error is thrown.
+If set to a \fIfalse\fR value, errors are thrown in case of encoding errors.
+.RS
+.PP
+The default value is \fIfalse\fR starting from TCL 9.0 and \fItrue\fR on TCL 8.7.
+This option was introduced with TCL 8.7 and has the fix value \fItrue\fR.
+.PP
+See the \fI\-nocomplain\fR option of the \fBencoding\fR command for more information.
+.RE
+.VE "TCL9.0 TIP633"
+.VS "TCL8.7 TIP346"
+.TP
+\fB\-strictencoding\fR \fIbool\fR
+.
+Activate additional stricter encoding application rules.
+Default value is \fIfalse\fR.
+.RS
+.PP
+See the \fI\-strict\fR option of the \fBencoding\fR command for more information.
+.VE "TCL8.7 TIP346"
+.RE
.TP
\fB\-translation\fR \fImode\fR
.TP
@@ -278,10 +295,10 @@ set data [read $f $numDataBytes]
close $f
.CE
.SH "SEE ALSO"
-close(n), flush(n), gets(n), open(n), puts(n), read(n), socket(n),
+close(n), encoding(n), flush(n), gets(n), open(n), puts(n), read(n), socket(n),
Tcl_StandardChannels(3)
.SH KEYWORDS
-blocking, buffering, carriage return, end of line, flushing, linemode,
+blocking, buffering, carriage return, end of line, encoding, flushing, linemode,
newline, nonblocking, platform, translation, encoding, filter, byte array,
binary
'\" Local Variables:
diff --git a/doc/http.n b/doc/http.n
index 59f15b6..ff2307e 100644
--- a/doc/http.n
+++ b/doc/http.n
@@ -172,14 +172,15 @@ fresh socket, overriding the \fB\-keepalive\fR option of
command \fBhttp::geturl\fR. See the \fBPERSISTENT SOCKETS\fR section for
details. The default is 0.
.TP
-\fB\-proxyhost\fR \fIhostname\fR
-.
-The name of the proxy host, if any. If this value is the
-empty string, the URL host is contacted directly.
-.TP
-\fB\-proxyport\fR \fInumber\fR
+\fB\-proxyauth\fR \fIstring\fR
.
-The proxy port number.
+If non-empty, the string is supplied to the proxy server as the value of the
+request header Proxy-Authorization. This option can be used for HTTP Basic
+Authentication. If the proxy server requires authentication by another
+technique, e.g. Digest Authentication, the \fB\-proxyauth\fR option is not
+useful. In that case the caller must expect a 407 response from the proxy,
+compute the authentication value to be supplied, and use the \fB\-headers\fR
+option to supply it as the value of the Proxy-Authorization header.
.TP
\fB\-proxyfilter\fR \fIcommand\fR
.
@@ -188,18 +189,46 @@ The command is a callback that is made during
to determine if a proxy is required for a given host. One argument, a
host name, is added to \fIcommand\fR when it is invoked. If a proxy
is required, the callback should return a two-element list containing
-the proxy server and proxy port. Otherwise the filter should return
-an empty list. The default filter returns the values of the
-\fB\-proxyhost\fR and \fB\-proxyport\fR settings if they are
-non-empty.
+the proxy server and proxy port. Otherwise the filter command should return
+an empty list.
.RS
.PP
+The default value of \fB\-proxyfilter\fR is \fBhttp::ProxyRequired\fR, and
+this command returns the values of the \fB\-proxyhost\fR and
+\fB\-proxyport\fR settings if they are non-empty. The options
+\fB\-proxyhost\fR, \fB\-proxyport\fR, and \fB\-proxynot\fR are used only
+by \fBhttp::ProxyRequired\fR, and nowhere else in \fB::http::geturl\fR.
+A user-supplied \fB\-proxyfilter\fR command may use these options, or
+alternatively it may obtain values from elsewhere in the calling script.
+In the latter case, any values provided for \fB\-proxyhost\fR,
+\fB\-proxyport\fR, and \fB\-proxynot\fR are unused.
+.PP
The \fB::http::geturl\fR command runs the \fB\-proxyfilter\fR callback inside
a \fBcatch\fR command. Therefore an error in the callback command does
not call the \fBbgerror\fR handler. See the \fBERRORS\fR section for
details.
.RE
.TP
+\fB\-proxyhost\fR \fIhostname\fR
+.
+The host name or IP address of the proxy server, if any. If this value is
+the empty string, the URL host is contacted directly. See
+\fB\-proxyfilter\fR for how the value is used.
+.TP
+\fB\-proxynot\fR \fIlist\fR
+.
+A Tcl list of domain names and IP addresses that should be accessed directly,
+not through the proxy server. The target hostname is compared with each list
+element using a case-insensitive \fBstring match\fR. It is often convenient
+to use the wildcard "*" at the start of a domain name (e.g. *.example.com) or
+at the end of an IP address (e.g. 192.168.0.*). See \fB\-proxyfilter\fR for
+how the value is used.
+.TP
+\fB\-proxyport\fR \fInumber\fR
+.
+The port number of the proxy server. See \fB\-proxyfilter\fR for how the
+value is used.
+.TP
\fB\-repost\fR \fIboolean\fR
.
Specifies what to do if a POST request over a persistent connection fails
diff --git a/doc/safe.n b/doc/safe.n
index 6dd4033..6e0d948 100644
--- a/doc/safe.n
+++ b/doc/safe.n
@@ -468,7 +468,7 @@ Examples of use with "Sync Mode" off: any of these commands will set the
safe::interpConfigure foo -accessPath {}
.CE
.RE
-.TP
+.PP
Example of use with "Sync Mode" off: when initializing a safe interpreter
with a non-empty access path, the ::auto_path will be set to {} unless its
own value is also specified:
@@ -506,7 +506,7 @@ own value is also specified:
}
.CE
.RE
-.TP
+.PP
Example of use with "Sync Mode" off: the command
\fBsafe::interpAddToAccessPath\fR does not change the safe interpreter's
::auto_path, and so any necessary change must be made by the script:
@@ -520,7 +520,6 @@ Example of use with "Sync Mode" off: the command
safe::interpConfigure foo -autoPath $childAutoPath
.CE
.RE
-.TP
.SH "SEE ALSO"
interp(n), library(n), load(n), package(n), pkg_mkIndex(n), source(n),
tm(n), unknown(n)
diff --git a/generic/regc_locale.c b/generic/regc_locale.c
index 7252b88..7d182e4 100644
--- a/generic/regc_locale.c
+++ b/generic/regc_locale.c
@@ -110,7 +110,7 @@ static const struct cname {
{"right-brace", '}'},
{"right-curly-bracket", '}'},
{"tilde", '~'},
- {"DEL", '\177'},
+ {"DEL", '\x7F'},
{NULL, 0}
};
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 23dc4af..322d0cf 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -86,10 +86,10 @@ declare 15 {
void Tcl_AppendStringsToObj(Tcl_Obj *objPtr, ...)
}
declare 16 {
- void Tcl_AppendToObj(Tcl_Obj *objPtr, const char *bytes, size_t length)
+ void Tcl_AppendToObj(Tcl_Obj *objPtr, const char *bytes, Tcl_Size length)
}
declare 17 {
- Tcl_Obj *Tcl_ConcatObj(size_t objc, Tcl_Obj *const objv[])
+ Tcl_Obj *Tcl_ConcatObj(Tcl_Size objc, Tcl_Obj *const objv[])
}
declare 18 {
int Tcl_ConvertToType(Tcl_Interp *interp, Tcl_Obj *objPtr,
@@ -110,14 +110,14 @@ declare 21 {
#}
declare 23 {
Tcl_Obj *Tcl_DbNewByteArrayObj(const unsigned char *bytes,
- size_t numBytes, const char *file, int line)
+ Tcl_Size numBytes, const char *file, int line)
}
declare 24 {
Tcl_Obj *Tcl_DbNewDoubleObj(double doubleValue, const char *file,
int line)
}
declare 25 {
- Tcl_Obj *Tcl_DbNewListObj(size_t objc, Tcl_Obj *const *objv,
+ Tcl_Obj *Tcl_DbNewListObj(Tcl_Size objc, Tcl_Obj *const *objv,
const char *file, int line)
}
# Removed in 9.0 (changed to macro):
@@ -128,7 +128,7 @@ declare 27 {
Tcl_Obj *Tcl_DbNewObj(const char *file, int line)
}
declare 28 {
- Tcl_Obj *Tcl_DbNewStringObj(const char *bytes, size_t length,
+ Tcl_Obj *Tcl_DbNewStringObj(const char *bytes, Tcl_Size length,
const char *file, int line)
}
declare 29 {
@@ -191,7 +191,7 @@ declare 45 {
int *objcPtr, Tcl_Obj ***objvPtr)
}
declare 46 {
- int Tcl_ListObjIndex(Tcl_Interp *interp, Tcl_Obj *listPtr, size_t index,
+ int Tcl_ListObjIndex(Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Size index,
Tcl_Obj **objPtrPtr)
}
declare 47 {
@@ -199,15 +199,15 @@ declare 47 {
int *lengthPtr)
}
declare 48 {
- int Tcl_ListObjReplace(Tcl_Interp *interp, Tcl_Obj *listPtr, size_t first,
- size_t count, size_t objc, Tcl_Obj *const objv[])
+ int Tcl_ListObjReplace(Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Size first,
+ Tcl_Size count, Tcl_Size objc, Tcl_Obj *const objv[])
}
# Removed in 9.0 (changed to macro):
#declare 49 {
# Tcl_Obj *Tcl_NewBooleanObj(int intValue)
#}
declare 50 {
- Tcl_Obj *Tcl_NewByteArrayObj(const unsigned char *bytes, size_t numBytes)
+ Tcl_Obj *Tcl_NewByteArrayObj(const unsigned char *bytes, Tcl_Size numBytes)
}
declare 51 {
Tcl_Obj *Tcl_NewDoubleObj(double doubleValue)
@@ -217,7 +217,7 @@ declare 51 {
# Tcl_Obj *Tcl_NewIntObj(int intValue)
#}
declare 53 {
- Tcl_Obj *Tcl_NewListObj(size_t objc, Tcl_Obj *const objv[])
+ Tcl_Obj *Tcl_NewListObj(Tcl_Size objc, Tcl_Obj *const objv[])
}
# Removed in 9.0 (changed to macro):
#declare 54 {
@@ -227,18 +227,18 @@ declare 55 {
Tcl_Obj *Tcl_NewObj(void)
}
declare 56 {
- Tcl_Obj *Tcl_NewStringObj(const char *bytes, size_t length)
+ Tcl_Obj *Tcl_NewStringObj(const char *bytes, Tcl_Size length)
}
# Removed in 9.0 (changed to macro):
#declare 57 {
# void Tcl_SetBooleanObj(Tcl_Obj *objPtr, int intValue)
#}
declare 58 {
- unsigned char *Tcl_SetByteArrayLength(Tcl_Obj *objPtr, size_t numBytes)
+ unsigned char *Tcl_SetByteArrayLength(Tcl_Obj *objPtr, Tcl_Size numBytes)
}
declare 59 {
void Tcl_SetByteArrayObj(Tcl_Obj *objPtr, const unsigned char *bytes,
- size_t numBytes)
+ Tcl_Size numBytes)
}
declare 60 {
void Tcl_SetDoubleObj(Tcl_Obj *objPtr, double doubleValue)
@@ -248,17 +248,17 @@ declare 60 {
# void Tcl_SetIntObj(Tcl_Obj *objPtr, int intValue)
#}
declare 62 {
- void Tcl_SetListObj(Tcl_Obj *objPtr, size_t objc, Tcl_Obj *const objv[])
+ void Tcl_SetListObj(Tcl_Obj *objPtr, Tcl_Size objc, Tcl_Obj *const objv[])
}
# Removed in 9.0 (changed to macro):
#declare 63 {
# void Tcl_SetLongObj(Tcl_Obj *objPtr, long longValue)
#}
declare 64 {
- void Tcl_SetObjLength(Tcl_Obj *objPtr, size_t length)
+ void Tcl_SetObjLength(Tcl_Obj *objPtr, Tcl_Size length)
}
declare 65 {
- void Tcl_SetStringObj(Tcl_Obj *objPtr, const char *bytes, size_t length)
+ void Tcl_SetStringObj(Tcl_Obj *objPtr, const char *bytes, Tcl_Size length)
}
# Removed in 9.0, replaced by macro.
#declare 66 {
@@ -321,23 +321,23 @@ declare 82 {
int Tcl_CommandComplete(const char *cmd)
}
declare 83 {
- char *Tcl_Concat(size_t argc, const char *const *argv)
+ char *Tcl_Concat(Tcl_Size argc, const char *const *argv)
}
declare 84 {
- size_t Tcl_ConvertElement(const char *src, char *dst, int flags)
+ Tcl_Size Tcl_ConvertElement(const char *src, char *dst, int flags)
}
declare 85 {
- size_t Tcl_ConvertCountedElement(const char *src, size_t length, char *dst,
+ Tcl_Size Tcl_ConvertCountedElement(const char *src, Tcl_Size length, char *dst,
int flags)
}
declare 86 {
int Tcl_CreateAlias(Tcl_Interp *childInterp, const char *childCmd,
- Tcl_Interp *target, const char *targetCmd, size_t argc,
+ Tcl_Interp *target, const char *targetCmd, Tcl_Size argc,
const char *const *argv)
}
declare 87 {
int Tcl_CreateAliasObj(Tcl_Interp *childInterp, const char *childCmd,
- Tcl_Interp *target, const char *targetCmd, size_t objc,
+ Tcl_Interp *target, const char *targetCmd, Tcl_Size objc,
Tcl_Obj *const objv[])
}
declare 88 {
@@ -388,7 +388,7 @@ declare 98 {
Tcl_TimerProc *proc, void *clientData)
}
declare 99 {
- Tcl_Trace Tcl_CreateTrace(Tcl_Interp *interp, int level,
+ Tcl_Trace Tcl_CreateTrace(Tcl_Interp *interp, Tcl_Size level,
Tcl_CmdTraceProc *proc, void *clientData)
}
declare 100 {
@@ -428,7 +428,7 @@ declare 110 {
void Tcl_DeleteInterp(Tcl_Interp *interp)
}
declare 111 {
- void Tcl_DetachPids(size_t numPids, Tcl_Pid *pidPtr)
+ void Tcl_DetachPids(Tcl_Size numPids, Tcl_Pid *pidPtr)
}
declare 112 {
void Tcl_DeleteTimerHandler(Tcl_TimerToken token)
@@ -447,7 +447,7 @@ declare 116 {
void Tcl_DoWhenIdle(Tcl_IdleProc *proc, void *clientData)
}
declare 117 {
- char *Tcl_DStringAppend(Tcl_DString *dsPtr, const char *bytes, size_t length)
+ char *Tcl_DStringAppend(Tcl_DString *dsPtr, const char *bytes, Tcl_Size length)
}
declare 118 {
char *Tcl_DStringAppendElement(Tcl_DString *dsPtr, const char *element)
@@ -468,7 +468,7 @@ declare 123 {
void Tcl_DStringResult(Tcl_Interp *interp, Tcl_DString *dsPtr)
}
declare 124 {
- void Tcl_DStringSetLength(Tcl_DString *dsPtr, size_t length)
+ void Tcl_DStringSetLength(Tcl_DString *dsPtr, Tcl_Size length)
}
declare 125 {
void Tcl_DStringStartSublist(Tcl_DString *dsPtr)
@@ -565,7 +565,7 @@ declare 151 {
int *modePtr)
}
declare 152 {
- size_t Tcl_GetChannelBufferSize(Tcl_Channel chan)
+ Tcl_Size Tcl_GetChannelBufferSize(Tcl_Channel chan)
}
declare 153 {
int Tcl_GetChannelHandle(Tcl_Channel chan, int direction,
@@ -627,10 +627,10 @@ declare 168 {
Tcl_PathType Tcl_GetPathType(const char *path)
}
declare 169 {
- size_t Tcl_Gets(Tcl_Channel chan, Tcl_DString *dsPtr)
+ Tcl_Size Tcl_Gets(Tcl_Channel chan, Tcl_DString *dsPtr)
}
declare 170 {
- size_t Tcl_GetsObj(Tcl_Channel chan, Tcl_Obj *objPtr)
+ Tcl_Size Tcl_GetsObj(Tcl_Channel chan, Tcl_Obj *objPtr)
}
declare 171 {
int Tcl_GetServiceMode(void)
@@ -686,7 +686,7 @@ declare 185 {
}
# Obsolete, use Tcl_FSJoinPath
declare 186 {
- char *Tcl_JoinPath(size_t argc, const char *const *argv,
+ char *Tcl_JoinPath(Tcl_Size argc, const char *const *argv,
Tcl_DString *resultPtr)
}
declare 187 {
@@ -710,7 +710,7 @@ declare 191 {
Tcl_Channel Tcl_MakeTcpClientChannel(void *tcpSocket)
}
declare 192 {
- char *Tcl_Merge(size_t argc, const char *const *argv)
+ char *Tcl_Merge(Tcl_Size argc, const char *const *argv)
}
declare 193 {
Tcl_HashEntry *Tcl_NextHashEntry(Tcl_HashSearch *searchPtr)
@@ -727,7 +727,7 @@ declare 196 {
Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, int flags)
}
declare 197 {
- Tcl_Channel Tcl_OpenCommandChannel(Tcl_Interp *interp, size_t argc,
+ Tcl_Channel Tcl_OpenCommandChannel(Tcl_Interp *interp, Tcl_Size argc,
const char **argv, int flags)
}
# This is obsolete, use Tcl_FSOpenFileChannel
@@ -737,7 +737,7 @@ declare 198 {
}
declare 199 {
Tcl_Channel Tcl_OpenTcpClient(Tcl_Interp *interp, int port,
- const char *address, const char *myaddr, int myport, int async)
+ const char *address, const char *myaddr, int myport, int flags)
}
declare 200 {
Tcl_Channel Tcl_OpenTcpServer(Tcl_Interp *interp, int port,
@@ -760,7 +760,7 @@ declare 205 {
void Tcl_QueueEvent(Tcl_Event *evPtr, int position)
}
declare 206 {
- size_t Tcl_Read(Tcl_Channel chan, char *bufPtr, size_t toRead)
+ Tcl_Size Tcl_Read(Tcl_Channel chan, char *bufPtr, Tcl_Size toRead)
}
declare 207 {
void Tcl_ReapDetachedProcs(void)
@@ -789,7 +789,7 @@ declare 214 {
const char *pattern)
}
declare 215 {
- void Tcl_RegExpRange(Tcl_RegExp regexp, size_t index,
+ void Tcl_RegExpRange(Tcl_RegExp regexp, Tcl_Size index,
const char **startPtr, const char **endPtr)
}
declare 216 {
@@ -799,10 +799,10 @@ declare 217 {
void Tcl_ResetResult(Tcl_Interp *interp)
}
declare 218 {
- size_t Tcl_ScanElement(const char *src, int *flagPtr)
+ Tcl_Size Tcl_ScanElement(const char *src, int *flagPtr)
}
declare 219 {
- size_t Tcl_ScanCountedElement(const char *src, size_t length, int *flagPtr)
+ Tcl_Size Tcl_ScanCountedElement(const char *src, Tcl_Size length, int *flagPtr)
}
# Removed in 9.0:
#declare 220 {
@@ -819,7 +819,7 @@ declare 223 {
Tcl_InterpDeleteProc *proc, void *clientData)
}
declare 224 {
- void Tcl_SetChannelBufferSize(Tcl_Channel chan, size_t sz)
+ void Tcl_SetChannelBufferSize(Tcl_Channel chan, Tcl_Size sz)
}
declare 225 {
int Tcl_SetChannelOption(Tcl_Interp *interp, Tcl_Channel chan,
@@ -843,7 +843,7 @@ declare 229 {
# const char *Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
#}
declare 231 {
- size_t Tcl_SetRecursionLimit(Tcl_Interp *interp, size_t depth)
+ Tcl_Size Tcl_SetRecursionLimit(Tcl_Interp *interp, Tcl_Size depth)
}
# Removed in 9.0, replaced by macro.
#declare 232 {
@@ -915,7 +915,7 @@ declare 249 {
Tcl_DString *bufferPtr)
}
declare 250 {
- size_t Tcl_Ungets(Tcl_Channel chan, const char *str, size_t len, int atHead)
+ Tcl_Size Tcl_Ungets(Tcl_Channel chan, const char *str, Tcl_Size len, int atHead)
}
declare 251 {
void Tcl_UnlinkVar(Tcl_Interp *interp, const char *varName)
@@ -967,10 +967,10 @@ declare 262 {
void *prevClientData)
}
declare 263 {
- size_t Tcl_Write(Tcl_Channel chan, const char *s, size_t slen)
+ Tcl_Size Tcl_Write(Tcl_Channel chan, const char *s, Tcl_Size slen)
}
declare 264 {
- void Tcl_WrongNumArgs(Tcl_Interp *interp, size_t objc,
+ void Tcl_WrongNumArgs(Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[], const char *message)
}
declare 265 {
@@ -1091,11 +1091,11 @@ declare 289 {
# void Tcl_DiscardResult(Tcl_SavedResult *statePtr)
#}
declare 291 {
- int Tcl_EvalEx(Tcl_Interp *interp, const char *script, size_t numBytes,
+ int Tcl_EvalEx(Tcl_Interp *interp, const char *script, Tcl_Size numBytes,
int flags)
}
declare 292 {
- int Tcl_EvalObjv(Tcl_Interp *interp, size_t objc, Tcl_Obj *const objv[],
+ int Tcl_EvalObjv(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[],
int flags)
}
declare 293 {
@@ -1106,13 +1106,13 @@ declare 294 {
}
declare 295 {
int Tcl_ExternalToUtf(Tcl_Interp *interp, Tcl_Encoding encoding,
- const char *src, size_t srcLen, int flags,
- Tcl_EncodingState *statePtr, char *dst, size_t dstLen,
+ const char *src, Tcl_Size srcLen, int flags,
+ Tcl_EncodingState *statePtr, char *dst, Tcl_Size dstLen,
int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr)
}
declare 296 {
char *Tcl_ExternalToUtfDString(Tcl_Encoding encoding,
- const char *src, size_t srcLen, Tcl_DString *dsPtr)
+ const char *src, Tcl_Size srcLen, Tcl_DString *dsPtr)
}
declare 297 {
void Tcl_FinalizeThread(void)
@@ -1137,11 +1137,11 @@ declare 303 {
}
declare 304 {
int Tcl_GetIndexFromObjStruct(Tcl_Interp *interp, Tcl_Obj *objPtr,
- const void *tablePtr, size_t offset, const char *msg, int flags,
+ const void *tablePtr, Tcl_Size offset, const char *msg, int flags,
void *indexPtr)
}
declare 305 {
- void *Tcl_GetThreadData(Tcl_ThreadDataKey *keyPtr, size_t size)
+ void *Tcl_GetThreadData(Tcl_ThreadDataKey *keyPtr, Tcl_Size size)
}
declare 306 {
Tcl_Obj *Tcl_GetVar2Ex(Tcl_Interp *interp, const char *part1,
@@ -1164,11 +1164,11 @@ declare 311 {
const Tcl_Time *timePtr)
}
declare 312 {
- size_t TclNumUtfChars(const char *src, size_t length)
+ Tcl_Size TclNumUtfChars(const char *src, Tcl_Size length)
}
declare 313 {
- size_t Tcl_ReadChars(Tcl_Channel channel, Tcl_Obj *objPtr,
- size_t charsToRead, int appendFlag)
+ Tcl_Size Tcl_ReadChars(Tcl_Channel channel, Tcl_Obj *objPtr,
+ Tcl_Size charsToRead, int appendFlag)
}
# Removed in 9.0
#declare 314 {
@@ -1193,7 +1193,7 @@ declare 319 {
int position)
}
declare 320 {
- int Tcl_UniCharAtIndex(const char *src, size_t index)
+ int Tcl_UniCharAtIndex(const char *src, Tcl_Size index)
}
declare 321 {
int Tcl_UniCharToLower(int ch)
@@ -1208,13 +1208,13 @@ declare 324 {
int Tcl_UniCharToUtf(int ch, char *buf)
}
declare 325 {
- const char *TclUtfAtIndex(const char *src, size_t index)
+ const char *TclUtfAtIndex(const char *src, Tcl_Size index)
}
declare 326 {
- int TclUtfCharComplete(const char *src, size_t length)
+ int TclUtfCharComplete(const char *src, Tcl_Size length)
}
declare 327 {
- size_t Tcl_UtfBackslash(const char *src, int *readPtr, char *dst)
+ Tcl_Size Tcl_UtfBackslash(const char *src, int *readPtr, char *dst)
}
declare 328 {
const char *Tcl_UtfFindFirst(const char *src, int ch)
@@ -1230,13 +1230,13 @@ declare 331 {
}
declare 332 {
int Tcl_UtfToExternal(Tcl_Interp *interp, Tcl_Encoding encoding,
- const char *src, size_t srcLen, int flags,
- Tcl_EncodingState *statePtr, char *dst, size_t dstLen,
+ const char *src, Tcl_Size srcLen, int flags,
+ Tcl_EncodingState *statePtr, char *dst, Tcl_Size dstLen,
int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr)
}
declare 333 {
char *Tcl_UtfToExternalDString(Tcl_Encoding encoding,
- const char *src, size_t srcLen, Tcl_DString *dsPtr)
+ const char *src, Tcl_Size srcLen, Tcl_DString *dsPtr)
}
declare 334 {
int Tcl_UtfToLower(char *src)
@@ -1251,10 +1251,10 @@ declare 337 {
int Tcl_UtfToUpper(char *src)
}
declare 338 {
- size_t Tcl_WriteChars(Tcl_Channel chan, const char *src, size_t srcLen)
+ Tcl_Size Tcl_WriteChars(Tcl_Channel chan, const char *src, Tcl_Size srcLen)
}
declare 339 {
- size_t Tcl_WriteObj(Tcl_Channel chan, Tcl_Obj *objPtr)
+ Tcl_Size Tcl_WriteObj(Tcl_Channel chan, Tcl_Obj *objPtr)
}
declare 340 {
char *Tcl_GetString(Tcl_Obj *objPtr)
@@ -1295,7 +1295,7 @@ declare 351 {
int Tcl_UniCharIsWordChar(int ch)
}
declare 352 {
- size_t Tcl_Char16Len(const unsigned short *uniStr)
+ Tcl_Size Tcl_Char16Len(const unsigned short *uniStr)
}
# Removed in 9.0:
#declare 353 {
@@ -1304,11 +1304,11 @@ declare 352 {
#}
declare 354 {
char *Tcl_Char16ToUtfDString(const unsigned short *uniStr,
- size_t uniLength, Tcl_DString *dsPtr)
+ Tcl_Size uniLength, Tcl_DString *dsPtr)
}
declare 355 {
unsigned short *Tcl_UtfToChar16DString(const char *src,
- size_t length, Tcl_DString *dsPtr)
+ Tcl_Size length, Tcl_DString *dsPtr)
}
declare 356 {
Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp, Tcl_Obj *patObj,
@@ -1324,29 +1324,29 @@ declare 358 {
}
declare 359 {
void Tcl_LogCommandInfo(Tcl_Interp *interp, const char *script,
- const char *command, size_t length)
+ const char *command, Tcl_Size length)
}
declare 360 {
int Tcl_ParseBraces(Tcl_Interp *interp, const char *start,
- size_t numBytes, Tcl_Parse *parsePtr, int append,
+ Tcl_Size numBytes, Tcl_Parse *parsePtr, int append,
const char **termPtr)
}
declare 361 {
int Tcl_ParseCommand(Tcl_Interp *interp, const char *start,
- size_t numBytes, int nested, Tcl_Parse *parsePtr)
+ Tcl_Size numBytes, int nested, Tcl_Parse *parsePtr)
}
declare 362 {
int Tcl_ParseExpr(Tcl_Interp *interp, const char *start,
- size_t numBytes, Tcl_Parse *parsePtr)
+ Tcl_Size numBytes, Tcl_Parse *parsePtr)
}
declare 363 {
int Tcl_ParseQuotedString(Tcl_Interp *interp, const char *start,
- size_t numBytes, Tcl_Parse *parsePtr, int append,
+ Tcl_Size numBytes, Tcl_Parse *parsePtr, int append,
const char **termPtr)
}
declare 364 {
int Tcl_ParseVarName(Tcl_Interp *interp, const char *start,
- size_t numBytes, Tcl_Parse *parsePtr, int append)
+ Tcl_Size numBytes, Tcl_Parse *parsePtr, int append)
}
# These 4 functions are obsolete, use Tcl_FSGetCwd, Tcl_FSChdir,
# Tcl_FSAccess and Tcl_FSStat
@@ -1385,34 +1385,34 @@ declare 375 {
}
declare 376 {
int Tcl_RegExpExecObj(Tcl_Interp *interp, Tcl_RegExp regexp,
- Tcl_Obj *textObj, size_t offset, size_t nmatches, int flags)
+ Tcl_Obj *textObj, Tcl_Size offset, Tcl_Size nmatches, int flags)
}
declare 377 {
void Tcl_RegExpGetInfo(Tcl_RegExp regexp, Tcl_RegExpInfo *infoPtr)
}
declare 378 {
- Tcl_Obj *Tcl_NewUnicodeObj(const Tcl_UniChar *unicode, size_t numChars)
+ Tcl_Obj *Tcl_NewUnicodeObj(const Tcl_UniChar *unicode, Tcl_Size numChars)
}
declare 379 {
void Tcl_SetUnicodeObj(Tcl_Obj *objPtr, const Tcl_UniChar *unicode,
- size_t numChars)
+ Tcl_Size numChars)
}
declare 380 {
- size_t TclGetCharLength(Tcl_Obj *objPtr)
+ Tcl_Size TclGetCharLength(Tcl_Obj *objPtr)
}
declare 381 {
- int TclGetUniChar(Tcl_Obj *objPtr, size_t index)
+ int TclGetUniChar(Tcl_Obj *objPtr, Tcl_Size index)
}
# Removed in 9.0, replaced by macro.
#declare 382 {
# Tcl_UniChar *Tcl_GetUnicode(Tcl_Obj *objPtr)
#}
declare 383 {
- Tcl_Obj *TclGetRange(Tcl_Obj *objPtr, size_t first, size_t last)
+ Tcl_Obj *TclGetRange(Tcl_Obj *objPtr, Tcl_Size first, Tcl_Size last)
}
declare 384 {
void Tcl_AppendUnicodeToObj(Tcl_Obj *objPtr, const Tcl_UniChar *unicode,
- size_t length)
+ Tcl_Size length)
}
declare 385 {
int Tcl_RegExpMatchObj(Tcl_Interp *interp, Tcl_Obj *textObj,
@@ -1432,7 +1432,7 @@ declare 389 {
}
declare 390 {
int Tcl_ProcObjCmd(void *clientData, Tcl_Interp *interp,
- size_t objc, Tcl_Obj *const objv[])
+ Tcl_Size objc, Tcl_Obj *const objv[])
}
declare 391 {
void Tcl_ConditionFinalize(Tcl_Condition *condPtr)
@@ -1442,15 +1442,15 @@ declare 392 {
}
declare 393 {
int Tcl_CreateThread(Tcl_ThreadId *idPtr, Tcl_ThreadCreateProc *proc,
- void *clientData, size_t stackSize, int flags)
+ void *clientData, Tcl_Size stackSize, int flags)
}
# Introduced in 8.3.2
declare 394 {
- size_t Tcl_ReadRaw(Tcl_Channel chan, char *dst, size_t bytesToRead)
+ Tcl_Size Tcl_ReadRaw(Tcl_Channel chan, char *dst, Tcl_Size bytesToRead)
}
declare 395 {
- size_t Tcl_WriteRaw(Tcl_Channel chan, const char *src, size_t srcLen)
+ Tcl_Size Tcl_WriteRaw(Tcl_Channel chan, const char *src, Tcl_Size srcLen)
}
declare 396 {
Tcl_Channel Tcl_GetTopChannel(Tcl_Channel chan)
@@ -1591,7 +1591,7 @@ declare 431 {
const char *file, int line)
}
declare 432 {
- int Tcl_AttemptSetObjLength(Tcl_Obj *objPtr, size_t length)
+ int Tcl_AttemptSetObjLength(Tcl_Obj *objPtr, Tcl_Size length)
}
# TIP#10 (thread-aware channels) akupries
@@ -1699,7 +1699,7 @@ declare 459 {
int Tcl_FSConvertToPathType(Tcl_Interp *interp, Tcl_Obj *pathPtr)
}
declare 460 {
- Tcl_Obj *Tcl_FSJoinPath(Tcl_Obj *listObj, size_t elements)
+ Tcl_Obj *Tcl_FSJoinPath(Tcl_Obj *listObj, Tcl_Size elements)
}
declare 461 {
Tcl_Obj *TclFSSplitPath(Tcl_Obj *pathPtr, int *lenPtr)
@@ -1711,7 +1711,7 @@ declare 463 {
Tcl_Obj *Tcl_FSGetNormalizedPath(Tcl_Interp *interp, Tcl_Obj *pathPtr)
}
declare 464 {
- Tcl_Obj *Tcl_FSJoinToPath(Tcl_Obj *pathPtr, size_t objc,
+ Tcl_Obj *Tcl_FSJoinToPath(Tcl_Obj *pathPtr, Tcl_Size objc,
Tcl_Obj *const objv[])
}
declare 465 {
@@ -1771,7 +1771,7 @@ declare 480 {
# TIP#56 (evaluate a parsed script) msofer
declare 481 {
int Tcl_EvalTokensStandard(Tcl_Interp *interp, Tcl_Token *tokenPtr,
- size_t count)
+ Tcl_Size count)
}
# TIP#73 (access to current time) kbk
@@ -1781,7 +1781,7 @@ declare 482 {
# TIP#32 (object-enabled traces) kbk
declare 483 {
- Tcl_Trace Tcl_CreateObjTrace(Tcl_Interp *interp, int level, int flags,
+ Tcl_Trace Tcl_CreateObjTrace(Tcl_Interp *interp, Tcl_Size level, int flags,
Tcl_CmdObjTraceProc *objProc, void *clientData,
Tcl_CmdObjTraceDeleteProc *delProc)
}
@@ -1857,11 +1857,11 @@ declare 500 {
}
declare 501 {
int Tcl_DictObjPutKeyList(Tcl_Interp *interp, Tcl_Obj *dictPtr,
- size_t keyc, Tcl_Obj *const *keyv, Tcl_Obj *valuePtr)
+ Tcl_Size keyc, Tcl_Obj *const *keyv, Tcl_Obj *valuePtr)
}
declare 502 {
int Tcl_DictObjRemoveKeyList(Tcl_Interp *interp, Tcl_Obj *dictPtr,
- size_t keyc, Tcl_Obj *const *keyv)
+ Tcl_Size keyc, Tcl_Obj *const *keyv)
}
declare 503 {
Tcl_Obj *Tcl_NewDictObj(void)
@@ -1954,7 +1954,7 @@ declare 524 {
int Tcl_LimitExceeded(Tcl_Interp *interp)
}
declare 525 {
- void Tcl_LimitSetCommands(Tcl_Interp *interp, size_t commandLimit)
+ void Tcl_LimitSetCommands(Tcl_Interp *interp, Tcl_Size commandLimit)
}
declare 526 {
void Tcl_LimitSetTime(Tcl_Interp *interp, Tcl_Time *timeLimitPtr)
@@ -2143,7 +2143,7 @@ declare 572 {
# TIP#268 (extended version numbers and requirements) akupries
declare 573 {
int Tcl_PkgRequireProc(Tcl_Interp *interp, const char *name,
- size_t objc, Tcl_Obj *const objv[], void *clientDataPtr)
+ Tcl_Size objc, Tcl_Obj *const objv[], void *clientDataPtr)
}
# TIP#270 (utility C routines for string formatting) dgp
@@ -2152,15 +2152,15 @@ declare 574 {
}
declare 575 {
void Tcl_AppendLimitedToObj(Tcl_Obj *objPtr, const char *bytes,
- size_t length, size_t limit, const char *ellipsis)
+ Tcl_Size length, Tcl_Size limit, const char *ellipsis)
}
declare 576 {
- Tcl_Obj *Tcl_Format(Tcl_Interp *interp, const char *format, size_t objc,
+ Tcl_Obj *Tcl_Format(Tcl_Interp *interp, const char *format, Tcl_Size objc,
Tcl_Obj *const objv[])
}
declare 577 {
int Tcl_AppendFormatToObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
- const char *format, size_t objc, Tcl_Obj *const objv[])
+ const char *format, Tcl_Size objc, Tcl_Obj *const objv[])
}
declare 578 {
Tcl_Obj *Tcl_ObjPrintf(const char *format, ...)
@@ -2197,11 +2197,11 @@ declare 584 {
int Tcl_NREvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int flags)
}
declare 585 {
- int Tcl_NREvalObjv(Tcl_Interp *interp, size_t objc,
+ int Tcl_NREvalObjv(Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[], int flags)
}
declare 586 {
- int Tcl_NRCmdSwap(Tcl_Interp *interp, Tcl_Command cmd, size_t objc,
+ int Tcl_NRCmdSwap(Tcl_Interp *interp, Tcl_Command cmd, Tcl_Size objc,
Tcl_Obj *const objv[], int flags)
}
declare 587 {
@@ -2213,7 +2213,7 @@ declare 587 {
# classic objProc
declare 588 {
int Tcl_NRCallObjProc(Tcl_Interp *interp, Tcl_ObjCmdProc *objProc,
- void *clientData, size_t objc, Tcl_Obj *const objv[])
+ void *clientData, Tcl_Size objc, Tcl_Obj *const objv[])
}
# TIP#316 (Tcl_StatBuf reader functions) dkf
@@ -2304,15 +2304,15 @@ declare 610 {
}
declare 611 {
int Tcl_ZlibInflate(Tcl_Interp *interp, int format, Tcl_Obj *data,
- size_t buffersize, Tcl_Obj *gzipHeaderDictObj)
+ Tcl_Size buffersize, Tcl_Obj *gzipHeaderDictObj)
}
declare 612 {
unsigned int Tcl_ZlibCRC32(unsigned int crc, const unsigned char *buf,
- size_t len)
+ Tcl_Size len)
}
declare 613 {
unsigned int Tcl_ZlibAdler32(unsigned int adler, const unsigned char *buf,
- size_t len)
+ Tcl_Size len)
}
declare 614 {
int Tcl_ZlibStreamInit(Tcl_Interp *interp, int mode, int format,
@@ -2332,7 +2332,7 @@ declare 618 {
}
declare 619 {
int Tcl_ZlibStreamGet(Tcl_ZlibStream zshandle, Tcl_Obj *data,
- size_t count)
+ Tcl_Size count)
}
declare 620 {
int Tcl_ZlibStreamClose(Tcl_ZlibStream zshandle)
@@ -2386,11 +2386,11 @@ declare 630 {
# ----- BASELINE -- FOR -- 8.6.0 ----- #
-# TIP #456
+# TIP #456/#468
declare 631 {
Tcl_Channel Tcl_OpenTcpServerEx(Tcl_Interp *interp, const char *service,
- const char *host, unsigned int flags, Tcl_TcpAcceptProc *acceptProc,
- void *callbackData)
+ const char *host, unsigned int flags, int backlog,
+ Tcl_TcpAcceptProc *acceptProc, void *callbackData)
}
# TIP #430
@@ -2444,12 +2444,12 @@ declare 643 {
# TIP#312 New Tcl_LinkArray() function
declare 644 {
int Tcl_LinkArray(Tcl_Interp *interp, const char *varName, void *addr,
- int type, size_t size)
+ int type, Tcl_Size size)
}
declare 645 {
int Tcl_GetIntForIndex(Tcl_Interp *interp, Tcl_Obj *objPtr,
- size_t endValue, size_t *indexPtr)
+ Tcl_Size endValue, Tcl_Size *indexPtr)
}
# TIP #548
@@ -2458,11 +2458,11 @@ declare 646 {
}
declare 647 {
char *Tcl_UniCharToUtfDString(const int *uniStr,
- size_t uniLength, Tcl_DString *dsPtr)
+ Tcl_Size uniLength, Tcl_DString *dsPtr)
}
declare 648 {
int *Tcl_UtfToUniCharDString(const char *src,
- size_t length, Tcl_DString *dsPtr)
+ Tcl_Size length, Tcl_DString *dsPtr)
}
# TIP #568
@@ -2489,7 +2489,7 @@ declare 653 {
# TIP #575
declare 654 {
- int Tcl_UtfCharComplete(const char *src, size_t length)
+ int Tcl_UtfCharComplete(const char *src, Tcl_Size length)
}
declare 655 {
const char *Tcl_UtfNext(const char *src)
@@ -2501,12 +2501,12 @@ declare 657 {
int Tcl_UniCharIsUnicode(int ch)
}
declare 658 {
- size_t Tcl_ExternalToUtfDStringEx(Tcl_Encoding encoding,
- const char *src, size_t srcLen, int flags, Tcl_DString *dsPtr)
+ Tcl_Size Tcl_ExternalToUtfDStringEx(Tcl_Encoding encoding,
+ const char *src, Tcl_Size srcLen, int flags, Tcl_DString *dsPtr)
}
declare 659 {
- size_t Tcl_UtfToExternalDStringEx(Tcl_Encoding encoding,
- const char *src, size_t srcLen, int flags, Tcl_DString *dsPtr)
+ Tcl_Size Tcl_UtfToExternalDStringEx(Tcl_Encoding encoding,
+ const char *src, Tcl_Size srcLen, int flags, Tcl_DString *dsPtr)
}
# TIP #511
@@ -2543,22 +2543,22 @@ declare 667 {
# TIP #617
declare 668 {
- size_t Tcl_UniCharLen(const int *uniStr)
+ Tcl_Size Tcl_UniCharLen(const int *uniStr)
}
declare 669 {
- size_t Tcl_NumUtfChars(const char *src, size_t length)
+ Tcl_Size Tcl_NumUtfChars(const char *src, Tcl_Size length)
}
declare 670 {
- size_t Tcl_GetCharLength(Tcl_Obj *objPtr)
+ Tcl_Size Tcl_GetCharLength(Tcl_Obj *objPtr)
}
declare 671 {
- const char *Tcl_UtfAtIndex(const char *src, size_t index)
+ const char *Tcl_UtfAtIndex(const char *src, Tcl_Size index)
}
declare 672 {
- Tcl_Obj *Tcl_GetRange(Tcl_Obj *objPtr, size_t first, size_t last)
+ Tcl_Obj *Tcl_GetRange(Tcl_Obj *objPtr, Tcl_Size first, Tcl_Size last)
}
declare 673 {
- int Tcl_GetUniChar(Tcl_Obj *objPtr, size_t index)
+ int Tcl_GetUniChar(Tcl_Obj *objPtr, Tcl_Size index)
}
declare 674 {
@@ -2576,7 +2576,7 @@ declare 676 {
Tcl_CmdDeleteProc *deleteProc)
}
declare 677 {
- Tcl_Trace Tcl_CreateObjTrace2(Tcl_Interp *interp, int level, int flags,
+ Tcl_Trace Tcl_CreateObjTrace2(Tcl_Interp *interp, Tcl_Size level, int flags,
Tcl_CmdObjTraceProc2 *objProc2, void *clientData,
Tcl_CmdObjTraceDeleteProc *delProc)
}
@@ -2606,6 +2606,11 @@ declare 682 {
int Tcl_RemoveChannelMode(Tcl_Interp *interp, Tcl_Channel chan, int mode)
}
+# TIP 643
+declare 683 {
+ int Tcl_GetEncodingNulLength(Tcl_Encoding encoding)
+}
+
# ----- BASELINE -- FOR -- 8.7.0 ----- #
##############################################################################
@@ -2642,7 +2647,7 @@ declare 3 {
# Public functions that are not accessible via the stubs table.
export {
- void Tcl_MainEx(size_t argc, char **argv, Tcl_AppInitProc *appInitProc,
+ void Tcl_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc,
Tcl_Interp *interp)
}
export {
diff --git a/generic/tcl.h b/generic/tcl.h
index 3f54c6d..580397d 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -48,17 +48,16 @@ extern "C" {
*/
#if !defined(TCL_MAJOR_VERSION)
-#define TCL_MAJOR_VERSION 9
+# define TCL_MAJOR_VERSION 9
#endif
-#if TCL_MAJOR_VERSION != 9
-#error "This header-file is for Tcl 9 only"
-#endif
-#define TCL_MINOR_VERSION 0
-#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
-#define TCL_RELEASE_SERIAL 4
-
-#define TCL_VERSION "9.0"
-#define TCL_PATCH_LEVEL "9.0a4"
+#if TCL_MAJOR_VERSION == 9
+# define TCL_MINOR_VERSION 0
+# define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
+# define TCL_RELEASE_SERIAL 4
+
+# define TCL_VERSION "9.0"
+# define TCL_PATCH_LEVEL "9.0a4"
+#endif /* TCL_MAJOR_VERSION */
#if defined(RC_INVOKED)
/*
@@ -117,7 +116,7 @@ extern "C" {
# define TCL_NORETURN1 __attribute__ ((noreturn))
#else
# define TCL_FORMAT_PRINTF(a,b)
-# if defined(_MSC_VER) && (_MSC_VER >= 1310)
+# if defined(_MSC_VER)
# define TCL_NORETURN _declspec(noreturn)
# define TCL_NOINLINE __declspec(noinline)
# else
@@ -317,7 +316,7 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
typedef struct __stat64 Tcl_StatBuf;
# elif defined(_WIN64) || defined(_USE_64BIT_TIME_T)
typedef struct __stat64 Tcl_StatBuf;
-# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T)
+# elif defined(_USE_32BIT_TIME_T)
typedef struct _stati64 Tcl_StatBuf;
# else
typedef struct _stat32i64 Tcl_StatBuf;
@@ -360,7 +359,6 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
typedef struct Tcl_Channel_ *Tcl_Channel;
typedef struct Tcl_ChannelTypeVersion_ *Tcl_ChannelTypeVersion;
-typedef struct Tcl_ObjTypeVersion_ *Tcl_ObjTypeVersion;
typedef struct Tcl_Command_ *Tcl_Command;
typedef struct Tcl_Condition_ *Tcl_Condition;
typedef struct Tcl_Dict_ *Tcl_Dict;
@@ -455,6 +453,7 @@ typedef void (Tcl_ThreadCreateProc) (void *clientData);
* string.
*/
+#if TCL_MAJOR_VERSION > 8
typedef struct Tcl_RegExpIndices {
size_t start; /* Character offset of first character in
* match. */
@@ -469,6 +468,23 @@ typedef struct Tcl_RegExpInfo {
size_t extendStart; /* The offset at which a subsequent match
* might begin. */
} Tcl_RegExpInfo;
+#else
+typedef struct Tcl_RegExpIndices {
+ long start; /* Character offset of first character in
+ * match. */
+ long end; /* Character offset of first character after
+ * the match. */
+} Tcl_RegExpIndices;
+
+typedef struct Tcl_RegExpInfo {
+ int nsubs; /* Number of subexpressions in the compiled
+ * expression. */
+ Tcl_RegExpIndices *matches; /* Array of nsubs match offset pairs. */
+ long extendStart; /* The offset at which a subsequent match
+ * might begin. */
+ long reserved; /* Reserved for later use. */
+} Tcl_RegExpInfo;
+#endif
/*
* Picky compilers complain if this typdef doesn't appear before the struct's
@@ -542,7 +558,7 @@ typedef int (Tcl_CmdObjTraceProc) (void *clientData, Tcl_Interp *interp,
int level, const char *command, Tcl_Command commandInfo, int objc,
struct Tcl_Obj *const *objv);
typedef int (Tcl_CmdObjTraceProc2) (void *clientData, Tcl_Interp *interp,
- int level, const char *command, Tcl_Command commandInfo, size_t objc,
+ size_t level, const char *command, Tcl_Command commandInfo, size_t objc,
struct Tcl_Obj *const *objv);
typedef void (Tcl_CmdObjTraceDeleteProc) (void *clientData);
typedef void (Tcl_DupInternalRepProc) (struct Tcl_Obj *srcPtr,
@@ -617,11 +633,11 @@ typedef struct Tcl_ObjType {
/* Called to convert the object's internal rep
* to this type. Frees the internal rep of the
* old type. Returns TCL_ERROR on failure. */
- Tcl_ObjTypeVersion version;
+ size_t version;
} Tcl_ObjType;
-#define TCL_OBJTYPE_V0 ((Tcl_ObjTypeVersion)0) /* Pre-Tcl 9. Set to 0 so
- * compiler will auto-init when existing code that does
- * not init this field is compiled with Tcl9 headers */
+#define TCL_OBJTYPE_V0 0 /* Pre-Tcl 9. Set to 0 so compiler will auto-init
+ * when existing code that does not init this
+ * field is compiled with Tcl9 headers */
#define TCL_OBJTYPE_CURRENT TCL_OBJTYPE_V0
/*
@@ -652,9 +668,15 @@ typedef union Tcl_ObjInternalRep { /* The internal representation: */
* An object stores a value as either a string, some internal representation,
* or both.
*/
+#if TCL_MAJOR_VERSION > 8
+typedef size_t Tcl_Size;
+#else
+typedef int Tcl_Size;
+#endif
+
typedef struct Tcl_Obj {
- size_t refCount; /* When 0 the object will be freed. */
+ Tcl_Size refCount; /* When 0 the object will be freed. */
char *bytes; /* This points to the first byte of the
* object's string representation. The array
* must be followed by a null byte (i.e., at
@@ -666,7 +688,7 @@ typedef struct Tcl_Obj {
* should use Tcl_GetStringFromObj or
* Tcl_GetString to get a pointer to the byte
* array as a readonly value. */
- size_t length; /* The number of bytes at *bytes, not
+ Tcl_Size length; /* The number of bytes at *bytes, not
* including the terminating null. */
const Tcl_ObjType *typePtr; /* Denotes the object's type. Always
* corresponds to the type of the object's
@@ -727,14 +749,14 @@ typedef struct Tcl_Namespace {
typedef struct Tcl_CallFrame {
Tcl_Namespace *nsPtr;
int dummy1;
- size_t dummy2;
+ Tcl_Size dummy2;
void *dummy3;
void *dummy4;
void *dummy5;
- size_t dummy6;
+ Tcl_Size dummy6;
void *dummy7;
void *dummy8;
- size_t dummy9;
+ Tcl_Size dummy9;
void *dummy10;
void *dummy11;
void *dummy12;
@@ -756,7 +778,7 @@ typedef struct Tcl_CallFrame {
* then calls the other function.
*/
-typedef struct Tcl_CmdInfo {
+typedef struct {
int isNativeObjectProc; /* 1 if objProc was registered by a call to
* Tcl_CreateObjCommand; 2 if objProc was registered by
* a call to Tcl_CreateObjCommand2; 0 otherwise.
@@ -790,9 +812,9 @@ typedef struct Tcl_CmdInfo {
typedef struct Tcl_DString {
char *string; /* Points to beginning of string: either
* staticSpace below or a malloced array. */
- size_t length; /* Number of non-NULL characters in the
+ Tcl_Size length; /* Number of non-NULL characters in the
* string. */
- size_t spaceAvl; /* Total number of bytes available for the
+ Tcl_Size spaceAvl; /* Total number of bytes available for the
* string and its terminating NULL char. */
char staticSpace[TCL_DSTRING_STATIC_SIZE];
/* Space to use in common case where string is
@@ -1008,8 +1030,8 @@ struct Tcl_HashEntry {
Tcl_HashEntry *nextPtr; /* Pointer to next entry in this hash bucket,
* or NULL for end of chain. */
Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */
- TCL_HASH_TYPE hash; /* Hash value. */
- void *clientData; /* Application stores something here with
+ size_t hash; /* Hash value. */
+ void *clientData; /* Application stores something here with
* Tcl_SetHashValue. */
union { /* Key has one of these forms: */
char *oneWordValue; /* One-word value for key. */
@@ -1097,11 +1119,11 @@ struct Tcl_HashTable {
Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE];
/* Bucket array used for small tables (to
* avoid mallocs and frees). */
- size_t numBuckets; /* Total number of buckets allocated at
+ Tcl_Size numBuckets; /* Total number of buckets allocated at
* **bucketPtr. */
- size_t numEntries; /* Total number of entries present in
+ Tcl_Size numEntries; /* Total number of entries present in
* table. */
- size_t rebuildSize; /* Enlarge table when numEntries gets to be
+ Tcl_Size rebuildSize; /* Enlarge table when numEntries gets to be
* this large. */
#if TCL_MAJOR_VERSION > 8
size_t mask; /* Mask value used in hashing function. */
@@ -1132,7 +1154,7 @@ struct Tcl_HashTable {
typedef struct Tcl_HashSearch {
Tcl_HashTable *tablePtr; /* Table being searched. */
- size_t nextIndex; /* Index of next bucket to be enumerated after
+ Tcl_Size nextIndex; /* Index of next bucket to be enumerated after
* present one. */
Tcl_HashEntry *nextEntryPtr;/* Next entry to be enumerated in the current
* bucket. */
@@ -1277,7 +1299,11 @@ typedef void (Tcl_ScaleTimeProc) (Tcl_Time *timebuf, void *clientData);
* interface.
*/
-#define TCL_CLOSE2PROC NULL
+#if TCL_MAJOR_VERSION > 8
+# define TCL_CLOSE2PROC NULL
+#else
+# define TCL_CLOSE2PROC ((void *) 1)
+#endif
/*
* Channel version tag. This was introduced in 8.3.2/8.4.
@@ -1528,7 +1554,7 @@ typedef struct Tcl_FSVersion_ *Tcl_FSVersion;
typedef struct Tcl_Filesystem {
const char *typeName; /* The name of the filesystem. */
- size_t structureLength; /* Length of this structure, so future binary
+ Tcl_Size structureLength; /* Length of this structure, so future binary
* compatibility can be assured. */
Tcl_FSVersion version; /* Version of the filesystem type. */
Tcl_FSPathInFilesystemProc *pathInFilesystemProc;
@@ -1690,8 +1716,8 @@ typedef struct Tcl_Token {
int type; /* Type of token, such as TCL_TOKEN_WORD; see
* below for valid types. */
const char *start; /* First character in token. */
- size_t size; /* Number of bytes in token. */
- size_t numComponents; /* If this token is composed of other tokens,
+ Tcl_Size size; /* Number of bytes in token. */
+ Tcl_Size numComponents; /* If this token is composed of other tokens,
* this field tells how many of them there are
* (including components of components, etc.).
* The component tokens immediately follow
@@ -1805,25 +1831,25 @@ typedef struct Tcl_Token {
typedef struct Tcl_Parse {
const char *commentStart; /* Pointer to # that begins the first of one
* or more comments preceding the command. */
- size_t commentSize; /* Number of bytes in comments (up through
+ Tcl_Size commentSize; /* Number of bytes in comments (up through
* newline character that terminates the last
* comment). If there were no comments, this
* field is 0. */
const char *commandStart; /* First character in first word of
* command. */
- size_t commandSize; /* Number of bytes in command, including first
+ Tcl_Size commandSize; /* Number of bytes in command, including first
* character of first word, up through the
* terminating newline, close bracket, or
* semicolon. */
- size_t numWords; /* Total number of words in command. May be
+ Tcl_Size numWords; /* Total number of words in command. May be
* 0. */
Tcl_Token *tokenPtr; /* Pointer to first token representing the
* words of the command. Initially points to
* staticTokens, but may change to point to
* malloc-ed space if command exceeds space in
* staticTokens. */
- size_t numTokens; /* Total number of tokens in command. */
- size_t tokensAvailable; /* Total number of tokens available at
+ Tcl_Size numTokens; /* Total number of tokens in command. */
+ Tcl_Size tokensAvailable; /* Total number of tokens available at
* *tokenPtr. */
int errorType; /* One of the parsing error types defined
* above. */
@@ -1943,8 +1969,13 @@ typedef struct Tcl_EncodingType {
#define TCL_ENCODING_START 0x01
#define TCL_ENCODING_END 0x02
-#define TCL_ENCODING_STRICT 0x04
-#define TCL_ENCODING_STOPONERROR 0x0 /* Not used any more */
+#if TCL_MAJOR_VERSION > 8
+# define TCL_ENCODING_STRICT 0x04
+# define TCL_ENCODING_STOPONERROR 0x0 /* Not used any more */
+#else
+# define TCL_ENCODING_STRICT 0x44
+# define TCL_ENCODING_STOPONERROR 0x04
+#endif
#define TCL_ENCODING_NO_TERMINATE 0x08
#define TCL_ENCODING_CHAR_LIMIT 0x10
#define TCL_ENCODING_MODIFIED 0x20
@@ -2180,12 +2211,12 @@ typedef int (Tcl_ArgvGenFuncProc)(void *clientData, Tcl_Interp *interp,
#define TCL_TCPSERVER_REUSEPORT (1<<1)
/*
- * Constants for special size_t-typed values, see TIP #494
+ * Constants for special Tcl_Size-typed values, see TIP #494
*/
-#define TCL_IO_FAILURE ((size_t)-1)
-#define TCL_AUTO_LENGTH ((size_t)-1)
-#define TCL_INDEX_NONE ((size_t)-1)
+#define TCL_IO_FAILURE ((Tcl_Size)-1)
+#define TCL_AUTO_LENGTH ((Tcl_Size)-1)
+#define TCL_INDEX_NONE ((Tcl_Size)-1)
/*
*----------------------------------------------------------------------------
@@ -2227,7 +2258,12 @@ void * TclStubCall(void *arg);
#endif
#ifdef USE_TCL_STUBS
-#if TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE
+#if TCL_MAJOR_VERSION < 9
+# define Tcl_InitStubs(interp, version, exact) \
+ (Tcl_InitStubs)(interp, version, \
+ (exact)|(TCL_MAJOR_VERSION<<8)|(0xFF<<16), \
+ TCL_STUB_MAGIC)
+#elif TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE
# define Tcl_InitStubs(interp, version, exact) \
(Tcl_InitStubs)(interp, version, \
(exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16), \
@@ -2239,7 +2275,9 @@ void * TclStubCall(void *arg);
TCL_STUB_MAGIC)
#endif
#else
-#if TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE
+#if TCL_MAJOR_VERSION < 9
+# error "Please define -DUSE_TCL_STUBS"
+#elif TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE
# define Tcl_InitStubs(interp, version, exact) \
Tcl_PkgInitStubsCheck(interp, version, \
(exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16))
@@ -2257,7 +2295,7 @@ void * TclStubCall(void *arg);
#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \
((Tcl_SetPanicProc(Tcl_ConsolePanic), Tcl_CreateInterp())))
-EXTERN TCL_NORETURN void Tcl_MainEx(size_t argc, char **argv,
+EXTERN TCL_NORETURN void Tcl_MainEx(Tcl_Size argc, char **argv,
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
const char *version, int exact);
@@ -2315,7 +2353,7 @@ EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv);
#define Tcl_SetPreInitScript(string) \
((const char *(*)(const char *))TclStubCall((void *)9))(string)
#endif
-
+
/*
*----------------------------------------------------------------------------
* Include the public function declarations that are accessible via the stubs
@@ -2445,7 +2483,7 @@ EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv);
*/
#define Tcl_GetHashValue(h) ((h)->clientData)
-#define Tcl_SetHashValue(h, value) ((h)->clientData = (void *) (value))
+#define Tcl_SetHashValue(h, value) ((h)->clientData = (void *)(value))
#define Tcl_GetHashKey(tablePtr, h) \
((void *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS || \
(tablePtr)->keyType == TCL_CUSTOM_PTR_KEYS) \
@@ -2457,8 +2495,10 @@ EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv);
* hash tables:
*/
+#undef Tcl_FindHashEntry
#define Tcl_FindHashEntry(tablePtr, key) \
(*((tablePtr)->findProc))(tablePtr, (const char *)(key))
+#undef Tcl_CreateHashEntry
#define Tcl_CreateHashEntry(tablePtr, key, newPtr) \
(*((tablePtr)->createProc))(tablePtr, (const char *)(key), newPtr)
diff --git a/generic/tclArithSeries.c b/generic/tclArithSeries.c
index 2c1ffca..3fa9792 100755
--- a/generic/tclArithSeries.c
+++ b/generic/tclArithSeries.c
@@ -708,15 +708,15 @@ Tcl_Obj *
TclArithSeriesObjRange(
Tcl_Interp *interp, /* For error message(s) */
Tcl_Obj *arithSeriesPtr, /* List object to take a range from. */
- int fromIdx, /* Index of first element to include. */
- int toIdx) /* Index of last element to include. */
+ Tcl_Size fromIdx, /* Index of first element to include. */
+ Tcl_Size toIdx) /* Index of last element to include. */
{
ArithSeries *arithSeriesRepPtr;
Tcl_Obj *startObj, *endObj, *stepObj;
ArithSeriesGetInternalRep(arithSeriesPtr, arithSeriesRepPtr);
- if (fromIdx < 0) {
+ if (fromIdx == TCL_INDEX_NONE) {
fromIdx = 0;
}
if (fromIdx > toIdx) {
@@ -725,9 +725,27 @@ TclArithSeriesObjRange(
return obj;
}
- TclArithSeriesObjIndex(arithSeriesPtr, fromIdx, &startObj);
+ if (TclArithSeriesObjIndex(arithSeriesPtr, fromIdx, &startObj) != TCL_OK) {
+ if (interp) {
+ Tcl_SetObjResult(
+ interp,
+ Tcl_ObjPrintf("index %" TCL_Z_MODIFIER "u is out of bounds 0 to %"
+ TCL_LL_MODIFIER "d", fromIdx, (arithSeriesRepPtr->len-1)));
+ Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
+ }
+ return NULL;
+ }
Tcl_IncrRefCount(startObj);
- TclArithSeriesObjIndex(arithSeriesPtr, toIdx, &endObj);
+ if (TclArithSeriesObjIndex(arithSeriesPtr, toIdx, &endObj) != TCL_OK) {
+ if (interp) {
+ Tcl_SetObjResult(
+ interp,
+ Tcl_ObjPrintf("index %" TCL_Z_MODIFIER "u is out of bounds 0 to %"
+ TCL_LL_MODIFIER "d", fromIdx, (arithSeriesRepPtr->len-1)));
+ Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
+ }
+ return NULL;
+ }
Tcl_IncrRefCount(endObj);
TclArithSeriesObjStep(arithSeriesPtr, &stepObj);
Tcl_IncrRefCount(stepObj);
@@ -822,7 +840,7 @@ TclArithSeriesGetElements(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
Tcl_Obj *objPtr, /* AbstractList object for which an element
* array is to be returned. */
- ListSizeT *objcPtr, /* Where to store the count of objects
+ Tcl_Size *objcPtr, /* Where to store the count of objects
* referenced by objv. */
Tcl_Obj ***objvPtr) /* Where to store the pointer to an array of
* pointers to the list's objects. */
diff --git a/generic/tclArithSeries.h b/generic/tclArithSeries.h
index 17e2513..af4777c 100644
--- a/generic/tclArithSeries.h
+++ b/generic/tclArithSeries.h
@@ -41,11 +41,11 @@ MODULE_SCOPE int TclArithSeriesObjIndex(Tcl_Obj *arithSeriesPtr,
Tcl_WideInt index, Tcl_Obj **elementObj);
MODULE_SCOPE Tcl_WideInt TclArithSeriesObjLength(Tcl_Obj *arithSeriesPtr);
MODULE_SCOPE Tcl_Obj * TclArithSeriesObjRange(Tcl_Interp *interp,
- Tcl_Obj *arithSeriesPtr, int fromIdx, int toIdx);
+ Tcl_Obj *arithSeriesPtr, Tcl_Size fromIdx, Tcl_Size toIdx);
MODULE_SCOPE Tcl_Obj * TclArithSeriesObjReverse(Tcl_Interp *interp,
Tcl_Obj *arithSeriesPtr);
MODULE_SCOPE int TclArithSeriesGetElements(Tcl_Interp *interp,
- Tcl_Obj *objPtr, size_t *objcPtr, Tcl_Obj ***objvPtr);
+ Tcl_Obj *objPtr, Tcl_Size *objcPtr, Tcl_Obj ***objvPtr);
MODULE_SCOPE Tcl_Obj * TclNewArithSeriesInt(Tcl_WideInt start,
Tcl_WideInt end, Tcl_WideInt step,
Tcl_WideInt len);
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 5ab12d4..cd1bfc8 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -297,6 +297,7 @@ static const CmdInfo builtInCmds[] = {
{"join", Tcl_JoinObjCmd, NULL, NULL, CMD_IS_SAFE},
{"lappend", Tcl_LappendObjCmd, TclCompileLappendCmd, NULL, CMD_IS_SAFE},
{"lassign", Tcl_LassignObjCmd, TclCompileLassignCmd, NULL, CMD_IS_SAFE},
+ {"ledit", Tcl_LeditObjCmd, NULL, NULL, CMD_IS_SAFE},
{"lindex", Tcl_LindexObjCmd, TclCompileLindexCmd, NULL, CMD_IS_SAFE},
{"linsert", Tcl_LinsertObjCmd, TclCompileLinsertCmd, NULL, CMD_IS_SAFE},
{"list", Tcl_ListObjCmd, TclCompileListCmd, NULL, CMD_IS_SAFE|CMD_COMPILES_EXPANDED},
@@ -309,10 +310,9 @@ static const CmdInfo builtInCmds[] = {
{"lreplace", Tcl_LreplaceObjCmd, TclCompileLreplaceCmd, NULL, CMD_IS_SAFE},
{"lreverse", Tcl_LreverseObjCmd, NULL, NULL, CMD_IS_SAFE},
{"lsearch", Tcl_LsearchObjCmd, NULL, NULL, CMD_IS_SAFE},
- {"lseq", Tcl_LseqObjCmd, NULL, NULL, CMD_IS_SAFE},
+ {"lseq", Tcl_LseqObjCmd, NULL, NULL, CMD_IS_SAFE},
{"lset", Tcl_LsetObjCmd, TclCompileLsetCmd, NULL, CMD_IS_SAFE},
{"lsort", Tcl_LsortObjCmd, NULL, NULL, CMD_IS_SAFE},
- {"ledit", Tcl_LeditObjCmd, NULL, NULL, CMD_IS_SAFE},
{"package", Tcl_PackageObjCmd, NULL, TclNRPackageObjCmd, CMD_IS_SAFE},
{"proc", procObjCmd, NULL, NULL, CMD_IS_SAFE},
{"regexp", Tcl_RegexpObjCmd, TclCompileRegexpCmd, NULL, CMD_IS_SAFE},
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 7e2634c..84188ef 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -2052,7 +2052,11 @@ FormatNumber(
*/
if (fabs(dvalue) > (double) FLT_MAX) {
+ if (fabs(dvalue) > (FLT_MAX + pow(2, (FLT_MAX_EXP - FLT_MANT_DIG - 1)))) {
+ fvalue = (dvalue >= 0.0) ? INFINITY : -INFINITY; // c99
+ } else {
fvalue = (dvalue >= 0.0) ? FLT_MAX : -FLT_MAX;
+ }
} else {
fvalue = (float) dvalue;
}
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 8a08f53..f94d914 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -2337,7 +2337,7 @@ StringReptCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- int count;
+ Tcl_WideInt count;
Tcl_Obj *resultPtr;
if (objc != 3) {
@@ -2345,7 +2345,7 @@ StringReptCmd(
return TCL_ERROR;
}
- if (TclGetIntFromObj(interp, objv[2], &count) != TCL_OK) {
+ if (TclGetWideIntFromObj(interp, objv[2], &count) != TCL_OK) {
return TCL_ERROR;
}
@@ -2437,6 +2437,9 @@ StringRplcCmd(
last + 1 - first, (objc == 5) ? objv[4] : NULL,
TCL_STRING_IN_PLACE);
+ if (resultPtr == NULL) {
+ return TCL_ERROR;
+ }
Tcl_SetObjResult(interp, resultPtr);
}
return TCL_OK;
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index 2ea3b77..c86d369 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -95,7 +95,7 @@ TclCompileGlobalCmd(
int localIndex, numWords, i;
/* TODO: Consider support for compiling expanded args. */
- numWords = (int)parsePtr->numWords;
+ numWords = parsePtr->numWords;
if (numWords < 2) {
return TCL_ERROR;
}
@@ -196,7 +196,7 @@ TclCompileIfCmd(
tokenPtr = parsePtr->tokenPtr;
wordIdx = 0;
- numWords = (int)parsePtr->numWords;
+ numWords = parsePtr->numWords;
for (wordIdx = 0; wordIdx < numWords; wordIdx++) {
if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
@@ -847,7 +847,7 @@ TclCompileLappendCmd(
int isScalar, localIndex, numWords, i;
/* TODO: Consider support for compiling expanded args. */
- numWords = (int)parsePtr->numWords;
+ numWords = parsePtr->numWords;
if (numWords < 3) {
return TCL_ERROR;
}
@@ -961,7 +961,7 @@ TclCompileLassignCmd(
Tcl_Token *tokenPtr;
int isScalar, localIndex, numWords, idx;
- numWords = (int)parsePtr->numWords;
+ numWords = parsePtr->numWords;
/*
* Check for command syntax error, but we'll punt that to runtime.
@@ -1062,7 +1062,7 @@ TclCompileLindexCmd(
{
DefineLineInformation; /* TIP #280 */
Tcl_Token *idxTokenPtr, *valTokenPtr;
- int i, idx, numWords = (int)parsePtr->numWords;
+ int i, idx, numWords = parsePtr->numWords;
/*
* Quit if not enough args.
@@ -1169,7 +1169,7 @@ TclCompileListCmd(
* implement with a simple push.
*/
- numWords = (int)parsePtr->numWords;
+ numWords = parsePtr->numWords;
valueTokenPtr = TokenAfter(parsePtr->tokenPtr);
TclNewObj(listObj);
for (i = 1; i < numWords && listObj != NULL; i++) {
@@ -1192,7 +1192,7 @@ TclCompileListCmd(
* Push the all values onto the stack.
*/
- numWords = (int)parsePtr->numWords;
+ numWords = parsePtr->numWords;
valueTokenPtr = TokenAfter(parsePtr->tokenPtr);
concat = build = 0;
for (i = 1; i < numWords; i++) {
@@ -1356,84 +1356,34 @@ TclCompileLinsertCmd(
CompileEnv *envPtr) /* Holds the resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
- Tcl_Token *tokenPtr, *listTokenPtr;
- int idx, i;
+ Tcl_Token *tokenPtr;
+ int i;
if ((int)parsePtr->numWords < 3) {
return TCL_ERROR;
}
- listTokenPtr = TokenAfter(parsePtr->tokenPtr);
-
- /*
- * Parse the index. Will only compile if it is constant and not an
- * _integer_ less than zero (since we reserve negative indices here for
- * end-relative indexing) or an end-based index greater than 'end' itself.
- */
-
- tokenPtr = TokenAfter(listTokenPtr);
-
- /*
- * NOTE: This command treats all inserts at indices before the list
- * the same as inserts at the start of the list, and all inserts
- * after the list the same as inserts at the end of the list. We
- * make that transformation here so we can use the optimized bytecode
- * as much as possible.
- */
- if (TclGetIndexFromToken(tokenPtr, TCL_INDEX_START, TCL_INDEX_END,
- &idx) != TCL_OK) {
- return TCL_ERROR;
- }
-
- /*
- * There are four main cases. If there are no values to insert, this is
- * just a confirm-listiness check. If the index is '0', this is a prepend.
- * If the index is 'end' (== TCL_INDEX_END), this is an append. Otherwise,
- * this is a splice (== split, insert values as list, concat-3).
- */
- CompileWord(envPtr, listTokenPtr, interp, 1);
- if (parsePtr->numWords == 3) {
- TclEmitInstInt4( INST_LIST_RANGE_IMM, 0, envPtr);
- TclEmitInt4( (int)TCL_INDEX_END, envPtr);
- return TCL_OK;
- }
+ /* Push list, insertion index onto the stack */
+ tokenPtr = TokenAfter(parsePtr->tokenPtr);
+ CompileWord(envPtr, tokenPtr, interp, 1);
+ tokenPtr = TokenAfter(tokenPtr);
+ CompileWord(envPtr, tokenPtr, interp, 2);
+ /* Push new elements to be inserted */
for (i=3 ; i<(int)parsePtr->numWords ; i++) {
tokenPtr = TokenAfter(tokenPtr);
CompileWord(envPtr, tokenPtr, interp, i);
}
- TclEmitInstInt4( INST_LIST, i - 3, envPtr);
-
- if (idx == (int)TCL_INDEX_START) {
- TclEmitInstInt4( INST_REVERSE, 2, envPtr);
- TclEmitOpcode( INST_LIST_CONCAT, envPtr);
- } else if (idx == (int)TCL_INDEX_END) {
- TclEmitOpcode( INST_LIST_CONCAT, envPtr);
- } else {
- /*
- * Here we handle two ranges for idx. First when idx > 0, we
- * want the first half of the split to end at index idx-1 and
- * the second half to start at index idx.
- * Second when idx < TCL_INDEX_END, indicating "end-N" indexing,
- * we want the first half of the split to end at index end-N and
- * the second half to start at index end-N+1. We accomplish this
- * with a pre-adjustment of the end-N value.
- * The root of this is that the commands [lrange] and [linsert]
- * differ in their interpretation of the "end" index.
- */
- if (idx < (int)TCL_INDEX_END) {
- idx++;
- }
- TclEmitInstInt4( INST_OVER, 1, envPtr);
- TclEmitInstInt4( INST_LIST_RANGE_IMM, 0, envPtr);
- TclEmitInt4( idx - 1, envPtr);
- TclEmitInstInt4( INST_REVERSE, 3, envPtr);
- TclEmitInstInt4( INST_LIST_RANGE_IMM, idx, envPtr);
- TclEmitInt4( (int)TCL_INDEX_END, envPtr);
- TclEmitOpcode( INST_LIST_CONCAT, envPtr);
- TclEmitOpcode( INST_LIST_CONCAT, envPtr);
- }
+ /* First operand is count of arguments */
+ TclEmitInstInt4(INST_LREPLACE4, parsePtr->numWords - 1, envPtr);
+ /*
+ * Second operand is bitmask
+ * TCL_LREPLACE4_END_IS_LAST - end refers to last element
+ * TCL_LREPLACE4_SINGLE_INDEX - second index is not present
+ * indicating this is a pure insert
+ */
+ TclEmitInt1(TCL_LREPLACE4_SINGLE_INDEX, envPtr);
return TCL_OK;
}
@@ -1458,116 +1408,34 @@ TclCompileLreplaceCmd(
CompileEnv *envPtr) /* Holds the resulting instructions. */
{
DefineLineInformation; /* TIP #280 */
- Tcl_Token *tokenPtr, *listTokenPtr;
- int idx1, idx2, i;
- int emptyPrefix=1, suffixStart = 0;
-
- if ((int)parsePtr->numWords < 4) {
- return TCL_ERROR;
- }
- listTokenPtr = TokenAfter(parsePtr->tokenPtr);
+ Tcl_Token *tokenPtr;
+ int i;
- tokenPtr = TokenAfter(listTokenPtr);
- if (TclGetIndexFromToken(tokenPtr, TCL_INDEX_START, TCL_INDEX_NONE,
- &idx1) != TCL_OK) {
+ if (parsePtr->numWords < 4) {
return TCL_ERROR;
}
+ /* Push list, first, last onto the stack */
+ tokenPtr = TokenAfter(parsePtr->tokenPtr);
+ CompileWord(envPtr, tokenPtr, interp, 1);
tokenPtr = TokenAfter(tokenPtr);
- if (TclGetIndexFromToken(tokenPtr, TCL_INDEX_NONE, TCL_INDEX_END,
- &idx2) != TCL_OK) {
- return TCL_ERROR;
- }
+ CompileWord(envPtr, tokenPtr, interp, 2);
+ tokenPtr = TokenAfter(tokenPtr);
+ CompileWord(envPtr, tokenPtr, interp, 3);
- /*
- * General structure of the [lreplace] result is
- * prefix replacement suffix
- * In a few cases we can predict various parts will be empty and
- * take advantage.
- *
- * The proper suffix begins with the greater of indices idx1 or
- * idx2 + 1. If we cannot tell at compile time which is greater,
- * we must defer to direct evaluation.
- */
-
- if (idx1 == (int)TCL_INDEX_NONE) {
- suffixStart = (int)TCL_INDEX_NONE;
- } else if (idx2 == (int)TCL_INDEX_NONE) {
- suffixStart = idx1;
- } else if (idx2 == (int)TCL_INDEX_END) {
- suffixStart = (int)TCL_INDEX_NONE;
- } else if (((idx2 < (int)TCL_INDEX_END) && (idx1 <= (int)TCL_INDEX_END))
- || ((idx2 >= (int)TCL_INDEX_START) && (idx1 >= (int)TCL_INDEX_START))) {
- suffixStart = (idx1 > idx2 + 1) ? idx1 : idx2 + 1;
- } else {
- return TCL_ERROR;
+ /* Push new elements to be inserted */
+ for (i=4 ; i< (int)parsePtr->numWords ; i++) {
+ tokenPtr = TokenAfter(tokenPtr);
+ CompileWord(envPtr, tokenPtr, interp, i);
}
- /* All paths start with computing/pushing the original value. */
- CompileWord(envPtr, listTokenPtr, interp, 1);
-
+ /* First operand is count of arguments */
+ TclEmitInstInt4(INST_LREPLACE4, parsePtr->numWords - 1, envPtr);
/*
- * Push all the replacement values next so any errors raised in
- * creating them get raised first.
+ * Second operand is bitmask
+ * TCL_LREPLACE4_END_IS_LAST - end refers to last element
*/
- if ((int)parsePtr->numWords > 4) {
- /* Push the replacement arguments */
- tokenPtr = TokenAfter(tokenPtr);
- for (i=4 ; i<(int)parsePtr->numWords ; i++) {
- CompileWord(envPtr, tokenPtr, interp, i);
- tokenPtr = TokenAfter(tokenPtr);
- }
-
- /* Make a list of them... */
- TclEmitInstInt4( INST_LIST, i - 4, envPtr);
-
- emptyPrefix = 0;
- }
-
- if ((idx1 == suffixStart) && (parsePtr->numWords == 4)) {
- /*
- * This is a "no-op". Example: [lreplace {a b c} 2 0]
- * We still do a list operation to get list-verification
- * and canonicalization side effects.
- */
- TclEmitInstInt4( INST_LIST_RANGE_IMM, 0, envPtr);
- TclEmitInt4( (int)TCL_INDEX_END, envPtr);
- return TCL_OK;
- }
-
- if (idx1 != (int)TCL_INDEX_START) {
- /* Prefix may not be empty; generate bytecode to push it */
- if (emptyPrefix) {
- TclEmitOpcode( INST_DUP, envPtr);
- } else {
- TclEmitInstInt4( INST_OVER, 1, envPtr);
- }
- TclEmitInstInt4( INST_LIST_RANGE_IMM, 0, envPtr);
- TclEmitInt4( idx1 - 1, envPtr);
- if (!emptyPrefix) {
- TclEmitInstInt4( INST_REVERSE, 2, envPtr);
- TclEmitOpcode( INST_LIST_CONCAT, envPtr);
- }
- emptyPrefix = 0;
- }
-
- if (!emptyPrefix) {
- TclEmitInstInt4( INST_REVERSE, 2, envPtr);
- }
-
- if (suffixStart == (int)TCL_INDEX_NONE) {
- TclEmitOpcode( INST_POP, envPtr);
- if (emptyPrefix) {
- PushStringLiteral(envPtr, "");
- }
- } else {
- /* Suffix may not be empty; generate bytecode to push it */
- TclEmitInstInt4( INST_LIST_RANGE_IMM, suffixStart, envPtr);
- TclEmitInt4( (int)TCL_INDEX_END, envPtr);
- if (!emptyPrefix) {
- TclEmitOpcode( INST_LIST_CONCAT, envPtr);
- }
- }
+ TclEmitInt1(TCL_LREPLACE4_END_IS_LAST, envPtr);
return TCL_OK;
}
@@ -2098,7 +1966,7 @@ TclCompileRegexpCmd(
sawLast++;
i++;
break;
- } else if ((len > 1) && (strncmp(str,"-nocase", len) == 0)) {
+ } else if ((len > 1) && (strncmp(str, "-nocase", len) == 0)) {
nocase = 1;
} else {
/*
@@ -2401,7 +2269,7 @@ TclCompileReturnCmd(
*/
int level, code, objc, status = TCL_OK;
size_t size;
- int numWords = (int)parsePtr->numWords;
+ int numWords = parsePtr->numWords;
int explicitResult = (0 == (numWords % 2));
int numOptionWords = numWords - 1 - explicitResult;
Tcl_Obj *returnOpts, **objv;
@@ -2655,7 +2523,7 @@ TclCompileUpvarCmd(
return TCL_ERROR;
}
- numWords = (int)parsePtr->numWords;
+ numWords = parsePtr->numWords;
if (numWords < 3) {
return TCL_ERROR;
}
@@ -2756,7 +2624,7 @@ TclCompileVariableCmd(
Tcl_Token *varTokenPtr, *valueTokenPtr;
int localIndex, numWords, i;
- numWords = (int)parsePtr->numWords;
+ numWords = parsePtr->numWords;
if (numWords < 2) {
return TCL_ERROR;
}
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index fc2b6b7..9708255 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -657,6 +657,13 @@ InstructionDesc const tclInstructionTable[] = {
/* String Less or equal: push (stknext <= stktop) */
{"strge", 1, -1, 0, {OPERAND_NONE}},
/* String Greater or equal: push (stknext >= stktop) */
+ {"lreplace4", 6, INT_MIN, 2, {OPERAND_UINT4, OPERAND_UINT1}},
+ /* Operands: number of arguments, flags
+ * flags: Combination of TCL_LREPLACE4_* flags
+ * Stack: ... listobj index1 ?index2? new1 ... newN => ... newlistobj
+ * where index2 is present only if TCL_LREPLACE_SINGLE_INDEX is not
+ * set in flags.
+ */
{NULL, 0, 0, 0, {OPERAND_NONE}}
};
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index 0dffcb62..035edac 100644
--- a/generic/tclCompile.h
+++ b/generic/tclCompile.h
@@ -89,20 +89,20 @@ typedef enum {
typedef struct {
ExceptionRangeType type; /* The kind of ExceptionRange. */
- size_t nestingLevel; /* Static depth of the exception range. Used
+ Tcl_Size nestingLevel; /* Static depth of the exception range. Used
* to find the most deeply-nested range
* surrounding a PC at runtime. */
- size_t codeOffset; /* Offset of the first instruction byte of the
+ Tcl_Size codeOffset; /* Offset of the first instruction byte of the
* code range. */
- size_t numCodeBytes; /* Number of bytes in the code range. */
- size_t breakOffset; /* If LOOP_EXCEPTION_RANGE, the target PC
+ Tcl_Size numCodeBytes; /* Number of bytes in the code range. */
+ Tcl_Size breakOffset; /* If LOOP_EXCEPTION_RANGE, the target PC
* offset for a break command in the range. */
- size_t continueOffset; /* If LOOP_EXCEPTION_RANGE and not TCL_INDEX_NONE, the
+ Tcl_Size continueOffset; /* If LOOP_EXCEPTION_RANGE and not TCL_INDEX_NONE, the
* target PC offset for a continue command in
* the code range. Otherwise, ignore this
* range when processing a continue
* command. */
- size_t catchOffset; /* If a CATCH_EXCEPTION_RANGE, the target PC
+ Tcl_Size catchOffset; /* If a CATCH_EXCEPTION_RANGE, the target PC
* offset for any "exception" in range. */
} ExceptionRange;
@@ -118,21 +118,21 @@ typedef struct ExceptionAux {
* one (see [for] next-clause) then we must
* not pick up the range when scanning for a
* target to continue to. */
- size_t stackDepth; /* The stack depth at the point where the
+ Tcl_Size stackDepth; /* The stack depth at the point where the
* exception range was created. This is used
* to calculate the number of POPs required to
* restore the stack to its prior state. */
- size_t expandTarget; /* The number of expansions expected on the
+ Tcl_Size expandTarget; /* The number of expansions expected on the
* auxData stack at the time the loop starts;
* we can't currently discard them except by
* doing INST_INVOKE_EXPANDED; this is a known
* problem. */
- size_t expandTargetDepth; /* The stack depth expected at the outermost
+ Tcl_Size expandTargetDepth; /* The stack depth expected at the outermost
* expansion within the loop. Not meaningful
* if there are no open expansions between the
* looping level and the point of jump
* issue. */
- size_t numBreakTargets; /* The number of [break]s that want to be
+ Tcl_Size numBreakTargets; /* The number of [break]s that want to be
* targeted to the place where this loop
* exception will be bound to. */
TCL_HASH_TYPE *breakTargets; /* The offsets of the INST_JUMP4 instructions
@@ -141,8 +141,8 @@ typedef struct ExceptionAux {
* TclFixupForwardJump) can cause the contents
* of this array to be updated. When
* numBreakTargets==0, this is NULL. */
- size_t allocBreakTargets; /* The size of the breakTargets array. */
- size_t numContinueTargets; /* The number of [continue]s that want to be
+ Tcl_Size allocBreakTargets; /* The size of the breakTargets array. */
+ Tcl_Size numContinueTargets; /* The number of [continue]s that want to be
* targeted to the place where this loop
* exception will be bound to. */
TCL_HASH_TYPE *continueTargets; /* The offsets of the INST_JUMP4 instructions
@@ -151,7 +151,7 @@ typedef struct ExceptionAux {
* TclFixupForwardJump) can cause the contents
* of this array to be updated. When
* numContinueTargets==0, this is NULL. */
- size_t allocContinueTargets; /* The size of the continueTargets array. */
+ Tcl_Size allocContinueTargets; /* The size of the continueTargets array. */
} ExceptionAux;
/*
@@ -163,10 +163,10 @@ typedef struct ExceptionAux {
*/
typedef struct {
- size_t codeOffset; /* Offset of first byte of command code. */
- size_t numCodeBytes; /* Number of bytes for command's code. */
- size_t srcOffset; /* Offset of first char of the command. */
- size_t numSrcBytes; /* Number of command source chars. */
+ Tcl_Size codeOffset; /* Offset of first byte of command code. */
+ Tcl_Size numCodeBytes; /* Number of bytes for command's code. */
+ Tcl_Size srcOffset; /* Offset of first char of the command. */
+ Tcl_Size numSrcBytes; /* Number of command source chars. */
} CmdLocation;
/*
@@ -181,8 +181,8 @@ typedef struct {
*/
typedef struct {
- size_t srcOffset; /* Command location to find the entry. */
- size_t nline; /* Number of words in the command */
+ Tcl_Size srcOffset; /* Command location to find the entry. */
+ Tcl_Size nline; /* Number of words in the command */
int *line; /* Line information for all words in the
* command. */
int **next; /* Transient information used by the compiler
@@ -198,8 +198,8 @@ typedef struct {
Tcl_Obj *path; /* Path of the sourced file the command is
* in. */
ECL *loc; /* Command word locations (lines). */
- size_t nloc; /* Number of allocated entries in 'loc'. */
- size_t nuloc; /* Number of used entries in 'loc'. */
+ Tcl_Size nloc; /* Number of allocated entries in 'loc'. */
+ Tcl_Size nuloc; /* Number of used entries in 'loc'. */
} ExtCmdLoc;
/*
@@ -290,21 +290,21 @@ typedef struct CompileEnv {
* SetByteCodeFromAny. This pointer is not
* owned by the CompileEnv and must not be
* freed or changed by it. */
- size_t numSrcBytes; /* Number of bytes in source. */
+ Tcl_Size numSrcBytes; /* Number of bytes in source. */
Proc *procPtr; /* If a procedure is being compiled, a pointer
* to its Proc structure; otherwise NULL. Used
* to compile local variables. Set from
* information provided by ObjInterpProc in
* tclProc.c. */
- size_t numCommands; /* Number of commands compiled. */
- size_t exceptDepth; /* Current exception range nesting level; TCL_INDEX_NONE
+ Tcl_Size numCommands; /* Number of commands compiled. */
+ Tcl_Size exceptDepth; /* Current exception range nesting level; TCL_INDEX_NONE
* if not in any range currently. */
- size_t maxExceptDepth; /* Max nesting level of exception ranges; TCL_INDEX_NONE
+ Tcl_Size maxExceptDepth; /* Max nesting level of exception ranges; TCL_INDEX_NONE
* if no ranges have been compiled. */
- size_t maxStackDepth; /* Maximum number of stack elements needed to
+ Tcl_Size maxStackDepth; /* Maximum number of stack elements needed to
* execute the code. Set by compilation
* procedures before returning. */
- size_t currStackDepth; /* Current stack depth. */
+ Tcl_Size currStackDepth; /* Current stack depth. */
LiteralTable localLitTable; /* Contains LiteralEntry's describing all Tcl
* objects referenced by this compiled code.
* Indexed by the string representations of
@@ -322,18 +322,18 @@ typedef struct CompileEnv {
#endif
LiteralEntry *literalArrayPtr;
/* Points to start of LiteralEntry array. */
- size_t literalArrayNext; /* Index of next free object array entry. */
- size_t literalArrayEnd; /* Index just after last obj array entry. */
+ Tcl_Size literalArrayNext; /* Index of next free object array entry. */
+ Tcl_Size literalArrayEnd; /* Index just after last obj array entry. */
int mallocedLiteralArray; /* 1 if object array was expanded and objArray
* points into the heap, else 0. */
ExceptionRange *exceptArrayPtr;
/* Points to start of the ExceptionRange
* array. */
- size_t exceptArrayNext; /* Next free ExceptionRange array index.
+ Tcl_Size exceptArrayNext; /* Next free ExceptionRange array index.
* exceptArrayNext is the number of ranges and
* (exceptArrayNext-1) is the index of the
* current range's array entry. */
- size_t exceptArrayEnd; /* Index after the last ExceptionRange array
+ Tcl_Size exceptArrayEnd; /* Index after the last ExceptionRange array
* entry. */
#if TCL_MAJOR_VERSION < 9
int mallocedExceptArray;
@@ -347,7 +347,7 @@ typedef struct CompileEnv {
* numCommands is the index of the next entry
* to use; (numCommands-1) is the entry index
* for the last command. */
- size_t cmdMapEnd; /* Index after last CmdLocation entry. */
+ Tcl_Size cmdMapEnd; /* Index after last CmdLocation entry. */
int mallocedCmdMap; /* 1 if command map array was expanded and
* cmdMapPtr points in the heap, else 0. */
#if TCL_MAJOR_VERSION > 8
@@ -355,11 +355,11 @@ typedef struct CompileEnv {
* auxDataArrayPtr points in heap else 0. */
#endif
AuxData *auxDataArrayPtr; /* Points to auxiliary data array start. */
- size_t auxDataArrayNext; /* Next free compile aux data array index.
+ Tcl_Size auxDataArrayNext; /* Next free compile aux data array index.
* auxDataArrayNext is the number of aux data
* items and (auxDataArrayNext-1) is index of
* current aux data array entry. */
- size_t auxDataArrayEnd; /* Index after last aux data array entry. */
+ Tcl_Size auxDataArrayEnd; /* Index after last aux data array entry. */
#if TCL_MAJOR_VERSION < 9
int mallocedAuxDataArray;
#endif
@@ -379,7 +379,7 @@ typedef struct CompileEnv {
/* TIP #280 */
ExtCmdLoc *extCmdMapPtr; /* Extended command location information for
* 'info frame'. */
- size_t line; /* First line of the script, based on the
+ Tcl_Size line; /* First line of the script, based on the
* invoking context, then the line of the
* command currently compiled. */
int atCmdStart; /* Flag to say whether an INST_START_CMD
@@ -388,7 +388,7 @@ typedef struct CompileEnv {
* inefficient. If set to 2, that instruction
* should not be issued at all (by the generic
* part of the command compiler). */
- size_t expandCount; /* Number of INST_EXPAND_START instructions
+ Tcl_Size expandCount; /* Number of INST_EXPAND_START instructions
* encountered that have not yet been paired
* with a corresponding
* INST_INVOKE_EXPANDED. */
@@ -427,7 +427,7 @@ typedef struct ByteCode {
* procs are specific to an interpreter so the
* code emitted will depend on the
* interpreter. */
- size_t compileEpoch; /* Value of iPtr->compileEpoch when this
+ Tcl_Size compileEpoch; /* Value of iPtr->compileEpoch when this
* ByteCode was compiled. Used to invalidate
* code when, e.g., commands with compile
* procs are redefined. */
@@ -435,11 +435,11 @@ typedef struct ByteCode {
* compiled. If the code is executed if a
* different namespace, it must be
* recompiled. */
- size_t nsEpoch; /* Value of nsPtr->resolverEpoch when this
+ Tcl_Size nsEpoch; /* Value of nsPtr->resolverEpoch when this
* ByteCode was compiled. Used to invalidate
* code when new namespace resolution rules
* are put into effect. */
- size_t refCount; /* Reference count: set 1 when created plus 1
+ Tcl_Size refCount; /* Reference count: set 1 when created plus 1
* for each execution of the code currently
* active. This structure can be freed when
* refCount becomes zero. */
@@ -459,17 +459,17 @@ typedef struct ByteCode {
* itself. Does not include heap space for
* literal Tcl objects or storage referenced
* by AuxData entries. */
- size_t numCommands; /* Number of commands compiled. */
- size_t numSrcBytes; /* Number of source bytes compiled. */
- size_t numCodeBytes; /* Number of code bytes. */
- size_t numLitObjects; /* Number of objects in literal array. */
- size_t numExceptRanges; /* Number of ExceptionRange array elems. */
- size_t numAuxDataItems; /* Number of AuxData items. */
- size_t numCmdLocBytes; /* Number of bytes needed for encoded command
+ Tcl_Size numCommands; /* Number of commands compiled. */
+ Tcl_Size numSrcBytes; /* Number of source bytes compiled. */
+ Tcl_Size numCodeBytes; /* Number of code bytes. */
+ Tcl_Size numLitObjects; /* Number of objects in literal array. */
+ Tcl_Size numExceptRanges; /* Number of ExceptionRange array elems. */
+ Tcl_Size numAuxDataItems; /* Number of AuxData items. */
+ Tcl_Size numCmdLocBytes; /* Number of bytes needed for encoded command
* location information. */
- size_t maxExceptDepth; /* Maximum nesting level of ExceptionRanges;
+ Tcl_Size maxExceptDepth; /* Maximum nesting level of ExceptionRanges;
* TCL_INDEX_NONE if no ranges were compiled. */
- size_t maxStackDepth; /* Maximum number of stack elements needed to
+ Tcl_Size maxStackDepth; /* Maximum number of stack elements needed to
* execute the code. */
unsigned char *codeStart; /* Points to the first byte of the code. This
* is just after the final ByteCode member
@@ -835,6 +835,8 @@ enum TclInstruction {
INST_STR_LE,
INST_STR_GE,
+ INST_LREPLACE4,
+
/* The last opcode */
LAST_INST_OPCODE
};
@@ -875,7 +877,7 @@ typedef enum InstOperandType {
typedef struct InstructionDesc {
const char *name; /* Name of instruction. */
- size_t numBytes; /* Total number of bytes for instruction. */
+ Tcl_Size numBytes; /* Total number of bytes for instruction. */
int stackEffect; /* The worst-case balance stack effect of the
* instruction, used for stack requirements
* computations. The value INT_MIN signals
@@ -963,8 +965,8 @@ typedef struct JumpFixup {
typedef struct JumpFixupArray {
JumpFixup *fixup; /* Points to start of jump fixup array. */
- size_t next; /* Index of next free array entry. */
- size_t end; /* Index of last usable entry in array. */
+ Tcl_Size next; /* Index of next free array entry. */
+ Tcl_Size end; /* Index of last usable entry in array. */
int mallocedArray; /* 1 if array was expanded and fixups points
* into the heap, else 0. */
JumpFixup staticFixupSpace[JUMPFIXUP_INIT_ENTRIES];
@@ -979,8 +981,8 @@ typedef struct JumpFixupArray {
*/
typedef struct ForeachVarList {
- size_t numVars; /* The number of variables in the list. */
- size_t varIndexes[TCLFLEXARRAY];/* An array of the indexes ("slot numbers")
+ Tcl_Size numVars; /* The number of variables in the list. */
+ Tcl_Size varIndexes[TCLFLEXARRAY];/* An array of the indexes ("slot numbers")
* for each variable in the procedure's array
* of local variables. Only scalar variables
* are supported. The actual size of this
@@ -996,11 +998,11 @@ typedef struct ForeachVarList {
*/
typedef struct ForeachInfo {
- size_t numLists; /* The number of both the variable and value
+ Tcl_Size numLists; /* The number of both the variable and value
* lists of the foreach command. */
- size_t firstValueTemp; /* Index of the first temp var in a proc frame
+ Tcl_Size firstValueTemp; /* Index of the first temp var in a proc frame
* used to point to a value list. */
- size_t loopCtTemp; /* Index of temp var in a proc frame holding
+ Tcl_Size loopCtTemp; /* Index of temp var in a proc frame holding
* the loop's iteration count. Used to
* determine next value list element to assign
* each loop var. */
@@ -1034,8 +1036,8 @@ MODULE_SCOPE const AuxDataType tclJumptableInfoType;
*/
typedef struct {
- size_t length; /* Size of array */
- size_t varIndices[TCLFLEXARRAY]; /* Array of variable indices to manage when
+ Tcl_Size length; /* Size of array */
+ Tcl_Size varIndices[TCLFLEXARRAY]; /* Array of variable indices to manage when
* processing the start and end of a [dict
* update]. There is really more than one
* entry, and the structure is allocated to
@@ -1062,6 +1064,7 @@ typedef struct {
*----------------------------------------------------------------
*/
+#if TCL_MAJOR_VERSION > 8
MODULE_SCOPE Tcl_ObjCmdProc TclNRInterpCoroutine;
/*
@@ -1200,6 +1203,7 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
Tcl_Interp *interp, size_t objc,
Tcl_Obj *const objv[], int isLambda);
+#endif /* TCL_MAJOR_VERSION > 8 */
/*
@@ -1249,9 +1253,9 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
#define TclCheckStackDepth(depth, envPtr) \
do { \
size_t _dd = (depth); \
- if (_dd != (envPtr)->currStackDepth) { \
+ if (_dd != (size_t)(envPtr)->currStackDepth) { \
Tcl_Panic("bad stack depth computations: is %" TCL_Z_MODIFIER "u, should be %" TCL_Z_MODIFIER "u", \
- (envPtr)->currStackDepth, _dd); \
+ (size_t)(envPtr)->currStackDepth, _dd); \
} \
} while (0)
@@ -1531,15 +1535,15 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
* these macros are:
*
* static void PushLiteral(CompileEnv *envPtr,
- * const char *string, size_t length);
+ * const char *string, Tcl_Size length);
* static void PushStringLiteral(CompileEnv *envPtr,
* const char *string);
*/
#define PushLiteral(envPtr, string, length) \
- TclEmitPush(TclRegisterLiteral(envPtr, string, length, 0), (envPtr))
+ TclEmitPush(TclRegisterLiteral((envPtr), (string), (length), 0), (envPtr))
#define PushStringLiteral(envPtr, string) \
- PushLiteral(envPtr, string, sizeof(string "") - 1)
+ PushLiteral((envPtr), (string), sizeof(string "") - 1)
/*
* Macro to advance to the next token; it is more mnemonic than the address
@@ -1568,16 +1572,16 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
* of LOOP ranges is an interesting datum for debugging purposes, and that is
* what we compute now.
*
- * static int ExceptionRangeStarts(CompileEnv *envPtr, size_t index);
- * static void ExceptionRangeEnds(CompileEnv *envPtr, size_t index);
- * static void ExceptionRangeTarget(CompileEnv *envPtr, size_t index, LABEL);
+ * static int ExceptionRangeStarts(CompileEnv *envPtr, Tcl_Size index);
+ * static void ExceptionRangeEnds(CompileEnv *envPtr, Tcl_Size index);
+ * static void ExceptionRangeTarget(CompileEnv *envPtr, Tcl_Size index, LABEL);
*/
#define ExceptionRangeStarts(envPtr, index) \
(((envPtr)->exceptDepth++), \
((envPtr)->maxExceptDepth = \
TclMax((envPtr)->exceptDepth, (envPtr)->maxExceptDepth)), \
- ((envPtr)->exceptArrayPtr[(index)].codeOffset= CurrentOffset(envPtr)))
+ ((envPtr)->exceptArrayPtr[(index)].codeOffset = CurrentOffset(envPtr)))
#define ExceptionRangeEnds(envPtr, index) \
(((envPtr)->exceptDepth--), \
((envPtr)->exceptArrayPtr[(index)].numCodeBytes = \
@@ -1629,7 +1633,7 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
#define DefineLineInformation \
ExtCmdLoc *mapPtr = envPtr->extCmdMapPtr; \
- size_t eclIndex = mapPtr->nuloc - 1
+ Tcl_Size eclIndex = mapPtr->nuloc - 1
#define SetLineInformation(word) \
envPtr->line = mapPtr->loc[eclIndex].line[(word)]; \
@@ -1671,6 +1675,12 @@ MODULE_SCOPE int TclPushProcCallFrame(void *clientData,
#define TCL_NO_ELEMENT 2 /* Do not push the array element. */
/*
+ * Flags bits used by lreplace4 instruction
+ */
+#define TCL_LREPLACE4_END_IS_LAST 1 /* "end" refers to last element */
+#define TCL_LREPLACE4_SINGLE_INDEX 2 /* Second index absent (pure insert) */
+
+/*
* DTrace probe macros (NOPs if DTrace support is not enabled).
*/
@@ -1807,8 +1817,8 @@ MODULE_SCOPE void TclDTraceInfo(Tcl_Obj *info, const char **args, int *argsi);
FILE *tclDTraceDebugLog = NULL; \
void TclDTraceOpenDebugLog(void) { \
char n[35]; \
- sprintf(n, "/tmp/tclDTraceDebug-%d.log", \
- getpid()); \
+ sprintf(n, "/tmp/tclDTraceDebug-%" TCL_Z_MODIFIER "u.log", \
+ (size_t) getpid()); \
tclDTraceDebugLog = fopen(n, "a"); \
}
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index d0343d3..8e4aa59 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -92,9 +92,9 @@ EXTERN int Tcl_AppendAllObjTypes(Tcl_Interp *interp,
EXTERN void Tcl_AppendStringsToObj(Tcl_Obj *objPtr, ...);
/* 16 */
EXTERN void Tcl_AppendToObj(Tcl_Obj *objPtr, const char *bytes,
- size_t length);
+ Tcl_Size length);
/* 17 */
-EXTERN Tcl_Obj * Tcl_ConcatObj(size_t objc, Tcl_Obj *const objv[]);
+EXTERN Tcl_Obj * Tcl_ConcatObj(Tcl_Size objc, Tcl_Obj *const objv[]);
/* 18 */
EXTERN int Tcl_ConvertToType(Tcl_Interp *interp,
Tcl_Obj *objPtr, const Tcl_ObjType *typePtr);
@@ -110,19 +110,20 @@ EXTERN int Tcl_DbIsShared(Tcl_Obj *objPtr, const char *file,
/* Slot 22 is reserved */
/* 23 */
EXTERN Tcl_Obj * Tcl_DbNewByteArrayObj(const unsigned char *bytes,
- size_t numBytes, const char *file, int line);
+ Tcl_Size numBytes, const char *file,
+ int line);
/* 24 */
EXTERN Tcl_Obj * Tcl_DbNewDoubleObj(double doubleValue,
const char *file, int line);
/* 25 */
-EXTERN Tcl_Obj * Tcl_DbNewListObj(size_t objc, Tcl_Obj *const *objv,
+EXTERN Tcl_Obj * Tcl_DbNewListObj(Tcl_Size objc, Tcl_Obj *const *objv,
const char *file, int line);
/* Slot 26 is reserved */
/* 27 */
EXTERN Tcl_Obj * Tcl_DbNewObj(const char *file, int line);
/* 28 */
-EXTERN Tcl_Obj * Tcl_DbNewStringObj(const char *bytes, size_t length,
- const char *file, int line);
+EXTERN Tcl_Obj * Tcl_DbNewStringObj(const char *bytes,
+ Tcl_Size length, const char *file, int line);
/* 29 */
EXTERN Tcl_Obj * Tcl_DuplicateObj(Tcl_Obj *objPtr);
/* 30 */
@@ -170,48 +171,50 @@ EXTERN int TclListObjGetElements(Tcl_Interp *interp,
Tcl_Obj ***objvPtr);
/* 46 */
EXTERN int Tcl_ListObjIndex(Tcl_Interp *interp,
- Tcl_Obj *listPtr, size_t index,
+ Tcl_Obj *listPtr, Tcl_Size index,
Tcl_Obj **objPtrPtr);
/* 47 */
EXTERN int TclListObjLength(Tcl_Interp *interp,
Tcl_Obj *listPtr, int *lengthPtr);
/* 48 */
EXTERN int Tcl_ListObjReplace(Tcl_Interp *interp,
- Tcl_Obj *listPtr, size_t first, size_t count,
- size_t objc, Tcl_Obj *const objv[]);
+ Tcl_Obj *listPtr, Tcl_Size first,
+ Tcl_Size count, Tcl_Size objc,
+ Tcl_Obj *const objv[]);
/* Slot 49 is reserved */
/* 50 */
EXTERN Tcl_Obj * Tcl_NewByteArrayObj(const unsigned char *bytes,
- size_t numBytes);
+ Tcl_Size numBytes);
/* 51 */
EXTERN Tcl_Obj * Tcl_NewDoubleObj(double doubleValue);
/* Slot 52 is reserved */
/* 53 */
-EXTERN Tcl_Obj * Tcl_NewListObj(size_t objc, Tcl_Obj *const objv[]);
+EXTERN Tcl_Obj * Tcl_NewListObj(Tcl_Size objc, Tcl_Obj *const objv[]);
/* Slot 54 is reserved */
/* 55 */
EXTERN Tcl_Obj * Tcl_NewObj(void);
/* 56 */
-EXTERN Tcl_Obj * Tcl_NewStringObj(const char *bytes, size_t length);
+EXTERN Tcl_Obj * Tcl_NewStringObj(const char *bytes, Tcl_Size length);
/* Slot 57 is reserved */
/* 58 */
EXTERN unsigned char * Tcl_SetByteArrayLength(Tcl_Obj *objPtr,
- size_t numBytes);
+ Tcl_Size numBytes);
/* 59 */
EXTERN void Tcl_SetByteArrayObj(Tcl_Obj *objPtr,
- const unsigned char *bytes, size_t numBytes);
+ const unsigned char *bytes,
+ Tcl_Size numBytes);
/* 60 */
EXTERN void Tcl_SetDoubleObj(Tcl_Obj *objPtr, double doubleValue);
/* Slot 61 is reserved */
/* 62 */
-EXTERN void Tcl_SetListObj(Tcl_Obj *objPtr, size_t objc,
+EXTERN void Tcl_SetListObj(Tcl_Obj *objPtr, Tcl_Size objc,
Tcl_Obj *const objv[]);
/* Slot 63 is reserved */
/* 64 */
-EXTERN void Tcl_SetObjLength(Tcl_Obj *objPtr, size_t length);
+EXTERN void Tcl_SetObjLength(Tcl_Obj *objPtr, Tcl_Size length);
/* 65 */
EXTERN void Tcl_SetStringObj(Tcl_Obj *objPtr, const char *bytes,
- size_t length);
+ Tcl_Size length);
/* Slot 66 is reserved */
/* Slot 67 is reserved */
/* 68 */
@@ -249,22 +252,22 @@ EXTERN int Tcl_Close(Tcl_Interp *interp, Tcl_Channel chan);
/* 82 */
EXTERN int Tcl_CommandComplete(const char *cmd);
/* 83 */
-EXTERN char * Tcl_Concat(size_t argc, const char *const *argv);
+EXTERN char * Tcl_Concat(Tcl_Size argc, const char *const *argv);
/* 84 */
-EXTERN size_t Tcl_ConvertElement(const char *src, char *dst,
+EXTERN Tcl_Size Tcl_ConvertElement(const char *src, char *dst,
int flags);
/* 85 */
-EXTERN size_t Tcl_ConvertCountedElement(const char *src,
- size_t length, char *dst, int flags);
+EXTERN Tcl_Size Tcl_ConvertCountedElement(const char *src,
+ Tcl_Size length, char *dst, int flags);
/* 86 */
EXTERN int Tcl_CreateAlias(Tcl_Interp *childInterp,
const char *childCmd, Tcl_Interp *target,
- const char *targetCmd, size_t argc,
+ const char *targetCmd, Tcl_Size argc,
const char *const *argv);
/* 87 */
EXTERN int Tcl_CreateAliasObj(Tcl_Interp *childInterp,
const char *childCmd, Tcl_Interp *target,
- const char *targetCmd, size_t objc,
+ const char *targetCmd, Tcl_Size objc,
Tcl_Obj *const objv[]);
/* 88 */
EXTERN Tcl_Channel Tcl_CreateChannel(const Tcl_ChannelType *typePtr,
@@ -303,7 +306,7 @@ EXTERN Tcl_Interp * Tcl_CreateChild(Tcl_Interp *interp, const char *name,
EXTERN Tcl_TimerToken Tcl_CreateTimerHandler(int milliseconds,
Tcl_TimerProc *proc, void *clientData);
/* 99 */
-EXTERN Tcl_Trace Tcl_CreateTrace(Tcl_Interp *interp, int level,
+EXTERN Tcl_Trace Tcl_CreateTrace(Tcl_Interp *interp, Tcl_Size level,
Tcl_CmdTraceProc *proc, void *clientData);
/* 100 */
EXTERN void Tcl_DeleteAssocData(Tcl_Interp *interp,
@@ -337,7 +340,7 @@ EXTERN void Tcl_DeleteHashTable(Tcl_HashTable *tablePtr);
/* 110 */
EXTERN void Tcl_DeleteInterp(Tcl_Interp *interp);
/* 111 */
-EXTERN void Tcl_DetachPids(size_t numPids, Tcl_Pid *pidPtr);
+EXTERN void Tcl_DetachPids(Tcl_Size numPids, Tcl_Pid *pidPtr);
/* 112 */
EXTERN void Tcl_DeleteTimerHandler(Tcl_TimerToken token);
/* 113 */
@@ -351,7 +354,7 @@ EXTERN int Tcl_DoOneEvent(int flags);
EXTERN void Tcl_DoWhenIdle(Tcl_IdleProc *proc, void *clientData);
/* 117 */
EXTERN char * Tcl_DStringAppend(Tcl_DString *dsPtr,
- const char *bytes, size_t length);
+ const char *bytes, Tcl_Size length);
/* 118 */
EXTERN char * Tcl_DStringAppendElement(Tcl_DString *dsPtr,
const char *element);
@@ -369,7 +372,7 @@ EXTERN void Tcl_DStringResult(Tcl_Interp *interp,
Tcl_DString *dsPtr);
/* 124 */
EXTERN void Tcl_DStringSetLength(Tcl_DString *dsPtr,
- size_t length);
+ Tcl_Size length);
/* 125 */
EXTERN void Tcl_DStringStartSublist(Tcl_DString *dsPtr);
/* 126 */
@@ -444,7 +447,7 @@ EXTERN void * Tcl_GetAssocData(Tcl_Interp *interp,
EXTERN Tcl_Channel Tcl_GetChannel(Tcl_Interp *interp,
const char *chanName, int *modePtr);
/* 152 */
-EXTERN size_t Tcl_GetChannelBufferSize(Tcl_Channel chan);
+EXTERN Tcl_Size Tcl_GetChannelBufferSize(Tcl_Channel chan);
/* 153 */
EXTERN int Tcl_GetChannelHandle(Tcl_Channel chan, int direction,
void **handlePtr);
@@ -486,9 +489,9 @@ EXTERN int Tcl_GetOpenFile(Tcl_Interp *interp,
/* 168 */
EXTERN Tcl_PathType Tcl_GetPathType(const char *path);
/* 169 */
-EXTERN size_t Tcl_Gets(Tcl_Channel chan, Tcl_DString *dsPtr);
+EXTERN Tcl_Size Tcl_Gets(Tcl_Channel chan, Tcl_DString *dsPtr);
/* 170 */
-EXTERN size_t Tcl_GetsObj(Tcl_Channel chan, Tcl_Obj *objPtr);
+EXTERN Tcl_Size Tcl_GetsObj(Tcl_Channel chan, Tcl_Obj *objPtr);
/* 171 */
EXTERN int Tcl_GetServiceMode(void);
/* 172 */
@@ -520,7 +523,7 @@ EXTERN int Tcl_InterpDeleted(Tcl_Interp *interp);
/* 185 */
EXTERN int Tcl_IsSafe(Tcl_Interp *interp);
/* 186 */
-EXTERN char * Tcl_JoinPath(size_t argc, const char *const *argv,
+EXTERN char * Tcl_JoinPath(Tcl_Size argc, const char *const *argv,
Tcl_DString *resultPtr);
/* 187 */
EXTERN int Tcl_LinkVar(Tcl_Interp *interp, const char *varName,
@@ -532,7 +535,7 @@ EXTERN Tcl_Channel Tcl_MakeFileChannel(void *handle, int mode);
/* 191 */
EXTERN Tcl_Channel Tcl_MakeTcpClientChannel(void *tcpSocket);
/* 192 */
-EXTERN char * Tcl_Merge(size_t argc, const char *const *argv);
+EXTERN char * Tcl_Merge(Tcl_Size argc, const char *const *argv);
/* 193 */
EXTERN Tcl_HashEntry * Tcl_NextHashEntry(Tcl_HashSearch *searchPtr);
/* 194 */
@@ -546,7 +549,7 @@ EXTERN Tcl_Obj * Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr,
int flags);
/* 197 */
EXTERN Tcl_Channel Tcl_OpenCommandChannel(Tcl_Interp *interp,
- size_t argc, const char **argv, int flags);
+ Tcl_Size argc, const char **argv, int flags);
/* 198 */
EXTERN Tcl_Channel Tcl_OpenFileChannel(Tcl_Interp *interp,
const char *fileName, const char *modeString,
@@ -554,7 +557,7 @@ EXTERN Tcl_Channel Tcl_OpenFileChannel(Tcl_Interp *interp,
/* 199 */
EXTERN Tcl_Channel Tcl_OpenTcpClient(Tcl_Interp *interp, int port,
const char *address, const char *myaddr,
- int myport, int async);
+ int myport, int flags);
/* 200 */
EXTERN Tcl_Channel Tcl_OpenTcpServer(Tcl_Interp *interp, int port,
const char *host,
@@ -572,8 +575,8 @@ EXTERN const char * Tcl_PosixError(Tcl_Interp *interp);
/* 205 */
EXTERN void Tcl_QueueEvent(Tcl_Event *evPtr, int position);
/* 206 */
-EXTERN size_t Tcl_Read(Tcl_Channel chan, char *bufPtr,
- size_t toRead);
+EXTERN Tcl_Size Tcl_Read(Tcl_Channel chan, char *bufPtr,
+ Tcl_Size toRead);
/* 207 */
EXTERN void Tcl_ReapDetachedProcs(void);
/* 208 */
@@ -597,17 +600,17 @@ EXTERN int Tcl_RegExpExec(Tcl_Interp *interp, Tcl_RegExp regexp,
EXTERN int Tcl_RegExpMatch(Tcl_Interp *interp, const char *text,
const char *pattern);
/* 215 */
-EXTERN void Tcl_RegExpRange(Tcl_RegExp regexp, size_t index,
+EXTERN void Tcl_RegExpRange(Tcl_RegExp regexp, Tcl_Size index,
const char **startPtr, const char **endPtr);
/* 216 */
EXTERN void Tcl_Release(void *clientData);
/* 217 */
EXTERN void Tcl_ResetResult(Tcl_Interp *interp);
/* 218 */
-EXTERN size_t Tcl_ScanElement(const char *src, int *flagPtr);
+EXTERN Tcl_Size Tcl_ScanElement(const char *src, int *flagPtr);
/* 219 */
-EXTERN size_t Tcl_ScanCountedElement(const char *src,
- size_t length, int *flagPtr);
+EXTERN Tcl_Size Tcl_ScanCountedElement(const char *src,
+ Tcl_Size length, int *flagPtr);
/* Slot 220 is reserved */
/* 221 */
EXTERN int Tcl_ServiceAll(void);
@@ -618,7 +621,8 @@ EXTERN void Tcl_SetAssocData(Tcl_Interp *interp,
const char *name, Tcl_InterpDeleteProc *proc,
void *clientData);
/* 224 */
-EXTERN void Tcl_SetChannelBufferSize(Tcl_Channel chan, size_t sz);
+EXTERN void Tcl_SetChannelBufferSize(Tcl_Channel chan,
+ Tcl_Size sz);
/* 225 */
EXTERN int Tcl_SetChannelOption(Tcl_Interp *interp,
Tcl_Channel chan, const char *optionName,
@@ -635,8 +639,8 @@ EXTERN void Tcl_SetErrorCode(Tcl_Interp *interp, ...);
EXTERN void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr);
/* Slot 230 is reserved */
/* 231 */
-EXTERN size_t Tcl_SetRecursionLimit(Tcl_Interp *interp,
- size_t depth);
+EXTERN Tcl_Size Tcl_SetRecursionLimit(Tcl_Interp *interp,
+ Tcl_Size depth);
/* Slot 232 is reserved */
/* 233 */
EXTERN int Tcl_SetServiceMode(int mode);
@@ -677,8 +681,8 @@ EXTERN int Tcl_TraceVar2(Tcl_Interp *interp, const char *part1,
EXTERN char * Tcl_TranslateFileName(Tcl_Interp *interp,
const char *name, Tcl_DString *bufferPtr);
/* 250 */
-EXTERN size_t Tcl_Ungets(Tcl_Channel chan, const char *str,
- size_t len, int atHead);
+EXTERN Tcl_Size Tcl_Ungets(Tcl_Channel chan, const char *str,
+ Tcl_Size len, int atHead);
/* 251 */
EXTERN void Tcl_UnlinkVar(Tcl_Interp *interp,
const char *varName);
@@ -712,10 +716,10 @@ EXTERN void * Tcl_VarTraceInfo2(Tcl_Interp *interp,
int flags, Tcl_VarTraceProc *procPtr,
void *prevClientData);
/* 263 */
-EXTERN size_t Tcl_Write(Tcl_Channel chan, const char *s,
- size_t slen);
+EXTERN Tcl_Size Tcl_Write(Tcl_Channel chan, const char *s,
+ Tcl_Size slen);
/* 264 */
-EXTERN void Tcl_WrongNumArgs(Tcl_Interp *interp, size_t objc,
+EXTERN void Tcl_WrongNumArgs(Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[], const char *message);
/* 265 */
EXTERN int Tcl_DumpActiveMemory(const char *fileName);
@@ -772,9 +776,9 @@ EXTERN void Tcl_DeleteThreadExitHandler(Tcl_ExitProc *proc,
/* Slot 290 is reserved */
/* 291 */
EXTERN int Tcl_EvalEx(Tcl_Interp *interp, const char *script,
- size_t numBytes, int flags);
+ Tcl_Size numBytes, int flags);
/* 292 */
-EXTERN int Tcl_EvalObjv(Tcl_Interp *interp, size_t objc,
+EXTERN int Tcl_EvalObjv(Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[], int flags);
/* 293 */
EXTERN int Tcl_EvalObjEx(Tcl_Interp *interp, Tcl_Obj *objPtr,
@@ -784,13 +788,13 @@ EXTERN TCL_NORETURN void Tcl_ExitThread(int status);
/* 295 */
EXTERN int Tcl_ExternalToUtf(Tcl_Interp *interp,
Tcl_Encoding encoding, const char *src,
- size_t srcLen, int flags,
+ Tcl_Size srcLen, int flags,
Tcl_EncodingState *statePtr, char *dst,
- size_t dstLen, int *srcReadPtr,
+ Tcl_Size dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
/* 296 */
EXTERN char * Tcl_ExternalToUtfDString(Tcl_Encoding encoding,
- const char *src, size_t srcLen,
+ const char *src, Tcl_Size srcLen,
Tcl_DString *dsPtr);
/* 297 */
EXTERN void Tcl_FinalizeThread(void);
@@ -809,11 +813,11 @@ EXTERN void Tcl_GetEncodingNames(Tcl_Interp *interp);
/* 304 */
EXTERN int Tcl_GetIndexFromObjStruct(Tcl_Interp *interp,
Tcl_Obj *objPtr, const void *tablePtr,
- size_t offset, const char *msg, int flags,
+ Tcl_Size offset, const char *msg, int flags,
void *indexPtr);
/* 305 */
EXTERN void * Tcl_GetThreadData(Tcl_ThreadDataKey *keyPtr,
- size_t size);
+ Tcl_Size size);
/* 306 */
EXTERN Tcl_Obj * Tcl_GetVar2Ex(Tcl_Interp *interp, const char *part1,
const char *part2, int flags);
@@ -829,10 +833,10 @@ EXTERN void Tcl_ConditionNotify(Tcl_Condition *condPtr);
EXTERN void Tcl_ConditionWait(Tcl_Condition *condPtr,
Tcl_Mutex *mutexPtr, const Tcl_Time *timePtr);
/* 312 */
-EXTERN size_t TclNumUtfChars(const char *src, size_t length);
+EXTERN Tcl_Size TclNumUtfChars(const char *src, Tcl_Size length);
/* 313 */
-EXTERN size_t Tcl_ReadChars(Tcl_Channel channel, Tcl_Obj *objPtr,
- size_t charsToRead, int appendFlag);
+EXTERN Tcl_Size Tcl_ReadChars(Tcl_Channel channel, Tcl_Obj *objPtr,
+ Tcl_Size charsToRead, int appendFlag);
/* Slot 314 is reserved */
/* Slot 315 is reserved */
/* 316 */
@@ -848,7 +852,7 @@ EXTERN void Tcl_ThreadAlert(Tcl_ThreadId threadId);
EXTERN void Tcl_ThreadQueueEvent(Tcl_ThreadId threadId,
Tcl_Event *evPtr, int position);
/* 320 */
-EXTERN int Tcl_UniCharAtIndex(const char *src, size_t index);
+EXTERN int Tcl_UniCharAtIndex(const char *src, Tcl_Size index);
/* 321 */
EXTERN int Tcl_UniCharToLower(int ch);
/* 322 */
@@ -858,11 +862,11 @@ EXTERN int Tcl_UniCharToUpper(int ch);
/* 324 */
EXTERN int Tcl_UniCharToUtf(int ch, char *buf);
/* 325 */
-EXTERN const char * TclUtfAtIndex(const char *src, size_t index);
+EXTERN const char * TclUtfAtIndex(const char *src, Tcl_Size index);
/* 326 */
-EXTERN int TclUtfCharComplete(const char *src, size_t length);
+EXTERN int TclUtfCharComplete(const char *src, Tcl_Size length);
/* 327 */
-EXTERN size_t Tcl_UtfBackslash(const char *src, int *readPtr,
+EXTERN Tcl_Size Tcl_UtfBackslash(const char *src, int *readPtr,
char *dst);
/* 328 */
EXTERN const char * Tcl_UtfFindFirst(const char *src, int ch);
@@ -875,13 +879,13 @@ EXTERN const char * TclUtfPrev(const char *src, const char *start);
/* 332 */
EXTERN int Tcl_UtfToExternal(Tcl_Interp *interp,
Tcl_Encoding encoding, const char *src,
- size_t srcLen, int flags,
+ Tcl_Size srcLen, int flags,
Tcl_EncodingState *statePtr, char *dst,
- size_t dstLen, int *srcReadPtr,
+ Tcl_Size dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
/* 333 */
EXTERN char * Tcl_UtfToExternalDString(Tcl_Encoding encoding,
- const char *src, size_t srcLen,
+ const char *src, Tcl_Size srcLen,
Tcl_DString *dsPtr);
/* 334 */
EXTERN int Tcl_UtfToLower(char *src);
@@ -893,10 +897,10 @@ EXTERN int Tcl_UtfToChar16(const char *src,
/* 337 */
EXTERN int Tcl_UtfToUpper(char *src);
/* 338 */
-EXTERN size_t Tcl_WriteChars(Tcl_Channel chan, const char *src,
- size_t srcLen);
+EXTERN Tcl_Size Tcl_WriteChars(Tcl_Channel chan, const char *src,
+ Tcl_Size srcLen);
/* 339 */
-EXTERN size_t Tcl_WriteObj(Tcl_Channel chan, Tcl_Obj *objPtr);
+EXTERN Tcl_Size Tcl_WriteObj(Tcl_Channel chan, Tcl_Obj *objPtr);
/* 340 */
EXTERN char * Tcl_GetString(Tcl_Obj *objPtr);
/* Slot 341 is reserved */
@@ -920,14 +924,14 @@ EXTERN int Tcl_UniCharIsUpper(int ch);
/* 351 */
EXTERN int Tcl_UniCharIsWordChar(int ch);
/* 352 */
-EXTERN size_t Tcl_Char16Len(const unsigned short *uniStr);
+EXTERN Tcl_Size Tcl_Char16Len(const unsigned short *uniStr);
/* Slot 353 is reserved */
/* 354 */
EXTERN char * Tcl_Char16ToUtfDString(const unsigned short *uniStr,
- size_t uniLength, Tcl_DString *dsPtr);
+ Tcl_Size uniLength, Tcl_DString *dsPtr);
/* 355 */
EXTERN unsigned short * Tcl_UtfToChar16DString(const char *src,
- size_t length, Tcl_DString *dsPtr);
+ Tcl_Size length, Tcl_DString *dsPtr);
/* 356 */
EXTERN Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp,
Tcl_Obj *patObj, int flags);
@@ -937,27 +941,27 @@ EXTERN void Tcl_FreeParse(Tcl_Parse *parsePtr);
/* 359 */
EXTERN void Tcl_LogCommandInfo(Tcl_Interp *interp,
const char *script, const char *command,
- size_t length);
+ Tcl_Size length);
/* 360 */
EXTERN int Tcl_ParseBraces(Tcl_Interp *interp,
- const char *start, size_t numBytes,
+ const char *start, Tcl_Size numBytes,
Tcl_Parse *parsePtr, int append,
const char **termPtr);
/* 361 */
EXTERN int Tcl_ParseCommand(Tcl_Interp *interp,
- const char *start, size_t numBytes,
+ const char *start, Tcl_Size numBytes,
int nested, Tcl_Parse *parsePtr);
/* 362 */
EXTERN int Tcl_ParseExpr(Tcl_Interp *interp, const char *start,
- size_t numBytes, Tcl_Parse *parsePtr);
+ Tcl_Size numBytes, Tcl_Parse *parsePtr);
/* 363 */
EXTERN int Tcl_ParseQuotedString(Tcl_Interp *interp,
- const char *start, size_t numBytes,
+ const char *start, Tcl_Size numBytes,
Tcl_Parse *parsePtr, int append,
const char **termPtr);
/* 364 */
EXTERN int Tcl_ParseVarName(Tcl_Interp *interp,
- const char *start, size_t numBytes,
+ const char *start, Tcl_Size numBytes,
Tcl_Parse *parsePtr, int append);
/* 365 */
EXTERN char * Tcl_GetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr);
@@ -986,27 +990,29 @@ EXTERN int Tcl_UniCharIsPunct(int ch);
/* 376 */
EXTERN int Tcl_RegExpExecObj(Tcl_Interp *interp,
Tcl_RegExp regexp, Tcl_Obj *textObj,
- size_t offset, size_t nmatches, int flags);
+ Tcl_Size offset, Tcl_Size nmatches,
+ int flags);
/* 377 */
EXTERN void Tcl_RegExpGetInfo(Tcl_RegExp regexp,
Tcl_RegExpInfo *infoPtr);
/* 378 */
EXTERN Tcl_Obj * Tcl_NewUnicodeObj(const Tcl_UniChar *unicode,
- size_t numChars);
+ Tcl_Size numChars);
/* 379 */
EXTERN void Tcl_SetUnicodeObj(Tcl_Obj *objPtr,
- const Tcl_UniChar *unicode, size_t numChars);
+ const Tcl_UniChar *unicode,
+ Tcl_Size numChars);
/* 380 */
-EXTERN size_t TclGetCharLength(Tcl_Obj *objPtr);
+EXTERN Tcl_Size TclGetCharLength(Tcl_Obj *objPtr);
/* 381 */
-EXTERN int TclGetUniChar(Tcl_Obj *objPtr, size_t index);
+EXTERN int TclGetUniChar(Tcl_Obj *objPtr, Tcl_Size index);
/* Slot 382 is reserved */
/* 383 */
-EXTERN Tcl_Obj * TclGetRange(Tcl_Obj *objPtr, size_t first,
- size_t last);
+EXTERN Tcl_Obj * TclGetRange(Tcl_Obj *objPtr, Tcl_Size first,
+ Tcl_Size last);
/* 384 */
EXTERN void Tcl_AppendUnicodeToObj(Tcl_Obj *objPtr,
- const Tcl_UniChar *unicode, size_t length);
+ const Tcl_UniChar *unicode, Tcl_Size length);
/* 385 */
EXTERN int Tcl_RegExpMatchObj(Tcl_Interp *interp,
Tcl_Obj *textObj, Tcl_Obj *patternObj);
@@ -1022,7 +1028,7 @@ EXTERN int Tcl_GetChannelNamesEx(Tcl_Interp *interp,
const char *pattern);
/* 390 */
EXTERN int Tcl_ProcObjCmd(void *clientData, Tcl_Interp *interp,
- size_t objc, Tcl_Obj *const objv[]);
+ Tcl_Size objc, Tcl_Obj *const objv[]);
/* 391 */
EXTERN void Tcl_ConditionFinalize(Tcl_Condition *condPtr);
/* 392 */
@@ -1030,13 +1036,13 @@ EXTERN void Tcl_MutexFinalize(Tcl_Mutex *mutex);
/* 393 */
EXTERN int Tcl_CreateThread(Tcl_ThreadId *idPtr,
Tcl_ThreadCreateProc *proc, void *clientData,
- size_t stackSize, int flags);
+ Tcl_Size stackSize, int flags);
/* 394 */
-EXTERN size_t Tcl_ReadRaw(Tcl_Channel chan, char *dst,
- size_t bytesToRead);
+EXTERN Tcl_Size Tcl_ReadRaw(Tcl_Channel chan, char *dst,
+ Tcl_Size bytesToRead);
/* 395 */
-EXTERN size_t Tcl_WriteRaw(Tcl_Channel chan, const char *src,
- size_t srcLen);
+EXTERN Tcl_Size Tcl_WriteRaw(Tcl_Channel chan, const char *src,
+ Tcl_Size srcLen);
/* 396 */
EXTERN Tcl_Channel Tcl_GetTopChannel(Tcl_Channel chan);
/* 397 */
@@ -1127,7 +1133,7 @@ EXTERN void * Tcl_AttemptDbCkrealloc(void *ptr, TCL_HASH_TYPE size,
const char *file, int line);
/* 432 */
EXTERN int Tcl_AttemptSetObjLength(Tcl_Obj *objPtr,
- size_t length);
+ Tcl_Size length);
/* 433 */
EXTERN Tcl_ThreadId Tcl_GetChannelThread(Tcl_Channel channel);
/* 434 */
@@ -1201,7 +1207,7 @@ EXTERN int Tcl_FSChdir(Tcl_Obj *pathPtr);
EXTERN int Tcl_FSConvertToPathType(Tcl_Interp *interp,
Tcl_Obj *pathPtr);
/* 460 */
-EXTERN Tcl_Obj * Tcl_FSJoinPath(Tcl_Obj *listObj, size_t elements);
+EXTERN Tcl_Obj * Tcl_FSJoinPath(Tcl_Obj *listObj, Tcl_Size elements);
/* 461 */
EXTERN Tcl_Obj * TclFSSplitPath(Tcl_Obj *pathPtr, int *lenPtr);
/* 462 */
@@ -1211,7 +1217,7 @@ EXTERN int Tcl_FSEqualPaths(Tcl_Obj *firstPtr,
EXTERN Tcl_Obj * Tcl_FSGetNormalizedPath(Tcl_Interp *interp,
Tcl_Obj *pathPtr);
/* 464 */
-EXTERN Tcl_Obj * Tcl_FSJoinToPath(Tcl_Obj *pathPtr, size_t objc,
+EXTERN Tcl_Obj * Tcl_FSJoinToPath(Tcl_Obj *pathPtr, Tcl_Size objc,
Tcl_Obj *const objv[]);
/* 465 */
EXTERN void * Tcl_FSGetInternalRep(Tcl_Obj *pathPtr,
@@ -1253,12 +1259,13 @@ EXTERN int Tcl_OutputBuffered(Tcl_Channel chan);
EXTERN void Tcl_FSMountsChanged(const Tcl_Filesystem *fsPtr);
/* 481 */
EXTERN int Tcl_EvalTokensStandard(Tcl_Interp *interp,
- Tcl_Token *tokenPtr, size_t count);
+ Tcl_Token *tokenPtr, Tcl_Size count);
/* 482 */
EXTERN void Tcl_GetTime(Tcl_Time *timeBuf);
/* 483 */
-EXTERN Tcl_Trace Tcl_CreateObjTrace(Tcl_Interp *interp, int level,
- int flags, Tcl_CmdObjTraceProc *objProc,
+EXTERN Tcl_Trace Tcl_CreateObjTrace(Tcl_Interp *interp,
+ Tcl_Size level, int flags,
+ Tcl_CmdObjTraceProc *objProc,
void *clientData,
Tcl_CmdObjTraceDeleteProc *delProc);
/* 484 */
@@ -1313,11 +1320,11 @@ EXTERN void Tcl_DictObjNext(Tcl_DictSearch *searchPtr,
EXTERN void Tcl_DictObjDone(Tcl_DictSearch *searchPtr);
/* 501 */
EXTERN int Tcl_DictObjPutKeyList(Tcl_Interp *interp,
- Tcl_Obj *dictPtr, size_t keyc,
+ Tcl_Obj *dictPtr, Tcl_Size keyc,
Tcl_Obj *const *keyv, Tcl_Obj *valuePtr);
/* 502 */
EXTERN int Tcl_DictObjRemoveKeyList(Tcl_Interp *interp,
- Tcl_Obj *dictPtr, size_t keyc,
+ Tcl_Obj *dictPtr, Tcl_Size keyc,
Tcl_Obj *const *keyv);
/* 503 */
EXTERN Tcl_Obj * Tcl_NewDictObj(void);
@@ -1384,7 +1391,7 @@ EXTERN int Tcl_LimitCheck(Tcl_Interp *interp);
EXTERN int Tcl_LimitExceeded(Tcl_Interp *interp);
/* 525 */
EXTERN void Tcl_LimitSetCommands(Tcl_Interp *interp,
- size_t commandLimit);
+ Tcl_Size commandLimit);
/* 526 */
EXTERN void Tcl_LimitSetTime(Tcl_Interp *interp,
Tcl_Time *timeLimitPtr);
@@ -1516,22 +1523,22 @@ EXTERN const char * Tcl_GetEncodingNameFromEnvironment(
Tcl_DString *bufPtr);
/* 573 */
EXTERN int Tcl_PkgRequireProc(Tcl_Interp *interp,
- const char *name, size_t objc,
+ const char *name, Tcl_Size objc,
Tcl_Obj *const objv[], void *clientDataPtr);
/* 574 */
EXTERN void Tcl_AppendObjToErrorInfo(Tcl_Interp *interp,
Tcl_Obj *objPtr);
/* 575 */
EXTERN void Tcl_AppendLimitedToObj(Tcl_Obj *objPtr,
- const char *bytes, size_t length,
- size_t limit, const char *ellipsis);
+ const char *bytes, Tcl_Size length,
+ Tcl_Size limit, const char *ellipsis);
/* 576 */
EXTERN Tcl_Obj * Tcl_Format(Tcl_Interp *interp, const char *format,
- size_t objc, Tcl_Obj *const objv[]);
+ Tcl_Size objc, Tcl_Obj *const objv[]);
/* 577 */
EXTERN int Tcl_AppendFormatToObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, const char *format,
- size_t objc, Tcl_Obj *const objv[]);
+ Tcl_Size objc, Tcl_Obj *const objv[]);
/* 578 */
EXTERN Tcl_Obj * Tcl_ObjPrintf(const char *format, ...) TCL_FORMAT_PRINTF(1, 2);
/* 579 */
@@ -1556,11 +1563,11 @@ EXTERN Tcl_Command Tcl_NRCreateCommand(Tcl_Interp *interp,
EXTERN int Tcl_NREvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
int flags);
/* 585 */
-EXTERN int Tcl_NREvalObjv(Tcl_Interp *interp, size_t objc,
+EXTERN int Tcl_NREvalObjv(Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[], int flags);
/* 586 */
EXTERN int Tcl_NRCmdSwap(Tcl_Interp *interp, Tcl_Command cmd,
- size_t objc, Tcl_Obj *const objv[],
+ Tcl_Size objc, Tcl_Obj *const objv[],
int flags);
/* 587 */
EXTERN void Tcl_NRAddCallback(Tcl_Interp *interp,
@@ -1569,7 +1576,7 @@ EXTERN void Tcl_NRAddCallback(Tcl_Interp *interp,
/* 588 */
EXTERN int Tcl_NRCallObjProc(Tcl_Interp *interp,
Tcl_ObjCmdProc *objProc, void *clientData,
- size_t objc, Tcl_Obj *const objv[]);
+ Tcl_Size objc, Tcl_Obj *const objv[]);
/* 589 */
EXTERN unsigned Tcl_GetFSDeviceFromStat(const Tcl_StatBuf *statPtr);
/* 590 */
@@ -1624,14 +1631,14 @@ EXTERN int Tcl_ZlibDeflate(Tcl_Interp *interp, int format,
Tcl_Obj *gzipHeaderDictObj);
/* 611 */
EXTERN int Tcl_ZlibInflate(Tcl_Interp *interp, int format,
- Tcl_Obj *data, size_t buffersize,
+ Tcl_Obj *data, Tcl_Size buffersize,
Tcl_Obj *gzipHeaderDictObj);
/* 612 */
EXTERN unsigned int Tcl_ZlibCRC32(unsigned int crc,
- const unsigned char *buf, size_t len);
+ const unsigned char *buf, Tcl_Size len);
/* 613 */
EXTERN unsigned int Tcl_ZlibAdler32(unsigned int adler,
- const unsigned char *buf, size_t len);
+ const unsigned char *buf, Tcl_Size len);
/* 614 */
EXTERN int Tcl_ZlibStreamInit(Tcl_Interp *interp, int mode,
int format, int level, Tcl_Obj *dictObj,
@@ -1647,7 +1654,7 @@ EXTERN int Tcl_ZlibStreamPut(Tcl_ZlibStream zshandle,
Tcl_Obj *data, int flush);
/* 619 */
EXTERN int Tcl_ZlibStreamGet(Tcl_ZlibStream zshandle,
- Tcl_Obj *data, size_t count);
+ Tcl_Obj *data, Tcl_Size count);
/* 620 */
EXTERN int Tcl_ZlibStreamClose(Tcl_ZlibStream zshandle);
/* 621 */
@@ -1683,7 +1690,7 @@ EXTERN void Tcl_ZlibStreamSetCompressionDictionary(
/* 631 */
EXTERN Tcl_Channel Tcl_OpenTcpServerEx(Tcl_Interp *interp,
const char *service, const char *host,
- unsigned int flags,
+ unsigned int flags, int backlog,
Tcl_TcpAcceptProc *acceptProc,
void *callbackData);
/* 632 */
@@ -1722,19 +1729,19 @@ EXTERN int Tcl_IsShared(Tcl_Obj *objPtr);
/* 644 */
EXTERN int Tcl_LinkArray(Tcl_Interp *interp,
const char *varName, void *addr, int type,
- size_t size);
+ Tcl_Size size);
/* 645 */
EXTERN int Tcl_GetIntForIndex(Tcl_Interp *interp,
- Tcl_Obj *objPtr, size_t endValue,
- size_t *indexPtr);
+ Tcl_Obj *objPtr, Tcl_Size endValue,
+ Tcl_Size *indexPtr);
/* 646 */
EXTERN int Tcl_UtfToUniChar(const char *src, int *chPtr);
/* 647 */
EXTERN char * Tcl_UniCharToUtfDString(const int *uniStr,
- size_t uniLength, Tcl_DString *dsPtr);
+ Tcl_Size uniLength, Tcl_DString *dsPtr);
/* 648 */
EXTERN int * Tcl_UtfToUniCharDString(const char *src,
- size_t length, Tcl_DString *dsPtr);
+ Tcl_Size length, Tcl_DString *dsPtr);
/* 649 */
EXTERN unsigned char * TclGetBytesFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, int *numBytesPtr);
@@ -1751,7 +1758,7 @@ EXTERN Tcl_UniChar * Tcl_GetUnicodeFromObj(Tcl_Obj *objPtr,
EXTERN unsigned char * Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr,
size_t *numBytesPtr);
/* 654 */
-EXTERN int Tcl_UtfCharComplete(const char *src, size_t length);
+EXTERN int Tcl_UtfCharComplete(const char *src, Tcl_Size length);
/* 655 */
EXTERN const char * Tcl_UtfNext(const char *src);
/* 656 */
@@ -1759,12 +1766,12 @@ EXTERN const char * Tcl_UtfPrev(const char *src, const char *start);
/* 657 */
EXTERN int Tcl_UniCharIsUnicode(int ch);
/* 658 */
-EXTERN size_t Tcl_ExternalToUtfDStringEx(Tcl_Encoding encoding,
- const char *src, size_t srcLen, int flags,
+EXTERN Tcl_Size Tcl_ExternalToUtfDStringEx(Tcl_Encoding encoding,
+ const char *src, Tcl_Size srcLen, int flags,
Tcl_DString *dsPtr);
/* 659 */
-EXTERN size_t Tcl_UtfToExternalDStringEx(Tcl_Encoding encoding,
- const char *src, size_t srcLen, int flags,
+EXTERN Tcl_Size Tcl_UtfToExternalDStringEx(Tcl_Encoding encoding,
+ const char *src, Tcl_Size srcLen, int flags,
Tcl_DString *dsPtr);
/* 660 */
EXTERN int Tcl_AsyncMarkFromSignal(Tcl_AsyncHandler async,
@@ -1794,18 +1801,18 @@ EXTERN int Tcl_ParseArgsObjv(Tcl_Interp *interp,
size_t *objcPtr, Tcl_Obj *const *objv,
Tcl_Obj ***remObjv);
/* 668 */
-EXTERN size_t Tcl_UniCharLen(const int *uniStr);
+EXTERN Tcl_Size Tcl_UniCharLen(const int *uniStr);
/* 669 */
-EXTERN size_t Tcl_NumUtfChars(const char *src, size_t length);
+EXTERN Tcl_Size Tcl_NumUtfChars(const char *src, Tcl_Size length);
/* 670 */
-EXTERN size_t Tcl_GetCharLength(Tcl_Obj *objPtr);
+EXTERN Tcl_Size Tcl_GetCharLength(Tcl_Obj *objPtr);
/* 671 */
-EXTERN const char * Tcl_UtfAtIndex(const char *src, size_t index);
+EXTERN const char * Tcl_UtfAtIndex(const char *src, Tcl_Size index);
/* 672 */
-EXTERN Tcl_Obj * Tcl_GetRange(Tcl_Obj *objPtr, size_t first,
- size_t last);
+EXTERN Tcl_Obj * Tcl_GetRange(Tcl_Obj *objPtr, Tcl_Size first,
+ Tcl_Size last);
/* 673 */
-EXTERN int Tcl_GetUniChar(Tcl_Obj *objPtr, size_t index);
+EXTERN int Tcl_GetUniChar(Tcl_Obj *objPtr, Tcl_Size index);
/* 674 */
EXTERN int Tcl_GetBool(Tcl_Interp *interp, const char *src,
int flags, char *charPtr);
@@ -1818,8 +1825,9 @@ EXTERN Tcl_Command Tcl_CreateObjCommand2(Tcl_Interp *interp,
void *clientData,
Tcl_CmdDeleteProc *deleteProc);
/* 677 */
-EXTERN Tcl_Trace Tcl_CreateObjTrace2(Tcl_Interp *interp, int level,
- int flags, Tcl_CmdObjTraceProc2 *objProc2,
+EXTERN Tcl_Trace Tcl_CreateObjTrace2(Tcl_Interp *interp,
+ Tcl_Size level, int flags,
+ Tcl_CmdObjTraceProc2 *objProc2,
void *clientData,
Tcl_CmdObjTraceDeleteProc *delProc);
/* 678 */
@@ -1842,6 +1850,8 @@ EXTERN int Tcl_GetNumber(Tcl_Interp *interp, const char *bytes,
/* 682 */
EXTERN int Tcl_RemoveChannelMode(Tcl_Interp *interp,
Tcl_Channel chan, int mode);
+/* 683 */
+EXTERN int Tcl_GetEncodingNulLength(Tcl_Encoding encoding);
typedef struct {
const struct TclPlatStubs *tclPlatStubs;
@@ -1869,19 +1879,19 @@ typedef struct TclStubs {
int (*tcl_WaitForEvent) (const Tcl_Time *timePtr); /* 13 */
int (*tcl_AppendAllObjTypes) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 14 */
void (*tcl_AppendStringsToObj) (Tcl_Obj *objPtr, ...); /* 15 */
- void (*tcl_AppendToObj) (Tcl_Obj *objPtr, const char *bytes, size_t length); /* 16 */
- Tcl_Obj * (*tcl_ConcatObj) (size_t objc, Tcl_Obj *const objv[]); /* 17 */
+ void (*tcl_AppendToObj) (Tcl_Obj *objPtr, const char *bytes, Tcl_Size length); /* 16 */
+ Tcl_Obj * (*tcl_ConcatObj) (Tcl_Size objc, Tcl_Obj *const objv[]); /* 17 */
int (*tcl_ConvertToType) (Tcl_Interp *interp, Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 18 */
void (*tcl_DbDecrRefCount) (Tcl_Obj *objPtr, const char *file, int line); /* 19 */
void (*tcl_DbIncrRefCount) (Tcl_Obj *objPtr, const char *file, int line); /* 20 */
int (*tcl_DbIsShared) (Tcl_Obj *objPtr, const char *file, int line); /* 21 */
void (*reserved22)(void);
- Tcl_Obj * (*tcl_DbNewByteArrayObj) (const unsigned char *bytes, size_t numBytes, const char *file, int line); /* 23 */
+ Tcl_Obj * (*tcl_DbNewByteArrayObj) (const unsigned char *bytes, Tcl_Size numBytes, const char *file, int line); /* 23 */
Tcl_Obj * (*tcl_DbNewDoubleObj) (double doubleValue, const char *file, int line); /* 24 */
- Tcl_Obj * (*tcl_DbNewListObj) (size_t objc, Tcl_Obj *const *objv, const char *file, int line); /* 25 */
+ Tcl_Obj * (*tcl_DbNewListObj) (Tcl_Size objc, Tcl_Obj *const *objv, const char *file, int line); /* 25 */
void (*reserved26)(void);
Tcl_Obj * (*tcl_DbNewObj) (const char *file, int line); /* 27 */
- Tcl_Obj * (*tcl_DbNewStringObj) (const char *bytes, size_t length, const char *file, int line); /* 28 */
+ Tcl_Obj * (*tcl_DbNewStringObj) (const char *bytes, Tcl_Size length, const char *file, int line); /* 28 */
Tcl_Obj * (*tcl_DuplicateObj) (Tcl_Obj *objPtr); /* 29 */
void (*tclFreeObj) (Tcl_Obj *objPtr); /* 30 */
int (*tcl_GetBoolean) (Tcl_Interp *interp, const char *src, int *intPtr); /* 31 */
@@ -1899,26 +1909,26 @@ typedef struct TclStubs {
int (*tcl_ListObjAppendList) (Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *elemListPtr); /* 43 */
int (*tcl_ListObjAppendElement) (Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *objPtr); /* 44 */
int (*tclListObjGetElements) (Tcl_Interp *interp, Tcl_Obj *listPtr, int *objcPtr, Tcl_Obj ***objvPtr); /* 45 */
- int (*tcl_ListObjIndex) (Tcl_Interp *interp, Tcl_Obj *listPtr, size_t index, Tcl_Obj **objPtrPtr); /* 46 */
+ int (*tcl_ListObjIndex) (Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Size index, Tcl_Obj **objPtrPtr); /* 46 */
int (*tclListObjLength) (Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr); /* 47 */
- int (*tcl_ListObjReplace) (Tcl_Interp *interp, Tcl_Obj *listPtr, size_t first, size_t count, size_t objc, Tcl_Obj *const objv[]); /* 48 */
+ int (*tcl_ListObjReplace) (Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Size first, Tcl_Size count, Tcl_Size objc, Tcl_Obj *const objv[]); /* 48 */
void (*reserved49)(void);
- Tcl_Obj * (*tcl_NewByteArrayObj) (const unsigned char *bytes, size_t numBytes); /* 50 */
+ Tcl_Obj * (*tcl_NewByteArrayObj) (const unsigned char *bytes, Tcl_Size numBytes); /* 50 */
Tcl_Obj * (*tcl_NewDoubleObj) (double doubleValue); /* 51 */
void (*reserved52)(void);
- Tcl_Obj * (*tcl_NewListObj) (size_t objc, Tcl_Obj *const objv[]); /* 53 */
+ Tcl_Obj * (*tcl_NewListObj) (Tcl_Size objc, Tcl_Obj *const objv[]); /* 53 */
void (*reserved54)(void);
Tcl_Obj * (*tcl_NewObj) (void); /* 55 */
- Tcl_Obj * (*tcl_NewStringObj) (const char *bytes, size_t length); /* 56 */
+ Tcl_Obj * (*tcl_NewStringObj) (const char *bytes, Tcl_Size length); /* 56 */
void (*reserved57)(void);
- unsigned char * (*tcl_SetByteArrayLength) (Tcl_Obj *objPtr, size_t numBytes); /* 58 */
- void (*tcl_SetByteArrayObj) (Tcl_Obj *objPtr, const unsigned char *bytes, size_t numBytes); /* 59 */
+ unsigned char * (*tcl_SetByteArrayLength) (Tcl_Obj *objPtr, Tcl_Size numBytes); /* 58 */
+ void (*tcl_SetByteArrayObj) (Tcl_Obj *objPtr, const unsigned char *bytes, Tcl_Size numBytes); /* 59 */
void (*tcl_SetDoubleObj) (Tcl_Obj *objPtr, double doubleValue); /* 60 */
void (*reserved61)(void);
- void (*tcl_SetListObj) (Tcl_Obj *objPtr, size_t objc, Tcl_Obj *const objv[]); /* 62 */
+ void (*tcl_SetListObj) (Tcl_Obj *objPtr, Tcl_Size objc, Tcl_Obj *const objv[]); /* 62 */
void (*reserved63)(void);
- void (*tcl_SetObjLength) (Tcl_Obj *objPtr, size_t length); /* 64 */
- void (*tcl_SetStringObj) (Tcl_Obj *objPtr, const char *bytes, size_t length); /* 65 */
+ void (*tcl_SetObjLength) (Tcl_Obj *objPtr, Tcl_Size length); /* 64 */
+ void (*tcl_SetStringObj) (Tcl_Obj *objPtr, const char *bytes, Tcl_Size length); /* 65 */
void (*reserved66)(void);
void (*reserved67)(void);
void (*tcl_AllowExceptions) (Tcl_Interp *interp); /* 68 */
@@ -1936,11 +1946,11 @@ typedef struct TclStubs {
void (*tcl_CancelIdleCall) (Tcl_IdleProc *idleProc, void *clientData); /* 80 */
int (*tcl_Close) (Tcl_Interp *interp, Tcl_Channel chan); /* 81 */
int (*tcl_CommandComplete) (const char *cmd); /* 82 */
- char * (*tcl_Concat) (size_t argc, const char *const *argv); /* 83 */
- size_t (*tcl_ConvertElement) (const char *src, char *dst, int flags); /* 84 */
- size_t (*tcl_ConvertCountedElement) (const char *src, size_t length, char *dst, int flags); /* 85 */
- int (*tcl_CreateAlias) (Tcl_Interp *childInterp, const char *childCmd, Tcl_Interp *target, const char *targetCmd, size_t argc, const char *const *argv); /* 86 */
- int (*tcl_CreateAliasObj) (Tcl_Interp *childInterp, const char *childCmd, Tcl_Interp *target, const char *targetCmd, size_t objc, Tcl_Obj *const objv[]); /* 87 */
+ char * (*tcl_Concat) (Tcl_Size argc, const char *const *argv); /* 83 */
+ Tcl_Size (*tcl_ConvertElement) (const char *src, char *dst, int flags); /* 84 */
+ Tcl_Size (*tcl_ConvertCountedElement) (const char *src, Tcl_Size length, char *dst, int flags); /* 85 */
+ int (*tcl_CreateAlias) (Tcl_Interp *childInterp, const char *childCmd, Tcl_Interp *target, const char *targetCmd, Tcl_Size argc, const char *const *argv); /* 86 */
+ int (*tcl_CreateAliasObj) (Tcl_Interp *childInterp, const char *childCmd, Tcl_Interp *target, const char *targetCmd, Tcl_Size objc, Tcl_Obj *const objv[]); /* 87 */
Tcl_Channel (*tcl_CreateChannel) (const Tcl_ChannelType *typePtr, const char *chanName, void *instanceData, int mask); /* 88 */
void (*tcl_CreateChannelHandler) (Tcl_Channel chan, int mask, Tcl_ChannelProc *proc, void *clientData); /* 89 */
void (*tcl_CreateCloseHandler) (Tcl_Channel chan, Tcl_CloseProc *proc, void *clientData); /* 90 */
@@ -1952,7 +1962,7 @@ typedef struct TclStubs {
Tcl_Command (*tcl_CreateObjCommand) (Tcl_Interp *interp, const char *cmdName, Tcl_ObjCmdProc *proc, void *clientData, Tcl_CmdDeleteProc *deleteProc); /* 96 */
Tcl_Interp * (*tcl_CreateChild) (Tcl_Interp *interp, const char *name, int isSafe); /* 97 */
Tcl_TimerToken (*tcl_CreateTimerHandler) (int milliseconds, Tcl_TimerProc *proc, void *clientData); /* 98 */
- Tcl_Trace (*tcl_CreateTrace) (Tcl_Interp *interp, int level, Tcl_CmdTraceProc *proc, void *clientData); /* 99 */
+ Tcl_Trace (*tcl_CreateTrace) (Tcl_Interp *interp, Tcl_Size level, Tcl_CmdTraceProc *proc, void *clientData); /* 99 */
void (*tcl_DeleteAssocData) (Tcl_Interp *interp, const char *name); /* 100 */
void (*tcl_DeleteChannelHandler) (Tcl_Channel chan, Tcl_ChannelProc *proc, void *clientData); /* 101 */
void (*tcl_DeleteCloseHandler) (Tcl_Channel chan, Tcl_CloseProc *proc, void *clientData); /* 102 */
@@ -1964,20 +1974,20 @@ typedef struct TclStubs {
void (*tcl_DeleteHashEntry) (Tcl_HashEntry *entryPtr); /* 108 */
void (*tcl_DeleteHashTable) (Tcl_HashTable *tablePtr); /* 109 */
void (*tcl_DeleteInterp) (Tcl_Interp *interp); /* 110 */
- void (*tcl_DetachPids) (size_t numPids, Tcl_Pid *pidPtr); /* 111 */
+ void (*tcl_DetachPids) (Tcl_Size numPids, Tcl_Pid *pidPtr); /* 111 */
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, void *clientData); /* 114 */
int (*tcl_DoOneEvent) (int flags); /* 115 */
void (*tcl_DoWhenIdle) (Tcl_IdleProc *proc, void *clientData); /* 116 */
- char * (*tcl_DStringAppend) (Tcl_DString *dsPtr, const char *bytes, size_t length); /* 117 */
+ char * (*tcl_DStringAppend) (Tcl_DString *dsPtr, const char *bytes, Tcl_Size length); /* 117 */
char * (*tcl_DStringAppendElement) (Tcl_DString *dsPtr, const char *element); /* 118 */
void (*tcl_DStringEndSublist) (Tcl_DString *dsPtr); /* 119 */
void (*tcl_DStringFree) (Tcl_DString *dsPtr); /* 120 */
void (*tcl_DStringGetResult) (Tcl_Interp *interp, Tcl_DString *dsPtr); /* 121 */
void (*tcl_DStringInit) (Tcl_DString *dsPtr); /* 122 */
void (*tcl_DStringResult) (Tcl_Interp *interp, Tcl_DString *dsPtr); /* 123 */
- void (*tcl_DStringSetLength) (Tcl_DString *dsPtr, size_t length); /* 124 */
+ void (*tcl_DStringSetLength) (Tcl_DString *dsPtr, Tcl_Size length); /* 124 */
void (*tcl_DStringStartSublist) (Tcl_DString *dsPtr); /* 125 */
int (*tcl_Eof) (Tcl_Channel chan); /* 126 */
const char * (*tcl_ErrnoId) (void); /* 127 */
@@ -2005,7 +2015,7 @@ typedef struct TclStubs {
int (*tcl_GetAliasObj) (Tcl_Interp *interp, const char *childCmd, Tcl_Interp **targetInterpPtr, const char **targetCmdPtr, int *objcPtr, Tcl_Obj ***objv); /* 149 */
void * (*tcl_GetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc **procPtr); /* 150 */
Tcl_Channel (*tcl_GetChannel) (Tcl_Interp *interp, const char *chanName, int *modePtr); /* 151 */
- size_t (*tcl_GetChannelBufferSize) (Tcl_Channel chan); /* 152 */
+ Tcl_Size (*tcl_GetChannelBufferSize) (Tcl_Channel chan); /* 152 */
int (*tcl_GetChannelHandle) (Tcl_Channel chan, int direction, void **handlePtr); /* 153 */
void * (*tcl_GetChannelInstanceData) (Tcl_Channel chan); /* 154 */
int (*tcl_GetChannelMode) (Tcl_Channel chan); /* 155 */
@@ -2022,8 +2032,8 @@ typedef struct TclStubs {
Tcl_Obj * (*tcl_GetObjResult) (Tcl_Interp *interp); /* 166 */
int (*tcl_GetOpenFile) (Tcl_Interp *interp, const char *chanID, int forWriting, int checkUsage, void **filePtr); /* 167 */
Tcl_PathType (*tcl_GetPathType) (const char *path); /* 168 */
- size_t (*tcl_Gets) (Tcl_Channel chan, Tcl_DString *dsPtr); /* 169 */
- size_t (*tcl_GetsObj) (Tcl_Channel chan, Tcl_Obj *objPtr); /* 170 */
+ Tcl_Size (*tcl_Gets) (Tcl_Channel chan, Tcl_DString *dsPtr); /* 169 */
+ Tcl_Size (*tcl_GetsObj) (Tcl_Channel chan, Tcl_Obj *objPtr); /* 170 */
int (*tcl_GetServiceMode) (void); /* 171 */
Tcl_Interp * (*tcl_GetChild) (Tcl_Interp *interp, const char *name); /* 172 */
Tcl_Channel (*tcl_GetStdChannel) (int type); /* 173 */
@@ -2039,27 +2049,27 @@ typedef struct TclStubs {
int (*tcl_InputBuffered) (Tcl_Channel chan); /* 183 */
int (*tcl_InterpDeleted) (Tcl_Interp *interp); /* 184 */
int (*tcl_IsSafe) (Tcl_Interp *interp); /* 185 */
- char * (*tcl_JoinPath) (size_t argc, const char *const *argv, Tcl_DString *resultPtr); /* 186 */
+ char * (*tcl_JoinPath) (Tcl_Size argc, const char *const *argv, Tcl_DString *resultPtr); /* 186 */
int (*tcl_LinkVar) (Tcl_Interp *interp, const char *varName, void *addr, int type); /* 187 */
void (*reserved188)(void);
Tcl_Channel (*tcl_MakeFileChannel) (void *handle, int mode); /* 189 */
void (*reserved190)(void);
Tcl_Channel (*tcl_MakeTcpClientChannel) (void *tcpSocket); /* 191 */
- char * (*tcl_Merge) (size_t argc, const char *const *argv); /* 192 */
+ char * (*tcl_Merge) (Tcl_Size argc, const char *const *argv); /* 192 */
Tcl_HashEntry * (*tcl_NextHashEntry) (Tcl_HashSearch *searchPtr); /* 193 */
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 */
- Tcl_Channel (*tcl_OpenCommandChannel) (Tcl_Interp *interp, size_t argc, const char **argv, int flags); /* 197 */
+ Tcl_Channel (*tcl_OpenCommandChannel) (Tcl_Interp *interp, Tcl_Size argc, const char **argv, int flags); /* 197 */
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_OpenTcpClient) (Tcl_Interp *interp, int port, const char *address, const char *myaddr, int myport, int flags); /* 199 */
Tcl_Channel (*tcl_OpenTcpServer) (Tcl_Interp *interp, int port, const char *host, Tcl_TcpAcceptProc *acceptProc, void *callbackData); /* 200 */
void (*tcl_Preserve) (void *data); /* 201 */
void (*tcl_PrintDouble) (Tcl_Interp *interp, double value, char *dst); /* 202 */
int (*tcl_PutEnv) (const char *assignment); /* 203 */
const char * (*tcl_PosixError) (Tcl_Interp *interp); /* 204 */
void (*tcl_QueueEvent) (Tcl_Event *evPtr, int position); /* 205 */
- size_t (*tcl_Read) (Tcl_Channel chan, char *bufPtr, size_t toRead); /* 206 */
+ Tcl_Size (*tcl_Read) (Tcl_Channel chan, char *bufPtr, Tcl_Size toRead); /* 206 */
void (*tcl_ReapDetachedProcs) (void); /* 207 */
int (*tcl_RecordAndEval) (Tcl_Interp *interp, const char *cmd, int flags); /* 208 */
int (*tcl_RecordAndEvalObj) (Tcl_Interp *interp, Tcl_Obj *cmdPtr, int flags); /* 209 */
@@ -2068,23 +2078,23 @@ typedef struct TclStubs {
Tcl_RegExp (*tcl_RegExpCompile) (Tcl_Interp *interp, const char *pattern); /* 212 */
int (*tcl_RegExpExec) (Tcl_Interp *interp, Tcl_RegExp regexp, const char *text, const char *start); /* 213 */
int (*tcl_RegExpMatch) (Tcl_Interp *interp, const char *text, const char *pattern); /* 214 */
- void (*tcl_RegExpRange) (Tcl_RegExp regexp, size_t index, const char **startPtr, const char **endPtr); /* 215 */
+ void (*tcl_RegExpRange) (Tcl_RegExp regexp, Tcl_Size index, const char **startPtr, const char **endPtr); /* 215 */
void (*tcl_Release) (void *clientData); /* 216 */
void (*tcl_ResetResult) (Tcl_Interp *interp); /* 217 */
- size_t (*tcl_ScanElement) (const char *src, int *flagPtr); /* 218 */
- size_t (*tcl_ScanCountedElement) (const char *src, size_t length, int *flagPtr); /* 219 */
+ Tcl_Size (*tcl_ScanElement) (const char *src, int *flagPtr); /* 218 */
+ Tcl_Size (*tcl_ScanCountedElement) (const char *src, Tcl_Size length, int *flagPtr); /* 219 */
void (*reserved220)(void);
int (*tcl_ServiceAll) (void); /* 221 */
int (*tcl_ServiceEvent) (int flags); /* 222 */
void (*tcl_SetAssocData) (Tcl_Interp *interp, const char *name, Tcl_InterpDeleteProc *proc, void *clientData); /* 223 */
- void (*tcl_SetChannelBufferSize) (Tcl_Channel chan, size_t sz); /* 224 */
+ void (*tcl_SetChannelBufferSize) (Tcl_Channel chan, Tcl_Size sz); /* 224 */
int (*tcl_SetChannelOption) (Tcl_Interp *interp, Tcl_Channel chan, const char *optionName, const char *newValue); /* 225 */
int (*tcl_SetCommandInfo) (Tcl_Interp *interp, const char *cmdName, const Tcl_CmdInfo *infoPtr); /* 226 */
void (*tcl_SetErrno) (int err); /* 227 */
void (*tcl_SetErrorCode) (Tcl_Interp *interp, ...); /* 228 */
void (*tcl_SetMaxBlockTime) (const Tcl_Time *timePtr); /* 229 */
void (*reserved230)(void);
- size_t (*tcl_SetRecursionLimit) (Tcl_Interp *interp, size_t depth); /* 231 */
+ Tcl_Size (*tcl_SetRecursionLimit) (Tcl_Interp *interp, Tcl_Size depth); /* 231 */
void (*reserved232)(void);
int (*tcl_SetServiceMode) (int mode); /* 233 */
void (*tcl_SetObjErrorCode) (Tcl_Interp *interp, Tcl_Obj *errorObjPtr); /* 234 */
@@ -2103,7 +2113,7 @@ typedef struct TclStubs {
void (*reserved247)(void);
int (*tcl_TraceVar2) (Tcl_Interp *interp, const char *part1, const char *part2, int flags, Tcl_VarTraceProc *proc, void *clientData); /* 248 */
char * (*tcl_TranslateFileName) (Tcl_Interp *interp, const char *name, Tcl_DString *bufferPtr); /* 249 */
- size_t (*tcl_Ungets) (Tcl_Channel chan, const char *str, size_t len, int atHead); /* 250 */
+ Tcl_Size (*tcl_Ungets) (Tcl_Channel chan, const char *str, Tcl_Size len, int atHead); /* 250 */
void (*tcl_UnlinkVar) (Tcl_Interp *interp, const char *varName); /* 251 */
int (*tcl_UnregisterChannel) (Tcl_Interp *interp, Tcl_Channel chan); /* 252 */
void (*reserved253)(void);
@@ -2116,8 +2126,8 @@ typedef struct TclStubs {
int (*tcl_VarEval) (Tcl_Interp *interp, ...); /* 260 */
void (*reserved261)(void);
void * (*tcl_VarTraceInfo2) (Tcl_Interp *interp, const char *part1, const char *part2, int flags, Tcl_VarTraceProc *procPtr, void *prevClientData); /* 262 */
- size_t (*tcl_Write) (Tcl_Channel chan, const char *s, size_t slen); /* 263 */
- void (*tcl_WrongNumArgs) (Tcl_Interp *interp, size_t objc, Tcl_Obj *const objv[], const char *message); /* 264 */
+ Tcl_Size (*tcl_Write) (Tcl_Channel chan, const char *s, Tcl_Size slen); /* 263 */
+ void (*tcl_WrongNumArgs) (Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], const char *message); /* 264 */
int (*tcl_DumpActiveMemory) (const char *fileName); /* 265 */
void (*tcl_ValidateAllMemory) (const char *file, int line); /* 266 */
void (*reserved267)(void);
@@ -2144,12 +2154,12 @@ typedef struct TclStubs {
void (*tcl_CreateThreadExitHandler) (Tcl_ExitProc *proc, void *clientData); /* 288 */
void (*tcl_DeleteThreadExitHandler) (Tcl_ExitProc *proc, void *clientData); /* 289 */
void (*reserved290)(void);
- int (*tcl_EvalEx) (Tcl_Interp *interp, const char *script, size_t numBytes, int flags); /* 291 */
- int (*tcl_EvalObjv) (Tcl_Interp *interp, size_t objc, Tcl_Obj *const objv[], int flags); /* 292 */
+ int (*tcl_EvalEx) (Tcl_Interp *interp, const char *script, Tcl_Size numBytes, int flags); /* 291 */
+ int (*tcl_EvalObjv) (Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int flags); /* 292 */
int (*tcl_EvalObjEx) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); /* 293 */
TCL_NORETURN1 void (*tcl_ExitThread) (int status); /* 294 */
- int (*tcl_ExternalToUtf) (Tcl_Interp *interp, Tcl_Encoding encoding, const char *src, size_t srcLen, int flags, Tcl_EncodingState *statePtr, char *dst, size_t dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); /* 295 */
- char * (*tcl_ExternalToUtfDString) (Tcl_Encoding encoding, const char *src, size_t srcLen, Tcl_DString *dsPtr); /* 296 */
+ int (*tcl_ExternalToUtf) (Tcl_Interp *interp, Tcl_Encoding encoding, const char *src, Tcl_Size srcLen, int flags, Tcl_EncodingState *statePtr, char *dst, Tcl_Size dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); /* 295 */
+ char * (*tcl_ExternalToUtfDString) (Tcl_Encoding encoding, const char *src, Tcl_Size srcLen, Tcl_DString *dsPtr); /* 296 */
void (*tcl_FinalizeThread) (void); /* 297 */
void (*tcl_FinalizeNotifier) (void *clientData); /* 298 */
void (*tcl_FreeEncoding) (Tcl_Encoding encoding); /* 299 */
@@ -2157,42 +2167,42 @@ typedef struct TclStubs {
Tcl_Encoding (*tcl_GetEncoding) (Tcl_Interp *interp, const char *name); /* 301 */
const char * (*tcl_GetEncodingName) (Tcl_Encoding encoding); /* 302 */
void (*tcl_GetEncodingNames) (Tcl_Interp *interp); /* 303 */
- int (*tcl_GetIndexFromObjStruct) (Tcl_Interp *interp, Tcl_Obj *objPtr, const void *tablePtr, size_t offset, const char *msg, int flags, void *indexPtr); /* 304 */
- void * (*tcl_GetThreadData) (Tcl_ThreadDataKey *keyPtr, size_t size); /* 305 */
+ int (*tcl_GetIndexFromObjStruct) (Tcl_Interp *interp, Tcl_Obj *objPtr, const void *tablePtr, Tcl_Size offset, const char *msg, int flags, void *indexPtr); /* 304 */
+ void * (*tcl_GetThreadData) (Tcl_ThreadDataKey *keyPtr, Tcl_Size size); /* 305 */
Tcl_Obj * (*tcl_GetVar2Ex) (Tcl_Interp *interp, const char *part1, const char *part2, int flags); /* 306 */
void * (*tcl_InitNotifier) (void); /* 307 */
void (*tcl_MutexLock) (Tcl_Mutex *mutexPtr); /* 308 */
void (*tcl_MutexUnlock) (Tcl_Mutex *mutexPtr); /* 309 */
void (*tcl_ConditionNotify) (Tcl_Condition *condPtr); /* 310 */
void (*tcl_ConditionWait) (Tcl_Condition *condPtr, Tcl_Mutex *mutexPtr, const Tcl_Time *timePtr); /* 311 */
- size_t (*tclNumUtfChars) (const char *src, size_t length); /* 312 */
- size_t (*tcl_ReadChars) (Tcl_Channel channel, Tcl_Obj *objPtr, size_t charsToRead, int appendFlag); /* 313 */
+ Tcl_Size (*tclNumUtfChars) (const char *src, Tcl_Size length); /* 312 */
+ Tcl_Size (*tcl_ReadChars) (Tcl_Channel channel, Tcl_Obj *objPtr, Tcl_Size charsToRead, int appendFlag); /* 313 */
void (*reserved314)(void);
void (*reserved315)(void);
int (*tcl_SetSystemEncoding) (Tcl_Interp *interp, const char *name); /* 316 */
Tcl_Obj * (*tcl_SetVar2Ex) (Tcl_Interp *interp, const char *part1, const char *part2, Tcl_Obj *newValuePtr, int flags); /* 317 */
void (*tcl_ThreadAlert) (Tcl_ThreadId threadId); /* 318 */
void (*tcl_ThreadQueueEvent) (Tcl_ThreadId threadId, Tcl_Event *evPtr, int position); /* 319 */
- int (*tcl_UniCharAtIndex) (const char *src, size_t index); /* 320 */
+ int (*tcl_UniCharAtIndex) (const char *src, Tcl_Size index); /* 320 */
int (*tcl_UniCharToLower) (int ch); /* 321 */
int (*tcl_UniCharToTitle) (int ch); /* 322 */
int (*tcl_UniCharToUpper) (int ch); /* 323 */
int (*tcl_UniCharToUtf) (int ch, char *buf); /* 324 */
- const char * (*tclUtfAtIndex) (const char *src, size_t index); /* 325 */
- int (*tclUtfCharComplete) (const char *src, size_t length); /* 326 */
- size_t (*tcl_UtfBackslash) (const char *src, int *readPtr, char *dst); /* 327 */
+ const char * (*tclUtfAtIndex) (const char *src, Tcl_Size index); /* 325 */
+ int (*tclUtfCharComplete) (const char *src, Tcl_Size length); /* 326 */
+ Tcl_Size (*tcl_UtfBackslash) (const char *src, int *readPtr, char *dst); /* 327 */
const char * (*tcl_UtfFindFirst) (const char *src, int ch); /* 328 */
const char * (*tcl_UtfFindLast) (const char *src, int ch); /* 329 */
const char * (*tclUtfNext) (const char *src); /* 330 */
const char * (*tclUtfPrev) (const char *src, const char *start); /* 331 */
- int (*tcl_UtfToExternal) (Tcl_Interp *interp, Tcl_Encoding encoding, const char *src, size_t srcLen, int flags, Tcl_EncodingState *statePtr, char *dst, size_t dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); /* 332 */
- char * (*tcl_UtfToExternalDString) (Tcl_Encoding encoding, const char *src, size_t srcLen, Tcl_DString *dsPtr); /* 333 */
+ int (*tcl_UtfToExternal) (Tcl_Interp *interp, Tcl_Encoding encoding, const char *src, Tcl_Size srcLen, int flags, Tcl_EncodingState *statePtr, char *dst, Tcl_Size dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); /* 332 */
+ char * (*tcl_UtfToExternalDString) (Tcl_Encoding encoding, const char *src, Tcl_Size srcLen, Tcl_DString *dsPtr); /* 333 */
int (*tcl_UtfToLower) (char *src); /* 334 */
int (*tcl_UtfToTitle) (char *src); /* 335 */
int (*tcl_UtfToChar16) (const char *src, unsigned short *chPtr); /* 336 */
int (*tcl_UtfToUpper) (char *src); /* 337 */
- size_t (*tcl_WriteChars) (Tcl_Channel chan, const char *src, size_t srcLen); /* 338 */
- size_t (*tcl_WriteObj) (Tcl_Channel chan, Tcl_Obj *objPtr); /* 339 */
+ Tcl_Size (*tcl_WriteChars) (Tcl_Channel chan, const char *src, Tcl_Size srcLen); /* 338 */
+ Tcl_Size (*tcl_WriteObj) (Tcl_Channel chan, Tcl_Obj *objPtr); /* 339 */
char * (*tcl_GetString) (Tcl_Obj *objPtr); /* 340 */
void (*reserved341)(void);
void (*reserved342)(void);
@@ -2205,19 +2215,19 @@ typedef struct TclStubs {
int (*tcl_UniCharIsSpace) (int ch); /* 349 */
int (*tcl_UniCharIsUpper) (int ch); /* 350 */
int (*tcl_UniCharIsWordChar) (int ch); /* 351 */
- size_t (*tcl_Char16Len) (const unsigned short *uniStr); /* 352 */
+ Tcl_Size (*tcl_Char16Len) (const unsigned short *uniStr); /* 352 */
void (*reserved353)(void);
- char * (*tcl_Char16ToUtfDString) (const unsigned short *uniStr, size_t uniLength, Tcl_DString *dsPtr); /* 354 */
- unsigned short * (*tcl_UtfToChar16DString) (const char *src, size_t length, Tcl_DString *dsPtr); /* 355 */
+ char * (*tcl_Char16ToUtfDString) (const unsigned short *uniStr, Tcl_Size uniLength, Tcl_DString *dsPtr); /* 354 */
+ unsigned short * (*tcl_UtfToChar16DString) (const char *src, Tcl_Size length, Tcl_DString *dsPtr); /* 355 */
Tcl_RegExp (*tcl_GetRegExpFromObj) (Tcl_Interp *interp, Tcl_Obj *patObj, int flags); /* 356 */
void (*reserved357)(void);
void (*tcl_FreeParse) (Tcl_Parse *parsePtr); /* 358 */
- void (*tcl_LogCommandInfo) (Tcl_Interp *interp, const char *script, const char *command, size_t length); /* 359 */
- int (*tcl_ParseBraces) (Tcl_Interp *interp, const char *start, size_t numBytes, Tcl_Parse *parsePtr, int append, const char **termPtr); /* 360 */
- int (*tcl_ParseCommand) (Tcl_Interp *interp, const char *start, size_t numBytes, int nested, Tcl_Parse *parsePtr); /* 361 */
- int (*tcl_ParseExpr) (Tcl_Interp *interp, const char *start, size_t numBytes, Tcl_Parse *parsePtr); /* 362 */
- int (*tcl_ParseQuotedString) (Tcl_Interp *interp, const char *start, size_t numBytes, Tcl_Parse *parsePtr, int append, const char **termPtr); /* 363 */
- int (*tcl_ParseVarName) (Tcl_Interp *interp, const char *start, size_t numBytes, Tcl_Parse *parsePtr, int append); /* 364 */
+ void (*tcl_LogCommandInfo) (Tcl_Interp *interp, const char *script, const char *command, Tcl_Size length); /* 359 */
+ int (*tcl_ParseBraces) (Tcl_Interp *interp, const char *start, Tcl_Size numBytes, Tcl_Parse *parsePtr, int append, const char **termPtr); /* 360 */
+ int (*tcl_ParseCommand) (Tcl_Interp *interp, const char *start, Tcl_Size numBytes, int nested, Tcl_Parse *parsePtr); /* 361 */
+ int (*tcl_ParseExpr) (Tcl_Interp *interp, const char *start, Tcl_Size numBytes, Tcl_Parse *parsePtr); /* 362 */
+ int (*tcl_ParseQuotedString) (Tcl_Interp *interp, const char *start, Tcl_Size numBytes, Tcl_Parse *parsePtr, int append, const char **termPtr); /* 363 */
+ int (*tcl_ParseVarName) (Tcl_Interp *interp, const char *start, Tcl_Size numBytes, Tcl_Parse *parsePtr, int append); /* 364 */
char * (*tcl_GetCwd) (Tcl_Interp *interp, Tcl_DString *cwdPtr); /* 365 */
int (*tcl_Chdir) (const char *dirName); /* 366 */
int (*tcl_Access) (const char *path, int mode); /* 367 */
@@ -2229,26 +2239,26 @@ typedef struct TclStubs {
int (*tcl_UniCharIsGraph) (int ch); /* 373 */
int (*tcl_UniCharIsPrint) (int ch); /* 374 */
int (*tcl_UniCharIsPunct) (int ch); /* 375 */
- int (*tcl_RegExpExecObj) (Tcl_Interp *interp, Tcl_RegExp regexp, Tcl_Obj *textObj, size_t offset, size_t nmatches, int flags); /* 376 */
+ int (*tcl_RegExpExecObj) (Tcl_Interp *interp, Tcl_RegExp regexp, Tcl_Obj *textObj, Tcl_Size offset, Tcl_Size nmatches, int flags); /* 376 */
void (*tcl_RegExpGetInfo) (Tcl_RegExp regexp, Tcl_RegExpInfo *infoPtr); /* 377 */
- Tcl_Obj * (*tcl_NewUnicodeObj) (const Tcl_UniChar *unicode, size_t numChars); /* 378 */
- void (*tcl_SetUnicodeObj) (Tcl_Obj *objPtr, const Tcl_UniChar *unicode, size_t numChars); /* 379 */
- size_t (*tclGetCharLength) (Tcl_Obj *objPtr); /* 380 */
- int (*tclGetUniChar) (Tcl_Obj *objPtr, size_t index); /* 381 */
+ Tcl_Obj * (*tcl_NewUnicodeObj) (const Tcl_UniChar *unicode, Tcl_Size numChars); /* 378 */
+ void (*tcl_SetUnicodeObj) (Tcl_Obj *objPtr, const Tcl_UniChar *unicode, Tcl_Size numChars); /* 379 */
+ Tcl_Size (*tclGetCharLength) (Tcl_Obj *objPtr); /* 380 */
+ int (*tclGetUniChar) (Tcl_Obj *objPtr, Tcl_Size index); /* 381 */
void (*reserved382)(void);
- Tcl_Obj * (*tclGetRange) (Tcl_Obj *objPtr, size_t first, size_t last); /* 383 */
- void (*tcl_AppendUnicodeToObj) (Tcl_Obj *objPtr, const Tcl_UniChar *unicode, size_t length); /* 384 */
+ Tcl_Obj * (*tclGetRange) (Tcl_Obj *objPtr, Tcl_Size first, Tcl_Size last); /* 383 */
+ void (*tcl_AppendUnicodeToObj) (Tcl_Obj *objPtr, const Tcl_UniChar *unicode, Tcl_Size length); /* 384 */
int (*tcl_RegExpMatchObj) (Tcl_Interp *interp, Tcl_Obj *textObj, Tcl_Obj *patternObj); /* 385 */
void (*tcl_SetNotifier) (const Tcl_NotifierProcs *notifierProcPtr); /* 386 */
Tcl_Mutex * (*tcl_GetAllocMutex) (void); /* 387 */
int (*tcl_GetChannelNames) (Tcl_Interp *interp); /* 388 */
int (*tcl_GetChannelNamesEx) (Tcl_Interp *interp, const char *pattern); /* 389 */
- int (*tcl_ProcObjCmd) (void *clientData, Tcl_Interp *interp, size_t objc, Tcl_Obj *const objv[]); /* 390 */
+ int (*tcl_ProcObjCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 390 */
void (*tcl_ConditionFinalize) (Tcl_Condition *condPtr); /* 391 */
void (*tcl_MutexFinalize) (Tcl_Mutex *mutex); /* 392 */
- int (*tcl_CreateThread) (Tcl_ThreadId *idPtr, Tcl_ThreadCreateProc *proc, void *clientData, size_t stackSize, int flags); /* 393 */
- size_t (*tcl_ReadRaw) (Tcl_Channel chan, char *dst, size_t bytesToRead); /* 394 */
- size_t (*tcl_WriteRaw) (Tcl_Channel chan, const char *src, size_t srcLen); /* 395 */
+ int (*tcl_CreateThread) (Tcl_ThreadId *idPtr, Tcl_ThreadCreateProc *proc, void *clientData, Tcl_Size stackSize, int flags); /* 393 */
+ Tcl_Size (*tcl_ReadRaw) (Tcl_Channel chan, char *dst, Tcl_Size bytesToRead); /* 394 */
+ Tcl_Size (*tcl_WriteRaw) (Tcl_Channel chan, const char *src, Tcl_Size srcLen); /* 395 */
Tcl_Channel (*tcl_GetTopChannel) (Tcl_Channel chan); /* 396 */
int (*tcl_ChannelBuffered) (Tcl_Channel chan); /* 397 */
const char * (*tcl_ChannelName) (const Tcl_ChannelType *chanTypePtr); /* 398 */
@@ -2285,7 +2295,7 @@ typedef struct TclStubs {
void * (*tcl_AttemptDbCkalloc) (TCL_HASH_TYPE size, const char *file, int line); /* 429 */
void * (*tcl_AttemptRealloc) (void *ptr, TCL_HASH_TYPE size); /* 430 */
void * (*tcl_AttemptDbCkrealloc) (void *ptr, TCL_HASH_TYPE size, const char *file, int line); /* 431 */
- int (*tcl_AttemptSetObjLength) (Tcl_Obj *objPtr, size_t length); /* 432 */
+ int (*tcl_AttemptSetObjLength) (Tcl_Obj *objPtr, Tcl_Size length); /* 432 */
Tcl_ThreadId (*tcl_GetChannelThread) (Tcl_Channel channel); /* 433 */
Tcl_UniChar * (*tclGetUnicodeFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 434 */
void (*reserved435)(void);
@@ -2313,11 +2323,11 @@ typedef struct TclStubs {
Tcl_Obj * (*tcl_FSGetCwd) (Tcl_Interp *interp); /* 457 */
int (*tcl_FSChdir) (Tcl_Obj *pathPtr); /* 458 */
int (*tcl_FSConvertToPathType) (Tcl_Interp *interp, Tcl_Obj *pathPtr); /* 459 */
- Tcl_Obj * (*tcl_FSJoinPath) (Tcl_Obj *listObj, size_t elements); /* 460 */
+ Tcl_Obj * (*tcl_FSJoinPath) (Tcl_Obj *listObj, Tcl_Size elements); /* 460 */
Tcl_Obj * (*tclFSSplitPath) (Tcl_Obj *pathPtr, int *lenPtr); /* 461 */
int (*tcl_FSEqualPaths) (Tcl_Obj *firstPtr, Tcl_Obj *secondPtr); /* 462 */
Tcl_Obj * (*tcl_FSGetNormalizedPath) (Tcl_Interp *interp, Tcl_Obj *pathPtr); /* 463 */
- Tcl_Obj * (*tcl_FSJoinToPath) (Tcl_Obj *pathPtr, size_t objc, Tcl_Obj *const objv[]); /* 464 */
+ Tcl_Obj * (*tcl_FSJoinToPath) (Tcl_Obj *pathPtr, Tcl_Size objc, Tcl_Obj *const objv[]); /* 464 */
void * (*tcl_FSGetInternalRep) (Tcl_Obj *pathPtr, const Tcl_Filesystem *fsPtr); /* 465 */
Tcl_Obj * (*tcl_FSGetTranslatedPath) (Tcl_Interp *interp, Tcl_Obj *pathPtr); /* 466 */
int (*tcl_FSEvalFile) (Tcl_Interp *interp, Tcl_Obj *fileName); /* 467 */
@@ -2334,9 +2344,9 @@ typedef struct TclStubs {
Tcl_PathType (*tcl_FSGetPathType) (Tcl_Obj *pathPtr); /* 478 */
int (*tcl_OutputBuffered) (Tcl_Channel chan); /* 479 */
void (*tcl_FSMountsChanged) (const Tcl_Filesystem *fsPtr); /* 480 */
- int (*tcl_EvalTokensStandard) (Tcl_Interp *interp, Tcl_Token *tokenPtr, size_t count); /* 481 */
+ int (*tcl_EvalTokensStandard) (Tcl_Interp *interp, Tcl_Token *tokenPtr, Tcl_Size count); /* 481 */
void (*tcl_GetTime) (Tcl_Time *timeBuf); /* 482 */
- Tcl_Trace (*tcl_CreateObjTrace) (Tcl_Interp *interp, int level, int flags, Tcl_CmdObjTraceProc *objProc, void *clientData, Tcl_CmdObjTraceDeleteProc *delProc); /* 483 */
+ Tcl_Trace (*tcl_CreateObjTrace) (Tcl_Interp *interp, Tcl_Size level, int flags, Tcl_CmdObjTraceProc *objProc, void *clientData, Tcl_CmdObjTraceDeleteProc *delProc); /* 483 */
int (*tcl_GetCommandInfoFromToken) (Tcl_Command token, Tcl_CmdInfo *infoPtr); /* 484 */
int (*tcl_SetCommandInfoFromToken) (Tcl_Command token, const Tcl_CmdInfo *infoPtr); /* 485 */
Tcl_Obj * (*tcl_DbNewWideIntObj) (Tcl_WideInt wideValue, const char *file, int line); /* 486 */
@@ -2354,8 +2364,8 @@ typedef struct TclStubs {
int (*tcl_DictObjFirst) (Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_DictSearch *searchPtr, Tcl_Obj **keyPtrPtr, Tcl_Obj **valuePtrPtr, int *donePtr); /* 498 */
void (*tcl_DictObjNext) (Tcl_DictSearch *searchPtr, Tcl_Obj **keyPtrPtr, Tcl_Obj **valuePtrPtr, int *donePtr); /* 499 */
void (*tcl_DictObjDone) (Tcl_DictSearch *searchPtr); /* 500 */
- int (*tcl_DictObjPutKeyList) (Tcl_Interp *interp, Tcl_Obj *dictPtr, size_t keyc, Tcl_Obj *const *keyv, Tcl_Obj *valuePtr); /* 501 */
- int (*tcl_DictObjRemoveKeyList) (Tcl_Interp *interp, Tcl_Obj *dictPtr, size_t keyc, Tcl_Obj *const *keyv); /* 502 */
+ int (*tcl_DictObjPutKeyList) (Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Size keyc, Tcl_Obj *const *keyv, Tcl_Obj *valuePtr); /* 501 */
+ int (*tcl_DictObjRemoveKeyList) (Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Size keyc, Tcl_Obj *const *keyv); /* 502 */
Tcl_Obj * (*tcl_NewDictObj) (void); /* 503 */
Tcl_Obj * (*tcl_DbNewDictObj) (const char *file, int line); /* 504 */
void (*tcl_RegisterConfig) (Tcl_Interp *interp, const char *pkgName, const Tcl_Config *configuration, const char *valEncoding); /* 505 */
@@ -2378,7 +2388,7 @@ typedef struct TclStubs {
int (*tcl_LimitReady) (Tcl_Interp *interp); /* 522 */
int (*tcl_LimitCheck) (Tcl_Interp *interp); /* 523 */
int (*tcl_LimitExceeded) (Tcl_Interp *interp); /* 524 */
- void (*tcl_LimitSetCommands) (Tcl_Interp *interp, size_t commandLimit); /* 525 */
+ void (*tcl_LimitSetCommands) (Tcl_Interp *interp, Tcl_Size commandLimit); /* 525 */
void (*tcl_LimitSetTime) (Tcl_Interp *interp, Tcl_Time *timeLimitPtr); /* 526 */
void (*tcl_LimitSetGranularity) (Tcl_Interp *interp, int type, int granularity); /* 527 */
int (*tcl_LimitTypeEnabled) (Tcl_Interp *interp, int type); /* 528 */
@@ -2426,11 +2436,11 @@ typedef struct TclStubs {
Tcl_Obj * (*tcl_GetEncodingSearchPath) (void); /* 570 */
int (*tcl_SetEncodingSearchPath) (Tcl_Obj *searchPath); /* 571 */
const char * (*tcl_GetEncodingNameFromEnvironment) (Tcl_DString *bufPtr); /* 572 */
- int (*tcl_PkgRequireProc) (Tcl_Interp *interp, const char *name, size_t objc, Tcl_Obj *const objv[], void *clientDataPtr); /* 573 */
+ int (*tcl_PkgRequireProc) (Tcl_Interp *interp, const char *name, Tcl_Size objc, Tcl_Obj *const objv[], void *clientDataPtr); /* 573 */
void (*tcl_AppendObjToErrorInfo) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 574 */
- void (*tcl_AppendLimitedToObj) (Tcl_Obj *objPtr, const char *bytes, size_t length, size_t limit, const char *ellipsis); /* 575 */
- Tcl_Obj * (*tcl_Format) (Tcl_Interp *interp, const char *format, size_t objc, Tcl_Obj *const objv[]); /* 576 */
- int (*tcl_AppendFormatToObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, const char *format, size_t objc, Tcl_Obj *const objv[]); /* 577 */
+ void (*tcl_AppendLimitedToObj) (Tcl_Obj *objPtr, const char *bytes, Tcl_Size length, Tcl_Size limit, const char *ellipsis); /* 575 */
+ Tcl_Obj * (*tcl_Format) (Tcl_Interp *interp, const char *format, Tcl_Size objc, Tcl_Obj *const objv[]); /* 576 */
+ int (*tcl_AppendFormatToObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, const char *format, Tcl_Size objc, Tcl_Obj *const objv[]); /* 577 */
Tcl_Obj * (*tcl_ObjPrintf) (const char *format, ...) TCL_FORMAT_PRINTF(1, 2); /* 578 */
void (*tcl_AppendPrintfToObj) (Tcl_Obj *objPtr, const char *format, ...) TCL_FORMAT_PRINTF(2, 3); /* 579 */
int (*tcl_CancelEval) (Tcl_Interp *interp, Tcl_Obj *resultObjPtr, void *clientData, int flags); /* 580 */
@@ -2438,10 +2448,10 @@ typedef struct TclStubs {
int (*tcl_CreatePipe) (Tcl_Interp *interp, Tcl_Channel *rchan, Tcl_Channel *wchan, int flags); /* 582 */
Tcl_Command (*tcl_NRCreateCommand) (Tcl_Interp *interp, const char *cmdName, Tcl_ObjCmdProc *proc, Tcl_ObjCmdProc *nreProc, void *clientData, Tcl_CmdDeleteProc *deleteProc); /* 583 */
int (*tcl_NREvalObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); /* 584 */
- int (*tcl_NREvalObjv) (Tcl_Interp *interp, size_t objc, Tcl_Obj *const objv[], int flags); /* 585 */
- int (*tcl_NRCmdSwap) (Tcl_Interp *interp, Tcl_Command cmd, size_t objc, Tcl_Obj *const objv[], int flags); /* 586 */
+ int (*tcl_NREvalObjv) (Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int flags); /* 585 */
+ int (*tcl_NRCmdSwap) (Tcl_Interp *interp, Tcl_Command cmd, Tcl_Size objc, Tcl_Obj *const objv[], int flags); /* 586 */
void (*tcl_NRAddCallback) (Tcl_Interp *interp, Tcl_NRPostProc *postProcPtr, void *data0, void *data1, void *data2, void *data3); /* 587 */
- int (*tcl_NRCallObjProc) (Tcl_Interp *interp, Tcl_ObjCmdProc *objProc, void *clientData, size_t objc, Tcl_Obj *const objv[]); /* 588 */
+ int (*tcl_NRCallObjProc) (Tcl_Interp *interp, Tcl_ObjCmdProc *objProc, void *clientData, Tcl_Size objc, Tcl_Obj *const objv[]); /* 588 */
unsigned (*tcl_GetFSDeviceFromStat) (const Tcl_StatBuf *statPtr); /* 589 */
unsigned (*tcl_GetFSInodeFromStat) (const Tcl_StatBuf *statPtr); /* 590 */
unsigned (*tcl_GetModeFromStat) (const Tcl_StatBuf *statPtr); /* 591 */
@@ -2464,15 +2474,15 @@ typedef struct TclStubs {
int (*tcl_InterpActive) (Tcl_Interp *interp); /* 608 */
void (*tcl_BackgroundException) (Tcl_Interp *interp, int code); /* 609 */
int (*tcl_ZlibDeflate) (Tcl_Interp *interp, int format, Tcl_Obj *data, int level, Tcl_Obj *gzipHeaderDictObj); /* 610 */
- int (*tcl_ZlibInflate) (Tcl_Interp *interp, int format, Tcl_Obj *data, size_t buffersize, Tcl_Obj *gzipHeaderDictObj); /* 611 */
- unsigned int (*tcl_ZlibCRC32) (unsigned int crc, const unsigned char *buf, size_t len); /* 612 */
- unsigned int (*tcl_ZlibAdler32) (unsigned int adler, const unsigned char *buf, size_t len); /* 613 */
+ int (*tcl_ZlibInflate) (Tcl_Interp *interp, int format, Tcl_Obj *data, Tcl_Size buffersize, Tcl_Obj *gzipHeaderDictObj); /* 611 */
+ unsigned int (*tcl_ZlibCRC32) (unsigned int crc, const unsigned char *buf, Tcl_Size len); /* 612 */
+ unsigned int (*tcl_ZlibAdler32) (unsigned int adler, const unsigned char *buf, Tcl_Size len); /* 613 */
int (*tcl_ZlibStreamInit) (Tcl_Interp *interp, int mode, int format, int level, Tcl_Obj *dictObj, Tcl_ZlibStream *zshandle); /* 614 */
Tcl_Obj * (*tcl_ZlibStreamGetCommandName) (Tcl_ZlibStream zshandle); /* 615 */
int (*tcl_ZlibStreamEof) (Tcl_ZlibStream zshandle); /* 616 */
int (*tcl_ZlibStreamChecksum) (Tcl_ZlibStream zshandle); /* 617 */
int (*tcl_ZlibStreamPut) (Tcl_ZlibStream zshandle, Tcl_Obj *data, int flush); /* 618 */
- int (*tcl_ZlibStreamGet) (Tcl_ZlibStream zshandle, Tcl_Obj *data, size_t count); /* 619 */
+ int (*tcl_ZlibStreamGet) (Tcl_ZlibStream zshandle, Tcl_Obj *data, Tcl_Size count); /* 619 */
int (*tcl_ZlibStreamClose) (Tcl_ZlibStream zshandle); /* 620 */
int (*tcl_ZlibStreamReset) (Tcl_ZlibStream zshandle); /* 621 */
void (*tcl_SetStartupScript) (Tcl_Obj *path, const char *encoding); /* 622 */
@@ -2484,7 +2494,7 @@ typedef struct TclStubs {
void * (*tcl_FindSymbol) (Tcl_Interp *interp, Tcl_LoadHandle handle, const char *symbol); /* 628 */
int (*tcl_FSUnloadFile) (Tcl_Interp *interp, Tcl_LoadHandle handlePtr); /* 629 */
void (*tcl_ZlibStreamSetCompressionDictionary) (Tcl_ZlibStream zhandle, Tcl_Obj *compressionDictionaryObj); /* 630 */
- Tcl_Channel (*tcl_OpenTcpServerEx) (Tcl_Interp *interp, const char *service, const char *host, unsigned int flags, Tcl_TcpAcceptProc *acceptProc, void *callbackData); /* 631 */
+ Tcl_Channel (*tcl_OpenTcpServerEx) (Tcl_Interp *interp, const char *service, const char *host, unsigned int flags, int backlog, Tcl_TcpAcceptProc *acceptProc, void *callbackData); /* 631 */
int (*tclZipfs_Mount) (Tcl_Interp *interp, const char *mountPoint, const char *zipname, const char *passwd); /* 632 */
int (*tclZipfs_Unmount) (Tcl_Interp *interp, const char *mountPoint); /* 633 */
Tcl_Obj * (*tclZipfs_TclLibrary) (void); /* 634 */
@@ -2497,22 +2507,22 @@ typedef struct TclStubs {
void (*tcl_IncrRefCount) (Tcl_Obj *objPtr); /* 641 */
void (*tcl_DecrRefCount) (Tcl_Obj *objPtr); /* 642 */
int (*tcl_IsShared) (Tcl_Obj *objPtr); /* 643 */
- int (*tcl_LinkArray) (Tcl_Interp *interp, const char *varName, void *addr, int type, size_t size); /* 644 */
- int (*tcl_GetIntForIndex) (Tcl_Interp *interp, Tcl_Obj *objPtr, size_t endValue, size_t *indexPtr); /* 645 */
+ int (*tcl_LinkArray) (Tcl_Interp *interp, const char *varName, void *addr, int type, Tcl_Size size); /* 644 */
+ int (*tcl_GetIntForIndex) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Size endValue, Tcl_Size *indexPtr); /* 645 */
int (*tcl_UtfToUniChar) (const char *src, int *chPtr); /* 646 */
- char * (*tcl_UniCharToUtfDString) (const int *uniStr, size_t uniLength, Tcl_DString *dsPtr); /* 647 */
- int * (*tcl_UtfToUniCharDString) (const char *src, size_t length, Tcl_DString *dsPtr); /* 648 */
+ char * (*tcl_UniCharToUtfDString) (const int *uniStr, Tcl_Size uniLength, Tcl_DString *dsPtr); /* 647 */
+ int * (*tcl_UtfToUniCharDString) (const char *src, Tcl_Size length, Tcl_DString *dsPtr); /* 648 */
unsigned char * (*tclGetBytesFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *numBytesPtr); /* 649 */
unsigned char * (*tcl_GetBytesFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, size_t *numBytesPtr); /* 650 */
char * (*tcl_GetStringFromObj) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 651 */
Tcl_UniChar * (*tcl_GetUnicodeFromObj) (Tcl_Obj *objPtr, size_t *lengthPtr); /* 652 */
unsigned char * (*tcl_GetByteArrayFromObj) (Tcl_Obj *objPtr, size_t *numBytesPtr); /* 653 */
- int (*tcl_UtfCharComplete) (const char *src, size_t length); /* 654 */
+ int (*tcl_UtfCharComplete) (const char *src, Tcl_Size length); /* 654 */
const char * (*tcl_UtfNext) (const char *src); /* 655 */
const char * (*tcl_UtfPrev) (const char *src, const char *start); /* 656 */
int (*tcl_UniCharIsUnicode) (int ch); /* 657 */
- size_t (*tcl_ExternalToUtfDStringEx) (Tcl_Encoding encoding, const char *src, size_t srcLen, int flags, Tcl_DString *dsPtr); /* 658 */
- size_t (*tcl_UtfToExternalDStringEx) (Tcl_Encoding encoding, const char *src, size_t srcLen, int flags, Tcl_DString *dsPtr); /* 659 */
+ Tcl_Size (*tcl_ExternalToUtfDStringEx) (Tcl_Encoding encoding, const char *src, Tcl_Size srcLen, int flags, Tcl_DString *dsPtr); /* 658 */
+ Tcl_Size (*tcl_UtfToExternalDStringEx) (Tcl_Encoding encoding, const char *src, Tcl_Size srcLen, int flags, Tcl_DString *dsPtr); /* 659 */
int (*tcl_AsyncMarkFromSignal) (Tcl_AsyncHandler async, int sigNumber); /* 660 */
int (*tcl_ListObjGetElements) (Tcl_Interp *interp, Tcl_Obj *listPtr, size_t *objcPtr, Tcl_Obj ***objvPtr); /* 661 */
int (*tcl_ListObjLength) (Tcl_Interp *interp, Tcl_Obj *listPtr, size_t *lengthPtr); /* 662 */
@@ -2521,21 +2531,22 @@ typedef struct TclStubs {
void (*tcl_SplitPath) (const char *path, size_t *argcPtr, const char ***argvPtr); /* 665 */
Tcl_Obj * (*tcl_FSSplitPath) (Tcl_Obj *pathPtr, size_t *lenPtr); /* 666 */
int (*tcl_ParseArgsObjv) (Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, size_t *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv); /* 667 */
- size_t (*tcl_UniCharLen) (const int *uniStr); /* 668 */
- size_t (*tcl_NumUtfChars) (const char *src, size_t length); /* 669 */
- size_t (*tcl_GetCharLength) (Tcl_Obj *objPtr); /* 670 */
- const char * (*tcl_UtfAtIndex) (const char *src, size_t index); /* 671 */
- Tcl_Obj * (*tcl_GetRange) (Tcl_Obj *objPtr, size_t first, size_t last); /* 672 */
- int (*tcl_GetUniChar) (Tcl_Obj *objPtr, size_t index); /* 673 */
+ Tcl_Size (*tcl_UniCharLen) (const int *uniStr); /* 668 */
+ Tcl_Size (*tcl_NumUtfChars) (const char *src, Tcl_Size length); /* 669 */
+ Tcl_Size (*tcl_GetCharLength) (Tcl_Obj *objPtr); /* 670 */
+ const char * (*tcl_UtfAtIndex) (const char *src, Tcl_Size index); /* 671 */
+ Tcl_Obj * (*tcl_GetRange) (Tcl_Obj *objPtr, Tcl_Size first, Tcl_Size last); /* 672 */
+ int (*tcl_GetUniChar) (Tcl_Obj *objPtr, Tcl_Size index); /* 673 */
int (*tcl_GetBool) (Tcl_Interp *interp, const char *src, int flags, char *charPtr); /* 674 */
int (*tcl_GetBoolFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags, char *charPtr); /* 675 */
Tcl_Command (*tcl_CreateObjCommand2) (Tcl_Interp *interp, const char *cmdName, Tcl_ObjCmdProc2 *proc2, void *clientData, Tcl_CmdDeleteProc *deleteProc); /* 676 */
- Tcl_Trace (*tcl_CreateObjTrace2) (Tcl_Interp *interp, int level, int flags, Tcl_CmdObjTraceProc2 *objProc2, void *clientData, Tcl_CmdObjTraceDeleteProc *delProc); /* 677 */
+ Tcl_Trace (*tcl_CreateObjTrace2) (Tcl_Interp *interp, Tcl_Size level, int flags, Tcl_CmdObjTraceProc2 *objProc2, void *clientData, Tcl_CmdObjTraceDeleteProc *delProc); /* 677 */
Tcl_Command (*tcl_NRCreateCommand2) (Tcl_Interp *interp, const char *cmdName, Tcl_ObjCmdProc2 *proc, Tcl_ObjCmdProc2 *nreProc2, void *clientData, Tcl_CmdDeleteProc *deleteProc); /* 678 */
int (*tcl_NRCallObjProc2) (Tcl_Interp *interp, Tcl_ObjCmdProc2 *objProc2, void *clientData, size_t objc, Tcl_Obj *const objv[]); /* 679 */
int (*tcl_GetNumberFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, void **clientDataPtr, int *typePtr); /* 680 */
int (*tcl_GetNumber) (Tcl_Interp *interp, const char *bytes, size_t numBytes, void **clientDataPtr, int *typePtr); /* 681 */
int (*tcl_RemoveChannelMode) (Tcl_Interp *interp, Tcl_Channel chan, int mode); /* 682 */
+ int (*tcl_GetEncodingNulLength) (Tcl_Encoding encoding); /* 683 */
} TclStubs;
extern const TclStubs *tclStubsPtr;
@@ -3854,6 +3865,8 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tcl_GetNumber) /* 681 */
#define Tcl_RemoveChannelMode \
(tclStubsPtr->tcl_RemoveChannelMode) /* 682 */
+#define Tcl_GetEncodingNulLength \
+ (tclStubsPtr->tcl_GetEncodingNulLength) /* 683 */
#endif /* defined(USE_TCL_STUBS) */
@@ -3979,55 +3992,76 @@ extern const TclStubs *tclStubsPtr;
#undef Tcl_GetString
#undef Tcl_GetUnicode
#define Tcl_GetString(objPtr) \
- Tcl_GetStringFromObj(objPtr, (size_t *)NULL)
+ Tcl_GetStringFromObj(objPtr, (Tcl_Size *)NULL)
#define Tcl_GetUnicode(objPtr) \
- Tcl_GetUnicodeFromObj(objPtr, (size_t *)NULL)
+ Tcl_GetUnicodeFromObj(objPtr, (Tcl_Size *)NULL)
+#undef Tcl_GetBytesFromObj
#undef Tcl_GetIndexFromObjStruct
+#undef Tcl_GetBooleanFromObj
+#undef Tcl_GetBoolean
#undef Tcl_GetStringFromObj
#undef Tcl_GetUnicodeFromObj
#undef TclGetByteArrayFromObj
#undef Tcl_GetByteArrayFromObj
-#undef Tcl_GetBytesFromObj
#if defined(USE_TCL_STUBS)
-#define Tcl_GetStringFromObj(objPtr, sizePtr) \
- ((sizeof(*(sizePtr)) == sizeof(int) && sizeof(int) != sizeof(size_t)) ? \
- tclStubsPtr->tclGetStringFromObj(objPtr, (int *)(void *)(sizePtr)) : \
- tclStubsPtr->tcl_GetStringFromObj(objPtr, (size_t *)(void *)(sizePtr)))
#define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \
- ((sizeof(*(sizePtr)) == sizeof(int) && sizeof(int) != sizeof(size_t)) ? \
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
tclStubsPtr->tclGetBytesFromObj(interp, objPtr, (int *)(void *)(sizePtr)) : \
tclStubsPtr->tcl_GetBytesFromObj(interp, objPtr, (size_t *)(void *)(sizePtr)))
+#define Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, indexPtr) \
+ (tclStubsPtr->tcl_GetIndexFromObjStruct((interp), (objPtr), (tablePtr), (offset), (msg), \
+ (flags)|(int)(sizeof(*(indexPtr))<<1), (indexPtr)))
+#define Tcl_GetBooleanFromObj(interp, objPtr, boolPtr) \
+ ((sizeof(*(boolPtr)) == sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? tclStubsPtr->tcl_GetBooleanFromObj(interp, objPtr, (int *)(boolPtr)) : \
+ Tcl_GetBoolFromObj(interp, objPtr, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)))
+#define Tcl_GetBoolean(interp, src, boolPtr) \
+ ((sizeof(*(boolPtr)) == sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? tclStubsPtr->tcl_GetBoolean(interp, src, (int *)(boolPtr)) : \
+ Tcl_GetBool(interp, src, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)))
+#define Tcl_GetStringFromObj(objPtr, sizePtr) \
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
+ tclStubsPtr->tclGetStringFromObj(objPtr, (int *)(void *)(sizePtr)) : \
+ tclStubsPtr->tcl_GetStringFromObj(objPtr, (size_t *)(void *)(sizePtr)))
+#if TCL_MAJOR_VERSION > 8
#define Tcl_GetByteArrayFromObj(objPtr, sizePtr) \
- ((sizeof(*(sizePtr)) == sizeof(int) && sizeof(int) != sizeof(size_t)) ? \
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
tclStubsPtr->tclGetBytesFromObj(NULL, objPtr, (int *)(void *)(sizePtr)) : \
tclStubsPtr->tcl_GetBytesFromObj(NULL, objPtr, (size_t *)(void *)(sizePtr)))
+#else
+#define Tcl_GetByteArrayFromObj(objPtr, sizePtr) \
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
+ tclStubsPtr->tclGetByteArrayFromObj(objPtr, (int *)(void *)(sizePtr)) : \
+ tclStubsPtr->tcl_GetByteArrayFromObj(objPtr, (size_t *)(void *)(sizePtr)))
+#endif
#define Tcl_GetUnicodeFromObj(objPtr, sizePtr) \
- ((sizeof(*(sizePtr)) == sizeof(int) && sizeof(int) != sizeof(size_t)) ? \
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
tclStubsPtr->tclGetUnicodeFromObj(objPtr, (int *)(void *)(sizePtr)) : \
tclStubsPtr->tcl_GetUnicodeFromObj(objPtr, (size_t *)(void *)(sizePtr)))
+#else
+#define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
+ TclGetBytesFromObj(interp, objPtr, (int *)(void *)(sizePtr)) : \
+ (Tcl_GetBytesFromObj)(interp, objPtr, (size_t *)(void *)(sizePtr)))
#define Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, indexPtr) \
- (tclStubsPtr->tcl_GetIndexFromObjStruct((interp), (objPtr), (tablePtr), (offset), (msg), \
+ ((Tcl_GetIndexFromObjStruct)((interp), (objPtr), (tablePtr), (offset), (msg), \
(flags)|(int)(sizeof(*(indexPtr))<<1), (indexPtr)))
-#else
+#define Tcl_GetBooleanFromObj(interp, objPtr, boolPtr) \
+ ((sizeof(*(boolPtr)) == sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? Tcl_GetBooleanFromObj(interp, objPtr, (int *)(boolPtr)) : \
+ Tcl_GetBoolFromObj(interp, objPtr, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)))
+#define Tcl_GetBoolean(interp, src, boolPtr) \
+ ((sizeof(*(boolPtr)) == sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? Tcl_GetBoolean(interp, src, (int *)(boolPtr)) : \
+ Tcl_GetBool(interp, src, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)))
#define Tcl_GetStringFromObj(objPtr, sizePtr) \
- ((sizeof(*(sizePtr)) == sizeof(int) && sizeof(int) != sizeof(size_t)) ? \
- (TclGetStringFromObj)(objPtr, (int *)(void *)(sizePtr)) : \
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
+ TclGetStringFromObj(objPtr, (int *)(void *)(sizePtr)) : \
(Tcl_GetStringFromObj)(objPtr, (size_t *)(void *)(sizePtr)))
-#define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \
- ((sizeof(*(sizePtr)) == sizeof(int) && sizeof(int) != sizeof(size_t)) ? \
- (TclGetBytesFromObj)(interp, objPtr, (int *)(void *)(sizePtr)) : \
- (Tcl_GetBytesFromObj)(interp, objPtr, (size_t *)(void *)(sizePtr)))
#define Tcl_GetByteArrayFromObj(objPtr, sizePtr) \
- ((sizeof(*(sizePtr)) == sizeof(int) && sizeof(int) != sizeof(size_t)) ? \
- (TclGetBytesFromObj)(NULL, objPtr, (int *)(void *)(sizePtr)) : \
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
+ TclGetBytesFromObj(NULL, objPtr, (int *)(void *)(sizePtr)) : \
(Tcl_GetBytesFromObj)(NULL, objPtr, (size_t *)(void *)(sizePtr)))
#define Tcl_GetUnicodeFromObj(objPtr, sizePtr) \
- ((sizeof(*(sizePtr)) == sizeof(int) && sizeof(int) != sizeof(size_t)) ? \
- (TclGetUnicodeFromObj)(objPtr, (int *)(void *)(sizePtr)) : \
- Tcl_GetUnicodeFromObj(objPtr, (size_t *)(void *)(sizePtr)))
-#define Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, indexPtr) \
- ((Tcl_GetIndexFromObjStruct)((interp), (objPtr), (tablePtr), (offset), (msg), \
- (flags)|(int)(sizeof(*(indexPtr))<<1), (indexPtr)))
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
+ TclGetUnicodeFromObj(objPtr, (int *)(void *)(sizePtr)) : \
+ (Tcl_GetUnicodeFromObj)(objPtr, (size_t *)(void *)(sizePtr)))
#endif
#ifdef TCL_MEM_DEBUG
@@ -4088,79 +4122,81 @@ extern const TclStubs *tclStubsPtr;
#endif
#if defined(USE_TCL_STUBS)
# define Tcl_WCharToUtfDString (sizeof(wchar_t) != sizeof(short) \
- ? (char *(*)(const wchar_t *, size_t, Tcl_DString *))tclStubsPtr->tcl_UniCharToUtfDString \
- : (char *(*)(const wchar_t *, size_t, Tcl_DString *))Tcl_Char16ToUtfDString)
+ ? (char *(*)(const wchar_t *, Tcl_Size, Tcl_DString *))tclStubsPtr->tcl_UniCharToUtfDString \
+ : (char *(*)(const wchar_t *, Tcl_Size, Tcl_DString *))Tcl_Char16ToUtfDString)
# define Tcl_UtfToWCharDString (sizeof(wchar_t) != sizeof(short) \
- ? (wchar_t *(*)(const char *, size_t, Tcl_DString *))tclStubsPtr->tcl_UtfToUniCharDString \
- : (wchar_t *(*)(const char *, size_t, Tcl_DString *))Tcl_UtfToChar16DString)
+ ? (wchar_t *(*)(const char *, Tcl_Size, Tcl_DString *))tclStubsPtr->tcl_UtfToUniCharDString \
+ : (wchar_t *(*)(const char *, Tcl_Size, Tcl_DString *))Tcl_UtfToChar16DString)
# define Tcl_UtfToWChar (sizeof(wchar_t) != sizeof(short) \
? (int (*)(const char *, wchar_t *))tclStubsPtr->tcl_UtfToUniChar \
: (int (*)(const char *, wchar_t *))Tcl_UtfToChar16)
# define Tcl_WCharLen (sizeof(wchar_t) != sizeof(short) \
- ? (size_t (*)(wchar_t *))tclStubsPtr->tcl_UniCharLen \
- : (size_t (*)(wchar_t *))Tcl_Char16Len)
+ ? (Tcl_Size (*)(wchar_t *))tclStubsPtr->tcl_UniCharLen \
+ : (Tcl_Size (*)(wchar_t *))Tcl_Char16Len)
# undef Tcl_ListObjGetElements
-# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) == sizeof(size_t) \
- ? tclStubsPtr->tcl_ListObjGetElements((interp), (listPtr), (size_t *)(void *)(objcPtr), (objvPtr)) \
- : tclStubsPtr->tclListObjGetElements((interp), (listPtr), (int *)(void *)(objcPtr), (objvPtr)))
+# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) == sizeof(int) \
+ ? tclStubsPtr->tclListObjGetElements((interp), (listPtr), (int *)(void *)(objcPtr), (objvPtr)) \
+ : tclStubsPtr->tcl_ListObjGetElements((interp), (listPtr), (size_t *)(void *)(objcPtr), (objvPtr)))
# undef Tcl_ListObjLength
-# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) == sizeof(size_t) \
- ? tclStubsPtr->tcl_ListObjLength((interp), (listPtr), (size_t *)(void *)(lengthPtr)) \
- : tclStubsPtr->tclListObjLength((interp), (listPtr), (int *)(void *)(lengthPtr)))
+# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) == sizeof(int) \
+ ? tclStubsPtr->tclListObjLength((interp), (listPtr), (int *)(void *)(lengthPtr)) \
+ : tclStubsPtr->tcl_ListObjLength((interp), (listPtr), (size_t *)(void *)(lengthPtr)))
# undef Tcl_DictObjSize
-# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) == sizeof(size_t) \
- ? tclStubsPtr->tcl_DictObjSize((interp), (dictPtr), (size_t *)(void *)(sizePtr)) \
- : tclStubsPtr->tclDictObjSize((interp), (dictPtr), (int *)(void *)(sizePtr)))
+# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) == sizeof(int) \
+ ? tclStubsPtr->tclDictObjSize((interp), (dictPtr), (int *)(void *)(sizePtr)) \
+ : tclStubsPtr->tcl_DictObjSize((interp), (dictPtr), (size_t *)(void *)(sizePtr)))
# undef Tcl_SplitList
-# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(size_t) \
- ? tclStubsPtr->tcl_SplitList((interp), (listStr), (size_t *)(void *)(argcPtr), (argvPtr)) \
- : tclStubsPtr->tclSplitList((interp), (listStr), (int *)(void *)(argcPtr), (argvPtr)))
+# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(int) \
+ ? tclStubsPtr->tclSplitList((interp), (listStr), (int *)(void *)(argcPtr), (argvPtr)) \
+ : tclStubsPtr->tcl_SplitList((interp), (listStr), (size_t *)(void *)(argcPtr), (argvPtr)))
# undef Tcl_SplitPath
-# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(size_t) \
- ? tclStubsPtr->tcl_SplitPath((path), (size_t *)(void *)(argcPtr), (argvPtr)) \
- : tclStubsPtr->tclSplitPath((path), (int *)(void *)(argcPtr), (argvPtr)))
+# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(int) \
+ ? tclStubsPtr->tclSplitPath((path), (int *)(void *)(argcPtr), (argvPtr)) \
+ : tclStubsPtr->tcl_SplitPath((path), (size_t *)(void *)(argcPtr), (argvPtr)))
# undef Tcl_FSSplitPath
-# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) == sizeof(size_t) \
- ? tclStubsPtr->tcl_FSSplitPath((pathPtr), (size_t *)(void *)(lenPtr)) \
- : tclStubsPtr->tclFSSplitPath((pathPtr), (int *)(void *)(lenPtr)))
+# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) == sizeof(int) \
+ ? tclStubsPtr->tclFSSplitPath((pathPtr), (int *)(void *)(lenPtr)) \
+ : tclStubsPtr->tcl_FSSplitPath((pathPtr), (size_t *)(void *)(lenPtr)))
# undef Tcl_ParseArgsObjv
-# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) == sizeof(size_t) \
- ? tclStubsPtr->tcl_ParseArgsObjv((interp), (argTable), (size_t *)(void *)(objcPtr), (objv), (remObjv)) \
- : tclStubsPtr->tclParseArgsObjv((interp), (argTable), (int *)(void *)(objcPtr), (objv), (remObjv)))
+# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) == sizeof(int) \
+ ? tclStubsPtr->tclParseArgsObjv((interp), (argTable), (int *)(void *)(objcPtr), (objv), (remObjv)) \
+ : tclStubsPtr->tcl_ParseArgsObjv((interp), (argTable), (size_t *)(void *)(objcPtr), (objv), (remObjv)))
#else
# define Tcl_WCharToUtfDString (sizeof(wchar_t) != sizeof(short) \
- ? (char *(*)(const wchar_t *, size_t, Tcl_DString *))Tcl_UniCharToUtfDString \
- : (char *(*)(const wchar_t *, size_t, Tcl_DString *))Tcl_Char16ToUtfDString)
+ ? (char *(*)(const wchar_t *, Tcl_Size, Tcl_DString *))Tcl_UniCharToUtfDString \
+ : (char *(*)(const wchar_t *, Tcl_Size, Tcl_DString *))Tcl_Char16ToUtfDString)
# define Tcl_UtfToWCharDString (sizeof(wchar_t) != sizeof(short) \
- ? (wchar_t *(*)(const char *, size_t, Tcl_DString *))Tcl_UtfToUniCharDString \
- : (wchar_t *(*)(const char *, size_t, Tcl_DString *))Tcl_UtfToChar16DString)
+ ? (wchar_t *(*)(const char *, Tcl_Size, Tcl_DString *))Tcl_UtfToUniCharDString \
+ : (wchar_t *(*)(const char *, Tcl_Size, Tcl_DString *))Tcl_UtfToChar16DString)
# define Tcl_UtfToWChar (sizeof(wchar_t) != sizeof(short) \
? (int (*)(const char *, wchar_t *))Tcl_UtfToUniChar \
: (int (*)(const char *, wchar_t *))Tcl_UtfToChar16)
# define Tcl_WCharLen (sizeof(wchar_t) != sizeof(short) \
- ? (size_t (*)(wchar_t *))Tcl_UniCharLen \
- : (size_t (*)(wchar_t *))Tcl_Char16Len)
-# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) == sizeof(size_t) \
- ? (Tcl_ListObjGetElements)((interp), (listPtr), (size_t *)(void *)(objcPtr), (objvPtr)) \
- : TclListObjGetElements((interp), (listPtr), (int *)(void *)(objcPtr), (objvPtr)))
-# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) == sizeof(size_t) \
- ? (Tcl_ListObjLength)((interp), (listPtr), (size_t *)(void *)(lengthPtr)) \
- : TclListObjLength((interp), (listPtr), (int *)(void *)(lengthPtr)))
-# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) == sizeof(size_t) \
- ? (Tcl_DictObjSize)((interp), (dictPtr), (size_t *)(void *)(sizePtr)) \
- : TclDictObjSize((interp), (dictPtr), (int *)(void *)(sizePtr)))
-# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(size_t) \
- ? (Tcl_SplitList)((interp), (listStr), (size_t *)(void *)(argcPtr), (argvPtr)) \
- : TclSplitList((interp), (listStr), (int *)(void *)(argcPtr), (argvPtr)))
-# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(size_t) \
- ? (Tcl_SplitPath)((path), (size_t *)(void *)(argcPtr), (argvPtr)) \
- : TclSplitPath((path), (int *)(void *)(argcPtr), (argvPtr)))
-# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) == sizeof(size_t) \
- ? (Tcl_FSSplitPath)((pathPtr), (size_t *)(void *)(lenPtr)) \
- : TclFSSplitPath((pathPtr), (int *)(void *)(lenPtr)))
-# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) == sizeof(size_t) \
- ? (Tcl_ParseArgsObjv)((interp), (argTable), (size_t *)(void *)(objcPtr), (objv), (remObjv)) \
- : TclParseArgsObjv((interp), (argTable), (int *)(void *)(objcPtr), (objv), (remObjv)))
+ ? (Tcl_Size (*)(wchar_t *))Tcl_UniCharLen \
+ : (Tcl_Size (*)(wchar_t *))Tcl_Char16Len)
+#if !defined(BUILD_tcl)
+# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) == sizeof(int) \
+ ? TclListObjGetElements((interp), (listPtr), (int *)(void *)(objcPtr), (objvPtr)) \
+ : (Tcl_ListObjGetElements)((interp), (listPtr), (size_t *)(void *)(objcPtr), (objvPtr)))
+# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) == sizeof(int) \
+ ? TclListObjLength((interp), (listPtr), (int *)(void *)(lengthPtr)) \
+ : (Tcl_ListObjLength)((interp), (listPtr), (size_t *)(void *)(lengthPtr)))
+# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) == sizeof(int) \
+ ? TclDictObjSize((interp), (dictPtr), (int *)(void *)(sizePtr)) \
+ : (Tcl_DictObjSize)((interp), (dictPtr), (size_t *)(void *)(sizePtr)))
+# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(int) \
+ ? TclSplitList((interp), (listStr), (int *)(void *)(argcPtr), (argvPtr)) \
+ : (Tcl_SplitList)((interp), (listStr), (size_t *)(void *)(argcPtr), (argvPtr)))
+# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(int) \
+ ? TclSplitPath((path), (int *)(void *)(argcPtr), (argvPtr)) \
+ : (Tcl_SplitPath)((path), (size_t *)(void *)(argcPtr), (argvPtr)))
+# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) == sizeof(int) \
+ ? TclFSSplitPath((pathPtr), (int *)(void *)(lenPtr)) \
+ : (Tcl_FSSplitPath)((pathPtr), (size_t *)(void *)(lenPtr)))
+# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) == sizeof(int) \
+ ? TclParseArgsObjv((interp), (argTable), (int *)(void *)(objcPtr), (objv), (remObjv)) \
+ : (Tcl_ParseArgsObjv)((interp), (argTable), (size_t *)(void *)(objcPtr), (objv), (remObjv)))
+#endif /* !defined(BUILD_tcl) */
#endif
/*
@@ -4208,8 +4244,10 @@ extern const TclStubs *tclStubsPtr;
# endif
#endif
-#undef Tcl_Close
-#define Tcl_Close(interp, chan) Tcl_CloseEx(interp, chan, 0)
+#if TCL_MAJOR_VERSION > 8
+# undef Tcl_Close
+# define Tcl_Close(interp, chan) Tcl_CloseEx(interp, chan, 0)
+#endif
#undef TclUtfCharComplete
#undef TclUtfNext
diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c
index 9670b84..66acade 100644
--- a/generic/tclDisassemble.c
+++ b/generic/tclDisassemble.c
@@ -833,7 +833,7 @@ UpdateStringOfInstName(
InstNameGetInternalRep(objPtr, inst);
- if (inst > LAST_INST_OPCODE) {
+ if (inst >= LAST_INST_OPCODE) {
dst = Tcl_InitStringRep(objPtr, NULL, TCL_INTEGER_SPACE + 5);
TclOOM(dst, TCL_INTEGER_SPACE + 5);
sprintf(dst, "inst_%" TCL_Z_MODIFIER "u", inst);
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 66da441..455d7a6 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -925,6 +925,33 @@ Tcl_GetEncodingNames(
}
/*
+ *-------------------------------------------------------------------------
+ *
+ * Tcl_GetEncodingNulLength --
+ *
+ * Given an encoding, return the number of nul bytes used for the
+ * string termination.
+ *
+ * Results:
+ * The name of the encoding.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+int
+Tcl_GetEncodingNulLength(
+ Tcl_Encoding encoding)
+{
+ if (encoding == NULL) {
+ encoding = systemEncoding;
+ }
+
+ return ((Encoding *) encoding)->nullSize;
+}
+
+/*
*------------------------------------------------------------------------
*
* Tcl_SetSystemEncoding --
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index ce346cb..926fd61 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5035,11 +5035,104 @@ TEBCresume(
NEXT_INST_F(1, 1, 0);
}
- /*
- * End of INST_LIST and related instructions.
- * -----------------------------------------------------------------
- * Start of string-related instructions.
- */
+ case INST_LREPLACE4:
+ {
+ Tcl_Size numToDelete, numNewElems;
+ int end_indicator;
+ int haveSecondIndex, flags;
+ Tcl_Obj *fromIdxObj, *toIdxObj;
+ opnd = TclGetInt4AtPtr(pc + 1);
+ flags = TclGetInt1AtPtr(pc + 5);
+
+ /* Stack: ... listobj index1 ?index2? new1 ... newN */
+ valuePtr = OBJ_AT_DEPTH(opnd-1);
+
+ /* haveSecondIndex==0 => pure insert */
+ haveSecondIndex = (flags & TCL_LREPLACE4_SINGLE_INDEX) == 0;
+ numNewElems = opnd - 2 - haveSecondIndex;
+
+ /* end_indicator==1 => "end" is last element's index, 0=>index beyond */
+ end_indicator = (flags & TCL_LREPLACE4_END_IS_LAST) != 0;
+ fromIdxObj = OBJ_AT_DEPTH(opnd - 2);
+ toIdxObj = haveSecondIndex ? OBJ_AT_DEPTH(opnd - 3) : NULL;
+ if (Tcl_ListObjLength(interp, valuePtr, &length) != TCL_OK) {
+ TRACE_ERROR(interp);
+ goto gotError;
+ }
+
+ DECACHE_STACK_INFO();
+
+ if (TclGetIntForIndexM(
+ interp, fromIdxObj, length - end_indicator, &fromIdx)
+ != TCL_OK) {
+ CACHE_STACK_INFO();
+ TRACE_ERROR(interp);
+ goto gotError;
+ }
+ if (fromIdx == TCL_INDEX_NONE) {
+ fromIdx = 0;
+ }
+ else if (fromIdx > length) {
+ fromIdx = length;
+ }
+ numToDelete = 0;
+ if (toIdxObj) {
+ if (TclGetIntForIndexM(
+ interp, toIdxObj, length - end_indicator, &toIdx)
+ != TCL_OK) {
+ CACHE_STACK_INFO();
+ TRACE_ERROR(interp);
+ goto gotError;
+ }
+ if (toIdx != TCL_INDEX_NONE) {
+ if (toIdx > length) {
+ toIdx = length;
+ }
+ if (toIdx >= fromIdx) {
+ numToDelete = toIdx - fromIdx + 1;
+ }
+ }
+ }
+
+ CACHE_STACK_INFO();
+
+ if (Tcl_IsShared(valuePtr)) {
+ objResultPtr = Tcl_DuplicateObj(valuePtr);
+ if (Tcl_ListObjReplace(interp,
+ objResultPtr,
+ fromIdx,
+ numToDelete,
+ numNewElems,
+ &OBJ_AT_DEPTH(numNewElems - 1))
+ != TCL_OK) {
+ TRACE_ERROR(interp);
+ Tcl_DecrRefCount(objResultPtr);
+ goto gotError;
+ }
+ TRACE_APPEND(("\"%.30s\"\n", O2S(objResultPtr)));
+ NEXT_INST_V(6, opnd, 1);
+ }
+ else {
+ if (Tcl_ListObjReplace(interp,
+ valuePtr,
+ fromIdx,
+ numToDelete,
+ numNewElems,
+ &OBJ_AT_DEPTH(numNewElems - 1))
+ != TCL_OK) {
+ TRACE_ERROR(interp);
+ goto gotError;
+ }
+ TRACE_APPEND(("\"%.30s\"\n", O2S(valuePtr)));
+ NEXT_INST_V(6, opnd - 1, 0);
+ }
+ }
+
+ /*
+ * End of INST_LIST and related instructions.
+ * -----------------------------------------------------------------
+ * Start of string-related instructions.
+ */
case INST_STR_EQ:
case INST_STR_NEQ: /* String (in)equality check */
diff --git a/generic/tclIO.c b/generic/tclIO.c
index aabbbd8..8594aa0 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -1689,7 +1689,6 @@ Tcl_CreateChannel(
statePtr->inputTranslation = TCL_TRANSLATE_AUTO;
statePtr->outputTranslation = TCL_PLATFORM_TRANSLATION;
statePtr->inEofChar = 0;
- statePtr->outEofChar = 0;
statePtr->unreportedError = 0;
statePtr->refCount = 0;
@@ -3078,18 +3077,6 @@ CloseChannel(
}
/*
- * If the EOF character is set in the channel, append that to the output
- * device.
- */
-
- if ((statePtr->outEofChar != 0) && GotFlag(statePtr, TCL_WRITABLE)) {
- int dummy;
- char c = (char) statePtr->outEofChar;
-
- (void) ChanWrite(chanPtr, &c, 1, &dummy);
- }
-
- /*
* TIP #219, Tcl Channel Reflection API.
* Move a leftover error message in the channel bypass into the
* interpreter bypass. Just clear it if there is no interpreter.
@@ -3854,18 +3841,6 @@ CloseChannelPart(
}
/*
- * If the EOF character is set in the channel, append that to the
- * output device.
- */
-
- if ((statePtr->outEofChar != 0) && GotFlag(statePtr, TCL_WRITABLE)) {
- int dummy;
- char c = (char) statePtr->outEofChar;
-
- (void) ChanWrite(chanPtr, &c, 1, &dummy);
- }
-
- /*
* TIP #219, Tcl Channel Reflection API.
* Move a leftover error message in the channel bypass into the
* interpreter bypass. Just clear it if there is no interpreter.
@@ -7956,47 +7931,18 @@ Tcl_GetChannelOption(
}
}
if (len == 0 || HaveOpt(2, "-eofchar")) {
+ char buf[4] = "";
if (len == 0) {
Tcl_DStringAppendElement(dsPtr, "-eofchar");
}
- if (((flags & (TCL_READABLE|TCL_WRITABLE)) ==
- (TCL_READABLE|TCL_WRITABLE)) && (len == 0)) {
- Tcl_DStringStartSublist(dsPtr);
- }
- if (flags & TCL_READABLE) {
- if (statePtr->inEofChar == 0) {
- Tcl_DStringAppendElement(dsPtr, "");
- } else {
- char buf[4];
-
- sprintf(buf, "%c", statePtr->inEofChar);
- Tcl_DStringAppendElement(dsPtr, buf);
- }
- }
- if (flags & TCL_WRITABLE) {
- if (statePtr->outEofChar == 0) {
- Tcl_DStringAppendElement(dsPtr, "");
- } else {
- char buf[4];
-
- sprintf(buf, "%c", statePtr->outEofChar);
- Tcl_DStringAppendElement(dsPtr, buf);
- }
- }
- if (!(flags & (TCL_READABLE|TCL_WRITABLE))) {
- /*
- * Not readable or writable (e.g. server socket)
- */
-
- Tcl_DStringAppendElement(dsPtr, "");
- }
- if (((flags & (TCL_READABLE|TCL_WRITABLE)) ==
- (TCL_READABLE|TCL_WRITABLE)) && (len == 0)) {
- Tcl_DStringEndSublist(dsPtr);
+ if ((flags & TCL_READABLE) && (statePtr->inEofChar != 0)) {
+ sprintf(buf, "%c", statePtr->inEofChar);
}
if (len > 0) {
+ Tcl_DStringAppend(dsPtr, buf, TCL_INDEX_NONE);
return TCL_OK;
}
+ Tcl_DStringAppendElement(dsPtr, buf);
}
if (len == 0 || HaveOpt(1, "-nocomplainencoding")) {
if (len == 0) {
@@ -8114,7 +8060,7 @@ Tcl_SetChannelOption(
/* State info for channel */
size_t len; /* Length of optionName string. */
size_t argc;
- const char **argv;
+ const char **argv = NULL;
/*
* If the channel is in the middle of a background copy, fail.
@@ -8230,37 +8176,19 @@ Tcl_SetChannelOption(
UpdateInterest(chanPtr);
return TCL_OK;
} else if (HaveOpt(2, "-eofchar")) {
- if (Tcl_SplitList(interp, newValue, &argc, &argv) == TCL_ERROR) {
- return TCL_ERROR;
- }
- if (argc == 0) {
- statePtr->inEofChar = 0;
- statePtr->outEofChar = 0;
- } else if (argc == 1 || argc == 2) {
- int outIndex = (argc - 1);
- int inValue = (int) argv[0][0];
- int outValue = (int) argv[outIndex][0];
-
- if (inValue & 0x80 || outValue & 0x80) {
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "bad value for -eofchar: must be non-NUL ASCII"
- " character", -1));
- }
- Tcl_Free((void *)argv);
- return TCL_ERROR;
- }
+ if (!newValue[0] || (!(newValue[0] & 0x80) && (!newValue[1]
+#ifndef TCL_NO_DEPRECATED
+ || !strcmp(newValue+1, " {}")
+#endif
+ ))) {
if (GotFlag(statePtr, TCL_READABLE)) {
- statePtr->inEofChar = inValue;
- }
- if (GotFlag(statePtr, TCL_WRITABLE)) {
- statePtr->outEofChar = outValue;
+ statePtr->inEofChar = newValue[0];
}
} else {
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "bad value for -eofchar: should be a list of zero,"
- " one, or two elements", -1));
+ "bad value for -eofchar: must be non-NUL ASCII"
+ " character", -1));
}
Tcl_Free((void *)argv);
return TCL_ERROR;
@@ -8388,7 +8316,6 @@ Tcl_SetChannelOption(
statePtr->outputTranslation = TCL_PLATFORM_TRANSLATION;
}
} else if (strcmp(writeMode, "binary") == 0) {
- statePtr->outEofChar = 0;
statePtr->outputTranslation = TCL_TRANSLATE_LF;
Tcl_FreeEncoding(statePtr->encoding);
statePtr->encoding = NULL;
diff --git a/generic/tclIO.h b/generic/tclIO.h
index a4cc602..490f26c 100644
--- a/generic/tclIO.h
+++ b/generic/tclIO.h
@@ -158,8 +158,10 @@ typedef struct ChannelState {
* of line sequences in output? */
int inEofChar; /* If nonzero, use this as a signal of EOF on
* input. */
+#if TCL_MAJOR_VERSION < 9
int outEofChar; /* If nonzero, append this to the channel when
- * it is closed if it is open for writing. */
+ * it is closed if it is open for writing. For Tcl 8.x only */
+#endif
int unreportedError; /* Non-zero if an error report was deferred
* because it happened in the background. The
* value is the POSIX error code. */
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index d479813..4ce27bb 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -1441,23 +1441,21 @@ Tcl_SocketObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
static const char *const socketOptions[] = {
- "-async", "-myaddr", "-myport", "-reuseaddr", "-reuseport", "-server",
- NULL
+ "-async", "-backlog", "-myaddr", "-myport", "-reuseaddr",
+ "-reuseport", "-server", NULL
};
enum socketOptionsEnum {
- SKT_ASYNC, SKT_MYADDR, SKT_MYPORT, SKT_REUSEADDR, SKT_REUSEPORT,
- SKT_SERVER
+ SKT_ASYNC, SKT_BACKLOG, SKT_MYADDR, SKT_MYPORT, SKT_REUSEADDR,
+ SKT_REUSEPORT, SKT_SERVER
} optionIndex;
int a, server = 0, myport = 0, async = 0, reusep = -1,
- reusea = -1;
+ reusea = -1, backlog = -1;
unsigned int flags = 0;
const char *host, *port, *myaddr = NULL;
Tcl_Obj *script = NULL;
Tcl_Channel chan;
- if (TclpHasSockets(interp) != TCL_OK) {
- return TCL_ERROR;
- }
+ TclInitSockets();
for (a = 1; a < objc; a++) {
const char *arg = TclGetString(objv[a]);
@@ -1539,6 +1537,17 @@ Tcl_SocketObjCmd(
return TCL_ERROR;
}
break;
+ case SKT_BACKLOG:
+ a++;
+ if (a >= objc) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ "no argument given for -backlog option", -1));
+ return TCL_ERROR;
+ }
+ if (Tcl_GetIntFromObj(interp, objv[a], &backlog) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
default:
Tcl_Panic("Tcl_SocketObjCmd: bad option index to SocketOptions");
}
@@ -1559,18 +1568,18 @@ Tcl_SocketObjCmd(
wrongNumArgs:
iPtr = (Interp *) interp;
Tcl_WrongNumArgs(interp, 1, objv,
- "?-myaddr addr? ?-myport myport? ?-async? host port");
+ "?-async? ?-myaddr addr? ?-myport myport? host port");
iPtr->flags |= INTERP_ALTERNATE_WRONG_ARGS;
Tcl_WrongNumArgs(interp, 1, objv,
- "-server command ?-reuseaddr boolean? ?-reuseport boolean? "
- "?-myaddr addr? port");
+ "-server command ?-backlog count? ?-myaddr addr? "
+ "?-reuseaddr boolean? ?-reuseport boolean? port");
return TCL_ERROR;
}
- if (!server && (reusea != -1 || reusep != -1)) {
+ if (!server && (reusea != -1 || reusep != -1 || backlog != -1)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "options -reuseaddr and -reuseport are only valid for servers",
- -1));
+ "options -backlog, -reuseaddr, and -reuseport are only valid "
+ "for servers", -1));
return TCL_ERROR;
}
@@ -1615,7 +1624,7 @@ Tcl_SocketObjCmd(
acceptCallbackPtr->script = script;
acceptCallbackPtr->interp = interp;
- chan = Tcl_OpenTcpServerEx(interp, port, host, flags,
+ chan = Tcl_OpenTcpServerEx(interp, port, host, flags, backlog,
AcceptCallbackProc, acceptCallbackPtr);
if (chan == NULL) {
Tcl_DecrRefCount(script);
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c
index 8f86257..f14c5c1 100644
--- a/generic/tclIOSock.c
+++ b/generic/tclIOSock.c
@@ -322,8 +322,8 @@ Tcl_OpenTcpServer(
char portbuf[TCL_INTEGER_SPACE];
TclFormatInt(portbuf, port);
- return Tcl_OpenTcpServerEx(interp, portbuf, host, TCL_TCPSERVER_REUSEADDR,
- acceptProc, callbackData);
+ return Tcl_OpenTcpServerEx(interp, portbuf, host, -1,
+ TCL_TCPSERVER_REUSEADDR, acceptProc, callbackData);
}
/*
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index aa92754..470977e 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -1715,11 +1715,11 @@ Tcl_FSEvalFileEx(
}
/*
- * The eof character is \32 (^Z). This is standard on Windows, and Tcl
- * uses it on every platform to allow for scripted documents. [Bug: 2040]
+ * The eof character is \x1A (^Z). Tcl uses it on every platform to allow
+ * for scripted documents. [Bug: 2040]
*/
- Tcl_SetChannelOption(interp, chan, "-eofchar", "\32 {}");
+ Tcl_SetChannelOption(interp, chan, "-eofchar", "\x1A");
/*
* If the encoding is specified, set the channel to that encoding.
@@ -1851,11 +1851,11 @@ TclNREvalFile(
TclPkgFileSeen(interp, TclGetString(pathPtr));
/*
- * The eof character is \32 (^Z). This is standard on Windows, and Tcl
- * uses it on every platform to allow for scripted documents. [Bug: 2040]
+ * The eof character is \x1A (^Z). Tcl uses it on every platform to allow
+ * for scripted documents. [Bug: 2040]
*/
- Tcl_SetChannelOption(interp, chan, "-eofchar", "\32 {}");
+ Tcl_SetChannelOption(interp, chan, "-eofchar", "\x1A");
/*
* If the encoding is specified, set the channel to that encoding.
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index 1c7cac9..d9bd5c5 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -28,14 +28,14 @@ declare 3 {
void TclAllocateFreeObjects(void)
}
declare 5 {
- int TclCleanupChildren(Tcl_Interp *interp, size_t numPids, Tcl_Pid *pidPtr,
+ int TclCleanupChildren(Tcl_Interp *interp, Tcl_Size numPids, Tcl_Pid *pidPtr,
Tcl_Channel errorChan)
}
declare 6 {
void TclCleanupCommand(Command *cmdPtr)
}
declare 7 {
- size_t TclCopyAndCollapse(size_t count, const char *src, char *dst)
+ Tcl_Size TclCopyAndCollapse(Tcl_Size count, const char *src, char *dst)
}
# Removed in 9.0:
#declare 8 {
@@ -44,7 +44,7 @@ declare 7 {
#}
# TclCreatePipeline unofficially exported for use by BLT.
declare 9 {
- size_t TclCreatePipeline(Tcl_Interp *interp, size_t argc, const char **argv,
+ Tcl_Size TclCreatePipeline(Tcl_Interp *interp, Tcl_Size argc, const char **argv,
Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr,
TclFile *errFilePtr)
}
@@ -67,15 +67,15 @@ declare 16 {
}
declare 22 {
int TclFindElement(Tcl_Interp *interp, const char *listStr,
- size_t listLength, const char **elementPtr, const char **nextPtr,
- size_t *sizePtr, int *bracePtr)
+ Tcl_Size listLength, const char **elementPtr, const char **nextPtr,
+ Tcl_Size *sizePtr, int *bracePtr)
}
declare 23 {
Proc *TclFindProc(Interp *iPtr, const char *procName)
}
# Replaced with macro (see tclInt.h) in Tcl 8.5.0, restored in 8.5.10
declare 24 {
- size_t TclFormatInt(char *buffer, Tcl_WideInt n)
+ Tcl_Size TclFormatInt(char *buffer, Tcl_WideInt n)
}
declare 25 {
void TclFreePackageInfo(Interp *iPtr)
@@ -171,7 +171,7 @@ declare 64 {
int flags)
}
declare 69 {
- void *TclpAlloc(size_t size)
+ void *TclpAlloc(TCL_HASH_TYPE size)
}
declare 74 {
void TclpFree(void *ptr)
@@ -187,7 +187,7 @@ declare 76 {
# void TclpGetTime(Tcl_Time *time)
#}
declare 81 {
- void *TclpRealloc(void *ptr, size_t size)
+ void *TclpRealloc(void *ptr, TCL_HASH_TYPE size)
}
# Removed in 9.0:
#declare 88 {
@@ -241,7 +241,7 @@ declare 109 {
int TclUpdateReturnInfo(Interp *iPtr)
}
declare 110 {
- int TclSockMinimumBuffers(void *sock, size_t size)
+ int TclSockMinimumBuffers(void *sock, Tcl_Size size)
}
# Procedures used in conjunction with Tcl namespaces. They are
@@ -330,9 +330,10 @@ declare 131 {
Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc,
Tcl_ResolveCompiledVarProc *compiledVarProc)
}
-declare 132 {
- int TclpHasSockets(Tcl_Interp *interp)
-}
+# Removed in 9.0:
+#declare 132 {
+# int TclpHasSockets(Tcl_Interp *interp)
+#}
# Removed in 9.0:
#declare 133 {
# struct tm *TclpGetDate(const time_t *time, int useGMT)
@@ -349,7 +350,7 @@ declare 142 {
CompileHookProc *hookProc, void *clientData)
}
declare 143 {
- size_t TclAddLiteralObj(struct CompileEnv *envPtr, Tcl_Obj *objPtr,
+ Tcl_Size TclAddLiteralObj(struct CompileEnv *envPtr, Tcl_Obj *objPtr,
LiteralEntry **litPtrPtr)
}
declare 144 {
@@ -375,8 +376,8 @@ declare 150 {
int TclRegAbout(Tcl_Interp *interp, Tcl_RegExp re)
}
declare 151 {
- void TclRegExpRangeUniChar(Tcl_RegExp re, size_t index, size_t *startPtr,
- size_t *endPtr)
+ void TclRegExpRangeUniChar(Tcl_RegExp re, Tcl_Size index, Tcl_Size *startPtr,
+ Tcl_Size *endPtr)
}
declare 152 {
void TclSetLibraryPath(Tcl_Obj *pathPtr)
@@ -432,7 +433,7 @@ declare 165 {
# New function due to TIP #33
declare 166 {
int TclListObjSetElement(Tcl_Interp *interp, Tcl_Obj *listPtr,
- size_t index, Tcl_Obj *valuePtr)
+ Tcl_Size index, Tcl_Obj *valuePtr)
}
# Removed in 9.0:
@@ -448,20 +449,20 @@ declare 169 {
}
declare 170 {
int TclCheckInterpTraces(Tcl_Interp *interp, const char *command,
- size_t numChars, Command *cmdPtr, int result, int traceFlags,
- size_t objc, Tcl_Obj *const objv[])
+ Tcl_Size numChars, Command *cmdPtr, int result, int traceFlags,
+ Tcl_Size objc, Tcl_Obj *const objv[])
}
declare 171 {
int TclCheckExecutionTraces(Tcl_Interp *interp, const char *command,
- size_t numChars, Command *cmdPtr, int result, int traceFlags,
- size_t objc, Tcl_Obj *const objv[])
+ Tcl_Size numChars, Command *cmdPtr, int result, int traceFlags,
+ Tcl_Size objc, Tcl_Obj *const objv[])
}
declare 172 {
int TclInThreadExit(void)
}
declare 173 {
- int TclUniCharMatch(const Tcl_UniChar *string, size_t strLen,
- const Tcl_UniChar *pattern, size_t ptnLen, int flags)
+ int TclUniCharMatch(const Tcl_UniChar *string, Tcl_Size strLen,
+ const Tcl_UniChar *pattern, Tcl_Size ptnLen, int flags)
}
declare 175 {
int TclCallVarTraces(Interp *iPtr, Var *arrayPtr, Var *varPtr,
@@ -535,7 +536,7 @@ declare 214 {
void TclSetObjNameOfExecutable(Tcl_Obj *name, Tcl_Encoding encoding)
}
declare 215 {
- void *TclStackAlloc(Tcl_Interp *interp, size_t numBytes)
+ void *TclStackAlloc(Tcl_Interp *interp, Tcl_Size numBytes)
}
declare 216 {
void TclStackFree(Tcl_Interp *interp, void *freePtr)
@@ -554,13 +555,13 @@ declare 224 {
}
declare 225 {
Tcl_Obj *TclTraceDictPath(Tcl_Interp *interp, Tcl_Obj *rootPtr,
- size_t keyc, Tcl_Obj *const keyv[], int flags)
+ Tcl_Size keyc, Tcl_Obj *const keyv[], int flags)
}
declare 226 {
int TclObjBeingDeleted(Tcl_Obj *objPtr)
}
declare 227 {
- void TclSetNsPath(Namespace *nsPtr, size_t pathLength,
+ void TclSetNsPath(Namespace *nsPtr, Tcl_Size pathLength,
Tcl_Namespace *pathAry[])
}
declare 229 {
@@ -612,7 +613,7 @@ declare 238 {
}
declare 239 {
int TclNRInterpProcCore(Tcl_Interp *interp, Tcl_Obj *procNameObj,
- size_t skip, ProcErrorProc *errorProc)
+ Tcl_Size skip, ProcErrorProc *errorProc)
}
declare 240 {
int TclNRRunCallbacks(Tcl_Interp *interp, int result,
@@ -623,7 +624,7 @@ declare 241 {
const CmdFrame *invoker, int word)
}
declare 242 {
- int TclNREvalObjv(Tcl_Interp *interp, size_t objc,
+ int TclNREvalObjv(Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[], int flags, Command *cmdPtr)
}
@@ -640,8 +641,8 @@ declare 245 {
Tcl_HashTable *TclGetNamespaceCommandTable(Tcl_Namespace *nsPtr)
}
declare 246 {
- int TclInitRewriteEnsemble(Tcl_Interp *interp, size_t numRemoved,
- size_t numInserted, Tcl_Obj *const *objv)
+ int TclInitRewriteEnsemble(Tcl_Interp *interp, Tcl_Size numRemoved,
+ Tcl_Size numInserted, Tcl_Obj *const *objv)
}
declare 247 {
void TclResetRewriteEnsemble(Tcl_Interp *interp, int isRootEnsemble)
@@ -663,8 +664,8 @@ declare 250 {
# Allow extensions for optimization
declare 251 {
- size_t TclRegisterLiteral(void *envPtr,
- const char *bytes, size_t length, int flags)
+ Tcl_Size TclRegisterLiteral(void *envPtr,
+ const char *bytes, Tcl_Size length, int flags)
}
# Exporting of the internal API to variables.
diff --git a/generic/tclInt.h b/generic/tclInt.h
index ad21b66..1b817e9 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -105,6 +105,12 @@
#endif
/*
+ * Maximum *signed* value that can be stored in a Tcl_Size type. This is
+ * primarily used for checking overflows in dynamically allocating memory.
+ */
+#define TCL_SIZE_SMAX ((((Tcl_Size) 1) << ((8*sizeof(Tcl_Size)) - 1)) - 1)
+
+/*
* Macros used to cast between pointers and integers (e.g. when storing an int
* in ClientData), on 64-bit architectures they avoid gcc warning about "cast
* to/from pointer from/to integer of different size".
@@ -171,7 +177,7 @@ typedef struct Tcl_ResolvedVarInfo {
} Tcl_ResolvedVarInfo;
typedef int (Tcl_ResolveCompiledVarProc)(Tcl_Interp *interp,
- const char *name, size_t length, Tcl_Namespace *context,
+ const char *name, Tcl_Size length, Tcl_Namespace *context,
Tcl_ResolvedVarInfo **rPtr);
typedef int (Tcl_ResolveVarProc)(Tcl_Interp *interp, const char *name,
@@ -224,7 +230,9 @@ typedef struct NamespacePathEntry NamespacePathEntry;
typedef struct TclVarHashTable {
Tcl_HashTable table;
struct Namespace *nsPtr;
+#if TCL_MAJOR_VERSION > 8
struct Var *arrayPtr;
+#endif /* TCL_MAJOR_VERSION > 8 */
} TclVarHashTable;
/*
@@ -283,11 +291,11 @@ typedef struct Namespace {
* namespace. */
int flags; /* OR-ed combination of the namespace status
* flags NS_DYING and NS_DEAD listed below. */
- size_t activationCount; /* Number of "activations" or active call
+ Tcl_Size activationCount; /* Number of "activations" or active call
* frames for this namespace that are on the
* Tcl call stack. The namespace won't be
* freed until activationCount becomes zero. */
- size_t refCount; /* Count of references by namespaceName
+ Tcl_Size refCount; /* Count of references by namespaceName
* objects. The namespace can't be freed until
* refCount becomes zero. */
Tcl_HashTable cmdTable; /* Contains all the commands currently
@@ -308,16 +316,16 @@ typedef struct Namespace {
* commands; however, no namespace qualifiers
* are allowed. NULL if no export patterns are
* registered. */
- size_t numExportPatterns; /* Number of export patterns currently
+ Tcl_Size numExportPatterns; /* Number of export patterns currently
* registered using "namespace export". */
- size_t maxExportPatterns; /* Number of export patterns for which space
+ Tcl_Size maxExportPatterns; /* Number of export patterns for which space
* is currently allocated. */
- size_t cmdRefEpoch; /* Incremented if a newly added command
+ Tcl_Size cmdRefEpoch; /* Incremented if a newly added command
* shadows a command for which this namespace
* has already cached a Command* pointer; this
* causes all its cached Command* pointers to
* be invalidated. */
- size_t resolverEpoch; /* Incremented whenever (a) the name
+ Tcl_Size resolverEpoch; /* Incremented whenever (a) the name
* resolution rules change for this namespace
* or (b) a newly added command shadows a
* command that is compiled to bytecodes. This
@@ -344,7 +352,7 @@ typedef struct Namespace {
* LookupCompiledLocal to resolve variable
* references within the namespace at compile
* time. */
- size_t exportLookupEpoch; /* Incremented whenever a command is added to
+ Tcl_Size exportLookupEpoch; /* Incremented whenever a command is added to
* a namespace, removed from a namespace or
* the exports of a namespace are changed.
* Allows TIP#112-driven command lists to be
@@ -355,7 +363,7 @@ typedef struct Namespace {
Tcl_Obj *unknownHandlerPtr; /* A script fragment to be used when command
* resolution in this namespace fails. TIP
* 181. */
- size_t commandPathLength; /* The length of the explicit path. */
+ Tcl_Size commandPathLength; /* The length of the explicit path. */
NamespacePathEntry *commandPathArray;
/* The explicit path of the namespace as an
* array. */
@@ -444,7 +452,7 @@ typedef struct EnsembleConfig {
* if the command has been deleted (or never
* existed; the global namespace never has an
* ensemble command.) */
- size_t epoch; /* The epoch at which this ensemble's table of
+ Tcl_Size epoch; /* The epoch at which this ensemble's table of
* exported commands is valid. */
char **subcommandArrayPtr; /* Array of ensemble subcommand names. At all
* consistent points, this will have the same
@@ -501,7 +509,7 @@ typedef struct EnsembleConfig {
* core, presumably because the ensemble
* itself has been updated. */
Tcl_Obj *parameterList; /* List of ensemble parameter names. */
- size_t numParameters; /* Cached number of parameters. This is either
+ Tcl_Size numParameters; /* Cached number of parameters. This is either
* 0 (if the parameterList field is NULL) or
* the length of the list in the parameterList
* field. */
@@ -557,7 +565,7 @@ typedef struct CommandTrace {
struct CommandTrace *nextPtr;
/* Next in list of traces associated with a
* particular command. */
- size_t refCount; /* Used to ensure this structure is not
+ Tcl_Size refCount; /* Used to ensure this structure is not
* deleted too early. Keeps track of how many
* pieces of code have a pointer to this
* structure. */
@@ -630,7 +638,7 @@ typedef struct Var {
typedef struct VarInHash {
Var var;
- size_t refCount; /* Counts number of active uses of this
+ Tcl_Size refCount; /* Counts number of active uses of this
* variable: 1 for the entry in the hash
* table, 1 for each additional variable whose
* linkPtr points here, 1 for each nested
@@ -955,9 +963,9 @@ typedef struct CompiledLocal {
/* Next compiler-recognized local variable for
* this procedure, or NULL if this is the last
* local. */
- size_t nameLength; /* The number of bytes in local variable's name.
+ Tcl_Size nameLength; /* The number of bytes in local variable's name.
* Among others used to speed up var lookups. */
- size_t frameIndex; /* Index in the array of compiler-assigned
+ Tcl_Size frameIndex; /* Index in the array of compiler-assigned
* variables in the procedure call frame. */
#if TCL_MAJOR_VERSION < 9
int flags;
@@ -994,7 +1002,7 @@ typedef struct CompiledLocal {
typedef struct Proc {
struct Interp *iPtr; /* Interpreter for which this command is
* defined. */
- size_t refCount; /* Reference count: 1 if still present in
+ Tcl_Size refCount; /* Reference count: 1 if still present in
* command table plus 1 for each call to the
* procedure that is currently active. This
* structure can be freed when refCount
@@ -1005,8 +1013,8 @@ typedef struct Proc {
* procedure. */
Tcl_Obj *bodyPtr; /* Points to the ByteCode object for
* procedure's body command. */
- size_t numArgs; /* Number of formal parameters. */
- size_t numCompiledLocals; /* Count of local variables recognized by the
+ Tcl_Size numArgs; /* Number of formal parameters. */
+ Tcl_Size numCompiledLocals; /* Count of local variables recognized by the
* compiler including arguments and
* temporaries. */
CompiledLocal *firstLocalPtr;
@@ -1033,9 +1041,13 @@ typedef void (ProcErrorProc)(Tcl_Interp *interp, Tcl_Obj *procNameObj);
*/
typedef struct Trace {
- int level; /* Only trace commands at nesting level less
+ Tcl_Size level; /* Only trace commands at nesting level less
* than or equal to this. */
+#if TCL_MAJOR_VERSION > 8
+ Tcl_CmdObjTraceProc2 *proc; /* Procedure to call to trace command. */
+#else
Tcl_CmdObjTraceProc *proc; /* Procedure to call to trace command. */
+#endif
void *clientData; /* Arbitrary value to pass to proc. */
struct Trace *nextPtr; /* Next in list of traces for this interp. */
int flags; /* Flags governing the trace - see
@@ -1111,8 +1123,8 @@ typedef struct AssocData {
*/
typedef struct LocalCache {
- size_t refCount;
- size_t numVars;
+ Tcl_Size refCount;
+ Tcl_Size numVars;
Tcl_Obj *varName0;
} LocalCache;
@@ -1132,7 +1144,7 @@ typedef struct CallFrame {
* If FRAME_IS_PROC is set, the frame was
* pushed to execute a Tcl procedure and may
* have local vars. */
- size_t objc; /* This and objv below describe the arguments
+ Tcl_Size objc; /* This and objv below describe the arguments
* for this procedure call. */
Tcl_Obj *const *objv; /* Array of argument objects. */
struct CallFrame *callerPtr;
@@ -1146,7 +1158,7 @@ typedef struct CallFrame {
* callerPtr unless an "uplevel" command or
* something equivalent was active in the
* caller). */
- size_t level; /* Level of this procedure, for "uplevel"
+ Tcl_Size level; /* Level of this procedure, for "uplevel"
* purposes (i.e. corresponds to nesting of
* callerVarPtr's, not callerPtr's). 1 for
* outermost procedure, 0 for top-level. */
@@ -1160,7 +1172,7 @@ typedef struct CallFrame {
* recognized by the compiler, or created at
* execution time through, e.g., upvar.
* Initially NULL and created if needed. */
- size_t numCompiledLocals; /* Count of local variables recognized
+ Tcl_Size numCompiledLocals; /* Count of local variables recognized
* by the compiler including arguments. */
Var *compiledLocals; /* Points to the array of local variables
* recognized by the compiler. The compiler
@@ -1222,7 +1234,7 @@ typedef struct CmdFrame {
int level; /* Number of frames in stack, prevent O(n)
* scan of list. */
int *line; /* Lines the words of the command start on. */
- size_t nline;
+ Tcl_Size nline;
CallFrame *framePtr; /* Procedure activation record, may be
* NULL. */
struct CmdFrame *nextPtr; /* Link to calling frame. */
@@ -1266,7 +1278,7 @@ typedef struct CmdFrame {
} data;
Tcl_Obj *cmdObj;
const char *cmd; /* The executed command, if possible... */
- size_t len; /* ... and its length. */
+ Tcl_Size len; /* ... and its length. */
const struct CFWordBC *litarg;
/* Link to set of literal arguments which have
* ben pushed on the lineLABCPtr stack by
@@ -1276,16 +1288,16 @@ typedef struct CmdFrame {
typedef struct CFWord {
CmdFrame *framePtr; /* CmdFrame to access. */
- size_t word; /* Index of the word in the command. */
- size_t refCount; /* Number of times the word is on the
+ Tcl_Size word; /* Index of the word in the command. */
+ Tcl_Size refCount; /* Number of times the word is on the
* stack. */
} CFWord;
typedef struct CFWordBC {
CmdFrame *framePtr; /* CmdFrame to access. */
- size_t pc; /* Instruction pointer of a command in
+ Tcl_Size pc; /* Instruction pointer of a command in
* ExtCmdLoc.loc[.] */
- size_t word; /* Index of word in
+ Tcl_Size word; /* Index of word in
* ExtCmdLoc.loc[cmd]->line[.] */
struct CFWordBC *prevPtr; /* Previous entry in stack for same Tcl_Obj. */
struct CFWordBC *nextPtr; /* Next entry for same command call. See
@@ -1314,7 +1326,7 @@ typedef struct CFWordBC {
#define CLL_END (-1)
typedef struct ContLineLoc {
- size_t num; /* Number of entries in loc, not counting the
+ Tcl_Size num; /* Number of entries in loc, not counting the
* final -1 marker entry. */
int loc[TCLFLEXARRAY];/* Table of locations, as character offsets.
* The table is allocated as part of the
@@ -1364,7 +1376,7 @@ typedef struct {
* proc field is NULL. */
} ExtraFrameInfoField;
typedef struct {
- size_t length; /* Length of array. */
+ Tcl_Size length; /* Length of array. */
ExtraFrameInfoField fields[2];
/* Really as long as necessary, but this is
* long enough for nearly anything. */
@@ -1495,11 +1507,11 @@ typedef struct CoroutineData {
CorContext running;
Tcl_HashTable *lineLABCPtr; /* See Interp.lineLABCPtr */
void *stackLevel;
- size_t auxNumLevels; /* While the coroutine is running the
+ Tcl_Size auxNumLevels; /* While the coroutine is running the
* numLevels of the create/resume command is
* stored here; for suspended coroutines it
* holds the nesting numLevels at yield. */
- size_t nargs; /* Number of args required for resuming this
+ Tcl_Size nargs; /* Number of args required for resuming this
* coroutine; COROUTINE_ARGUMENTS_SINGLE_OPTIONAL means "0 or 1"
* (default), COROUTINE_ARGUMENTS_ARBITRARY means "any" */
Tcl_Obj *yieldPtr; /* The command to yield to. Stored here in
@@ -1545,7 +1557,7 @@ typedef struct LiteralEntry {
* NULL if end of chain. */
Tcl_Obj *objPtr; /* Points to Tcl object that holds the
* literal's bytes and length. */
- size_t refCount; /* If in an interpreter's global literal
+ Tcl_Size refCount; /* If in an interpreter's global literal
* table, the number of ByteCode structures
* that share the literal object; the literal
* entry can be freed when refCount drops to
@@ -1687,12 +1699,12 @@ typedef struct Command {
* recreated). */
Namespace *nsPtr; /* Points to the namespace containing this
* command. */
- size_t refCount; /* 1 if in command hashtable plus 1 for each
+ Tcl_Size refCount; /* 1 if in command hashtable plus 1 for each
* reference from a CmdName Tcl object
* representing a command's name in a ByteCode
* instruction sequence. This structure can be
* freed when refCount becomes zero. */
- size_t cmdEpoch; /* Incremented to invalidate any references
+ Tcl_Size cmdEpoch; /* Incremented to invalidate any references
* that point to this command when it is
* renamed, deleted, hidden, or exposed. */
CompileProc *compileProc; /* Procedure called to compile command. NULL
@@ -1881,12 +1893,12 @@ typedef struct Interp {
* tclVar.c for usage.
*/
- size_t numLevels; /* Keeps track of how many nested calls to
+ Tcl_Size numLevels; /* Keeps track of how many nested calls to
* Tcl_Eval are in progress for this
* interpreter. It's used to delay deletion of
* the table until all Tcl_Eval invocations
* are completed. */
- size_t maxNestingDepth; /* If numLevels exceeds this value then Tcl
+ Tcl_Size maxNestingDepth; /* If numLevels exceeds this value then Tcl
* assumes that infinite recursion has
* occurred and it generates an error. */
CallFrame *framePtr; /* Points to top-most in stack of all nested
@@ -1926,7 +1938,7 @@ typedef struct Interp {
* Miscellaneous information:
*/
- size_t cmdCount; /* Total number of times a command procedure
+ Tcl_Size cmdCount; /* Total number of times a command procedure
* has been called for this interpreter. */
int evalFlags; /* Flags to control next call to Tcl_Eval.
* Normally zero, but may be set before
@@ -1940,7 +1952,7 @@ typedef struct Interp {
* compiled by the interpreter. Indexed by the
* string representations of literals. Used to
* avoid creating duplicate objects. */
- size_t compileEpoch; /* Holds the current "compilation epoch" for
+ Tcl_Size compileEpoch; /* Holds the current "compilation epoch" for
* this interpreter. This is incremented to
* invalidate existing ByteCodes when, e.g., a
* command with a compile procedure is
@@ -1987,7 +1999,7 @@ typedef struct Interp {
/* First in list of active traces for interp,
* or NULL if no active traces. */
- size_t tracesForbiddingInline; /* Count of traces (in the list headed by
+ Tcl_Size tracesForbiddingInline; /* Count of traces (in the list headed by
* tracePtr) that forbid inline bytecode
* compilation. */
@@ -2017,7 +2029,7 @@ typedef struct Interp {
* as flag values the same as the 'active'
* field. */
- size_t cmdCount; /* Limit for how many commands to execute in
+ Tcl_Size cmdCount; /* Limit for how many commands to execute in
* the interpreter. */
LimitHandler *cmdHandlers;
/* Handlers to execute when the limit is
@@ -2053,9 +2065,9 @@ typedef struct Interp {
* *root* ensemble command? (Nested ensembles
* don't rewrite this.) NULL if we're not
* processing an ensemble. */
- size_t numRemovedObjs; /* How many arguments have been stripped off
+ Tcl_Size numRemovedObjs; /* How many arguments have been stripped off
* because of ensemble processing. */
- size_t numInsertedObjs; /* How many of the current arguments were
+ Tcl_Size numInsertedObjs; /* How many of the current arguments were
* inserted by an ensemble. */
} ensembleRewrite;
@@ -2428,25 +2440,14 @@ typedef enum TclEolTranslation {
#define TCL_INVOKE_NO_UNKNOWN (1<<1)
#define TCL_INVOKE_NO_TRACEBACK (1<<2)
-/*
- * ListSizeT is the type for holding list element counts. It's defined
- * simplify sharing source between Tcl8 and Tcl9.
- */
#if TCL_MAJOR_VERSION > 8
-
-typedef size_t ListSizeT;
-
/*
* SSIZE_MAX, NOT SIZE_MAX as negative differences need to be expressed
- * between values of the ListSizeT type so limit the range to signed
+ * between values of the Tcl_Size type so limit the range to signed
*/
-#define ListSizeT_MAX ((ListSizeT)PTRDIFF_MAX)
-
+# define ListSizeT_MAX ((Tcl_Size)PTRDIFF_MAX)
#else
-
-typedef int ListSizeT;
-#define ListSizeT_MAX INT_MAX
-
+# define ListSizeT_MAX INT_MAX
#endif
/*
@@ -2475,9 +2476,9 @@ typedef int ListSizeT;
*
*/
typedef struct ListStore {
- ListSizeT firstUsed; /* Index of first slot in use within slots[] */
- ListSizeT numUsed; /* Number of slots in use (starting firstUsed) */
- ListSizeT numAllocated; /* Total number of slots[] array slots. */
+ Tcl_Size firstUsed; /* Index of first slot in use within slots[] */
+ Tcl_Size numUsed; /* Number of slots in use (starting firstUsed) */
+ Tcl_Size numAllocated; /* Total number of slots[] array slots. */
size_t refCount; /* Number of references to this instance */
int flags; /* LISTSTORE_* flags */
Tcl_Obj *slots[TCLFLEXARRAY]; /* Variable size array. Grown as needed */
@@ -2500,8 +2501,8 @@ typedef struct ListStore {
* See comments above for ListStore
*/
typedef struct ListSpan {
- ListSizeT spanStart; /* Starting index of the span */
- ListSizeT spanLength; /* Number of elements in the span */
+ Tcl_Size spanStart; /* Starting index of the span */
+ Tcl_Size spanLength; /* Number of elements in the span */
size_t refCount; /* Count of references to this span record */
} ListSpan;
#ifndef LIST_SPAN_THRESHOLD /* May be set on build line */
@@ -2651,11 +2652,20 @@ typedef struct ListRep {
* WARNING: these macros eval their args more than once.
*/
+#if TCL_MAJOR_VERSION > 8
#define TclGetBooleanFromObj(interp, objPtr, intPtr) \
(((objPtr)->typePtr == &tclIntType \
|| (objPtr)->typePtr == &tclBooleanType) \
? (*(intPtr) = ((objPtr)->internalRep.wideValue!=0), TCL_OK) \
: Tcl_GetBooleanFromObj((interp), (objPtr), (intPtr)))
+#else
+#define TclGetBooleanFromObj(interp, objPtr, intPtr) \
+ (((objPtr)->typePtr == &tclIntType) \
+ ? (*(intPtr) = ((objPtr)->internalRep.wideValue!=0), TCL_OK) \
+ : ((objPtr)->typePtr == &tclBooleanType) \
+ ? (*(intPtr) = ((objPtr)->internalRep.longValue!=0), TCL_OK) \
+ : Tcl_GetBooleanFromObj((interp), (objPtr), (intPtr)))
+#endif
#ifdef TCL_WIDE_INT_IS_LONG
#define TclGetLongFromObj(interp, objPtr, longPtr) \
@@ -2679,8 +2689,8 @@ typedef struct ListRep {
: Tcl_GetIntFromObj((interp), (objPtr), (intPtr)))
#define TclGetIntForIndexM(interp, objPtr, endValue, idxPtr) \
((((objPtr)->typePtr == &tclIntType) && ((objPtr)->internalRep.wideValue >= 0) \
- && ((Tcl_WideUInt)(objPtr)->internalRep.wideValue <= (size_t)(endValue) + 1)) \
- ? ((*(idxPtr) = (size_t)(objPtr)->internalRep.wideValue), TCL_OK) \
+ && ((Tcl_WideUInt)(objPtr)->internalRep.wideValue <= (Tcl_WideUInt)(endValue + 1))) \
+ ? ((*(idxPtr) = (objPtr)->internalRep.wideValue), TCL_OK) \
: Tcl_GetIntForIndex((interp), (objPtr), (endValue), (idxPtr)))
/*
@@ -2803,7 +2813,7 @@ typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, TCL_HASH_TYPE *len
*/
typedef struct ProcessGlobalValue {
- size_t epoch; /* Epoch counter to detect changes in the
+ Tcl_Size epoch; /* Epoch counter to detect changes in the
* global value. */
TCL_HASH_TYPE numBytes; /* Length of the global string. */
char *value; /* The global string value. */
@@ -2975,7 +2985,7 @@ typedef struct ForIterData {
Tcl_Obj *body; /* Loop body. */
Tcl_Obj *next; /* Loop step script, NULL for 'while'. */
const char *msg; /* Error message part. */
- size_t word; /* Index of the body script in the command */
+ Tcl_Size word; /* Index of the body script in the command */
} ForIterData;
/* TIP #357 - Structure doing the bookkeeping of handles for Tcl_LoadFile
@@ -3019,6 +3029,7 @@ struct Tcl_LoadHandle_ {
*----------------------------------------------------------------
*/
+#if TCL_MAJOR_VERSION > 8
MODULE_SCOPE void TclAppendBytesToByteArray(Tcl_Obj *objPtr,
const unsigned char *bytes, size_t len);
MODULE_SCOPE int TclNREvalCmd(Tcl_Interp *interp, Tcl_Obj *objPtr,
@@ -3269,6 +3280,11 @@ MODULE_SCOPE void TclpFinalizeMutex(Tcl_Mutex *mutexPtr);
MODULE_SCOPE void TclpFinalizeNotifier(void *clientData);
MODULE_SCOPE void TclpFinalizePipes(void);
MODULE_SCOPE void TclpFinalizeSockets(void);
+#ifdef _WIN32
+MODULE_SCOPE void TclInitSockets(void);
+#else
+#define TclInitSockets() /* do nothing */
+#endif
MODULE_SCOPE int TclCreateSocketAddress(Tcl_Interp *interp,
struct addrinfo **addrlist,
const char *host, int port, int willBind,
@@ -3299,7 +3315,7 @@ MODULE_SCOPE int TclCrossFilesystemCopy(Tcl_Interp *interp,
MODULE_SCOPE int TclpMatchInDirectory(Tcl_Interp *interp,
Tcl_Obj *resultPtr, Tcl_Obj *pathPtr,
const char *pattern, Tcl_GlobTypeData *types);
-MODULE_SCOPE void *TclpGetNativeCwd(void *clientData);
+MODULE_SCOPE void *TclpGetNativeCwd(void *clientData);
MODULE_SCOPE Tcl_FSDupInternalRepProc TclNativeDupInternalRep;
MODULE_SCOPE Tcl_Obj * TclpObjLink(Tcl_Obj *pathPtr, Tcl_Obj *toPtr,
int linkType);
@@ -4135,10 +4151,11 @@ MODULE_SCOPE Tcl_Obj * TclGetArrayDefault(Var *arrayPtr);
MODULE_SCOPE int TclIndexEncode(Tcl_Interp *interp, Tcl_Obj *objPtr,
size_t before, size_t after, int *indexPtr);
MODULE_SCOPE size_t TclIndexDecode(int encoded, size_t endValue);
+#endif /* TCL_MAJOR_VERSION > 8 */
/* Constants used in index value encoding routines. */
-#define TCL_INDEX_END ((size_t)-2)
-#define TCL_INDEX_START ((size_t)0)
+#define TCL_INDEX_END ((Tcl_Size)-2)
+#define TCL_INDEX_START ((Tcl_Size)0)
/*
*----------------------------------------------------------------------
@@ -4623,8 +4640,8 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
* of counting along a string of all one-byte characters. The ANSI C
* "prototype" for this macro is:
*
- * MODULE_SCOPE void TclNumUtfCharsM(size_t numChars, const char *bytes,
- * size_t numBytes);
+ * MODULE_SCOPE void TclNumUtfCharsM(int numChars, const char *bytes,
+ * int numBytes);
*----------------------------------------------------------------
*/
@@ -4796,7 +4813,7 @@ MODULE_SCOPE Tcl_LibraryInitProc Procbodytest_SafeInit;
TclAllocObjStorage(objPtr); \
(objPtr)->refCount = 0; \
(objPtr)->bytes = NULL; \
- (objPtr)->internalRep.wideValue = ((_w) == TCL_INDEX_NONE) ? -1 : (Tcl_WideInt)(_w); \
+ (objPtr)->internalRep.wideValue = ((size_t)(_w) == (size_t)TCL_INDEX_NONE) ? -1 : (Tcl_WideInt)(_w); \
(objPtr)->typePtr = &tclIntType; \
TCL_DTRACE_OBJ_CREATE(objPtr); \
} while (0)
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index d19bc7e..eaa7d95 100644
--- a/generic/tclIntDecls.h
+++ b/generic/tclIntDecls.h
@@ -51,16 +51,16 @@ EXTERN void TclAllocateFreeObjects(void);
/* Slot 4 is reserved */
/* 5 */
EXTERN int TclCleanupChildren(Tcl_Interp *interp,
- size_t numPids, Tcl_Pid *pidPtr,
+ Tcl_Size numPids, Tcl_Pid *pidPtr,
Tcl_Channel errorChan);
/* 6 */
EXTERN void TclCleanupCommand(Command *cmdPtr);
/* 7 */
-EXTERN size_t TclCopyAndCollapse(size_t count, const char *src,
+EXTERN Tcl_Size TclCopyAndCollapse(Tcl_Size count, const char *src,
char *dst);
/* Slot 8 is reserved */
/* 9 */
-EXTERN size_t TclCreatePipeline(Tcl_Interp *interp, size_t argc,
+EXTERN Tcl_Size TclCreatePipeline(Tcl_Interp *interp, Tcl_Size argc,
const char **argv, Tcl_Pid **pidArrayPtr,
TclFile *inPipePtr, TclFile *outPipePtr,
TclFile *errFilePtr);
@@ -87,14 +87,14 @@ EXTERN void TclExprFloatError(Tcl_Interp *interp, double value);
/* Slot 21 is reserved */
/* 22 */
EXTERN int TclFindElement(Tcl_Interp *interp,
- const char *listStr, size_t listLength,
+ const char *listStr, Tcl_Size listLength,
const char **elementPtr,
- const char **nextPtr, size_t *sizePtr,
+ const char **nextPtr, Tcl_Size *sizePtr,
int *bracePtr);
/* 23 */
EXTERN Proc * TclFindProc(Interp *iPtr, const char *procName);
/* 24 */
-EXTERN size_t TclFormatInt(char *buffer, Tcl_WideInt n);
+EXTERN Tcl_Size TclFormatInt(char *buffer, Tcl_WideInt n);
/* 25 */
EXTERN void TclFreePackageInfo(Interp *iPtr);
/* Slot 26 is reserved */
@@ -180,7 +180,7 @@ EXTERN int TclObjInvoke(Tcl_Interp *interp, int objc,
/* Slot 67 is reserved */
/* Slot 68 is reserved */
/* 69 */
-EXTERN void * TclpAlloc(size_t size);
+EXTERN void * TclpAlloc(TCL_HASH_TYPE size);
/* Slot 70 is reserved */
/* Slot 71 is reserved */
/* Slot 72 is reserved */
@@ -196,7 +196,7 @@ EXTERN unsigned long long TclpGetSeconds(void);
/* Slot 79 is reserved */
/* Slot 80 is reserved */
/* 81 */
-EXTERN void * TclpRealloc(void *ptr, size_t size);
+EXTERN void * TclpRealloc(void *ptr, TCL_HASH_TYPE size);
/* Slot 82 is reserved */
/* Slot 83 is reserved */
/* Slot 84 is reserved */
@@ -244,7 +244,7 @@ EXTERN void TclTeardownNamespace(Namespace *nsPtr);
/* 109 */
EXTERN int TclUpdateReturnInfo(Interp *iPtr);
/* 110 */
-EXTERN int TclSockMinimumBuffers(void *sock, size_t size);
+EXTERN int TclSockMinimumBuffers(void *sock, Tcl_Size size);
/* 111 */
EXTERN void Tcl_AddInterpResolvers(Tcl_Interp *interp,
const char *name,
@@ -292,8 +292,7 @@ EXTERN void Tcl_SetNamespaceResolvers(
Tcl_ResolveCmdProc *cmdProc,
Tcl_ResolveVarProc *varProc,
Tcl_ResolveCompiledVarProc *compiledVarProc);
-/* 132 */
-EXTERN int TclpHasSockets(Tcl_Interp *interp);
+/* Slot 132 is reserved */
/* Slot 133 is reserved */
/* Slot 134 is reserved */
/* Slot 135 is reserved */
@@ -310,7 +309,7 @@ EXTERN int TclSetByteCodeFromAny(Tcl_Interp *interp,
Tcl_Obj *objPtr, CompileHookProc *hookProc,
void *clientData);
/* 143 */
-EXTERN size_t TclAddLiteralObj(struct CompileEnv *envPtr,
+EXTERN Tcl_Size TclAddLiteralObj(struct CompileEnv *envPtr,
Tcl_Obj *objPtr, LiteralEntry **litPtrPtr);
/* 144 */
EXTERN void TclHideLiteral(Tcl_Interp *interp,
@@ -328,8 +327,8 @@ EXTERN void TclHandleRelease(TclHandle handle);
/* 150 */
EXTERN int TclRegAbout(Tcl_Interp *interp, Tcl_RegExp re);
/* 151 */
-EXTERN void TclRegExpRangeUniChar(Tcl_RegExp re, size_t index,
- size_t *startPtr, size_t *endPtr);
+EXTERN void TclRegExpRangeUniChar(Tcl_RegExp re, Tcl_Size index,
+ Tcl_Size *startPtr, Tcl_Size *endPtr);
/* 152 */
EXTERN void TclSetLibraryPath(Tcl_Obj *pathPtr);
/* 153 */
@@ -359,7 +358,7 @@ EXTERN void TclExpandCodeArray(void *envPtr);
EXTERN void TclpSetInitialEncodings(void);
/* 166 */
EXTERN int TclListObjSetElement(Tcl_Interp *interp,
- Tcl_Obj *listPtr, size_t index,
+ Tcl_Obj *listPtr, Tcl_Size index,
Tcl_Obj *valuePtr);
/* Slot 167 is reserved */
/* Slot 168 is reserved */
@@ -368,20 +367,20 @@ EXTERN int TclpUtfNcmp2(const char *s1, const char *s2,
size_t n);
/* 170 */
EXTERN int TclCheckInterpTraces(Tcl_Interp *interp,
- const char *command, size_t numChars,
+ const char *command, Tcl_Size numChars,
Command *cmdPtr, int result, int traceFlags,
- size_t objc, Tcl_Obj *const objv[]);
+ Tcl_Size objc, Tcl_Obj *const objv[]);
/* 171 */
EXTERN int TclCheckExecutionTraces(Tcl_Interp *interp,
- const char *command, size_t numChars,
+ const char *command, Tcl_Size numChars,
Command *cmdPtr, int result, int traceFlags,
- size_t objc, Tcl_Obj *const objv[]);
+ Tcl_Size objc, Tcl_Obj *const objv[]);
/* 172 */
EXTERN int TclInThreadExit(void);
/* 173 */
EXTERN int TclUniCharMatch(const Tcl_UniChar *string,
- size_t strLen, const Tcl_UniChar *pattern,
- size_t ptnLen, int flags);
+ Tcl_Size strLen, const Tcl_UniChar *pattern,
+ Tcl_Size ptnLen, int flags);
/* Slot 174 is reserved */
/* 175 */
EXTERN int TclCallVarTraces(Interp *iPtr, Var *arrayPtr,
@@ -452,7 +451,7 @@ EXTERN Tcl_Obj * TclGetObjNameOfExecutable(void);
EXTERN void TclSetObjNameOfExecutable(Tcl_Obj *name,
Tcl_Encoding encoding);
/* 215 */
-EXTERN void * TclStackAlloc(Tcl_Interp *interp, size_t numBytes);
+EXTERN void * TclStackAlloc(Tcl_Interp *interp, Tcl_Size numBytes);
/* 216 */
EXTERN void TclStackFree(Tcl_Interp *interp, void *freePtr);
/* 217 */
@@ -471,12 +470,12 @@ EXTERN void TclPopStackFrame(Tcl_Interp *interp);
EXTERN TclPlatformType * TclGetPlatform(void);
/* 225 */
EXTERN Tcl_Obj * TclTraceDictPath(Tcl_Interp *interp,
- Tcl_Obj *rootPtr, size_t keyc,
+ Tcl_Obj *rootPtr, Tcl_Size keyc,
Tcl_Obj *const keyv[], int flags);
/* 226 */
EXTERN int TclObjBeingDeleted(Tcl_Obj *objPtr);
/* 227 */
-EXTERN void TclSetNsPath(Namespace *nsPtr, size_t pathLength,
+EXTERN void TclSetNsPath(Namespace *nsPtr, Tcl_Size pathLength,
Tcl_Namespace *pathAry[]);
/* Slot 228 is reserved */
/* 229 */
@@ -509,7 +508,7 @@ EXTERN int TclNRInterpProc(void *clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
/* 239 */
EXTERN int TclNRInterpProcCore(Tcl_Interp *interp,
- Tcl_Obj *procNameObj, size_t skip,
+ Tcl_Obj *procNameObj, Tcl_Size skip,
ProcErrorProc *errorProc);
/* 240 */
EXTERN int TclNRRunCallbacks(Tcl_Interp *interp, int result,
@@ -518,7 +517,7 @@ EXTERN int TclNRRunCallbacks(Tcl_Interp *interp, int result,
EXTERN int TclNREvalObjEx(Tcl_Interp *interp, Tcl_Obj *objPtr,
int flags, const CmdFrame *invoker, int word);
/* 242 */
-EXTERN int TclNREvalObjv(Tcl_Interp *interp, size_t objc,
+EXTERN int TclNREvalObjv(Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[], int flags,
Command *cmdPtr);
/* 243 */
@@ -529,7 +528,7 @@ EXTERN Tcl_HashTable * TclGetNamespaceChildTable(Tcl_Namespace *nsPtr);
EXTERN Tcl_HashTable * TclGetNamespaceCommandTable(Tcl_Namespace *nsPtr);
/* 246 */
EXTERN int TclInitRewriteEnsemble(Tcl_Interp *interp,
- size_t numRemoved, size_t numInserted,
+ Tcl_Size numRemoved, Tcl_Size numInserted,
Tcl_Obj *const *objv);
/* 247 */
EXTERN void TclResetRewriteEnsemble(Tcl_Interp *interp,
@@ -545,8 +544,8 @@ EXTERN char * TclDoubleDigits(double dv, int ndigits, int flags,
EXTERN void TclSetChildCancelFlags(Tcl_Interp *interp, int flags,
int force);
/* 251 */
-EXTERN size_t TclRegisterLiteral(void *envPtr, const char *bytes,
- size_t length, int flags);
+EXTERN Tcl_Size TclRegisterLiteral(void *envPtr, const char *bytes,
+ Tcl_Size length, int flags);
/* 252 */
EXTERN Tcl_Obj * TclPtrGetVar(Tcl_Interp *interp, Tcl_Var varPtr,
Tcl_Var arrayPtr, Tcl_Obj *part1Ptr,
@@ -594,11 +593,11 @@ typedef struct TclIntStubs {
void (*reserved2)(void);
void (*tclAllocateFreeObjects) (void); /* 3 */
void (*reserved4)(void);
- int (*tclCleanupChildren) (Tcl_Interp *interp, size_t numPids, Tcl_Pid *pidPtr, Tcl_Channel errorChan); /* 5 */
+ int (*tclCleanupChildren) (Tcl_Interp *interp, Tcl_Size numPids, Tcl_Pid *pidPtr, Tcl_Channel errorChan); /* 5 */
void (*tclCleanupCommand) (Command *cmdPtr); /* 6 */
- size_t (*tclCopyAndCollapse) (size_t count, const char *src, char *dst); /* 7 */
+ Tcl_Size (*tclCopyAndCollapse) (Tcl_Size count, const char *src, char *dst); /* 7 */
void (*reserved8)(void);
- size_t (*tclCreatePipeline) (Tcl_Interp *interp, size_t argc, const char **argv, Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr, TclFile *errFilePtr); /* 9 */
+ Tcl_Size (*tclCreatePipeline) (Tcl_Interp *interp, Tcl_Size argc, const char **argv, Tcl_Pid **pidArrayPtr, TclFile *inPipePtr, TclFile *outPipePtr, TclFile *errFilePtr); /* 9 */
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 */
@@ -611,9 +610,9 @@ typedef struct TclIntStubs {
void (*reserved19)(void);
void (*reserved20)(void);
void (*reserved21)(void);
- int (*tclFindElement) (Tcl_Interp *interp, const char *listStr, size_t listLength, const char **elementPtr, const char **nextPtr, size_t *sizePtr, int *bracePtr); /* 22 */
+ int (*tclFindElement) (Tcl_Interp *interp, const char *listStr, Tcl_Size listLength, const char **elementPtr, const char **nextPtr, Tcl_Size *sizePtr, int *bracePtr); /* 22 */
Proc * (*tclFindProc) (Interp *iPtr, const char *procName); /* 23 */
- size_t (*tclFormatInt) (char *buffer, Tcl_WideInt n); /* 24 */
+ Tcl_Size (*tclFormatInt) (char *buffer, Tcl_WideInt n); /* 24 */
void (*tclFreePackageInfo) (Interp *iPtr); /* 25 */
void (*reserved26)(void);
void (*reserved27)(void);
@@ -658,7 +657,7 @@ typedef struct TclIntStubs {
void (*reserved66)(void);
void (*reserved67)(void);
void (*reserved68)(void);
- void * (*tclpAlloc) (size_t size); /* 69 */
+ void * (*tclpAlloc) (TCL_HASH_TYPE size); /* 69 */
void (*reserved70)(void);
void (*reserved71)(void);
void (*reserved72)(void);
@@ -670,7 +669,7 @@ typedef struct TclIntStubs {
void (*reserved78)(void);
void (*reserved79)(void);
void (*reserved80)(void);
- void * (*tclpRealloc) (void *ptr, size_t size); /* 81 */
+ void * (*tclpRealloc) (void *ptr, TCL_HASH_TYPE size); /* 81 */
void (*reserved82)(void);
void (*reserved83)(void);
void (*reserved84)(void);
@@ -699,7 +698,7 @@ typedef struct TclIntStubs {
void (*reserved107)(void);
void (*tclTeardownNamespace) (Namespace *nsPtr); /* 108 */
int (*tclUpdateReturnInfo) (Interp *iPtr); /* 109 */
- int (*tclSockMinimumBuffers) (void *sock, size_t size); /* 110 */
+ int (*tclSockMinimumBuffers) (void *sock, Tcl_Size size); /* 110 */
void (*tcl_AddInterpResolvers) (Tcl_Interp *interp, const char *name, Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc); /* 111 */
void (*reserved112)(void);
void (*reserved113)(void);
@@ -721,7 +720,7 @@ typedef struct TclIntStubs {
int (*tcl_PushCallFrame) (Tcl_Interp *interp, Tcl_CallFrame *framePtr, Tcl_Namespace *nsPtr, int isProcCallFrame); /* 129 */
int (*tcl_RemoveInterpResolvers) (Tcl_Interp *interp, const char *name); /* 130 */
void (*tcl_SetNamespaceResolvers) (Tcl_Namespace *namespacePtr, Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc); /* 131 */
- int (*tclpHasSockets) (Tcl_Interp *interp); /* 132 */
+ void (*reserved132)(void);
void (*reserved133)(void);
void (*reserved134)(void);
void (*reserved135)(void);
@@ -732,7 +731,7 @@ typedef struct TclIntStubs {
void (*reserved140)(void);
const char * (*tclpGetCwd) (Tcl_Interp *interp, Tcl_DString *cwdPtr); /* 141 */
int (*tclSetByteCodeFromAny) (Tcl_Interp *interp, Tcl_Obj *objPtr, CompileHookProc *hookProc, void *clientData); /* 142 */
- size_t (*tclAddLiteralObj) (struct CompileEnv *envPtr, Tcl_Obj *objPtr, LiteralEntry **litPtrPtr); /* 143 */
+ Tcl_Size (*tclAddLiteralObj) (struct CompileEnv *envPtr, Tcl_Obj *objPtr, LiteralEntry **litPtrPtr); /* 143 */
void (*tclHideLiteral) (Tcl_Interp *interp, struct CompileEnv *envPtr, int index); /* 144 */
const struct AuxDataType * (*tclGetAuxDataType) (const char *typeName); /* 145 */
TclHandle (*tclHandleCreate) (void *ptr); /* 146 */
@@ -740,7 +739,7 @@ typedef struct TclIntStubs {
TclHandle (*tclHandlePreserve) (TclHandle handle); /* 148 */
void (*tclHandleRelease) (TclHandle handle); /* 149 */
int (*tclRegAbout) (Tcl_Interp *interp, Tcl_RegExp re); /* 150 */
- void (*tclRegExpRangeUniChar) (Tcl_RegExp re, size_t index, size_t *startPtr, size_t *endPtr); /* 151 */
+ void (*tclRegExpRangeUniChar) (Tcl_RegExp re, Tcl_Size index, Tcl_Size *startPtr, Tcl_Size *endPtr); /* 151 */
void (*tclSetLibraryPath) (Tcl_Obj *pathPtr); /* 152 */
Tcl_Obj * (*tclGetLibraryPath) (void); /* 153 */
void (*reserved154)(void);
@@ -755,14 +754,14 @@ typedef struct TclIntStubs {
const void * (*tclGetInstructionTable) (void); /* 163 */
void (*tclExpandCodeArray) (void *envPtr); /* 164 */
void (*tclpSetInitialEncodings) (void); /* 165 */
- int (*tclListObjSetElement) (Tcl_Interp *interp, Tcl_Obj *listPtr, size_t index, Tcl_Obj *valuePtr); /* 166 */
+ int (*tclListObjSetElement) (Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Size index, Tcl_Obj *valuePtr); /* 166 */
void (*reserved167)(void);
void (*reserved168)(void);
int (*tclpUtfNcmp2) (const char *s1, const char *s2, size_t n); /* 169 */
- int (*tclCheckInterpTraces) (Tcl_Interp *interp, const char *command, size_t numChars, Command *cmdPtr, int result, int traceFlags, size_t objc, Tcl_Obj *const objv[]); /* 170 */
- int (*tclCheckExecutionTraces) (Tcl_Interp *interp, const char *command, size_t numChars, Command *cmdPtr, int result, int traceFlags, size_t objc, Tcl_Obj *const objv[]); /* 171 */
+ int (*tclCheckInterpTraces) (Tcl_Interp *interp, const char *command, Tcl_Size numChars, Command *cmdPtr, int result, int traceFlags, Tcl_Size objc, Tcl_Obj *const objv[]); /* 170 */
+ int (*tclCheckExecutionTraces) (Tcl_Interp *interp, const char *command, Tcl_Size numChars, Command *cmdPtr, int result, int traceFlags, Tcl_Size objc, Tcl_Obj *const objv[]); /* 171 */
int (*tclInThreadExit) (void); /* 172 */
- int (*tclUniCharMatch) (const Tcl_UniChar *string, size_t strLen, const Tcl_UniChar *pattern, size_t ptnLen, int flags); /* 173 */
+ int (*tclUniCharMatch) (const Tcl_UniChar *string, Tcl_Size strLen, const Tcl_UniChar *pattern, Tcl_Size ptnLen, int flags); /* 173 */
void (*reserved174)(void);
int (*tclCallVarTraces) (Interp *iPtr, Var *arrayPtr, Var *varPtr, const char *part1, const char *part2, int flags, int leaveErrMsg); /* 175 */
void (*tclCleanupVar) (Var *varPtr, Var *arrayPtr); /* 176 */
@@ -804,7 +803,7 @@ typedef struct TclIntStubs {
void (*tclpFindExecutable) (const char *argv0); /* 212 */
Tcl_Obj * (*tclGetObjNameOfExecutable) (void); /* 213 */
void (*tclSetObjNameOfExecutable) (Tcl_Obj *name, Tcl_Encoding encoding); /* 214 */
- void * (*tclStackAlloc) (Tcl_Interp *interp, size_t numBytes); /* 215 */
+ void * (*tclStackAlloc) (Tcl_Interp *interp, Tcl_Size numBytes); /* 215 */
void (*tclStackFree) (Tcl_Interp *interp, void *freePtr); /* 216 */
int (*tclPushStackFrame) (Tcl_Interp *interp, Tcl_CallFrame **framePtrPtr, Tcl_Namespace *namespacePtr, int isProcCallFrame); /* 217 */
void (*tclPopStackFrame) (Tcl_Interp *interp); /* 218 */
@@ -814,9 +813,9 @@ typedef struct TclIntStubs {
void (*reserved222)(void);
void (*reserved223)(void);
TclPlatformType * (*tclGetPlatform) (void); /* 224 */
- Tcl_Obj * (*tclTraceDictPath) (Tcl_Interp *interp, Tcl_Obj *rootPtr, size_t keyc, Tcl_Obj *const keyv[], int flags); /* 225 */
+ Tcl_Obj * (*tclTraceDictPath) (Tcl_Interp *interp, Tcl_Obj *rootPtr, Tcl_Size keyc, Tcl_Obj *const keyv[], int flags); /* 225 */
int (*tclObjBeingDeleted) (Tcl_Obj *objPtr); /* 226 */
- void (*tclSetNsPath) (Namespace *nsPtr, size_t pathLength, Tcl_Namespace *pathAry[]); /* 227 */
+ void (*tclSetNsPath) (Namespace *nsPtr, Tcl_Size pathLength, Tcl_Namespace *pathAry[]); /* 227 */
void (*reserved228)(void);
int (*tclPtrMakeUpvar) (Tcl_Interp *interp, Var *otherP1Ptr, const char *myName, int myFlags, int index); /* 229 */
Var * (*tclObjLookupVar) (Tcl_Interp *interp, Tcl_Obj *part1Ptr, const char *part2, int flags, const char *msg, int createPart1, int createPart2, Var **arrayPtrPtr); /* 230 */
@@ -828,19 +827,19 @@ typedef struct TclIntStubs {
void (*reserved236)(void);
int (*tclResetCancellation) (Tcl_Interp *interp, int force); /* 237 */
int (*tclNRInterpProc) (void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 238 */
- int (*tclNRInterpProcCore) (Tcl_Interp *interp, Tcl_Obj *procNameObj, size_t skip, ProcErrorProc *errorProc); /* 239 */
+ int (*tclNRInterpProcCore) (Tcl_Interp *interp, Tcl_Obj *procNameObj, Tcl_Size skip, ProcErrorProc *errorProc); /* 239 */
int (*tclNRRunCallbacks) (Tcl_Interp *interp, int result, struct NRE_callback *rootPtr); /* 240 */
int (*tclNREvalObjEx) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags, const CmdFrame *invoker, int word); /* 241 */
- int (*tclNREvalObjv) (Tcl_Interp *interp, size_t objc, Tcl_Obj *const objv[], int flags, Command *cmdPtr); /* 242 */
+ int (*tclNREvalObjv) (Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int flags, Command *cmdPtr); /* 242 */
void (*tclDbDumpActiveObjects) (FILE *outFile); /* 243 */
Tcl_HashTable * (*tclGetNamespaceChildTable) (Tcl_Namespace *nsPtr); /* 244 */
Tcl_HashTable * (*tclGetNamespaceCommandTable) (Tcl_Namespace *nsPtr); /* 245 */
- int (*tclInitRewriteEnsemble) (Tcl_Interp *interp, size_t numRemoved, size_t numInserted, Tcl_Obj *const *objv); /* 246 */
+ int (*tclInitRewriteEnsemble) (Tcl_Interp *interp, Tcl_Size numRemoved, Tcl_Size numInserted, Tcl_Obj *const *objv); /* 246 */
void (*tclResetRewriteEnsemble) (Tcl_Interp *interp, int isRootEnsemble); /* 247 */
int (*tclCopyChannel) (Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, long long toRead, Tcl_Obj *cmdPtr); /* 248 */
char * (*tclDoubleDigits) (double dv, int ndigits, int flags, int *decpt, int *signum, char **endPtr); /* 249 */
void (*tclSetChildCancelFlags) (Tcl_Interp *interp, int flags, int force); /* 250 */
- size_t (*tclRegisterLiteral) (void *envPtr, const char *bytes, size_t length, int flags); /* 251 */
+ Tcl_Size (*tclRegisterLiteral) (void *envPtr, const char *bytes, Tcl_Size length, int flags); /* 251 */
Tcl_Obj * (*tclPtrGetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags); /* 252 */
Tcl_Obj * (*tclPtrSetVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, int flags); /* 253 */
Tcl_Obj * (*tclPtrIncrObjVar) (Tcl_Interp *interp, Tcl_Var varPtr, Tcl_Var arrayPtr, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *incrPtr, int flags); /* 254 */
@@ -1058,8 +1057,7 @@ extern const TclIntStubs *tclIntStubsPtr;
(tclIntStubsPtr->tcl_RemoveInterpResolvers) /* 130 */
#define Tcl_SetNamespaceResolvers \
(tclIntStubsPtr->tcl_SetNamespaceResolvers) /* 131 */
-#define TclpHasSockets \
- (tclIntStubsPtr->tclpHasSockets) /* 132 */
+/* Slot 132 is reserved */
/* Slot 133 is reserved */
/* Slot 134 is reserved */
/* Slot 135 is reserved */
@@ -1281,6 +1279,16 @@ extern const TclIntStubs *tclIntStubsPtr;
#define Tcl_StaticLibrary \
(tclIntStubsPtr->tclStaticLibrary)
#endif /* defined(USE_TCL_STUBS) */
+
+#if (TCL_MAJOR_VERSION < 9) && defined(USE_TCL_STUBS)
+#undef TclpGetClicks
+#define TclpGetClicks() \
+ ((unsigned long)tclIntStubsPtr->tclpGetClicks())
+#undef TclpGetSeconds
+#define TclpGetSeconds() \
+ ((unsigned long)tclIntStubsPtr->tclpGetSeconds())
+#endif
+
#undef TclObjInterpProc
#define TclObjInterpProc TclGetObjInterpProc()
#define TclObjInterpProc2 TclGetObjInterpProc2()
diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h
index 0e51eef..1ec9259 100644
--- a/generic/tclIntPlatDecls.h
+++ b/generic/tclIntPlatDecls.h
@@ -30,6 +30,539 @@
* in the generic/tclInt.decls script.
*/
+#if TCL_MAJOR_VERSION < 9
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Exported function declarations:
+ */
+
+#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
+/* 0 */
+EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
+ Tcl_Channel chan);
+/* 1 */
+EXTERN int TclpCloseFile(TclFile file);
+/* 2 */
+EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
+ TclFile writeFile, TclFile errorFile,
+ int numPids, Tcl_Pid *pidPtr);
+/* 3 */
+EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
+/* 4 */
+EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
+ const char **argv, TclFile inputFile,
+ TclFile outputFile, TclFile errorFile,
+ Tcl_Pid *pidPtr);
+/* 5 */
+EXTERN int TclUnixWaitForFile_(int fd, int mask, int timeout);
+/* 6 */
+EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
+/* 7 */
+EXTERN TclFile TclpOpenFile(const char *fname, int mode);
+/* 8 */
+EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
+/* 9 */
+EXTERN TclFile TclpCreateTempFile(const char *contents);
+/* 10 */
+EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
+/* 11 */
+EXTERN struct tm * TclpLocaltime_unix(const time_t *clock);
+/* 12 */
+EXTERN struct tm * TclpGmtime_unix(const time_t *clock);
+/* 13 */
+EXTERN char * TclpInetNtoa(struct in_addr addr);
+/* 14 */
+EXTERN int TclUnixCopyFile(const char *src, const char *dst,
+ const Tcl_StatBuf *statBufPtr,
+ int dontCopyAtts);
+/* 15 */
+EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
+ int objIndex, Tcl_Obj *fileName,
+ Tcl_Obj **attributePtrPtr);
+/* 16 */
+EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
+ int objIndex, Tcl_Obj *fileName,
+ Tcl_Obj *attributePtr);
+/* 17 */
+EXTERN int TclMacOSXCopyFileAttributes(const char *src,
+ const char *dst,
+ const Tcl_StatBuf *statBufPtr);
+/* 18 */
+EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
+ const char *pathName, const char *fileName,
+ Tcl_StatBuf *statBufPtr,
+ Tcl_GlobTypeData *types);
+/* 19 */
+EXTERN void TclMacOSXNotifierAddRunLoopMode(
+ const void *runLoopMode);
+/* Slot 20 is reserved */
+/* Slot 21 is reserved */
+/* 22 */
+EXTERN TclFile TclpCreateTempFile_(const char *contents);
+/* Slot 23 is reserved */
+/* Slot 24 is reserved */
+/* Slot 25 is reserved */
+/* Slot 26 is reserved */
+/* Slot 27 is reserved */
+/* Slot 28 is reserved */
+/* 29 */
+EXTERN int TclWinCPUID(int index, int *regs);
+/* 30 */
+EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
+ Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
+ Tcl_Obj *resultingNameObj);
+#endif /* UNIX */
+#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
+/* 0 */
+EXTERN void TclWinConvertError(DWORD errCode);
+/* 1 */
+EXTERN void TclWinConvertWSAError(DWORD errCode);
+/* 2 */
+EXTERN struct servent * TclWinGetServByName(const char *nm,
+ const char *proto);
+/* 3 */
+EXTERN int TclWinGetSockOpt(SOCKET s, int level, int optname,
+ char *optval, int *optlen);
+/* 4 */
+EXTERN HINSTANCE TclWinGetTclInstance(void);
+/* 5 */
+EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
+/* 6 */
+EXTERN unsigned short TclWinNToHS(unsigned short ns);
+/* 7 */
+EXTERN int TclWinSetSockOpt(SOCKET s, int level, int optname,
+ const char *optval, int optlen);
+/* 8 */
+EXTERN int TclpGetPid(Tcl_Pid pid);
+/* 9 */
+EXTERN int TclWinGetPlatformId(void);
+/* 10 */
+EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
+/* 11 */
+EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
+ Tcl_Channel chan);
+/* 12 */
+EXTERN int TclpCloseFile(TclFile file);
+/* 13 */
+EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
+ TclFile writeFile, TclFile errorFile,
+ int numPids, Tcl_Pid *pidPtr);
+/* 14 */
+EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
+/* 15 */
+EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
+ const char **argv, TclFile inputFile,
+ TclFile outputFile, TclFile errorFile,
+ Tcl_Pid *pidPtr);
+/* 16 */
+EXTERN int TclpIsAtty(int fd);
+/* 17 */
+EXTERN int TclUnixCopyFile(const char *src, const char *dst,
+ const Tcl_StatBuf *statBufPtr,
+ int dontCopyAtts);
+/* 18 */
+EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
+/* 19 */
+EXTERN TclFile TclpOpenFile(const char *fname, int mode);
+/* 20 */
+EXTERN void TclWinAddProcess(HANDLE hProcess, DWORD id);
+/* 21 */
+EXTERN char * TclpInetNtoa(struct in_addr addr);
+/* 22 */
+EXTERN TclFile TclpCreateTempFile(const char *contents);
+/* Slot 23 is reserved */
+/* 24 */
+EXTERN char * TclWinNoBackslash(char *path);
+/* Slot 25 is reserved */
+/* 26 */
+EXTERN void TclWinSetInterfaces(int wide);
+/* 27 */
+EXTERN void TclWinFlushDirtyChannels(void);
+/* 28 */
+EXTERN void TclWinResetInterfaces(void);
+/* 29 */
+EXTERN int TclWinCPUID(int index, int *regs);
+/* 30 */
+EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
+ Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
+ Tcl_Obj *resultingNameObj);
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+/* 0 */
+EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
+ Tcl_Channel chan);
+/* 1 */
+EXTERN int TclpCloseFile(TclFile file);
+/* 2 */
+EXTERN Tcl_Channel TclpCreateCommandChannel(TclFile readFile,
+ TclFile writeFile, TclFile errorFile,
+ int numPids, Tcl_Pid *pidPtr);
+/* 3 */
+EXTERN int TclpCreatePipe(TclFile *readPipe, TclFile *writePipe);
+/* 4 */
+EXTERN int TclpCreateProcess(Tcl_Interp *interp, int argc,
+ const char **argv, TclFile inputFile,
+ TclFile outputFile, TclFile errorFile,
+ Tcl_Pid *pidPtr);
+/* 5 */
+EXTERN int TclUnixWaitForFile_(int fd, int mask, int timeout);
+/* 6 */
+EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
+/* 7 */
+EXTERN TclFile TclpOpenFile(const char *fname, int mode);
+/* 8 */
+EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
+/* 9 */
+EXTERN TclFile TclpCreateTempFile(const char *contents);
+/* 10 */
+EXTERN Tcl_DirEntry * TclpReaddir(TclDIR *dir);
+/* 11 */
+EXTERN struct tm * TclpLocaltime_unix(const time_t *clock);
+/* 12 */
+EXTERN struct tm * TclpGmtime_unix(const time_t *clock);
+/* 13 */
+EXTERN char * TclpInetNtoa(struct in_addr addr);
+/* 14 */
+EXTERN int TclUnixCopyFile(const char *src, const char *dst,
+ const Tcl_StatBuf *statBufPtr,
+ int dontCopyAtts);
+/* 15 */
+EXTERN int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
+ int objIndex, Tcl_Obj *fileName,
+ Tcl_Obj **attributePtrPtr);
+/* 16 */
+EXTERN int TclMacOSXSetFileAttribute(Tcl_Interp *interp,
+ int objIndex, Tcl_Obj *fileName,
+ Tcl_Obj *attributePtr);
+/* 17 */
+EXTERN int TclMacOSXCopyFileAttributes(const char *src,
+ const char *dst,
+ const Tcl_StatBuf *statBufPtr);
+/* 18 */
+EXTERN int TclMacOSXMatchType(Tcl_Interp *interp,
+ const char *pathName, const char *fileName,
+ Tcl_StatBuf *statBufPtr,
+ Tcl_GlobTypeData *types);
+/* 19 */
+EXTERN void TclMacOSXNotifierAddRunLoopMode(
+ const void *runLoopMode);
+/* Slot 20 is reserved */
+/* Slot 21 is reserved */
+/* 22 */
+EXTERN TclFile TclpCreateTempFile_(const char *contents);
+/* Slot 23 is reserved */
+/* Slot 24 is reserved */
+/* Slot 25 is reserved */
+/* Slot 26 is reserved */
+/* Slot 27 is reserved */
+/* Slot 28 is reserved */
+/* 29 */
+EXTERN int TclWinCPUID(int index, int *regs);
+/* 30 */
+EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
+ Tcl_Obj *basenameObj, Tcl_Obj *extensionObj,
+ Tcl_Obj *resultingNameObj);
+#endif /* MACOSX */
+
+typedef struct TclIntPlatStubs {
+ int magic;
+ void *hooks;
+
+#if !defined(_WIN32) && !defined(__CYGWIN__) && !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 */
+ 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 */
+ int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
+ 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) (TclDIR *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 */
+ void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
+ void (*reserved20)(void);
+ void (*reserved21)(void);
+ TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
+ void (*reserved23)(void);
+ void (*reserved24)(void);
+ void (*reserved25)(void);
+ void (*reserved26)(void);
+ void (*reserved27)(void);
+ void (*reserved28)(void);
+ int (*tclWinCPUID) (int index, int *regs); /* 29 */
+ int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
+#endif /* UNIX */
+#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
+ void (*tclWinConvertError) (DWORD errCode); /* 0 */
+ void (*tclWinConvertWSAError) (DWORD errCode); /* 1 */
+ struct servent * (*tclWinGetServByName) (const char *nm, const char *proto); /* 2 */
+ int (*tclWinGetSockOpt) (SOCKET s, int level, int optname, char *optval, int *optlen); /* 3 */
+ HINSTANCE (*tclWinGetTclInstance) (void); /* 4 */
+ int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 5 */
+ unsigned short (*tclWinNToHS) (unsigned short ns); /* 6 */
+ int (*tclWinSetSockOpt) (SOCKET s, int level, int optname, const char *optval, int optlen); /* 7 */
+ int (*tclpGetPid) (Tcl_Pid pid); /* 8 */
+ int (*tclWinGetPlatformId) (void); /* 9 */
+ Tcl_DirEntry * (*tclpReaddir) (TclDIR *dir); /* 10 */
+ void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 11 */
+ int (*tclpCloseFile) (TclFile file); /* 12 */
+ Tcl_Channel (*tclpCreateCommandChannel) (TclFile readFile, TclFile writeFile, TclFile errorFile, int numPids, Tcl_Pid *pidPtr); /* 13 */
+ int (*tclpCreatePipe) (TclFile *readPipe, TclFile *writePipe); /* 14 */
+ int (*tclpCreateProcess) (Tcl_Interp *interp, int argc, const char **argv, TclFile inputFile, TclFile outputFile, TclFile errorFile, Tcl_Pid *pidPtr); /* 15 */
+ int (*tclpIsAtty) (int fd); /* 16 */
+ int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 17 */
+ TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 18 */
+ TclFile (*tclpOpenFile) (const char *fname, int mode); /* 19 */
+ void (*tclWinAddProcess) (HANDLE hProcess, DWORD id); /* 20 */
+ char * (*tclpInetNtoa) (struct in_addr addr); /* 21 */
+ TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */
+ void (*reserved23)(void);
+ char * (*tclWinNoBackslash) (char *path); /* 24 */
+ void (*reserved25)(void);
+ void (*tclWinSetInterfaces) (int wide); /* 26 */
+ void (*tclWinFlushDirtyChannels) (void); /* 27 */
+ void (*tclWinResetInterfaces) (void); /* 28 */
+ int (*tclWinCPUID) (int index, int *regs); /* 29 */
+ int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
+#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 */
+ int (*tclUnixWaitForFile_) (int fd, int mask, int timeout); /* 5 */
+ 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) (TclDIR *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 */
+ void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */
+ void (*reserved20)(void);
+ void (*reserved21)(void);
+ TclFile (*tclpCreateTempFile_) (const char *contents); /* 22 */
+ void (*reserved23)(void);
+ void (*reserved24)(void);
+ void (*reserved25)(void);
+ void (*reserved26)(void);
+ void (*reserved27)(void);
+ void (*reserved28)(void);
+ int (*tclWinCPUID) (int index, int *regs); /* 29 */
+ int (*tclUnixOpenTemporaryFile) (Tcl_Obj *dirObj, Tcl_Obj *basenameObj, Tcl_Obj *extensionObj, Tcl_Obj *resultingNameObj); /* 30 */
+#endif /* MACOSX */
+} TclIntPlatStubs;
+
+extern const TclIntPlatStubs *tclIntPlatStubsPtr;
+
+#ifdef __cplusplus
+}
+#endif
+
+#if defined(USE_TCL_STUBS)
+
+/*
+ * Inline function declarations:
+ */
+
+#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MAC_OSX_TCL) /* UNIX */
+#define TclGetAndDetachPids \
+ (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
+#define TclpCloseFile \
+ (tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
+#define TclpCreateCommandChannel \
+ (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
+#define TclpCreatePipe \
+ (tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
+#define TclpCreateProcess \
+ (tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
+#define TclUnixWaitForFile_ \
+ (tclIntPlatStubsPtr->tclUnixWaitForFile_) /* 5 */
+#define TclpMakeFile \
+ (tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
+#define TclpOpenFile \
+ (tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
+#define TclUnixWaitForFile \
+ (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
+#define TclpCreateTempFile \
+ (tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
+#define TclpReaddir \
+ (tclIntPlatStubsPtr->tclpReaddir) /* 10 */
+#define TclpLocaltime_unix \
+ (tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */
+#define TclpGmtime_unix \
+ (tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
+#define TclpInetNtoa \
+ (tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
+#define TclUnixCopyFile \
+ (tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
+#define TclMacOSXGetFileAttribute \
+ (tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
+#define TclMacOSXSetFileAttribute \
+ (tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
+#define TclMacOSXCopyFileAttributes \
+ (tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
+#define TclMacOSXMatchType \
+ (tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
+#define TclMacOSXNotifierAddRunLoopMode \
+ (tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
+/* Slot 20 is reserved */
+/* Slot 21 is reserved */
+#define TclpCreateTempFile_ \
+ (tclIntPlatStubsPtr->tclpCreateTempFile_) /* 22 */
+/* Slot 23 is reserved */
+/* Slot 24 is reserved */
+/* Slot 25 is reserved */
+/* Slot 26 is reserved */
+/* Slot 27 is reserved */
+/* Slot 28 is reserved */
+#define TclWinCPUID \
+ (tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
+#define TclUnixOpenTemporaryFile \
+ (tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
+#endif /* UNIX */
+#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
+#define TclWinConvertError \
+ (tclIntPlatStubsPtr->tclWinConvertError) /* 0 */
+#define TclWinConvertWSAError \
+ (tclIntPlatStubsPtr->tclWinConvertWSAError) /* 1 */
+#define TclWinGetServByName \
+ (tclIntPlatStubsPtr->tclWinGetServByName) /* 2 */
+#define TclWinGetSockOpt \
+ (tclIntPlatStubsPtr->tclWinGetSockOpt) /* 3 */
+#define TclWinGetTclInstance \
+ (tclIntPlatStubsPtr->tclWinGetTclInstance) /* 4 */
+#define TclUnixWaitForFile \
+ (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 5 */
+#define TclWinNToHS \
+ (tclIntPlatStubsPtr->tclWinNToHS) /* 6 */
+#define TclWinSetSockOpt \
+ (tclIntPlatStubsPtr->tclWinSetSockOpt) /* 7 */
+#define TclpGetPid \
+ (tclIntPlatStubsPtr->tclpGetPid) /* 8 */
+#define TclWinGetPlatformId \
+ (tclIntPlatStubsPtr->tclWinGetPlatformId) /* 9 */
+#define TclpReaddir \
+ (tclIntPlatStubsPtr->tclpReaddir) /* 10 */
+#define TclGetAndDetachPids \
+ (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 11 */
+#define TclpCloseFile \
+ (tclIntPlatStubsPtr->tclpCloseFile) /* 12 */
+#define TclpCreateCommandChannel \
+ (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 13 */
+#define TclpCreatePipe \
+ (tclIntPlatStubsPtr->tclpCreatePipe) /* 14 */
+#define TclpCreateProcess \
+ (tclIntPlatStubsPtr->tclpCreateProcess) /* 15 */
+#define TclpIsAtty \
+ (tclIntPlatStubsPtr->tclpIsAtty) /* 16 */
+#define TclUnixCopyFile \
+ (tclIntPlatStubsPtr->tclUnixCopyFile) /* 17 */
+#define TclpMakeFile \
+ (tclIntPlatStubsPtr->tclpMakeFile) /* 18 */
+#define TclpOpenFile \
+ (tclIntPlatStubsPtr->tclpOpenFile) /* 19 */
+#define TclWinAddProcess \
+ (tclIntPlatStubsPtr->tclWinAddProcess) /* 20 */
+#define TclpInetNtoa \
+ (tclIntPlatStubsPtr->tclpInetNtoa) /* 21 */
+#define TclpCreateTempFile \
+ (tclIntPlatStubsPtr->tclpCreateTempFile) /* 22 */
+/* Slot 23 is reserved */
+#define TclWinNoBackslash \
+ (tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */
+/* Slot 25 is reserved */
+#define TclWinSetInterfaces \
+ (tclIntPlatStubsPtr->tclWinSetInterfaces) /* 26 */
+#define TclWinFlushDirtyChannels \
+ (tclIntPlatStubsPtr->tclWinFlushDirtyChannels) /* 27 */
+#define TclWinResetInterfaces \
+ (tclIntPlatStubsPtr->tclWinResetInterfaces) /* 28 */
+#define TclWinCPUID \
+ (tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
+#define TclUnixOpenTemporaryFile \
+ (tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#define TclGetAndDetachPids \
+ (tclIntPlatStubsPtr->tclGetAndDetachPids) /* 0 */
+#define TclpCloseFile \
+ (tclIntPlatStubsPtr->tclpCloseFile) /* 1 */
+#define TclpCreateCommandChannel \
+ (tclIntPlatStubsPtr->tclpCreateCommandChannel) /* 2 */
+#define TclpCreatePipe \
+ (tclIntPlatStubsPtr->tclpCreatePipe) /* 3 */
+#define TclpCreateProcess \
+ (tclIntPlatStubsPtr->tclpCreateProcess) /* 4 */
+#define TclUnixWaitForFile_ \
+ (tclIntPlatStubsPtr->tclUnixWaitForFile_) /* 5 */
+#define TclpMakeFile \
+ (tclIntPlatStubsPtr->tclpMakeFile) /* 6 */
+#define TclpOpenFile \
+ (tclIntPlatStubsPtr->tclpOpenFile) /* 7 */
+#define TclUnixWaitForFile \
+ (tclIntPlatStubsPtr->tclUnixWaitForFile) /* 8 */
+#define TclpCreateTempFile \
+ (tclIntPlatStubsPtr->tclpCreateTempFile) /* 9 */
+#define TclpReaddir \
+ (tclIntPlatStubsPtr->tclpReaddir) /* 10 */
+#define TclpLocaltime_unix \
+ (tclIntPlatStubsPtr->tclpLocaltime_unix) /* 11 */
+#define TclpGmtime_unix \
+ (tclIntPlatStubsPtr->tclpGmtime_unix) /* 12 */
+#define TclpInetNtoa \
+ (tclIntPlatStubsPtr->tclpInetNtoa) /* 13 */
+#define TclUnixCopyFile \
+ (tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
+#define TclMacOSXGetFileAttribute \
+ (tclIntPlatStubsPtr->tclMacOSXGetFileAttribute) /* 15 */
+#define TclMacOSXSetFileAttribute \
+ (tclIntPlatStubsPtr->tclMacOSXSetFileAttribute) /* 16 */
+#define TclMacOSXCopyFileAttributes \
+ (tclIntPlatStubsPtr->tclMacOSXCopyFileAttributes) /* 17 */
+#define TclMacOSXMatchType \
+ (tclIntPlatStubsPtr->tclMacOSXMatchType) /* 18 */
+#define TclMacOSXNotifierAddRunLoopMode \
+ (tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */
+/* Slot 20 is reserved */
+/* Slot 21 is reserved */
+#define TclpCreateTempFile_ \
+ (tclIntPlatStubsPtr->tclpCreateTempFile_) /* 22 */
+/* Slot 23 is reserved */
+/* Slot 24 is reserved */
+/* Slot 25 is reserved */
+/* Slot 26 is reserved */
+/* Slot 27 is reserved */
+/* Slot 28 is reserved */
+#define TclWinCPUID \
+ (tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
+#define TclUnixOpenTemporaryFile \
+ (tclIntPlatStubsPtr->tclUnixOpenTemporaryFile) /* 30 */
+#endif /* MACOSX */
+
+#endif /* defined(USE_TCL_STUBS) */
+
+#else /* TCL_MAJOR_VERSION > 8 */
/* !BEGIN!: Do not edit below this line. */
#ifdef __cplusplus
@@ -202,12 +735,24 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
#endif /* defined(USE_TCL_STUBS) */
/* !END!: Do not edit above this line. */
+#endif /* TCL_MAJOR_VERSION */
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
-#define TclWinConvertWSAError Tcl_WinConvertError
-#define TclWinConvertError Tcl_WinConvertError
+#undef TclpLocaltime_unix
+#undef TclpGmtime_unix
+#undef TclWinConvertWSAError
+#define TclWinConvertWSAError TclWinConvertError
+#if !defined(TCL_USE_STUBS) && !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
+# undef TclWinConvertError
+# define TclWinConvertError Tcl_WinConvertError
+#endif
+
+#undef TclpInetNtoa
+#define TclpInetNtoa inet_ntoa
+#undef TclpCreateTempFile_
+#undef TclUnixWaitForFile_
#ifdef MAC_OSX_TCL /* not accessable on Win32/UNIX */
MODULE_SCOPE int TclMacOSXGetFileAttribute(Tcl_Interp *interp,
int objIndex, Tcl_Obj *fileName,
@@ -225,9 +770,32 @@ MODULE_SCOPE int TclMacOSXMatchType(Tcl_Interp *interp,
const char *pathName, const char *fileName,
Tcl_StatBuf *statBufPtr,
Tcl_GlobTypeData *types);
+#else
+#undef TclMacOSXGetFileAttribute /* 15 */
+#undef TclMacOSXSetFileAttribute /* 16 */
+#undef TclMacOSXCopyFileAttributes /* 17 */
+#undef TclMacOSXMatchType /* 18 */
+#undef TclMacOSXNotifierAddRunLoopMode /* 19 */
#endif
-#if !defined(_WIN32)
+#if defined(_WIN32)
+# undef TclWinNToHS
+# undef TclWinGetServByName
+# undef TclWinGetSockOpt
+# undef TclWinSetSockOpt
+# undef TclWinGetPlatformId
+# undef TclWinResetInterfaces
+# undef TclWinSetInterfaces
+# if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
+# define TclWinNToHS ntohs
+# define TclWinGetServByName getservbyname
+# define TclWinGetSockOpt getsockopt
+# define TclWinSetSockOpt setsockopt
+# define TclWinGetPlatformId() (2) /* VER_PLATFORM_WIN32_NT */
+# define TclWinResetInterfaces() /* nop */
+# define TclWinSetInterfaces(dummy) /* nop */
+# endif /* TCL_NO_DEPRECATED */
+#else
# undef TclpGetPid
# define TclpGetPid(pid) ((size_t)(pid))
#endif
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index 98e63db..416f74e 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -332,7 +332,7 @@ int
Tcl_Init(
Tcl_Interp *interp) /* Interpreter to initialize. */
{
- PkgName pkgName = {NULL, "Tcl"};
+ PkgName pkgName = {NULL, "tcl"};
PkgName **names = (PkgName **)TclInitPkgFiles(interp);
int result = TCL_ERROR;
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index 06a316f..ea5afac 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -48,13 +48,13 @@
*/
#define LIST_INDEX_ASSERT(idxarg_) \
do { \
- ListSizeT idx_ = (idxarg_); /* To guard against ++ etc. */ \
+ Tcl_Size idx_ = (idxarg_); /* To guard against ++ etc. */ \
LIST_ASSERT(idx_ != TCL_INDEX_NONE && idx_ < LIST_MAX); \
} while (0)
/* Ditto for counts except upper limit is different */
#define LIST_COUNT_ASSERT(countarg_) \
do { \
- ListSizeT count_ = (countarg_); /* To guard against ++ etc. */ \
+ Tcl_Size count_ = (countarg_); /* To guard against ++ etc. */ \
LIST_ASSERT(count_ != TCL_INDEX_NONE && count_ <= LIST_MAX); \
} while (0)
@@ -119,23 +119,23 @@
/*
* Prototypes for non-inline static functions defined later in this file:
*/
-static int MemoryAllocationError(Tcl_Interp *, size_t size);
+static int MemoryAllocationError(Tcl_Interp *, Tcl_Size size);
static int ListLimitExceededError(Tcl_Interp *);
-static ListStore *ListStoreNew(ListSizeT objc, Tcl_Obj *const objv[], int flags);
-static int ListRepInit(ListSizeT objc, Tcl_Obj *const objv[], int flags, ListRep *);
+static ListStore *ListStoreNew(Tcl_Size objc, Tcl_Obj *const objv[], int flags);
+static int ListRepInit(Tcl_Size objc, Tcl_Obj *const objv[], int flags, ListRep *);
static int ListRepInitAttempt(Tcl_Interp *,
- ListSizeT objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[],
ListRep *);
static void ListRepClone(ListRep *fromRepPtr, ListRep *toRepPtr, int flags);
static void ListRepUnsharedFreeUnreferenced(const ListRep *repPtr);
static int TclListObjGetRep(Tcl_Interp *, Tcl_Obj *listPtr, ListRep *repPtr);
static void ListRepRange(ListRep *srcRepPtr,
- ListSizeT rangeStart,
- ListSizeT rangeEnd,
+ Tcl_Size rangeStart,
+ Tcl_Size rangeEnd,
int preserveSrcRep,
ListRep *rangeRepPtr);
-static ListStore *ListStoreReallocate(ListStore *storePtr, ListSizeT numSlots);
+static ListStore *ListStoreReallocate(ListStore *storePtr, Tcl_Size numSlots);
static void ListRepValidate(const ListRep *repPtr, const char *file,
int lineNum);
static void DupListInternalRep(Tcl_Obj *srcPtr, Tcl_Obj *copyPtr);
@@ -238,8 +238,8 @@ const Tcl_ObjType tclListType = {
*/
static inline ListSpan *
ListSpanNew(
- ListSizeT firstSlot, /* Starting slot index of the span */
- ListSizeT numSlots) /* Number of slots covered by the span */
+ Tcl_Size firstSlot, /* Starting slot index of the span */
+ Tcl_Size numSlots) /* Number of slots covered by the span */
{
ListSpan *spanPtr = (ListSpan *) Tcl_Alloc(sizeof(*spanPtr));
spanPtr->refCount = 0;
@@ -296,9 +296,9 @@ ListSpanDecrRefs(ListSpan *spanPtr)
*/
static inline int
ListSpanMerited(
- ListSizeT length, /* Length of the proposed span */
- ListSizeT usedStorageLength, /* Number of slots currently in used */
- ListSizeT allocatedStorageLength) /* Length of the currently allocation */
+ Tcl_Size length, /* Length of the proposed span */
+ Tcl_Size usedStorageLength, /* Number of slots currently in used */
+ Tcl_Size allocatedStorageLength) /* Length of the currently allocation */
{
/*
TODO
@@ -339,8 +339,8 @@ ListSpanMerited(
*
*------------------------------------------------------------------------
*/
-static inline ListSizeT
-ListStoreUpSize(ListSizeT numSlotsRequested) {
+static inline Tcl_Size
+ListStoreUpSize(Tcl_Size numSlotsRequested) {
/* TODO -how much extra? May be double only for smaller requests? */
return numSlotsRequested < (LIST_MAX / 2) ? 2 * numSlotsRequested
: LIST_MAX;
@@ -392,8 +392,8 @@ ListRepFreeUnreferenced(const ListRep *repPtr)
static inline void
ObjArrayIncrRefs(
Tcl_Obj * const *objv, /* Pointer to the array */
- ListSizeT startIdx, /* Starting index of subarray within objv */
- ListSizeT count) /* Number of elements in the subarray */
+ Tcl_Size startIdx, /* Starting index of subarray within objv */
+ Tcl_Size count) /* Number of elements in the subarray */
{
Tcl_Obj * const *end;
LIST_INDEX_ASSERT(startIdx);
@@ -424,8 +424,8 @@ ObjArrayIncrRefs(
static inline void
ObjArrayDecrRefs(
Tcl_Obj * const *objv, /* Pointer to the array */
- ListSizeT startIdx, /* Starting index of subarray within objv */
- ListSizeT count) /* Number of elements in the subarray */
+ Tcl_Size startIdx, /* Starting index of subarray within objv */
+ Tcl_Size count) /* Number of elements in the subarray */
{
Tcl_Obj * const *end;
LIST_INDEX_ASSERT(startIdx);
@@ -456,7 +456,7 @@ ObjArrayDecrRefs(
static inline void
ObjArrayCopy(
Tcl_Obj **to, /* Destination */
- ListSizeT count, /* Number of pointers to copy */
+ Tcl_Size count, /* Number of pointers to copy */
Tcl_Obj *const from[]) /* Source array of Tcl_Obj* */
{
Tcl_Obj **end;
@@ -487,7 +487,7 @@ ObjArrayCopy(
static int
MemoryAllocationError(
Tcl_Interp *interp, /* Interpreter for error message. May be NULL */
- ListSizeT size) /* Size of attempted allocation that failed */
+ Tcl_Size size) /* Size of attempted allocation that failed */
{
if (interp != NULL) {
Tcl_SetObjResult(
@@ -548,7 +548,7 @@ ListLimitExceededError(Tcl_Interp *interp)
*------------------------------------------------------------------------
*/
static inline void
-ListRepUnsharedShiftDown(ListRep *repPtr, ListSizeT shiftCount)
+ListRepUnsharedShiftDown(ListRep *repPtr, Tcl_Size shiftCount)
{
ListStore *storePtr;
@@ -603,7 +603,7 @@ ListRepUnsharedShiftDown(ListRep *repPtr, ListSizeT shiftCount)
*/
#if 0
static inline void
-ListRepUnsharedShiftUp(ListRep *repPtr, ListSizeT shiftCount)
+ListRepUnsharedShiftUp(ListRep *repPtr, Tcl_Size shiftCount)
{
ListStore *storePtr;
@@ -748,12 +748,12 @@ TclListObjValidate(Tcl_Interp *interp, Tcl_Obj *listObj)
*/
static ListStore *
ListStoreNew(
- ListSizeT objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[],
int flags)
{
ListStore *storePtr;
- ListSizeT capacity;
+ Tcl_Size capacity;
/*
* First check to see if we'd overflow and try to allocate an object
@@ -791,7 +791,7 @@ ListStoreNew(
if (capacity == objc) {
storePtr->firstUsed = 0;
} else {
- ListSizeT extra = capacity - objc;
+ Tcl_Size extra = capacity - objc;
int spaceFlags = flags & LISTREP_SPACE_FLAGS;
if (spaceFlags == LISTREP_SPACE_ONLY_BACK) {
storePtr->firstUsed = 0;
@@ -838,9 +838,9 @@ ListStoreNew(
*------------------------------------------------------------------------
*/
ListStore *
-ListStoreReallocate (ListStore *storePtr, ListSizeT numSlots)
+ListStoreReallocate (ListStore *storePtr, Tcl_Size numSlots)
{
- ListSizeT newCapacity;
+ Tcl_Size newCapacity;
ListStore *newStorePtr;
newCapacity = ListStoreUpSize(numSlots);
@@ -891,7 +891,7 @@ ListStoreReallocate (ListStore *storePtr, ListSizeT numSlots)
*/
static int
ListRepInit(
- ListSizeT objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[],
int flags,
ListRep *repPtr
@@ -947,7 +947,7 @@ ListRepInit(
static int
ListRepInitAttempt(
Tcl_Interp *interp,
- ListSizeT objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[],
ListRep *repPtr)
{
@@ -988,7 +988,7 @@ static void
ListRepClone(ListRep *fromRepPtr, ListRep *toRepPtr, int flags)
{
Tcl_Obj **fromObjs;
- ListSizeT numFrom;
+ Tcl_Size numFrom;
ListRepElements(fromRepPtr, numFrom, fromObjs);
ListRepInit(numFrom, fromObjs, flags | LISTREP_PANIC_ON_FAIL, toRepPtr);
@@ -1016,7 +1016,7 @@ ListRepClone(ListRep *fromRepPtr, ListRep *toRepPtr, int flags)
*/
static void ListRepUnsharedFreeUnreferenced(const ListRep *repPtr)
{
- ListSizeT count;
+ Tcl_Size count;
ListStore *storePtr;
ListSpan *spanPtr;
@@ -1089,7 +1089,7 @@ static void ListRepUnsharedFreeUnreferenced(const ListRep *repPtr)
Tcl_Obj *
Tcl_NewListObj(
- ListSizeT objc, /* Count of objects referenced by objv. */
+ Tcl_Size objc, /* Count of objects referenced by objv. */
Tcl_Obj *const objv[]) /* An array of pointers to Tcl objects. */
{
return Tcl_DbNewListObj(objc, objv, "unknown", 0);
@@ -1099,7 +1099,7 @@ Tcl_NewListObj(
Tcl_Obj *
Tcl_NewListObj(
- ListSizeT objc, /* Count of objects referenced by objv. */
+ Tcl_Size objc, /* Count of objects referenced by objv. */
Tcl_Obj *const objv[]) /* An array of pointers to Tcl objects. */
{
ListRep listRep;
@@ -1151,7 +1151,7 @@ Tcl_NewListObj(
Tcl_Obj *
Tcl_DbNewListObj(
- ListSizeT objc, /* Count of objects referenced by objv. */
+ Tcl_Size objc, /* Count of objects referenced by objv. */
Tcl_Obj *const objv[], /* An array of pointers to Tcl objects. */
const char *file, /* The name of the source file calling this
* function; used for debugging. */
@@ -1177,7 +1177,7 @@ Tcl_DbNewListObj(
Tcl_Obj *
Tcl_DbNewListObj(
- ListSizeT objc, /* Count of objects referenced by objv. */
+ Tcl_Size objc, /* Count of objects referenced by objv. */
Tcl_Obj *const objv[], /* An array of pointers to Tcl objects. */
TCL_UNUSED(const char *) /*file*/,
TCL_UNUSED(int) /*line*/)
@@ -1207,15 +1207,15 @@ Tcl_DbNewListObj(
*/
Tcl_Obj *
TclNewListObj2(
- ListSizeT objc1, /* Count of objects referenced by objv1. */
+ Tcl_Size objc1, /* Count of objects referenced by objv1. */
Tcl_Obj *const objv1[], /* First array of pointers to Tcl objects. */
- ListSizeT objc2, /* Count of objects referenced by objv2. */
+ Tcl_Size objc2, /* Count of objects referenced by objv2. */
Tcl_Obj *const objv2[] /* Second array of pointers to Tcl objects. */
)
{
Tcl_Obj *listObj;
ListStore *storePtr;
- ListSizeT objc = objc1 + objc2;
+ Tcl_Size objc = objc1 + objc2;
listObj = Tcl_NewListObj(objc, NULL);
if (objc == 0) {
@@ -1311,7 +1311,7 @@ TclListObjGetRep(
void
Tcl_SetListObj(
Tcl_Obj *objPtr, /* Object whose internal rep to init. */
- ListSizeT objc, /* Count of objects referenced by objv. */
+ Tcl_Size objc, /* Count of objects referenced by objv. */
Tcl_Obj *const objv[]) /* An array of pointers to Tcl objects. */
{
if (Tcl_IsShared(objPtr)) {
@@ -1411,17 +1411,17 @@ TclListObjCopy(
static void
ListRepRange(
ListRep *srcRepPtr, /* Contains source of the range */
- ListSizeT rangeStart, /* Index of first element to include */
- ListSizeT rangeEnd, /* Index of last element to include */
+ Tcl_Size rangeStart, /* Index of first element to include */
+ Tcl_Size rangeEnd, /* Index of last element to include */
int preserveSrcRep, /* If true, srcRepPtr contents must not be
modified (generally because a shared Tcl_Obj
references it) */
ListRep *rangeRepPtr) /* Output. Must NOT be == srcRepPtr */
{
Tcl_Obj **srcElems;
- ListSizeT numSrcElems = ListRepLength(srcRepPtr);
- ListSizeT rangeLen;
- ListSizeT numAfterRangeEnd;
+ Tcl_Size numSrcElems = ListRepLength(srcRepPtr);
+ Tcl_Size rangeLen;
+ Tcl_Size numAfterRangeEnd;
LISTREP_CHECK(srcRepPtr);
@@ -1487,7 +1487,7 @@ ListRepRange(
srcRepPtr->storePtr->numUsed,
srcRepPtr->storePtr->numAllocated)) {
/* Option 2 - because span would be most efficient */
- ListSizeT spanStart = ListRepStart(srcRepPtr) + rangeStart;
+ Tcl_Size spanStart = ListRepStart(srcRepPtr) + rangeStart;
if (!preserveSrcRep && srcRepPtr->spanPtr
&& srcRepPtr->spanPtr->refCount <= 1) {
/* If span is not shared reuse it */
@@ -1598,8 +1598,8 @@ ListRepRange(
Tcl_Obj *
TclListObjRange(
Tcl_Obj *listObj, /* List object to take a range from. */
- ListSizeT rangeStart, /* Index of first element to include. */
- ListSizeT rangeEnd) /* Index of last element to include. */
+ Tcl_Size rangeStart, /* Index of first element to include. */
+ Tcl_Size rangeEnd) /* Index of last element to include. */
{
ListRep listRep;
ListRep resultRep;
@@ -1656,7 +1656,7 @@ Tcl_ListObjGetElements(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
Tcl_Obj *objPtr, /* List object for which an element array is
* to be returned. */
- ListSizeT *objcPtr, /* Where to store the count of objects
+ Tcl_Size *objcPtr, /* Where to store the count of objects
* referenced by objv. */
Tcl_Obj ***objvPtr) /* Where to store the pointer to an array of
* pointers to the list's objects. */
@@ -1701,7 +1701,7 @@ Tcl_ListObjAppendList(
Tcl_Obj *toObj, /* List object to append elements to. */
Tcl_Obj *fromObj) /* List obj with elements to append. */
{
- ListSizeT objc;
+ Tcl_Size objc;
Tcl_Obj **objv;
if (Tcl_IsShared(toObj)) {
@@ -1745,13 +1745,13 @@ Tcl_ListObjAppendList(
int TclListObjAppendElements (
Tcl_Interp *interp, /* Used to report errors if not NULL. */
Tcl_Obj *toObj, /* List object to append */
- ListSizeT elemCount, /* Number of elements in elemObjs[] */
+ Tcl_Size elemCount, /* Number of elements in elemObjs[] */
Tcl_Obj * const elemObjv[]) /* Objects to append to toObj's list. */
{
ListRep listRep;
Tcl_Obj **toObjv;
- ListSizeT toLen;
- ListSizeT finalLen;
+ Tcl_Size toLen;
+ Tcl_Size finalLen;
if (Tcl_IsShared(toObj)) {
Tcl_Panic("%s called with shared object", "TclListObjAppendElements");
@@ -1776,7 +1776,7 @@ Tcl_ListObjAppendList(
* reference counts on the elements which is a substantial cost
* if the list is not small.
*/
- ListSizeT numTailFree;
+ Tcl_Size numTailFree;
ListRepFreeUnreferenced(&listRep); /* Collect garbage before checking room */
@@ -1808,7 +1808,7 @@ Tcl_ListObjAppendList(
if (numTailFree < elemCount) {
/* Not enough room at back. Move some to front */
/* T:listrep-3.5 */
- ListSizeT shiftCount = elemCount - numTailFree;
+ Tcl_Size shiftCount = elemCount - numTailFree;
/* Divide remaining space between front and back */
shiftCount += (listRep.storePtr->numAllocated - finalLen) / 2;
LIST_ASSERT(shiftCount <= listRep.storePtr->firstUsed);
@@ -1936,11 +1936,11 @@ int
Tcl_ListObjIndex(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
Tcl_Obj *listObj, /* List object to index into. */
- ListSizeT index, /* Index of element to return. */
+ Tcl_Size index, /* Index of element to return. */
Tcl_Obj **objPtrPtr) /* The resulting Tcl_Obj* is stored here. */
{
Tcl_Obj **elemObjs;
- ListSizeT numElems;
+ Tcl_Size numElems;
/*
* TODO
@@ -1989,7 +1989,7 @@ int
Tcl_ListObjLength(
Tcl_Interp *interp, /* Used to report errors if not NULL. */
Tcl_Obj *listObj, /* List object whose #elements to return. */
- ListSizeT *lenPtr) /* The resulting int is stored here. */
+ Tcl_Size *lenPtr) /* The resulting int is stored here. */
{
ListRep listRep;
@@ -2053,17 +2053,17 @@ int
Tcl_ListObjReplace(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *listObj, /* List object whose elements to replace. */
- ListSizeT first, /* Index of first element to replace. */
- ListSizeT numToDelete, /* Number of elements to replace. */
- ListSizeT numToInsert, /* Number of objects to insert. */
+ Tcl_Size first, /* Index of first element to replace. */
+ Tcl_Size numToDelete, /* Number of elements to replace. */
+ Tcl_Size numToInsert, /* Number of objects to insert. */
Tcl_Obj *const insertObjs[])/* Tcl objects to insert */
{
ListRep listRep;
- ListSizeT origListLen;
+ Tcl_Size origListLen;
ptrdiff_t lenChange;
ptrdiff_t leadSegmentLen;
ptrdiff_t tailSegmentLen;
- ListSizeT numFreeSlots;
+ Tcl_Size numFreeSlots;
ptrdiff_t leadShift;
ptrdiff_t tailShift;
Tcl_Obj **listObjs;
@@ -2182,7 +2182,7 @@ Tcl_ListObjReplace(
ListRepStart(&listRep) == listRep.storePtr->firstUsed && /* (ii) */
numToInsert <= listRep.storePtr->firstUsed /* (iii) */
) {
- ListSizeT newLen;
+ Tcl_Size newLen;
LIST_ASSERT(numToInsert); /* Else would have returned above */
listRep.storePtr->firstUsed -= numToInsert;
ObjArrayCopy(&listRep.storePtr->slots[listRep.storePtr->firstUsed],
@@ -2389,7 +2389,7 @@ Tcl_ListObjReplace(
if (finalFreeSpace > 1 && (tailSpace == 0 || tailSegmentLen == 0)) {
ptrdiff_t postShiftLeadSpace = leadSpace - lenChange;
if (postShiftLeadSpace > (finalFreeSpace/2)) {
- ListSizeT extraShift = postShiftLeadSpace - (finalFreeSpace / 2);
+ Tcl_Size extraShift = postShiftLeadSpace - (finalFreeSpace / 2);
leadShift -= extraShift;
tailShift = -extraShift; /* Move tail to the front as well */
}
@@ -2407,7 +2407,7 @@ Tcl_ListObjReplace(
ptrdiff_t postShiftTailSpace = tailSpace - lenChange;
if (postShiftTailSpace > (finalFreeSpace/2)) {
/* T:listrep-1.{1,3,14,18,21},3.{2,3,26,27} */
- ListSizeT extraShift = postShiftTailSpace - (finalFreeSpace / 2);
+ Tcl_Size extraShift = postShiftTailSpace - (finalFreeSpace / 2);
tailShift += extraShift;
leadShift = extraShift; /* Move head to the back as well */
}
@@ -2452,7 +2452,7 @@ Tcl_ListObjReplace(
/* Will happen when we have to make room at bottom */
if (tailShift != 0 && tailSegmentLen != 0) {
/* T:listrep-1.{1,3,14,18},3.{2,3,26,27} */
- ListSizeT tailStart = leadSegmentLen + numToDelete;
+ Tcl_Size tailStart = leadSegmentLen + numToDelete;
memmove(&listObjs[tailStart + tailShift],
&listObjs[tailStart],
tailSegmentLen * sizeof(Tcl_Obj *));
@@ -2472,7 +2472,7 @@ Tcl_ListObjReplace(
}
if (tailShift != 0 && tailSegmentLen != 0) {
/* T:listrep-1.{7,17},3.{8:11,13,14,21,22,35,37,39:41} */
- ListSizeT tailStart = leadSegmentLen + numToDelete;
+ Tcl_Size tailStart = leadSegmentLen + numToDelete;
memmove(&listObjs[tailStart + tailShift],
&listObjs[tailStart],
tailSegmentLen * sizeof(Tcl_Obj *));
@@ -2542,10 +2542,10 @@ TclLindexList(
Tcl_Obj *listObj, /* List being unpacked. */
Tcl_Obj *argObj) /* Index or index list. */
{
- ListSizeT index; /* Index into the list. */
+ Tcl_Size index; /* Index into the list. */
Tcl_Obj *indexListCopy;
Tcl_Obj **indexObjs;
- ListSizeT numIndexObjs;
+ Tcl_Size numIndexObjs;
/*
* Determine whether argPtr designates a list or a single index. We have
@@ -2619,16 +2619,16 @@ Tcl_Obj *
TclLindexFlat(
Tcl_Interp *interp, /* Tcl interpreter. */
Tcl_Obj *listObj, /* Tcl object representing the list. */
- ListSizeT indexCount, /* Count of indices. */
+ Tcl_Size indexCount, /* Count of indices. */
Tcl_Obj *const indexArray[])/* Array of pointers to Tcl objects that
* represent the indices in the list. */
{
- ListSizeT i;
+ Tcl_Size i;
/* Handle ArithSeries as special case */
if (TclHasInternalRep(listObj,&tclArithSeriesType)) {
Tcl_WideInt listLen = TclArithSeriesObjLength(listObj);
- ListSizeT index;
+ Tcl_Size index;
Tcl_Obj *elemObj = NULL;
for (i=0 ; i<indexCount && listObj ; i++) {
if (TclGetIntForIndexM(interp, indexArray[i], /*endValue*/ listLen-1,
@@ -2640,17 +2640,17 @@ TclLindexFlat(
/* ArithSeries cannot be a list of lists */
Tcl_DecrRefCount(elemObj);
TclNewObj(elemObj);
- Tcl_IncrRefCount(elemObj);
break;
}
}
+ Tcl_IncrRefCount(elemObj);
return elemObj;
}
Tcl_IncrRefCount(listObj);
for (i=0 ; i<indexCount && listObj ; i++) {
- ListSizeT index, listLen = 0;
+ Tcl_Size index, listLen = 0;
Tcl_Obj **elemPtrs = NULL, *sublistCopy;
/*
@@ -2732,10 +2732,10 @@ TclLsetList(
Tcl_Obj *indexArgObj, /* Index or index-list arg to 'lset'. */
Tcl_Obj *valueObj) /* Value arg to 'lset' or NULL to 'lpop'. */
{
- ListSizeT indexCount = 0; /* Number of indices in the index list. */
+ Tcl_Size indexCount = 0; /* Number of indices in the index list. */
Tcl_Obj **indices = NULL; /* Vector of indices in the index list. */
Tcl_Obj *retValueObj; /* Pointer to the list to be returned. */
- ListSizeT index; /* Current index in the list - discarded. */
+ Tcl_Size index; /* Current index in the list - discarded. */
Tcl_Obj *indexListCopy;
/*
@@ -2813,17 +2813,17 @@ Tcl_Obj *
TclLsetFlat(
Tcl_Interp *interp, /* Tcl interpreter. */
Tcl_Obj *listObj, /* Pointer to the list being modified. */
- ListSizeT indexCount, /* Number of index args. */
+ Tcl_Size indexCount, /* Number of index args. */
Tcl_Obj *const indexArray[],
/* Index args. */
Tcl_Obj *valueObj) /* Value arg to 'lset' or NULL to 'lpop'. */
{
- ListSizeT index, len;
+ Tcl_Size index, len;
int result;
Tcl_Obj *subListObj, *retValueObj;
Tcl_Obj *pendingInvalidates[10];
Tcl_Obj **pendingInvalidatesPtr = pendingInvalidates;
- ListSizeT numPendingInvalidates = 0;
+ Tcl_Size numPendingInvalidates = 0;
/*
* If there are no indices, simply return the new value. (Without
@@ -2872,7 +2872,7 @@ TclLsetFlat(
*/
do {
- ListSizeT elemCount;
+ Tcl_Size elemCount;
Tcl_Obj *parentList, **elemPtrs;
/*
@@ -3076,13 +3076,13 @@ TclListObjSetElement(
* if not NULL. */
Tcl_Obj *listObj, /* List object in which element should be
* stored. */
- ListSizeT index, /* Index of element to store. */
+ Tcl_Size index, /* Index of element to store. */
Tcl_Obj *valueObj) /* Tcl object to store in the designated list
* element. */
{
ListRep listRep;
Tcl_Obj **elemPtrs; /* Pointers to elements of the list. */
- ListSizeT elemCount; /* Number of elements in the list. */
+ Tcl_Size elemCount; /* Number of elements in the list. */
/* Ensure that the listObj parameter designates an unshared list. */
@@ -3238,7 +3238,7 @@ SetListFromAny(
Tcl_Obj *keyPtr, *valuePtr;
Tcl_DictSearch search;
int done;
- ListSizeT size;
+ Tcl_Size size;
/*
* Create the new list representation. Note that we do not need to do
@@ -3280,7 +3280,7 @@ SetListFromAny(
* because it can be done an order of magnitude faster
* and may occur frequently.
*/
- ListSizeT j, size = TclArithSeriesObjLength(objPtr);
+ Tcl_Size j, size = TclArithSeriesObjLength(objPtr);
/* TODO - leave space in front and/or back? */
if (ListRepInitAttempt(
@@ -3302,7 +3302,7 @@ SetListFromAny(
}
} else {
- ListSizeT estCount, length;
+ Tcl_Size estCount, length;
const char *limit, *nextElem = Tcl_GetStringFromObj(objPtr, &length);
/*
@@ -3329,7 +3329,7 @@ SetListFromAny(
while (nextElem < limit) {
const char *elemStart;
char *check;
- ListSizeT elemSize;
+ Tcl_Size elemSize;
int literal;
if (TCL_OK != TclFindElement(interp, nextElem, limit - nextElem,
@@ -3413,7 +3413,7 @@ UpdateStringOfList(
{
# define LOCAL_SIZE 64
char localFlags[LOCAL_SIZE], *flagPtr = NULL;
- ListSizeT numElems, i, length;
+ Tcl_Size numElems, i, length;
TCL_HASH_TYPE bytesNeeded = 0;
const char *elem, *start;
char *dst;
@@ -3517,7 +3517,7 @@ TclListTestObj (int length, int leadingSpace, int endSpace)
endSpace = 0;
ListRep listRep;
- ListSizeT capacity;
+ Tcl_Size capacity;
Tcl_Obj *listObj;
TclNewObj(listObj);
diff --git a/generic/tclOOScript.h b/generic/tclOOScript.h
index a1e4624..f2e99b0 100644
--- a/generic/tclOOScript.h
+++ b/generic/tclOOScript.h
@@ -116,7 +116,7 @@ static const char *tclOOSetupScript =
"\t\t\t\t}]\n"
"\t\t}\n"
"\t}\n"
-"\tproc define::classmethod {name {args {}} {body {}}} {\n"
+"\tproc define::classmethod {name args} {\n"
"\t\t::set argc [::llength [::info level 0]]\n"
"\t\t::if {$argc == 3} {\n"
"\t\t\t::return -code error -errorcode {TCL WRONGARGS} [::format \\\n"
@@ -125,7 +125,7 @@ static const char *tclOOSetupScript =
"\t\t}\n"
"\t\t::set cls [::uplevel 1 self]\n"
"\t\t::if {$argc == 4} {\n"
-"\t\t\t::oo::define [::oo::DelegateName $cls] method $name $args $body\n"
+"\t\t\t::oo::define [::oo::DelegateName $cls] method $name {*}$args\n"
"\t\t}\n"
"\t\t::tailcall forward $name myclass $name\n"
"\t}\n"
diff --git a/generic/tclObj.c b/generic/tclObj.c
index b2d70e6..df2ed6d 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -2040,6 +2040,8 @@ Tcl_GetBoolFromObj(
} else if (flags == (int)sizeof(short)) {
*(short *)charPtr = result;
return TCL_OK;
+ } else {
+ Tcl_Panic("Wrong bool var for %s", "Tcl_GetBoolFromObj");
}
}
*charPtr = result;
diff --git a/generic/tclPkg.c b/generic/tclPkg.c
index 4cbc52b..c439a36 100644
--- a/generic/tclPkg.c
+++ b/generic/tclPkg.c
@@ -40,7 +40,7 @@ typedef struct PkgAvail {
typedef struct PkgName {
struct PkgName *nextPtr; /* Next in list of package names being
* initialized. */
- char name[1];
+ char name[TCLFLEXARRAY];
} PkgName;
typedef struct PkgFiles {
@@ -828,7 +828,7 @@ SelectPackage(
* Push "ifneeded" package name in "tclPkgFiles" assocdata.
*/
- pkgName = (PkgName *)Tcl_Alloc(sizeof(PkgName) + strlen(name));
+ pkgName = (PkgName *)Tcl_Alloc(offsetof(PkgName, name) + 1 + strlen(name));
pkgName->nextPtr = pkgFiles->names;
strcpy(pkgName->name, name);
pkgFiles->names = pkgName;
diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h
index 871a2d3..10d3094 100644
--- a/generic/tclPlatDecls.h
+++ b/generic/tclPlatDecls.h
@@ -48,6 +48,94 @@
# endif
#endif
+#if TCL_MAJOR_VERSION < 9
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Exported function declarations:
+ */
+
+#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
+/* 0 */
+EXTERN TCHAR * Tcl_WinUtfToTChar(const char *str, int len,
+ Tcl_DString *dsPtr);
+/* 1 */
+EXTERN char * Tcl_WinTCharToUtf(const TCHAR *str, int len,
+ Tcl_DString *dsPtr);
+/* Slot 2 is reserved */
+/* 3 */
+EXTERN void Tcl_WinConvertError(unsigned errCode);
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+/* 0 */
+EXTERN int Tcl_MacOSXOpenBundleResources(Tcl_Interp *interp,
+ const char *bundleName, int hasResourceFile,
+ int maxPathLen, char *libraryPath);
+/* 1 */
+EXTERN int Tcl_MacOSXOpenVersionedBundleResources(
+ Tcl_Interp *interp, const char *bundleName,
+ const char *bundleVersion,
+ int hasResourceFile, int maxPathLen,
+ char *libraryPath);
+/* 2 */
+EXTERN void Tcl_MacOSXNotifierAddRunLoopMode(
+ const void *runLoopMode);
+#endif /* MACOSX */
+
+typedef struct TclPlatStubs {
+ int magic;
+ void *hooks;
+
+#if defined(_WIN32) || defined(__CYGWIN__) /* 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 */
+ void (*reserved2)(void);
+ void (*tcl_WinConvertError) (unsigned errCode); /* 3 */
+#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 */
+ void (*tcl_MacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 2 */
+#endif /* MACOSX */
+} TclPlatStubs;
+
+extern const TclPlatStubs *tclPlatStubsPtr;
+
+#ifdef __cplusplus
+}
+#endif
+
+#if defined(USE_TCL_STUBS)
+
+/*
+ * Inline function declarations:
+ */
+
+#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
+#define Tcl_WinUtfToTChar \
+ (tclPlatStubsPtr->tcl_WinUtfToTChar) /* 0 */
+#define Tcl_WinTCharToUtf \
+ (tclPlatStubsPtr->tcl_WinTCharToUtf) /* 1 */
+/* Slot 2 is reserved */
+#define Tcl_WinConvertError \
+ (tclPlatStubsPtr->tcl_WinConvertError) /* 3 */
+#endif /* WIN */
+#ifdef MAC_OSX_TCL /* MACOSX */
+#define Tcl_MacOSXOpenBundleResources \
+ (tclPlatStubsPtr->tcl_MacOSXOpenBundleResources) /* 0 */
+#define Tcl_MacOSXOpenVersionedBundleResources \
+ (tclPlatStubsPtr->tcl_MacOSXOpenVersionedBundleResources) /* 1 */
+#define Tcl_MacOSXNotifierAddRunLoopMode \
+ (tclPlatStubsPtr->tcl_MacOSXNotifierAddRunLoopMode) /* 2 */
+#endif /* MACOSX */
+
+#endif /* defined(USE_TCL_STUBS) */
+
+#else /* TCL_MAJOR_VERSION > 8 */
+
/* !BEGIN!: Do not edit below this line. */
#ifdef __cplusplus
@@ -105,6 +193,13 @@ extern const TclPlatStubs *tclPlatStubsPtr;
/* !END!: Do not edit above this line. */
+#endif /* TCL_MAJOR_VERSION */
+
+#ifdef MAC_OSX_TCL /* MACOSX */
+#undef Tcl_MacOSXOpenBundleResources
+#define Tcl_MacOSXOpenBundleResources(a,b,c,d,e) Tcl_MacOSXOpenVersionedBundleResources(a,b,NULL,c,d,e)
+#endif
+
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
@@ -118,11 +213,16 @@ extern const TclPlatStubs *tclPlatStubsPtr;
# undef Tcl_MacOSXNotifierAddRunLoopMode
#endif
-#if defined(USE_TCL_STUBS) && defined(_WIN32) && !defined(TCL_NO_DEPRECATED)
+#if defined(USE_TCL_STUBS) && (defined(_WIN32) || defined(__CYGWIN__))\
+ && (defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8)
+#undef Tcl_WinUtfToTChar
+#undef Tcl_WinTCharToUtf
+#ifdef _WIN32
#define Tcl_WinUtfToTChar(string, len, dsPtr) (Tcl_DStringInit(dsPtr), \
(TCHAR *)Tcl_UtfToChar16DString((string), (len), (dsPtr)))
#define Tcl_WinTCharToUtf(string, len, dsPtr) (Tcl_DStringInit(dsPtr), \
(char *)Tcl_Char16ToUtfDString((const unsigned short *)(string), ((((len) + 2) >> 1) - 1), (dsPtr)))
#endif
+#endif
#endif /* _TCLPLATDECLS */
diff --git a/generic/tclProc.c b/generic/tclProc.c
index a9baba2..e97cb10 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -68,7 +68,7 @@ const Tcl_ObjType tclProcBodyType = {
TCL_OBJTYPE_V0
};
-#define ProcSetIntRep(objPtr, procPtr) \
+#define ProcSetInternalRep(objPtr, procPtr) \
do { \
Tcl_ObjInternalRep ir; \
(procPtr)->refCount++; \
@@ -77,7 +77,7 @@ const Tcl_ObjType tclProcBodyType = {
Tcl_StoreInternalRep((objPtr), &tclProcBodyType, &ir); \
} while (0)
-#define ProcGetIntRep(objPtr, procPtr) \
+#define ProcGetInternalRep(objPtr, procPtr) \
do { \
const Tcl_ObjInternalRep *irPtr; \
irPtr = TclFetchInternalRep((objPtr), &tclProcBodyType); \
@@ -115,7 +115,7 @@ static const Tcl_ObjType lambdaType = {
TCL_OBJTYPE_V0
};
-#define LambdaSetIntRep(objPtr, procPtr, nsObjPtr) \
+#define LambdaSetInternalRep(objPtr, procPtr, nsObjPtr) \
do { \
Tcl_ObjInternalRep ir; \
ir.twoPtrValue.ptr1 = (procPtr); \
@@ -124,7 +124,7 @@ static const Tcl_ObjType lambdaType = {
Tcl_StoreInternalRep((objPtr), &lambdaType, &ir); \
} while (0)
-#define LambdaGetIntRep(objPtr, procPtr, nsObjPtr) \
+#define LambdaGetInternalRep(objPtr, procPtr, nsObjPtr) \
do { \
const Tcl_ObjInternalRep *irPtr; \
irPtr = TclFetchInternalRep((objPtr), &lambdaType); \
@@ -155,7 +155,7 @@ int
Tcl_ProcObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
- size_t objc, /* Number of arguments. */
+ Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
@@ -330,7 +330,7 @@ Tcl_ProcObjCmd(
* of all procs whose argument list is just _args_
*/
- if (objv[3]->typePtr == &tclProcBodyType) {
+ if (TclHasInternalRep(objv[3], &tclProcBodyType)) {
goto done;
}
@@ -341,7 +341,7 @@ Tcl_ProcObjCmd(
}
if ((procArgs[0] == 'a') && (strncmp(procArgs, "args", 4) == 0)) {
- size_t numBytes;
+ Tcl_Size numBytes;
procArgs +=4;
while (*procArgs != '\0') {
@@ -407,12 +407,12 @@ TclCreateProc(
Interp *iPtr = (Interp *) interp;
Proc *procPtr = NULL;
- size_t i, numArgs;
+ Tcl_Size i, numArgs;
CompiledLocal *localPtr = NULL;
Tcl_Obj **argArray;
int precompiled = 0, result;
- ProcGetIntRep(bodyPtr, procPtr);
+ ProcGetInternalRep(bodyPtr, procPtr);
if (procPtr != NULL) {
/*
* Because the body is a TclProProcBody, the actual body is already
@@ -447,7 +447,7 @@ TclCreateProc(
if (Tcl_IsShared(bodyPtr)) {
const char *bytes;
- size_t length;
+ Tcl_Size length;
Tcl_Obj *sharedBodyPtr = bodyPtr;
bytes = Tcl_GetStringFromObj(bodyPtr, &length);
@@ -510,7 +510,7 @@ TclCreateProc(
for (i = 0; i < numArgs; i++) {
const char *argname, *argnamei, *argnamelast;
- size_t fieldCount, nameLength;
+ Tcl_Size fieldCount, nameLength;
Tcl_Obj **fieldValues;
/*
@@ -602,7 +602,7 @@ TclCreateProc(
*/
if (localPtr->defValuePtr != NULL) {
- size_t tmpLength, valueLength;
+ Tcl_Size tmpLength, valueLength;
const char *tmpPtr = Tcl_GetStringFromObj(localPtr->defValuePtr, &tmpLength);
const char *value = Tcl_GetStringFromObj(fieldValues[1], &valueLength);
@@ -867,7 +867,7 @@ badLevel:
static int
Uplevel_Callback(
- ClientData data[],
+ void *data[],
Tcl_Interp *interp,
int result)
{
@@ -888,7 +888,7 @@ Uplevel_Callback(
int
Tcl_UplevelObjCmd(
- ClientData clientData,
+ void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -922,7 +922,7 @@ TclNRUplevelObjCmd(
return TCL_ERROR;
} else if (!TclHasStringRep(objv[1]) && objc == 2) {
int status;
- size_t llength;
+ Tcl_Size llength;
status = TclListObjLengthM(interp, objv[1], &llength);
if (status == TCL_OK && llength > 1) {
/* the first argument can't interpreted as a level. Avoid
@@ -1249,7 +1249,7 @@ TclFreeLocalCache(
Tcl_Interp *interp,
LocalCache *localCachePtr)
{
- size_t i;
+ Tcl_Size i;
Tcl_Obj **namePtrPtr = &localCachePtr->varName0;
for (i = 0; i < localCachePtr->numVars; i++, namePtrPtr++) {
@@ -1269,8 +1269,8 @@ InitLocalCache(
{
Interp *iPtr = procPtr->iPtr;
ByteCode *codePtr;
- size_t localCt = procPtr->numCompiledLocals;
- size_t numArgs = procPtr->numArgs, i = 0;
+ Tcl_Size localCt = procPtr->numCompiledLocals;
+ Tcl_Size numArgs = procPtr->numArgs, i = 0;
Tcl_Obj **namePtr;
Var *varPtr;
@@ -1298,7 +1298,7 @@ InitLocalCache(
*namePtr = NULL;
} else {
*namePtr = TclCreateLiteral(iPtr, localPtr->name,
- localPtr->nameLength, /* hash */ -1,
+ localPtr->nameLength, /* hash */ (size_t) -1,
&isNew, /* nsPtr */ NULL, 0, NULL);
Tcl_IncrRefCount(*namePtr);
}
@@ -1503,11 +1503,11 @@ InitArgsAndLocals(
int
TclPushProcCallFrame(
- ClientData clientData, /* Record describing procedure to be
+ void *clientData, /* Record describing procedure to be
* interpreted. */
Tcl_Interp *interp,/* Interpreter in which procedure was
* invoked. */
- size_t objc1, /* Count of number of arguments to this
+ Tcl_Size objc, /* Count of number of arguments to this
* procedure. */
Tcl_Obj *const objv[], /* Argument value objects. */
int isLambda) /* 1 if this is a call by ApplyObjCmd: it
@@ -1518,7 +1518,6 @@ TclPushProcCallFrame(
CallFrame *framePtr, **framePtrPtr;
int result;
ByteCode *codePtr;
- int objc = objc1;
/*
* If necessary (i.e. if we haven't got a suitable compilation already
@@ -1599,7 +1598,7 @@ TclPushProcCallFrame(
int
TclObjInterpProc(
- ClientData clientData, /* Record describing procedure to be
+ void *clientData, /* Record describing procedure to be
* interpreted. */
Tcl_Interp *interp,/* Interpreter in which procedure was
* invoked. */
@@ -1616,7 +1615,7 @@ TclObjInterpProc(
int
TclNRInterpProc(
- ClientData clientData, /* Record describing procedure to be
+ void *clientData, /* Record describing procedure to be
* interpreted. */
Tcl_Interp *interp,/* Interpreter in which procedure was
* invoked. */
@@ -1635,7 +1634,7 @@ TclNRInterpProc(
static int
NRInterpProc2(
- ClientData clientData, /* Record describing procedure to be
+ void *clientData, /* Record describing procedure to be
* interpreted. */
Tcl_Interp *interp,/* Interpreter in which procedure was
* invoked. */
@@ -1654,7 +1653,7 @@ NRInterpProc2(
static int
ObjInterpProc2(
- ClientData clientData, /* Record describing procedure to be
+ void *clientData, /* Record describing procedure to be
* interpreted. */
Tcl_Interp *interp,/* Interpreter in which procedure was
* invoked. */
@@ -1693,7 +1692,7 @@ TclNRInterpProcCore(
Tcl_Interp *interp,/* Interpreter in which procedure was
* invoked. */
Tcl_Obj *procNameObj, /* Procedure name for error reporting. */
- size_t skip1, /* Number of initial arguments to be skipped,
+ Tcl_Size skip, /* Number of initial arguments to be skipped,
* i.e., words in the "command name". */
ProcErrorProc *errorProc) /* How to convert results from the script into
* results of the overall procedure. */
@@ -1703,7 +1702,6 @@ TclNRInterpProcCore(
int result;
CallFrame *freePtr;
ByteCode *codePtr;
- int skip = skip1;
result = InitArgsAndLocals(interp, skip);
if (result != TCL_OK) {
@@ -1718,7 +1716,7 @@ TclNRInterpProcCore(
#if defined(TCL_COMPILE_DEBUG)
if (tclTraceExec >= 1) {
CallFrame *framePtr = iPtr->varFramePtr;
- size_t i;
+ Tcl_Size i;
if (framePtr->isProcCallFrame & FRAME_IS_LAMBDA) {
fprintf(stdout, "Calling lambda ");
@@ -1736,9 +1734,9 @@ TclNRInterpProcCore(
#ifdef USE_DTRACE
if (TCL_DTRACE_PROC_ARGS_ENABLED()) {
- size_t l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;
+ Tcl_Size l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;
const char *a[10];
- size_t i;
+ Tcl_Size i;
for (i = 0 ; i < 10 ; i++) {
a[i] = (l < iPtr->varFramePtr->objc ?
@@ -1757,7 +1755,7 @@ TclNRInterpProcCore(
TclDecrRefCount(info);
}
if (TCL_DTRACE_PROC_ENTRY_ENABLED()) {
- size_t l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;
+ Tcl_Size l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;
TCL_DTRACE_PROC_ENTRY(l < iPtr->varFramePtr->objc ?
TclGetString(iPtr->varFramePtr->objv[l]) : NULL,
@@ -1765,7 +1763,7 @@ TclNRInterpProcCore(
(Tcl_Obj **)(iPtr->varFramePtr->objv + l + 1));
}
if (TCL_DTRACE_PROC_ENTRY_ENABLED()) {
- size_t l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;
+ Tcl_Size l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;
TCL_DTRACE_PROC_ENTRY(l < iPtr->varFramePtr->objc ?
TclGetString(iPtr->varFramePtr->objv[l]) : NULL,
@@ -1788,7 +1786,7 @@ TclNRInterpProcCore(
static int
InterpProcNR2(
- ClientData data[],
+ void *data[],
Tcl_Interp *interp,
int result)
{
@@ -1799,7 +1797,7 @@ InterpProcNR2(
ProcErrorProc *errorProc = (ProcErrorProc *)data[1];
if (TCL_DTRACE_PROC_RETURN_ENABLED()) {
- size_t l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;
+ Tcl_Size l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;
TCL_DTRACE_PROC_RETURN(l < iPtr->varFramePtr->objc ?
TclGetString(iPtr->varFramePtr->objv[l]) : NULL, result);
@@ -1822,7 +1820,7 @@ InterpProcNR2(
done:
if (TCL_DTRACE_PROC_RESULT_ENABLED()) {
- size_t l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;
+ Tcl_Size l = iPtr->varFramePtr->isProcCallFrame & FRAME_IS_LAMBDA ? 1 : 0;
Tcl_Obj *r = Tcl_GetObjResult(interp);
TCL_DTRACE_PROC_RESULT(l < iPtr->varFramePtr->objc ?
@@ -2080,14 +2078,14 @@ MakeProcError(
Tcl_Obj *procNameObj) /* Name of the procedure. Used for error
* messages and trace information. */
{
- unsigned int overflow, limit = 60;
- size_t nameLen;
+ int overflow, limit = 60;
+ Tcl_Size nameLen;
const char *procName = Tcl_GetStringFromObj(procNameObj, &nameLen);
- overflow = (nameLen > limit);
+ overflow = (nameLen > (Tcl_Size)limit);
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (procedure \"%.*s%s\" line %d)",
- (int)(overflow ? limit :nameLen), procName,
+ (overflow ? limit : (int)nameLen), procName,
(overflow ? "..." : ""), Tcl_GetErrorLine(interp)));
}
@@ -2113,7 +2111,7 @@ MakeProcError(
void
TclProcDeleteProc(
- ClientData clientData) /* Procedure to be deleted. */
+ void *clientData) /* Procedure to be deleted. */
{
Proc *procPtr = (Proc *)clientData;
@@ -2323,7 +2321,7 @@ TclNewProcBodyObj(
TclNewObj(objPtr);
if (objPtr) {
- ProcSetIntRep(objPtr, procPtr);
+ ProcSetInternalRep(objPtr, procPtr);
}
return objPtr;
@@ -2352,9 +2350,9 @@ ProcBodyDup(
Tcl_Obj *dupPtr) /* Target object for the duplication. */
{
Proc *procPtr;
- ProcGetIntRep(srcPtr, procPtr);
+ ProcGetInternalRep(srcPtr, procPtr);
- ProcSetIntRep(dupPtr, procPtr);
+ ProcSetInternalRep(dupPtr, procPtr);
}
/*
@@ -2382,7 +2380,7 @@ ProcBodyFree(
{
Proc *procPtr;
- ProcGetIntRep(objPtr, procPtr);
+ ProcGetInternalRep(objPtr, procPtr);
if (procPtr->refCount-- <= 1) {
TclProcCleanupProc(procPtr);
@@ -2411,12 +2409,12 @@ DupLambdaInternalRep(
Proc *procPtr;
Tcl_Obj *nsObjPtr;
- LambdaGetIntRep(srcPtr, procPtr, nsObjPtr);
+ LambdaGetInternalRep(srcPtr, procPtr, nsObjPtr);
assert(procPtr != NULL);
procPtr->refCount++;
- LambdaSetIntRep(copyPtr, procPtr, nsObjPtr);
+ LambdaSetInternalRep(copyPtr, procPtr, nsObjPtr);
}
static void
@@ -2427,7 +2425,7 @@ FreeLambdaInternalRep(
Proc *procPtr;
Tcl_Obj *nsObjPtr;
- LambdaGetIntRep(objPtr, procPtr, nsObjPtr);
+ LambdaGetInternalRep(objPtr, procPtr, nsObjPtr);
assert(procPtr != NULL);
if (procPtr->refCount-- <= 1) {
@@ -2445,7 +2443,7 @@ SetLambdaFromAny(
const char *name;
Tcl_Obj *argsPtr, *bodyPtr, *nsObjPtr, **objv;
int isNew, result;
- size_t objc;
+ Tcl_Size objc;
CmdFrame *cfPtr = NULL;
Proc *procPtr;
@@ -2602,7 +2600,7 @@ SetLambdaFromAny(
* conversion to lambdaType.
*/
- LambdaSetIntRep(objPtr, procPtr, nsObjPtr);
+ LambdaSetInternalRep(objPtr, procPtr, nsObjPtr);
return TCL_OK;
}
@@ -2615,13 +2613,13 @@ TclGetLambdaFromObj(
Proc *procPtr;
Tcl_Obj *nsObjPtr;
- LambdaGetIntRep(objPtr, procPtr, nsObjPtr);
+ LambdaGetInternalRep(objPtr, procPtr, nsObjPtr);
if (procPtr == NULL) {
if (SetLambdaFromAny(interp, objPtr) != TCL_OK) {
return NULL;
}
- LambdaGetIntRep(objPtr, procPtr, nsObjPtr);
+ LambdaGetInternalRep(objPtr, procPtr, nsObjPtr);
}
assert(procPtr != NULL);
@@ -2652,7 +2650,7 @@ TclGetLambdaFromObj(
int
Tcl_ApplyObjCmd(
- ClientData clientData,
+ void *clientData,
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -2731,7 +2729,7 @@ TclNRApplyObjCmd(
static int
ApplyNR2(
- ClientData data[],
+ void *data[],
Tcl_Interp *interp,
int result)
{
@@ -2766,14 +2764,14 @@ MakeLambdaError(
Tcl_Obj *procNameObj) /* Name of the procedure. Used for error
* messages and trace information. */
{
- unsigned int overflow, limit = 60;
- size_t nameLen;
+ int overflow, limit = 60;
+ Tcl_Size nameLen;
const char *procName = Tcl_GetStringFromObj(procNameObj, &nameLen);
- overflow = (nameLen > limit);
+ overflow = (nameLen > (Tcl_Size)limit);
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (lambda term \"%.*s%s\" line %d)",
- (int)(overflow ? limit : nameLen), procName,
+ (overflow ? limit : (int)nameLen), procName,
(overflow ? "..." : ""), Tcl_GetErrorLine(interp)));
}
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index fb7e45a..607bfab 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2934,6 +2934,7 @@ TclStringRepeat(
int inPlace = flags & TCL_STRING_IN_PLACE;
size_t length = 0, unichar = 0, done = 1;
int binary = TclIsPureByteArray(objPtr);
+ size_t maxCount;
/* assert (count >= 2) */
@@ -2956,12 +2957,17 @@ TclStringRepeat(
if (binary) {
/* Result will be pure byte array. Pre-size it */
(void)Tcl_GetByteArrayFromObj(objPtr, &length);
- } else if (unichar) {
+ maxCount = TCL_SIZE_SMAX;
+ }
+ else if (unichar) {
/* Result will be pure Tcl_UniChar array. Pre-size it. */
(void)Tcl_GetUnicodeFromObj(objPtr, &length);
- } else {
+ maxCount = TCL_SIZE_SMAX/sizeof(Tcl_UniChar);
+ }
+ else {
/* Result will be concat of string reps. Pre-size it. */
(void)Tcl_GetStringFromObj(objPtr, &length);
+ maxCount = TCL_SIZE_SMAX;
}
if (length == 0) {
@@ -2969,10 +2975,14 @@ TclStringRepeat(
return objPtr;
}
- if (count > INT_MAX/length) {
+ /* maxCount includes space for null */
+ if (count > (maxCount-1)) {
if (interp) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "max size for a Tcl value (%d bytes) exceeded", INT_MAX));
+ Tcl_SetObjResult(
+ interp,
+ Tcl_ObjPrintf("max size for a Tcl value (%" TCL_Z_MODIFIER
+ "u bytes) exceeded",
+ TCL_SIZE_SMAX));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return NULL;
@@ -2983,6 +2993,7 @@ TclStringRepeat(
objResultPtr = (!inPlace || Tcl_IsShared(objPtr)) ?
Tcl_DuplicateObj(objPtr) : objPtr;
+ /* Allocate count*length space */
Tcl_SetByteArrayLength(objResultPtr, count*length); /* PANIC? */
Tcl_SetByteArrayLength(objResultPtr, length);
while (count - done > done) {
@@ -3050,6 +3061,7 @@ TclStringRepeat(
(count - done) * length);
}
return objResultPtr;
+
}
/*
@@ -3078,7 +3090,7 @@ TclStringCat(
{
Tcl_Obj *objResultPtr, * const *ov;
int oc, binary = 1;
- size_t length = 0;
+ size_t length = 0;
int allowUniChar = 1, requestUniChar = 0, forceUniChar = 0;
int first = objc - 1; /* Index of first value possibly not empty */
int last = 0; /* Index of last value possibly not empty */
@@ -3160,6 +3172,9 @@ TclStringCat(
if (length == 0) {
first = last;
}
+ if (length > (TCL_SIZE_SMAX-numBytes)) {
+ goto overflow;
+ }
length += numBytes;
}
}
@@ -3183,6 +3198,9 @@ TclStringCat(
if (length == 0) {
first = last;
}
+ if (length > ((TCL_SIZE_SMAX/sizeof(Tcl_UniChar))-numChars)) {
+ goto overflow;
+ }
length += numChars;
}
}
@@ -3247,7 +3265,7 @@ TclStringCat(
if (numBytes) {
first = last;
}
- } else if (numBytes + length > (size_t)INT_MAX) {
+ } else if (numBytes > (TCL_SIZE_SMAX - length)) {
goto overflow;
}
length += numBytes;
@@ -3264,7 +3282,7 @@ TclStringCat(
numBytes = objPtr->length;
if (numBytes) {
last = objc - oc;
- if (numBytes + length > (size_t)INT_MAX) {
+ if (numBytes > (TCL_SIZE_SMAX - length)) {
goto overflow;
}
length += numBytes;
@@ -3423,7 +3441,7 @@ TclStringCat(
overflow:
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "max size for a Tcl value (%d bytes) exceeded", INT_MAX));
+ "max size for a Tcl value (%" TCL_Z_MODIFIER "u bytes) exceeded", TCL_SIZE_SMAX));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return NULL;
@@ -4083,11 +4101,11 @@ TclStringReplace(
return objPtr;
}
- if ((size_t)newBytes > INT_MAX - (numBytes - count)) {
+ if (newBytes > (TCL_SIZE_SMAX - (numBytes - count))) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "max size for a Tcl value (%d bytes) exceeded",
- INT_MAX));
+ "max size for a Tcl value (%" TCL_Z_MODIFIER "u bytes) exceeded",
+ TCL_SIZE_SMAX));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return NULL;
@@ -4122,7 +4140,7 @@ TclStringReplace(
if (insertPtr) {
Tcl_AppendObjToObj(result, insertPtr);
}
- if (first + count < (size_t)numChars) {
+ if ((first + count) < numChars) {
Tcl_AppendUnicodeToObj(result, ustring + first + count,
numChars - first - count);
}
diff --git a/generic/tclStringRep.h b/generic/tclStringRep.h
index 425f08c..ab52ea8 100644
--- a/generic/tclStringRep.h
+++ b/generic/tclStringRep.h
@@ -51,15 +51,15 @@
*/
typedef struct {
- size_t numChars; /* The number of chars in the string. -1 means
- * this value has not been calculated. Any other
- * means that there is a valid Unicode rep, or
- * that the number of UTF bytes == the number
- * of chars. */
- size_t allocated; /* The amount of space actually allocated for
+ Tcl_Size numChars; /* The number of chars in the string.
+ * TCL_INDEX_NONE means this value has not been
+ * calculated. Any other means that there is a valid
+ * Unicode rep, or that the number of UTF bytes ==
+ * the number of chars. */
+ Tcl_Size allocated; /* The amount of space actually allocated for
* the UTF string (minus 1 byte for the
* termination char). */
- size_t maxChars; /* Max number of chars that can fit in the
+ Tcl_Size maxChars; /* Max number of chars that can fit in the
* space allocated for the unicode array. */
int hasUnicode; /* Boolean determining whether the string has
* a Unicode representation. */
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 18ef6d4..a1d0541 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -55,6 +55,13 @@
#undef TclSockMinimumBuffers
#undef Tcl_SetIntObj
#undef Tcl_SetLongObj
+#undef Tcl_ListObjGetElements
+#undef Tcl_ListObjLength
+#undef Tcl_DictObjSize
+#undef Tcl_SplitList
+#undef Tcl_SplitPath
+#undef Tcl_FSSplitPath
+#undef Tcl_ParseArgsObjv
#undef TclpInetNtoa
#undef TclWinGetServByName
#undef TclWinGetSockOpt
@@ -524,7 +531,7 @@ static const TclIntStubs tclIntStubs = {
Tcl_PushCallFrame, /* 129 */
Tcl_RemoveInterpResolvers, /* 130 */
Tcl_SetNamespaceResolvers, /* 131 */
- TclpHasSockets, /* 132 */
+ 0, /* 132 */
0, /* 133 */
0, /* 134 */
0, /* 135 */
@@ -1479,6 +1486,7 @@ const TclStubs tclStubs = {
Tcl_GetNumberFromObj, /* 680 */
Tcl_GetNumber, /* 681 */
Tcl_RemoveChannelMode, /* 682 */
+ Tcl_GetEncodingNulLength, /* 683 */
};
/* !END!: Do not edit above this line. */
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 20859d2..5d76afd 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -526,7 +526,8 @@ Tcltest_Init(
{
Tcl_CmdInfo info;
Tcl_Obj **objv, *objPtr;
- int objc, index;
+ Tcl_Size objc;
+ int index;
static const char *const specialOptions[] = {
"-appinitprocerror", "-appinitprocdeleteinterp",
"-appinitprocclosestderr", "-appinitprocsetrcfile", NULL
@@ -1965,12 +1966,17 @@ TestencodingObjCmd(
const char *string;
TclEncoding *encodingPtr;
static const char *const optionStrings[] = {
- "create", "delete", NULL
+ "create", "delete", "nullength", NULL
};
enum options {
- ENC_CREATE, ENC_DELETE
+ ENC_CREATE, ENC_DELETE, ENC_NULLENGTH
} index;
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "command ?args?");
+ return TCL_ERROR;
+ }
+
if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
&index) != TCL_OK) {
return TCL_ERROR;
@@ -1981,6 +1987,7 @@ TestencodingObjCmd(
Tcl_EncodingType type;
if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 2, objv, "name toutfcmd fromutfcmd");
return TCL_ERROR;
}
encodingPtr = (TclEncoding*)Tcl_Alloc(sizeof(TclEncoding));
@@ -2017,6 +2024,20 @@ TestencodingObjCmd(
Tcl_FreeEncoding(encoding); /* Free to match CREATE */
TclFreeInternalRep(objv[2]); /* Free the cached ref */
break;
+
+ case ENC_NULLENGTH:
+ if (objc > 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?encoding?");
+ return TCL_ERROR;
+ }
+ encoding =
+ Tcl_GetEncoding(interp, objc == 2 ? NULL : Tcl_GetString(objv[2]));
+ if (encoding == NULL) {
+ return TCL_ERROR;
+ }
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(Tcl_GetEncodingNulLength(encoding)));
+ Tcl_FreeEncoding(encoding);
}
return TCL_OK;
}
@@ -3508,7 +3529,7 @@ TestlistrepCmd(
return TCL_ERROR;
} else {
Tcl_Obj **objs;
- ListSizeT nobjs;
+ Tcl_Size nobjs;
ListRep listRep;
Tcl_Obj *listRepObjs[4];
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 8999858..ac92a73 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -21,8 +21,8 @@
typedef struct {
int flags; /* Operations for which Tcl command is to be
* invoked. */
- size_t length; /* Number of non-NUL chars. in command. */
- char command[1]; /* Space for Tcl command to invoke. Actual
+ Tcl_Size length; /* Number of non-NUL chars. in command. */
+ char command[TCLFLEXARRAY]; /* Space for Tcl command to invoke. Actual
* size will be as large as necessary to hold
* command. This field must be the last in the
* structure, so that it can be larger than 1
@@ -41,10 +41,10 @@ typedef struct {
typedef struct {
int flags; /* Operations for which Tcl command is to be
* invoked. */
- size_t length; /* Number of non-NUL chars. in command. */
+ Tcl_Size length; /* Number of non-NUL chars. in command. */
Tcl_Trace stepTrace; /* Used for execution traces, when tracing
* inside the given command */
- int startLevel; /* Used for bookkeeping with step execution
+ Tcl_Size startLevel; /* Used for bookkeeping with step execution
* traces, store the level at which the step
* trace was invoked */
char *startCmd; /* Used for bookkeeping with step execution
@@ -56,7 +56,7 @@ typedef struct {
* deleted too early. Keeps track of how many
* pieces of code have a pointer to this
* structure. */
- char command[1]; /* Space for Tcl command to invoke. Actual
+ char command[TCLFLEXARRAY]; /* Space for Tcl command to invoke. Actual
* size will be as large as necessary to hold
* command. This field must be the last in the
* structure, so that it can be larger than 1
@@ -92,14 +92,15 @@ typedef struct {
* Forward declarations for functions defined in this file:
*/
-enum traceOptions {
+/* 'OLD' options are pre-Tcl-8.4 style */
+enum traceOptionsEnum {
TRACE_ADD, TRACE_INFO, TRACE_REMOVE
#ifndef TCL_REMOVE_OBSOLETE_TRACES
,TRACE_OLD_VARIABLE, TRACE_OLD_VDELETE, TRACE_OLD_VINFO
#endif
};
-typedef int (Tcl_TraceTypeObjCmd)(Tcl_Interp *interp, enum traceOptions optionIndex,
- int objc, Tcl_Obj *const objv[]);
+typedef int (Tcl_TraceTypeObjCmd)(Tcl_Interp *interp, enum traceOptionsEnum optionIndex,
+ Tcl_Size objc, Tcl_Obj *const objv[]);
static Tcl_TraceTypeObjCmd TraceVariableObjCmd;
static Tcl_TraceTypeObjCmd TraceCommandObjCmd;
@@ -126,18 +127,18 @@ static Tcl_TraceTypeObjCmd *const traceSubCmds[] = {
*/
static int CallTraceFunction(Tcl_Interp *interp, Trace *tracePtr,
- Command *cmdPtr, const char *command, size_t numChars,
- int objc, Tcl_Obj *const objv[]);
+ Command *cmdPtr, const char *command, Tcl_Size numChars,
+ Tcl_Size objc, Tcl_Obj *const objv[]);
static char * TraceVarProc(void *clientData, Tcl_Interp *interp,
const char *name1, const char *name2, int flags);
static void TraceCommandProc(void *clientData,
Tcl_Interp *interp, const char *oldName,
const char *newName, int flags);
-static Tcl_CmdObjTraceProc TraceExecutionProc;
+static Tcl_CmdObjTraceProc2 TraceExecutionProc;
static int StringTraceProc(void *clientData,
- Tcl_Interp *interp, int level,
+ Tcl_Interp *interp, Tcl_Size level,
const char *command, Tcl_Command commandInfo,
- int objc, Tcl_Obj *const objv[]);
+ Tcl_Size objc, Tcl_Obj *const objv[]);
static void StringTraceDeleteProc(void *clientData);
static void DisposeTraceResult(int flags, char *result);
static int TraceVarEx(Tcl_Interp *interp, const char *part1,
@@ -206,8 +207,7 @@ Tcl_TraceObjCmd(
#endif
NULL
};
- /* 'OLD' options are pre-Tcl-8.4 style */
- enum traceOptions optionIndex;
+ enum traceOptionsEnum optionIndex;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
@@ -269,8 +269,7 @@ Tcl_TraceObjCmd(
case TRACE_OLD_VDELETE: {
Tcl_Obj *copyObjv[6];
Tcl_Obj *opsList;
- int code;
- size_t numFlags;
+ int code, numFlags;
if (objc != 5) {
Tcl_WrongNumArgs(interp, 2, objv, "name ops command");
@@ -398,12 +397,12 @@ Tcl_TraceObjCmd(
static int
TraceExecutionObjCmd(
Tcl_Interp *interp, /* Current interpreter. */
- enum traceOptions optionIndex, /* Add, info or remove */
- int objc, /* Number of arguments. */
+ enum traceOptionsEnum optionIndex, /* Add, info or remove */
+ Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name, *command;
- size_t commandLength, length;
+ Tcl_Size length;
static const char *const opStrings[] = {
"enter", "leave", "enterstep", "leavestep", NULL
};
@@ -416,7 +415,7 @@ TraceExecutionObjCmd(
case TRACE_ADD:
case TRACE_REMOVE: {
int flags = 0, result;
- size_t i, listLen;
+ Tcl_Size i, listLen;
Tcl_Obj **elemPtrs;
if (objc != 6) {
@@ -461,8 +460,7 @@ TraceExecutionObjCmd(
break;
}
}
- command = Tcl_GetStringFromObj(objv[5], &commandLength);
- length = commandLength;
+ command = Tcl_GetStringFromObj(objv[5], &length);
if (optionIndex == TRACE_ADD) {
TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)Tcl_Alloc(
offsetof(TraceCommandInfo, command) + 1 + length);
@@ -571,7 +569,7 @@ TraceExecutionObjCmd(
resultListPtr = Tcl_NewListObj(0, NULL);
FOREACH_COMMAND_TRACE(interp, name, clientData) {
- size_t numOps = 0;
+ Tcl_Size numOps = 0;
Tcl_Obj *opObj, *eachTraceObjPtr, *elemObjPtr;
TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)clientData;
@@ -646,12 +644,12 @@ TraceExecutionObjCmd(
static int
TraceCommandObjCmd(
Tcl_Interp *interp, /* Current interpreter. */
- enum traceOptions optionIndex, /* Add, info or remove */
- int objc, /* Number of arguments. */
+ enum traceOptionsEnum optionIndex, /* Add, info or remove */
+ Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name, *command;
- size_t commandLength, length;
+ Tcl_Size length;
static const char *const opStrings[] = { "delete", "rename", NULL };
enum operations { TRACE_CMD_DELETE, TRACE_CMD_RENAME } index;
@@ -659,7 +657,7 @@ TraceCommandObjCmd(
case TRACE_ADD:
case TRACE_REMOVE: {
int flags = 0, result;
- size_t i, listLen;
+ Tcl_Size i, listLen;
Tcl_Obj **elemPtrs;
if (objc != 6) {
@@ -700,8 +698,7 @@ TraceCommandObjCmd(
}
}
- command = Tcl_GetStringFromObj(objv[5], &commandLength);
- length = commandLength;
+ command = Tcl_GetStringFromObj(objv[5], &length);
if (optionIndex == TRACE_ADD) {
TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)Tcl_Alloc(
offsetof(TraceCommandInfo, command) + 1 + length);
@@ -776,7 +773,7 @@ TraceCommandObjCmd(
resultListPtr = Tcl_NewListObj(0, NULL);
FOREACH_COMMAND_TRACE(interp, name, clientData) {
- size_t numOps = 0;
+ Tcl_Size numOps = 0;
Tcl_Obj *opObj, *eachTraceObjPtr, *elemObjPtr;
TraceCommandInfo *tcmdPtr = (TraceCommandInfo *)clientData;
@@ -842,12 +839,12 @@ TraceCommandObjCmd(
static int
TraceVariableObjCmd(
Tcl_Interp *interp, /* Current interpreter. */
- enum traceOptions optionIndex, /* Add, info or remove */
- int objc, /* Number of arguments. */
+ enum traceOptionsEnum optionIndex, /* Add, info or remove */
+ Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
const char *name, *command;
- size_t commandLength, length;
+ Tcl_Size length;
void *clientData;
static const char *const opStrings[] = {
"array", "read", "unset", "write", NULL
@@ -860,7 +857,7 @@ TraceVariableObjCmd(
case TRACE_ADD:
case TRACE_REMOVE: {
int flags = 0, result;
- size_t i, listLen;
+ Tcl_Size i, listLen;
Tcl_Obj **elemPtrs;
if (objc != 6) {
@@ -905,8 +902,7 @@ TraceVariableObjCmd(
break;
}
}
- command = Tcl_GetStringFromObj(objv[5], &commandLength);
- length = commandLength;
+ command = Tcl_GetStringFromObj(objv[5], &length);
if (optionIndex == TRACE_ADD) {
CombinedTraceVarInfo *ctvarPtr = (CombinedTraceVarInfo *)Tcl_Alloc(
offsetof(CombinedTraceVarInfo, traceCmdInfo.command)
@@ -1039,7 +1035,7 @@ TraceVariableObjCmd(
*----------------------------------------------------------------------
*/
-ClientData
+void *
Tcl_CommandTraceInfo(
Tcl_Interp *interp, /* Interpreter containing command. */
const char *cmdName, /* Name of command. */
@@ -1423,17 +1419,17 @@ TclCheckExecutionTraces(
Tcl_Interp *interp, /* The current interpreter. */
const char *command, /* Pointer to beginning of the current command
* string. */
- TCL_UNUSED(size_t) /*numChars*/,
+ TCL_UNUSED(Tcl_Size) /*numChars*/,
Command *cmdPtr, /* Points to command's Command struct. */
int code, /* The current result code. */
int traceFlags, /* Current tracing situation. */
- size_t objc, /* Number of arguments for the command. */
+ Tcl_Size objc, /* Number of arguments for the command. */
Tcl_Obj *const objv[]) /* Pointers to Tcl_Obj of each argument. */
{
Interp *iPtr = (Interp *) interp;
CommandTrace *tracePtr, *lastTracePtr;
ActiveCommandTrace active;
- int curLevel;
+ Tcl_Size curLevel;
int traceCode = TCL_OK;
Tcl_InterpState state = NULL;
@@ -1528,18 +1524,18 @@ TclCheckInterpTraces(
Tcl_Interp *interp, /* The current interpreter. */
const char *command, /* Pointer to beginning of the current command
* string. */
- size_t numChars, /* The number of characters in 'command' which
+ Tcl_Size numChars, /* The number of characters in 'command' which
* are part of the command string. */
Command *cmdPtr, /* Points to command's Command struct. */
int code, /* The current result code. */
int traceFlags, /* Current tracing situation. */
- size_t objc, /* Number of arguments for the command. */
+ Tcl_Size objc, /* Number of arguments for the command. */
Tcl_Obj *const objv[]) /* Pointers to Tcl_Obj of each argument. */
{
Interp *iPtr = (Interp *) interp;
Trace *tracePtr, *lastTracePtr;
ActiveInterpTrace active;
- int curLevel;
+ Tcl_Size curLevel;
int traceCode = TCL_OK;
Tcl_InterpState state = NULL;
@@ -1675,9 +1671,9 @@ CallTraceFunction(
Command *cmdPtr, /* Points to command's Command struct. */
const char *command, /* Points to the first character of the
* command's source before substitutions. */
- size_t numChars, /* The number of characters in the command's
+ Tcl_Size numChars, /* The number of characters in the command's
* source. */
- int objc, /* Number of arguments for the command. */
+ Tcl_Size objc, /* Number of arguments for the command. */
Tcl_Obj *const objv[]) /* Pointers to Tcl_Obj of each argument. */
{
Interp *iPtr = (Interp *) interp;
@@ -1760,10 +1756,10 @@ static int
TraceExecutionProc(
void *clientData,
Tcl_Interp *interp,
- int level,
+ Tcl_Size level,
const char *command,
TCL_UNUSED(Tcl_Command),
- int objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[])
{
int call = 0;
@@ -1818,7 +1814,8 @@ TraceExecutionProc(
if (call) {
Tcl_DString cmd, sub;
- int i, saveInterpFlags;
+ Tcl_Size i;
+ int saveInterpFlags;
Tcl_DStringInit(&cmd);
Tcl_DStringAppend(&cmd, tcmdPtr->command, tcmdPtr->length);
@@ -1925,7 +1922,7 @@ TraceExecutionProc(
tcmdPtr->startCmd = (char *)Tcl_Alloc(len);
memcpy(tcmdPtr->startCmd, command, len);
tcmdPtr->refCount++;
- tcmdPtr->stepTrace = Tcl_CreateObjTrace(interp, 0,
+ tcmdPtr->stepTrace = Tcl_CreateObjTrace2(interp, 0,
(tcmdPtr->flags & TCL_TRACE_ANY_EXEC) >> 2,
TraceExecutionProc, tcmdPtr, CommandObjTraceDeleted);
}
@@ -2074,7 +2071,7 @@ TraceVarProc(
/*
*----------------------------------------------------------------------
*
- * Tcl_CreateObjTrace --
+ * Tcl_CreateObjTrace/Tcl_CreateObjTrace2 --
*
* Arrange for a function to be called to trace command execution.
*
@@ -2087,7 +2084,7 @@ TraceVarProc(
* called to execute a Tcl command. Calls to proc will have the following
* form:
*
- * void proc(ClientData clientData,
+ * void proc(void * clientData,
* Tcl_Interp * interp,
* int level,
* const char * command,
@@ -2127,7 +2124,7 @@ TraceVarProc(
*/
typedef struct {
- Tcl_CmdObjTraceProc2 *proc;
+ Tcl_CmdObjTraceProc *proc;
Tcl_CmdObjTraceDeleteProc *delProc;
void *clientData;
} TraceWrapperInfo;
@@ -2135,14 +2132,17 @@ typedef struct {
static int traceWrapperProc(
void *clientData,
Tcl_Interp *interp,
- int level,
+ Tcl_Size level,
const char *command,
Tcl_Command commandInfo,
- int objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[])
{
TraceWrapperInfo *info = (TraceWrapperInfo *)clientData;
- return info->proc(info->clientData, interp, level, command, commandInfo, objc, objv);
+ if (objc > INT_MAX) {
+ objc = -1; /* Signal Tcl_CmdObjTraceProc that objc is out of range */
+ }
+ return info->proc(info->clientData, interp, (int)level, command, commandInfo, objc, objv);
}
static void traceWrapperDelProc(void *clientData)
@@ -2156,11 +2156,11 @@ static void traceWrapperDelProc(void *clientData)
}
Tcl_Trace
-Tcl_CreateObjTrace2(
+Tcl_CreateObjTrace(
Tcl_Interp *interp, /* Tcl interpreter */
- int level, /* Maximum nesting level */
+ Tcl_Size level, /* Maximum nesting level */
int flags, /* Flags, see above */
- Tcl_CmdObjTraceProc2 *proc, /* Trace callback */
+ Tcl_CmdObjTraceProc *proc, /* Trace callback */
void *clientData, /* Client data for the callback */
Tcl_CmdObjTraceDeleteProc *delProc)
/* Function to call when trace is deleted */
@@ -2169,17 +2169,17 @@ Tcl_CreateObjTrace2(
info->proc = proc;
info->delProc = delProc;
info->clientData = clientData;
- return Tcl_CreateObjTrace(interp, level, flags,
+ return Tcl_CreateObjTrace2(interp, level, flags,
(proc ? traceWrapperProc : NULL),
info, traceWrapperDelProc);
}
Tcl_Trace
-Tcl_CreateObjTrace(
+Tcl_CreateObjTrace2(
Tcl_Interp *interp, /* Tcl interpreter */
- int level, /* Maximum nesting level */
+ Tcl_Size level, /* Maximum nesting level */
int flags, /* Flags, see above */
- Tcl_CmdObjTraceProc *proc, /* Trace callback */
+ Tcl_CmdObjTraceProc2 *proc, /* Trace callback */
void *clientData, /* Client data for the callback */
Tcl_CmdObjTraceDeleteProc *delProc)
/* Function to call when trace is deleted */
@@ -2266,7 +2266,7 @@ Tcl_CreateObjTrace(
Tcl_Trace
Tcl_CreateTrace(
Tcl_Interp *interp, /* Interpreter in which to create trace. */
- int level, /* Only call proc for commands at nesting
+ Tcl_Size level, /* Only call proc for commands at nesting
* level<=argument level (1=>top level). */
Tcl_CmdTraceProc *proc, /* Function to call before executing each
* command. */
@@ -2276,7 +2276,7 @@ Tcl_CreateTrace(
data->clientData = clientData;
data->proc = proc;
- return Tcl_CreateObjTrace(interp, level, 0, StringTraceProc,
+ return Tcl_CreateObjTrace2(interp, level, 0, StringTraceProc,
data, StringTraceDeleteProc);
}
@@ -2300,16 +2300,16 @@ static int
StringTraceProc(
void *clientData,
Tcl_Interp *interp,
- int level,
+ Tcl_Size level,
const char *command,
Tcl_Command commandInfo,
- int objc,
+ Tcl_Size objc,
Tcl_Obj *const *objv)
{
StringTraceData *data = (StringTraceData *)clientData;
Command *cmdPtr = (Command *) commandInfo;
const char **argv; /* Args to pass to string trace proc */
- int i;
+ Tcl_Size i;
/*
* This is a bit messy because we have to emulate the old trace interface,
@@ -3036,7 +3036,7 @@ Tcl_UntraceVar2(
*----------------------------------------------------------------------
*/
-ClientData
+void *
Tcl_VarTraceInfo2(
Tcl_Interp *interp, /* Interpreter containing variable. */
const char *part1, /* Name of variable or array. */
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index a7293ca..aa5f9e8 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -3752,7 +3752,17 @@ TclIndexEncode(
* We parsed an end+offset index value.
* wide holds the offset value in the range WIDE_MIN...WIDE_MAX.
*/
- if (wide > (unsigned)(irPtr ? TCL_INDEX_END : INT_MAX)) {
+ if ((irPtr ? ((wide < INT_MIN) && ((size_t)-wide <= LIST_MAX))
+ : ((wide > INT_MAX) && ((size_t)wide <= LIST_MAX))) && (sizeof(int) != sizeof(size_t))) {
+ if (interp) {
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "index \"%s\" out of range",
+ TclGetString(objPtr)));
+ Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX"
+ "OUTOFRANGE", NULL);
+ }
+ return TCL_ERROR;
+ } else if (wide > (unsigned)(irPtr ? TCL_INDEX_END : INT_MAX)) {
/*
* All end+postive or end-negative expressions
* always indicate "after the end".
diff --git a/library/auto.tcl b/library/auto.tcl
index 5baaf04..1b1c7fe 100644
--- a/library/auto.tcl
+++ b/library/auto.tcl
@@ -302,7 +302,7 @@ proc auto_mkindex_old {dir args} {
set f ""
set error [catch {
set f [open $file]
- fconfigure $f -encoding utf-8 -eofchar "\x1A {}"
+ fconfigure $f -encoding utf-8 -eofchar \x1A
while {[gets $f line] >= 0} {
if {[regexp {^proc[ ]+([^ ]*)} $line match procName]} {
set procName [lindex [auto_qualify $procName "::"] 0]
@@ -414,7 +414,7 @@ proc auto_mkindex_parser::mkindex {file} {
set scriptFile $file
set fid [open $file]
- fconfigure $fid -encoding utf-8 -eofchar "\x1A {}"
+ fconfigure $fid -encoding utf-8 -eofchar \x1A
set contents [read $fid]
close $fid
diff --git a/library/http/http.tcl b/library/http/http.tcl
index 88685ec..fcb03e1 100644
--- a/library/http/http.tcl
+++ b/library/http/http.tcl
@@ -26,6 +26,8 @@ namespace eval http {
-proxyhost {}
-proxyport {}
-proxyfilter http::ProxyRequired
+ -proxynot {}
+ -proxyauth {}
-repost 0
-threadlevel 0
-urlencoding utf-8
@@ -470,7 +472,9 @@ proc http::Finish {token {errormsg ""} {skipCB 0}} {
if {[info exists state(-command)] && (!$skipCB)
&& (![info exists state(done-command-cb)])} {
set state(done-command-cb) yes
- if {[catch {namespace eval :: $state(-command) $token} err] && $errormsg eq ""} {
+ if { [catch {namespace eval :: $state(-command) $token} err]
+ && ($errormsg eq "")
+ } {
set state(error) [list $err $errorInfo $errorCode]
set state(status) error
}
@@ -886,20 +890,22 @@ proc http::reset {token {why reset}} {
proc http::geturl {url args} {
variable urlTypes
- # The value is set in the namespace header of this file. If the file has
- # not been modified the value is "::http::socket".
- set socketCmd [lindex $urlTypes(http) 1]
-
# - If ::tls::socketCmd has its default value "::socket", change it to the
- # new value $socketCmd.
+ # new value ::http::socketForTls.
# - If the old value is different, then it has been modified either by the
# script or by the Tcl installation, and replaced by a new command. The
# script or installation that modified ::tls::socketCmd is also
- # responsible for integrating ::http::socket into its own "new" command,
- # if it wishes to do so.
+ # responsible for integrating ::http::socketForTls into its own "new"
+ # command, if it wishes to do so.
+ # - Commands that open a socket:
+ # - ::socket - basic
+ # - ::http::socket - can use a thread to avoid blockage by slow DNS
+ # lookup. See http::config option -threadlevel.
+ # - ::http::socketForTls - as ::http::socket, but can also open a socket
+ # for HTTPS/TLS through a proxy.
if {[info exists ::tls::socketCmd] && ($::tls::socketCmd eq {::socket})} {
- set ::tls::socketCmd $socketCmd
+ set ::tls::socketCmd ::http::socketForTls
}
set token [CreateToken $url {*}$args]
@@ -1023,6 +1029,7 @@ proc http::CreateToken {url args} {
requestHeaders {}
requestLine {}
transfer {}
+ proxyUsed none
}
set state(-keepalive) $defaultKeepalive
set state(-strict) $strict
@@ -1299,11 +1306,16 @@ proc http::CreateToken {url args} {
set state(-keepalive) 0
}
- # If we are using the proxy, we must pass in the full URL that includes
- # the server name.
- if {$phost ne ""} {
+ # Handle proxy requests here for http:// but not for https://
+ # The proxying for https is done in the ::http::socketForTls command.
+ # A proxy request for http:// needs the full URL in the HTTP request line,
+ # including the server name.
+ # The *tls* test below attempts to describe protocols in addition to
+ # "https on port 443" that use HTTP over TLS.
+ if {($phost ne "") && (![string match -nocase *tls* $defcmd])} {
set srvurl $url
set targetAddr [list $phost $pport]
+ set state(proxyUsed) HttpProxy
} else {
set targetAddr [list $host $port]
}
@@ -1316,7 +1328,7 @@ proc http::CreateToken {url args} {
}
set state(connArgs) [list $proto $phost $srvurl]
- set state(openCmd) [list {*}$defcmd {*}$sockopts {*}$targetAddr]
+ set state(openCmd) [list {*}$defcmd {*}$sockopts -type $token {*}$targetAddr]
# See if we are supposed to use a previously opened channel.
# - In principle, ANY call to http::geturl could use a previously opened
@@ -1663,12 +1675,14 @@ proc http::OpenSocket {token DoLater} {
##Log pre socket opened, - token $token
##Log $state(openCmd) - token $token
set sock [namespace eval :: $state(openCmd)]
-
+ set state(sock) $sock
# Normal return from $state(openCmd) always returns a valid socket.
+ # A TLS proxy connection with 407 or other failure from the
+ # proxy server raises an error.
+
# Initialisation of a new socket.
##Log post socket opened, - token $token
##Log socket opened, now fconfigure - token $token
- set state(sock) $sock
set delay [expr {[clock milliseconds] - $pre}]
if {$delay > 3000} {
Log socket delay $delay - token $token
@@ -1684,7 +1698,15 @@ proc http::OpenSocket {token DoLater} {
# Code above has set state(sock) $sock
ConfigureNewSocket $token $sockOld $DoLater
} result errdict]} {
- Finish $token $result
+ if {[string range $result 0 20] eq {proxy connect failed:}} {
+ # The socket can be persistent: if so it is identified with
+ # the https target host, and will be kept open.
+ # Results of the failed proxy CONNECT have been copied to $token and
+ # are available to the caller.
+ Eot $token
+ } else {
+ Finish $token $result
+ }
}
##Log Leaving http::OpenSocket coroutine [info coroutine] - token $token
return
@@ -1715,7 +1737,8 @@ proc http::OpenSocket {token DoLater} {
#
# Arguments:
# token - connection token (name of an array)
-# sockOld - handle or placeholder used for a socket before the call to OpenSocket
+# sockOld - handle or placeholder used for a socket before the call to
+# OpenSocket
# DoLater - dictionary of boolean values listing unfinished tasks
#
# Return Value: none
@@ -2083,9 +2106,15 @@ proc http::Connected {token proto phost srvurl} {
Log ^B$tk begin sending request - token $token
if {[catch {
- set state(method) $how
- set state(requestHeaders) {}
- set state(requestLine) "$how $srvurl HTTP/$state(-protocol)"
+ if {[info exists state(bypass)]} {
+ set state(method) [lindex [split $state(bypass) { }] 0]
+ set state(requestHeaders) {}
+ set state(requestLine) $state(bypass)
+ } else {
+ set state(method) $how
+ set state(requestHeaders) {}
+ set state(requestLine) "$how $srvurl HTTP/$state(-protocol)"
+ }
puts $sock $state(requestLine)
set hostValue [GetFieldValue $state(-headers) Host]
if {$hostValue ne {}} {
@@ -2119,6 +2148,11 @@ proc http::Connected {token proto phost srvurl} {
# and "state(-keepalive) 0".
set ConnVal close
}
+ # Proxy authorisation (cf. mod by Anders Ramdahl to autoproxy by
+ # Pat Thoyts).
+ if {($http(-proxyauth) ne {}) && ($state(proxyUsed) eq {HttpProxy})} {
+ SendHeader $token Proxy-Authorization $http(-proxyauth)
+ }
# RFC7230 A.1 - "clients are encouraged not to send the
# Proxy-Connection header field in any requests"
set accept_encoding_seen 0
@@ -2143,7 +2177,12 @@ proc http::Connected {token proto phost srvurl} {
set contDone 1
set state(querylength) $value
}
- if {[string equal -nocase $key "connection"]} {
+ if { [string equal -nocase $key "connection"]
+ && [info exists state(bypass)]
+ } {
+ # Value supplied in -headers overrides $ConnVal.
+ set connection_seen 1
+ } elseif {[string equal -nocase $key "connection"]} {
# Remove "close" or "keep-alive" and use our own value.
# In an upgrade request, the upgrade is not guaranteed.
# Value "close" or "keep-alive" tells the server what to do
@@ -3121,6 +3160,7 @@ proc http::responseInfo {token} {
currentPost STATE queryoffset
totalSize STATE totalsize
currentSize STATE currentsize
+ proxyUsed STATE proxyUsed
} {
if {$origin eq {STATE}} {
if {[info exists state($name)]} {
@@ -3604,6 +3644,45 @@ proc http::Event {sock token} {
set state(state) complete
Eot $token
return
+ } elseif {
+ ($state(method) eq {CONNECT})
+ && [string is integer -strict $state(responseCode)]
+ && ($state(responseCode) >= 200)
+ && ($state(responseCode) < 300)
+ } {
+ # A successful CONNECT response has no body.
+ # (An unsuccessful CONNECT has headers and body.)
+ # The code below is abstracted from Eot/Finish, but
+ # keeps the socket open.
+ catch {fileevent $state(sock) readable {}}
+ catch {fileevent $state(sock) writable {}}
+ set state(state) complete
+ set state(status) ok
+ if {[info commands ${token}--EventCoroutine] ne {}} {
+ rename ${token}--EventCoroutine {}
+ }
+ if {[info commands ${token}--SocketCoroutine] ne {}} {
+ rename ${token}--SocketCoroutine {}
+ }
+ if {[info exists state(socketcoro)]} {
+ Log $token Cancel socket after-idle event (Finish)
+ after cancel $state(socketcoro)
+ unset state(socketcoro)
+ }
+ if {[info exists state(after)]} {
+ after cancel $state(after)
+ unset state(after)
+ }
+ if { [info exists state(-command)]
+ && (![info exists state(done-command-cb)])
+ } {
+ set state(done-command-cb) yes
+ if {[catch {namespace eval :: $state(-command) $token} err]} {
+ set state(error) [list $err $errorInfo $errorCode]
+ set state(status) error
+ }
+ }
+ return
} else {
}
@@ -4305,7 +4384,7 @@ proc http::CopyDone {token count {error {}}} {
# reason - "eof" means premature EOF (not EOF as the natural end of
# the response)
# - "" means completion of response, with or without EOF
-# - anything else describes an error confition other than
+# - anything else describes an error condition other than
# premature EOF.
#
# Side Effects
@@ -4537,17 +4616,23 @@ proc http::quoteString {string} {
proc http::ProxyRequired {host} {
variable http
- if {[info exists http(-proxyhost)] && [string length $http(-proxyhost)]} {
- if {
- ![info exists http(-proxyport)] ||
- ![string length $http(-proxyport)]
- } {
- set http(-proxyport) 8080
- }
- return [list $http(-proxyhost) $http(-proxyport)]
+ if {(![info exists http(-proxyhost)]) || ($http(-proxyhost) eq {})} {
+ return
+ }
+ if {![info exists http(-proxyport)] || ($http(-proxyport) eq {})} {
+ set port 8080
} else {
- return
+ set port $http(-proxyport)
+ }
+
+ # Simple test (cf. autoproxy) for hosts that must be accessed directly,
+ # not through the proxy server.
+ foreach domain $http(-proxynot) {
+ if {[string match -nocase $domain $host]} {
+ return {}
+ }
}
+ return [list $http(-proxyhost) $port]
}
# http::CharsetToEncoding --
@@ -4730,6 +4815,190 @@ interp alias {} http::meta {} http::responseHeaders
interp alias {} http::metaValue {} http::responseHeaderValue
interp alias {} http::ncode {} http::responseCode
+
+# ------------------------------------------------------------------------------
+# Proc http::socketForTls
+# ------------------------------------------------------------------------------
+# Command to use in place of ::socket as the value of ::tls::socketCmd.
+# This command does the same as http::socket, and also handles https connections
+# through a proxy server.
+#
+# Notes.
+# - The proxy server works differently for https and http. This implementation
+# is for https. The proxy for http is implemented in http::CreateToken (in
+# code that was previously part of http::geturl).
+# - This code implicitly uses the tls options set for https in a call to
+# http::register, and does not need to call commands tls::*. This simple
+# implementation is possible because tls uses a callback to ::socket that can
+# be redirected by changing the value of ::tls::socketCmd.
+#
+# Arguments:
+# args - as for ::socket
+#
+# Return Value: a socket identifier
+# ------------------------------------------------------------------------------
+
+proc http::socketForTls {args} {
+ variable http
+ set host [lindex $args end-1]
+ set port [lindex $args end]
+ if { ($http(-proxyfilter) ne {})
+ && (![catch {$http(-proxyfilter) $host} proxy])
+ } {
+ set phost [lindex $proxy 0]
+ set pport [lindex $proxy 1]
+ } else {
+ set phost {}
+ set pport {}
+ }
+ if {$phost eq ""} {
+ set sock [::http::socket {*}$args]
+ } else {
+ set sock [::http::SecureProxyConnect {*}$args $phost $pport]
+ }
+ return $sock
+}
+
+
+# ------------------------------------------------------------------------------
+# Proc http::SecureProxyConnect
+# ------------------------------------------------------------------------------
+# Command to open a socket through a proxy server to a remote server for use by
+# tls. The caller must perform the tls handshake.
+#
+# Notes
+# - Based on patch supplied by Melissa Chawla in ticket 1173760, and
+# Proxy-Authorization header cf. autoproxy by Pat Thoyts.
+# - Rewritten as a call to http::geturl, because response headers and body are
+# needed if the CONNECT request fails. CONNECT is implemented for this case
+# only, by state(bypass).
+# - FUTURE WORK: give http::geturl a -connect option for a general CONNECT.
+# - The request header Proxy-Connection is discouraged in RFC 7230 (June 2014),
+# RFC 9112 (June 2022).
+#
+# Arguments:
+# args - as for ::socket, ending in host, port; with proxy host, proxy
+# port appended.
+#
+# Return Value: a socket identifier
+# ------------------------------------------------------------------------------
+proc http::AllDone {varName args} {
+ set $varName done
+ return
+}
+
+proc http::SecureProxyConnect {args} {
+ variable http
+ variable ConnectVar
+ variable ConnectCounter
+ set varName ::http::ConnectVar([incr ConnectCounter])
+
+ # Extract (non-proxy) target from args.
+ set host [lindex $args end-3]
+ set port [lindex $args end-2]
+ set args [lremove $args end-3 end-2]
+
+ # Proxy server URL for connection.
+ # This determines where the socket is opened.
+ set phost [lindex $args end-1]
+ set pport [lindex $args end]
+ if {[string first : $phost] != -1} {
+ # IPv6 address, wrap it in [] so we can append :pport
+ set phost "\[${phost}\]"
+ }
+ set url http://${phost}:${pport}
+ # Elements of args other than host and port are not used when
+ # AsyncTransaction opens a socket. Those elements are -async and the
+ # -type $tokenName for the https transaction. Option -async is used by
+ # AsyncTransaction anyway, and -type $tokenName should not be propagated:
+ # the proxy request adds its own -type value.
+
+ set targ [lsearch -exact $args -type]
+ if {$targ != -1} {
+ # Record in the token that this is a proxy call.
+ set token [lindex $args $targ+1]
+ upvar 0 ${token} state
+ set state(proxyUsed) SecureProxy
+ set tim $state(-timeout)
+ } else {
+ set tim 0
+ }
+ if {$tim == 0} {
+ # Do not use infinite timeout for the proxy.
+ set tim 30000
+ }
+
+ # Prepare and send a CONNECT request to the proxy, using
+ # code similar to http::geturl.
+ set requestHeaders [list Host $host]
+ lappend requestHeaders Connection keep-alive
+ if {$http(-proxyauth) != {}} {
+ lappend requestHeaders Proxy-Authorization $http(-proxyauth)
+ }
+
+ set token2 [CreateToken $url -keepalive 0 -timeout $tim \
+ -headers $requestHeaders -command [list http::AllDone $varName]]
+ variable $token2
+ upvar 0 $token2 state2
+
+ # Setting this variable overrides the HTTP request line and allows
+ # -headers to override the Connection: header set by -keepalive.
+ set state2(bypass) "CONNECT $host:$port HTTP/1.1"
+
+ AsyncTransaction $token2
+
+ if {[info coroutine] ne {}} {
+ # All callers in the http package are coroutines launched by
+ # the event loop.
+ # The cwait command requires a coroutine because it yields
+ # to the caller; $varName is traced and the coroutine resumes
+ # when the variable is written.
+ cwait $varName
+ } else {
+ return -code error {code must run in a coroutine}
+ # For testing with a non-coroutine caller outside the http package.
+ # vwait $varName
+ }
+ unset $varName
+
+ set sock $state2(sock)
+ set code $state2(responseCode)
+ if {[string is integer -strict $code] && ($code >= 200) && ($code < 300)} {
+ # All OK. The caller in tls will now call "tls::import $sock".
+ # Do not use Finish, which will close (sock).
+ # Other tidying done in http::Event.
+ array unset state2
+ } elseif {$targ != -1} {
+ # Bad HTTP status code; token is known.
+ # Copy from state2 to state, including (sock).
+ foreach name [array names state2] {
+ set state($name) $state2($name)
+ }
+ set state(proxyUsed) SecureProxy
+ set state(proxyFail) failed
+
+ # Do not use Finish, which will close (sock).
+ # Other tidying done in http::Event.
+ array unset state2
+
+ # Error message detected by http::OpenSocket.
+ return -code error "proxy connect failed: $code"
+ } else {
+ # Bad HTTP status code; token is not known because option -type
+ # (cf. targ) was not passed through tcltls, and so the script
+ # cannot write to state(*).
+ # Do not use Finish, which will close (sock).
+ # Other tidying done in http::Event.
+ array unset state2
+
+ # Error message detected by http::OpenSocket.
+ return -code error "proxy connect failed: $code\n$block"
+ }
+
+ return $sock
+}
+
+
# ------------------------------------------------------------------------------
# Proc http::socket
# ------------------------------------------------------------------------------
@@ -4767,7 +5036,7 @@ proc http::socket {args} {
LoadThreadIfNeeded
- set targ [lsearch -exact $args -token]
+ set targ [lsearch -exact $args -type]
if {$targ != -1} {
set token [lindex $args $targ+1]
set args [lreplace $args $targ $targ+1]
@@ -4831,7 +5100,7 @@ proc http::socket {args} {
}
# The commands below are dependencies of http::socket and
-# are not used elsewhere.
+# http::SecureProxyConnect and are not used elsewhere.
# ------------------------------------------------------------------------------
# Proc http::LoadThreadIfNeeded
diff --git a/library/init.tcl b/library/init.tcl
index 2962dbd..2646aa7 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -450,7 +450,7 @@ proc auto_load_index {} {
continue
} else {
set error [catch {
- fconfigure $f -encoding utf-8 -eofchar "\x1A {}"
+ fconfigure $f -encoding utf-8 -eofchar \x1A
set id [gets $f]
if {$id eq "# Tcl autoload index file, version 2.0"} {
eval [read $f]
diff --git a/library/install.tcl b/library/install.tcl
index ce8e80b..4abdead 100644
--- a/library/install.tcl
+++ b/library/install.tcl
@@ -35,7 +35,7 @@ proc ::practcl::_pkgindex_directory {path} {
# Read the file, and override assumptions as needed
###
set fin [open $file r]
- fconfigure $fin -encoding utf-8 -eofchar "\032 {}"
+ fconfigure $fin -encoding utf-8 -eofchar \x1A
set dat [read $fin]
close $fin
# Look for a teapot style Package statement
@@ -59,7 +59,7 @@ proc ::practcl::_pkgindex_directory {path} {
foreach file [glob -nocomplain $path/*.tcl] {
if { [file tail $file] == "version_info.tcl" } continue
set fin [open $file r]
- fconfigure $fin -encoding utf-8 -eofchar "\032 {}"
+ fconfigure $fin -encoding utf-8 -eofchar \x1A
set dat [read $fin]
close $fin
if {![regexp "package provide" $dat]} continue
@@ -79,7 +79,7 @@ proc ::practcl::_pkgindex_directory {path} {
return $buffer
}
set fin [open $pkgidxfile r]
- fconfigure $fin -encoding utf-8 -eofchar "\032 {}"
+ fconfigure $fin -encoding utf-8 -eofchar \x1A
set dat [read $fin]
close $fin
set trace 0
diff --git a/library/manifest.txt b/library/manifest.txt
index b425920..6d999e8 100644
--- a/library/manifest.txt
+++ b/library/manifest.txt
@@ -10,7 +10,7 @@ apply {{dir} {
1 opt 0.4.8 {opt optparse.tcl}
0 cookiejar 0.2.0 {cookiejar cookiejar.tcl}
0 tcl::idna 1.0.1 {cookiejar idna.tcl}
- 0 platform 1.0.18 {platform platform.tcl}
+ 0 platform 1.0.19 {platform platform.tcl}
0 platform::shell 1.1.4 {platform shell.tcl}
1 tcltest 2.5.5 {tcltest tcltest.tcl}
} {
diff --git a/library/platform/pkgIndex.tcl b/library/platform/pkgIndex.tcl
index de28fd1..e7029d0 100644
--- a/library/platform/pkgIndex.tcl
+++ b/library/platform/pkgIndex.tcl
@@ -1,3 +1,3 @@
-package ifneeded platform 1.0.18 [list source [file join $dir platform.tcl]]
+package ifneeded platform 1.0.19 [list source [file join $dir platform.tcl]]
package ifneeded platform::shell 1.1.4 [list source [file join $dir shell.tcl]]
diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl
index 752f069..acaebf2 100644
--- a/library/platform/platform.tcl
+++ b/library/platform/platform.tcl
@@ -364,6 +364,17 @@ proc ::platform::patterns {id} {
foreach {major minor} [split $v .] break
set res {}
+ if {$major eq 13} {
+ # Add 13.0 to 13.minor to patterns.
+ for {set j $minor} {$j >= 0} {incr j -1} {
+ lappend res macosx${major}.${j}-${cpu}
+ foreach a $alt {
+ lappend res macosx${major}.${j}-$a
+ }
+ }
+ set major 12
+ set minor 5
+ }
if {$major eq 12} {
# Add 12.0 to 12.minor to patterns.
for {set j $minor} {$j >= 0} {incr j -1} {
@@ -420,7 +431,7 @@ proc ::platform::patterns {id} {
# ### ### ### ######### ######### #########
## Ready
-package provide platform 1.0.18
+package provide platform 1.0.19
# ### ### ### ######### ######### #########
## Demo application
diff --git a/library/safe.tcl b/library/safe.tcl
index ab97b8f..fd7bd73 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -1076,7 +1076,7 @@ proc ::safe::AliasSource {child args} {
set replacementMsg "script error"
set code [catch {
set f [open $realfile]
- fconfigure $f -encoding $encoding -eofchar "\x1A {}"
+ fconfigure $f -encoding $encoding -eofchar \x1A
set contents [read $f]
close $f
::interp eval $child [list info script $file]
diff --git a/library/tzdata/America/Bahia_Banderas b/library/tzdata/America/Bahia_Banderas
index f06141e..cdcc4b3 100644
--- a/library/tzdata/America/Bahia_Banderas
+++ b/library/tzdata/America/Bahia_Banderas
@@ -65,158 +65,4 @@ set TZData(:America/Bahia_Banderas) {
{1635663600 -21600 0 CST}
{1648972800 -18000 1 CDT}
{1667113200 -21600 0 CST}
- {1680422400 -18000 1 CDT}
- {1698562800 -21600 0 CST}
- {1712476800 -18000 1 CDT}
- {1730012400 -21600 0 CST}
- {1743926400 -18000 1 CDT}
- {1761462000 -21600 0 CST}
- {1775376000 -18000 1 CDT}
- {1792911600 -21600 0 CST}
- {1806825600 -18000 1 CDT}
- {1824966000 -21600 0 CST}
- {1838275200 -18000 1 CDT}
- {1856415600 -21600 0 CST}
- {1869724800 -18000 1 CDT}
- {1887865200 -21600 0 CST}
- {1901779200 -18000 1 CDT}
- {1919314800 -21600 0 CST}
- {1933228800 -18000 1 CDT}
- {1950764400 -21600 0 CST}
- {1964678400 -18000 1 CDT}
- {1982818800 -21600 0 CST}
- {1996128000 -18000 1 CDT}
- {2014268400 -21600 0 CST}
- {2027577600 -18000 1 CDT}
- {2045718000 -21600 0 CST}
- {2059027200 -18000 1 CDT}
- {2077167600 -21600 0 CST}
- {2091081600 -18000 1 CDT}
- {2108617200 -21600 0 CST}
- {2122531200 -18000 1 CDT}
- {2140066800 -21600 0 CST}
- {2153980800 -18000 1 CDT}
- {2172121200 -21600 0 CST}
- {2185430400 -18000 1 CDT}
- {2203570800 -21600 0 CST}
- {2216880000 -18000 1 CDT}
- {2235020400 -21600 0 CST}
- {2248934400 -18000 1 CDT}
- {2266470000 -21600 0 CST}
- {2280384000 -18000 1 CDT}
- {2297919600 -21600 0 CST}
- {2311833600 -18000 1 CDT}
- {2329369200 -21600 0 CST}
- {2343283200 -18000 1 CDT}
- {2361423600 -21600 0 CST}
- {2374732800 -18000 1 CDT}
- {2392873200 -21600 0 CST}
- {2406182400 -18000 1 CDT}
- {2424322800 -21600 0 CST}
- {2438236800 -18000 1 CDT}
- {2455772400 -21600 0 CST}
- {2469686400 -18000 1 CDT}
- {2487222000 -21600 0 CST}
- {2501136000 -18000 1 CDT}
- {2519276400 -21600 0 CST}
- {2532585600 -18000 1 CDT}
- {2550726000 -21600 0 CST}
- {2564035200 -18000 1 CDT}
- {2582175600 -21600 0 CST}
- {2596089600 -18000 1 CDT}
- {2613625200 -21600 0 CST}
- {2627539200 -18000 1 CDT}
- {2645074800 -21600 0 CST}
- {2658988800 -18000 1 CDT}
- {2676524400 -21600 0 CST}
- {2690438400 -18000 1 CDT}
- {2708578800 -21600 0 CST}
- {2721888000 -18000 1 CDT}
- {2740028400 -21600 0 CST}
- {2753337600 -18000 1 CDT}
- {2771478000 -21600 0 CST}
- {2785392000 -18000 1 CDT}
- {2802927600 -21600 0 CST}
- {2816841600 -18000 1 CDT}
- {2834377200 -21600 0 CST}
- {2848291200 -18000 1 CDT}
- {2866431600 -21600 0 CST}
- {2879740800 -18000 1 CDT}
- {2897881200 -21600 0 CST}
- {2911190400 -18000 1 CDT}
- {2929330800 -21600 0 CST}
- {2942640000 -18000 1 CDT}
- {2960780400 -21600 0 CST}
- {2974694400 -18000 1 CDT}
- {2992230000 -21600 0 CST}
- {3006144000 -18000 1 CDT}
- {3023679600 -21600 0 CST}
- {3037593600 -18000 1 CDT}
- {3055734000 -21600 0 CST}
- {3069043200 -18000 1 CDT}
- {3087183600 -21600 0 CST}
- {3100492800 -18000 1 CDT}
- {3118633200 -21600 0 CST}
- {3132547200 -18000 1 CDT}
- {3150082800 -21600 0 CST}
- {3163996800 -18000 1 CDT}
- {3181532400 -21600 0 CST}
- {3195446400 -18000 1 CDT}
- {3212982000 -21600 0 CST}
- {3226896000 -18000 1 CDT}
- {3245036400 -21600 0 CST}
- {3258345600 -18000 1 CDT}
- {3276486000 -21600 0 CST}
- {3289795200 -18000 1 CDT}
- {3307935600 -21600 0 CST}
- {3321849600 -18000 1 CDT}
- {3339385200 -21600 0 CST}
- {3353299200 -18000 1 CDT}
- {3370834800 -21600 0 CST}
- {3384748800 -18000 1 CDT}
- {3402889200 -21600 0 CST}
- {3416198400 -18000 1 CDT}
- {3434338800 -21600 0 CST}
- {3447648000 -18000 1 CDT}
- {3465788400 -21600 0 CST}
- {3479702400 -18000 1 CDT}
- {3497238000 -21600 0 CST}
- {3511152000 -18000 1 CDT}
- {3528687600 -21600 0 CST}
- {3542601600 -18000 1 CDT}
- {3560137200 -21600 0 CST}
- {3574051200 -18000 1 CDT}
- {3592191600 -21600 0 CST}
- {3605500800 -18000 1 CDT}
- {3623641200 -21600 0 CST}
- {3636950400 -18000 1 CDT}
- {3655090800 -21600 0 CST}
- {3669004800 -18000 1 CDT}
- {3686540400 -21600 0 CST}
- {3700454400 -18000 1 CDT}
- {3717990000 -21600 0 CST}
- {3731904000 -18000 1 CDT}
- {3750044400 -21600 0 CST}
- {3763353600 -18000 1 CDT}
- {3781494000 -21600 0 CST}
- {3794803200 -18000 1 CDT}
- {3812943600 -21600 0 CST}
- {3826252800 -18000 1 CDT}
- {3844393200 -21600 0 CST}
- {3858307200 -18000 1 CDT}
- {3875842800 -21600 0 CST}
- {3889756800 -18000 1 CDT}
- {3907292400 -21600 0 CST}
- {3921206400 -18000 1 CDT}
- {3939346800 -21600 0 CST}
- {3952656000 -18000 1 CDT}
- {3970796400 -21600 0 CST}
- {3984105600 -18000 1 CDT}
- {4002246000 -21600 0 CST}
- {4016160000 -18000 1 CDT}
- {4033695600 -21600 0 CST}
- {4047609600 -18000 1 CDT}
- {4065145200 -21600 0 CST}
- {4079059200 -18000 1 CDT}
- {4096594800 -21600 0 CST}
}
diff --git a/library/tzdata/America/Chihuahua b/library/tzdata/America/Chihuahua
index fc38542..50cb9de 100644
--- a/library/tzdata/America/Chihuahua
+++ b/library/tzdata/America/Chihuahua
@@ -63,159 +63,5 @@ set TZData(:America/Chihuahua) {
{1617526800 -21600 1 MDT}
{1635667200 -25200 0 MST}
{1648976400 -21600 1 MDT}
- {1667116800 -25200 0 MST}
- {1680426000 -21600 1 MDT}
- {1698566400 -25200 0 MST}
- {1712480400 -21600 1 MDT}
- {1730016000 -25200 0 MST}
- {1743930000 -21600 1 MDT}
- {1761465600 -25200 0 MST}
- {1775379600 -21600 1 MDT}
- {1792915200 -25200 0 MST}
- {1806829200 -21600 1 MDT}
- {1824969600 -25200 0 MST}
- {1838278800 -21600 1 MDT}
- {1856419200 -25200 0 MST}
- {1869728400 -21600 1 MDT}
- {1887868800 -25200 0 MST}
- {1901782800 -21600 1 MDT}
- {1919318400 -25200 0 MST}
- {1933232400 -21600 1 MDT}
- {1950768000 -25200 0 MST}
- {1964682000 -21600 1 MDT}
- {1982822400 -25200 0 MST}
- {1996131600 -21600 1 MDT}
- {2014272000 -25200 0 MST}
- {2027581200 -21600 1 MDT}
- {2045721600 -25200 0 MST}
- {2059030800 -21600 1 MDT}
- {2077171200 -25200 0 MST}
- {2091085200 -21600 1 MDT}
- {2108620800 -25200 0 MST}
- {2122534800 -21600 1 MDT}
- {2140070400 -25200 0 MST}
- {2153984400 -21600 1 MDT}
- {2172124800 -25200 0 MST}
- {2185434000 -21600 1 MDT}
- {2203574400 -25200 0 MST}
- {2216883600 -21600 1 MDT}
- {2235024000 -25200 0 MST}
- {2248938000 -21600 1 MDT}
- {2266473600 -25200 0 MST}
- {2280387600 -21600 1 MDT}
- {2297923200 -25200 0 MST}
- {2311837200 -21600 1 MDT}
- {2329372800 -25200 0 MST}
- {2343286800 -21600 1 MDT}
- {2361427200 -25200 0 MST}
- {2374736400 -21600 1 MDT}
- {2392876800 -25200 0 MST}
- {2406186000 -21600 1 MDT}
- {2424326400 -25200 0 MST}
- {2438240400 -21600 1 MDT}
- {2455776000 -25200 0 MST}
- {2469690000 -21600 1 MDT}
- {2487225600 -25200 0 MST}
- {2501139600 -21600 1 MDT}
- {2519280000 -25200 0 MST}
- {2532589200 -21600 1 MDT}
- {2550729600 -25200 0 MST}
- {2564038800 -21600 1 MDT}
- {2582179200 -25200 0 MST}
- {2596093200 -21600 1 MDT}
- {2613628800 -25200 0 MST}
- {2627542800 -21600 1 MDT}
- {2645078400 -25200 0 MST}
- {2658992400 -21600 1 MDT}
- {2676528000 -25200 0 MST}
- {2690442000 -21600 1 MDT}
- {2708582400 -25200 0 MST}
- {2721891600 -21600 1 MDT}
- {2740032000 -25200 0 MST}
- {2753341200 -21600 1 MDT}
- {2771481600 -25200 0 MST}
- {2785395600 -21600 1 MDT}
- {2802931200 -25200 0 MST}
- {2816845200 -21600 1 MDT}
- {2834380800 -25200 0 MST}
- {2848294800 -21600 1 MDT}
- {2866435200 -25200 0 MST}
- {2879744400 -21600 1 MDT}
- {2897884800 -25200 0 MST}
- {2911194000 -21600 1 MDT}
- {2929334400 -25200 0 MST}
- {2942643600 -21600 1 MDT}
- {2960784000 -25200 0 MST}
- {2974698000 -21600 1 MDT}
- {2992233600 -25200 0 MST}
- {3006147600 -21600 1 MDT}
- {3023683200 -25200 0 MST}
- {3037597200 -21600 1 MDT}
- {3055737600 -25200 0 MST}
- {3069046800 -21600 1 MDT}
- {3087187200 -25200 0 MST}
- {3100496400 -21600 1 MDT}
- {3118636800 -25200 0 MST}
- {3132550800 -21600 1 MDT}
- {3150086400 -25200 0 MST}
- {3164000400 -21600 1 MDT}
- {3181536000 -25200 0 MST}
- {3195450000 -21600 1 MDT}
- {3212985600 -25200 0 MST}
- {3226899600 -21600 1 MDT}
- {3245040000 -25200 0 MST}
- {3258349200 -21600 1 MDT}
- {3276489600 -25200 0 MST}
- {3289798800 -21600 1 MDT}
- {3307939200 -25200 0 MST}
- {3321853200 -21600 1 MDT}
- {3339388800 -25200 0 MST}
- {3353302800 -21600 1 MDT}
- {3370838400 -25200 0 MST}
- {3384752400 -21600 1 MDT}
- {3402892800 -25200 0 MST}
- {3416202000 -21600 1 MDT}
- {3434342400 -25200 0 MST}
- {3447651600 -21600 1 MDT}
- {3465792000 -25200 0 MST}
- {3479706000 -21600 1 MDT}
- {3497241600 -25200 0 MST}
- {3511155600 -21600 1 MDT}
- {3528691200 -25200 0 MST}
- {3542605200 -21600 1 MDT}
- {3560140800 -25200 0 MST}
- {3574054800 -21600 1 MDT}
- {3592195200 -25200 0 MST}
- {3605504400 -21600 1 MDT}
- {3623644800 -25200 0 MST}
- {3636954000 -21600 1 MDT}
- {3655094400 -25200 0 MST}
- {3669008400 -21600 1 MDT}
- {3686544000 -25200 0 MST}
- {3700458000 -21600 1 MDT}
- {3717993600 -25200 0 MST}
- {3731907600 -21600 1 MDT}
- {3750048000 -25200 0 MST}
- {3763357200 -21600 1 MDT}
- {3781497600 -25200 0 MST}
- {3794806800 -21600 1 MDT}
- {3812947200 -25200 0 MST}
- {3826256400 -21600 1 MDT}
- {3844396800 -25200 0 MST}
- {3858310800 -21600 1 MDT}
- {3875846400 -25200 0 MST}
- {3889760400 -21600 1 MDT}
- {3907296000 -25200 0 MST}
- {3921210000 -21600 1 MDT}
- {3939350400 -25200 0 MST}
- {3952659600 -21600 1 MDT}
- {3970800000 -25200 0 MST}
- {3984109200 -21600 1 MDT}
- {4002249600 -25200 0 MST}
- {4016163600 -21600 1 MDT}
- {4033699200 -25200 0 MST}
- {4047613200 -21600 1 MDT}
- {4065148800 -25200 0 MST}
- {4079062800 -21600 1 MDT}
- {4096598400 -25200 0 MST}
+ {1667120400 -21600 0 CST}
}
diff --git a/library/tzdata/America/Mazatlan b/library/tzdata/America/Mazatlan
index 5547d3f..d9da09f 100644
--- a/library/tzdata/America/Mazatlan
+++ b/library/tzdata/America/Mazatlan
@@ -65,158 +65,4 @@ set TZData(:America/Mazatlan) {
{1635667200 -25200 0 MST}
{1648976400 -21600 1 MDT}
{1667116800 -25200 0 MST}
- {1680426000 -21600 1 MDT}
- {1698566400 -25200 0 MST}
- {1712480400 -21600 1 MDT}
- {1730016000 -25200 0 MST}
- {1743930000 -21600 1 MDT}
- {1761465600 -25200 0 MST}
- {1775379600 -21600 1 MDT}
- {1792915200 -25200 0 MST}
- {1806829200 -21600 1 MDT}
- {1824969600 -25200 0 MST}
- {1838278800 -21600 1 MDT}
- {1856419200 -25200 0 MST}
- {1869728400 -21600 1 MDT}
- {1887868800 -25200 0 MST}
- {1901782800 -21600 1 MDT}
- {1919318400 -25200 0 MST}
- {1933232400 -21600 1 MDT}
- {1950768000 -25200 0 MST}
- {1964682000 -21600 1 MDT}
- {1982822400 -25200 0 MST}
- {1996131600 -21600 1 MDT}
- {2014272000 -25200 0 MST}
- {2027581200 -21600 1 MDT}
- {2045721600 -25200 0 MST}
- {2059030800 -21600 1 MDT}
- {2077171200 -25200 0 MST}
- {2091085200 -21600 1 MDT}
- {2108620800 -25200 0 MST}
- {2122534800 -21600 1 MDT}
- {2140070400 -25200 0 MST}
- {2153984400 -21600 1 MDT}
- {2172124800 -25200 0 MST}
- {2185434000 -21600 1 MDT}
- {2203574400 -25200 0 MST}
- {2216883600 -21600 1 MDT}
- {2235024000 -25200 0 MST}
- {2248938000 -21600 1 MDT}
- {2266473600 -25200 0 MST}
- {2280387600 -21600 1 MDT}
- {2297923200 -25200 0 MST}
- {2311837200 -21600 1 MDT}
- {2329372800 -25200 0 MST}
- {2343286800 -21600 1 MDT}
- {2361427200 -25200 0 MST}
- {2374736400 -21600 1 MDT}
- {2392876800 -25200 0 MST}
- {2406186000 -21600 1 MDT}
- {2424326400 -25200 0 MST}
- {2438240400 -21600 1 MDT}
- {2455776000 -25200 0 MST}
- {2469690000 -21600 1 MDT}
- {2487225600 -25200 0 MST}
- {2501139600 -21600 1 MDT}
- {2519280000 -25200 0 MST}
- {2532589200 -21600 1 MDT}
- {2550729600 -25200 0 MST}
- {2564038800 -21600 1 MDT}
- {2582179200 -25200 0 MST}
- {2596093200 -21600 1 MDT}
- {2613628800 -25200 0 MST}
- {2627542800 -21600 1 MDT}
- {2645078400 -25200 0 MST}
- {2658992400 -21600 1 MDT}
- {2676528000 -25200 0 MST}
- {2690442000 -21600 1 MDT}
- {2708582400 -25200 0 MST}
- {2721891600 -21600 1 MDT}
- {2740032000 -25200 0 MST}
- {2753341200 -21600 1 MDT}
- {2771481600 -25200 0 MST}
- {2785395600 -21600 1 MDT}
- {2802931200 -25200 0 MST}
- {2816845200 -21600 1 MDT}
- {2834380800 -25200 0 MST}
- {2848294800 -21600 1 MDT}
- {2866435200 -25200 0 MST}
- {2879744400 -21600 1 MDT}
- {2897884800 -25200 0 MST}
- {2911194000 -21600 1 MDT}
- {2929334400 -25200 0 MST}
- {2942643600 -21600 1 MDT}
- {2960784000 -25200 0 MST}
- {2974698000 -21600 1 MDT}
- {2992233600 -25200 0 MST}
- {3006147600 -21600 1 MDT}
- {3023683200 -25200 0 MST}
- {3037597200 -21600 1 MDT}
- {3055737600 -25200 0 MST}
- {3069046800 -21600 1 MDT}
- {3087187200 -25200 0 MST}
- {3100496400 -21600 1 MDT}
- {3118636800 -25200 0 MST}
- {3132550800 -21600 1 MDT}
- {3150086400 -25200 0 MST}
- {3164000400 -21600 1 MDT}
- {3181536000 -25200 0 MST}
- {3195450000 -21600 1 MDT}
- {3212985600 -25200 0 MST}
- {3226899600 -21600 1 MDT}
- {3245040000 -25200 0 MST}
- {3258349200 -21600 1 MDT}
- {3276489600 -25200 0 MST}
- {3289798800 -21600 1 MDT}
- {3307939200 -25200 0 MST}
- {3321853200 -21600 1 MDT}
- {3339388800 -25200 0 MST}
- {3353302800 -21600 1 MDT}
- {3370838400 -25200 0 MST}
- {3384752400 -21600 1 MDT}
- {3402892800 -25200 0 MST}
- {3416202000 -21600 1 MDT}
- {3434342400 -25200 0 MST}
- {3447651600 -21600 1 MDT}
- {3465792000 -25200 0 MST}
- {3479706000 -21600 1 MDT}
- {3497241600 -25200 0 MST}
- {3511155600 -21600 1 MDT}
- {3528691200 -25200 0 MST}
- {3542605200 -21600 1 MDT}
- {3560140800 -25200 0 MST}
- {3574054800 -21600 1 MDT}
- {3592195200 -25200 0 MST}
- {3605504400 -21600 1 MDT}
- {3623644800 -25200 0 MST}
- {3636954000 -21600 1 MDT}
- {3655094400 -25200 0 MST}
- {3669008400 -21600 1 MDT}
- {3686544000 -25200 0 MST}
- {3700458000 -21600 1 MDT}
- {3717993600 -25200 0 MST}
- {3731907600 -21600 1 MDT}
- {3750048000 -25200 0 MST}
- {3763357200 -21600 1 MDT}
- {3781497600 -25200 0 MST}
- {3794806800 -21600 1 MDT}
- {3812947200 -25200 0 MST}
- {3826256400 -21600 1 MDT}
- {3844396800 -25200 0 MST}
- {3858310800 -21600 1 MDT}
- {3875846400 -25200 0 MST}
- {3889760400 -21600 1 MDT}
- {3907296000 -25200 0 MST}
- {3921210000 -21600 1 MDT}
- {3939350400 -25200 0 MST}
- {3952659600 -21600 1 MDT}
- {3970800000 -25200 0 MST}
- {3984109200 -21600 1 MDT}
- {4002249600 -25200 0 MST}
- {4016163600 -21600 1 MDT}
- {4033699200 -25200 0 MST}
- {4047613200 -21600 1 MDT}
- {4065148800 -25200 0 MST}
- {4079062800 -21600 1 MDT}
- {4096598400 -25200 0 MST}
}
diff --git a/library/tzdata/America/Merida b/library/tzdata/America/Merida
index ebf5927..d17431d 100644
--- a/library/tzdata/America/Merida
+++ b/library/tzdata/America/Merida
@@ -59,158 +59,4 @@ set TZData(:America/Merida) {
{1635663600 -21600 0 CST}
{1648972800 -18000 1 CDT}
{1667113200 -21600 0 CST}
- {1680422400 -18000 1 CDT}
- {1698562800 -21600 0 CST}
- {1712476800 -18000 1 CDT}
- {1730012400 -21600 0 CST}
- {1743926400 -18000 1 CDT}
- {1761462000 -21600 0 CST}
- {1775376000 -18000 1 CDT}
- {1792911600 -21600 0 CST}
- {1806825600 -18000 1 CDT}
- {1824966000 -21600 0 CST}
- {1838275200 -18000 1 CDT}
- {1856415600 -21600 0 CST}
- {1869724800 -18000 1 CDT}
- {1887865200 -21600 0 CST}
- {1901779200 -18000 1 CDT}
- {1919314800 -21600 0 CST}
- {1933228800 -18000 1 CDT}
- {1950764400 -21600 0 CST}
- {1964678400 -18000 1 CDT}
- {1982818800 -21600 0 CST}
- {1996128000 -18000 1 CDT}
- {2014268400 -21600 0 CST}
- {2027577600 -18000 1 CDT}
- {2045718000 -21600 0 CST}
- {2059027200 -18000 1 CDT}
- {2077167600 -21600 0 CST}
- {2091081600 -18000 1 CDT}
- {2108617200 -21600 0 CST}
- {2122531200 -18000 1 CDT}
- {2140066800 -21600 0 CST}
- {2153980800 -18000 1 CDT}
- {2172121200 -21600 0 CST}
- {2185430400 -18000 1 CDT}
- {2203570800 -21600 0 CST}
- {2216880000 -18000 1 CDT}
- {2235020400 -21600 0 CST}
- {2248934400 -18000 1 CDT}
- {2266470000 -21600 0 CST}
- {2280384000 -18000 1 CDT}
- {2297919600 -21600 0 CST}
- {2311833600 -18000 1 CDT}
- {2329369200 -21600 0 CST}
- {2343283200 -18000 1 CDT}
- {2361423600 -21600 0 CST}
- {2374732800 -18000 1 CDT}
- {2392873200 -21600 0 CST}
- {2406182400 -18000 1 CDT}
- {2424322800 -21600 0 CST}
- {2438236800 -18000 1 CDT}
- {2455772400 -21600 0 CST}
- {2469686400 -18000 1 CDT}
- {2487222000 -21600 0 CST}
- {2501136000 -18000 1 CDT}
- {2519276400 -21600 0 CST}
- {2532585600 -18000 1 CDT}
- {2550726000 -21600 0 CST}
- {2564035200 -18000 1 CDT}
- {2582175600 -21600 0 CST}
- {2596089600 -18000 1 CDT}
- {2613625200 -21600 0 CST}
- {2627539200 -18000 1 CDT}
- {2645074800 -21600 0 CST}
- {2658988800 -18000 1 CDT}
- {2676524400 -21600 0 CST}
- {2690438400 -18000 1 CDT}
- {2708578800 -21600 0 CST}
- {2721888000 -18000 1 CDT}
- {2740028400 -21600 0 CST}
- {2753337600 -18000 1 CDT}
- {2771478000 -21600 0 CST}
- {2785392000 -18000 1 CDT}
- {2802927600 -21600 0 CST}
- {2816841600 -18000 1 CDT}
- {2834377200 -21600 0 CST}
- {2848291200 -18000 1 CDT}
- {2866431600 -21600 0 CST}
- {2879740800 -18000 1 CDT}
- {2897881200 -21600 0 CST}
- {2911190400 -18000 1 CDT}
- {2929330800 -21600 0 CST}
- {2942640000 -18000 1 CDT}
- {2960780400 -21600 0 CST}
- {2974694400 -18000 1 CDT}
- {2992230000 -21600 0 CST}
- {3006144000 -18000 1 CDT}
- {3023679600 -21600 0 CST}
- {3037593600 -18000 1 CDT}
- {3055734000 -21600 0 CST}
- {3069043200 -18000 1 CDT}
- {3087183600 -21600 0 CST}
- {3100492800 -18000 1 CDT}
- {3118633200 -21600 0 CST}
- {3132547200 -18000 1 CDT}
- {3150082800 -21600 0 CST}
- {3163996800 -18000 1 CDT}
- {3181532400 -21600 0 CST}
- {3195446400 -18000 1 CDT}
- {3212982000 -21600 0 CST}
- {3226896000 -18000 1 CDT}
- {3245036400 -21600 0 CST}
- {3258345600 -18000 1 CDT}
- {3276486000 -21600 0 CST}
- {3289795200 -18000 1 CDT}
- {3307935600 -21600 0 CST}
- {3321849600 -18000 1 CDT}
- {3339385200 -21600 0 CST}
- {3353299200 -18000 1 CDT}
- {3370834800 -21600 0 CST}
- {3384748800 -18000 1 CDT}
- {3402889200 -21600 0 CST}
- {3416198400 -18000 1 CDT}
- {3434338800 -21600 0 CST}
- {3447648000 -18000 1 CDT}
- {3465788400 -21600 0 CST}
- {3479702400 -18000 1 CDT}
- {3497238000 -21600 0 CST}
- {3511152000 -18000 1 CDT}
- {3528687600 -21600 0 CST}
- {3542601600 -18000 1 CDT}
- {3560137200 -21600 0 CST}
- {3574051200 -18000 1 CDT}
- {3592191600 -21600 0 CST}
- {3605500800 -18000 1 CDT}
- {3623641200 -21600 0 CST}
- {3636950400 -18000 1 CDT}
- {3655090800 -21600 0 CST}
- {3669004800 -18000 1 CDT}
- {3686540400 -21600 0 CST}
- {3700454400 -18000 1 CDT}
- {3717990000 -21600 0 CST}
- {3731904000 -18000 1 CDT}
- {3750044400 -21600 0 CST}
- {3763353600 -18000 1 CDT}
- {3781494000 -21600 0 CST}
- {3794803200 -18000 1 CDT}
- {3812943600 -21600 0 CST}
- {3826252800 -18000 1 CDT}
- {3844393200 -21600 0 CST}
- {3858307200 -18000 1 CDT}
- {3875842800 -21600 0 CST}
- {3889756800 -18000 1 CDT}
- {3907292400 -21600 0 CST}
- {3921206400 -18000 1 CDT}
- {3939346800 -21600 0 CST}
- {3952656000 -18000 1 CDT}
- {3970796400 -21600 0 CST}
- {3984105600 -18000 1 CDT}
- {4002246000 -21600 0 CST}
- {4016160000 -18000 1 CDT}
- {4033695600 -21600 0 CST}
- {4047609600 -18000 1 CDT}
- {4065145200 -21600 0 CST}
- {4079059200 -18000 1 CDT}
- {4096594800 -21600 0 CST}
}
diff --git a/library/tzdata/America/Mexico_City b/library/tzdata/America/Mexico_City
index 66e273f..2a0a5a8 100644
--- a/library/tzdata/America/Mexico_City
+++ b/library/tzdata/America/Mexico_City
@@ -71,158 +71,4 @@ set TZData(:America/Mexico_City) {
{1635663600 -21600 0 CST}
{1648972800 -18000 1 CDT}
{1667113200 -21600 0 CST}
- {1680422400 -18000 1 CDT}
- {1698562800 -21600 0 CST}
- {1712476800 -18000 1 CDT}
- {1730012400 -21600 0 CST}
- {1743926400 -18000 1 CDT}
- {1761462000 -21600 0 CST}
- {1775376000 -18000 1 CDT}
- {1792911600 -21600 0 CST}
- {1806825600 -18000 1 CDT}
- {1824966000 -21600 0 CST}
- {1838275200 -18000 1 CDT}
- {1856415600 -21600 0 CST}
- {1869724800 -18000 1 CDT}
- {1887865200 -21600 0 CST}
- {1901779200 -18000 1 CDT}
- {1919314800 -21600 0 CST}
- {1933228800 -18000 1 CDT}
- {1950764400 -21600 0 CST}
- {1964678400 -18000 1 CDT}
- {1982818800 -21600 0 CST}
- {1996128000 -18000 1 CDT}
- {2014268400 -21600 0 CST}
- {2027577600 -18000 1 CDT}
- {2045718000 -21600 0 CST}
- {2059027200 -18000 1 CDT}
- {2077167600 -21600 0 CST}
- {2091081600 -18000 1 CDT}
- {2108617200 -21600 0 CST}
- {2122531200 -18000 1 CDT}
- {2140066800 -21600 0 CST}
- {2153980800 -18000 1 CDT}
- {2172121200 -21600 0 CST}
- {2185430400 -18000 1 CDT}
- {2203570800 -21600 0 CST}
- {2216880000 -18000 1 CDT}
- {2235020400 -21600 0 CST}
- {2248934400 -18000 1 CDT}
- {2266470000 -21600 0 CST}
- {2280384000 -18000 1 CDT}
- {2297919600 -21600 0 CST}
- {2311833600 -18000 1 CDT}
- {2329369200 -21600 0 CST}
- {2343283200 -18000 1 CDT}
- {2361423600 -21600 0 CST}
- {2374732800 -18000 1 CDT}
- {2392873200 -21600 0 CST}
- {2406182400 -18000 1 CDT}
- {2424322800 -21600 0 CST}
- {2438236800 -18000 1 CDT}
- {2455772400 -21600 0 CST}
- {2469686400 -18000 1 CDT}
- {2487222000 -21600 0 CST}
- {2501136000 -18000 1 CDT}
- {2519276400 -21600 0 CST}
- {2532585600 -18000 1 CDT}
- {2550726000 -21600 0 CST}
- {2564035200 -18000 1 CDT}
- {2582175600 -21600 0 CST}
- {2596089600 -18000 1 CDT}
- {2613625200 -21600 0 CST}
- {2627539200 -18000 1 CDT}
- {2645074800 -21600 0 CST}
- {2658988800 -18000 1 CDT}
- {2676524400 -21600 0 CST}
- {2690438400 -18000 1 CDT}
- {2708578800 -21600 0 CST}
- {2721888000 -18000 1 CDT}
- {2740028400 -21600 0 CST}
- {2753337600 -18000 1 CDT}
- {2771478000 -21600 0 CST}
- {2785392000 -18000 1 CDT}
- {2802927600 -21600 0 CST}
- {2816841600 -18000 1 CDT}
- {2834377200 -21600 0 CST}
- {2848291200 -18000 1 CDT}
- {2866431600 -21600 0 CST}
- {2879740800 -18000 1 CDT}
- {2897881200 -21600 0 CST}
- {2911190400 -18000 1 CDT}
- {2929330800 -21600 0 CST}
- {2942640000 -18000 1 CDT}
- {2960780400 -21600 0 CST}
- {2974694400 -18000 1 CDT}
- {2992230000 -21600 0 CST}
- {3006144000 -18000 1 CDT}
- {3023679600 -21600 0 CST}
- {3037593600 -18000 1 CDT}
- {3055734000 -21600 0 CST}
- {3069043200 -18000 1 CDT}
- {3087183600 -21600 0 CST}
- {3100492800 -18000 1 CDT}
- {3118633200 -21600 0 CST}
- {3132547200 -18000 1 CDT}
- {3150082800 -21600 0 CST}
- {3163996800 -18000 1 CDT}
- {3181532400 -21600 0 CST}
- {3195446400 -18000 1 CDT}
- {3212982000 -21600 0 CST}
- {3226896000 -18000 1 CDT}
- {3245036400 -21600 0 CST}
- {3258345600 -18000 1 CDT}
- {3276486000 -21600 0 CST}
- {3289795200 -18000 1 CDT}
- {3307935600 -21600 0 CST}
- {3321849600 -18000 1 CDT}
- {3339385200 -21600 0 CST}
- {3353299200 -18000 1 CDT}
- {3370834800 -21600 0 CST}
- {3384748800 -18000 1 CDT}
- {3402889200 -21600 0 CST}
- {3416198400 -18000 1 CDT}
- {3434338800 -21600 0 CST}
- {3447648000 -18000 1 CDT}
- {3465788400 -21600 0 CST}
- {3479702400 -18000 1 CDT}
- {3497238000 -21600 0 CST}
- {3511152000 -18000 1 CDT}
- {3528687600 -21600 0 CST}
- {3542601600 -18000 1 CDT}
- {3560137200 -21600 0 CST}
- {3574051200 -18000 1 CDT}
- {3592191600 -21600 0 CST}
- {3605500800 -18000 1 CDT}
- {3623641200 -21600 0 CST}
- {3636950400 -18000 1 CDT}
- {3655090800 -21600 0 CST}
- {3669004800 -18000 1 CDT}
- {3686540400 -21600 0 CST}
- {3700454400 -18000 1 CDT}
- {3717990000 -21600 0 CST}
- {3731904000 -18000 1 CDT}
- {3750044400 -21600 0 CST}
- {3763353600 -18000 1 CDT}
- {3781494000 -21600 0 CST}
- {3794803200 -18000 1 CDT}
- {3812943600 -21600 0 CST}
- {3826252800 -18000 1 CDT}
- {3844393200 -21600 0 CST}
- {3858307200 -18000 1 CDT}
- {3875842800 -21600 0 CST}
- {3889756800 -18000 1 CDT}
- {3907292400 -21600 0 CST}
- {3921206400 -18000 1 CDT}
- {3939346800 -21600 0 CST}
- {3952656000 -18000 1 CDT}
- {3970796400 -21600 0 CST}
- {3984105600 -18000 1 CDT}
- {4002246000 -21600 0 CST}
- {4016160000 -18000 1 CDT}
- {4033695600 -21600 0 CST}
- {4047609600 -18000 1 CDT}
- {4065145200 -21600 0 CST}
- {4079059200 -18000 1 CDT}
- {4096594800 -21600 0 CST}
}
diff --git a/library/tzdata/America/Monterrey b/library/tzdata/America/Monterrey
index 4135884..7471c6a 100644
--- a/library/tzdata/America/Monterrey
+++ b/library/tzdata/America/Monterrey
@@ -61,158 +61,4 @@ set TZData(:America/Monterrey) {
{1635663600 -21600 0 CST}
{1648972800 -18000 1 CDT}
{1667113200 -21600 0 CST}
- {1680422400 -18000 1 CDT}
- {1698562800 -21600 0 CST}
- {1712476800 -18000 1 CDT}
- {1730012400 -21600 0 CST}
- {1743926400 -18000 1 CDT}
- {1761462000 -21600 0 CST}
- {1775376000 -18000 1 CDT}
- {1792911600 -21600 0 CST}
- {1806825600 -18000 1 CDT}
- {1824966000 -21600 0 CST}
- {1838275200 -18000 1 CDT}
- {1856415600 -21600 0 CST}
- {1869724800 -18000 1 CDT}
- {1887865200 -21600 0 CST}
- {1901779200 -18000 1 CDT}
- {1919314800 -21600 0 CST}
- {1933228800 -18000 1 CDT}
- {1950764400 -21600 0 CST}
- {1964678400 -18000 1 CDT}
- {1982818800 -21600 0 CST}
- {1996128000 -18000 1 CDT}
- {2014268400 -21600 0 CST}
- {2027577600 -18000 1 CDT}
- {2045718000 -21600 0 CST}
- {2059027200 -18000 1 CDT}
- {2077167600 -21600 0 CST}
- {2091081600 -18000 1 CDT}
- {2108617200 -21600 0 CST}
- {2122531200 -18000 1 CDT}
- {2140066800 -21600 0 CST}
- {2153980800 -18000 1 CDT}
- {2172121200 -21600 0 CST}
- {2185430400 -18000 1 CDT}
- {2203570800 -21600 0 CST}
- {2216880000 -18000 1 CDT}
- {2235020400 -21600 0 CST}
- {2248934400 -18000 1 CDT}
- {2266470000 -21600 0 CST}
- {2280384000 -18000 1 CDT}
- {2297919600 -21600 0 CST}
- {2311833600 -18000 1 CDT}
- {2329369200 -21600 0 CST}
- {2343283200 -18000 1 CDT}
- {2361423600 -21600 0 CST}
- {2374732800 -18000 1 CDT}
- {2392873200 -21600 0 CST}
- {2406182400 -18000 1 CDT}
- {2424322800 -21600 0 CST}
- {2438236800 -18000 1 CDT}
- {2455772400 -21600 0 CST}
- {2469686400 -18000 1 CDT}
- {2487222000 -21600 0 CST}
- {2501136000 -18000 1 CDT}
- {2519276400 -21600 0 CST}
- {2532585600 -18000 1 CDT}
- {2550726000 -21600 0 CST}
- {2564035200 -18000 1 CDT}
- {2582175600 -21600 0 CST}
- {2596089600 -18000 1 CDT}
- {2613625200 -21600 0 CST}
- {2627539200 -18000 1 CDT}
- {2645074800 -21600 0 CST}
- {2658988800 -18000 1 CDT}
- {2676524400 -21600 0 CST}
- {2690438400 -18000 1 CDT}
- {2708578800 -21600 0 CST}
- {2721888000 -18000 1 CDT}
- {2740028400 -21600 0 CST}
- {2753337600 -18000 1 CDT}
- {2771478000 -21600 0 CST}
- {2785392000 -18000 1 CDT}
- {2802927600 -21600 0 CST}
- {2816841600 -18000 1 CDT}
- {2834377200 -21600 0 CST}
- {2848291200 -18000 1 CDT}
- {2866431600 -21600 0 CST}
- {2879740800 -18000 1 CDT}
- {2897881200 -21600 0 CST}
- {2911190400 -18000 1 CDT}
- {2929330800 -21600 0 CST}
- {2942640000 -18000 1 CDT}
- {2960780400 -21600 0 CST}
- {2974694400 -18000 1 CDT}
- {2992230000 -21600 0 CST}
- {3006144000 -18000 1 CDT}
- {3023679600 -21600 0 CST}
- {3037593600 -18000 1 CDT}
- {3055734000 -21600 0 CST}
- {3069043200 -18000 1 CDT}
- {3087183600 -21600 0 CST}
- {3100492800 -18000 1 CDT}
- {3118633200 -21600 0 CST}
- {3132547200 -18000 1 CDT}
- {3150082800 -21600 0 CST}
- {3163996800 -18000 1 CDT}
- {3181532400 -21600 0 CST}
- {3195446400 -18000 1 CDT}
- {3212982000 -21600 0 CST}
- {3226896000 -18000 1 CDT}
- {3245036400 -21600 0 CST}
- {3258345600 -18000 1 CDT}
- {3276486000 -21600 0 CST}
- {3289795200 -18000 1 CDT}
- {3307935600 -21600 0 CST}
- {3321849600 -18000 1 CDT}
- {3339385200 -21600 0 CST}
- {3353299200 -18000 1 CDT}
- {3370834800 -21600 0 CST}
- {3384748800 -18000 1 CDT}
- {3402889200 -21600 0 CST}
- {3416198400 -18000 1 CDT}
- {3434338800 -21600 0 CST}
- {3447648000 -18000 1 CDT}
- {3465788400 -21600 0 CST}
- {3479702400 -18000 1 CDT}
- {3497238000 -21600 0 CST}
- {3511152000 -18000 1 CDT}
- {3528687600 -21600 0 CST}
- {3542601600 -18000 1 CDT}
- {3560137200 -21600 0 CST}
- {3574051200 -18000 1 CDT}
- {3592191600 -21600 0 CST}
- {3605500800 -18000 1 CDT}
- {3623641200 -21600 0 CST}
- {3636950400 -18000 1 CDT}
- {3655090800 -21600 0 CST}
- {3669004800 -18000 1 CDT}
- {3686540400 -21600 0 CST}
- {3700454400 -18000 1 CDT}
- {3717990000 -21600 0 CST}
- {3731904000 -18000 1 CDT}
- {3750044400 -21600 0 CST}
- {3763353600 -18000 1 CDT}
- {3781494000 -21600 0 CST}
- {3794803200 -18000 1 CDT}
- {3812943600 -21600 0 CST}
- {3826252800 -18000 1 CDT}
- {3844393200 -21600 0 CST}
- {3858307200 -18000 1 CDT}
- {3875842800 -21600 0 CST}
- {3889756800 -18000 1 CDT}
- {3907292400 -21600 0 CST}
- {3921206400 -18000 1 CDT}
- {3939346800 -21600 0 CST}
- {3952656000 -18000 1 CDT}
- {3970796400 -21600 0 CST}
- {3984105600 -18000 1 CDT}
- {4002246000 -21600 0 CST}
- {4016160000 -18000 1 CDT}
- {4033695600 -21600 0 CST}
- {4047609600 -18000 1 CDT}
- {4065145200 -21600 0 CST}
- {4079059200 -18000 1 CDT}
- {4096594800 -21600 0 CST}
}
diff --git a/library/tzdata/America/Nipigon b/library/tzdata/America/Nipigon
index 30690aa..785a3a3 100644
--- a/library/tzdata/America/Nipigon
+++ b/library/tzdata/America/Nipigon
@@ -1,264 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:America/Nipigon) {
- {-9223372036854775808 -21184 0 LMT}
- {-2366734016 -18000 0 EST}
- {-1632070800 -14400 1 EDT}
- {-1615140000 -18000 0 EST}
- {-923252400 -14400 1 EDT}
- {-880218000 -14400 0 EWT}
- {-769395600 -14400 1 EPT}
- {-765396000 -18000 0 EST}
- {136364400 -14400 1 EDT}
- {152085600 -18000 0 EST}
- {167814000 -14400 1 EDT}
- {183535200 -18000 0 EST}
- {199263600 -14400 1 EDT}
- {215589600 -18000 0 EST}
- {230713200 -14400 1 EDT}
- {247039200 -18000 0 EST}
- {262767600 -14400 1 EDT}
- {278488800 -18000 0 EST}
- {294217200 -14400 1 EDT}
- {309938400 -18000 0 EST}
- {325666800 -14400 1 EDT}
- {341388000 -18000 0 EST}
- {357116400 -14400 1 EDT}
- {372837600 -18000 0 EST}
- {388566000 -14400 1 EDT}
- {404892000 -18000 0 EST}
- {420015600 -14400 1 EDT}
- {436341600 -18000 0 EST}
- {452070000 -14400 1 EDT}
- {467791200 -18000 0 EST}
- {483519600 -14400 1 EDT}
- {499240800 -18000 0 EST}
- {514969200 -14400 1 EDT}
- {530690400 -18000 0 EST}
- {544604400 -14400 1 EDT}
- {562140000 -18000 0 EST}
- {576054000 -14400 1 EDT}
- {594194400 -18000 0 EST}
- {607503600 -14400 1 EDT}
- {625644000 -18000 0 EST}
- {638953200 -14400 1 EDT}
- {657093600 -18000 0 EST}
- {671007600 -14400 1 EDT}
- {688543200 -18000 0 EST}
- {702457200 -14400 1 EDT}
- {719992800 -18000 0 EST}
- {733906800 -14400 1 EDT}
- {752047200 -18000 0 EST}
- {765356400 -14400 1 EDT}
- {783496800 -18000 0 EST}
- {796806000 -14400 1 EDT}
- {814946400 -18000 0 EST}
- {828860400 -14400 1 EDT}
- {846396000 -18000 0 EST}
- {860310000 -14400 1 EDT}
- {877845600 -18000 0 EST}
- {891759600 -14400 1 EDT}
- {909295200 -18000 0 EST}
- {923209200 -14400 1 EDT}
- {941349600 -18000 0 EST}
- {954658800 -14400 1 EDT}
- {972799200 -18000 0 EST}
- {986108400 -14400 1 EDT}
- {1004248800 -18000 0 EST}
- {1018162800 -14400 1 EDT}
- {1035698400 -18000 0 EST}
- {1049612400 -14400 1 EDT}
- {1067148000 -18000 0 EST}
- {1081062000 -14400 1 EDT}
- {1099202400 -18000 0 EST}
- {1112511600 -14400 1 EDT}
- {1130652000 -18000 0 EST}
- {1143961200 -14400 1 EDT}
- {1162101600 -18000 0 EST}
- {1173596400 -14400 1 EDT}
- {1194156000 -18000 0 EST}
- {1205046000 -14400 1 EDT}
- {1225605600 -18000 0 EST}
- {1236495600 -14400 1 EDT}
- {1257055200 -18000 0 EST}
- {1268550000 -14400 1 EDT}
- {1289109600 -18000 0 EST}
- {1299999600 -14400 1 EDT}
- {1320559200 -18000 0 EST}
- {1331449200 -14400 1 EDT}
- {1352008800 -18000 0 EST}
- {1362898800 -14400 1 EDT}
- {1383458400 -18000 0 EST}
- {1394348400 -14400 1 EDT}
- {1414908000 -18000 0 EST}
- {1425798000 -14400 1 EDT}
- {1446357600 -18000 0 EST}
- {1457852400 -14400 1 EDT}
- {1478412000 -18000 0 EST}
- {1489302000 -14400 1 EDT}
- {1509861600 -18000 0 EST}
- {1520751600 -14400 1 EDT}
- {1541311200 -18000 0 EST}
- {1552201200 -14400 1 EDT}
- {1572760800 -18000 0 EST}
- {1583650800 -14400 1 EDT}
- {1604210400 -18000 0 EST}
- {1615705200 -14400 1 EDT}
- {1636264800 -18000 0 EST}
- {1647154800 -14400 1 EDT}
- {1667714400 -18000 0 EST}
- {1678604400 -14400 1 EDT}
- {1699164000 -18000 0 EST}
- {1710054000 -14400 1 EDT}
- {1730613600 -18000 0 EST}
- {1741503600 -14400 1 EDT}
- {1762063200 -18000 0 EST}
- {1772953200 -14400 1 EDT}
- {1793512800 -18000 0 EST}
- {1805007600 -14400 1 EDT}
- {1825567200 -18000 0 EST}
- {1836457200 -14400 1 EDT}
- {1857016800 -18000 0 EST}
- {1867906800 -14400 1 EDT}
- {1888466400 -18000 0 EST}
- {1899356400 -14400 1 EDT}
- {1919916000 -18000 0 EST}
- {1930806000 -14400 1 EDT}
- {1951365600 -18000 0 EST}
- {1962860400 -14400 1 EDT}
- {1983420000 -18000 0 EST}
- {1994310000 -14400 1 EDT}
- {2014869600 -18000 0 EST}
- {2025759600 -14400 1 EDT}
- {2046319200 -18000 0 EST}
- {2057209200 -14400 1 EDT}
- {2077768800 -18000 0 EST}
- {2088658800 -14400 1 EDT}
- {2109218400 -18000 0 EST}
- {2120108400 -14400 1 EDT}
- {2140668000 -18000 0 EST}
- {2152162800 -14400 1 EDT}
- {2172722400 -18000 0 EST}
- {2183612400 -14400 1 EDT}
- {2204172000 -18000 0 EST}
- {2215062000 -14400 1 EDT}
- {2235621600 -18000 0 EST}
- {2246511600 -14400 1 EDT}
- {2267071200 -18000 0 EST}
- {2277961200 -14400 1 EDT}
- {2298520800 -18000 0 EST}
- {2309410800 -14400 1 EDT}
- {2329970400 -18000 0 EST}
- {2341465200 -14400 1 EDT}
- {2362024800 -18000 0 EST}
- {2372914800 -14400 1 EDT}
- {2393474400 -18000 0 EST}
- {2404364400 -14400 1 EDT}
- {2424924000 -18000 0 EST}
- {2435814000 -14400 1 EDT}
- {2456373600 -18000 0 EST}
- {2467263600 -14400 1 EDT}
- {2487823200 -18000 0 EST}
- {2499318000 -14400 1 EDT}
- {2519877600 -18000 0 EST}
- {2530767600 -14400 1 EDT}
- {2551327200 -18000 0 EST}
- {2562217200 -14400 1 EDT}
- {2582776800 -18000 0 EST}
- {2593666800 -14400 1 EDT}
- {2614226400 -18000 0 EST}
- {2625116400 -14400 1 EDT}
- {2645676000 -18000 0 EST}
- {2656566000 -14400 1 EDT}
- {2677125600 -18000 0 EST}
- {2688620400 -14400 1 EDT}
- {2709180000 -18000 0 EST}
- {2720070000 -14400 1 EDT}
- {2740629600 -18000 0 EST}
- {2751519600 -14400 1 EDT}
- {2772079200 -18000 0 EST}
- {2782969200 -14400 1 EDT}
- {2803528800 -18000 0 EST}
- {2814418800 -14400 1 EDT}
- {2834978400 -18000 0 EST}
- {2846473200 -14400 1 EDT}
- {2867032800 -18000 0 EST}
- {2877922800 -14400 1 EDT}
- {2898482400 -18000 0 EST}
- {2909372400 -14400 1 EDT}
- {2929932000 -18000 0 EST}
- {2940822000 -14400 1 EDT}
- {2961381600 -18000 0 EST}
- {2972271600 -14400 1 EDT}
- {2992831200 -18000 0 EST}
- {3003721200 -14400 1 EDT}
- {3024280800 -18000 0 EST}
- {3035775600 -14400 1 EDT}
- {3056335200 -18000 0 EST}
- {3067225200 -14400 1 EDT}
- {3087784800 -18000 0 EST}
- {3098674800 -14400 1 EDT}
- {3119234400 -18000 0 EST}
- {3130124400 -14400 1 EDT}
- {3150684000 -18000 0 EST}
- {3161574000 -14400 1 EDT}
- {3182133600 -18000 0 EST}
- {3193023600 -14400 1 EDT}
- {3213583200 -18000 0 EST}
- {3225078000 -14400 1 EDT}
- {3245637600 -18000 0 EST}
- {3256527600 -14400 1 EDT}
- {3277087200 -18000 0 EST}
- {3287977200 -14400 1 EDT}
- {3308536800 -18000 0 EST}
- {3319426800 -14400 1 EDT}
- {3339986400 -18000 0 EST}
- {3350876400 -14400 1 EDT}
- {3371436000 -18000 0 EST}
- {3382930800 -14400 1 EDT}
- {3403490400 -18000 0 EST}
- {3414380400 -14400 1 EDT}
- {3434940000 -18000 0 EST}
- {3445830000 -14400 1 EDT}
- {3466389600 -18000 0 EST}
- {3477279600 -14400 1 EDT}
- {3497839200 -18000 0 EST}
- {3508729200 -14400 1 EDT}
- {3529288800 -18000 0 EST}
- {3540178800 -14400 1 EDT}
- {3560738400 -18000 0 EST}
- {3572233200 -14400 1 EDT}
- {3592792800 -18000 0 EST}
- {3603682800 -14400 1 EDT}
- {3624242400 -18000 0 EST}
- {3635132400 -14400 1 EDT}
- {3655692000 -18000 0 EST}
- {3666582000 -14400 1 EDT}
- {3687141600 -18000 0 EST}
- {3698031600 -14400 1 EDT}
- {3718591200 -18000 0 EST}
- {3730086000 -14400 1 EDT}
- {3750645600 -18000 0 EST}
- {3761535600 -14400 1 EDT}
- {3782095200 -18000 0 EST}
- {3792985200 -14400 1 EDT}
- {3813544800 -18000 0 EST}
- {3824434800 -14400 1 EDT}
- {3844994400 -18000 0 EST}
- {3855884400 -14400 1 EDT}
- {3876444000 -18000 0 EST}
- {3887334000 -14400 1 EDT}
- {3907893600 -18000 0 EST}
- {3919388400 -14400 1 EDT}
- {3939948000 -18000 0 EST}
- {3950838000 -14400 1 EDT}
- {3971397600 -18000 0 EST}
- {3982287600 -14400 1 EDT}
- {4002847200 -18000 0 EST}
- {4013737200 -14400 1 EDT}
- {4034296800 -18000 0 EST}
- {4045186800 -14400 1 EDT}
- {4065746400 -18000 0 EST}
- {4076636400 -14400 1 EDT}
- {4097196000 -18000 0 EST}
+if {![info exists TZData(America/Toronto)]} {
+ LoadTimeZoneFile America/Toronto
}
+set TZData(:America/Nipigon) $TZData(:America/Toronto)
diff --git a/library/tzdata/America/Ojinaga b/library/tzdata/America/Ojinaga
index c01cfde..7102f73 100644
--- a/library/tzdata/America/Ojinaga
+++ b/library/tzdata/America/Ojinaga
@@ -64,159 +64,5 @@ set TZData(:America/Ojinaga) {
{1615712400 -21600 1 MDT}
{1636272000 -25200 0 MST}
{1647162000 -21600 1 MDT}
- {1667721600 -25200 0 MST}
- {1678611600 -21600 1 MDT}
- {1699171200 -25200 0 MST}
- {1710061200 -21600 1 MDT}
- {1730620800 -25200 0 MST}
- {1741510800 -21600 1 MDT}
- {1762070400 -25200 0 MST}
- {1772960400 -21600 1 MDT}
- {1793520000 -25200 0 MST}
- {1805014800 -21600 1 MDT}
- {1825574400 -25200 0 MST}
- {1836464400 -21600 1 MDT}
- {1857024000 -25200 0 MST}
- {1867914000 -21600 1 MDT}
- {1888473600 -25200 0 MST}
- {1899363600 -21600 1 MDT}
- {1919923200 -25200 0 MST}
- {1930813200 -21600 1 MDT}
- {1951372800 -25200 0 MST}
- {1962867600 -21600 1 MDT}
- {1983427200 -25200 0 MST}
- {1994317200 -21600 1 MDT}
- {2014876800 -25200 0 MST}
- {2025766800 -21600 1 MDT}
- {2046326400 -25200 0 MST}
- {2057216400 -21600 1 MDT}
- {2077776000 -25200 0 MST}
- {2088666000 -21600 1 MDT}
- {2109225600 -25200 0 MST}
- {2120115600 -21600 1 MDT}
- {2140675200 -25200 0 MST}
- {2152170000 -21600 1 MDT}
- {2172729600 -25200 0 MST}
- {2183619600 -21600 1 MDT}
- {2204179200 -25200 0 MST}
- {2215069200 -21600 1 MDT}
- {2235628800 -25200 0 MST}
- {2246518800 -21600 1 MDT}
- {2267078400 -25200 0 MST}
- {2277968400 -21600 1 MDT}
- {2298528000 -25200 0 MST}
- {2309418000 -21600 1 MDT}
- {2329977600 -25200 0 MST}
- {2341472400 -21600 1 MDT}
- {2362032000 -25200 0 MST}
- {2372922000 -21600 1 MDT}
- {2393481600 -25200 0 MST}
- {2404371600 -21600 1 MDT}
- {2424931200 -25200 0 MST}
- {2435821200 -21600 1 MDT}
- {2456380800 -25200 0 MST}
- {2467270800 -21600 1 MDT}
- {2487830400 -25200 0 MST}
- {2499325200 -21600 1 MDT}
- {2519884800 -25200 0 MST}
- {2530774800 -21600 1 MDT}
- {2551334400 -25200 0 MST}
- {2562224400 -21600 1 MDT}
- {2582784000 -25200 0 MST}
- {2593674000 -21600 1 MDT}
- {2614233600 -25200 0 MST}
- {2625123600 -21600 1 MDT}
- {2645683200 -25200 0 MST}
- {2656573200 -21600 1 MDT}
- {2677132800 -25200 0 MST}
- {2688627600 -21600 1 MDT}
- {2709187200 -25200 0 MST}
- {2720077200 -21600 1 MDT}
- {2740636800 -25200 0 MST}
- {2751526800 -21600 1 MDT}
- {2772086400 -25200 0 MST}
- {2782976400 -21600 1 MDT}
- {2803536000 -25200 0 MST}
- {2814426000 -21600 1 MDT}
- {2834985600 -25200 0 MST}
- {2846480400 -21600 1 MDT}
- {2867040000 -25200 0 MST}
- {2877930000 -21600 1 MDT}
- {2898489600 -25200 0 MST}
- {2909379600 -21600 1 MDT}
- {2929939200 -25200 0 MST}
- {2940829200 -21600 1 MDT}
- {2961388800 -25200 0 MST}
- {2972278800 -21600 1 MDT}
- {2992838400 -25200 0 MST}
- {3003728400 -21600 1 MDT}
- {3024288000 -25200 0 MST}
- {3035782800 -21600 1 MDT}
- {3056342400 -25200 0 MST}
- {3067232400 -21600 1 MDT}
- {3087792000 -25200 0 MST}
- {3098682000 -21600 1 MDT}
- {3119241600 -25200 0 MST}
- {3130131600 -21600 1 MDT}
- {3150691200 -25200 0 MST}
- {3161581200 -21600 1 MDT}
- {3182140800 -25200 0 MST}
- {3193030800 -21600 1 MDT}
- {3213590400 -25200 0 MST}
- {3225085200 -21600 1 MDT}
- {3245644800 -25200 0 MST}
- {3256534800 -21600 1 MDT}
- {3277094400 -25200 0 MST}
- {3287984400 -21600 1 MDT}
- {3308544000 -25200 0 MST}
- {3319434000 -21600 1 MDT}
- {3339993600 -25200 0 MST}
- {3350883600 -21600 1 MDT}
- {3371443200 -25200 0 MST}
- {3382938000 -21600 1 MDT}
- {3403497600 -25200 0 MST}
- {3414387600 -21600 1 MDT}
- {3434947200 -25200 0 MST}
- {3445837200 -21600 1 MDT}
- {3466396800 -25200 0 MST}
- {3477286800 -21600 1 MDT}
- {3497846400 -25200 0 MST}
- {3508736400 -21600 1 MDT}
- {3529296000 -25200 0 MST}
- {3540186000 -21600 1 MDT}
- {3560745600 -25200 0 MST}
- {3572240400 -21600 1 MDT}
- {3592800000 -25200 0 MST}
- {3603690000 -21600 1 MDT}
- {3624249600 -25200 0 MST}
- {3635139600 -21600 1 MDT}
- {3655699200 -25200 0 MST}
- {3666589200 -21600 1 MDT}
- {3687148800 -25200 0 MST}
- {3698038800 -21600 1 MDT}
- {3718598400 -25200 0 MST}
- {3730093200 -21600 1 MDT}
- {3750652800 -25200 0 MST}
- {3761542800 -21600 1 MDT}
- {3782102400 -25200 0 MST}
- {3792992400 -21600 1 MDT}
- {3813552000 -25200 0 MST}
- {3824442000 -21600 1 MDT}
- {3845001600 -25200 0 MST}
- {3855891600 -21600 1 MDT}
- {3876451200 -25200 0 MST}
- {3887341200 -21600 1 MDT}
- {3907900800 -25200 0 MST}
- {3919395600 -21600 1 MDT}
- {3939955200 -25200 0 MST}
- {3950845200 -21600 1 MDT}
- {3971404800 -25200 0 MST}
- {3982294800 -21600 1 MDT}
- {4002854400 -25200 0 MST}
- {4013744400 -21600 1 MDT}
- {4034304000 -25200 0 MST}
- {4045194000 -21600 1 MDT}
- {4065753600 -25200 0 MST}
- {4076643600 -21600 1 MDT}
- {4097203200 -25200 0 MST}
+ {1667120400 -21600 0 CST}
}
diff --git a/library/tzdata/America/Rainy_River b/library/tzdata/America/Rainy_River
index a2b11aa..17fccb4 100644
--- a/library/tzdata/America/Rainy_River
+++ b/library/tzdata/America/Rainy_River
@@ -1,264 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:America/Rainy_River) {
- {-9223372036854775808 -22696 0 LMT}
- {-2366732504 -21600 0 CST}
- {-1632067200 -18000 1 CDT}
- {-1615136400 -21600 0 CST}
- {-923248800 -18000 1 CDT}
- {-880214400 -18000 0 CWT}
- {-769395600 -18000 1 CPT}
- {-765392400 -21600 0 CST}
- {136368000 -18000 1 CDT}
- {152089200 -21600 0 CST}
- {167817600 -18000 1 CDT}
- {183538800 -21600 0 CST}
- {199267200 -18000 1 CDT}
- {215593200 -21600 0 CST}
- {230716800 -18000 1 CDT}
- {247042800 -21600 0 CST}
- {262771200 -18000 1 CDT}
- {278492400 -21600 0 CST}
- {294220800 -18000 1 CDT}
- {309942000 -21600 0 CST}
- {325670400 -18000 1 CDT}
- {341391600 -21600 0 CST}
- {357120000 -18000 1 CDT}
- {372841200 -21600 0 CST}
- {388569600 -18000 1 CDT}
- {404895600 -21600 0 CST}
- {420019200 -18000 1 CDT}
- {436345200 -21600 0 CST}
- {452073600 -18000 1 CDT}
- {467794800 -21600 0 CST}
- {483523200 -18000 1 CDT}
- {499244400 -21600 0 CST}
- {514972800 -18000 1 CDT}
- {530694000 -21600 0 CST}
- {544608000 -18000 1 CDT}
- {562143600 -21600 0 CST}
- {576057600 -18000 1 CDT}
- {594198000 -21600 0 CST}
- {607507200 -18000 1 CDT}
- {625647600 -21600 0 CST}
- {638956800 -18000 1 CDT}
- {657097200 -21600 0 CST}
- {671011200 -18000 1 CDT}
- {688546800 -21600 0 CST}
- {702460800 -18000 1 CDT}
- {719996400 -21600 0 CST}
- {733910400 -18000 1 CDT}
- {752050800 -21600 0 CST}
- {765360000 -18000 1 CDT}
- {783500400 -21600 0 CST}
- {796809600 -18000 1 CDT}
- {814950000 -21600 0 CST}
- {828864000 -18000 1 CDT}
- {846399600 -21600 0 CST}
- {860313600 -18000 1 CDT}
- {877849200 -21600 0 CST}
- {891763200 -18000 1 CDT}
- {909298800 -21600 0 CST}
- {923212800 -18000 1 CDT}
- {941353200 -21600 0 CST}
- {954662400 -18000 1 CDT}
- {972802800 -21600 0 CST}
- {986112000 -18000 1 CDT}
- {1004252400 -21600 0 CST}
- {1018166400 -18000 1 CDT}
- {1035702000 -21600 0 CST}
- {1049616000 -18000 1 CDT}
- {1067151600 -21600 0 CST}
- {1081065600 -18000 1 CDT}
- {1099206000 -21600 0 CST}
- {1112515200 -18000 1 CDT}
- {1130655600 -21600 0 CST}
- {1143964800 -18000 1 CDT}
- {1162105200 -21600 0 CST}
- {1173600000 -18000 1 CDT}
- {1194159600 -21600 0 CST}
- {1205049600 -18000 1 CDT}
- {1225609200 -21600 0 CST}
- {1236499200 -18000 1 CDT}
- {1257058800 -21600 0 CST}
- {1268553600 -18000 1 CDT}
- {1289113200 -21600 0 CST}
- {1300003200 -18000 1 CDT}
- {1320562800 -21600 0 CST}
- {1331452800 -18000 1 CDT}
- {1352012400 -21600 0 CST}
- {1362902400 -18000 1 CDT}
- {1383462000 -21600 0 CST}
- {1394352000 -18000 1 CDT}
- {1414911600 -21600 0 CST}
- {1425801600 -18000 1 CDT}
- {1446361200 -21600 0 CST}
- {1457856000 -18000 1 CDT}
- {1478415600 -21600 0 CST}
- {1489305600 -18000 1 CDT}
- {1509865200 -21600 0 CST}
- {1520755200 -18000 1 CDT}
- {1541314800 -21600 0 CST}
- {1552204800 -18000 1 CDT}
- {1572764400 -21600 0 CST}
- {1583654400 -18000 1 CDT}
- {1604214000 -21600 0 CST}
- {1615708800 -18000 1 CDT}
- {1636268400 -21600 0 CST}
- {1647158400 -18000 1 CDT}
- {1667718000 -21600 0 CST}
- {1678608000 -18000 1 CDT}
- {1699167600 -21600 0 CST}
- {1710057600 -18000 1 CDT}
- {1730617200 -21600 0 CST}
- {1741507200 -18000 1 CDT}
- {1762066800 -21600 0 CST}
- {1772956800 -18000 1 CDT}
- {1793516400 -21600 0 CST}
- {1805011200 -18000 1 CDT}
- {1825570800 -21600 0 CST}
- {1836460800 -18000 1 CDT}
- {1857020400 -21600 0 CST}
- {1867910400 -18000 1 CDT}
- {1888470000 -21600 0 CST}
- {1899360000 -18000 1 CDT}
- {1919919600 -21600 0 CST}
- {1930809600 -18000 1 CDT}
- {1951369200 -21600 0 CST}
- {1962864000 -18000 1 CDT}
- {1983423600 -21600 0 CST}
- {1994313600 -18000 1 CDT}
- {2014873200 -21600 0 CST}
- {2025763200 -18000 1 CDT}
- {2046322800 -21600 0 CST}
- {2057212800 -18000 1 CDT}
- {2077772400 -21600 0 CST}
- {2088662400 -18000 1 CDT}
- {2109222000 -21600 0 CST}
- {2120112000 -18000 1 CDT}
- {2140671600 -21600 0 CST}
- {2152166400 -18000 1 CDT}
- {2172726000 -21600 0 CST}
- {2183616000 -18000 1 CDT}
- {2204175600 -21600 0 CST}
- {2215065600 -18000 1 CDT}
- {2235625200 -21600 0 CST}
- {2246515200 -18000 1 CDT}
- {2267074800 -21600 0 CST}
- {2277964800 -18000 1 CDT}
- {2298524400 -21600 0 CST}
- {2309414400 -18000 1 CDT}
- {2329974000 -21600 0 CST}
- {2341468800 -18000 1 CDT}
- {2362028400 -21600 0 CST}
- {2372918400 -18000 1 CDT}
- {2393478000 -21600 0 CST}
- {2404368000 -18000 1 CDT}
- {2424927600 -21600 0 CST}
- {2435817600 -18000 1 CDT}
- {2456377200 -21600 0 CST}
- {2467267200 -18000 1 CDT}
- {2487826800 -21600 0 CST}
- {2499321600 -18000 1 CDT}
- {2519881200 -21600 0 CST}
- {2530771200 -18000 1 CDT}
- {2551330800 -21600 0 CST}
- {2562220800 -18000 1 CDT}
- {2582780400 -21600 0 CST}
- {2593670400 -18000 1 CDT}
- {2614230000 -21600 0 CST}
- {2625120000 -18000 1 CDT}
- {2645679600 -21600 0 CST}
- {2656569600 -18000 1 CDT}
- {2677129200 -21600 0 CST}
- {2688624000 -18000 1 CDT}
- {2709183600 -21600 0 CST}
- {2720073600 -18000 1 CDT}
- {2740633200 -21600 0 CST}
- {2751523200 -18000 1 CDT}
- {2772082800 -21600 0 CST}
- {2782972800 -18000 1 CDT}
- {2803532400 -21600 0 CST}
- {2814422400 -18000 1 CDT}
- {2834982000 -21600 0 CST}
- {2846476800 -18000 1 CDT}
- {2867036400 -21600 0 CST}
- {2877926400 -18000 1 CDT}
- {2898486000 -21600 0 CST}
- {2909376000 -18000 1 CDT}
- {2929935600 -21600 0 CST}
- {2940825600 -18000 1 CDT}
- {2961385200 -21600 0 CST}
- {2972275200 -18000 1 CDT}
- {2992834800 -21600 0 CST}
- {3003724800 -18000 1 CDT}
- {3024284400 -21600 0 CST}
- {3035779200 -18000 1 CDT}
- {3056338800 -21600 0 CST}
- {3067228800 -18000 1 CDT}
- {3087788400 -21600 0 CST}
- {3098678400 -18000 1 CDT}
- {3119238000 -21600 0 CST}
- {3130128000 -18000 1 CDT}
- {3150687600 -21600 0 CST}
- {3161577600 -18000 1 CDT}
- {3182137200 -21600 0 CST}
- {3193027200 -18000 1 CDT}
- {3213586800 -21600 0 CST}
- {3225081600 -18000 1 CDT}
- {3245641200 -21600 0 CST}
- {3256531200 -18000 1 CDT}
- {3277090800 -21600 0 CST}
- {3287980800 -18000 1 CDT}
- {3308540400 -21600 0 CST}
- {3319430400 -18000 1 CDT}
- {3339990000 -21600 0 CST}
- {3350880000 -18000 1 CDT}
- {3371439600 -21600 0 CST}
- {3382934400 -18000 1 CDT}
- {3403494000 -21600 0 CST}
- {3414384000 -18000 1 CDT}
- {3434943600 -21600 0 CST}
- {3445833600 -18000 1 CDT}
- {3466393200 -21600 0 CST}
- {3477283200 -18000 1 CDT}
- {3497842800 -21600 0 CST}
- {3508732800 -18000 1 CDT}
- {3529292400 -21600 0 CST}
- {3540182400 -18000 1 CDT}
- {3560742000 -21600 0 CST}
- {3572236800 -18000 1 CDT}
- {3592796400 -21600 0 CST}
- {3603686400 -18000 1 CDT}
- {3624246000 -21600 0 CST}
- {3635136000 -18000 1 CDT}
- {3655695600 -21600 0 CST}
- {3666585600 -18000 1 CDT}
- {3687145200 -21600 0 CST}
- {3698035200 -18000 1 CDT}
- {3718594800 -21600 0 CST}
- {3730089600 -18000 1 CDT}
- {3750649200 -21600 0 CST}
- {3761539200 -18000 1 CDT}
- {3782098800 -21600 0 CST}
- {3792988800 -18000 1 CDT}
- {3813548400 -21600 0 CST}
- {3824438400 -18000 1 CDT}
- {3844998000 -21600 0 CST}
- {3855888000 -18000 1 CDT}
- {3876447600 -21600 0 CST}
- {3887337600 -18000 1 CDT}
- {3907897200 -21600 0 CST}
- {3919392000 -18000 1 CDT}
- {3939951600 -21600 0 CST}
- {3950841600 -18000 1 CDT}
- {3971401200 -21600 0 CST}
- {3982291200 -18000 1 CDT}
- {4002850800 -21600 0 CST}
- {4013740800 -18000 1 CDT}
- {4034300400 -21600 0 CST}
- {4045190400 -18000 1 CDT}
- {4065750000 -21600 0 CST}
- {4076640000 -18000 1 CDT}
- {4097199600 -21600 0 CST}
+if {![info exists TZData(America/Winnipeg)]} {
+ LoadTimeZoneFile America/Winnipeg
}
+set TZData(:America/Rainy_River) $TZData(:America/Winnipeg)
diff --git a/library/tzdata/America/Thunder_Bay b/library/tzdata/America/Thunder_Bay
index 8a454be..4761beb 100644
--- a/library/tzdata/America/Thunder_Bay
+++ b/library/tzdata/America/Thunder_Bay
@@ -1,272 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
-
-set TZData(:America/Thunder_Bay) {
- {-9223372036854775808 -21420 0 LMT}
- {-2366733780 -21600 0 CST}
- {-1893434400 -18000 0 EST}
- {-883594800 -18000 0 EST}
- {-880218000 -14400 1 EWT}
- {-769395600 -14400 1 EPT}
- {-765396000 -18000 0 EST}
- {18000 -18000 0 EST}
- {9961200 -14400 1 EDT}
- {25682400 -18000 0 EST}
- {41410800 -14400 1 EDT}
- {57736800 -18000 0 EST}
- {73465200 -14400 1 EDT}
- {89186400 -18000 0 EST}
- {94712400 -18000 0 EST}
- {126248400 -18000 0 EST}
- {136364400 -14400 1 EDT}
- {152085600 -18000 0 EST}
- {167814000 -14400 1 EDT}
- {183535200 -18000 0 EST}
- {199263600 -14400 1 EDT}
- {215589600 -18000 0 EST}
- {230713200 -14400 1 EDT}
- {247039200 -18000 0 EST}
- {262767600 -14400 1 EDT}
- {278488800 -18000 0 EST}
- {294217200 -14400 1 EDT}
- {309938400 -18000 0 EST}
- {325666800 -14400 1 EDT}
- {341388000 -18000 0 EST}
- {357116400 -14400 1 EDT}
- {372837600 -18000 0 EST}
- {388566000 -14400 1 EDT}
- {404892000 -18000 0 EST}
- {420015600 -14400 1 EDT}
- {436341600 -18000 0 EST}
- {452070000 -14400 1 EDT}
- {467791200 -18000 0 EST}
- {483519600 -14400 1 EDT}
- {499240800 -18000 0 EST}
- {514969200 -14400 1 EDT}
- {530690400 -18000 0 EST}
- {544604400 -14400 1 EDT}
- {562140000 -18000 0 EST}
- {576054000 -14400 1 EDT}
- {594194400 -18000 0 EST}
- {607503600 -14400 1 EDT}
- {625644000 -18000 0 EST}
- {638953200 -14400 1 EDT}
- {657093600 -18000 0 EST}
- {671007600 -14400 1 EDT}
- {688543200 -18000 0 EST}
- {702457200 -14400 1 EDT}
- {719992800 -18000 0 EST}
- {733906800 -14400 1 EDT}
- {752047200 -18000 0 EST}
- {765356400 -14400 1 EDT}
- {783496800 -18000 0 EST}
- {796806000 -14400 1 EDT}
- {814946400 -18000 0 EST}
- {828860400 -14400 1 EDT}
- {846396000 -18000 0 EST}
- {860310000 -14400 1 EDT}
- {877845600 -18000 0 EST}
- {891759600 -14400 1 EDT}
- {909295200 -18000 0 EST}
- {923209200 -14400 1 EDT}
- {941349600 -18000 0 EST}
- {954658800 -14400 1 EDT}
- {972799200 -18000 0 EST}
- {986108400 -14400 1 EDT}
- {1004248800 -18000 0 EST}
- {1018162800 -14400 1 EDT}
- {1035698400 -18000 0 EST}
- {1049612400 -14400 1 EDT}
- {1067148000 -18000 0 EST}
- {1081062000 -14400 1 EDT}
- {1099202400 -18000 0 EST}
- {1112511600 -14400 1 EDT}
- {1130652000 -18000 0 EST}
- {1143961200 -14400 1 EDT}
- {1162101600 -18000 0 EST}
- {1173596400 -14400 1 EDT}
- {1194156000 -18000 0 EST}
- {1205046000 -14400 1 EDT}
- {1225605600 -18000 0 EST}
- {1236495600 -14400 1 EDT}
- {1257055200 -18000 0 EST}
- {1268550000 -14400 1 EDT}
- {1289109600 -18000 0 EST}
- {1299999600 -14400 1 EDT}
- {1320559200 -18000 0 EST}
- {1331449200 -14400 1 EDT}
- {1352008800 -18000 0 EST}
- {1362898800 -14400 1 EDT}
- {1383458400 -18000 0 EST}
- {1394348400 -14400 1 EDT}
- {1414908000 -18000 0 EST}
- {1425798000 -14400 1 EDT}
- {1446357600 -18000 0 EST}
- {1457852400 -14400 1 EDT}
- {1478412000 -18000 0 EST}
- {1489302000 -14400 1 EDT}
- {1509861600 -18000 0 EST}
- {1520751600 -14400 1 EDT}
- {1541311200 -18000 0 EST}
- {1552201200 -14400 1 EDT}
- {1572760800 -18000 0 EST}
- {1583650800 -14400 1 EDT}
- {1604210400 -18000 0 EST}
- {1615705200 -14400 1 EDT}
- {1636264800 -18000 0 EST}
- {1647154800 -14400 1 EDT}
- {1667714400 -18000 0 EST}
- {1678604400 -14400 1 EDT}
- {1699164000 -18000 0 EST}
- {1710054000 -14400 1 EDT}
- {1730613600 -18000 0 EST}
- {1741503600 -14400 1 EDT}
- {1762063200 -18000 0 EST}
- {1772953200 -14400 1 EDT}
- {1793512800 -18000 0 EST}
- {1805007600 -14400 1 EDT}
- {1825567200 -18000 0 EST}
- {1836457200 -14400 1 EDT}
- {1857016800 -18000 0 EST}
- {1867906800 -14400 1 EDT}
- {1888466400 -18000 0 EST}
- {1899356400 -14400 1 EDT}
- {1919916000 -18000 0 EST}
- {1930806000 -14400 1 EDT}
- {1951365600 -18000 0 EST}
- {1962860400 -14400 1 EDT}
- {1983420000 -18000 0 EST}
- {1994310000 -14400 1 EDT}
- {2014869600 -18000 0 EST}
- {2025759600 -14400 1 EDT}
- {2046319200 -18000 0 EST}
- {2057209200 -14400 1 EDT}
- {2077768800 -18000 0 EST}
- {2088658800 -14400 1 EDT}
- {2109218400 -18000 0 EST}
- {2120108400 -14400 1 EDT}
- {2140668000 -18000 0 EST}
- {2152162800 -14400 1 EDT}
- {2172722400 -18000 0 EST}
- {2183612400 -14400 1 EDT}
- {2204172000 -18000 0 EST}
- {2215062000 -14400 1 EDT}
- {2235621600 -18000 0 EST}
- {2246511600 -14400 1 EDT}
- {2267071200 -18000 0 EST}
- {2277961200 -14400 1 EDT}
- {2298520800 -18000 0 EST}
- {2309410800 -14400 1 EDT}
- {2329970400 -18000 0 EST}
- {2341465200 -14400 1 EDT}
- {2362024800 -18000 0 EST}
- {2372914800 -14400 1 EDT}
- {2393474400 -18000 0 EST}
- {2404364400 -14400 1 EDT}
- {2424924000 -18000 0 EST}
- {2435814000 -14400 1 EDT}
- {2456373600 -18000 0 EST}
- {2467263600 -14400 1 EDT}
- {2487823200 -18000 0 EST}
- {2499318000 -14400 1 EDT}
- {2519877600 -18000 0 EST}
- {2530767600 -14400 1 EDT}
- {2551327200 -18000 0 EST}
- {2562217200 -14400 1 EDT}
- {2582776800 -18000 0 EST}
- {2593666800 -14400 1 EDT}
- {2614226400 -18000 0 EST}
- {2625116400 -14400 1 EDT}
- {2645676000 -18000 0 EST}
- {2656566000 -14400 1 EDT}
- {2677125600 -18000 0 EST}
- {2688620400 -14400 1 EDT}
- {2709180000 -18000 0 EST}
- {2720070000 -14400 1 EDT}
- {2740629600 -18000 0 EST}
- {2751519600 -14400 1 EDT}
- {2772079200 -18000 0 EST}
- {2782969200 -14400 1 EDT}
- {2803528800 -18000 0 EST}
- {2814418800 -14400 1 EDT}
- {2834978400 -18000 0 EST}
- {2846473200 -14400 1 EDT}
- {2867032800 -18000 0 EST}
- {2877922800 -14400 1 EDT}
- {2898482400 -18000 0 EST}
- {2909372400 -14400 1 EDT}
- {2929932000 -18000 0 EST}
- {2940822000 -14400 1 EDT}
- {2961381600 -18000 0 EST}
- {2972271600 -14400 1 EDT}
- {2992831200 -18000 0 EST}
- {3003721200 -14400 1 EDT}
- {3024280800 -18000 0 EST}
- {3035775600 -14400 1 EDT}
- {3056335200 -18000 0 EST}
- {3067225200 -14400 1 EDT}
- {3087784800 -18000 0 EST}
- {3098674800 -14400 1 EDT}
- {3119234400 -18000 0 EST}
- {3130124400 -14400 1 EDT}
- {3150684000 -18000 0 EST}
- {3161574000 -14400 1 EDT}
- {3182133600 -18000 0 EST}
- {3193023600 -14400 1 EDT}
- {3213583200 -18000 0 EST}
- {3225078000 -14400 1 EDT}
- {3245637600 -18000 0 EST}
- {3256527600 -14400 1 EDT}
- {3277087200 -18000 0 EST}
- {3287977200 -14400 1 EDT}
- {3308536800 -18000 0 EST}
- {3319426800 -14400 1 EDT}
- {3339986400 -18000 0 EST}
- {3350876400 -14400 1 EDT}
- {3371436000 -18000 0 EST}
- {3382930800 -14400 1 EDT}
- {3403490400 -18000 0 EST}
- {3414380400 -14400 1 EDT}
- {3434940000 -18000 0 EST}
- {3445830000 -14400 1 EDT}
- {3466389600 -18000 0 EST}
- {3477279600 -14400 1 EDT}
- {3497839200 -18000 0 EST}
- {3508729200 -14400 1 EDT}
- {3529288800 -18000 0 EST}
- {3540178800 -14400 1 EDT}
- {3560738400 -18000 0 EST}
- {3572233200 -14400 1 EDT}
- {3592792800 -18000 0 EST}
- {3603682800 -14400 1 EDT}
- {3624242400 -18000 0 EST}
- {3635132400 -14400 1 EDT}
- {3655692000 -18000 0 EST}
- {3666582000 -14400 1 EDT}
- {3687141600 -18000 0 EST}
- {3698031600 -14400 1 EDT}
- {3718591200 -18000 0 EST}
- {3730086000 -14400 1 EDT}
- {3750645600 -18000 0 EST}
- {3761535600 -14400 1 EDT}
- {3782095200 -18000 0 EST}
- {3792985200 -14400 1 EDT}
- {3813544800 -18000 0 EST}
- {3824434800 -14400 1 EDT}
- {3844994400 -18000 0 EST}
- {3855884400 -14400 1 EDT}
- {3876444000 -18000 0 EST}
- {3887334000 -14400 1 EDT}
- {3907893600 -18000 0 EST}
- {3919388400 -14400 1 EDT}
- {3939948000 -18000 0 EST}
- {3950838000 -14400 1 EDT}
- {3971397600 -18000 0 EST}
- {3982287600 -14400 1 EDT}
- {4002847200 -18000 0 EST}
- {4013737200 -14400 1 EDT}
- {4034296800 -18000 0 EST}
- {4045186800 -14400 1 EDT}
- {4065746400 -18000 0 EST}
- {4076636400 -14400 1 EDT}
- {4097196000 -18000 0 EST}
+if {![info exists TZData(America/Toronto)]} {
+ LoadTimeZoneFile America/Toronto
}
+set TZData(:America/Thunder_Bay) $TZData(:America/Toronto)
diff --git a/library/tzdata/Pacific/Fiji b/library/tzdata/Pacific/Fiji
index 67a1f00..c1d748b 100644
--- a/library/tzdata/Pacific/Fiji
+++ b/library/tzdata/Pacific/Fiji
@@ -31,159 +31,4 @@ set TZData(:Pacific/Fiji) {
{1578751200 43200 0 +12}
{1608386400 46800 1 +12}
{1610805600 43200 0 +12}
- {1668261600 46800 1 +12}
- {1673704800 43200 0 +12}
- {1699711200 46800 1 +12}
- {1705154400 43200 0 +12}
- {1731160800 46800 1 +12}
- {1736604000 43200 0 +12}
- {1762610400 46800 1 +12}
- {1768658400 43200 0 +12}
- {1794060000 46800 1 +12}
- {1800108000 43200 0 +12}
- {1826114400 46800 1 +12}
- {1831557600 43200 0 +12}
- {1857564000 46800 1 +12}
- {1863007200 43200 0 +12}
- {1889013600 46800 1 +12}
- {1894456800 43200 0 +12}
- {1920463200 46800 1 +12}
- {1925906400 43200 0 +12}
- {1951912800 46800 1 +12}
- {1957960800 43200 0 +12}
- {1983967200 46800 1 +12}
- {1989410400 43200 0 +12}
- {2015416800 46800 1 +12}
- {2020860000 43200 0 +12}
- {2046866400 46800 1 +12}
- {2052309600 43200 0 +12}
- {2078316000 46800 1 +12}
- {2083759200 43200 0 +12}
- {2109765600 46800 1 +12}
- {2115813600 43200 0 +12}
- {2141215200 46800 1 +12}
- {2147263200 43200 0 +12}
- {2173269600 46800 1 +12}
- {2178712800 43200 0 +12}
- {2204719200 46800 1 +12}
- {2210162400 43200 0 +12}
- {2236168800 46800 1 +12}
- {2241612000 43200 0 +12}
- {2267618400 46800 1 +12}
- {2273061600 43200 0 +12}
- {2299068000 46800 1 +12}
- {2305116000 43200 0 +12}
- {2330517600 46800 1 +12}
- {2336565600 43200 0 +12}
- {2362572000 46800 1 +12}
- {2368015200 43200 0 +12}
- {2394021600 46800 1 +12}
- {2399464800 43200 0 +12}
- {2425471200 46800 1 +12}
- {2430914400 43200 0 +12}
- {2456920800 46800 1 +12}
- {2462364000 43200 0 +12}
- {2488370400 46800 1 +12}
- {2494418400 43200 0 +12}
- {2520424800 46800 1 +12}
- {2525868000 43200 0 +12}
- {2551874400 46800 1 +12}
- {2557317600 43200 0 +12}
- {2583324000 46800 1 +12}
- {2588767200 43200 0 +12}
- {2614773600 46800 1 +12}
- {2620216800 43200 0 +12}
- {2646223200 46800 1 +12}
- {2652271200 43200 0 +12}
- {2677672800 46800 1 +12}
- {2683720800 43200 0 +12}
- {2709727200 46800 1 +12}
- {2715170400 43200 0 +12}
- {2741176800 46800 1 +12}
- {2746620000 43200 0 +12}
- {2772626400 46800 1 +12}
- {2778069600 43200 0 +12}
- {2804076000 46800 1 +12}
- {2809519200 43200 0 +12}
- {2835525600 46800 1 +12}
- {2841573600 43200 0 +12}
- {2867580000 46800 1 +12}
- {2873023200 43200 0 +12}
- {2899029600 46800 1 +12}
- {2904472800 43200 0 +12}
- {2930479200 46800 1 +12}
- {2935922400 43200 0 +12}
- {2961928800 46800 1 +12}
- {2967372000 43200 0 +12}
- {2993378400 46800 1 +12}
- {2999426400 43200 0 +12}
- {3024828000 46800 1 +12}
- {3030876000 43200 0 +12}
- {3056882400 46800 1 +12}
- {3062325600 43200 0 +12}
- {3088332000 46800 1 +12}
- {3093775200 43200 0 +12}
- {3119781600 46800 1 +12}
- {3125224800 43200 0 +12}
- {3151231200 46800 1 +12}
- {3156674400 43200 0 +12}
- {3182680800 46800 1 +12}
- {3188728800 43200 0 +12}
- {3214130400 46800 1 +12}
- {3220178400 43200 0 +12}
- {3246184800 46800 1 +12}
- {3251628000 43200 0 +12}
- {3277634400 46800 1 +12}
- {3283077600 43200 0 +12}
- {3309084000 46800 1 +12}
- {3314527200 43200 0 +12}
- {3340533600 46800 1 +12}
- {3345976800 43200 0 +12}
- {3371983200 46800 1 +12}
- {3378031200 43200 0 +12}
- {3404037600 46800 1 +12}
- {3409480800 43200 0 +12}
- {3435487200 46800 1 +12}
- {3440930400 43200 0 +12}
- {3466936800 46800 1 +12}
- {3472380000 43200 0 +12}
- {3498386400 46800 1 +12}
- {3503829600 43200 0 +12}
- {3529836000 46800 1 +12}
- {3535884000 43200 0 +12}
- {3561285600 46800 1 +12}
- {3567333600 43200 0 +12}
- {3593340000 46800 1 +12}
- {3598783200 43200 0 +12}
- {3624789600 46800 1 +12}
- {3630232800 43200 0 +12}
- {3656239200 46800 1 +12}
- {3661682400 43200 0 +12}
- {3687688800 46800 1 +12}
- {3693132000 43200 0 +12}
- {3719138400 46800 1 +12}
- {3725186400 43200 0 +12}
- {3751192800 46800 1 +12}
- {3756636000 43200 0 +12}
- {3782642400 46800 1 +12}
- {3788085600 43200 0 +12}
- {3814092000 46800 1 +12}
- {3819535200 43200 0 +12}
- {3845541600 46800 1 +12}
- {3850984800 43200 0 +12}
- {3876991200 46800 1 +12}
- {3883039200 43200 0 +12}
- {3908440800 46800 1 +12}
- {3914488800 43200 0 +12}
- {3940495200 46800 1 +12}
- {3945938400 43200 0 +12}
- {3971944800 46800 1 +12}
- {3977388000 43200 0 +12}
- {4003394400 46800 1 +12}
- {4008837600 43200 0 +12}
- {4034844000 46800 1 +12}
- {4040287200 43200 0 +12}
- {4066293600 46800 1 +12}
- {4072341600 43200 0 +12}
- {4097743200 46800 1 +12}
}
diff --git a/tests/binary.test b/tests/binary.test
index 56f5920..a947410 100644
--- a/tests/binary.test
+++ b/tests/binary.test
@@ -512,10 +512,10 @@ test binary-13.11 {Tcl_BinaryObjCmd: format} littleEndian {
} \xCD\xCC\xCC\x3F\x9A\x99\x59\x40
test binary-13.12 {Tcl_BinaryObjCmd: float overflow} bigEndian {
binary format f -3.402825e+38
-} \xFF\x7F\xFF\xFF
+} \xFF\x80\x00\x00
test binary-13.13 {Tcl_BinaryObjCmd: float overflow} littleEndian {
binary format f -3.402825e+38
-} \xFF\xFF\x7F\xFF
+} \x00\x00\x80\xFF
test binary-13.14 {Tcl_BinaryObjCmd: float underflow} bigEndian {
binary format f -3.402825e-100
} \x80\x00\x00\x00
@@ -537,6 +537,18 @@ test binary-13.19 {Tcl_BinaryObjCmd: format} littleEndian {
set a {1.6 3.4}
binary format f1 $a
} \xCD\xCC\xCC\x3F
+test binary-13.20 {Tcl_BinaryObjCmd: format float Inf} bigEndian {
+ binary format f Inf
+} \x7F\x80\x00\x00
+test binary-13.21 {Tcl_BinaryObjCmd: format float Inf} littleEndian {
+ binary format f Inf
+} \x00\x00\x80\x7F
+test binary-13.22 {Tcl_BinaryObjCmd: format float -Inf} bigEndian {
+ binary format f -Inf
+} \xFF\x80\x00\x00
+test binary-13.23 {Tcl_BinaryObjCmd: format float -Inf} littleEndian {
+ binary format f -Inf
+} \x00\x00\x80\xFF
test binary-14.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body {
binary format d
@@ -767,7 +779,7 @@ test binary-21.13 {Tcl_BinaryObjCmd: scan} -setup {
} -body {
list [binary scan "abc def \x00 " C* arg1] $arg1
} -result {1 {abc def }}
-test binary-21.12 {Tcl_BinaryObjCmd: scan} -setup {
+test binary-21.14 {Tcl_BinaryObjCmd: scan} -setup {
unset -nocomplain arg1
} -body {
list [binary scan "abc def \x00ghi" C* arg1] $arg1
@@ -1975,10 +1987,10 @@ test binary-53.11 {Tcl_BinaryObjCmd: format} {} {
} \xCD\xCC\xCC\x3F\x9A\x99\x59\x40
test binary-53.12 {Tcl_BinaryObjCmd: float overflow} {} {
binary format R -3.402825e+38
-} \xFF\x7F\xFF\xFF
+} \xFF\x80\x00\x00
test binary-53.13 {Tcl_BinaryObjCmd: float overflow} {} {
binary format r -3.402825e+38
-} \xFF\xFF\x7F\xFF
+} \x00\x00\x80\xFF
test binary-53.14 {Tcl_BinaryObjCmd: float underflow} {} {
binary format R -3.402825e-100
} \x80\x00\x00\x00
@@ -2000,6 +2012,39 @@ test binary-53.19 {Tcl_BinaryObjCmd: format} {} {
set a {1.6 3.4}
binary format r1 $a
} \xCD\xCC\xCC\x3F
+test binary-53.20 {Tcl_BinaryObjCmd: float Inf} {} {
+ binary format R Inf
+} \x7f\x80\x00\x00
+test binary-53.21 {Tcl_BinaryObjCmd: float Inf} {} {
+ binary format r Inf
+} \x00\x00\x80\x7f
+test binary-53.22 {Binary float Inf round trip} -body {
+ binary scan [binary format R Inf] R inf
+ binary scan [binary format R -Inf] R inf_
+ list $inf $inf_
+} -result {Inf -Inf}
+test binary-53.23 {Binary float round to FLT_MAX} -body {
+ binary scan [binary format H* 7f7fffff] R fltmax
+ binary scan [binary format H* 47effffff0000000] Q round_to_fltmax
+ binary scan [binary format R $round_to_fltmax] R fltmax1
+ expr {$fltmax eq $fltmax1}
+} -result 1
+test binary-53.24 {Binary float round to -FLT_MAX} -body {
+ binary scan [binary format H* ff7fffff] R fltmax
+ binary scan [binary format H* c7effffff0000000] Q round_to_fltmax
+ binary scan [binary format R $round_to_fltmax] R fltmax1
+ expr {$fltmax eq $fltmax1}
+} -result 1
+test binary-53.25 {Binary float round to Inf} -body {
+ binary scan [binary format H* 47effffff0000001] Q round_to_inf
+ binary scan [binary format R $round_to_inf] R inf1
+ expr {$inf1 eq Inf}
+} -result 1
+test binary-53.26 {Binary float round to -Inf} -body {
+ binary scan [binary format H* c7effffff0000001] Q round_to_inf
+ binary scan [binary format R $round_to_inf] R inf1
+ expr {$inf1 eq -Inf}
+} -result 1
# scan t (s)
test binary-54.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body {
@@ -2396,11 +2441,27 @@ test binary-62.4 {infinity} ieeeFloatingPoint {
format 0x%016lx $w
} 0xfff0000000000000
test binary-62.5 {infinity} ieeeFloatingPoint {
- binary scan [binary format w 0x7ff0000000000000] q d
+ binary scan [binary format w 0x7FF0000000000000] q d
set d
} Inf
test binary-62.6 {infinity} ieeeFloatingPoint {
- binary scan [binary format w 0xfff0000000000000] q d
+ binary scan [binary format w 0xFFF0000000000000] q d
+ set d
+} -Inf
+test binary-62.7 {infinity} ieeeFloatingPoint {
+ binary scan [binary format r Inf] iu i
+ format 0x%08x $i
+} 0x7f800000
+test binary-62.8 {infinity} ieeeFloatingPoint {
+ binary scan [binary format r -Inf] iu i
+ format 0x%08x $i
+} 0xff800000
+test binary-62.9 {infinity} ieeeFloatingPoint {
+ binary scan [binary format i 0x7F800000] r d
+ set d
+} Inf
+test binary-62.10 {infinity} ieeeFloatingPoint {
+ binary scan [binary format i 0xFF800000] r d
set d
} -Inf
@@ -2408,19 +2469,19 @@ test binary-62.6 {infinity} ieeeFloatingPoint {
test binary-63.1 {NaN} ieeeFloatingPoint {
binary scan [binary format q NaN] w w
- format 0x%016lx [expr {$w & 0xfff3ffffffffffff}]
+ format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}]
} 0x7ff0000000000000
test binary-63.2 {NaN} ieeeFloatingPoint {
binary scan [binary format q -NaN] w w
- format 0x%016lx [expr {$w & 0xfff3ffffffffffff}]
+ format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}]
} 0xfff0000000000000
test binary-63.3 {NaN} ieeeFloatingPoint {
binary scan [binary format q NaN(3123456789aBc)] w w
- format 0x%016lx [expr {$w & 0xfff3ffffffffffff}]
+ format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}]
} 0x7ff3123456789abc
test binary-63.4 {NaN} ieeeFloatingPoint {
binary scan [binary format q {NaN( 3123456789aBc)}] w w
- format 0x%016lx [expr {$w & 0xfff3ffffffffffff}]
+ format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}]
} 0x7ff3123456789abc
# Make sure TclParseNumber() rejects invalid nan-hex formats [Bug 3402540]
diff --git a/tests/chan.test b/tests/chan.test
index 4155c36..946e424 100644
--- a/tests/chan.test
+++ b/tests/chan.test
@@ -12,6 +12,8 @@ if {"::tcltest" ni [namespace children]} {
namespace import -force ::tcltest::*
}
+package require tcltests
+
#
# Note: The tests for the chan methods "create" and "postevent"
# currently reside in the file "ioCmd.test".
@@ -49,19 +51,19 @@ test chan-4.1 {chan command: configure subcommand} -body {
} -returnCodes error -result "wrong # args: should be \"chan configure channelId ?-option value ...?\""
test chan-4.2 {chan command: [Bug 800753]} -body {
chan configure stdout -eofchar Ā
-} -returnCodes error -match glob -result {bad value*}
+} -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character}
test chan-4.3 {chan command: [Bug 800753]} -body {
chan configure stdout -eofchar \x00
-} -returnCodes error -match glob -result {bad value*}
-test chan-4.4 {chan command: check valid inValue, no outValue} -body {
+} -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character}
+test chan-4.4 {chan command: check valid inValue, no outValue} -constraints deprecated -body {
chan configure stdout -eofchar [list \x27 {}]
} -result {}
test chan-4.5 {chan command: check valid inValue, invalid outValue} -body {
chan configure stdout -eofchar [list \x27 \x80]
-} -returnCodes error -match glob -result {bad value for -eofchar:*}
+} -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character}
test chan-4.6 {chan command: check no inValue, valid outValue} -body {
chan configure stdout -eofchar [list {} \x27]
-} -result {} -cleanup {chan configure stdout -eofchar [list {} {}]}
+} -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character} -cleanup {chan configure stdout -eofchar {}}
test chan-5.1 {chan command: copy subcommand} -body {
chan copy foo
diff --git a/tests/chanio.test b/tests/chanio.test
index c1085f4..41c0ef7 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -1889,13 +1889,13 @@ test chan-io-20.2 {Tcl_CreateChannel: initial settings} -constraints {win} -body
list [chan configure $f -eofchar] [chan configure $f -translation]
} -cleanup {
chan close $f
-} -result [list [list \x1A ""] {auto crlf}]
+} -result {{} {auto crlf}}
test chan-io-20.3 {Tcl_CreateChannel: initial settings} -constraints {unix} -body {
set f [open $path(test1) w+]
list [chan configure $f -eofchar] [chan configure $f -translation]
} -cleanup {
chan close $f
-} -result {{{} {}} {auto lf}}
+} -result {{} {auto lf}}
test chan-io-20.5 {Tcl_CreateChannel: install channel in empty slot} -setup {
set path(stdout) [makeFile {} stdout]
} -constraints {stdio notWinCI} -body {
@@ -4657,7 +4657,7 @@ test chan-io-35.6 {Tcl_Eof, eof char, lf write, auto read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {9 8 1}
+} -result {8 8 1}
test chan-io-35.7 {Tcl_Eof, eof char, lf write, lf read} -setup {
file delete $path(test1)
} -body {
@@ -4671,7 +4671,7 @@ test chan-io-35.7 {Tcl_Eof, eof char, lf write, lf read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {9 8 1}
+} -result {8 8 1}
test chan-io-35.8 {Tcl_Eof, eof char, cr write, auto read} -setup {
file delete $path(test1)
} -body {
@@ -4685,7 +4685,7 @@ test chan-io-35.8 {Tcl_Eof, eof char, cr write, auto read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {9 8 1}
+} -result {8 8 1}
test chan-io-35.9 {Tcl_Eof, eof char, cr write, cr read} -setup {
file delete $path(test1)
} -body {
@@ -4699,7 +4699,7 @@ test chan-io-35.9 {Tcl_Eof, eof char, cr write, cr read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {9 8 1}
+} -result {8 8 1}
test chan-io-35.10 {Tcl_Eof, eof char, crlf write, auto read} -setup {
file delete $path(test1)
} -body {
@@ -4713,7 +4713,7 @@ test chan-io-35.10 {Tcl_Eof, eof char, crlf write, auto read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {11 8 1}
+} -result {10 8 1}
test chan-io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} -setup {
file delete $path(test1)
} -body {
@@ -4727,7 +4727,7 @@ test chan-io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {11 8 1}
+} -result {10 8 1}
test chan-io-35.12 {Tcl_Eof, eof char in middle, lf write, auto read} -setup {
file delete $path(test1)
} -body {
@@ -5285,29 +5285,29 @@ test chan-io-39.21 {Tcl_SetChannelOption, setting read mode independently} \
test chan-io-39.22 {Tcl_SetChannelOption, invariance} -setup {
file delete $path(test1)
set l ""
-} -constraints {unix} -body {
+} -constraints {unix deprecated} -body {
set f1 [open $path(test1) w+]
lappend l [chan configure $f1 -eofchar]
- chan configure $f1 -eofchar {ON GO}
+ chan configure $f1 -eofchar {O {}}
lappend l [chan configure $f1 -eofchar]
chan configure $f1 -eofchar D
lappend l [chan configure $f1 -eofchar]
} -cleanup {
chan close $f1
-} -result {{{} {}} {O G} {D D}}
+} -result {{} O D}
test chan-io-39.22a {Tcl_SetChannelOption, invariance} -setup {
file delete $path(test1)
set l [list]
-} -body {
+} -constraints deprecated -body {
set f1 [open $path(test1) w+]
- chan configure $f1 -eofchar {ON GO}
+ chan configure $f1 -eofchar {O {}}
lappend l [chan configure $f1 -eofchar]
chan configure $f1 -eofchar D
lappend l [chan configure $f1 -eofchar]
lappend l [list [catch {chan configure $f1 -eofchar {1 2 3}} msg] $msg]
} -cleanup {
chan close $f1
-} -result {{O G} {D D} {1 {bad value for -eofchar: should be a list of zero, one, or two elements}}}
+} -result {O D {1 {bad value for -eofchar: must be non-NUL ASCII character}}}
test chan-io-39.23 {Tcl_GetChannelOption, server socket is not readable or\
writeable, it should still have valid -eofchar and -translation options} -setup {
set l [list]
@@ -5317,7 +5317,7 @@ test chan-io-39.23 {Tcl_GetChannelOption, server socket is not readable or\
[chan configure $sock -translation]
} -cleanup {
chan close $sock
-} -result {{{}} auto}
+} -result {{} auto}
test chan-io-39.24 {Tcl_SetChannelOption, server socket is not readable or\
writable so we can't change -eofchar or -translation} -setup {
set l [list]
@@ -5328,7 +5328,7 @@ test chan-io-39.24 {Tcl_SetChannelOption, server socket is not readable or\
[chan configure $sock -translation]
} -cleanup {
chan close $sock
-} -result {{{}} auto}
+} -result {{} auto}
test chan-io-40.1 {POSIX open access modes: RDWR} -setup {
file delete $path(test3)
diff --git a/tests/encoding.test b/tests/encoding.test
index 1b13318..49570d3 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -844,6 +844,17 @@ runtests
}
+test encoding-29.0 {get encoding nul terminator lengths} -constraints {
+ testencoding
+} -body {
+ list \
+ [testencoding nullength ascii] \
+ [testencoding nullength utf-16] \
+ [testencoding nullength utf-32] \
+ [testencoding nullength gb12345] \
+ [testencoding nullength ksc5601]
+} -result {1 2 4 2 2}
+
# cleanup
namespace delete ::tcl::test::encoding
::tcltest::cleanupTests
diff --git a/tests/env.test b/tests/env.test
index dcf5ab4..bbf7985 100644
--- a/tests/env.test
+++ b/tests/env.test
@@ -106,8 +106,8 @@ variable keep {
__CF_USER_TEXT_ENCODING SECURITYSESSIONID LANG WINDIR TERM
CommonProgramFiles CommonProgramFiles(x86) ProgramFiles
ProgramFiles(x86) CommonProgramW6432 ProgramW6432
- WINECONFIGDIR WINEDATADIR WINEDLLDIR0 WINEHOMEDIR PROCESSOR_ARCHITECTURE
- USERPROFILE
+ PROCESSOR_ARCHITECTURE PROCESSOR_ARCHITEW6432 USERPROFILE
+ WINECONFIGDIR WINEDATADIR WINEDLLDIR0 WINEHOMEDIR
}
variable printenvScript [makeFile [string map [list @keep@ [list $keep]] {
diff --git a/tests/http.test b/tests/http.test
index 11bf0f9..3c2f4d8 100644
--- a/tests/http.test
+++ b/tests/http.test
@@ -46,6 +46,7 @@ if {![file exists $httpdFile]} {
catch {package require Thread 2.7-}
if {[catch {package present Thread}] == 0 && [file exists $httpdFile]} {
set httpthread [thread::create -preserved]
+ lappend threadStack [list thread::release $httpthread]
thread::send $httpthread [list source $httpdFile]
thread::send $httpthread [list set bindata $bindata]
thread::send $httpthread {httpd_init 0; set port} port
@@ -63,6 +64,7 @@ if {[catch {package present Thread}] == 0 && [file exists $httpdFile]} {
catch {unset port}
return
}
+ set threadStack {}
}
if {![info exists ThreadLevel]} {
@@ -77,6 +79,9 @@ if {![info exists ThreadLevel]} {
foreach ThreadLevel $ValueRange {
source [info script]
}
+ if {[llength $threadStack]} {
+ eval [lpop threadStack]
+ }
catch {unset ThreadLevel}
catch {unset ValueRange}
return
@@ -85,17 +90,17 @@ if {![info exists ThreadLevel]} {
catch {puts "==== Test with ThreadLevel $ThreadLevel ===="}
http::config -threadlevel $ThreadLevel
-test http-1.1 {http::config} {
+test http-1.1.$ThreadLevel {http::config} {
http::config -useragent UserAgent
http::config
-} [list -accept */* -cookiejar {} -pipeline 1 -postfresh 0 -proxyfilter http::ProxyRequired -proxyhost {} -proxyport {} -repost 0 -threadlevel $ThreadLevel -urlencoding utf-8 -useragent UserAgent -zip 1]
-test http-1.2 {http::config} {
+} [list -accept */* -cookiejar {} -pipeline 1 -postfresh 0 -proxyauth {} -proxyfilter http::ProxyRequired -proxyhost {} -proxynot {} -proxyport {} -repost 0 -threadlevel $ThreadLevel -urlencoding utf-8 -useragent UserAgent -zip 1]
+test http-1.2.$ThreadLevel {http::config} {
http::config -proxyfilter
} http::ProxyRequired
-test http-1.3 {http::config} {
+test http-1.3.$ThreadLevel {http::config} {
catch {http::config -junk}
} 1
-test http-1.4 {http::config} {
+test http-1.4.$ThreadLevel {http::config} {
set savedconf [http::config]
http::config -proxyhost nowhere.come -proxyport 8080 \
-proxyfilter myFilter -useragent "Tcl Test Suite" \
@@ -103,11 +108,11 @@ test http-1.4 {http::config} {
set x [http::config]
http::config {*}$savedconf
set x
-} [list -accept */* -cookiejar {} -pipeline 1 -postfresh 0 -proxyfilter myFilter -proxyhost nowhere.come -proxyport 8080 -repost 0 -threadlevel $ThreadLevel -urlencoding iso8859-1 -useragent {Tcl Test Suite} -zip 1]
-test http-1.5 {http::config} -returnCodes error -body {
+} [list -accept */* -cookiejar {} -pipeline 1 -postfresh 0 -proxyauth {} -proxyfilter myFilter -proxyhost nowhere.come -proxynot {} -proxyport 8080 -repost 0 -threadlevel $ThreadLevel -urlencoding iso8859-1 -useragent {Tcl Test Suite} -zip 1]
+test http-1.5.$ThreadLevel {http::config} -returnCodes error -body {
http::config -proxyhost {} -junk 8080
-} -result {Unknown option -junk, must be: -accept, -cookiejar, -pipeline, -postfresh, -proxyfilter, -proxyhost, -proxyport, -repost, -threadlevel, -urlencoding, -useragent, -zip}
-test http-1.6 {http::config} -setup {
+} -result {Unknown option -junk, must be: -accept, -cookiejar, -pipeline, -postfresh, -proxyauth, -proxyfilter, -proxyhost, -proxynot, -proxyport, -repost, -threadlevel, -urlencoding, -useragent, -zip}
+test http-1.6.$ThreadLevel {http::config} -setup {
set oldenc [http::config -urlencoding]
} -body {
set enc [list [http::config -urlencoding]]
@@ -117,42 +122,42 @@ test http-1.6 {http::config} -setup {
http::config -urlencoding $oldenc
} -result {utf-8 iso8859-1}
-test http-2.1 {http::reset} {
+test http-2.1.$ThreadLevel {http::reset} {
catch {http::reset http#1}
} 0
-test http-2.2 {http::CharsetToEncoding} {
+test http-2.2.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding iso-8859-11
} iso8859-11
-test http-2.3 {http::CharsetToEncoding} {
+test http-2.3.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding iso-2022-kr
} iso2022-kr
-test http-2.4 {http::CharsetToEncoding} {
+test http-2.4.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding shift-jis
} shiftjis
-test http-2.5 {http::CharsetToEncoding} {
+test http-2.5.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding windows-437
} cp437
-test http-2.6 {http::CharsetToEncoding} {
+test http-2.6.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding latin5
} iso8859-9
-test http-2.7 {http::CharsetToEncoding} {
+test http-2.7.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding latin1
} iso8859-1
-test http-2.8 {http::CharsetToEncoding} {
+test http-2.8.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding latin4
} binary
-test http-3.1 {http::geturl} -returnCodes error -body {
+test http-3.1.$ThreadLevel {http::geturl} -returnCodes error -body {
http::geturl -bogus flag
} -result {Unknown option flag, can be: -binary, -blocksize, -channel, -command, -guesstype, -handler, -headers, -keepalive, -method, -myaddr, -progress, -protocol, -query, -queryblocksize, -querychannel, -queryprogress, -strict, -timeout, -type, -validate}
-test http-3.2 {http::geturl} -returnCodes error -body {
+test http-3.2.$ThreadLevel {http::geturl} -returnCodes error -body {
http::geturl http:junk
} -result {Unsupported URL: http:junk}
set url //${::HOST}:$port
set badurl //${::HOST}:[expr {$port+1}]
-test http-3.3 {http::geturl} -body {
+test http-3.3.$ThreadLevel {http::geturl} -body {
set token [http::geturl $url]
http::data $token
} -cleanup {
@@ -172,7 +177,7 @@ set badposturl //${::HOST}:$port/droppost
set authorityurl //${::HOST}:$port
set ipv6url http://\[::1\]:$port/
-test http-3.4 {http::geturl} -body {
+test http-3.4.$ThreadLevel {http::geturl} -body {
set token [http::geturl $url]
http::data $token
} -cleanup {
@@ -185,7 +190,7 @@ proc selfproxy {host} {
global port
return [list ${::HOST} $port]
}
-test http-3.5 {http::geturl} -body {
+test http-3.5.$ThreadLevel {http::geturl} -body {
http::config -proxyfilter selfproxy
set token [http::geturl $url]
http::data $token
@@ -196,7 +201,7 @@ test http-3.5 {http::geturl} -body {
<h1>Hello, World!</h1>
<h2>GET http:$url</h2>
</body></html>"
-test http-3.6 {http::geturl} -body {
+test http-3.6.$ThreadLevel {http::geturl} -body {
http::config -proxyfilter bogus
set token [http::geturl $url]
http::data $token
@@ -207,7 +212,7 @@ test http-3.6 {http::geturl} -body {
<h1>Hello, World!</h1>
<h2>GET $tail</h2>
</body></html>"
-test http-3.7 {http::geturl} -body {
+test http-3.7.$ThreadLevel {http::geturl} -body {
set token [http::geturl $url -headers {Pragma no-cache}]
http::data $token
} -cleanup {
@@ -216,7 +221,7 @@ test http-3.7 {http::geturl} -body {
<h1>Hello, World!</h1>
<h2>GET $tail</h2>
</body></html>"
-test http-3.8 {http::geturl} -body {
+test http-3.8.$ThreadLevel {http::geturl} -body {
set token [http::geturl $url -query Name=Value&Foo=Bar -timeout 3000]
http::data $token
} -cleanup {
@@ -230,13 +235,13 @@ test http-3.8 {http::geturl} -body {
<dt>Foo<dd>Bar
</dl>
</body></html>"
-test http-3.9 {http::geturl} -body {
+test http-3.9.$ThreadLevel {http::geturl} -body {
set token [http::geturl $url -validate 1]
http::code $token
} -cleanup {
http::cleanup $token
} -result "HTTP/1.0 200 OK"
-test http-3.10 {http::geturl queryprogress} -setup {
+test http-3.10.$ThreadLevel {http::geturl queryprogress} -setup {
set query foo=bar
set sep ""
set i 0
@@ -259,7 +264,7 @@ test http-3.10 {http::geturl queryprogress} -setup {
} -cleanup {
http::cleanup $t
} -result {ok 122879 {16384 32768 49152 65536 81920 98304 114688 122879} {Got 122879 bytes}}
-test http-3.11 {http::geturl querychannel with -command} -setup {
+test http-3.11.$ThreadLevel {http::geturl querychannel with -command} -setup {
set query foo=bar
set sep ""
set i 0
@@ -298,7 +303,7 @@ test http-3.11 {http::geturl querychannel with -command} -setup {
# The status is "eof".
# On Windows, the http::wait procedure gets a "connection reset by peer" error
# while reading the reply.
-test http-3.12 {http::geturl querychannel with aborted request} -setup {
+test http-3.12.$ThreadLevel {http::geturl querychannel with aborted request} -setup {
set query foo=bar
set sep ""
set i 0
@@ -336,7 +341,7 @@ test http-3.12 {http::geturl querychannel with aborted request} -setup {
removeFile outdata
http::cleanup $t
} -result {ok {HTTP/1.0 200 Data follows}}
-test http-3.13 {http::geturl socket leak test} {
+test http-3.13.$ThreadLevel {http::geturl socket leak test} {
set chanCount [llength [file channels]]
for {set i 0} {$i < 3} {incr i} {
catch {http::geturl $badurl -timeout 5000}
@@ -344,43 +349,43 @@ test http-3.13 {http::geturl socket leak test} {
# No extra channels should be taken
expr {[llength [file channels]] == $chanCount}
} 1
-test http-3.14 "http::geturl $fullurl" -body {
+test http-3.14.$ThreadLevel "http::geturl $fullurl" -body {
set token [http::geturl $fullurl -validate 1]
http::code $token
} -cleanup {
http::cleanup $token
} -result "HTTP/1.0 200 OK"
-test http-3.15 {http::geturl parse failures} -body {
+test http-3.15.$ThreadLevel {http::geturl parse failures} -body {
http::geturl "{invalid}:url"
} -returnCodes error -result {Unsupported URL: {invalid}:url}
-test http-3.16 {http::geturl parse failures} -body {
+test http-3.16.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http:relative/url
} -returnCodes error -result {Unsupported URL: http:relative/url}
-test http-3.17 {http::geturl parse failures} -body {
+test http-3.17.$ThreadLevel {http::geturl parse failures} -body {
http::geturl /absolute/url
} -returnCodes error -result {Missing host part: /absolute/url}
-test http-3.18 {http::geturl parse failures} -body {
+test http-3.18.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://somewhere:123456789/
} -returnCodes error -result {Invalid port number: 123456789}
-test http-3.19 {http::geturl parse failures} -body {
+test http-3.19.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://{user}@somewhere
} -returnCodes error -result {Illegal characters in URL user}
-test http-3.20 {http::geturl parse failures} -body {
+test http-3.20.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://%user@somewhere
} -returnCodes error -result {Illegal encoding character usage "%us" in URL user}
-test http-3.21 {http::geturl parse failures} -body {
+test http-3.21.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://somewhere/{path}
} -returnCodes error -result {Illegal characters in URL path}
-test http-3.22 {http::geturl parse failures} -body {
+test http-3.22.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://somewhere/%path
} -returnCodes error -result {Illegal encoding character usage "%pa" in URL path}
-test http-3.23 {http::geturl parse failures} -body {
+test http-3.23.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://somewhere/path?{query}?
} -returnCodes error -result {Illegal characters in URL path}
-test http-3.24 {http::geturl parse failures} -body {
+test http-3.24.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://somewhere/path?%query
} -returnCodes error -result {Illegal encoding character usage "%qu" in URL path}
-test http-3.25 {http::meta} -setup {
+test http-3.25.$ThreadLevel {http::meta} -setup {
unset -nocomplain m token
} -body {
set token [http::geturl $url -timeout 3000]
@@ -390,7 +395,7 @@ test http-3.25 {http::meta} -setup {
http::cleanup $token
unset -nocomplain m token
} -result {content-length content-type date}
-test http-3.26 {http::meta} -setup {
+test http-3.26.$ThreadLevel {http::meta} -setup {
unset -nocomplain m token
} -body {
set token [http::geturl $url -headers {X-Check 1} -timeout 3000]
@@ -400,7 +405,7 @@ test http-3.26 {http::meta} -setup {
http::cleanup $token
unset -nocomplain m token
} -result {content-length content-type date x-check}
-test http-3.27 {http::geturl: -headers override -type} -body {
+test http-3.27.$ThreadLevel {http::geturl: -headers override -type} -body {
set token [http::geturl $url/headers -type "text/plain" -query dummy \
-headers [list "Content-Type" "text/plain;charset=utf-8"]]
http::data $token
@@ -413,7 +418,7 @@ Accept \*/\*
Accept-Encoding .*
Connection close
Content-Length 5}
-test http-3.28 {http::geturl: -headers override -type default} -body {
+test http-3.28.$ThreadLevel {http::geturl: -headers override -type default} -body {
set token [http::geturl $url/headers -query dummy \
-headers [list "Content-Type" "text/plain;charset=utf-8"]]
http::data $token
@@ -426,7 +431,7 @@ Accept \*/\*
Accept-Encoding .*
Connection close
Content-Length 5}
-test http-3.29 {http::geturl IPv6 address} -body {
+test http-3.29.$ThreadLevel {http::geturl IPv6 address} -body {
# We only want to see if the URL gets parsed correctly. This is
# the case if http::geturl succeeds or returns a socket related
# error. If the parsing is wrong, we'll get a parse error.
@@ -440,20 +445,20 @@ test http-3.29 {http::geturl IPv6 address} -body {
} -cleanup {
catch { http::cleanup $token }
} -result 0
-test http-3.30 {http::geturl query without path} -body {
+test http-3.30.$ThreadLevel {http::geturl query without path} -body {
set token [http::geturl $authorityurl?var=val]
http::ncode $token
} -cleanup {
catch { http::cleanup $token }
} -result 200
-test http-3.31 {http::geturl fragment without path} -body {
+test http-3.31.$ThreadLevel {http::geturl fragment without path} -body {
set token [http::geturl "$authorityurl#fragment42"]
http::ncode $token
} -cleanup {
catch { http::cleanup $token }
} -result 200
# Bug c11a51c482
-test http-3.32 {http::geturl: -headers override -accept default} -body {
+test http-3.32.$ThreadLevel {http::geturl: -headers override -accept default} -body {
set token [http::geturl $url/headers -query dummy \
-headers [list "Accept" "text/plain,application/tcl-test-value"]]
http::data $token
@@ -467,20 +472,20 @@ Connection close
Content-Type application/x-www-form-urlencoded
Content-Length 5}
# Bug 838e99a76d
-test http-3.33 {http::geturl application/xml is text} -body {
+test http-3.33.$ThreadLevel {http::geturl application/xml is text} -body {
set token [http::geturl "$xmlurl"]
scan [http::data $token] "<%\[^>]>%c<%\[^>]>"
} -cleanup {
catch { http::cleanup $token }
} -result {test 4660 /test}
-test http-3.34 {http::geturl -headers not a list} -returnCodes error -body {
+test http-3.34.$ThreadLevel {http::geturl -headers not a list} -returnCodes error -body {
http::geturl http://test/t -headers \"
} -result {Bad value for -headers ("), must be list}
-test http-3.35 {http::geturl -headers not even number of elements} -returnCodes error -body {
+test http-3.35.$ThreadLevel {http::geturl -headers not even number of elements} -returnCodes error -body {
http::geturl http://test/t -headers {List Length 3}
} -result {Bad value for -headers (List Length 3), number of list elements must be even}
-test http-4.1 {http::Event} -body {
+test http-4.1.$ThreadLevel {http::Event} -body {
set token [http::geturl $url -keepalive 0]
upvar #0 $token data
array set meta $data(meta)
@@ -488,7 +493,7 @@ test http-4.1 {http::Event} -body {
} -cleanup {
http::cleanup $token
} -result 1
-test http-4.2 {http::Event} -body {
+test http-4.2.$ThreadLevel {http::Event} -body {
set token [http::geturl $url]
upvar #0 $token data
array set meta $data(meta)
@@ -496,13 +501,13 @@ test http-4.2 {http::Event} -body {
} -cleanup {
http::cleanup $token
} -result 0
-test http-4.3 {http::Event} -body {
+test http-4.3.$ThreadLevel {http::Event} -body {
set token [http::geturl $url]
http::code $token
} -cleanup {
http::cleanup $token
} -result {HTTP/1.0 200 Data follows}
-test http-4.4 {http::Event} -setup {
+test http-4.4.$ThreadLevel {http::Event} -setup {
set testfile [makeFile "" testfile]
} -body {
set out [open $testfile w]
@@ -519,7 +524,7 @@ test http-4.4 {http::Event} -setup {
<h1>Hello, World!</h1>
<h2>GET $tail</h2>
</body></html>"
-test http-4.5 {http::Event} -setup {
+test http-4.5.$ThreadLevel {http::Event} -setup {
set testfile [makeFile "" testfile]
} -body {
set out [open $testfile w]
@@ -532,7 +537,7 @@ test http-4.5 {http::Event} -setup {
removeFile $testfile
http::cleanup $token
} -result 1
-test http-4.6 {http::Event} -setup {
+test http-4.6.$ThreadLevel {http::Event} -setup {
set testfile [makeFile "" testfile]
} -body {
set out [open $testfile w]
@@ -554,29 +559,29 @@ proc myProgress {token total current} {
}
set progress [list $total $current]
}
-test http-4.6.1 {http::Event} knownBug {
+test http-4.6.1.$ThreadLevel {http::Event} knownBug {
set token [http::geturl $url -blocksize 50 -progress myProgress]
return $progress
} {111 111}
-test http-4.7 {http::Event} -body {
+test http-4.7.$ThreadLevel {http::Event} -body {
set token [http::geturl $url -keepalive 0 -progress myProgress]
return $progress
} -cleanup {
http::cleanup $token
} -result {111 111}
-test http-4.8 {http::Event} -body {
+test http-4.8.$ThreadLevel {http::Event} -body {
set token [http::geturl $url]
http::status $token
} -cleanup {
http::cleanup $token
} -result {ok}
-test http-4.9 {http::Event} -body {
+test http-4.9.$ThreadLevel {http::Event} -body {
set token [http::geturl $url -progress myProgress]
http::code $token
} -cleanup {
http::cleanup $token
} -result {HTTP/1.0 200 Data follows}
-test http-4.10 {http::Event} -body {
+test http-4.10.$ThreadLevel {http::Event} -body {
set token [http::geturl $url -progress myProgress]
http::size $token
} -cleanup {
@@ -586,7 +591,7 @@ test http-4.10 {http::Event} -body {
# Timeout cases
# Short timeout to working server (the test server). This lets us try a
# reset during the connection.
-test http-4.11 {http::Event} -body {
+test http-4.11.$ThreadLevel {http::Event} -body {
set token [http::geturl $url -timeout 1 -keepalive 0 -command \#]
http::reset $token
http::status $token
@@ -595,7 +600,7 @@ test http-4.11 {http::Event} -body {
} -result {reset}
# Longer timeout with reset.
-test http-4.12 {http::Event} -body {
+test http-4.12.$ThreadLevel {http::Event} -body {
set token [http::geturl $url/?timeout=10 -keepalive 0 -command \#]
http::reset $token
http::status $token
@@ -605,7 +610,7 @@ test http-4.12 {http::Event} -body {
# Medium timeout to working server that waits even longer. The timeout
# hits while waiting for a reply.
-test http-4.13 {http::Event} -body {
+test http-4.13.$ThreadLevel {http::Event} -body {
set token [http::geturl $url?timeout=30 -keepalive 0 -timeout 10 -command \#]
http::wait $token
http::status $token
@@ -615,7 +620,7 @@ test http-4.13 {http::Event} -body {
# Longer timeout to good host, bad port, gets an error after the
# connection "completes" but the socket is bad.
-test http-4.14 {http::Event} -body {
+test http-4.14.$ThreadLevel {http::Event} -body {
set token [http::geturl $badurl/?timeout=10 -timeout 10000 -command \#]
if {$token eq ""} {
error "bogus return from http::geturl"
@@ -627,10 +632,13 @@ test http-4.14 {http::Event} -body {
} -result {connect failed connection refused}
# Bogus host
-test http-4.15 {http::Event} -body {
+test http-4.15.$ThreadLevel {http::Event} -body {
# This test may fail if you use a proxy server. That is to be
# expected and is not a problem with Tcl.
- set token [http::geturl //not_a_host.tcl.tk -timeout 3000 -command \#]
+ # With http::config -threadlevel 1 or 2, the script enters the event loop
+ # during the DNS lookup, and has the opportunity to time out.
+ # Increase -timeout from 3000 to 10000 to prevent this.
+ set token [http::geturl //not_a_host.tcl.tk -timeout 10000 -command \#]
http::wait $token
set result "[http::status $token] -- [lindex [http::error $token] 0]"
# error codes vary among platforms.
@@ -638,7 +646,7 @@ test http-4.15 {http::Event} -body {
catch {http::cleanup $token}
} -match glob -result "error -- couldn't open socket*"
-test http-4.16 {Leak with Close vs Keepalive (bug [6ca52aec14]} -setup {
+test http-4.16.$ThreadLevel {Leak with Close vs Keepalive (bug [6ca52aec14]} -setup {
proc list-difference {l1 l2} {
lmap item $l2 {if {$item in $l1} continue; set item}
}
@@ -653,17 +661,17 @@ test http-4.16 {Leak with Close vs Keepalive (bug [6ca52aec14]} -setup {
rename list-difference {}
} -result {}
-test http-5.1 {http::formatQuery} {
+test http-5.1.$ThreadLevel {http::formatQuery} {
http::formatQuery name1 value1 name2 "value two"
} {name1=value1&name2=value%20two}
# test http-5.2 obsoleted by 5.4 and 5.5 with http 2.5
-test http-5.3 {http::formatQuery} {
+test http-5.3.$ThreadLevel {http::formatQuery} {
http::formatQuery lines "line1\nline2\nline3"
} {lines=line1%0D%0Aline2%0D%0Aline3}
-test http-5.4 {http::formatQuery} {
+test http-5.4.$ThreadLevel {http::formatQuery} {
http::formatQuery name1 ~bwelch name2 ¡¢¢
} {name1=~bwelch&name2=%C2%A1%C2%A2%C2%A2}
-test http-5.5 {http::formatQuery} {
+test http-5.5.$ThreadLevel {http::formatQuery} {
set enc [http::config -urlencoding]
http::config -urlencoding iso8859-1
set res [http::formatQuery name1 ~bwelch name2 ¡¢¢]
@@ -671,7 +679,7 @@ test http-5.5 {http::formatQuery} {
set res
} {name1=~bwelch&name2=%A1%A2%A2}
-test http-6.1 {http::ProxyRequired} -body {
+test http-6.1.$ThreadLevel {http::ProxyRequired} -body {
http::config -proxyhost ${::HOST} -proxyport $port
set token [http::geturl $url]
http::wait $token
@@ -685,15 +693,15 @@ test http-6.1 {http::ProxyRequired} -body {
<h2>GET http:$url</h2>
</body></html>"
-test http-7.1 {http::mapReply} {
+test http-7.1.$ThreadLevel {http::mapReply} {
http::mapReply "abc\$\[\]\"\\()\}\{"
} {abc%24%5B%5D%22%5C%28%29%7D%7B}
-test http-7.2 {http::mapReply} {
+test http-7.2.$ThreadLevel {http::mapReply} {
# RFC 2718 specifies that we pass urlencoding on utf-8 chars by default,
# so make sure this gets converted to utf-8 then urlencoded.
http::mapReply "∈"
} {%E2%88%88}
-test http-7.3 {http::formatQuery} -setup {
+test http-7.3.$ThreadLevel {http::formatQuery} -setup {
set enc [http::config -urlencoding]
} -returnCodes error -body {
# -urlencoding "" no longer supported. Use "iso8859-1".
@@ -702,7 +710,7 @@ test http-7.3 {http::formatQuery} -setup {
} -cleanup {
http::config -urlencoding $enc
} -result {unknown encoding ""}
-test http-7.4 {http::formatQuery} -setup {
+test http-7.4.$ThreadLevel {http::formatQuery} -setup {
set enc [http::config -urlencoding]
} -body {
# this would be reverting to http <=2.4 behavior w/o errors
@@ -716,113 +724,113 @@ test http-7.4 {http::formatQuery} -setup {
package require tcl::idna 1.0
-test http-idna-1.1 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.1.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna
} -result {wrong # args: should be "::tcl::idna subcommand ?arg ...?"}
-test http-idna-1.2 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.2.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna ?
} -result {unknown or ambiguous subcommand "?": must be decode, encode, puny, or version}
-test http-idna-1.3 {IDNA package: basics} -body {
+test http-idna-1.3.$ThreadLevel {IDNA package: basics} -body {
::tcl::idna version
} -result 1.0.1
-test http-idna-1.4 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.4.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna version what
} -result {wrong # args: should be "::tcl::idna version"}
-test http-idna-1.5 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.5.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny
} -result {wrong # args: should be "::tcl::idna puny subcommand ?arg ...?"}
-test http-idna-1.6 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.6.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny ?
} -result {unknown or ambiguous subcommand "?": must be decode, or encode}
-test http-idna-1.7 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.7.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny encode
} -result {wrong # args: should be "::tcl::idna puny encode string ?case?"}
-test http-idna-1.8 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.8.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny encode a b c
} -result {wrong # args: should be "::tcl::idna puny encode string ?case?"}
-test http-idna-1.9 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.9.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny decode
} -result {wrong # args: should be "::tcl::idna puny decode string ?case?"}
-test http-idna-1.10 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.10.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny decode a b c
} -result {wrong # args: should be "::tcl::idna puny decode string ?case?"}
-test http-idna-1.11 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.11.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna decode
} -result {wrong # args: should be "::tcl::idna decode hostname"}
-test http-idna-1.12 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.12.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna encode
} -result {wrong # args: should be "::tcl::idna encode hostname"}
-test http-idna-2.1 {puny encode: functional test} {
+test http-idna-2.1.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode abc
} abc-
-test http-idna-2.2 {puny encode: functional test} {
+test http-idna-2.2.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode a€b€c
} abc-k50ab
-test http-idna-2.3 {puny encode: functional test} {
+test http-idna-2.3.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode ABC
} ABC-
-test http-idna-2.4 {puny encode: functional test} {
+test http-idna-2.4.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode A€B€C
} ABC-k50ab
-test http-idna-2.5 {puny encode: functional test} {
+test http-idna-2.5.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode ABC 0
} abc-
-test http-idna-2.6 {puny encode: functional test} {
+test http-idna-2.6.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode A€B€C 0
} abc-k50ab
-test http-idna-2.7 {puny encode: functional test} {
+test http-idna-2.7.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode ABC 1
} ABC-
-test http-idna-2.8 {puny encode: functional test} {
+test http-idna-2.8.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode A€B€C 1
} ABC-k50ab
-test http-idna-2.9 {puny encode: functional test} {
+test http-idna-2.9.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode abc 0
} abc-
-test http-idna-2.10 {puny encode: functional test} {
+test http-idna-2.10.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode a€b€c 0
} abc-k50ab
-test http-idna-2.11 {puny encode: functional test} {
+test http-idna-2.11.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode abc 1
} ABC-
-test http-idna-2.12 {puny encode: functional test} {
+test http-idna-2.12.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode a€b€c 1
} ABC-k50ab
-test http-idna-2.13 {puny encode: edge cases} {
+test http-idna-2.13.$ThreadLevel {puny encode: edge cases} {
::tcl::idna puny encode ""
} ""
-test http-idna-2.14-A {puny encode: examples from RFC 3492} {
+test http-idna-2.14-A.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0644 u+064A u+0647 u+0645 u+0627 u+0628 u+062A u+0643 u+0644
u+0645 u+0648 u+0634 u+0639 u+0631 u+0628 u+064A u+061F
}]] ""]
} egbpdaj6bu4bxfgehfvwxn
-test http-idna-2.14-B {puny encode: examples from RFC 3492} {
+test http-idna-2.14-B.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+4ED6 u+4EEC u+4E3A u+4EC0 u+4E48 u+4E0D u+8BF4 u+4E2D u+6587
}]] ""]
} ihqwcrb4cv8a8dqg056pqjye
-test http-idna-2.14-C {puny encode: examples from RFC 3492} {
+test http-idna-2.14-C.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+4ED6 u+5011 u+7232 u+4EC0 u+9EBD u+4E0D u+8AAA u+4E2D u+6587
}]] ""]
} ihqwctvzc91f659drss3x8bo0yb
-test http-idna-2.14-D {puny encode: examples from RFC 3492} {
+test http-idna-2.14-D.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0050 u+0072 u+006F u+010D u+0070 u+0072 u+006F u+0073 u+0074
u+011B u+006E u+0065 u+006D u+006C u+0075 u+0076 u+00ED u+010D
u+0065 u+0073 u+006B u+0079
}]] ""]
} Proprostnemluvesky-uyb24dma41a
-test http-idna-2.14-E {puny encode: examples from RFC 3492} {
+test http-idna-2.14-E.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+05DC u+05DE u+05D4 u+05D4 u+05DD u+05E4 u+05E9 u+05D5 u+05D8
u+05DC u+05D0 u+05DE u+05D3 u+05D1 u+05E8 u+05D9 u+05DD u+05E2
u+05D1 u+05E8 u+05D9 u+05EA
}]] ""]
} 4dbcagdahymbxekheh6e0a7fei0b
-test http-idna-2.14-F {puny encode: examples from RFC 3492} {
+test http-idna-2.14-F.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+092F u+0939 u+0932 u+094B u+0917 u+0939 u+093F u+0928 u+094D
u+0926 u+0940 u+0915 u+094D u+092F u+094B u+0902 u+0928 u+0939
@@ -830,20 +838,20 @@ test http-idna-2.14-F {puny encode: examples from RFC 3492} {
u+0939 u+0948 u+0902
}]] ""]
} i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd
-test http-idna-2.14-G {puny encode: examples from RFC 3492} {
+test http-idna-2.14-G.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+306A u+305C u+307F u+3093 u+306A u+65E5 u+672C u+8A9E u+3092
u+8A71 u+3057 u+3066 u+304F u+308C u+306A u+3044 u+306E u+304B
}]] ""]
} n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa
-test http-idna-2.14-H {puny encode: examples from RFC 3492} {
+test http-idna-2.14-H.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+C138 u+ACC4 u+C758 u+BAA8 u+B4E0 u+C0AC u+B78C u+B4E4 u+C774
u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74
u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C
}]] ""]
} 989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c
-test http-idna-2.14-I {puny encode: examples from RFC 3492} {
+test http-idna-2.14-I.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+043F u+043E u+0447 u+0435 u+043C u+0443 u+0436 u+0435 u+043E
u+043D u+0438 u+043D u+0435 u+0433 u+043E u+0432 u+043E u+0440
@@ -851,7 +859,7 @@ test http-idna-2.14-I {puny encode: examples from RFC 3492} {
u+0438
}]] ""]
} b1abfaaepdrnnbgefbadotcwatmq2g4l
-test http-idna-2.14-J {puny encode: examples from RFC 3492} {
+test http-idna-2.14-J.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0050 u+006F u+0072 u+0071 u+0075 u+00E9 u+006E u+006F u+0070
u+0075 u+0065 u+0064 u+0065 u+006E u+0073 u+0069 u+006D u+0070
@@ -860,7 +868,7 @@ test http-idna-2.14-J {puny encode: examples from RFC 3492} {
u+0061 u+00F1 u+006F u+006C
}]] ""]
} PorqunopuedensimplementehablarenEspaol-fmd56a
-test http-idna-2.14-K {puny encode: examples from RFC 3492} {
+test http-idna-2.14-K.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0054 u+1EA1 u+0069 u+0073 u+0061 u+006F u+0068 u+1ECD u+006B
u+0068 u+00F4 u+006E u+0067 u+0074 u+0068 u+1EC3 u+0063 u+0068
@@ -868,135 +876,135 @@ test http-idna-2.14-K {puny encode: examples from RFC 3492} {
u+0056 u+0069 u+1EC7 u+0074
}]] ""]
} TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g
-test http-idna-2.14-L {puny encode: examples from RFC 3492} {
+test http-idna-2.14-L.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0033 u+5E74 u+0042 u+7D44 u+91D1 u+516B u+5148 u+751F
}]] ""]
} 3B-ww4c5e180e575a65lsy2b
-test http-idna-2.14-M {puny encode: examples from RFC 3492} {
+test http-idna-2.14-M.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+5B89 u+5BA4 u+5948 u+7F8E u+6075 u+002D u+0077 u+0069 u+0074
u+0068 u+002D u+0053 u+0055 u+0050 u+0045 u+0052 u+002D u+004D
u+004F u+004E u+004B u+0045 u+0059 u+0053
}]] ""]
} -with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n
-test http-idna-2.14-N {puny encode: examples from RFC 3492} {
+test http-idna-2.14-N.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0048 u+0065 u+006C u+006C u+006F u+002D u+0041 u+006E u+006F
u+0074 u+0068 u+0065 u+0072 u+002D u+0057 u+0061 u+0079 u+002D
u+305D u+308C u+305E u+308C u+306E u+5834 u+6240
}]] ""]
} Hello-Another-Way--fc4qua05auwb3674vfr0b
-test http-idna-2.14-O {puny encode: examples from RFC 3492} {
+test http-idna-2.14-O.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+3072 u+3068 u+3064 u+5C4B u+6839 u+306E u+4E0B u+0032
}]] ""]
} 2-u9tlzr9756bt3uc0v
-test http-idna-2.14-P {puny encode: examples from RFC 3492} {
+test http-idna-2.14-P.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+004D u+0061 u+006A u+0069 u+3067 u+004B u+006F u+0069 u+3059
u+308B u+0035 u+79D2 u+524D
}]] ""]
} MajiKoi5-783gue6qz075azm5e
-test http-idna-2.14-Q {puny encode: examples from RFC 3492} {
+test http-idna-2.14-Q.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+30D1 u+30D5 u+30A3 u+30FC u+0064 u+0065 u+30EB u+30F3 u+30D0
}]] ""]
} de-jg4avhby1noc0d
-test http-idna-2.14-R {puny encode: examples from RFC 3492} {
+test http-idna-2.14-R.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+305D u+306E u+30B9 u+30D4 u+30FC u+30C9 u+3067
}]] ""]
} d9juau41awczczp
-test http-idna-2.14-S {puny encode: examples from RFC 3492} {
+test http-idna-2.14-S.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode {-> $1.00 <-}
} {-> $1.00 <--}
-test http-idna-3.1 {puny decode: functional test} {
+test http-idna-3.1.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc-
} abc
-test http-idna-3.2 {puny decode: functional test} {
+test http-idna-3.2.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc-k50ab
} a€b€c
-test http-idna-3.3 {puny decode: functional test} {
+test http-idna-3.3.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC-
} ABC
-test http-idna-3.4 {puny decode: functional test} {
+test http-idna-3.4.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC-k50ab
} A€B€C
-test http-idna-3.5 {puny decode: functional test} {
+test http-idna-3.5.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC-K50AB
} A€B€C
-test http-idna-3.6 {puny decode: functional test} {
+test http-idna-3.6.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc-K50AB
} a€b€c
-test http-idna-3.7 {puny decode: functional test} {
+test http-idna-3.7.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC- 0
} abc
-test http-idna-3.8 {puny decode: functional test} {
+test http-idna-3.8.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC-K50AB 0
} a€b€c
-test http-idna-3.9 {puny decode: functional test} {
+test http-idna-3.9.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC- 1
} ABC
-test http-idna-3.10 {puny decode: functional test} {
+test http-idna-3.10.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC-K50AB 1
} A€B€C
-test http-idna-3.11 {puny decode: functional test} {
+test http-idna-3.11.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc- 0
} abc
-test http-idna-3.12 {puny decode: functional test} {
+test http-idna-3.12.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc-k50ab 0
} a€b€c
-test http-idna-3.13 {puny decode: functional test} {
+test http-idna-3.13.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc- 1
} ABC
-test http-idna-3.14 {puny decode: functional test} {
+test http-idna-3.14.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc-k50ab 1
} A€B€C
-test http-idna-3.15 {puny decode: edge cases and errors} {
+test http-idna-3.15.$ThreadLevel {puny decode: edge cases and errors} {
# Is this case actually correct?
binary encode hex [encoding convertto utf-8 [::tcl::idna puny decode abc]]
} c282c281c280
-test http-idna-3.16 {puny decode: edge cases and errors} -returnCodes error -body {
+test http-idna-3.16.$ThreadLevel {puny decode: edge cases and errors} -returnCodes error -body {
::tcl::idna puny decode abc!
} -result {bad decode character "!"}
-test http-idna-3.17 {puny decode: edge cases and errors} {
+test http-idna-3.17.$ThreadLevel {puny decode: edge cases and errors} {
catch {::tcl::idna puny decode abc!} -> opt
dict get $opt -errorcode
} {PUNYCODE BAD_INPUT CHAR}
-test http-idna-3.18 {puny decode: edge cases and errors} {
+test http-idna-3.18.$ThreadLevel {puny decode: edge cases and errors} {
::tcl::idna puny decode ""
} {}
# A helper so we don't get lots of crap in failures
proc hexify s {lmap c [split $s ""] {format u+%04X [scan $c %c]}}
-test http-idna-3.19-A {puny decode: examples from RFC 3492} {
+test http-idna-3.19-A.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode egbpdaj6bu4bxfgehfvwxn]
} [list {*}{
u+0644 u+064A u+0647 u+0645 u+0627 u+0628 u+062A u+0643 u+0644
u+0645 u+0648 u+0634 u+0639 u+0631 u+0628 u+064A u+061F
}]
-test http-idna-3.19-B {puny decode: examples from RFC 3492} {
+test http-idna-3.19-B.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode ihqwcrb4cv8a8dqg056pqjye]
} {u+4ED6 u+4EEC u+4E3A u+4EC0 u+4E48 u+4E0D u+8BF4 u+4E2D u+6587}
-test http-idna-3.19-C {puny decode: examples from RFC 3492} {
+test http-idna-3.19-C.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode ihqwctvzc91f659drss3x8bo0yb]
} {u+4ED6 u+5011 u+7232 u+4EC0 u+9EBD u+4E0D u+8AAA u+4E2D u+6587}
-test http-idna-3.19-D {puny decode: examples from RFC 3492} {
+test http-idna-3.19-D.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode Proprostnemluvesky-uyb24dma41a]
} [list {*}{
u+0050 u+0072 u+006F u+010D u+0070 u+0072 u+006F u+0073 u+0074
u+011B u+006E u+0065 u+006D u+006C u+0075 u+0076 u+00ED u+010D
u+0065 u+0073 u+006B u+0079
}]
-test http-idna-3.19-E {puny decode: examples from RFC 3492} {
+test http-idna-3.19-E.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode 4dbcagdahymbxekheh6e0a7fei0b]
} [list {*}{
u+05DC u+05DE u+05D4 u+05D4 u+05DD u+05E4 u+05E9 u+05D5 u+05D8
u+05DC u+05D0 u+05DE u+05D3 u+05D1 u+05E8 u+05D9 u+05DD u+05E2
u+05D1 u+05E8 u+05D9 u+05EA
}]
-test http-idna-3.19-F {puny decode: examples from RFC 3492} {
+test http-idna-3.19-F.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode \
i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd]
} [list {*}{
@@ -1005,13 +1013,13 @@ test http-idna-3.19-F {puny decode: examples from RFC 3492} {
u+0940 u+0902 u+092C u+094B u+0932 u+0938 u+0915 u+0924 u+0947
u+0939 u+0948 u+0902
}]
-test http-idna-3.19-G {puny decode: examples from RFC 3492} {
+test http-idna-3.19-G.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa]
} [list {*}{
u+306A u+305C u+307F u+3093 u+306A u+65E5 u+672C u+8A9E u+3092
u+8A71 u+3057 u+3066 u+304F u+308C u+306A u+3044 u+306E u+304B
}]
-test http-idna-3.19-H {puny decode: examples from RFC 3492} {
+test http-idna-3.19-H.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode \
989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c]
} [list {*}{
@@ -1019,7 +1027,7 @@ test http-idna-3.19-H {puny decode: examples from RFC 3492} {
u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74
u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C
}]
-test http-idna-3.19-I {puny decode: examples from RFC 3492} {
+test http-idna-3.19-I.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode b1abfaaepdrnnbgefbadotcwatmq2g4l]
} [list {*}{
u+043F u+043E u+0447 u+0435 u+043C u+0443 u+0436 u+0435 u+043E
@@ -1027,7 +1035,7 @@ test http-idna-3.19-I {puny decode: examples from RFC 3492} {
u+044F u+0442 u+043F u+043E u+0440 u+0443 u+0441 u+0441 u+043A
u+0438
}]
-test http-idna-3.19-J {puny decode: examples from RFC 3492} {
+test http-idna-3.19-J.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode \
PorqunopuedensimplementehablarenEspaol-fmd56a]
} [list {*}{
@@ -1037,7 +1045,7 @@ test http-idna-3.19-J {puny decode: examples from RFC 3492} {
u+0062 u+006C u+0061 u+0072 u+0065 u+006E u+0045 u+0073 u+0070
u+0061 u+00F1 u+006F u+006C
}]
-test http-idna-3.19-K {puny decode: examples from RFC 3492} {
+test http-idna-3.19-K.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode \
TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g]
} [list {*}{
@@ -1046,70 +1054,70 @@ test http-idna-3.19-K {puny decode: examples from RFC 3492} {
u+1EC9 u+006E u+00F3 u+0069 u+0074 u+0069 u+1EBF u+006E u+0067
u+0056 u+0069 u+1EC7 u+0074
}]
-test http-idna-3.19-L {puny decode: examples from RFC 3492} {
+test http-idna-3.19-L.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode 3B-ww4c5e180e575a65lsy2b]
} {u+0033 u+5E74 u+0042 u+7D44 u+91D1 u+516B u+5148 u+751F}
-test http-idna-3.19-M {puny decode: examples from RFC 3492} {
+test http-idna-3.19-M.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode -with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n]
} [list {*}{
u+5B89 u+5BA4 u+5948 u+7F8E u+6075 u+002D u+0077 u+0069 u+0074
u+0068 u+002D u+0053 u+0055 u+0050 u+0045 u+0052 u+002D u+004D
u+004F u+004E u+004B u+0045 u+0059 u+0053
}]
-test http-idna-3.19-N {puny decode: examples from RFC 3492} {
+test http-idna-3.19-N.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode Hello-Another-Way--fc4qua05auwb3674vfr0b]
} [list {*}{
u+0048 u+0065 u+006C u+006C u+006F u+002D u+0041 u+006E u+006F
u+0074 u+0068 u+0065 u+0072 u+002D u+0057 u+0061 u+0079 u+002D
u+305D u+308C u+305E u+308C u+306E u+5834 u+6240
}]
-test http-idna-3.19-O {puny decode: examples from RFC 3492} {
+test http-idna-3.19-O.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode 2-u9tlzr9756bt3uc0v]
} {u+3072 u+3068 u+3064 u+5C4B u+6839 u+306E u+4E0B u+0032}
-test http-idna-3.19-P {puny decode: examples from RFC 3492} {
+test http-idna-3.19-P.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode MajiKoi5-783gue6qz075azm5e]
} [list {*}{
u+004D u+0061 u+006A u+0069 u+3067 u+004B u+006F u+0069 u+3059
u+308B u+0035 u+79D2 u+524D
}]
-test http-idna-3.19-Q {puny decode: examples from RFC 3492} {
+test http-idna-3.19-Q.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode de-jg4avhby1noc0d]
} {u+30D1 u+30D5 u+30A3 u+30FC u+0064 u+0065 u+30EB u+30F3 u+30D0}
-test http-idna-3.19-R {puny decode: examples from RFC 3492} {
+test http-idna-3.19-R.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode d9juau41awczczp]
} {u+305D u+306E u+30B9 u+30D4 u+30FC u+30C9 u+3067}
-test http-idna-3.19-S {puny decode: examples from RFC 3492} {
+test http-idna-3.19-S.$ThreadLevel {puny decode: examples from RFC 3492} {
::tcl::idna puny decode {-> $1.00 <--}
} {-> $1.00 <-}
rename hexify ""
-test http-idna-4.1 {IDNA encoding} {
+test http-idna-4.1.$ThreadLevel {IDNA encoding} {
::tcl::idna encode abc.def
} abc.def
-test http-idna-4.2 {IDNA encoding} {
+test http-idna-4.2.$ThreadLevel {IDNA encoding} {
::tcl::idna encode a€b€c.def
} xn--abc-k50ab.def
-test http-idna-4.3 {IDNA encoding} {
+test http-idna-4.3.$ThreadLevel {IDNA encoding} {
::tcl::idna encode def.a€b€c
} def.xn--abc-k50ab
-test http-idna-4.4 {IDNA encoding} {
+test http-idna-4.4.$ThreadLevel {IDNA encoding} {
::tcl::idna encode ABC.DEF
} ABC.DEF
-test http-idna-4.5 {IDNA encoding} {
+test http-idna-4.5.$ThreadLevel {IDNA encoding} {
::tcl::idna encode A€B€C.def
} xn--ABC-k50ab.def
-test http-idna-4.6 {IDNA encoding: invalid edge case} {
+test http-idna-4.6.$ThreadLevel {IDNA encoding: invalid edge case} {
# Should this be an error?
::tcl::idna encode abc..def
} abc..def
-test http-idna-4.7 {IDNA encoding: invalid char} -returnCodes error -body {
+test http-idna-4.7.$ThreadLevel {IDNA encoding: invalid char} -returnCodes error -body {
::tcl::idna encode abc.$.def
} -result {bad character "$" in DNS name}
-test http-idna-4.7.1 {IDNA encoding: invalid char} {
+test http-idna-4.7.1.$ThreadLevel {IDNA encoding: invalid char} {
catch {::tcl::idna encode abc.$.def} -> opt
dict get $opt -errorcode
} {IDNA INVALID_NAME_CHARACTER {$}}
-test http-idna-4.8 {IDNA encoding: empty} {
+test http-idna-4.8.$ThreadLevel {IDNA encoding: empty} {
::tcl::idna encode ""
} {}
set overlong www.[join [subst [string map {u+ \\u} {
@@ -1117,44 +1125,44 @@ set overlong www.[join [subst [string map {u+ \\u} {
u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74
u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C
}]] ""].com
-test http-idna-4.9 {IDNA encoding: max lengths from RFC 5890} -body {
+test http-idna-4.9.$ThreadLevel {IDNA encoding: max lengths from RFC 5890} -body {
::tcl::idna encode $overlong
} -returnCodes error -result "hostname part too long"
-test http-idna-4.9.1 {IDNA encoding: max lengths from RFC 5890} {
+test http-idna-4.9.1.$ThreadLevel {IDNA encoding: max lengths from RFC 5890} {
catch {::tcl::idna encode $overlong} -> opt
dict get $opt -errorcode
} {IDNA OVERLONG_PART xn--989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c}
unset overlong
-test http-idna-4.10 {IDNA encoding: edge cases} {
+test http-idna-4.10.$ThreadLevel {IDNA encoding: edge cases} {
::tcl::idna encode passé.example.com
} xn--pass-epa.example.com
-test http-idna-5.1 {IDNA decoding} {
+test http-idna-5.1.$ThreadLevel {IDNA decoding} {
::tcl::idna decode abc.def
} abc.def
-test http-idna-5.2 {IDNA decoding} {
+test http-idna-5.2.$ThreadLevel {IDNA decoding} {
# Invalid entry that's just a wrapper
::tcl::idna decode xn--abc-.def
} abc.def
-test http-idna-5.3 {IDNA decoding} {
+test http-idna-5.3.$ThreadLevel {IDNA decoding} {
# Invalid entry that's just a wrapper
::tcl::idna decode xn--abc-.xn--def-
} abc.def
-test http-idna-5.4 {IDNA decoding} {
+test http-idna-5.4.$ThreadLevel {IDNA decoding} {
# Invalid entry that's just a wrapper
::tcl::idna decode XN--abc-.XN--def-
} abc.def
-test http-idna-5.5 {IDNA decoding: error cases} -returnCodes error -body {
+test http-idna-5.5.$ThreadLevel {IDNA decoding: error cases} -returnCodes error -body {
::tcl::idna decode xn--$$$.example.com
} -result {bad decode character "$"}
-test http-idna-5.5.1 {IDNA decoding: error cases} {
+test http-idna-5.5.1.$ThreadLevel {IDNA decoding: error cases} {
catch {::tcl::idna decode xn--$$$.example.com} -> opt
dict get $opt -errorcode
} {PUNYCODE BAD_INPUT CHAR}
-test http-idna-5.6 {IDNA decoding: error cases} -returnCodes error -body {
+test http-idna-5.6.$ThreadLevel {IDNA decoding: error cases} -returnCodes error -body {
::tcl::idna decode xn--a-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.def
} -result {exceeded input data}
-test http-idna-5.6.1 {IDNA decoding: error cases} {
+test http-idna-5.6.1.$ThreadLevel {IDNA decoding: error cases} {
catch {::tcl::idna decode xn--a-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.def} -> opt
dict get $opt -errorcode
} {PUNYCODE BAD_INPUT LENGTH}
@@ -1164,8 +1172,8 @@ catch {unset url}
catch {unset badurl}
catch {unset port}
catch {unset data}
-if {[info exists httpthread]} {
- thread::release $httpthread
+if {[llength $threadStack]} {
+ eval [lpop threadStack]
} else {
close $listen
}
diff --git a/tests/http11.test b/tests/http11.test
index 71ef4c7..55e7d39 100644
--- a/tests/http11.test
+++ b/tests/http11.test
@@ -108,7 +108,7 @@ http::config -threadlevel $ThreadLevel
# -------------------------------------------------------------------------
-test http11-1.0 "normal request for document " -setup {
+test http11-1.0.$ThreadLevel "normal request for document " -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html -timeout 10000]
@@ -119,7 +119,7 @@ test http11-1.0 "normal request for document " -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close}
-test http11-1.1 "normal,gzip,non-chunked" -setup {
+test http11-1.1.$ThreadLevel "normal,gzip,non-chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \
@@ -133,7 +133,7 @@ test http11-1.1 "normal,gzip,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok gzip {} {content-encoding gzip} {}}
-test http11-1.2 "normal,deflated,non-chunked" -setup {
+test http11-1.2.$ThreadLevel "normal,deflated,non-chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \
@@ -146,7 +146,7 @@ test http11-1.2 "normal,deflated,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok deflate {}}
-test http11-1.2.1 "normal,deflated,non-chunked,msdeflate" -setup {
+test http11-1.2.1.$ThreadLevel "normal,deflated,non-chunked,msdeflate" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1&msdeflate=1 \
@@ -159,7 +159,7 @@ test http11-1.2.1 "normal,deflated,non-chunked,msdeflate" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok deflate {}}
-test http11-1.3 "normal,compressed,non-chunked" -constraints badCompress -setup {
+test http11-1.3.$ThreadLevel "normal,compressed,non-chunked" -constraints badCompress -setup {
# The Tcl "compress" algorithm appears to be incorrect and has been removed.
# Bug [a13b9d0ce1].
variable httpd [create_httpd]
@@ -174,7 +174,7 @@ test http11-1.3 "normal,compressed,non-chunked" -constraints badCompress -setup
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok compress {}}
-test http11-1.4 "normal,identity,non-chunked" -setup {
+test http11-1.4.$ThreadLevel "normal,identity,non-chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \
@@ -187,7 +187,7 @@ test http11-1.4 "normal,identity,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} {}}
-test http11-1.5 "normal request for document, unsupported coding" -setup {
+test http11-1.5.$ThreadLevel "normal request for document, unsupported coding" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -200,7 +200,7 @@ test http11-1.5 "normal request for document, unsupported coding" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {}}
-test http11-1.6 "normal, specify 1.1 " -setup {
+test http11-1.6.$ThreadLevel "normal, specify 1.1 " -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -214,7 +214,7 @@ test http11-1.6 "normal, specify 1.1 " -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close chunked {connection close} {transfer-encoding chunked}}
-test http11-1.7 "normal, 1.1 and keepalive " -setup {
+test http11-1.7.$ThreadLevel "normal, 1.1 and keepalive " -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -227,7 +227,7 @@ test http11-1.7 "normal, 1.1 and keepalive " -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} chunked}
-test http11-1.8 "normal, 1.1 and keepalive, server close" -setup {
+test http11-1.8.$ThreadLevel "normal, 1.1 and keepalive, server close" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \
@@ -240,7 +240,7 @@ test http11-1.8 "normal, 1.1 and keepalive, server close" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {}}
-test http11-1.9 "normal,gzip,chunked" -setup {
+test http11-1.9.$ThreadLevel "normal,gzip,chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -253,7 +253,7 @@ test http11-1.9 "normal,gzip,chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok gzip chunked}
-test http11-1.10 "normal,deflate,chunked" -setup {
+test http11-1.10.$ThreadLevel "normal,deflate,chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -266,7 +266,7 @@ test http11-1.10 "normal,deflate,chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok deflate chunked}
-test http11-1.10.1 "normal,deflate,chunked,msdeflate" -setup {
+test http11-1.10.1.$ThreadLevel "normal,deflate,chunked,msdeflate" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?msdeflate=1 \
@@ -279,7 +279,7 @@ test http11-1.10.1 "normal,deflate,chunked,msdeflate" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok deflate chunked}
-test http11-1.11 "normal,compress,chunked" -constraints badCompress -setup {
+test http11-1.11.$ThreadLevel "normal,compress,chunked" -constraints badCompress -setup {
# The Tcl "compress" algorithm appears to be incorrect and has been removed.
# Bug [a13b9d0ce1].
variable httpd [create_httpd]
@@ -294,7 +294,7 @@ test http11-1.11 "normal,compress,chunked" -constraints badCompress -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok compress chunked}
-test http11-1.12 "normal,identity,chunked" -setup {
+test http11-1.12.$ThreadLevel "normal,identity,chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -307,7 +307,7 @@ test http11-1.12 "normal,identity,chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} chunked}
-test http11-1.13 "normal, 1.1 and keepalive as server default, no zip" -setup {
+test http11-1.13.$ThreadLevel "normal, 1.1 and keepalive as server default, no zip" -setup {
variable httpd [create_httpd]
set zipTmp [http::config -zip]
http::config -zip 0
@@ -346,7 +346,7 @@ proc progressPause {var token total current} {
return
}
-test http11-2.0 "-channel" -setup {
+test http11-2.0.$ThreadLevel "-channel" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -364,7 +364,7 @@ test http11-2.0 "-channel" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close chunked}
-test http11-2.1 "-channel, encoding gzip" -setup {
+test http11-2.1.$ThreadLevel "-channel, encoding gzip" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -387,7 +387,7 @@ test http11-2.1 "-channel, encoding gzip" -setup {
# Cf. Bug [3610253] "CopyChunk does not drain decompressor(s)"
# This test failed before the bugfix.
# The pass/fail depended on file size.
-test http11-2.1.1 "-channel, encoding gzip" -setup {
+test http11-2.1.1.$ThreadLevel "-channel, encoding gzip" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
set fileName largedoc.html
@@ -408,7 +408,7 @@ test http11-2.1.1 "-channel, encoding gzip" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close gzip chunked -- 0 bytes lost}
-test http11-2.2 "-channel, encoding deflate" -setup {
+test http11-2.2.$ThreadLevel "-channel, encoding deflate" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -427,7 +427,7 @@ test http11-2.2 "-channel, encoding deflate" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close deflate chunked}
-test http11-2.2.1 "-channel, encoding deflate,msdeflate" -setup {
+test http11-2.2.1.$ThreadLevel "-channel, encoding deflate,msdeflate" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -446,7 +446,7 @@ test http11-2.2.1 "-channel, encoding deflate,msdeflate" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close deflate chunked}
-test http11-2.3 "-channel,encoding compress" -constraints badCompress -setup {
+test http11-2.3.$ThreadLevel "-channel,encoding compress" -constraints badCompress -setup {
# The Tcl "compress" algorithm appears to be incorrect and has been removed.
# Bug [a13b9d0ce1].
variable httpd [create_httpd]
@@ -468,7 +468,7 @@ test http11-2.3 "-channel,encoding compress" -constraints badCompress -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close compress chunked}
-test http11-2.4 "-channel,encoding identity" -setup {
+test http11-2.4.$ThreadLevel "-channel,encoding identity" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -488,7 +488,7 @@ test http11-2.4 "-channel,encoding identity" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {} chunked}
-test http11-2.4.1 "-channel,encoding identity with -progress" -setup {
+test http11-2.4.1.$ThreadLevel "-channel,encoding identity with -progress" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
set logdata ""
@@ -514,7 +514,7 @@ test http11-2.4.1 "-channel,encoding identity with -progress" -setup {
unset -nocomplain logdata data
} -result {ok {HTTP/1.1 200 OK} ok close {} chunked 0 0}
-test http11-2.4.2 "-channel,encoding identity with -progress progressPause enters event loop" -constraints knownBug -setup {
+test http11-2.4.2.$ThreadLevel "-channel,encoding identity with -progress progressPause enters event loop" -constraints knownBug -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
set logdata ""
@@ -540,7 +540,7 @@ test http11-2.4.2 "-channel,encoding identity with -progress progressPause enter
unset -nocomplain logdata data ::WaitHere
} -result {ok {HTTP/1.1 200 OK} ok close {} chunked 0 0}
-test http11-2.5 "-channel,encoding unsupported" -setup {
+test http11-2.5.$ThreadLevel "-channel,encoding unsupported" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -560,7 +560,7 @@ test http11-2.5 "-channel,encoding unsupported" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {} chunked}
-test http11-2.6 "-channel,encoding gzip,non-chunked" -setup {
+test http11-2.6.$ThreadLevel "-channel,encoding gzip,non-chunked" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -580,7 +580,7 @@ test http11-2.6 "-channel,encoding gzip,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close gzip {} 0}
-test http11-2.7 "-channel,encoding deflate,non-chunked" -setup {
+test http11-2.7.$ThreadLevel "-channel,encoding deflate,non-chunked" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -600,7 +600,7 @@ test http11-2.7 "-channel,encoding deflate,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close deflate {} 0}
-test http11-2.7.1 "-channel,encoding deflate,non-chunked,msdeflate" -constraints knownBug -setup {
+test http11-2.7.1.$ThreadLevel "-channel,encoding deflate,non-chunked,msdeflate" -constraints knownBug -setup {
# Test fails because a -channel can only try one un-deflate algorithm, and the
# compliant "decompress" is tried, not the non-compliant "inflate" of
# the MS browser implementation.
@@ -623,7 +623,7 @@ test http11-2.7.1 "-channel,encoding deflate,non-chunked,msdeflate" -constraints
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close deflate {} 0}
-test http11-2.8 "-channel,encoding compress,non-chunked" -constraints badCompress -setup {
+test http11-2.8.$ThreadLevel "-channel,encoding compress,non-chunked" -constraints badCompress -setup {
# The Tcl "compress" algorithm appears to be incorrect and has been removed.
# Bug [a13b9d0ce1].
variable httpd [create_httpd]
@@ -645,7 +645,7 @@ test http11-2.8 "-channel,encoding compress,non-chunked" -constraints badCompres
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close compress {} 0}
-test http11-2.9 "-channel,encoding identity,non-chunked" -setup {
+test http11-2.9.$ThreadLevel "-channel,encoding identity,non-chunked" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -665,7 +665,7 @@ test http11-2.9 "-channel,encoding identity,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {} {} 0}
-test http11-2.10 "-channel,deflate,keepalive" -setup {
+test http11-2.10.$ThreadLevel "-channel,deflate,keepalive" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -686,7 +686,7 @@ test http11-2.10 "-channel,deflate,keepalive" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} deflate chunked 0}
-test http11-2.10.1 "-channel,deflate,keepalive,msdeflate" -setup {
+test http11-2.10.1.$ThreadLevel "-channel,deflate,keepalive,msdeflate" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -707,7 +707,7 @@ test http11-2.10.1 "-channel,deflate,keepalive,msdeflate" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} deflate chunked 0}
-test http11-2.11 "-channel,identity,keepalive" -setup {
+test http11-2.11.$ThreadLevel "-channel,identity,keepalive" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -727,7 +727,7 @@ test http11-2.11 "-channel,identity,keepalive" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} {} chunked}
-test http11-2.12 "-channel,negotiate,keepalive" -setup {
+test http11-2.12.$ThreadLevel "-channel,negotiate,keepalive" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -775,7 +775,7 @@ proc handlerPause {var sock token} {
return [string length $chunk]
}
-test http11-3.0 "-handler,close,identity" -setup {
+test http11-3.0.$ThreadLevel "-handler,close,identity" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -792,7 +792,7 @@ test http11-3.0 "-handler,close,identity" -setup {
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0}
-test http11-3.1 "-handler,protocol1.0" -setup {
+test http11-3.1.$ThreadLevel "-handler,protocol1.0" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -810,7 +810,7 @@ test http11-3.1 "-handler,protocol1.0" -setup {
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0}
-test http11-3.2 "-handler,close,chunked" -setup {
+test http11-3.2.$ThreadLevel "-handler,close,chunked" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -828,7 +828,7 @@ test http11-3.2 "-handler,close,chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0}
-test http11-3.3 "-handler,keepalive,chunked" -setup {
+test http11-3.3.$ThreadLevel "-handler,keepalive,chunked" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -856,7 +856,7 @@ test http11-3.3 "-handler,keepalive,chunked" -setup {
# "Connection: keep-alive", i.e. the server will keep the connection
# open. In HTTP/1.0 this is not the case, and this is a test that
# the Tcl client assumes "Connection: close" by default in HTTP/1.0.
-test http11-3.4 "-handler,close,identity; HTTP/1.0 server does not send Connection: close header or Content-Length" -setup {
+test http11-3.4.$ThreadLevel "-handler,close,identity; HTTP/1.0 server does not send Connection: close header or Content-Length" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -874,7 +874,7 @@ test http11-3.4 "-handler,close,identity; HTTP/1.0 server does not send Connecti
} -result {ok {HTTP/1.0 200 OK} ok {} {} {} 0}
# It is not forbidden for a handler to enter the event loop.
-test http11-3.5 "-handler,close,identity as http11-3.0 but handlerPause enters event loop" -setup {
+test http11-3.5.$ThreadLevel "-handler,close,identity as http11-3.0 but handlerPause enters event loop" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -891,7 +891,7 @@ test http11-3.5 "-handler,close,identity as http11-3.0 but handlerPause enters e
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0}
-test http11-3.6 "-handler,close,identity as http11-3.0 but with -progress" -setup {
+test http11-3.6.$ThreadLevel "-handler,close,identity as http11-3.0 but with -progress" -setup {
variable httpd [create_httpd]
set testdata ""
set logdata ""
@@ -912,7 +912,7 @@ test http11-3.6 "-handler,close,identity as http11-3.0 but with -progress" -setu
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0 0 0}
-test http11-3.7 "-handler,close,identity as http11-3.0 but with -progress progressPause enters event loop" -setup {
+test http11-3.7.$ThreadLevel "-handler,close,identity as http11-3.0 but with -progress progressPause enters event loop" -setup {
variable httpd [create_httpd]
set testdata ""
set logdata ""
@@ -933,7 +933,7 @@ test http11-3.7 "-handler,close,identity as http11-3.0 but with -progress progre
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0 0 0}
-test http11-3.8 "close,identity no -handler but with -progress" -setup {
+test http11-3.8.$ThreadLevel "close,identity no -handler but with -progress" -setup {
variable httpd [create_httpd]
set logdata ""
} -body {
@@ -954,7 +954,7 @@ test http11-3.8 "close,identity no -handler but with -progress" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {} {} 0 0 0}
-test http11-3.9 "close,identity no -handler but with -progress progressPause enters event loop" -setup {
+test http11-3.9.$ThreadLevel "close,identity no -handler but with -progress progressPause enters event loop" -setup {
variable httpd [create_httpd]
set logdata ""
} -body {
@@ -975,7 +975,7 @@ test http11-3.9 "close,identity no -handler but with -progress progressPause ent
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {} {} 0 0 0}
-test http11-4.0 "normal post request" -setup {
+test http11-4.0.$ThreadLevel "normal post request" -setup {
variable httpd [create_httpd]
} -body {
set query [http::formatQuery q 1 z 2]
@@ -991,7 +991,7 @@ test http11-4.0 "normal post request" -setup {
halt_httpd
} -result {status ok code {HTTP/1.1 200 OK} crc ok connection close query-length 7}
-test http11-4.1 "normal post request, check query length" -setup {
+test http11-4.1.$ThreadLevel "normal post request, check query length" -setup {
variable httpd [create_httpd]
} -body {
set query [http::formatQuery q 1 z 2]
@@ -1008,7 +1008,7 @@ test http11-4.1 "normal post request, check query length" -setup {
halt_httpd
} -result {status ok code {HTTP/1.1 200 OK} crc ok connection close query-length 7}
-test http11-4.2 "normal post request, check long query length" -setup {
+test http11-4.2.$ThreadLevel "normal post request, check long query length" -setup {
variable httpd [create_httpd]
} -body {
set query [string repeat a 24576]
@@ -1025,7 +1025,7 @@ test http11-4.2 "normal post request, check long query length" -setup {
halt_httpd
} -result {status ok code {HTTP/1.1 200 OK} crc ok connection close query-length 24576}
-test http11-4.3 "normal post request, check channel query length" -setup {
+test http11-4.3.$ThreadLevel "normal post request, check channel query length" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
puts -nonewline $chan [string repeat [encoding convertto utf-8 "This is a test\n"] 8192]
diff --git a/tests/httpPipeline.test b/tests/httpPipeline.test
index 161519f..491aae0 100644
--- a/tests/httpPipeline.test
+++ b/tests/httpPipeline.test
@@ -839,7 +839,7 @@ for {set header 1} {$header <= 4} {incr header} {
# Here's the test:
- test httpPipeline-${header}.${footer}${label}-${tag} $name \
+ test httpPipeline-${header}.${footer}${label}-${tag}-$ThreadLevel $name \
-constraints $cons \
-setup [string map [list TE $te] {
# Restore default values for tests:
diff --git a/tests/httpProxy.test b/tests/httpProxy.test
new file mode 100644
index 0000000..90fe828
--- /dev/null
+++ b/tests/httpProxy.test
@@ -0,0 +1,456 @@
+# Commands covered: http::geturl when using a proxy server.
+#
+# This file contains a collection of tests for the http script library.
+# Sourcing this file into Tcl runs the tests and generates output for errors.
+# No output means no errors were found.
+#
+# Copyright © 1991-1993 The Regents of the University of California.
+# Copyright © 1994-1996 Sun Microsystems, Inc.
+# Copyright © 1998-2000 Ajuba Solutions.
+# Copyright © 2022 Keith Nash.
+#
+# See the file "license.terms" for information on usage and redistribution of
+# this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+if {"::tcltest" ni [namespace children]} {
+ package require tcltest 2.5
+ namespace import -force ::tcltest::*
+}
+
+package require http 2.10
+
+proc bgerror {args} {
+ global errorInfo
+ puts stderr "httpProxy.test bgerror"
+ puts stderr [join $args]
+ puts stderr $errorInfo
+}
+
+if {![info exists ThreadLevel]} {
+ if {[catch {package require Thread}] == 0} {
+ set ValueRange {0 1 2}
+ } else {
+ set ValueRange {0 1}
+ }
+
+ # For each value of ThreadLevel, source this file recursively in the
+ # same interpreter.
+ foreach ThreadLevel $ValueRange {
+ source [info script]
+ }
+ catch {unset ThreadLevel}
+ catch {unset ValueRange}
+ return
+}
+
+catch {puts "==== Test with ThreadLevel $ThreadLevel ===="}
+http::config -threadlevel $ThreadLevel
+
+
+#testConstraint needsSquid 1
+#testConstraint needsTls 1
+
+if {[testConstraint needsTls]} {
+ package require tls
+ http::register https 443 [list ::tls::socket -ssl2 0 -ssl3 0 \
+ -tls1 0 -tls1.1 0 -tls1.2 1 -tls1.3 0 -autoservername 1]
+}
+
+# Testing with Squid
+# - Example Squid configuration for Enterprise Linux 8 (Red Hat, Oracle, Rocky,
+# Alma, ...) is in file tests/httpProxySquidConfigForEL8.tar.gz.
+# - Two instances of Squid are launched, one that needs authentication and one
+# that does not.
+# - Each instance of Squid listens on IPv4 and IPv6, on different ports.
+
+# Instance of Squid that does not need authentication.
+set n4host 127.0.0.1
+set n6host ::1
+set n4port 3128
+set n6port 3130
+
+# Instance of Squid that needs authentication.
+set a4host 127.0.0.1
+set a6host ::1
+set a4port 3129
+set a6port 3131
+
+# concat Basic [base64::encode alice:alicia]
+set aliceCreds {Basic YWxpY2U6YWxpY2lh}
+
+# concat Basic [base64::encode intruder:intruder]
+set badCreds {Basic aW50cnVkZXI6aW50cnVkZXI=}
+
+test httpProxy-1.1.$ThreadLevel {squid is running - ipv4 noauth} -constraints {needsSquid} -setup {
+} -body {
+ set token [http::geturl http://$n4host:$n4port/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 400 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-1.2.$ThreadLevel {squid is running - ipv6 noauth} -constraints {needsSquid} -setup {
+} -body {
+ set token [http::geturl http://\[$n6host\]:$n6port/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 400 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-1.3.$ThreadLevel {squid is running - ipv4 auth} -constraints {needsSquid} -setup {
+} -body {
+ set token [http::geturl http://$a4host:$a4port/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 400 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-1.4.$ThreadLevel {squid is running - ipv6 auth} -constraints {needsSquid} -setup {
+} -body {
+ set token [http::geturl http://\[$a6host\]:$a6port/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 400 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-2.1.$ThreadLevel {http no-proxy no-auth} -constraints {needsSquid} -setup {
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-2.2.$ThreadLevel {https no-proxy no-auth} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-2.3.$ThreadLevel {http with-proxy ipv4 no-auth} -constraints {needsSquid} -setup {
+ http::config -proxyhost $n4host -proxyport $n4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 HttpProxy} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+ http::config -proxyhost {} -proxyport {} -proxynot {}
+}
+
+test httpProxy-2.4.$ThreadLevel {https with-proxy ipv4 no-auth} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $n4host -proxyport $n4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 SecureProxy} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+ http::config -proxyhost {} -proxyport {} -proxynot {}
+}
+
+test httpProxy-2.5.$ThreadLevel {http with-proxy ipv6 no-auth} -constraints {needsSquid} -setup {
+ http::config -proxyhost $n6host -proxyport $n6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 HttpProxy} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+ http::config -proxyhost {} -proxyport {} -proxynot {}
+}
+
+test httpProxy-2.6.$ThreadLevel {https with-proxy ipv6 no-auth} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $n6host -proxyport $n6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 SecureProxy} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+ http::config -proxyhost {} -proxyport {} -proxynot {}
+}
+
+test httpProxy-3.1.$ThreadLevel {http no-proxy with-auth valid-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-3.2.$ThreadLevel {https no-proxy with-auth valid-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-3.3.$ThreadLevel {http with-proxy ipv4 with-auth valid-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 HttpProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-3.4.$ThreadLevel {https with-proxy ipv4 with-auth valid-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 SecureProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-3.5.$ThreadLevel {http with-proxy ipv6 with-auth valid-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 HttpProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-3.6.$ThreadLevel {https with-proxy ipv6 with-auth valid-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 SecureProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.1.$ThreadLevel {http no-proxy with-auth no-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.2.$ThreadLevel {https no-proxy with-auth no-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.3.$ThreadLevel {http with-proxy ipv4 with-auth no-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 HttpProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.4.$ThreadLevel {https with-proxy ipv4 with-auth no-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 SecureProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.5.$ThreadLevel {http with-proxy ipv6 with-auth no-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 HttpProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.6.$ThreadLevel {https with-proxy ipv6 with-auth no-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 SecureProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.1.$ThreadLevel {http no-proxy with-auth bad-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.2.$ThreadLevel {https no-proxy with-auth bad-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.3.$ThreadLevel {http with-proxy ipv4 with-auth bad-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 HttpProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.4.$ThreadLevel {https with-proxy ipv4 with-auth bad-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 SecureProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.5.$ThreadLevel {http with-proxy ipv6 with-auth bad-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 HttpProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.6.$ThreadLevel {https with-proxy ipv6 with-auth bad-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 SecureProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+# cleanup
+unset -nocomplain n4host n6host n4port n6port a4host a6host a4port a6port aliceCreds badCreds
+
+rename bgerror {}
+
+::tcltest::cleanupTests
+
+# Local variables:
+# mode: tcl
+# End:
+
diff --git a/tests/httpProxySquidConfigForEL8.tar.gz b/tests/httpProxySquidConfigForEL8.tar.gz
new file mode 100644
index 0000000..a94dbdb
--- /dev/null
+++ b/tests/httpProxySquidConfigForEL8.tar.gz
Binary files differ
diff --git a/tests/io.test b/tests/io.test
index 3241625..04c9cd2 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -2093,13 +2093,13 @@ test io-20.2 {Tcl_CreateChannel: initial settings} {win} {
set x [list [fconfigure $f -eofchar] [fconfigure $f -translation]]
close $f
set x
-} [list [list \x1A ""] {auto crlf}]
+} {{} {auto crlf}}
test io-20.3 {Tcl_CreateChannel: initial settings} {unix} {
set f [open $path(test1) w+]
set x [list [fconfigure $f -eofchar] [fconfigure $f -translation]]
close $f
set x
-} {{{} {}} {auto lf}}
+} {{} {auto lf}}
set path(stdout) [makeFile {} stdout]
test io-20.5 {Tcl_CreateChannel: install channel in empty slot} stdio {
set f [open $path(script) w]
@@ -5038,7 +5038,7 @@ test io-35.6 {Tcl_Eof, eof char, lf write, auto read} {
set e [eof $f]
close $f
list $s $l $e
-} {9 8 1}
+} {8 8 1}
test io-35.7 {Tcl_Eof, eof char, lf write, lf read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5052,7 +5052,7 @@ test io-35.7 {Tcl_Eof, eof char, lf write, lf read} {
set e [eof $f]
close $f
list $s $l $e
-} {9 8 1}
+} {8 8 1}
test io-35.8 {Tcl_Eof, eof char, cr write, auto read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5066,7 +5066,7 @@ test io-35.8 {Tcl_Eof, eof char, cr write, auto read} {
set e [eof $f]
close $f
list $s $l $e
-} {9 8 1}
+} {8 8 1}
test io-35.9 {Tcl_Eof, eof char, cr write, cr read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5080,7 +5080,7 @@ test io-35.9 {Tcl_Eof, eof char, cr write, cr read} {
set e [eof $f]
close $f
list $s $l $e
-} {9 8 1}
+} {8 8 1}
test io-35.10 {Tcl_Eof, eof char, crlf write, auto read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5094,7 +5094,7 @@ test io-35.10 {Tcl_Eof, eof char, crlf write, auto read} {
set e [eof $f]
close $f
list $s $l $e
-} {11 8 1}
+} {10 8 1}
test io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5108,7 +5108,7 @@ test io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} {
set e [eof $f]
close $f
list $s $l $e
-} {11 8 1}
+} {10 8 1}
test io-35.12 {Tcl_Eof, eof char in middle, lf write, auto read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5226,7 +5226,7 @@ test io-35.18a {Tcl_Eof, eof char, cr write, crlf read} -body {
set e [eof $f]
close $f
list $s $l $e [scan [string index $in end] %c]
-} -result {9 8 1 13}
+} -result {8 8 1 13}
test io-35.18b {Tcl_Eof, eof char, cr write, crlf read} -body {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5240,7 +5240,7 @@ test io-35.18b {Tcl_Eof, eof char, cr write, crlf read} -body {
set e [eof $f]
close $f
list $s $l $e [scan [string index $in end] %c]
-} -result {2 1 1 13}
+} -result {1 1 1 13}
test io-35.18c {Tcl_Eof, eof char, cr write, crlf read} -body {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5756,30 +5756,30 @@ test io-39.21 {Tcl_SetChannelOption, setting read mode independently} \
close $s2
set modes
} {auto crlf}
-test io-39.22 {Tcl_SetChannelOption, invariance} {unix} {
+test io-39.22 {Tcl_SetChannelOption, invariance} {unix deprecated} {
file delete $path(test1)
set f1 [open $path(test1) w+]
set l ""
lappend l [fconfigure $f1 -eofchar]
- fconfigure $f1 -eofchar {ON GO}
+ fconfigure $f1 -eofchar {O {}}
lappend l [fconfigure $f1 -eofchar]
fconfigure $f1 -eofchar D
lappend l [fconfigure $f1 -eofchar]
close $f1
set l
-} {{{} {}} {O G} {D D}}
-test io-39.22a {Tcl_SetChannelOption, invariance} {
+} {{} O D}
+test io-39.22a {Tcl_SetChannelOption, invariance} deprecated {
file delete $path(test1)
set f1 [open $path(test1) w+]
set l [list]
- fconfigure $f1 -eofchar {ON GO}
+ fconfigure $f1 -eofchar {O {}}
lappend l [fconfigure $f1 -eofchar]
fconfigure $f1 -eofchar D
lappend l [fconfigure $f1 -eofchar]
lappend l [list [catch {fconfigure $f1 -eofchar {1 2 3}} msg] $msg]
close $f1
set l
-} {{O G} {D D} {1 {bad value for -eofchar: should be a list of zero, one, or two elements}}}
+} {O D {1 {bad value for -eofchar: must be non-NUL ASCII character}}}
test io-39.23 {Tcl_GetChannelOption, server socket is not readable or
writeable, it should still have valid -eofchar and -translation options } {
set l [list]
@@ -5787,7 +5787,7 @@ test io-39.23 {Tcl_GetChannelOption, server socket is not readable or
lappend l [fconfigure $sock -eofchar] [fconfigure $sock -translation]
close $sock
set l
-} {{{}} auto}
+} {{} auto}
test io-39.24 {Tcl_SetChannelOption, server socket is not readable or
writable so we can't change -eofchar or -translation } {
set l [list]
@@ -5796,7 +5796,7 @@ test io-39.24 {Tcl_SetChannelOption, server socket is not readable or
lappend l [fconfigure $sock -eofchar] [fconfigure $sock -translation]
close $sock
set l
-} {{{}} auto}
+} {{} auto}
test io-40.1 {POSIX open access modes: RDWR} {
file delete $path(test3)
diff --git a/tests/ioCmd.test b/tests/ioCmd.test
index 20418f3..9e53201 100644
--- a/tests/ioCmd.test
+++ b/tests/ioCmd.test
@@ -1363,7 +1363,7 @@ test iocmd-25.1 {chan configure, cgetall, standard options} -match glob -body {
close $c
rename foo {}
set res
-} -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} -nocomplainencoding 0 -strictencoding 0 -translation {auto *}}}
+} -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} -nocomplainencoding 0 -strictencoding 0 -translation {auto *}}}
test iocmd-25.2 {chan configure, cgetall, no options} -match glob -body {
set res {}
proc foo {args} {oninit cget cgetall; onfinal; track; return ""}
@@ -1372,7 +1372,7 @@ test iocmd-25.2 {chan configure, cgetall, no options} -match glob -body {
close $c
rename foo {}
set res
-} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} -nocomplainencoding 0 -strictencoding 0 -translation {auto *}}}
+} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} -nocomplainencoding 0 -strictencoding 0 -translation {auto *}}}
test iocmd-25.3 {chan configure, cgetall, regular result} -match glob -body {
set res {}
proc foo {args} {
@@ -1384,7 +1384,7 @@ test iocmd-25.3 {chan configure, cgetall, regular result} -match glob -body {
close $c
rename foo {}
set res
-} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} -nocomplainencoding 0 -strictencoding 0 -translation {auto *} -bar foo -snarf x}}
+} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} -nocomplainencoding 0 -strictencoding 0 -translation {auto *} -bar foo -snarf x}}
test iocmd-25.4 {chan configure, cgetall, bad result, list of uneven length} -match glob -body {
set res {}
proc foo {args} {
@@ -2905,7 +2905,7 @@ test iocmd.tf-25.1 {chan configure, cgetall, standard options} -match glob -body
rename foo {}
set res
} -constraints {testchannel thread} \
- -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} * -translation {auto *}}}
+ -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} * -translation {auto *}}}
test iocmd.tf-25.2 {chan configure, cgetall, no options} -match glob -body {
set res {}
proc foo {args} {oninit cget cgetall; onfinal; track; return ""}
@@ -2918,7 +2918,7 @@ test iocmd.tf-25.2 {chan configure, cgetall, no options} -match glob -body {
rename foo {}
set res
} -constraints {testchannel thread} \
- -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} * -translation {auto *}}}
+ -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} * -translation {auto *}}}
test iocmd.tf-25.3 {chan configure, cgetall, regular result} -match glob -body {
set res {}
proc foo {args} {
@@ -2934,7 +2934,7 @@ test iocmd.tf-25.3 {chan configure, cgetall, regular result} -match glob -body {
rename foo {}
set res
} -constraints {testchannel thread} \
- -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} * -translation {auto *} -bar foo -snarf x}}
+ -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} * -translation {auto *} -bar foo -snarf x}}
test iocmd.tf-25.4 {chan configure, cgetall, bad result, list of uneven length} -match glob -body {
set res {}
proc foo {args} {
diff --git a/tests/load.test b/tests/load.test
index 1f6321e..77a6dec 100644
--- a/tests/load.test
+++ b/tests/load.test
@@ -31,7 +31,7 @@ testConstraint $dll [file readable $x]
# Tests also require that this DLL has not already been loaded.
set loaded "[file tail $x]Loaded"
-set alreadyLoaded [info loaded]
+set alreadyLoaded [info loaded {}]
testConstraint $loaded [expr {![string match *pkga* $alreadyLoaded]}]
set alreadyTotalLoaded [info loaded]
diff --git a/tests/lreplace.test b/tests/lreplace.test
index 2952899..009170e 100644
--- a/tests/lreplace.test
+++ b/tests/lreplace.test
@@ -434,7 +434,7 @@ test ledit-4.4 {ledit edge case} {
set l {1 2 3 4 5}
list [ledit l 3 1] $l
} {{1 2 3 4 5} {1 2 3 4 5}}
-test lreplace-4.5 {lreplace edge case} {
+test ledit-4.5 {ledit edge case} {
lreplace {1 2 3 4 5} 3 0 _
} {1 2 3 _ 4 5}
test ledit-4.6 {ledit end-x: bug a4cb3f06c4} {
diff --git a/tests/lseq.test b/tests/lseq.test
index 19ae348..3f68da4 100644
--- a/tests/lseq.test
+++ b/tests/lseq.test
@@ -255,8 +255,9 @@ test lseq-3.7 {lmap lseq} {
test lseq-3.8 {lrange lseq} {
set r [lrange [lseq 1 100] 10 20]
- lindex [tcl::unsupported::representation $r] 3
-} {arithseries}
+ set empty [lrange [lseq 1 100] 20 10]
+ list $r $empty [lindex [tcl::unsupported::representation $r] 3]
+} {{11 12 13 14 15 16 17 18 19 20 21} {} arithseries}
test lseq-3.9 {lassign lseq} arithSeriesShimmer {
set r [lseq 15]
@@ -509,12 +510,44 @@ test lseq-4.5 {lindex off by one} -body {
unset res
} -result {4 3}
+# Bad refcount on ResultObj
+test lseq-4.6 {lindex flat} -body {
+ set l [lseq 2 10]
+ set cmd lindex
+ set i 4
+ set c [lindex $l $i]
+ set d [$cmd $l $i]
+ set e [lindex [lseq 2 10] $i]
+ set f [$cmd [lseq 2 10] $i]
+ list $c $d $e $f
+} -cleanup {
+ unset l
+ unset e
+} -result [lrepeat 4 6]
+
+test lseq-4.7 {empty list} {
+ list [lseq 0] [join [lseq 0] {}] [join [lseq 1] {}]
+} {{} {} 0}
+
+test lseq-4.8 {error case lrange} -body {
+ lrange [lseq 1 5] fred ginger
+} -returnCodes 1 \
+ -result {bad index "fred": must be integer?[+-]integer? or end?[+-]integer?}
+
+test lseq-4.9 {error case lrange} -body {
+ set fred 7
+ set ginger 8
+ lrange [lseq 1 5] $fred $ginger
+} -returnCodes 1 \
+ -result {index 7 is out of bounds 0 to 4}
+
# Panic when using variable value?
-test lseq-4.6 {panic using variable index} {
+test lseq-4.10 {panic using variable index} {
set i 0
lindex [lseq 10] $i
} {0}
+
# cleanup
::tcltest::cleanupTests
diff --git a/tests/main.test b/tests/main.test
index 4aadd79..2703dc1 100644
--- a/tests/main.test
+++ b/tests/main.test
@@ -606,7 +606,7 @@ namespace eval ::tcl::test::main {
catch {set f [open "|[list [interpreter]]" w+]}
catch {chan configure $f -blocking 0}
} -body {
- type $f "chan configure stdin -eofchar \"\\x1A {}\"
+ type $f "chan configure stdin -eofchar \\x1A
if 1 \{\n\x1A"
variable wait
chan event $f readable \
diff --git a/tests/scan.test b/tests/scan.test
index c6e7922..03a5b46 100644
--- a/tests/scan.test
+++ b/tests/scan.test
@@ -605,7 +605,7 @@ test scan-6.8 {floating-point scanning} -setup {
} -body {
list [scan "4.6 5.2" "%f %f %f %f" a b c d] $a $b $c $d
} -result {2 4.6 5.2 {} {}}
-test scan-6.8 {disallow diget separator in floating-point} -setup {
+test scan-6.9 {disallow diget separator in floating-point} -setup {
set a {}; set b {}; set c {};
} -body {
list [scan "3.14_2.35_98.6" %f_%f_%f a b c ] $a $b $c
diff --git a/tests/socket.test b/tests/socket.test
index 7fdb09d..a0fe2f7 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -308,13 +308,13 @@ test socket_$af-1.1 {arg parsing for socket command} -constraints [list socket s
} -returnCodes error -result {no argument given for -server option}
test socket_$af-1.2 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -server foo
-} -returnCodes error -result {wrong # args: should be "socket ?-myaddr addr? ?-myport myport? ?-async? host port" or "socket -server command ?-reuseaddr boolean? ?-reuseport boolean? ?-myaddr addr? port"}
+} -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"}
test socket_$af-1.3 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -myaddr
} -returnCodes error -result {no argument given for -myaddr option}
test socket_$af-1.4 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -myaddr $localhost
-} -returnCodes error -result {wrong # args: should be "socket ?-myaddr addr? ?-myport myport? ?-async? host port" or "socket -server command ?-reuseaddr boolean? ?-reuseport boolean? ?-myaddr addr? port"}
+} -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"}
test socket_$af-1.5 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -myport
} -returnCodes error -result {no argument given for -myport option}
@@ -323,19 +323,19 @@ test socket_$af-1.6 {arg parsing for socket command} -constraints [list socket s
} -returnCodes error -result {expected integer but got "xxxx"}
test socket_$af-1.7 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -myport 2522
-} -returnCodes error -result {wrong # args: should be "socket ?-myaddr addr? ?-myport myport? ?-async? host port" or "socket -server command ?-reuseaddr boolean? ?-reuseport boolean? ?-myaddr addr? port"}
+} -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"}
test socket_$af-1.8 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -froboz
-} -returnCodes error -result {bad option "-froboz": must be -async, -myaddr, -myport, -reuseaddr, -reuseport, or -server}
+} -returnCodes error -result {bad option "-froboz": must be -async, -backlog, -myaddr, -myport, -reuseaddr, -reuseport, or -server}
test socket_$af-1.9 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -server foo -myport 2521 3333
} -returnCodes error -result {option -myport is not valid for servers}
test socket_$af-1.10 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket host 2528 -junk
-} -returnCodes error -result {wrong # args: should be "socket ?-myaddr addr? ?-myport myport? ?-async? host port" or "socket -server command ?-reuseaddr boolean? ?-reuseport boolean? ?-myaddr addr? port"}
+} -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"}
test socket_$af-1.11 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -server callback 2520 --
-} -returnCodes error -result {wrong # args: should be "socket ?-myaddr addr? ?-myport myport? ?-async? host port" or "socket -server command ?-reuseaddr boolean? ?-reuseport boolean? ?-myaddr addr? port"}
+} -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"}
test socket_$af-1.12 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket foo badport
} -returnCodes error -result {expected integer but got "badport"}
@@ -347,19 +347,19 @@ test socket_$af-1.14 {arg parsing for socket command} -constraints [list socket
} -returnCodes error -result {cannot set -async option for server sockets}
test socket_$af-1.15 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseaddr yes 4242
-} -returnCodes error -result {options -reuseaddr and -reuseport are only valid for servers}
+} -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers}
test socket_$af-1.16 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseaddr no 4242
-} -returnCodes error -result {options -reuseaddr and -reuseport are only valid for servers}
+} -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers}
test socket_$af-1.17 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseaddr
} -returnCodes error -result {no argument given for -reuseaddr option}
test socket_$af-1.18 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseport yes 4242
-} -returnCodes error -result {options -reuseaddr and -reuseport are only valid for servers}
+} -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers}
test socket_$af-1.19 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseport no 4242
-} -returnCodes error -result {options -reuseaddr and -reuseport are only valid for servers}
+} -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers}
test socket_$af-1.20 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseport
} -returnCodes error -result {no argument given for -reuseport option}
diff --git a/tools/regexpTestLib.tcl b/tools/regexpTestLib.tcl
index 454a4e8..2687e67 100644
--- a/tools/regexpTestLib.tcl
+++ b/tools/regexpTestLib.tcl
@@ -183,9 +183,9 @@ proc convertTestLine {currentLine len lineNum srcLineNum} {
set noBraces 0
if {[regexp {=|>} $flags] == 1} {
regsub -all {_} $currentLine {\\ } currentLine
- regsub -all {A} $currentLine {\\007} currentLine
+ regsub -all {A} $currentLine {\\x07} currentLine
regsub -all {B} $currentLine {\\b} currentLine
- regsub -all {E} $currentLine {\\033} currentLine
+ regsub -all {E} $currentLine {\\x1B} currentLine
regsub -all {F} $currentLine {\\f} currentLine
regsub -all {N} $currentLine {\\n} currentLine
diff --git a/tools/tclOOScript.tcl b/tools/tclOOScript.tcl
index 10d3bf8..941f15c 100644
--- a/tools/tclOOScript.tcl
+++ b/tools/tclOOScript.tcl
@@ -195,7 +195,7 @@
#
# ----------------------------------------------------------------------
- proc define::classmethod {name {args {}} {body {}}} {
+ proc define::classmethod {name args} {
# Create the method on the class if the caller gave arguments and body
::set argc [::llength [::info level 0]]
::if {$argc == 3} {
@@ -205,7 +205,7 @@
}
::set cls [::uplevel 1 self]
::if {$argc == 4} {
- ::oo::define [::oo::DelegateName $cls] method $name $args $body
+ ::oo::define [::oo::DelegateName $cls] method $name {*}$args
}
# Make the connection by forwarding
::tailcall forward $name myclass $name
diff --git a/unix/Makefile.in b/unix/Makefile.in
index c6e4469..a5f8b23 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -857,7 +857,7 @@ clean: clean-packages
distclean: distclean-packages clean
rm -rf Makefile config.status config.cache config.log tclConfig.sh \
- tclConfig.h *.plist Tcl.framework tcl.pc
+ tclConfig.h *.plist Tcl.framework tcl.pc tclUuid.h
(cd dltest ; $(MAKE) distclean)
depend:
@@ -1058,9 +1058,9 @@ install-libraries: libraries
@echo "Installing package tcltest 2.5.5 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl \
"$(MODULE_INSTALL_DIR)/9.0/tcltest-2.5.5.tm"
- @echo "Installing package platform 1.0.18 as a Tcl Module"
+ @echo "Installing package platform 1.0.19 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl \
- "$(MODULE_INSTALL_DIR)/9.0/platform-1.0.18.tm"
+ "$(MODULE_INSTALL_DIR)/9.0/platform-1.0.19.tm"
@echo "Installing package platform::shell 1.1.4 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl \
"$(MODULE_INSTALL_DIR)/9.0/platform/shell-1.1.4.tm"
diff --git a/unix/README b/unix/README
index b8adc71..9dad93a 100644
--- a/unix/README
+++ b/unix/README
@@ -8,11 +8,11 @@ MacOSX platform too, but they all depend on UNIX (POSIX/ANSI C) interfaces and
some of them only make sense under UNIX.
Updated forms of the information found in this file is available at:
- https://www.tcl-tk.org/doc/howto/compile.html#unix
+ https://www.tcl-lang.org/doc/howto/compile.html#unix
For information on platforms where Tcl is known to compile, along with any
porting notes for getting it to work on those platforms, see:
- https://www.tcl-tk.org/software/tcltk/platforms.html
+ https://www.tcl-lang.org/software/tcltk/platforms.html
The rest of this file contains instructions on how to do this. The release
should compile and run either "out of the box" or with trivial changes on any
diff --git a/unix/configure b/unix/configure
index 4e69ed6..ca94150 100755
--- a/unix/configure
+++ b/unix/configure
@@ -11237,15 +11237,11 @@ fi
# Replace ${VERSION} with contents of ${TCL_VERSION}
# double-eval to account for TCL_TRIM_DOTS.
#
-eval "TCL_STUB_LIB_FILE=libtclstub${TCL_UNSHARED_LIB_SUFFIX}"
+eval "TCL_STUB_LIB_FILE=libtclstub.a"
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
eval "TCL_STUB_LIB_DIR=\"${libdir}\""
-if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
- TCL_STUB_LIB_FLAG="-ltclstub${TCL_VERSION}"
-else
- TCL_STUB_LIB_FLAG="-ltclstub`echo ${TCL_VERSION} | tr -d .`"
-fi
+TCL_STUB_LIB_FLAG="-ltclstub"
TCL_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
TCL_STUB_LIB_SPEC="-L${TCL_STUB_LIB_DIR} ${TCL_STUB_LIB_FLAG}"
diff --git a/unix/configure.ac b/unix/configure.ac
index a1a6b17..29933bd 100644
--- a/unix/configure.ac
+++ b/unix/configure.ac
@@ -932,15 +932,11 @@ fi
# Replace ${VERSION} with contents of ${TCL_VERSION}
# double-eval to account for TCL_TRIM_DOTS.
#
-eval "TCL_STUB_LIB_FILE=libtclstub${TCL_UNSHARED_LIB_SUFFIX}"
+eval "TCL_STUB_LIB_FILE=libtclstub.a"
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
eval "TCL_STUB_LIB_DIR=\"${libdir}\""
-if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
- TCL_STUB_LIB_FLAG="-ltclstub${TCL_VERSION}"
-else
- TCL_STUB_LIB_FLAG="-ltclstub`echo ${TCL_VERSION} | tr -d .`"
-fi
+TCL_STUB_LIB_FLAG="-ltclstub"
TCL_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
TCL_STUB_LIB_SPEC="-L${TCL_STUB_LIB_DIR} ${TCL_STUB_LIB_FLAG}"
diff --git a/unix/dltest/Makefile.in b/unix/dltest/Makefile.in
index 7a872c5..19b7d84 100644
--- a/unix/dltest/Makefile.in
+++ b/unix/dltest/Makefile.in
@@ -25,11 +25,15 @@ LDFLAGS = @LDFLAGS_DEFAULT@ @LDFLAGS@
CC_SWITCHES = $(CFLAGS) -I${SRC_DIR}/../../generic -DTCL_MEM_DEBUG \
${SHLIB_CFLAGS} -DUSE_TCL_STUBS ${AC_FLAGS}
-all: embtest tcl9pkga${SHLIB_SUFFIX} tcl9pkgb${SHLIB_SUFFIX} tcl9pkgc${SHLIB_SUFFIX} tcl9pkgd${SHLIB_SUFFIX} tcl9pkge${SHLIB_SUFFIX} tcl9pkgua${SHLIB_SUFFIX} tcl9pkgooa${SHLIB_SUFFIX}
+all: embtest tcl9pkga${SHLIB_SUFFIX} tcl9pkgb${SHLIB_SUFFIX} tcl9pkgc${SHLIB_SUFFIX} \
+ tcl9pkgd${SHLIB_SUFFIX} tcl9pkge${SHLIB_SUFFIX} tcl9pkgua${SHLIB_SUFFIX} tcl9pkgooa${SHLIB_SUFFIX} \
+ pkga${SHLIB_SUFFIX} pkgb${SHLIB_SUFFIX} pkgc${SHLIB_SUFFIX}
@if test -n "$(DLTEST_SUFFIX)"; then $(MAKE) dltest_suffix; fi
@touch ../dltest.marker
-dltest_suffix: tcl9pkga${DLTEST_SUFFIX} tcl9pkgb${DLTEST_SUFFIX} tcl9pkgc${DLTEST_SUFFIX} tcl9pkgd${DLTEST_SUFFIX} tcl9pkge${DLTEST_SUFFIX} tcl9pkgua${DLTEST_SUFFIX} tcl9pkgooa${DLTEST_SUFFIX}
+dltest_suffix: tcl9pkga${DLTEST_SUFFIX} tcl9pkgb${DLTEST_SUFFIX} tcl9pkgc${DLTEST_SUFFIX} \
+ tcl9pkgd${DLTEST_SUFFIX} tcl9pkge${DLTEST_SUFFIX} tcl9pkgua${DLTEST_SUFFIX} tcl9pkgooa${DLTEST_SUFFIX} \
+ pkga${DLTEST_SUFFIX} pkgb${DLTEST_SUFFIX} pkgc${DLTEST_SUFFIX}
@touch ../dltest.marker
embtest.o: $(SRC_DIR)/embtest.c
@@ -47,6 +51,15 @@ pkgb.o: $(SRC_DIR)/pkgb.c
pkgc.o: $(SRC_DIR)/pkgc.c
$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgc.c
+tcl8pkga.o: $(SRC_DIR)/pkga.c
+ $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(SRC_DIR)/pkga.c
+
+tcl8pkgb.o: $(SRC_DIR)/pkgb.c
+ $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(SRC_DIR)/pkgb.c
+
+tcl8pkgc.o: $(SRC_DIR)/pkgc.c
+ $(CC) -o $@ -c $(CC_SWITCHES) -DTCL_MAJOR_VERSION=8 $(SRC_DIR)/pkgc.c
+
pkgd.o: $(SRC_DIR)/pkgd.c
$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgd.c
@@ -74,6 +87,15 @@ tcl9pkgb${SHLIB_SUFFIX}: pkgb.o
tcl9pkgc${SHLIB_SUFFIX}: pkgc.o
${SHLIB_LD} -o $@ pkgc.o ${SHLIB_LD_LIBS}
+pkga${SHLIB_SUFFIX}: tcl8pkga.o
+ ${SHLIB_LD} -o $@ tcl8pkga.o ${SHLIB_LD_LIBS}
+
+pkgb${SHLIB_SUFFIX}: tcl8pkgb.o
+ ${SHLIB_LD} -o $@ tcl8pkgb.o ${SHLIB_LD_LIBS}
+
+pkgc${SHLIB_SUFFIX}: tcl8pkgc.o
+ ${SHLIB_LD} -o $@ tcl8pkgc.o ${SHLIB_LD_LIBS}
+
tcl9pkgd${SHLIB_SUFFIX}: pkgd.o
${SHLIB_LD} -o $@ pkgd.o ${SHLIB_LD_LIBS}
@@ -98,6 +120,15 @@ tcl9pkgb${DLTEST_SUFFIX}: pkgb.o
tcl9pkgc${DLTEST_SUFFIX}: pkgc.o
${DLTEST_LD} -o $@ pkgc.o ${SHLIB_LD_LIBS}
+pkga${DLTEST_SUFFIX}: tcl8pkga.o
+ ${DLTEST_LD} -o $@ tcl8pkga.o ${SHLIB_LD_LIBS}
+
+pkgb${DLTEST_SUFFIX}: tcl8pkgb.o
+ ${DLTEST_LD} -o $@ tcl8pkgb.o ${SHLIB_LD_LIBS}
+
+pkgc${DLTEST_SUFFIX}: tcl8pkgc.o
+ ${DLTEST_LD} -o $@ tcl8pkgc.o ${SHLIB_LD_LIBS}
+
tcl9pkgd${DLTEST_SUFFIX}: pkgd.o
${DLTEST_LD} -o $@ pkgd.o ${SHLIB_LD_LIBS}
diff --git a/unix/tcl.pc.in b/unix/tcl.pc.in
index 21ea0ce..5f90c41 100644
--- a/unix/tcl.pc.in
+++ b/unix/tcl.pc.in
@@ -8,7 +8,7 @@ libfile=@TCL_LIB_FILE@
Name: Tool Command Language
Description: Tcl is a powerful, easy-to-learn dynamic programming language, suitable for a wide range of uses.
-URL: https://www.tcl-tk.org/
+URL: https://www.tcl-lang.org/
Version: @TCL_VERSION@@TCL_PATCH_LEVEL@
Requires.private: zlib >= 1.2.3, libtommath >= 1.2.0
Libs: -L${libdir} @TCL_LIB_FLAG@ @TCL_STUB_LIB_FLAG@
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index adcda4f..864d477 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -319,29 +319,6 @@ Tcl_GetHostName(void)
/*
* ----------------------------------------------------------------------
*
- * TclpHasSockets --
- *
- * Detect if sockets are available on this platform.
- *
- * Results:
- * Returns TCL_OK.
- *
- * Side effects:
- * None.
- *
- * ----------------------------------------------------------------------
- */
-
-int
-TclpHasSockets(
- TCL_UNUSED(Tcl_Interp *))
-{
- return TCL_OK;
-}
-
-/*
- * ----------------------------------------------------------------------
- *
* TclpFinalizeSockets --
*
* Performs per-thread socket subsystem finalization.
@@ -1670,6 +1647,7 @@ Tcl_OpenTcpServerEx(
const char *service, /* Port number to open. */
const char *myHost, /* Name of local host. */
unsigned int flags, /* Flags. */
+ int backlog, /* Length of OS listen backlog queue. */
Tcl_TcpAcceptProc *acceptProc,
/* Callback for accepting connections from new
* clients. */
@@ -1835,7 +1813,10 @@ Tcl_OpenTcpServerEx(
chosenport = ntohs(sockname.sa4.sin_port);
}
}
- status = listen(sock, SOMAXCONN);
+ if (backlog < 0) {
+ backlog = SOMAXCONN;
+ }
+ status = listen(sock, backlog);
if (status < 0) {
if (howfar < LISTEN) {
howfar = LISTEN;
diff --git a/win/Makefile.in b/win/Makefile.in
index fed72a7..a74808b 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -150,8 +150,10 @@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@
TCL_DLL_FILE = @TCL_DLL_FILE@
TCL_LIB_FILE = @TCL_LIB_FILE@
DDE_DLL_FILE = tcl9dde$(DDEVER)${DLLSUFFIX}
+DDE_DLL_FILE8 = dde$(DDEVER)${DLLSUFFIX}
DDE_LIB_FILE = @LIBPREFIX@tcldde$(DDEVER)${DLLSUFFIX}${LIBSUFFIX}
REG_DLL_FILE = tcl9registry$(REGVER)${DLLSUFFIX}
+REG_DLL_FILE8 = registry$(REGVER)${DLLSUFFIX}
REG_LIB_FILE = @LIBPREFIX@tclregistry$(REGVER)${DLLSUFFIX}${LIBSUFFIX}
TEST_DLL_FILE = tcltest$(VER)${DLLSUFFIX}
TEST_EXE_FILE = tcltest${EXESUFFIX}
@@ -515,7 +517,7 @@ tcltest: binaries $(TEST_EXE_FILE) $(TEST_DLL_FILE) $(CAT32) tcltest.cmd
binaries: $(TCL_STUB_LIB_FILE) @LIBRARIES@ winextensions ${TCL_ZIP_FILE} $(TCLSH)
-winextensions: ${DDE_DLL_FILE} ${REG_DLL_FILE}
+winextensions: ${DDE_DLL_FILE} ${REG_DLL_FILE} ${DDE_DLL_FILE8} ${REG_DLL_FILE8}
libraries:
@@ -589,6 +591,14 @@ ${REG_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${REG_OBJS}
@MAKE_DLL@ ${REG_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS)
$(COPY) tclsh.exe.manifest ${REG_DLL_FILE}.manifest
+${DDE_DLL_FILE8}: ${TCL_STUB_LIB_FILE} ${DDE_OBJS}
+ @MAKE_DLL@ -DTCL_MAJOR_VERSION=8 ${DDE_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS)
+ $(COPY) tclsh.exe.manifest ${DDE_DLL_FILE8}.manifest
+
+${REG_DLL_FILE8}: ${TCL_STUB_LIB_FILE} ${REG_OBJS}
+ @MAKE_DLL@ -DTCL_MAJOR_VERSION=8 ${REG_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS)
+ $(COPY) tclsh.exe.manifest ${REG_DLL_FILE8}.manifest
+
${TEST_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS}
@$(RM) ${TEST_DLL_FILE} ${TEST_LIB_FILE}
@MAKE_DLL@ ${TCLTEST_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS)
@@ -840,6 +850,10 @@ install-binaries: binaries
$(COPY) $(ROOT_DIR)/library/dde/pkgIndex.tcl \
"$(LIB_INSTALL_DIR)/dde${DDEDOTVER}"; \
fi
+ @if [ -f $(DDE_DLL_FILE8) ]; then \
+ echo Installing $(DDE_DLL_FILE8); \
+ $(COPY) $(DDE_DLL_FILE8) "$(LIB_INSTALL_DIR)/dde${DDEDOTVER}"; \
+ fi
@if [ -f $(DDE_LIB_FILE) ]; then \
echo Installing $(DDE_LIB_FILE); \
$(COPY) $(DDE_LIB_FILE) "$(LIB_INSTALL_DIR)/dde${DDEDOTVER}"; \
@@ -850,6 +864,10 @@ install-binaries: binaries
$(COPY) $(ROOT_DIR)/library/registry/pkgIndex.tcl \
"$(LIB_INSTALL_DIR)/registry${REGDOTVER}"; \
fi
+ @if [ -f $(REG_DLL_FILE8) ]; then \
+ echo Installing $(REG_DLL_FILE8); \
+ $(COPY) $(REG_DLL_FILE8) "$(LIB_INSTALL_DIR)/registry${REGDOTVER}"; \
+ fi
@if [ -f $(REG_LIB_FILE) ]; then \
echo Installing $(REG_LIB_FILE); \
$(COPY) $(REG_LIB_FILE) "$(LIB_INSTALL_DIR)/registry${REGDOTVER}"; \
@@ -900,8 +918,8 @@ install-libraries: libraries install-tzdata install-msgs
@$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl "$(MODULE_INSTALL_DIR)/9.0/msgcat-1.7.1.tm";
@echo "Installing package tcltest 2.5.5 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl "$(MODULE_INSTALL_DIR)/9.0/tcltest-2.5.5.tm";
- @echo "Installing package platform 1.0.18 as a Tcl Module";
- @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl "$(MODULE_INSTALL_DIR)/9.0/platform-1.0.18.tm";
+ @echo "Installing package platform 1.0.19 as a Tcl Module";
+ @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl "$(MODULE_INSTALL_DIR)/9.0/platform-1.0.19.tm";
@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/platform/shell.tcl "$(MODULE_INSTALL_DIR)/9.0/platform/shell-1.1.4.tm";
@echo "Installing encodings";
@@ -1006,7 +1024,7 @@ clean: cleanhelp clean-packages
distclean: distclean-packages clean
$(RM) Makefile config.status config.cache config.log tclConfig.sh \
- config.status.lineno tclsh.exe.manifest
+ config.status.lineno tclsh.exe.manifest tclUuid.h
#
# Bundled package targets
diff --git a/win/configure b/win/configure
index 703125e..d47fc6cb 100755
--- a/win/configure
+++ b/win/configure
@@ -5804,8 +5804,8 @@ eval "TCL_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\""
eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}"
-eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\""
-eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${LIBFLAGSUFFIX}\""
+eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${LIBSUFFIX}\""
+eval "TCL_STUB_LIB_FLAG=\"-ltclstub${LIBFLAGSUFFIX}\""
eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_STUB_LIB_FLAG}\""
eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\""
eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\""
diff --git a/win/configure.ac b/win/configure.ac
index dccc3b6..c6ff202 100644
--- a/win/configure.ac
+++ b/win/configure.ac
@@ -313,8 +313,8 @@ eval "TCL_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\""
eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}"
-eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\""
-eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${LIBFLAGSUFFIX}\""
+eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${LIBSUFFIX}\""
+eval "TCL_STUB_LIB_FLAG=\"-ltclstub${LIBFLAGSUFFIX}\""
eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TCL_STUB_LIB_FLAG}\""
eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\""
eval "TCL_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TCL_STUB_LIB_FILE}\""
diff --git a/win/rules.vc b/win/rules.vc
index fdc68e0..0dd6ef2 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -24,7 +24,7 @@ _RULES_VC = 1
# For modifications that are not backward-compatible, you *must* change
# the major version.
RULES_VERSION_MAJOR = 1
-RULES_VERSION_MINOR = 10
+RULES_VERSION_MINOR = 11
# The PROJECT macro must be defined by parent makefile.
!if "$(PROJECT)" == ""
@@ -707,7 +707,7 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg
!if defined(_TK_H)
!if [echo TK_MAJOR_VERSION = \>> versions.vc] \
- && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc]
+ && [nmakehlp -V $(_TK_H) "define TK_MAJOR_VERSION" >> versions.vc]
!endif
!if [echo TK_MINOR_VERSION = \>> versions.vc] \
&& [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc]
@@ -877,6 +877,11 @@ TCL_THREADS = 0
USE_THREAD_ALLOC= 0
!endif
+!if [nmakehlp -f $(OPTS) "tcl8"]
+!message *** Build for Tcl8
+TCL_BUILD_FOR = 8
+!endif
+
!if $(TCL_MAJOR_VERSION) == 8
!if [nmakehlp -f $(OPTS) "time64bit"]
!message *** Force 64-bit time_t
@@ -1146,7 +1151,11 @@ TCLLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT)
TCLLIB = $(OUT_DIR)\$(TCLLIBNAME)
TCLSCRIPTZIP = $(OUT_DIR)\$(TCLSCRIPTZIPNAME)
+!if $(TCL_MAJOR_VERSION) == 8
TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
+!else
+TCLSTUBLIBNAME = $(STUBPREFIX).lib
+!endif
TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME)
TCL_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)"
@@ -1162,7 +1171,11 @@ TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:t=).exe
TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX:t=).exe
!endif
+!if $(TCL_MAJOR_VERSION) == 8
TCLSTUBLIB = $(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib
+!else
+TCLSTUBLIB = $(_TCLDIR)\lib\tclstub.lib
+!endif
TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:t=).lib
# When building extensions, may be linking against Tcl that does not add
# "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility.
@@ -1182,7 +1195,11 @@ TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:t=).exe
!if !exist($(TCLSH))
TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX:t=).exe
!endif
+!if $(TCL_MAJOR_VERSION) == 8
TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib
+!else
+TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub.lib
+!endif
TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:t=).lib
# When building extensions, may be linking against Tcl that does not add
# "t" suffix (e.g. 8.5 or 8.7). If lib not found check for that possibility.
@@ -1198,7 +1215,11 @@ TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win"
!endif # TCLINSTALL
+!if !$(STATIC_BUILD) && "$(TCL_BUILD_FOR)" == "8"
+tcllibs = "$(TCLSTUBLIB)"
+!else
tcllibs = "$(TCLSTUBLIB)" "$(TCLIMPLIB)"
+!endif
!endif # $(DOING_TCL)
@@ -1218,7 +1239,7 @@ WISHNAMEPREFIX = wish
WISHNAME = $(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe
TKLIBNAME8 = tk$(TK_VERSION)$(SUFX).$(EXT)
TKLIBNAME9 = tcl9tk$(TK_VERSION)$(SUFX).$(EXT)
-!if $(TCL_MAJOR_VERSION) == 8
+!if $(TCL_MAJOR_VERSION) == 8 || "$(TCL_BUILD_FOR)" == "8"
TKLIBNAME = tk$(TK_VERSION)$(SUFX).$(EXT)
TKIMPLIBNAME = tk$(TK_VERSION)$(SUFX).lib
!else
@@ -1275,14 +1296,18 @@ tklibs = "$(TKSTUBLIB)" "$(TKIMPLIB)"
PRJIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
PRJLIBNAME8 = $(PROJECT)$(VERSION)$(SUFX).$(EXT)
PRJLIBNAME9 = tcl9$(PROJECT)$(VERSION)$(SUFX).$(EXT)
-!if $(TCL_MAJOR_VERSION) == 8
+!if $(TCL_MAJOR_VERSION) == 8 || "$(TCL_BUILD_FOR)" == "8"
PRJLIBNAME = $(PRJLIBNAME8)
!else
PRJLIBNAME = $(PRJLIBNAME9)
!endif
PRJLIB = $(OUT_DIR)\$(PRJLIBNAME)
+!if $(TCL_MAJOR_VERSION) == 8
PRJSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
+!else
+PRJSTUBLIBNAME = $(STUBPREFIX).lib
+!endif
PRJSTUBLIB = $(OUT_DIR)\$(PRJSTUBLIBNAME)
# If extension parent makefile has not defined a resource definition file,
@@ -1429,6 +1454,9 @@ COMPILERFLAGS = /D_ATL_XP_TARGETING
!if "$(TCL_UTF_MAX)" == "3"
OPTDEFINES = $(OPTDEFINES) /DTCL_UTF_MAX=3
!endif
+!if "$(TCL_BUILD_FOR)" == "8"
+OPTDEFINES = $(OPTDEFINES) /DTCL_MAJOR_VERSION=8
+!endif
# Like the TEA system only set this non empty for non-Tk extensions
# Note: some extensions use PACKAGE_NAME and others use PACKAGE_TCLNAME
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index c004c16..4968802 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -1238,7 +1238,6 @@ TclpGetDefaultStdChannel(
*/
if (Tcl_SetChannelOption(NULL,channel,"-translation","auto")!=TCL_OK ||
- Tcl_SetChannelOption(NULL,channel,"-eofchar","\032 {}")!=TCL_OK ||
Tcl_SetChannelOption(NULL,channel,"-buffering",bufMode)!=TCL_OK) {
Tcl_CloseEx(NULL, channel, 0);
return (Tcl_Channel) NULL;
@@ -1315,7 +1314,6 @@ TclWinOpenFileChannel(
*/
Tcl_SetChannelOption(NULL, infoPtr->channel, "-translation", "auto");
- Tcl_SetChannelOption(NULL, infoPtr->channel, "-eofchar", "\032 {}");
return infoPtr->channel;
}
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index 8452cf1..9f6cadf 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -2200,7 +2200,6 @@ TclWinOpenConsoleChannel(
*/
Tcl_SetChannelOption(NULL, chanInfoPtr->channel, "-translation", "auto");
- Tcl_SetChannelOption(NULL, chanInfoPtr->channel, "-eofchar", "\032 {}");
Tcl_SetChannelOption(NULL, chanInfoPtr->channel, "-encoding", "utf-16");
return chanInfoPtr->channel;
}
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 62820a7..3fd3d7e 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -1827,14 +1827,7 @@ TclpCreateCommandChannel(
infoPtr->channel = Tcl_CreateChannel(&pipeChannelType, channelName,
infoPtr, infoPtr->validMask);
- /*
- * Pipes have AUTO translation mode on Windows and ^Z eof char, which
- * means that a ^Z will be appended to them at close. This is needed for
- * Windows programs that expect a ^Z at EOF.
- */
-
Tcl_SetChannelOption(NULL, infoPtr->channel, "-translation", "auto");
- Tcl_SetChannelOption(NULL, infoPtr->channel, "-eofchar", "\032 {}");
return infoPtr->channel;
}
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c
index a4ad3f3..3db36d5 100644
--- a/win/tclWinSerial.c
+++ b/win/tclWinSerial.c
@@ -1508,13 +1508,7 @@ TclWinOpenSerialChannel(
infoPtr->evWritable), 0, NULL);
}
- /*
- * Files have default translation of AUTO and ^Z eof char, which means
- * that a ^Z will be accepted as EOF when reading.
- */
-
Tcl_SetChannelOption(NULL, infoPtr->channel, "-translation", "auto");
- Tcl_SetChannelOption(NULL, infoPtr->channel, "-eofchar", "\032 {}");
return infoPtr->channel;
}
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 2174210..3c82caa 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -234,7 +234,6 @@ static TcpState * NewSocketInfo(SOCKET socket);
static void SocketExitHandler(void *clientData);
static LRESULT CALLBACK SocketProc(HWND hwnd, UINT message, WPARAM wParam,
LPARAM lParam);
-static int SocketsEnabled(void);
static void TcpAccept(TcpFdList *fds, SOCKET newSocket, address addr);
static int WaitForConnect(TcpState *statePtr, int *errorCodePtr);
static int WaitForSocketEvent(TcpState *statePtr, int events,
@@ -362,23 +361,22 @@ InitializeHostName(
Tcl_UtfToLower(Tcl_WCharToUtfDString(wbuf, TCL_INDEX_NONE, &ds));
} else {
- if (TclpHasSockets(NULL) == TCL_OK) {
- /*
- * The buffer size of 256 is recommended by the MSDN page that
- * documents gethostname() as being always adequate.
- */
+ TclInitSockets();
+ /*
+ * The buffer size of 256 is recommended by the MSDN page that
+ * documents gethostname() as being always adequate.
+ */
- Tcl_DString inDs;
+ Tcl_DString inDs;
- Tcl_DStringInit(&inDs);
- Tcl_DStringSetLength(&inDs, 256);
- if (gethostname(Tcl_DStringValue(&inDs),
- Tcl_DStringLength(&inDs)) == 0) {
- Tcl_ExternalToUtfDStringEx(NULL, Tcl_DStringValue(&inDs),
- TCL_INDEX_NONE, TCL_ENCODING_NOCOMPLAIN, &ds);
- }
- Tcl_DStringFree(&inDs);
+ Tcl_DStringInit(&inDs);
+ Tcl_DStringSetLength(&inDs, 256);
+ if (gethostname(Tcl_DStringValue(&inDs),
+ Tcl_DStringLength(&inDs)) == 0) {
+ Tcl_ExternalToUtfDStringEx(NULL, Tcl_DStringValue(&inDs),
+ TCL_INDEX_NONE, TCL_ENCODING_NOCOMPLAIN, &ds);
}
+ Tcl_DStringFree(&inDs);
}
*encodingPtr = Tcl_GetEncoding(NULL, "utf-8");
@@ -415,11 +413,9 @@ Tcl_GetHostName(void)
/*
*----------------------------------------------------------------------
*
- * TclpHasSockets --
+ * TclInitSockets --
*
- * This function determines whether sockets are available on the current
- * system and returns an error in interp if they are not. Note that
- * interp may be NULL.
+ * This function just calls InitSockets(), but is protected by a mutex.
*
* Results:
* Returns TCL_OK if the system supports sockets, or TCL_ERROR with an
@@ -433,24 +429,16 @@ Tcl_GetHostName(void)
*----------------------------------------------------------------------
*/
-int
-TclpHasSockets(
- Tcl_Interp *interp) /* Where to write an error message if sockets
- * are not present, or NULL if no such message
- * is to be written. */
+void
+TclInitSockets()
{
- Tcl_MutexLock(&socketMutex);
- InitSockets();
- Tcl_MutexUnlock(&socketMutex);
-
- if (SocketsEnabled()) {
- return TCL_OK;
- }
- if (interp != NULL) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "sockets are not available on this system", TCL_INDEX_NONE));
+ if (!initialized) {
+ Tcl_MutexLock(&socketMutex);
+ if (!initialized) {
+ InitSockets();
+ }
+ Tcl_MutexUnlock(&socketMutex);
}
- return TCL_ERROR;
}
/*
@@ -775,17 +763,6 @@ TcpInputProc(
*errorCodePtr = 0;
/*
- * Check that WinSock is initialized; do not call it if not, to prevent
- * system crashes. This can happen at exit time if the exit handler for
- * WinSock ran before other exit handlers that want to use sockets.
- */
-
- if (!SocketsEnabled()) {
- *errorCodePtr = EFAULT;
- return -1;
- }
-
- /*
* First check to see if EOF was already detected, to prevent calling the
* socket stack after the first time EOF is detected.
*/
@@ -918,17 +895,6 @@ TcpOutputProc(
*errorCodePtr = 0;
/*
- * Check that WinSock is initialized; do not call it if not, to prevent
- * system crashes. This can happen at exit time if the exit handler for
- * WinSock ran before other exit handlers that want to use sockets.
- */
-
- if (!SocketsEnabled()) {
- *errorCodePtr = EFAULT;
- return -1;
- }
-
- /*
* Check if there is an async connect running.
* For blocking sockets terminate connect, otherwise do one step.
* For a non blocking socket return EWOULDBLOCK if connect not terminated
@@ -1029,28 +995,20 @@ TcpCloseProc(
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
/*
- * Check that WinSock is initialized; do not call it if not, to prevent
- * system crashes. This can happen at exit time if the exit handler for
- * WinSock ran before other exit handlers that want to use sockets.
+ * Clean up the OS socket handle. The default Windows setting for a
+ * socket is SO_DONTLINGER, which does a graceful shutdown in the
+ * background.
*/
- if (SocketsEnabled()) {
- /*
- * Clean up the OS socket handle. The default Windows setting for a
- * socket is SO_DONTLINGER, which does a graceful shutdown in the
- * background.
- */
-
- while (statePtr->sockets != NULL) {
- TcpFdList *thisfd = statePtr->sockets;
+ while (statePtr->sockets != NULL) {
+ TcpFdList *thisfd = statePtr->sockets;
- statePtr->sockets = thisfd->next;
- if (closesocket(thisfd->fd) == SOCKET_ERROR) {
- Tcl_WinConvertError((DWORD) WSAGetLastError());
- errorCode = Tcl_GetErrno();
- }
- Tcl_Free(thisfd);
+ statePtr->sockets = thisfd->next;
+ if (closesocket(thisfd->fd) == SOCKET_ERROR) {
+ Tcl_WinConvertError((DWORD) WSAGetLastError());
+ errorCode = Tcl_GetErrno();
}
+ Tcl_Free(thisfd);
}
if (statePtr->addrlist != NULL) {
@@ -1177,33 +1135,18 @@ TcpSetOptionProc(
len = strlen(optionName);
}
- /*
- * Check that WinSock is initialized; do not call it if not, to prevent
- * system crashes. This can happen at exit time if the exit handler for
- * WinSock ran before other exit handlers that want to use sockets.
- */
-
- if (!SocketsEnabled()) {
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "winsock is not initialized", -1));
- }
- return TCL_ERROR;
- }
-
sock = statePtr->sockets->fd;
if ((len > 1) && (optionName[1] == 'k') &&
(strncmp(optionName, "-keepalive", len) == 0)) {
- BOOL val;
- int boolVar, rtn;
+ BOOL boolVar;
+ int rtn;
if (Tcl_GetBoolean(interp, value, &boolVar) != TCL_OK) {
return TCL_ERROR;
}
- val = boolVar ? TRUE : FALSE;
rtn = setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE,
- (const char *) &val, sizeof(BOOL));
+ (const char *) &boolVar, sizeof(boolVar));
if (rtn != 0) {
Tcl_WinConvertError(WSAGetLastError());
if (interp) {
@@ -1217,15 +1160,14 @@ TcpSetOptionProc(
}
if ((len > 1) && (optionName[1] == 'n') &&
(strncmp(optionName, "-nodelay", len) == 0)) {
- BOOL val;
- int boolVar, rtn;
+ BOOL boolVar;
+ int rtn;
if (Tcl_GetBoolean(interp, value, &boolVar) != TCL_OK) {
return TCL_ERROR;
}
- val = boolVar ? TRUE : FALSE;
rtn = setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
- (const char *) &val, sizeof(BOOL));
+ (const char *) &boolVar, sizeof(boolVar));
if (rtn != 0) {
Tcl_WinConvertError(WSAGetLastError());
if (interp) {
@@ -1279,20 +1221,6 @@ TcpGetOptionProc(
#define SUPPRESS_RDNS_VAR "::tcl::unsupported::noReverseDNS"
/*
- * Check that WinSock is initialized; do not call it if not, to prevent
- * system crashes. This can happen at exit time if the exit handler for
- * WinSock ran before other exit handlers that want to use sockets.
- */
-
- if (!SocketsEnabled()) {
- if (interp) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "winsock is not initialized", -1));
- }
- return TCL_ERROR;
- }
-
- /*
* Go one step in async connect
*
* If any error is thrown save it as backround error to report eventually
@@ -2015,19 +1943,7 @@ Tcl_OpenTcpClient(
struct addrinfo *addrlist = NULL, *myaddrlist = NULL;
char channelName[SOCK_CHAN_LENGTH];
- if (TclpHasSockets(interp) != TCL_OK) {
- return NULL;
- }
-
- /*
- * Check that WinSock is initialized; do not call it if not, to prevent
- * system crashes. This can happen at exit time if the exit handler for
- * WinSock ran before other exit handlers that want to use sockets.
- */
-
- if (!SocketsEnabled()) {
- return NULL;
- }
+ TclInitSockets();
/*
* Do the name lookups for the local and remote addresses.
@@ -2101,9 +2017,7 @@ Tcl_MakeTcpClientChannel(
char channelName[SOCK_CHAN_LENGTH];
ThreadSpecificData *tsdPtr;
- if (TclpHasSockets(NULL) != TCL_OK) {
- return NULL;
- }
+ TclInitSockets();
tsdPtr = (ThreadSpecificData *)TclThreadDataKeyGet(&dataKey);
@@ -2152,6 +2066,8 @@ Tcl_OpenTcpServerEx(
const char *service, /* Port number to open. */
const char *myHost, /* Name of local host. */
unsigned int flags, /* Flags. */
+ int backlog, /* Length of OS listen backlog queue, or -1
+ * for default. */
Tcl_TcpAcceptProc *acceptProc,
/* Callback for accepting connections from new
* clients. */
@@ -2167,19 +2083,7 @@ Tcl_OpenTcpServerEx(
const char *errorMsg = NULL;
int optvalue, port;
- if (TclpHasSockets(interp) != TCL_OK) {
- return NULL;
- }
-
- /*
- * Check that WinSock is initialized; do not call it if not, to prevent
- * system crashes. This can happen at exit time if the exit handler for
- * WinSock ran before other exit handlers that want to use sockets.
- */
-
- if (!SocketsEnabled()) {
- return NULL;
- }
+ TclInitSockets();
/*
* Construct the addresses for each end of the socket.
@@ -2274,7 +2178,10 @@ Tcl_OpenTcpServerEx(
* different, and there may be differences between TCP/IP stacks).
*/
- if (listen(sock, SOMAXCONN) == SOCKET_ERROR) {
+ if (backlog < 0) {
+ backlog = SOMAXCONN;
+ }
+ if (listen(sock, backlog) == SOCKET_ERROR) {
Tcl_WinConvertError((DWORD) WSAGetLastError());
closesocket(sock);
continue;
@@ -2507,55 +2414,19 @@ InitSockets(void)
WaitForSingleObject(tsdPtr->readyEvent, INFINITE);
- if (tsdPtr->hwnd == NULL) {
- goto initFailure; /* Trouble creating the window. */
+ if (tsdPtr->hwnd != NULL) {
+ Tcl_CreateEventSource(SocketSetupProc, SocketCheckProc, NULL);
+ return;
}
- Tcl_CreateEventSource(SocketSetupProc, SocketCheckProc, NULL);
- return;
-
initFailure:
- TclpFinalizeSockets();
- initialized = -1;
+ Tcl_Panic("InitSockets failed");
return;
}
/*
*----------------------------------------------------------------------
*
- * SocketsEnabled --
- *
- * Check that the WinSock was successfully initialized.
- *
- * Warning:
- * This check was useful in times of Windows98 where WinSock may
- * not be available. This is not the case any more.
- * This function may be removed with TCL 9.0
- *
- * Results:
- * 1 if it is.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-SocketsEnabled(void)
-{
- int enabled;
-
- Tcl_MutexLock(&socketMutex);
- enabled = (initialized == 1);
- Tcl_MutexUnlock(&socketMutex);
- return enabled;
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
* SocketExitHandler --
*
* Callback invoked during exit clean up to delete the socket
@@ -3385,9 +3256,7 @@ TcpThreadActionProc(
* sockets will not work.
*/
- Tcl_MutexLock(&socketMutex);
- InitSockets();
- Tcl_MutexUnlock(&socketMutex);
+ TclInitSockets();
tsdPtr = TCL_TSD_INIT(&dataKey);