Compare commits
279
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95d7850d9e | ||
|
|
b97b608974 | ||
|
|
7a91dd767e | ||
|
|
48a249a15e | ||
|
|
678622482a | ||
|
|
c23982e3c2 | ||
|
|
a85834a18e | ||
|
|
36aca800d0 | ||
|
|
a14cef18c0 | ||
|
|
b104b5ce6e | ||
|
|
a794e440ae | ||
|
|
1905291fed | ||
|
|
09a6e8adca | ||
|
|
d513bef710 | ||
|
|
751fe9de93 | ||
|
|
0569fc46c8 | ||
|
|
697d8c5398 | ||
|
|
bdc679352c | ||
|
|
e42804a0c2 | ||
|
|
368acc3d50 | ||
|
|
4f69e81ae0 | ||
|
|
50698aacbf | ||
|
|
b86f569b11 | ||
|
|
754c5a5fe1 | ||
|
|
4cc60d34fb | ||
|
|
e1e6b685fd | ||
|
|
cc19135f2e | ||
|
|
2cf7904bd2 | ||
|
|
84fe9556f1 | ||
|
|
c20405e576 | ||
|
|
795355ee43 | ||
|
|
2977f2ab44 | ||
|
|
8ecdd7277d | ||
|
|
93e9d2457c | ||
|
|
3f7e1dc18f | ||
|
|
6111cf68fe | ||
|
|
f8081ac245 | ||
|
|
a14ab9eecb | ||
|
|
ccb7c3b60b | ||
|
|
c5ae3a0a2d | ||
|
|
c7e8d507d9 | ||
|
|
cb242c0d50 | ||
|
|
24c4a4cc6e | ||
|
|
683e97521e | ||
|
|
e5f3c1495b | ||
|
|
057d325d35 | ||
|
|
54654ae7e4 | ||
|
|
a6dd04e6da | ||
|
|
14a3439dd8 | ||
|
|
695856b85c | ||
|
|
d07756fc70 | ||
|
|
79c79df0e1 | ||
|
|
2e1e641d75 | ||
|
|
aef69d0b0f | ||
|
|
bfb19782c9 | ||
|
|
b31a3b3d70 | ||
|
|
fa036d2b99 | ||
|
|
f5bf130f05 | ||
|
|
701d9dbe89 | ||
|
|
64ef84994a | ||
|
|
494a47ee6e | ||
|
|
f9a0feeb4b | ||
|
|
fcfee868a9 | ||
|
|
e4364f45cc | ||
|
|
967136cc0f | ||
|
|
5335ab79e5 | ||
|
|
6ce7eb980b | ||
|
|
6bd80d67e4 | ||
|
|
e905a75c0f | ||
|
|
ee2574ddce | ||
|
|
e543dbc09c | ||
|
|
32aa419154 | ||
|
|
010f610a80 | ||
|
|
102d58a165 | ||
|
|
3c6933efc0 | ||
|
|
a43cab006e | ||
|
|
93fa41f6c7 | ||
|
|
eb5da6ae82 | ||
|
|
4786f9814b | ||
|
|
d695e02d2f | ||
|
|
1c58e29da2 | ||
|
|
ed6aa022a6 | ||
|
|
0019582fd2 | ||
|
|
d34c6b6526 | ||
|
|
b40ed15606 | ||
|
|
904582dd30 | ||
|
|
d08f08a24d | ||
|
|
7172ae9071 | ||
|
|
63224df965 | ||
|
|
b067895cc4 | ||
|
|
e754f70125 | ||
|
|
2a5955ee50 | ||
|
|
264c508ca4 | ||
|
|
7fdcf0c76d | ||
|
|
7835ba29c7 | ||
|
|
a15b801bfb | ||
|
|
1b40a62611 | ||
|
|
2bfe68441a | ||
|
|
82512215ff | ||
|
|
a430544f4a | ||
|
|
0a2389d0ab | ||
|
|
4a98f5042e | ||
|
|
62545de5ce | ||
|
|
ab6e69444f | ||
|
|
8bc8d823bb | ||
|
|
0ebe3d394d | ||
|
|
5501e78098 | ||
|
|
5de1c8c6a5 | ||
|
|
e58661a87e | ||
|
|
5b605792cb | ||
|
|
5724764152 | ||
|
|
ae26eec096 | ||
|
|
2623503549 | ||
|
|
a7bb7b19d6 | ||
|
|
1e64c9f8b2 | ||
|
|
b68bab17c0 | ||
|
|
b6b032fc3b | ||
|
|
200910b9c1 | ||
|
|
0bd09c4106 | ||
|
|
ff91f80124 | ||
|
|
e802927981 | ||
|
|
9d4d161834 | ||
|
|
111f52def6 | ||
|
|
9dd792a540 | ||
|
|
20bbe0a790 | ||
|
|
94b624f11c | ||
|
|
5a9014a650 | ||
|
|
a6a61c4ca6 | ||
|
|
121654ecd8 | ||
|
|
d0e9170c39 | ||
|
|
75a121d773 | ||
|
|
adc8a8bbdf | ||
|
|
466e0f29c3 | ||
|
|
de0ff2272e | ||
|
|
b9216a9c1f | ||
|
|
43f411afeb | ||
|
|
a35ad3e794 | ||
|
|
cd80622d5e | ||
|
|
26c5e61700 | ||
|
|
de9a7da4ba | ||
|
|
c1f627b31e | ||
|
|
4ed027b7bc | ||
|
|
258b9f4333 | ||
|
|
a31c699833 | ||
|
|
9c9ce91ef5 | ||
|
|
c38755a732 | ||
|
|
9c75e1c5f8 | ||
|
|
8a090098fe | ||
|
|
547a4781df | ||
|
|
77140c23d4 | ||
|
|
382ff46e71 | ||
|
|
0af0a4ef07 | ||
|
|
ee2b083ea7 | ||
|
|
2c4866bd92 | ||
|
|
08553f531f | ||
|
|
7e7ec63c2c | ||
|
|
e354aa0e3d | ||
|
|
0957b2c850 | ||
|
|
57665b295c | ||
|
|
dfff588886 | ||
|
|
ca7c7ce1b7 | ||
|
|
4349c08e31 | ||
|
|
bb71951f1a | ||
|
|
4f37f05a9c | ||
|
|
abc5015131 | ||
|
|
f50166e4fc | ||
|
|
2c163978e7 | ||
|
|
4acf174468 | ||
|
|
e8b3de6a75 | ||
|
|
6fa4858662 | ||
|
|
dd7709baa2 | ||
|
|
c67bfbf1a4 | ||
|
|
b0bf6914f1 | ||
|
|
330e115d11 | ||
|
|
03c4df2e30 | ||
|
|
ff878198ef | ||
|
|
84707cf702 | ||
|
|
d8b1866404 | ||
|
|
45c9d1dc2c | ||
|
|
a3100689bc | ||
|
|
014e7b1951 | ||
|
|
ad5f7e5464 | ||
|
|
3b0f6c1c31 | ||
|
|
4198cbe8cd | ||
|
|
3e3a85339f | ||
|
|
adf3bedc0c | ||
|
|
c260fedf0c | ||
|
|
1c58938f2c | ||
|
|
051f9006ef | ||
|
|
361141a857 | ||
|
|
75194c3206 | ||
|
|
04a740f5c6 | ||
|
|
6aa85ad35f | ||
|
|
6797693d1b | ||
|
|
aef36bf11d | ||
|
|
0dc45b9fe3 | ||
|
|
e65b021050 | ||
|
|
b5100ee98f | ||
|
|
2951fec86b | ||
|
|
d07793f49c | ||
|
|
2acbdb0493 | ||
|
|
e00ad288cc | ||
|
|
5b8ce14566 | ||
|
|
facce70703 | ||
|
|
26f4ba76ca | ||
|
|
aaf8665696 | ||
|
|
e4dd07e735 | ||
|
|
e98a68549d | ||
|
|
1fc4f8eaa3 | ||
|
|
70bccae334 | ||
|
|
052f5d50c9 | ||
|
|
5815a325af | ||
|
|
3ff398393a | ||
|
|
ef0bb68bcb | ||
|
|
382a840e23 | ||
|
|
1e6fd4531c | ||
|
|
21e80b3a25 | ||
|
|
8e6efd7026 | ||
|
|
39365ed3c0 | ||
|
|
f52f05c3b1 | ||
|
|
388741b7d0 | ||
|
|
b2ca802381 | ||
|
|
b05600e60a | ||
|
|
98a8b3604f | ||
|
|
905d1e5d03 | ||
|
|
cb7c84c310 | ||
|
|
03bdf41de2 | ||
|
|
206428d2cf | ||
|
|
bc0d613154 | ||
|
|
1d6f003314 | ||
|
|
e81a4abd60 | ||
|
|
06ebe62a5e | ||
|
|
0d78d389e1 | ||
|
|
eea64f8d90 | ||
|
|
4c5cc88bdf | ||
|
|
a1cee7cd20 | ||
|
|
3327979282 | ||
|
|
8c19725a30 | ||
|
|
0a224ddfc8 | ||
|
|
9a7c011683 | ||
|
|
44427fccaa | ||
|
|
c4cf77f310 | ||
|
|
9b00a63b22 | ||
|
|
91d9bd02c0 | ||
|
|
56b69c4e9a | ||
|
|
d2b1e66352 | ||
|
|
d29d888dc6 | ||
|
|
f4ed4079b7 | ||
|
|
dde5a2565e | ||
|
|
e59a1e0b14 | ||
|
|
c4b5bfbd50 | ||
|
|
44869c9e35 | ||
|
|
e5463e8ec8 | ||
|
|
bddf737714 | ||
|
|
ef0fd808de | ||
|
|
f4fb1d1752 | ||
|
|
59ea8cb145 | ||
|
|
e9cf99c212 | ||
|
|
80630f4ec9 | ||
|
|
e63dcc2677 | ||
|
|
9bbc90b227 | ||
|
|
8e5dbc8a27 | ||
|
|
29c6b72a83 | ||
|
|
fd5b3bb085 | ||
|
|
2fda7e49a0 | ||
|
|
27256fcd71 | ||
|
|
e702454abe | ||
|
|
9423df2491 | ||
|
|
05b1764f74 | ||
|
|
bff7817ec0 | ||
|
|
13bc69a8a4 | ||
|
|
9aa711e8e0 | ||
|
|
b339d4bf03 | ||
|
|
1e58e8e42d | ||
|
|
91af7f6f90 | ||
|
|
68191ded75 | ||
|
|
ac3d0b69d3 | ||
|
|
96f611f896 | ||
|
|
ec9c29c80d |
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>tcl8</name>
|
||||
<name>tcl9</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
README: Tcl
|
||||
This is the Tcl 8.7a2 source distribution.
|
||||
This is the Tcl 9.0a0 source distribution.
|
||||
http://sourceforge.net/projects/tcl/files/Tcl/
|
||||
You can get any source release of Tcl from the URL above.
|
||||
|
||||
@@ -49,7 +49,7 @@ and selling it either in whole or in part. See the file
|
||||
|
||||
Extensive documentation is available at our website.
|
||||
The home page for this release, including new features, is
|
||||
http://www.tcl.tk/software/tcltk/8.7.html
|
||||
http://www.tcl.tk/software/tcltk/9.0.html
|
||||
|
||||
Detailed release notes can be found at the file distributions page
|
||||
by clicking on the relevant version.
|
||||
@@ -61,9 +61,9 @@ Information about Tcl itself can be found at
|
||||
There have been many Tcl books on the market. Many are mentioned in the Wiki:
|
||||
http://wiki.tcl.tk/_/ref?N=25206
|
||||
|
||||
To view the complete set of reference manual entries for Tcl 8.7 online,
|
||||
To view the complete set of reference manual entries for Tcl 9.0 online,
|
||||
visit the URL:
|
||||
http://www.tcl.tk/man/tcl8.7/
|
||||
http://www.tcl.tk/man/tcl9.0/
|
||||
|
||||
2a. Unix Documentation
|
||||
----------------------
|
||||
|
||||
+1
-6
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
|
||||
Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorLine, Tcl_GetErrorLine, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -30,8 +30,6 @@ int
|
||||
.sp
|
||||
\fBTcl_SetErrorCode\fR(\fIinterp, element, element, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
\fBTcl_SetErrorCodeVA\fR(\fIinterp, argList\fR)
|
||||
.sp
|
||||
\fBTcl_GetErrorLine\fR(\fIinterp\fR)
|
||||
.sp
|
||||
\fBTcl_SetErrorLine\fR(\fIinterp, lineNum\fR)
|
||||
@@ -245,9 +243,6 @@ The procedure \fBTcl_SetErrorCode\fR is also used to set the
|
||||
record instead of a value. Otherwise, it is similar to
|
||||
\fBTcl_SetObjErrorCode\fR in behavior.
|
||||
.PP
|
||||
\fBTcl_SetErrorCodeVA\fR is the same as \fBTcl_SetErrorCode\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument list.
|
||||
.PP
|
||||
The procedure \fBTcl_GetErrorLine\fR is used to read the integer value
|
||||
of the \fB\-errorline\fR return option without the overhead of a full
|
||||
call to \fBTcl_GetReturnOptions\fR. Likewise, \fBTcl_SetErrorLine\fR
|
||||
|
||||
+1
-2
@@ -30,8 +30,7 @@ or \fBTCL_RETURN\fR, then Tcl normally converts this into a \fBTCL_ERROR\fR
|
||||
return with an appropriate message. The particular script
|
||||
evaluation procedures of Tcl that act in the manner are
|
||||
\fBTcl_EvalObjEx\fR, \fBTcl_EvalObjv\fR, \fBTcl_Eval\fR, \fBTcl_EvalEx\fR,
|
||||
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR, \fBTcl_VarEval\fR and
|
||||
\fBTcl_VarEvalVA\fR.
|
||||
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR and \fBTcl_VarEval\fR.
|
||||
.PP
|
||||
However, if \fBTcl_AllowExceptions\fR is invoked immediately before
|
||||
calling one of those a procedures, then arbitrary completion
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1989-1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_Backslash 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_Backslash \- parse a backslash sequence
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
char
|
||||
\fBTcl_Backslash\fR(\fIsrc, countPtr\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS char *countPtr out
|
||||
.AP char *src in
|
||||
Pointer to a string starting with a backslash.
|
||||
.AP int *countPtr out
|
||||
If \fIcountPtr\fR is not NULL, \fI*countPtr\fR gets filled
|
||||
in with number of characters in the backslash sequence, including
|
||||
the backslash character.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The use of \fBTcl_Backslash\fR is deprecated in favor of
|
||||
\fBTcl_UtfBackslash\fR.
|
||||
.PP
|
||||
This is a utility procedure provided for backwards compatibility with
|
||||
non-internationalized Tcl extensions. It parses a backslash sequence and
|
||||
returns the low byte of the Unicode character corresponding to the sequence.
|
||||
\fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number of
|
||||
characters in the backslash sequence.
|
||||
.PP
|
||||
See the Tcl manual entry for information on the valid backslash sequences.
|
||||
All of the sequences described in the Tcl manual entry are supported by
|
||||
\fBTcl_Backslash\fR.
|
||||
.SH "SEE ALSO"
|
||||
Tcl(n), Tcl_UtfBackslash(3)
|
||||
|
||||
.SH KEYWORDS
|
||||
backslash, parse
|
||||
@@ -1,162 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1989-1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH Tcl_CreateMathFunc 3 8.4 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_CreateMathFunc, Tcl_GetMathFuncInfo, Tcl_ListMathFuncs \- Define, query and enumerate math functions for expressions
|
||||
.SH "NOTICE OF EVENTUAL DEPRECATION"
|
||||
.PP
|
||||
The \fBTcl_CreateMathFunc\fR and \fBTcl_GetMathFuncInfo\fR functions
|
||||
are rendered somewhat obsolete by the ability to create functions for
|
||||
expressions by placing commands in the \fBtcl::mathfunc\fR namespace,
|
||||
as described in the \fBmathfunc\fR manual page; the API described on
|
||||
this page is not expected to be maintained indefinitely.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
.sp
|
||||
void
|
||||
\fBTcl_CreateMathFunc\fR(\fIinterp, name, numArgs, argTypes, proc, clientData\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_GetMathFuncInfo\fR(\fIinterp, name, numArgsPtr, argTypesPtr, procPtr,
|
||||
clientDataPtr\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_ListMathFuncs\fR(\fIinterp, pattern\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_ValueType *clientDataPtr out
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which new function will be defined.
|
||||
.AP "const char" *name in
|
||||
Name for new function.
|
||||
.AP int numArgs in
|
||||
Number of arguments to new function; also gives size of \fIargTypes\fR array.
|
||||
.AP Tcl_ValueType *argTypes in
|
||||
Points to an array giving the permissible types for each argument to
|
||||
function.
|
||||
.AP Tcl_MathProc *proc in
|
||||
Procedure that implements the function.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary one-word value to pass to \fIproc\fR when it is invoked.
|
||||
.AP int *numArgsPtr out
|
||||
Points to a variable that will be set to contain the number of
|
||||
arguments to the function.
|
||||
.AP Tcl_ValueType **argTypesPtr out
|
||||
Points to a variable that will be set to contain a pointer to an array
|
||||
giving the permissible types for each argument to the function which
|
||||
will need to be freed up using \fITcl_Free\fR.
|
||||
.AP Tcl_MathProc **procPtr out
|
||||
Points to a variable that will be set to contain a pointer to the
|
||||
implementation code for the function (or NULL if the function is
|
||||
implemented directly in bytecode).
|
||||
.AP ClientData *clientDataPtr out
|
||||
Points to a variable that will be set to contain the clientData
|
||||
argument passed to \fITcl_CreateMathFunc\fR when the function was
|
||||
created if the function is not implemented directly in bytecode.
|
||||
.AP "const char" *pattern in
|
||||
Pattern to match against function names so as to filter them (by
|
||||
passing to \fITcl_StringMatch\fR), or NULL to not apply any filter.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Tcl allows a number of mathematical functions to be used in
|
||||
expressions, such as \fBsin\fR, \fBcos\fR, and \fBhypot\fR.
|
||||
These functions are represented by commands in the namespace,
|
||||
\fBtcl::mathfunc\fR. The \fBTcl_CreateMathFunc\fR function is
|
||||
an obsolete way for applications to add additional functions
|
||||
to those already provided by Tcl or to replace existing functions.
|
||||
It should not be used by new applications, which should create
|
||||
math functions using \fBTcl_CreateObjCommand\fR to create a command
|
||||
in the \fBtcl::mathfunc\fR namespace.
|
||||
.PP
|
||||
In the \fBTcl_CreateMathFunc\fR interface,
|
||||
\fIName\fR is the name of the function as it will appear in expressions.
|
||||
If \fIname\fR does not already exist in the \fB::tcl::mathfunc\fR
|
||||
namespace, then a new command is created in that namespace.
|
||||
If \fIname\fR does exist, then the existing function is replaced.
|
||||
\fINumArgs\fR and \fIargTypes\fR describe the arguments to the function.
|
||||
Each entry in the \fIargTypes\fR array must be
|
||||
one of \fBTCL_INT\fR, \fBTCL_DOUBLE\fR, \fBTCL_WIDE_INT\fR,
|
||||
or \fBTCL_EITHER\fR to indicate whether the corresponding argument must be an
|
||||
integer, a double-precision floating value, a wide (64-bit) integer,
|
||||
or any, respectively.
|
||||
.PP
|
||||
Whenever the function is invoked in an expression Tcl will invoke
|
||||
\fIproc\fR. \fIProc\fR should have arguments and result that match
|
||||
the type \fBTcl_MathProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_MathProc\fR(
|
||||
ClientData \fIclientData\fR,
|
||||
Tcl_Interp *\fIinterp\fR,
|
||||
Tcl_Value *\fIargs\fR,
|
||||
Tcl_Value *\fIresultPtr\fR);
|
||||
.CE
|
||||
.PP
|
||||
When \fIproc\fR is invoked the \fIclientData\fR and \fIinterp\fR
|
||||
arguments will be the same as those passed to \fBTcl_CreateMathFunc\fR.
|
||||
\fIArgs\fR will point to an array of \fInumArgs\fR Tcl_Value structures,
|
||||
which describe the actual arguments to the function:
|
||||
.PP
|
||||
.CS
|
||||
typedef struct Tcl_Value {
|
||||
Tcl_ValueType \fItype\fR;
|
||||
long \fIintValue\fR;
|
||||
double \fIdoubleValue\fR;
|
||||
Tcl_WideInt \fIwideValue\fR;
|
||||
} \fBTcl_Value\fR;
|
||||
.CE
|
||||
.PP
|
||||
The \fItype\fR field indicates the type of the argument and is
|
||||
one of \fBTCL_INT\fR, \fBTCL_DOUBLE\fR or \fBTCL_WIDE_INT\fR.
|
||||
It will match the \fIargTypes\fR value specified for the function unless
|
||||
the \fIargTypes\fR value was \fBTCL_EITHER\fR. Tcl converts
|
||||
the argument supplied in the expression to the type requested in
|
||||
\fIargTypes\fR, if that is necessary.
|
||||
Depending on the value of the \fItype\fR field, the \fIintValue\fR,
|
||||
\fIdoubleValue\fR or \fIwideValue\fR
|
||||
field will contain the actual value of the argument.
|
||||
.PP
|
||||
\fIProc\fR should compute its result and store it either as an integer
|
||||
in \fIresultPtr->intValue\fR or as a floating value in
|
||||
\fIresultPtr->doubleValue\fR.
|
||||
It should set also \fIresultPtr->type\fR to one of
|
||||
\fBTCL_INT\fR, \fBTCL_DOUBLE\fR or \fBTCL_WIDE_INT\fR
|
||||
to indicate which value was set.
|
||||
Under normal circumstances \fIproc\fR should return \fBTCL_OK\fR.
|
||||
If an error occurs while executing the function, \fIproc\fR should
|
||||
return \fBTCL_ERROR\fR and leave an error message in the interpreter's result.
|
||||
.PP
|
||||
\fBTcl_GetMathFuncInfo\fR retrieves the values associated with
|
||||
function \fIname\fR that were passed to a preceding
|
||||
\fBTcl_CreateMathFunc\fR call. Normally, the return code is
|
||||
\fBTCL_OK\fR but if the named function does not exist, \fBTCL_ERROR\fR
|
||||
is returned and an error message is placed in the interpreter's
|
||||
result.
|
||||
.PP
|
||||
If an error did not occur, the array reference placed in the variable
|
||||
pointed to by \fIargTypesPtr\fR is newly allocated, and should be
|
||||
released by passing it to \fBTcl_Free\fR. Some functions (the
|
||||
standard set implemented in the core, and those defined by placing
|
||||
commands in the \fBtcl::mathfunc\fR namespace) do not have
|
||||
argument type information; attempting to retrieve values for
|
||||
them causes a NULL to be stored in the variable pointed to by
|
||||
\fIprocPtr\fR and the variable pointed to by \fIclientDataPtr\fR
|
||||
will not be modified. The variable pointed to by \fInumArgsPointer\fR
|
||||
will contain -1, and no argument types will be stored in the variable
|
||||
pointed to by \fIargTypesPointer\fR.
|
||||
.PP
|
||||
\fBTcl_ListMathFuncs\fR returns a Tcl value containing a list of all
|
||||
the math functions defined in the interpreter whose name matches
|
||||
\fIpattern\fR. The returned value has a reference count of zero.
|
||||
.SH "SEE ALSO"
|
||||
expr(n), info(n), Tcl_CreateObjCommand(3), Tcl_Free(3), Tcl_NewListObj(3)
|
||||
.SH KEYWORDS
|
||||
expression, mathematical function
|
||||
+1
-7
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringTrunc, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult \- manipulate dynamic strings
|
||||
Tcl_DStringInit, Tcl_DStringAppend, Tcl_DStringAppendElement, Tcl_DStringStartSublist, Tcl_DStringEndSublist, Tcl_DStringLength, Tcl_DStringValue, Tcl_DStringSetLength, Tcl_DStringFree, Tcl_DStringResult, Tcl_DStringGetResult \- manipulate dynamic strings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -34,8 +34,6 @@ char *
|
||||
.sp
|
||||
\fBTcl_DStringSetLength\fR(\fIdsPtr, newLength\fR)
|
||||
.sp
|
||||
\fBTcl_DStringTrunc\fR(\fIdsPtr, newLength\fR)
|
||||
.sp
|
||||
\fBTcl_DStringFree\fR(\fIdsPtr\fR)
|
||||
.sp
|
||||
\fBTcl_DStringResult\fR(\fIinterp, dsPtr\fR)
|
||||
@@ -128,10 +126,6 @@ caller to fill in the new space.
|
||||
even if the string is truncated to zero length, so \fBTcl_DStringFree\fR
|
||||
will still need to be called.
|
||||
.PP
|
||||
\fBTcl_DStringTrunc\fR changes the length of a dynamic string.
|
||||
This procedure is now deprecated. \fBTcl_DStringSetLength\fR should
|
||||
be used instead.
|
||||
.PP
|
||||
\fBTcl_DStringFree\fR should be called when you are finished using
|
||||
the string. It frees up any memory that was allocated for the string
|
||||
and reinitializes the string's value to an empty string.
|
||||
|
||||
+2
-17
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_GetEncodingFromObj, Tcl_ExternalToUtfDString, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternal, Tcl_WinTCharToUtf, Tcl_WinUtfToTChar, Tcl_GetEncodingName, Tcl_SetSystemEncoding, Tcl_GetEncodingNameFromEnvironment, Tcl_GetEncodingNames, Tcl_CreateEncoding, Tcl_GetEncodingSearchPath, Tcl_SetEncodingSearchPath, Tcl_GetDefaultEncodingDir, Tcl_SetDefaultEncodingDir \- procedures for creating and using encodings
|
||||
Tcl_GetEncoding, Tcl_FreeEncoding, Tcl_GetEncodingFromObj, Tcl_ExternalToUtfDString, Tcl_ExternalToUtf, Tcl_UtfToExternalDString, Tcl_UtfToExternal, Tcl_WinTCharToUtf, Tcl_WinUtfToTChar, Tcl_GetEncodingName, Tcl_SetSystemEncoding, Tcl_GetEncodingNameFromEnvironment, Tcl_GetEncodingNames, Tcl_CreateEncoding, Tcl_GetEncodingSearchPath, Tcl_SetEncodingSearchPath \- procedures for creating and using encodings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -62,12 +62,6 @@ Tcl_Obj *
|
||||
.sp
|
||||
int
|
||||
\fBTcl_SetEncodingSearchPath\fR(\fIsearchPath\fR)
|
||||
.sp
|
||||
const char *
|
||||
\fBTcl_GetDefaultEncodingDir\fR(\fIvoid\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_SetDefaultEncodingDir\fR(\fIpath\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS "const Tcl_EncodingType" *dstWrotePtr in/out
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -287,7 +281,7 @@ the encoding name to it. The \fBTcl_DStringValue\fR is returned.
|
||||
\fBTcl_GetEncodingNames\fR sets the \fIinterp\fR result to a list
|
||||
consisting of the names of all the encodings that are currently defined
|
||||
or can be dynamically loaded, searching the encoding path specified by
|
||||
\fBTcl_SetDefaultEncodingDir\fR. This procedure does not ensure that the
|
||||
\fBTcl_SetEncodingSearchPath\fR. This procedure does not ensure that the
|
||||
dynamically-loadable encoding files contain valid data, but merely that they
|
||||
exist.
|
||||
.PP
|
||||
@@ -402,15 +396,6 @@ are not verified as existing readable filesystem directories. When
|
||||
searching for encoding data files takes place, and non-existent or
|
||||
non-readable filesystem directories on the \fIsearchPath\fR are silently
|
||||
ignored.
|
||||
.PP
|
||||
\fBTcl_GetDefaultEncodingDir\fR and \fBTcl_SetDefaultEncodingDir\fR
|
||||
are obsolete interfaces best replaced with calls to
|
||||
\fBTcl_GetEncodingSearchPath\fR and \fBTcl_SetEncodingSearchPath\fR.
|
||||
They are called to access and set the first element of the \fIsearchPath\fR
|
||||
list. Since Tcl searches \fIsearchPath\fR for encoding data files in
|
||||
list order, these routines establish the
|
||||
.QW default
|
||||
directory in which to find encoding data files.
|
||||
.SH "ENCODING FILES"
|
||||
Space would prohibit precompiling into Tcl every possible encoding
|
||||
algorithm, so many encodings are stored on disk as dynamically-loadable
|
||||
|
||||
+3
-19
@@ -10,7 +10,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval, Tcl_VarEvalVA \- execute Tcl scripts
|
||||
Tcl_EvalObjEx, Tcl_EvalFile, Tcl_EvalObjv, Tcl_Eval, Tcl_EvalEx, Tcl_GlobalEval, Tcl_GlobalEvalObj, Tcl_VarEval \- execute Tcl scripts
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -38,9 +38,6 @@ int
|
||||
.sp
|
||||
int
|
||||
\fBTcl_VarEval\fR(\fIinterp, part, part, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_VarEvalVA\fR(\fIinterp, argList\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp **termPtr
|
||||
.AP Tcl_Interp *interp in
|
||||
@@ -67,9 +64,6 @@ first null byte are used.
|
||||
Points to first byte of script to execute (null-terminated and UTF-8).
|
||||
.AP char *part in
|
||||
String forming part of a Tcl script.
|
||||
.AP va_list argList in
|
||||
An argument list which must have been initialized using
|
||||
\fBva_start\fR, and cleared using \fBva_end\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
@@ -128,16 +122,10 @@ might be a UTF-8 special code. The string is parsed and executed directly
|
||||
bytecodes. In situations where it is known that the script will never be
|
||||
executed again, \fBTcl_Eval\fR may be faster than \fBTcl_EvalObjEx\fR.
|
||||
\fBTcl_Eval\fR returns a completion code and result just like
|
||||
\fBTcl_EvalObjEx\fR. Note: for backward compatibility with versions before
|
||||
Tcl 8.0, \fBTcl_Eval\fR copies the value result in \fIinterp\fR to
|
||||
\fIinterp->result\fR (use is deprecated) where it can be accessed directly.
|
||||
This makes \fBTcl_Eval\fR somewhat slower than \fBTcl_EvalEx\fR, which
|
||||
does not do the copy.
|
||||
\fBTcl_EvalObjEx\fR.
|
||||
.PP
|
||||
\fBTcl_EvalEx\fR is an extended version of \fBTcl_Eval\fR that takes
|
||||
additional arguments \fInumBytes\fR and \fIflags\fR. For the
|
||||
efficiency reason given above, \fBTcl_EvalEx\fR is generally preferred
|
||||
over \fBTcl_Eval\fR.
|
||||
additional arguments \fInumBytes\fR and \fIflags\fR.
|
||||
.PP
|
||||
\fBTcl_GlobalEval\fR and \fBTcl_GlobalEvalObj\fR are older procedures
|
||||
that are now deprecated. They are similar to \fBTcl_EvalEx\fR and
|
||||
@@ -153,10 +141,6 @@ It returns the result of the command and also modifies
|
||||
\fIinterp->result\fR in the same way as \fBTcl_Eval\fR.
|
||||
The last argument to \fBTcl_VarEval\fR must be NULL to indicate the end
|
||||
of arguments. \fBTcl_VarEval\fR is now deprecated.
|
||||
.PP
|
||||
\fBTcl_VarEvalVA\fR is the same as \fBTcl_VarEval\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument
|
||||
list. Like \fBTcl_VarEval\fR, \fBTcl_VarEvalVA\fR is deprecated.
|
||||
|
||||
.SH "FLAG BITS"
|
||||
.PP
|
||||
|
||||
+2
-5
@@ -64,12 +64,9 @@ if the first such characters are
|
||||
then \fIsrc\fR is expected to be in octal form; otherwise,
|
||||
if the first such characters are
|
||||
.QW \fB0b\fR
|
||||
then \fIsrc\fR is expected to be in binary form; otherwise,
|
||||
if the first such character is
|
||||
.QW \fB0\fR
|
||||
then \fIsrc\fR
|
||||
is expected to be in octal form; otherwise, \fIsrc\fR
|
||||
is expected to be in decimal form.
|
||||
is expected to be in binary form; otherwise, \fIsrc\fR is
|
||||
expected to be in decimal form.
|
||||
.PP
|
||||
\fBTcl_GetDouble\fR expects \fIsrc\fR to consist of a floating-point
|
||||
number, which is: white space; a sign; a sequence of digits; a
|
||||
|
||||
+3
-3
@@ -63,9 +63,9 @@ Define the \fBUSE_TCL_STUBS\fR symbol. Typically, you would include the
|
||||
\fB\-DUSE_TCL_STUBS\fR flag when compiling the extension.
|
||||
.IP 3) 5
|
||||
Link the extension with the Tcl stubs library instead of the standard
|
||||
Tcl library. For example, to use the Tcl 8.6 ABI on Unix platforms,
|
||||
the library name is \fIlibtclstub8.6.a\fR; on Windows platforms, the
|
||||
library name is \fItclstub86.lib\fR.
|
||||
Tcl library. For example, to use the Tcl 9.0 ABI on Unix platforms,
|
||||
the library name is \fIlibtclstub9.0.a\fR; on Windows platforms, the
|
||||
library name is \fItclstub90.lib\fR.
|
||||
.PP
|
||||
If the extension also requires the Tk API, it must also call
|
||||
\fBTk_InitStubs\fR to initialize the Tk stubs interface and link
|
||||
|
||||
@@ -33,19 +33,6 @@ the pointer as described below is no longer supported. The supported
|
||||
public routines \fBTcl_SetResult\fR, \fBTcl_GetResult\fR,
|
||||
\fBTcl_SetErrorLine\fR, \fBTcl_GetErrorLine\fR must be used instead.
|
||||
.PP
|
||||
For legacy programs and extensions no longer being maintained, compiles
|
||||
against the Tcl 8.6 header files are only possible with the compiler
|
||||
directives
|
||||
.CS
|
||||
#define USE_INTERP_RESULT
|
||||
.CE
|
||||
and/or
|
||||
.CS
|
||||
#define USE_INTERP_ERRORLINE
|
||||
.CE
|
||||
depending on which fields of the \fBTcl_Interp\fR struct are accessed.
|
||||
These directives may be embedded in code or supplied via compiler options.
|
||||
.PP
|
||||
The \fIresult\fR and \fIfreeProc\fR fields are used to return
|
||||
results or error messages from commands.
|
||||
This information is returned by command procedures back to \fBTcl_Eval\fR,
|
||||
|
||||
+1
-7
@@ -7,7 +7,7 @@
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
Tcl_Panic, Tcl_PanicVA, Tcl_SetPanicProc \- report fatal error and abort
|
||||
Tcl_Panic, Tcl_SetPanicProc \- report fatal error and abort
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -16,9 +16,6 @@ void
|
||||
\fBTcl_Panic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_PanicVA\fR(\fIformat\fR, \fIargList\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_SetPanicProc\fR(\fIpanicProc\fR)
|
||||
.sp
|
||||
.SH ARGUMENTS
|
||||
@@ -80,9 +77,6 @@ the Tcl library, \fBTcl_Panic\fR is a public function and may be called
|
||||
by any extension or application that wishes to abort the process and
|
||||
have a panic message displayed the same way that panic messages from Tcl
|
||||
will be displayed.
|
||||
.PP
|
||||
\fBTcl_PanicVA\fR is the same as \fBTcl_Panic\fR except that instead of
|
||||
taking a variable number of arguments it takes an argument list.
|
||||
.SH "SEE ALSO"
|
||||
abort(3), printf(3), exec(n), format(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+5
-19
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokens, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
|
||||
Tcl_ParseCommand, Tcl_ParseExpr, Tcl_ParseBraces, Tcl_ParseQuotedString, Tcl_ParseVarName, Tcl_ParseVar, Tcl_FreeParse, Tcl_EvalTokensStandard \- parse Tcl scripts and expressions
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -33,20 +33,16 @@ const char *
|
||||
.sp
|
||||
\fBTcl_FreeParse\fR(\fIusedParsePtr\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
\fBTcl_EvalTokens\fR(\fIinterp, tokenPtr, numTokens\fR)
|
||||
.sp
|
||||
int
|
||||
\fBTcl_EvalTokensStandard\fR(\fIinterp, tokenPtr, numTokens\fR)
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *usedParsePtr out
|
||||
.AP Tcl_Interp *interp out
|
||||
For procedures other than \fBTcl_FreeParse\fR, \fBTcl_EvalTokens\fR
|
||||
and \fBTcl_EvalTokensStandard\fR, used only for error reporting;
|
||||
For procedures other than \fBTcl_FreeParse\fR and
|
||||
\fBTcl_EvalTokensStandard\fR, used only for error reporting;
|
||||
if NULL, then no error messages are left after errors.
|
||||
For \fBTcl_EvalTokens\fR and \fBTcl_EvalTokensStandard\fR,
|
||||
determines the context for evaluating the
|
||||
script and also is used for error reporting; must not be NULL.
|
||||
For \fBTcl_EvalTokensStandard\fR, determines the context for evaluating
|
||||
the script and also is used for error reporting; must not be NULL.
|
||||
.AP "const char" *start in
|
||||
Pointer to first character in string to parse.
|
||||
.AP int numBytes in
|
||||
@@ -191,16 +187,6 @@ code with one of the values \fBTCL_OK\fR, \fBTCL_ERROR\fR,
|
||||
some other integer value originating in an extension.
|
||||
In addition, a result value or error message is left in \fIinterp\fR's
|
||||
result; it can be retrieved using \fBTcl_GetObjResult\fR.
|
||||
.PP
|
||||
\fBTcl_EvalTokens\fR differs from \fBTcl_EvalTokensStandard\fR only in
|
||||
the return convention used: it returns the result in a new Tcl_Obj.
|
||||
The reference count of the value returned as result has been
|
||||
incremented, so the caller must
|
||||
invoke \fBTcl_DecrRefCount\fR when it is finished with the value.
|
||||
If an error or other exception occurs while evaluating the tokens
|
||||
(such as a reference to a non-existent variable) then the return value
|
||||
is NULL and an error message is left in \fIinterp\fR's result. The use
|
||||
of \fBTcl_EvalTokens\fR is deprecated.
|
||||
.SH "TCL_PARSE STRUCTURE"
|
||||
.PP
|
||||
\fBTcl_ParseCommand\fR, \fBTcl_ParseExpr\fR, \fBTcl_ParseBraces\fR,
|
||||
|
||||
+2
-7
@@ -18,10 +18,7 @@ Tcl_PrintDouble \- Convert floating value to string
|
||||
.SH ARGUMENTS
|
||||
.AS Tcl_Interp *interp out
|
||||
.AP Tcl_Interp *interp in
|
||||
Before Tcl 8.0, the \fBtcl_precision\fR variable in this interpreter
|
||||
controlled the conversion. As of Tcl 8.0, this argument is ignored and
|
||||
the conversion is controlled by the \fBtcl_precision\fR variable
|
||||
that is now shared by all interpreters.
|
||||
This argument is ignored.
|
||||
.AP double value in
|
||||
Floating-point value to be converted.
|
||||
.AP char *dst out
|
||||
@@ -41,9 +38,7 @@ so that it does not look like an integer. Where \fB%g\fR would
|
||||
generate an integer with no decimal point, \fBTcl_PrintDouble\fR adds
|
||||
.QW .0 .
|
||||
.PP
|
||||
If the \fBtcl_precision\fR value is non-zero, the result will have
|
||||
precisely that many digits of significance. If the value is zero
|
||||
(the default), the result will have the fewest digits needed to
|
||||
The result will have the fewest digits needed to
|
||||
represent the number in such a way that \fBTcl_NewDoubleObj\fR
|
||||
will generate the same number when presented with the given string.
|
||||
IEEE semantics of rounding to even apply to the conversion.
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ the command at global level instead of the current stack level.
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTcl_RecordAndEvalObj\fR is invoked to record a command as an event
|
||||
on the history list and then execute it using \fBTcl_EvalObjEx\fR
|
||||
on the history list and then execute it using \fBTcl_EvalObjEx\fR.
|
||||
It returns a completion code such as \fBTCL_OK\fR just like \fBTcl_EvalObjEx\fR,
|
||||
as well as a result value containing additional information
|
||||
(a result value or error message)
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ New limit for nested calls to \fBTcl_Eval\fR for \fIinterp\fR.
|
||||
.PP
|
||||
At any given time Tcl enforces a limit on the number of recursive
|
||||
calls that may be active for \fBTcl_Eval\fR and related procedures
|
||||
such as \fBTcl_GlobalEval\fR.
|
||||
such as \fBTcl_EvalEx\fR.
|
||||
Any call to \fBTcl_Eval\fR that exceeds this depth is aborted with
|
||||
an error.
|
||||
By default the recursion limit is 1000.
|
||||
|
||||
+1
-19
@@ -9,7 +9,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendResultVA, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult, Tcl_FreeResult \- manipulate Tcl result
|
||||
Tcl_SetObjResult, Tcl_GetObjResult, Tcl_SetResult, Tcl_GetStringResult, Tcl_AppendResult, Tcl_AppendElement, Tcl_ResetResult, Tcl_TransferResult, Tcl_FreeResult \- manipulate Tcl result
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -26,8 +26,6 @@ const char *
|
||||
.sp
|
||||
\fBTcl_AppendResult\fR(\fIinterp, result, result, ... , \fB(char *) NULL\fR)
|
||||
.sp
|
||||
\fBTcl_AppendResultVA\fR(\fIinterp, argList\fR)
|
||||
.sp
|
||||
\fBTcl_ResetResult\fR(\fIinterp\fR)
|
||||
.sp
|
||||
.VS 8.6
|
||||
@@ -152,9 +150,6 @@ extensions.
|
||||
Any number of \fIresult\fR arguments may be passed in a single
|
||||
call; the last argument in the list must be a NULL pointer.
|
||||
.PP
|
||||
\fBTcl_AppendResultVA\fR is the same as \fBTcl_AppendResult\fR except that
|
||||
instead of taking a variable number of arguments it takes an argument list.
|
||||
.PP
|
||||
.VS 8.6
|
||||
\fBTcl_TransferResult\fR moves a result from one interpreter to another,
|
||||
optionally (dependent on the \fIresult\fR parameter) including the error
|
||||
@@ -197,19 +192,6 @@ It also sets \fIinterp->freeProc\fR to zero, but does not
|
||||
change \fIinterp->result\fR or clear error state.
|
||||
\fBTcl_FreeResult\fR is most commonly used when a procedure
|
||||
is about to replace one result value with another.
|
||||
.SS "DIRECT ACCESS TO INTERP->RESULT"
|
||||
.PP
|
||||
It used to be legal for programs to
|
||||
directly read and write \fIinterp->result\fR
|
||||
to manipulate the interpreter result. The Tcl headers no longer
|
||||
permit this access by default, and C code still doing this must
|
||||
be updated to use supported routines \fBTcl_GetObjResult\fR,
|
||||
\fBTcl_GetStringResult\fR, \fBTcl_SetObjResult\fR, and \fBTcl_SetResult\fR.
|
||||
As a migration aid, access can be restored with the compiler directive
|
||||
.CS
|
||||
#define USE_INTERP_RESULT
|
||||
.CE
|
||||
but this is meant only to offer life support to otherwise dead code.
|
||||
.SH "THE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT"
|
||||
.PP
|
||||
\fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how
|
||||
|
||||
+1
-8
@@ -8,7 +8,7 @@
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendStringsToObjVA, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
|
||||
Tcl_NewStringObj, Tcl_NewUnicodeObj, Tcl_SetStringObj, Tcl_SetUnicodeObj, Tcl_GetStringFromObj, Tcl_GetString, Tcl_GetUnicodeFromObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendToObj, Tcl_AppendUnicodeToObj, Tcl_AppendObjToObj, Tcl_AppendStringsToObj, Tcl_AppendLimitedToObj, Tcl_Format, Tcl_AppendFormatToObj, Tcl_ObjPrintf, Tcl_AppendPrintfToObj, Tcl_SetObjLength, Tcl_AttemptSetObjLength, Tcl_ConcatObj \- manipulate Tcl values as strings
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -59,9 +59,6 @@ void
|
||||
\fBTcl_AppendStringsToObj\fR(\fIobjPtr, string, string, ... \fB(char *) NULL\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_AppendStringsToObjVA\fR(\fIobjPtr, argList\fR)
|
||||
.sp
|
||||
void
|
||||
\fBTcl_AppendLimitedToObj\fR(\fIobjPtr, bytes, length, limit, ellipsis\fR)
|
||||
.sp
|
||||
Tcl_Obj *
|
||||
@@ -247,10 +244,6 @@ values may contain internal null characters). Any number of
|
||||
\fIstring\fR arguments may be provided, but the last argument
|
||||
must be a NULL pointer to indicate the end of the list.
|
||||
.PP
|
||||
\fBTcl_AppendStringsToObjVA\fR is the same as \fBTcl_AppendStringsToObj\fR
|
||||
except that instead of taking a variable number of arguments it takes an
|
||||
argument list.
|
||||
.PP
|
||||
\fBTcl_AppendLimitedToObj\fR is similar to \fBTcl_AppendToObj\fR
|
||||
except that it imposes a limit on how many bytes are appended.
|
||||
This can be handy when the string to be appended might be
|
||||
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
.TH case n 7.0 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
case \- Evaluate one of several scripts, depending on a given value
|
||||
.SH SYNOPSIS
|
||||
\fBcase\fI string \fR?\fBin\fR? \fIpatList body \fR?\fIpatList body \fR...?
|
||||
.sp
|
||||
\fBcase\fI string \fR?\fBin\fR? {\fIpatList body \fR?\fIpatList body \fR...?}
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fINote: the \fBcase\fI command is obsolete and is supported only
|
||||
for backward compatibility. At some point in the future it may be
|
||||
removed entirely. You should use the \fBswitch\fI command instead.\fR
|
||||
.PP
|
||||
The \fBcase\fR command matches \fIstring\fR against each of
|
||||
the \fIpatList\fR arguments in order.
|
||||
Each \fIpatList\fR argument is a list of one or
|
||||
more patterns. If any of these patterns matches \fIstring\fR then
|
||||
\fBcase\fR evaluates the following \fIbody\fR argument
|
||||
by passing it recursively to the Tcl interpreter and returns the result
|
||||
of that evaluation.
|
||||
Each \fIpatList\fR argument consists of a single
|
||||
pattern or list of patterns. Each pattern may contain any of the wild-cards
|
||||
described under \fBstring match\fR. If a \fIpatList\fR
|
||||
argument is \fBdefault\fR, the corresponding body will be evaluated
|
||||
if no \fIpatList\fR matches \fIstring\fR. If no \fIpatList\fR argument
|
||||
matches \fIstring\fR and no default is given, then the \fBcase\fR
|
||||
command returns an empty string.
|
||||
.PP
|
||||
Two syntaxes are provided for the \fIpatList\fR and \fIbody\fR arguments.
|
||||
The first uses a separate argument for each of the patterns and commands;
|
||||
this form is convenient if substitutions are desired on some of the
|
||||
patterns or commands.
|
||||
The second form places all of the patterns and commands together into
|
||||
a single argument; the argument must have proper list structure, with
|
||||
the elements of the list being the patterns and commands.
|
||||
The second form makes it easy to construct multi-line case commands,
|
||||
since the braces around the whole list make it unnecessary to include a
|
||||
backslash at the end of each line.
|
||||
Since the \fIpatList\fR arguments are in braces in the second form,
|
||||
no command or variable substitutions are performed on them; this makes
|
||||
the behavior of the second form different than the first form in some
|
||||
cases.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
switch(n)
|
||||
|
||||
.SH KEYWORDS
|
||||
case, match, regular expression
|
||||
+1
-3
@@ -50,9 +50,7 @@ An integer operand may be specified in decimal (the normal case, the optional
|
||||
first two characters are \fB0d\fR), binary
|
||||
(the first two characters are \fB0b\fR), octal
|
||||
(the first two characters are \fB0o\fR), or hexadecimal
|
||||
(the first two characters are \fB0x\fR) form. For
|
||||
compatibility with older Tcl releases, an operand that begins with \fB0\fR is
|
||||
interpreted as an octal integer even if the second character is not \fBo\fR.
|
||||
(the first two characters are \fB0x\fR) form.
|
||||
A floating-point number may be specified in any of several
|
||||
common decimal formats, and may use the decimal point \fB.\fR,
|
||||
\fBe\fR or \fBE\fR for scientific notation, and
|
||||
|
||||
+1
-4
@@ -106,10 +106,7 @@ of which work solely with floating-point numbers unless otherwise noted:
|
||||
In addition to these predefined functions, applications may
|
||||
define additional functions by using \fBproc\fR (or any other method,
|
||||
such as \fBinterp alias\fR or \fBTcl_CreateObjCommand\fR) to define
|
||||
new commands in the \fBtcl::mathfunc\fR namespace. In addition, an
|
||||
obsolete interface named \fBTcl_CreateMathFunc\fR() is available to
|
||||
extensions that are written in C. The latter interface is not recommended
|
||||
for new implementations.
|
||||
new commands in the \fBtcl::mathfunc\fR namespace.
|
||||
.SS "DETAILED DEFINITIONS"
|
||||
.TP
|
||||
\fBabs \fIarg\fR
|
||||
|
||||
+2
-4
@@ -224,12 +224,10 @@ set string "#08D03F"
|
||||
\fBscan\fR $string "#%2x%2x%2x" r g b
|
||||
.CE
|
||||
.PP
|
||||
Parse a \fIHH:MM\fR time string, noting that this avoids problems with
|
||||
octal numbers by forcing interpretation as decimals (if we did not
|
||||
care, we would use the \fB%i\fR conversion instead):
|
||||
Parse a \fIHH:MM\fR time string:
|
||||
.PP
|
||||
.CS
|
||||
set string "08:08" ;# *Not* octal!
|
||||
set string "08:08"
|
||||
if {[\fBscan\fR $string "%d:%d" hours minutes] != 2} {
|
||||
error "not a valid time string"
|
||||
}
|
||||
|
||||
+1
-65
@@ -10,7 +10,7 @@
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
argc, argv, argv0, auto_path, env, errorCode, errorInfo, tcl_interactive, tcl_library, tcl_nonwordchars, tcl_patchLevel, tcl_pkgPath, tcl_platform, tcl_precision, tcl_rcFileName, tcl_traceCompile, tcl_traceExec, tcl_wordchars, tcl_version \- Variables used by Tcl
|
||||
argc, argv, argv0, auto_path, env, errorCode, errorInfo, tcl_interactive, tcl_library, tcl_nonwordchars, tcl_patchLevel, tcl_pkgPath, tcl_platform, tcl_rcFileName, tcl_traceCompile, tcl_traceExec, tcl_wordchars, tcl_version \- Variables used by Tcl
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
@@ -356,70 +356,6 @@ This gives the size of the native-machine word in bytes (strictly, it
|
||||
is same as the result of evaluating \fIsizeof(long)\fR in C.)
|
||||
.RE
|
||||
.TP
|
||||
\fBtcl_precision\fR
|
||||
.
|
||||
This variable controls the number of digits to generate
|
||||
when converting floating-point values to strings. It defaults
|
||||
to 0. \fIApplications should not change this value;\fR it is
|
||||
provided for compatibility with legacy code.
|
||||
.PP
|
||||
.RS
|
||||
The default value of 0 is special, meaning that Tcl should
|
||||
convert numbers using as few digits as possible while still
|
||||
distinguishing any floating point number from its nearest
|
||||
neighbours. It differs from using an arbitrarily high value
|
||||
for \fItcl_precision\fR in that an inexact number like \fI1.4\fR
|
||||
will convert as \fI1.4\fR rather than \fI1.3999999999999999\fR
|
||||
even though the latter is nearer to the exact value of the
|
||||
binary number.
|
||||
.RE
|
||||
.PP
|
||||
.RS
|
||||
If \fBtcl_precision\fR is not zero, then when Tcl converts a floating
|
||||
point number, it creates a decimal representation of at most
|
||||
\fBtcl_precision\fR significant digits; the result may be shorter if
|
||||
the shorter result represents the original number exactly. If no
|
||||
result of at most \fBtcl_precision\fR digits is an exact representation
|
||||
of the original number, the one that is closest to the original
|
||||
number is chosen.
|
||||
If the original number lies precisely between two equally accurate
|
||||
decimal representations, then the one with an even value for the least
|
||||
significant digit is chosen; for instance, if \fBtcl_precision\fR is 3, then
|
||||
0.3125 will convert to 0.312, not 0.313, while 0.6875 will convert to
|
||||
0.688, not 0.687. Any string of trailing zeroes that remains is trimmed.
|
||||
.RE
|
||||
.PP
|
||||
.RS
|
||||
a \fBtcl_precision\fR value of 17 digits is
|
||||
.QW perfect
|
||||
for IEEE floating-point in that it allows
|
||||
double-precision values to be converted to strings and back to
|
||||
binary with no loss of information. For this reason, you will often
|
||||
see it as a value in legacy code that must run on Tcl versions before
|
||||
8.5. It is no longer recommended; as noted above, a zero value is the
|
||||
preferred method.
|
||||
.RE
|
||||
.PP
|
||||
.RS
|
||||
All interpreters in a thread share a single \fBtcl_precision\fR value:
|
||||
changing it in one interpreter will affect all other interpreters as
|
||||
well. Safe interpreters are not allowed to modify the
|
||||
variable.
|
||||
.RE
|
||||
.PP
|
||||
.RS
|
||||
Valid values for \fBtcl_precision\fR range from 0 to 17.
|
||||
.RE
|
||||
.TP
|
||||
\fBtcl_rcFileName\fR
|
||||
.
|
||||
This variable is used during initialization to indicate the name of a
|
||||
user-specific startup file. If it is set by application-specific
|
||||
initialization, then the Tcl startup code will check for the existence
|
||||
of this file and \fBsource\fR it if it exists. For example, for \fBwish\fR
|
||||
the variable is set to \fB~/.wishrc\fR for Unix and \fB~/wishrc.tcl\fR
|
||||
for Windows.
|
||||
.TP
|
||||
\fBtcl_traceCompile\fR
|
||||
.
|
||||
The value of this variable can be set to control
|
||||
|
||||
+114
-91
@@ -104,9 +104,10 @@ declare 20 {
|
||||
declare 21 {
|
||||
int Tcl_DbIsShared(Tcl_Obj *objPtr, const char *file, int line)
|
||||
}
|
||||
declare 22 {
|
||||
Tcl_Obj *Tcl_DbNewBooleanObj(int boolValue, const char *file, int line)
|
||||
}
|
||||
# Removed in 9.0 (changed to macro):
|
||||
#declare 22 {
|
||||
# Tcl_Obj *Tcl_DbNewBooleanObj(int boolValue, const char *file, int line)
|
||||
#}
|
||||
declare 23 {
|
||||
Tcl_Obj *Tcl_DbNewByteArrayObj(const unsigned char *bytes, int length,
|
||||
const char *file, int line)
|
||||
@@ -119,9 +120,10 @@ declare 25 {
|
||||
Tcl_Obj *Tcl_DbNewListObj(int objc, Tcl_Obj *const *objv,
|
||||
const char *file, int line)
|
||||
}
|
||||
declare 26 {
|
||||
Tcl_Obj *Tcl_DbNewLongObj(long longValue, const char *file, int line)
|
||||
}
|
||||
# Removed in 9.0 (changed to macro):
|
||||
#declare 26 {
|
||||
# Tcl_Obj *Tcl_DbNewLongObj(long longValue, const char *file, int line)
|
||||
#}
|
||||
declare 27 {
|
||||
Tcl_Obj *Tcl_DbNewObj(const char *file, int line)
|
||||
}
|
||||
@@ -166,7 +168,7 @@ declare 39 {
|
||||
int Tcl_GetLongFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, long *longPtr)
|
||||
}
|
||||
declare 40 {
|
||||
CONST86 Tcl_ObjType *Tcl_GetObjType(const char *typeName)
|
||||
const Tcl_ObjType *Tcl_GetObjType(const char *typeName)
|
||||
}
|
||||
declare 41 {
|
||||
char *Tcl_GetStringFromObj(Tcl_Obj *objPtr, int *lengthPtr)
|
||||
@@ -198,33 +200,37 @@ declare 48 {
|
||||
int Tcl_ListObjReplace(Tcl_Interp *interp, Tcl_Obj *listPtr, int first,
|
||||
int count, int objc, Tcl_Obj *const objv[])
|
||||
}
|
||||
declare 49 {
|
||||
Tcl_Obj *Tcl_NewBooleanObj(int boolValue)
|
||||
}
|
||||
# Removed in 9.0 (changed to macro):
|
||||
#declare 49 {
|
||||
# Tcl_Obj *Tcl_NewBooleanObj(int boolValue)
|
||||
#}
|
||||
declare 50 {
|
||||
Tcl_Obj *Tcl_NewByteArrayObj(const unsigned char *bytes, int length)
|
||||
}
|
||||
declare 51 {
|
||||
Tcl_Obj *Tcl_NewDoubleObj(double doubleValue)
|
||||
}
|
||||
declare 52 {
|
||||
Tcl_Obj *Tcl_NewIntObj(int intValue)
|
||||
}
|
||||
# Removed in 9.0 (changed to macro):
|
||||
#declare 52 {
|
||||
# Tcl_Obj *Tcl_NewIntObj(int intValue)
|
||||
#}
|
||||
declare 53 {
|
||||
Tcl_Obj *Tcl_NewListObj(int objc, Tcl_Obj *const objv[])
|
||||
}
|
||||
declare 54 {
|
||||
Tcl_Obj *Tcl_NewLongObj(long longValue)
|
||||
}
|
||||
# Removed in 9.0 (changed to macro):
|
||||
#declare 54 {
|
||||
# Tcl_Obj *Tcl_NewLongObj(long longValue)
|
||||
#}
|
||||
declare 55 {
|
||||
Tcl_Obj *Tcl_NewObj(void)
|
||||
}
|
||||
declare 56 {
|
||||
Tcl_Obj *Tcl_NewStringObj(const char *bytes, int length)
|
||||
}
|
||||
declare 57 {
|
||||
void Tcl_SetBooleanObj(Tcl_Obj *objPtr, int boolValue)
|
||||
}
|
||||
# Removed in 9.0 (changed to macro):
|
||||
#declare 57 {
|
||||
# void Tcl_SetBooleanObj(Tcl_Obj *objPtr, int boolValue)
|
||||
#}
|
||||
declare 58 {
|
||||
unsigned char *Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int length)
|
||||
}
|
||||
@@ -235,15 +241,17 @@ declare 59 {
|
||||
declare 60 {
|
||||
void Tcl_SetDoubleObj(Tcl_Obj *objPtr, double doubleValue)
|
||||
}
|
||||
declare 61 {
|
||||
void Tcl_SetIntObj(Tcl_Obj *objPtr, int intValue)
|
||||
}
|
||||
# Removed in 9.0 (changed to macro):
|
||||
#declare 61 {
|
||||
# void Tcl_SetIntObj(Tcl_Obj *objPtr, int intValue)
|
||||
#}
|
||||
declare 62 {
|
||||
void Tcl_SetListObj(Tcl_Obj *objPtr, int objc, Tcl_Obj *const objv[])
|
||||
}
|
||||
declare 63 {
|
||||
void Tcl_SetLongObj(Tcl_Obj *objPtr, long longValue)
|
||||
}
|
||||
# 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, int length)
|
||||
}
|
||||
@@ -285,9 +293,10 @@ declare 75 {
|
||||
declare 76 {
|
||||
void Tcl_BackgroundError(Tcl_Interp *interp)
|
||||
}
|
||||
declare 77 {deprecated {Use Tcl_UtfBackslash}} {
|
||||
char Tcl_Backslash(const char *src, int *readPtr)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 77 {deprecated {Use Tcl_UtfBackslash}} {
|
||||
# char Tcl_Backslash(const char *src, int *readPtr)
|
||||
#}
|
||||
declare 78 {
|
||||
int Tcl_BadChannelOption(Tcl_Interp *interp, const char *optionName,
|
||||
const char *optionList)
|
||||
@@ -352,11 +361,12 @@ declare 93 {
|
||||
declare 94 {
|
||||
Tcl_Interp *Tcl_CreateInterp(void)
|
||||
}
|
||||
declare 95 {deprecated {}} {
|
||||
void Tcl_CreateMathFunc(Tcl_Interp *interp, const char *name,
|
||||
int numArgs, Tcl_ValueType *argTypes,
|
||||
Tcl_MathProc *proc, ClientData clientData)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 95 {deprecated {}} {
|
||||
# void Tcl_CreateMathFunc(Tcl_Interp *interp, const char *name,
|
||||
# int numArgs, Tcl_ValueType *argTypes,
|
||||
# Tcl_MathProc *proc, ClientData clientData)
|
||||
#}
|
||||
declare 96 {
|
||||
Tcl_Command Tcl_CreateObjCommand(Tcl_Interp *interp,
|
||||
const char *cmdName,
|
||||
@@ -472,9 +482,10 @@ declare 129 {
|
||||
declare 130 {
|
||||
int Tcl_EvalFile(Tcl_Interp *interp, const char *fileName)
|
||||
}
|
||||
declare 131 {
|
||||
int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
|
||||
}
|
||||
# Removed in 9.0, replaced by macro.
|
||||
#declare 131 {
|
||||
# int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
|
||||
#}
|
||||
declare 132 {
|
||||
void Tcl_EventuallyFree(ClientData clientData, Tcl_FreeProc *freeProc)
|
||||
}
|
||||
@@ -565,7 +576,7 @@ declare 157 {
|
||||
const char *optionName, Tcl_DString *dsPtr)
|
||||
}
|
||||
declare 158 {
|
||||
CONST86 Tcl_ChannelType *Tcl_GetChannelType(Tcl_Channel chan)
|
||||
const Tcl_ChannelType *Tcl_GetChannelType(Tcl_Channel chan)
|
||||
}
|
||||
declare 159 {
|
||||
int Tcl_GetCommandInfo(Tcl_Interp *interp, const char *cmdName,
|
||||
@@ -635,9 +646,10 @@ declare 176 {
|
||||
declare 177 {
|
||||
int Tcl_GlobalEval(Tcl_Interp *interp, const char *command)
|
||||
}
|
||||
declare 178 {
|
||||
int Tcl_GlobalEvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
|
||||
}
|
||||
# Removed in 9.0, replaced by macro.
|
||||
#declare 178 {
|
||||
# int Tcl_GlobalEvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
|
||||
#}
|
||||
declare 179 {
|
||||
int Tcl_HideCommand(Tcl_Interp *interp, const char *cmdName,
|
||||
const char *hiddenCmdToken)
|
||||
@@ -779,9 +791,10 @@ declare 218 {
|
||||
declare 219 {
|
||||
int Tcl_ScanCountedElement(const char *src, int length, int *flagPtr)
|
||||
}
|
||||
declare 220 {deprecated {}} {
|
||||
int Tcl_SeekOld(Tcl_Channel chan, int offset, int mode)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 220 {
|
||||
# int Tcl_SeekOld(Tcl_Channel chan, int offset, int mode)
|
||||
#}
|
||||
declare 221 {
|
||||
int Tcl_ServiceAll(void)
|
||||
}
|
||||
@@ -866,9 +879,10 @@ declare 244 {
|
||||
declare 245 {
|
||||
int Tcl_StringMatch(const char *str, const char *pattern)
|
||||
}
|
||||
declare 246 {deprecated {}} {
|
||||
int Tcl_TellOld(Tcl_Channel chan)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 246 {
|
||||
# int Tcl_TellOld(Tcl_Channel chan)
|
||||
#}
|
||||
declare 247 {
|
||||
int Tcl_TraceVar(Tcl_Interp *interp, const char *varName, int flags,
|
||||
Tcl_VarTraceProc *proc, ClientData clientData)
|
||||
@@ -942,12 +956,14 @@ declare 265 {
|
||||
declare 266 {
|
||||
void Tcl_ValidateAllMemory(const char *file, int line)
|
||||
}
|
||||
declare 267 {deprecated {see TIP #422}} {
|
||||
void Tcl_AppendResultVA(Tcl_Interp *interp, va_list argList)
|
||||
}
|
||||
declare 268 {deprecated {see TIP #422}} {
|
||||
void Tcl_AppendStringsToObjVA(Tcl_Obj *objPtr, va_list argList)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 267 {
|
||||
# void Tcl_AppendResultVA(Tcl_Interp *interp, va_list argList)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 268 {
|
||||
# void Tcl_AppendStringsToObjVA(Tcl_Obj *objPtr, va_list argList)
|
||||
#}
|
||||
declare 269 {
|
||||
char *Tcl_HashStats(Tcl_HashTable *tablePtr)
|
||||
}
|
||||
@@ -973,18 +989,21 @@ declare 274 {
|
||||
const char *Tcl_PkgRequire(Tcl_Interp *interp, const char *name,
|
||||
const char *version, int exact)
|
||||
}
|
||||
declare 275 {deprecated {see TIP #422}} {
|
||||
void Tcl_SetErrorCodeVA(Tcl_Interp *interp, va_list argList)
|
||||
}
|
||||
declare 276 {deprecated {see TIP #422}} {
|
||||
int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 275 {
|
||||
# void Tcl_SetErrorCodeVA(Tcl_Interp *interp, va_list argList)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 276 {
|
||||
# int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList)
|
||||
#}
|
||||
declare 277 {
|
||||
Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options)
|
||||
}
|
||||
declare 278 {deprecated {see TIP #422}} {
|
||||
TCL_NORETURN void Tcl_PanicVA(const char *format, va_list argList)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 278 {
|
||||
# TCL_NORETURN void Tcl_PanicVA(const char *format, va_list argList)
|
||||
#}
|
||||
declare 279 {
|
||||
void Tcl_GetVersion(int *major, int *minor, int *patchLevel, int *type)
|
||||
}
|
||||
@@ -1211,12 +1230,14 @@ declare 339 {
|
||||
declare 340 {
|
||||
char *Tcl_GetString(Tcl_Obj *objPtr)
|
||||
}
|
||||
declare 341 {deprecated {Use Tcl_GetEncodingSearchPath}} {
|
||||
const char *Tcl_GetDefaultEncodingDir(void)
|
||||
}
|
||||
declare 342 {deprecated {Use Tcl_SetEncodingSearchPath}} {
|
||||
void Tcl_SetDefaultEncodingDir(const char *path)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 341 {deprecated {Use Tcl_GetEncodingSearchPath}} {
|
||||
# const char *Tcl_GetDefaultEncodingDir(void)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 342 {deprecated {Use Tcl_SetEncodingSearchPath}} {
|
||||
# void Tcl_SetDefaultEncodingDir(const char *path)
|
||||
#}
|
||||
declare 343 {
|
||||
void Tcl_AlertNotifier(ClientData clientData)
|
||||
}
|
||||
@@ -1263,10 +1284,11 @@ declare 356 {
|
||||
Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp, Tcl_Obj *patObj,
|
||||
int flags)
|
||||
}
|
||||
declare 357 {deprecated {Use Tcl_EvalTokensStandard}} {
|
||||
Tcl_Obj *Tcl_EvalTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr,
|
||||
int count)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 357 {deprecated {Use Tcl_EvalTokensStandard}} {
|
||||
# Tcl_Obj *Tcl_EvalTokens(Tcl_Interp *interp, Tcl_Token *tokenPtr,
|
||||
# int count)
|
||||
#}
|
||||
declare 358 {
|
||||
void Tcl_FreeParse(Tcl_Parse *parsePtr)
|
||||
}
|
||||
@@ -1490,13 +1512,15 @@ declare 420 {
|
||||
int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr,
|
||||
const Tcl_UniChar *uniPattern, int nocase)
|
||||
}
|
||||
declare 421 {
|
||||
Tcl_HashEntry *Tcl_FindHashEntry(Tcl_HashTable *tablePtr, const void *key)
|
||||
}
|
||||
declare 422 {
|
||||
Tcl_HashEntry *Tcl_CreateHashEntry(Tcl_HashTable *tablePtr,
|
||||
const void *key, int *newPtr)
|
||||
}
|
||||
# Removed in 9.0, as it is actually a macro:
|
||||
#declare 421 {
|
||||
# Tcl_HashEntry *Tcl_FindHashEntry(Tcl_HashTable *tablePtr, const void *key)
|
||||
#}
|
||||
# Removed in 9.0, as it is actually a macro:
|
||||
#declare 422 {
|
||||
# Tcl_HashEntry *Tcl_CreateHashEntry(Tcl_HashTable *tablePtr,
|
||||
# const void *key, int *newPtr)
|
||||
#}
|
||||
declare 423 {
|
||||
void Tcl_InitCustomHashTable(Tcl_HashTable *tablePtr, int keyType,
|
||||
const Tcl_HashKeyType *typePtr)
|
||||
@@ -1545,14 +1569,16 @@ declare 434 {
|
||||
}
|
||||
|
||||
# TIP#15 (math function introspection) dkf
|
||||
declare 435 {deprecated {}} {
|
||||
int Tcl_GetMathFuncInfo(Tcl_Interp *interp, const char *name,
|
||||
int *numArgsPtr, Tcl_ValueType **argTypesPtr,
|
||||
Tcl_MathProc **procPtr, ClientData *clientDataPtr)
|
||||
}
|
||||
declare 436 {deprecated {}} {
|
||||
Tcl_Obj *Tcl_ListMathFuncs(Tcl_Interp *interp, const char *pattern)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 435 {deprecated {}} {
|
||||
# int Tcl_GetMathFuncInfo(Tcl_Interp *interp, const char *name,
|
||||
# int *numArgsPtr, Tcl_ValueType **argTypesPtr,
|
||||
# Tcl_MathProc **procPtr, ClientData *clientDataPtr)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 436 {deprecated {}} {
|
||||
# Tcl_Obj *Tcl_ListMathFuncs(Tcl_Interp *interp, const char *pattern)
|
||||
#}
|
||||
|
||||
# TIP#36 (better access to 'subst') dkf
|
||||
declare 437 {
|
||||
@@ -1614,7 +1640,7 @@ declare 452 {
|
||||
int index, Tcl_Obj *pathPtr, Tcl_Obj *objPtr)
|
||||
}
|
||||
declare 453 {
|
||||
const char *CONST86 *Tcl_FSFileAttrStrings(Tcl_Obj *pathPtr,
|
||||
const char *const *Tcl_FSFileAttrStrings(Tcl_Obj *pathPtr,
|
||||
Tcl_Obj **objPtrRef)
|
||||
}
|
||||
declare 454 {
|
||||
@@ -1692,7 +1718,7 @@ declare 476 {
|
||||
Tcl_Obj *pathPtr)
|
||||
}
|
||||
declare 477 {
|
||||
CONST86 Tcl_Filesystem *Tcl_FSGetFileSystemForPath(Tcl_Obj *pathPtr)
|
||||
const Tcl_Filesystem *Tcl_FSGetFileSystemForPath(Tcl_Obj *pathPtr)
|
||||
}
|
||||
declare 478 {
|
||||
Tcl_PathType Tcl_FSGetPathType(Tcl_Obj *pathPtr)
|
||||
@@ -2375,9 +2401,6 @@ declare 1 macosx {
|
||||
|
||||
# Public functions that are not accessible via the stubs table.
|
||||
|
||||
export {
|
||||
void Tcl_Main(int argc, char **argv, Tcl_AppInitProc *appInitProc)
|
||||
}
|
||||
export {
|
||||
const char *Tcl_InitStubs(Tcl_Interp *interp, const char *version,
|
||||
int exact)
|
||||
|
||||
+23
-211
@@ -52,30 +52,15 @@ extern "C" {
|
||||
* tools/tcl.hpj.in (not patchlevel, for windows installer)
|
||||
*/
|
||||
|
||||
#define TCL_MAJOR_VERSION 8
|
||||
#define TCL_MINOR_VERSION 7
|
||||
#define TCL_MAJOR_VERSION 9
|
||||
#define TCL_MINOR_VERSION 0
|
||||
#define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE
|
||||
#define TCL_RELEASE_SERIAL 2
|
||||
#define TCL_RELEASE_SERIAL 0
|
||||
|
||||
#define TCL_VERSION "8.7"
|
||||
#define TCL_PATCH_LEVEL "8.7a2"
|
||||
#define TCL_VERSION "9.0"
|
||||
#define TCL_PATCH_LEVEL "9.0a0"
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) || defined(RC_INVOKED)
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* The following definitions set up the proper options for Windows compilers.
|
||||
* We use this method because there is no autoconf equivalent.
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifndef __WIN32__
|
||||
# define __WIN32__
|
||||
# endif
|
||||
# ifndef WIN32
|
||||
# define WIN32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(RC_INVOKED)
|
||||
/*
|
||||
* Utility macros: STRINGIFY takes an argument and wraps it in "" (double
|
||||
* quotation marks), JOIN joins two arguments.
|
||||
@@ -89,7 +74,7 @@ extern "C" {
|
||||
# define JOIN(a,b) JOIN1(a,b)
|
||||
# define JOIN1(a,b) a##b
|
||||
#endif
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
#endif /* RC_INVOKED */
|
||||
|
||||
/*
|
||||
* A special definition used to allow this header file to be included from
|
||||
@@ -125,32 +110,11 @@ extern "C" {
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* Support for functions with a variable number of arguments.
|
||||
*
|
||||
* The following TCL_VARARGS* macros are to support old extensions
|
||||
* written for older versions of Tcl where the macros permitted
|
||||
* support for the varargs.h system as well as stdarg.h .
|
||||
*
|
||||
* New code should just directly be written to use stdarg.h conventions.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
# define TCL_VARARGS(type, name) (type name, ...)
|
||||
# define TCL_VARARGS_DEF(type, name) (type name, ...)
|
||||
# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
#if defined(__GNUC__) && (__GNUC__ > 2)
|
||||
# define TCL_FORMAT_PRINTF(a,b) __attribute__ ((__format__ (__printf__, a, b)))
|
||||
# define TCL_NORETURN __attribute__ ((noreturn))
|
||||
# define TCL_NOINLINE __attribute__ ((noinline))
|
||||
# if defined(BUILD_tcl) || defined(BUILD_tk)
|
||||
# define TCL_NORETURN1 __attribute__ ((noreturn))
|
||||
# else
|
||||
# define TCL_NORETURN1 /* nothing */
|
||||
# endif
|
||||
# define TCL_NORETURN1 __attribute__ ((noreturn))
|
||||
#else
|
||||
# define TCL_FORMAT_PRINTF(a,b)
|
||||
# if defined(_MSC_VER) && (_MSC_VER >= 1310)
|
||||
@@ -225,7 +189,7 @@ extern "C" {
|
||||
* to be included in a shared library, then it should have the DLLEXPORT
|
||||
* storage class. If is being declared for use by a module that is going to
|
||||
* link against the shared library, then it should have the DLLIMPORT storage
|
||||
* class. If the symbol is beind declared for a static build or for use from a
|
||||
* class. If the symbol is being declared for a static build or for use from a
|
||||
* stub library, then the storage class should be empty.
|
||||
*
|
||||
* The convention is that a macro called BUILD_xxxx, where xxxx is the name of
|
||||
@@ -246,33 +210,7 @@ extern "C" {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following _ANSI_ARGS_ macro is to support old extensions
|
||||
* written for older versions of Tcl where it permitted support
|
||||
* for compilers written in the pre-prototype era of C.
|
||||
*
|
||||
* New code should use prototypes.
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
# undef _ANSI_ARGS_
|
||||
# define _ANSI_ARGS_(x) x
|
||||
|
||||
/*
|
||||
* Definitions that allow this header file to be used either with or without
|
||||
* ANSI C features.
|
||||
*/
|
||||
|
||||
#ifndef INLINE
|
||||
# define INLINE
|
||||
#endif
|
||||
#ifndef CONST
|
||||
# define CONST const
|
||||
#endif
|
||||
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
#ifndef CONST86
|
||||
#if !defined(CONST86) && !defined(TCL_NO_DEPRECATED)
|
||||
# define CONST86 const
|
||||
#endif
|
||||
|
||||
@@ -290,41 +228,11 @@ extern "C" {
|
||||
# define EXTERN extern TCL_STORAGE_CLASS
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* The following code is copied from winnt.h. If we don't replicate it here,
|
||||
* then <windows.h> can't be included after tcl.h, since tcl.h also defines
|
||||
* VOID. This block is skipped under Cygwin and Mingw.
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
#if defined(_WIN32) && !defined(HAVE_WINNT_IGNORE_VOID)
|
||||
#ifndef VOID
|
||||
#define VOID void
|
||||
typedef char CHAR;
|
||||
typedef short SHORT;
|
||||
typedef long LONG;
|
||||
#endif
|
||||
#endif /* _WIN32 && !HAVE_WINNT_IGNORE_VOID */
|
||||
|
||||
/*
|
||||
* Macro to use instead of "void" for arguments that must have type "void *"
|
||||
* in ANSI C; maps them to type "char *" in non-ANSI systems.
|
||||
*/
|
||||
|
||||
#ifndef __VXWORKS__
|
||||
# define VOID void
|
||||
#endif
|
||||
#endif /* !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 */
|
||||
|
||||
/*
|
||||
* Miscellaneous declarations.
|
||||
*/
|
||||
|
||||
#ifndef _CLIENTDATA
|
||||
typedef void *ClientData;
|
||||
# define _CLIENTDATA
|
||||
#endif
|
||||
typedef void *ClientData;
|
||||
|
||||
/*
|
||||
* Darwin specific configure overrides (to support fat compiles, where
|
||||
@@ -461,17 +369,7 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
|
||||
* accessed with Tcl_GetObjResult() and Tcl_SetObjResult().
|
||||
*/
|
||||
|
||||
typedef struct Tcl_Interp
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
{
|
||||
/* TIP #330: Strongly discourage extensions from using the string
|
||||
* result. */
|
||||
char *resultDontUse; /* Don't use in extensions! */
|
||||
void (*freeProcDontUse) (char *); /* Don't use in extensions! */
|
||||
int errorLineDontUse; /* Don't use in extensions! */
|
||||
}
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
Tcl_Interp;
|
||||
typedef struct Tcl_Interp Tcl_Interp;
|
||||
|
||||
typedef struct Tcl_AsyncHandler_ *Tcl_AsyncHandler;
|
||||
typedef struct Tcl_Channel_ *Tcl_Channel;
|
||||
@@ -620,10 +518,6 @@ typedef struct stat *Tcl_OldStat_;
|
||||
#define TCL_BREAK 3
|
||||
#define TCL_CONTINUE 4
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
#define TCL_RESULT_SIZE 200
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* Flags to control what substitutions are performed by Tcl_SubstObj():
|
||||
@@ -634,27 +528,6 @@ typedef struct stat *Tcl_OldStat_;
|
||||
#define TCL_SUBST_BACKSLASHES 004
|
||||
#define TCL_SUBST_ALL 007
|
||||
|
||||
/*
|
||||
* Argument descriptors for math function callbacks in expressions:
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
typedef enum {
|
||||
TCL_INT, TCL_DOUBLE, TCL_EITHER, TCL_WIDE_INT
|
||||
} Tcl_ValueType;
|
||||
|
||||
typedef struct Tcl_Value {
|
||||
Tcl_ValueType type; /* Indicates intValue or doubleValue is valid,
|
||||
* or both. */
|
||||
long intValue; /* Integer value. */
|
||||
double doubleValue; /* Double-precision floating value. */
|
||||
Tcl_WideInt wideValue; /* Wide (min. 64-bit) integer value. */
|
||||
} Tcl_Value;
|
||||
#else
|
||||
#define Tcl_ValueType void /* Just enough to prevent compilation error in Tcl */
|
||||
#define Tcl_Value void /* Just enough to prevent compilation error in Tcl */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Forward declaration of Tcl_Obj to prevent an error when the forward
|
||||
* reference to Tcl_Obj is encountered in the function types declared below.
|
||||
@@ -700,8 +573,6 @@ typedef void (Tcl_FreeProc) (char *blockPtr);
|
||||
typedef void (Tcl_IdleProc) (ClientData clientData);
|
||||
typedef void (Tcl_InterpDeleteProc) (ClientData clientData,
|
||||
Tcl_Interp *interp);
|
||||
typedef int (Tcl_MathProc) (ClientData clientData, Tcl_Interp *interp,
|
||||
Tcl_Value *args, Tcl_Value *resultPtr);
|
||||
typedef void (Tcl_NamespaceDeleteProc) (ClientData clientData);
|
||||
typedef int (Tcl_ObjCmdProc) (ClientData clientData, Tcl_Interp *interp,
|
||||
int objc, struct Tcl_Obj *const *objv);
|
||||
@@ -813,20 +684,11 @@ int Tcl_IsShared(Tcl_Obj *objPtr);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* The following structure contains the state needed by Tcl_SaveResult. No-one
|
||||
* outside of Tcl should access any of these fields. This structure is
|
||||
* typically allocated on the stack.
|
||||
* The following type contains the state needed by Tcl_SaveResult. It
|
||||
* is typically allocated on the stack.
|
||||
*/
|
||||
|
||||
typedef struct Tcl_SavedResult {
|
||||
char *result;
|
||||
Tcl_FreeProc *freeProc;
|
||||
Tcl_Obj *objResultPtr;
|
||||
char *appendResult;
|
||||
int appendAvl;
|
||||
int appendUsed;
|
||||
char resultSpace[200+1];
|
||||
} Tcl_SavedResult;
|
||||
typedef Tcl_Obj *Tcl_SavedResult;
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
@@ -951,14 +813,11 @@ typedef struct Tcl_DString {
|
||||
|
||||
#define Tcl_DStringLength(dsPtr) ((dsPtr)->length)
|
||||
#define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
# define Tcl_DStringTrunc Tcl_DStringSetLength
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
* Definitions for the maximum number of digits of precision that may be
|
||||
* specified in the "tcl_precision" variable, and the number of bytes of
|
||||
* buffer space required by Tcl_PrintDouble.
|
||||
* produced by Tcl_PrintDouble, and the number of bytes of buffer space
|
||||
* required by Tcl_PrintDouble.
|
||||
*/
|
||||
|
||||
#define TCL_MAX_PREC 17
|
||||
@@ -1072,17 +931,6 @@ typedef struct Tcl_DString {
|
||||
|
||||
#define TCL_ALLOW_INLINE_COMPILATION 0x20000
|
||||
|
||||
/*
|
||||
* The TCL_PARSE_PART1 flag is deprecated and has no effect. The part1 is now
|
||||
* always parsed whenever the part2 is NULL. (This is to avoid a common error
|
||||
* when converting code to use the new object based APIs and forgetting to
|
||||
* give the flag)
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
# define TCL_PARSE_PART1 0x400
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
* Types for linked variables:
|
||||
*/
|
||||
@@ -1136,9 +984,7 @@ 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. */
|
||||
void *hash; /* Hash value, stored as pointer to ensure
|
||||
* that the offsets of the fields in this
|
||||
* structure are not changed. */
|
||||
unsigned int hash; /* Hash value. */
|
||||
ClientData clientData; /* Application stores something here with
|
||||
* Tcl_SetHashValue. */
|
||||
union { /* Key has one of these forms: */
|
||||
@@ -1233,10 +1079,10 @@ struct Tcl_HashTable {
|
||||
* table. */
|
||||
int rebuildSize; /* Enlarge table when numEntries gets to be
|
||||
* this large. */
|
||||
unsigned int mask; /* Mask value used in hashing function. */
|
||||
int downShift; /* Shift count used in hashing function.
|
||||
* Designed to use high-order bits of
|
||||
* randomized keys. */
|
||||
int mask; /* Mask value used in hashing function. */
|
||||
int keyType; /* Type of keys used in this table. It's
|
||||
* either TCL_CUSTOM_KEYS, TCL_STRING_KEYS,
|
||||
* TCL_ONE_WORD_KEYS, or an integer giving the
|
||||
@@ -1357,8 +1203,8 @@ typedef struct Tcl_Time {
|
||||
long usec; /* Microseconds. */
|
||||
} Tcl_Time;
|
||||
|
||||
typedef void (Tcl_SetTimerProc) (CONST86 Tcl_Time *timePtr);
|
||||
typedef int (Tcl_WaitForEventProc) (CONST86 Tcl_Time *timePtr);
|
||||
typedef void (Tcl_SetTimerProc) (const Tcl_Time *timePtr);
|
||||
typedef int (Tcl_WaitForEventProc) (const Tcl_Time *timePtr);
|
||||
|
||||
/*
|
||||
* TIP #233 (Virtualized Time)
|
||||
@@ -1630,7 +1476,7 @@ typedef int (Tcl_FSNormalizePathProc) (Tcl_Interp *interp, Tcl_Obj *pathPtr,
|
||||
int nextCheckpoint);
|
||||
typedef int (Tcl_FSFileAttrsGetProc) (Tcl_Interp *interp, int index,
|
||||
Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef);
|
||||
typedef const char *CONST86 * (Tcl_FSFileAttrStringsProc) (Tcl_Obj *pathPtr,
|
||||
typedef const char *const * (Tcl_FSFileAttrStringsProc) (Tcl_Obj *pathPtr,
|
||||
Tcl_Obj **objPtrRef);
|
||||
typedef int (Tcl_FSFileAttrsSetProc) (Tcl_Interp *interp, int index,
|
||||
Tcl_Obj *pathPtr, Tcl_Obj *objPtr);
|
||||
@@ -1932,7 +1778,7 @@ typedef struct Tcl_Token {
|
||||
* TCL_TOKEN_OPERATOR - The token describes one expression operator.
|
||||
* An operator might be the name of a math
|
||||
* function such as "abs". A TCL_TOKEN_OPERATOR
|
||||
* token is always preceded by one
|
||||
* token is always preceeded by one
|
||||
* TCL_TOKEN_SUB_EXPR token for the operator's
|
||||
* subexpression, and is followed by zero or more
|
||||
* TCL_TOKEN_SUB_EXPR tokens for the operator's
|
||||
@@ -2543,10 +2389,8 @@ EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
|
||||
* 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)
|
||||
|
||||
@@ -2571,38 +2415,6 @@ EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr);
|
||||
#define Tcl_ConditionFinalize(condPtr)
|
||||
#endif /* TCL_THREADS */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* Deprecated Tcl functions:
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
/*
|
||||
* These function have been renamed. The old names are deprecated, but we
|
||||
* define these macros for backwards compatibility.
|
||||
*/
|
||||
|
||||
# define Tcl_Ckalloc Tcl_Alloc
|
||||
# define Tcl_Ckfree Tcl_Free
|
||||
# define Tcl_Ckrealloc Tcl_Realloc
|
||||
# define Tcl_Return Tcl_SetResult
|
||||
# define Tcl_TildeSubst Tcl_TranslateFileName
|
||||
#if !defined(__APPLE__) /* On OSX, there is a conflict with "mach/mach.h" */
|
||||
# define panic Tcl_Panic
|
||||
#endif
|
||||
# define panicVA Tcl_PanicVA
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
* Convenience declaration of Tcl_AppInit for backwards compatibility. This
|
||||
* function is not *implemented* by the tcl library, so the storage class is
|
||||
* neither DLLEXPORT nor DLLIMPORT.
|
||||
*/
|
||||
|
||||
extern Tcl_AppInitProc Tcl_AppInit;
|
||||
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
#endif /* RC_INVOKED */
|
||||
|
||||
/*
|
||||
|
||||
@@ -406,7 +406,6 @@ static const TalInstDesc TalInstructionTable[] = {
|
||||
{"jumpTrue", ASSEM_JUMP, INST_JUMP_TRUE1, 1, 0},
|
||||
{"jumpTrue4", ASSEM_JUMP4, INST_JUMP_TRUE4, 1, 0},
|
||||
{"label", ASSEM_LABEL, 0, 0, 0},
|
||||
{"land", ASSEM_1BYTE, INST_LAND, 2, 1},
|
||||
{"lappend", ASSEM_LVT, (INST_LAPPEND_SCALAR1<<8
|
||||
| INST_LAPPEND_SCALAR4),
|
||||
1, 1},
|
||||
@@ -434,7 +433,6 @@ static const TalInstDesc TalInstructionTable[] = {
|
||||
| INST_LOAD_ARRAY4), 1, 1},
|
||||
{"loadArrayStk", ASSEM_1BYTE, INST_LOAD_ARRAY_STK, 2, 1},
|
||||
{"loadStk", ASSEM_1BYTE, INST_LOAD_STK, 1, 1},
|
||||
{"lor", ASSEM_1BYTE, INST_LOR, 2, 1},
|
||||
{"lsetFlat", ASSEM_LSET_FLAT,INST_LSET_FLAT, INT_MIN,1},
|
||||
{"lsetList", ASSEM_1BYTE, INST_LSET_LIST, 3, 1},
|
||||
{"lshift", ASSEM_1BYTE, INST_LSHIFT, 2, 1},
|
||||
|
||||
+24
-613
@@ -37,18 +37,6 @@
|
||||
# define MAX_EXACT 9007199254740991.0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following structure defines the client data for a math function
|
||||
* registered with Tcl_CreateMathFunc
|
||||
*/
|
||||
|
||||
typedef struct OldMathFuncData {
|
||||
Tcl_MathProc *proc; /* Handler function */
|
||||
int numArgs; /* Number of args expected */
|
||||
Tcl_ValueType *argTypes; /* Types of the args */
|
||||
ClientData clientData; /* Client data for the handler function */
|
||||
} OldMathFuncData;
|
||||
|
||||
/*
|
||||
* This is the script cancellation struct and hash table. The hash table is
|
||||
* used to keep track of the information necessary to process script
|
||||
@@ -132,10 +120,6 @@ static Tcl_NRPostProc NRCoroutineCallerCallback;
|
||||
static Tcl_NRPostProc NRCoroutineExitCallback;
|
||||
static Tcl_NRPostProc NRCommand;
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED)
|
||||
static Tcl_ObjCmdProc OldMathFuncProc;
|
||||
static void OldMathFuncDeleteProc(ClientData clientData);
|
||||
#endif /* !defined(TCL_NO_DEPRECATED) */
|
||||
static void ProcessUnexpectedResult(Tcl_Interp *interp,
|
||||
int returnCode);
|
||||
static int RewindCoroutine(CoroutineData *corPtr, int result);
|
||||
@@ -207,9 +191,6 @@ static const CmdInfo builtInCmds[] = {
|
||||
{"append", Tcl_AppendObjCmd, TclCompileAppendCmd, NULL, CMD_IS_SAFE},
|
||||
{"apply", Tcl_ApplyObjCmd, NULL, TclNRApplyObjCmd, CMD_IS_SAFE},
|
||||
{"break", Tcl_BreakObjCmd, TclCompileBreakCmd, NULL, CMD_IS_SAFE},
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
{"case", Tcl_CaseObjCmd, NULL, NULL, CMD_IS_SAFE},
|
||||
#endif
|
||||
{"catch", Tcl_CatchObjCmd, TclCompileCatchCmd, TclNRCatchObjCmd, CMD_IS_SAFE},
|
||||
{"concat", Tcl_ConcatObjCmd, TclCompileConcatCmd, NULL, CMD_IS_SAFE},
|
||||
{"continue", Tcl_ContinueObjCmd, TclCompileContinueCmd, NULL, CMD_IS_SAFE},
|
||||
@@ -516,13 +497,12 @@ Tcl_CreateInterp(void)
|
||||
iPtr = ckalloc(sizeof(Interp));
|
||||
interp = (Tcl_Interp *) iPtr;
|
||||
|
||||
#ifdef TCL_NO_DEPRECATED
|
||||
iPtr->result = &tclEmptyString;
|
||||
#else
|
||||
iPtr->result = iPtr->resultSpace;
|
||||
#endif
|
||||
iPtr->freeProc = NULL;
|
||||
iPtr->legacyResult = NULL;
|
||||
/* Special invalid value: Any attempt to free the legacy result
|
||||
* will cause a crash. */
|
||||
iPtr->legacyFreeProc = (void (*) (void))-1;
|
||||
iPtr->errorLine = 0;
|
||||
iPtr->stubTable = &tclStubs;
|
||||
iPtr->objResultPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(iPtr->objResultPtr);
|
||||
iPtr->handle = TclHandleCreate(iPtr);
|
||||
@@ -530,8 +510,7 @@ Tcl_CreateInterp(void)
|
||||
iPtr->hiddenCmdTablePtr = NULL;
|
||||
iPtr->interpInfo = NULL;
|
||||
|
||||
TCL_CT_ASSERT(sizeof(iPtr->extra) <= sizeof(Tcl_HashTable));
|
||||
iPtr->extra.optimizer = TclOptimizeBytecode;
|
||||
iPtr->optimizer = TclOptimizeBytecode;
|
||||
|
||||
iPtr->numLevels = 0;
|
||||
iPtr->maxNestingDepth = MAX_NESTING_DEPTH;
|
||||
@@ -580,12 +559,6 @@ Tcl_CreateInterp(void)
|
||||
iPtr->rootFramePtr = NULL; /* Initialise as soon as :: is available */
|
||||
iPtr->lookupNsPtr = NULL;
|
||||
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
iPtr->appendResult = NULL;
|
||||
iPtr->appendAvl = 0;
|
||||
iPtr->appendUsed = 0;
|
||||
#endif
|
||||
|
||||
Tcl_InitHashTable(&iPtr->packageTable, TCL_STRING_KEYS);
|
||||
iPtr->packageUnknown = NULL;
|
||||
|
||||
@@ -614,9 +587,6 @@ Tcl_CreateInterp(void)
|
||||
iPtr->emptyObjPtr = Tcl_NewObj();
|
||||
/* Another empty object. */
|
||||
Tcl_IncrRefCount(iPtr->emptyObjPtr);
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
iPtr->resultSpace[0] = 0;
|
||||
#endif
|
||||
iPtr->threadId = Tcl_GetCurrentThread();
|
||||
|
||||
/* TIP #378 */
|
||||
@@ -726,12 +696,6 @@ Tcl_CreateInterp(void)
|
||||
memset(statsPtr->literalCount, 0, sizeof(statsPtr->literalCount));
|
||||
#endif /* TCL_COMPILE_STATS */
|
||||
|
||||
/*
|
||||
* Initialise the stub table pointer.
|
||||
*/
|
||||
|
||||
iPtr->stubTable = &tclStubs;
|
||||
|
||||
/*
|
||||
* Initialize the ensemble error message rewriting support.
|
||||
*/
|
||||
@@ -957,11 +921,6 @@ Tcl_CreateInterp(void)
|
||||
|
||||
Tcl_SetVar2(interp, "tcl_patchLevel", NULL, TCL_PATCH_LEVEL, TCL_GLOBAL_ONLY);
|
||||
Tcl_SetVar2(interp, "tcl_version", NULL, TCL_VERSION, TCL_GLOBAL_ONLY);
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
Tcl_TraceVar2(interp, "tcl_precision", NULL,
|
||||
TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
|
||||
TclPrecTraceProc, NULL);
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
TclpSetVariables(interp);
|
||||
|
||||
#ifdef TCL_THREADS
|
||||
@@ -1530,7 +1489,6 @@ DeleteInterpProc(
|
||||
*/
|
||||
|
||||
Tcl_FreeResult(interp);
|
||||
iPtr->result = NULL;
|
||||
Tcl_DecrRefCount(iPtr->objResultPtr);
|
||||
iPtr->objResultPtr = NULL;
|
||||
Tcl_DecrRefCount(iPtr->ecVar);
|
||||
@@ -1552,12 +1510,6 @@ DeleteInterpProc(
|
||||
if (iPtr->returnOpts) {
|
||||
Tcl_DecrRefCount(iPtr->returnOpts);
|
||||
}
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
if (iPtr->appendResult != NULL) {
|
||||
ckfree(iPtr->appendResult);
|
||||
iPtr->appendResult = NULL;
|
||||
}
|
||||
#endif
|
||||
TclFreePackageInfo(iPtr);
|
||||
while (iPtr->tracePtr != NULL) {
|
||||
Tcl_DeleteTrace((Tcl_Interp *) iPtr, (Tcl_Trace) iPtr->tracePtr);
|
||||
@@ -2514,7 +2466,7 @@ TclInvokeStringCommand(
|
||||
* in the Command structure.
|
||||
*
|
||||
* Results:
|
||||
* A standard Tcl string result value.
|
||||
* A standard Tcl result value.
|
||||
*
|
||||
* Side effects:
|
||||
* Besides those side effects of the called Tcl_ObjCmdProc,
|
||||
@@ -2554,13 +2506,6 @@ TclInvokeObjectCommand(
|
||||
cmdPtr->objClientData, argc, objv);
|
||||
}
|
||||
|
||||
/*
|
||||
* Move the interpreter's object result to the string result, then reset
|
||||
* the object result.
|
||||
*/
|
||||
|
||||
(void) Tcl_GetStringResult(interp);
|
||||
|
||||
/*
|
||||
* Decrement the ref counts for the argument objects created above, then
|
||||
* free the objv array if malloc'ed storage was used.
|
||||
@@ -3501,362 +3446,6 @@ TclCleanupCommand(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_CreateMathFunc --
|
||||
*
|
||||
* Creates a new math function for expressions in a given interpreter.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The Tcl function defined by "name" is created or redefined. If the
|
||||
* function already exists then its definition is replaced; this includes
|
||||
* the builtin functions. Redefining a builtin function forces all
|
||||
* existing code to be invalidated since that code may be compiled using
|
||||
* an instruction specific to the replaced function. In addition,
|
||||
* redefioning a non-builtin function will force existing code to be
|
||||
* invalidated if the number of arguments has changed.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED)
|
||||
void
|
||||
Tcl_CreateMathFunc(
|
||||
Tcl_Interp *interp, /* Interpreter in which function is to be
|
||||
* available. */
|
||||
const char *name, /* Name of function (e.g. "sin"). */
|
||||
int numArgs, /* Nnumber of arguments required by
|
||||
* function. */
|
||||
Tcl_ValueType *argTypes, /* Array of types acceptable for each
|
||||
* argument. */
|
||||
Tcl_MathProc *proc, /* C function that implements the math
|
||||
* function. */
|
||||
ClientData clientData) /* Additional value to pass to the
|
||||
* function. */
|
||||
{
|
||||
Tcl_DString bigName;
|
||||
OldMathFuncData *data = ckalloc(sizeof(OldMathFuncData));
|
||||
|
||||
data->proc = proc;
|
||||
data->numArgs = numArgs;
|
||||
data->argTypes = ckalloc(numArgs * sizeof(Tcl_ValueType));
|
||||
memcpy(data->argTypes, argTypes, numArgs * sizeof(Tcl_ValueType));
|
||||
data->clientData = clientData;
|
||||
|
||||
Tcl_DStringInit(&bigName);
|
||||
TclDStringAppendLiteral(&bigName, "::tcl::mathfunc::");
|
||||
Tcl_DStringAppend(&bigName, name, -1);
|
||||
|
||||
Tcl_CreateObjCommand(interp, Tcl_DStringValue(&bigName),
|
||||
OldMathFuncProc, data, OldMathFuncDeleteProc);
|
||||
Tcl_DStringFree(&bigName);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* OldMathFuncProc --
|
||||
*
|
||||
* Dispatch to a math function created with Tcl_CreateMathFunc
|
||||
*
|
||||
* Results:
|
||||
* Returns a standard Tcl result.
|
||||
*
|
||||
* Side effects:
|
||||
* Whatever the math function does.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
OldMathFuncProc(
|
||||
ClientData clientData, /* Pointer to OldMathFuncData describing the
|
||||
* function being called */
|
||||
Tcl_Interp *interp, /* Tcl interpreter */
|
||||
int objc, /* Actual parameter count */
|
||||
Tcl_Obj *const *objv) /* Parameter vector */
|
||||
{
|
||||
Tcl_Obj *valuePtr;
|
||||
OldMathFuncData *dataPtr = clientData;
|
||||
Tcl_Value funcResult, *args;
|
||||
int result;
|
||||
int j, k;
|
||||
double d;
|
||||
|
||||
/*
|
||||
* Check argument count.
|
||||
*/
|
||||
|
||||
if (objc != dataPtr->numArgs + 1) {
|
||||
MathFuncWrongNumArgs(interp, dataPtr->numArgs+1, objc, objv);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert arguments from Tcl_Obj's to Tcl_Value's.
|
||||
*/
|
||||
|
||||
args = ckalloc(dataPtr->numArgs * sizeof(Tcl_Value));
|
||||
for (j = 1, k = 0; j < objc; ++j, ++k) {
|
||||
/* TODO: Convert to TclGetNumberFromObj? */
|
||||
valuePtr = objv[j];
|
||||
result = Tcl_GetDoubleFromObj(NULL, valuePtr, &d);
|
||||
#ifdef ACCEPT_NAN
|
||||
if ((result != TCL_OK) && (valuePtr->typePtr == &tclDoubleType)) {
|
||||
d = valuePtr->internalRep.doubleValue;
|
||||
result = TCL_OK;
|
||||
}
|
||||
#endif
|
||||
if (result != TCL_OK) {
|
||||
/*
|
||||
* We have a non-numeric argument.
|
||||
*/
|
||||
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"argument to math function didn't have numeric value",
|
||||
-1));
|
||||
TclCheckBadOctal(interp, TclGetString(valuePtr));
|
||||
ckfree(args);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the object's numeric value to the argument record, converting
|
||||
* it if necessary.
|
||||
*
|
||||
* NOTE: no bignum support; use the new mathfunc interface for that.
|
||||
*/
|
||||
|
||||
args[k].type = dataPtr->argTypes[k];
|
||||
switch (args[k].type) {
|
||||
case TCL_EITHER:
|
||||
if (Tcl_GetLongFromObj(NULL, valuePtr, &args[k].intValue)
|
||||
== TCL_OK) {
|
||||
args[k].type = TCL_INT;
|
||||
break;
|
||||
}
|
||||
if (TclGetWideIntFromObj(interp, valuePtr, &args[k].wideValue)
|
||||
== TCL_OK) {
|
||||
args[k].type = TCL_WIDE_INT;
|
||||
break;
|
||||
}
|
||||
args[k].type = TCL_DOUBLE;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case TCL_DOUBLE:
|
||||
args[k].doubleValue = d;
|
||||
break;
|
||||
case TCL_INT:
|
||||
if (ExprIntFunc(NULL, interp, 2, &objv[j-1]) != TCL_OK) {
|
||||
ckfree(args);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
valuePtr = Tcl_GetObjResult(interp);
|
||||
Tcl_GetLongFromObj(NULL, valuePtr, &args[k].intValue);
|
||||
Tcl_ResetResult(interp);
|
||||
break;
|
||||
case TCL_WIDE_INT:
|
||||
if (ExprWideFunc(NULL, interp, 2, &objv[j-1]) != TCL_OK) {
|
||||
ckfree(args);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
valuePtr = Tcl_GetObjResult(interp);
|
||||
TclGetWideIntFromObj(NULL, valuePtr, &args[k].wideValue);
|
||||
Tcl_ResetResult(interp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Call the function.
|
||||
*/
|
||||
|
||||
errno = 0;
|
||||
result = dataPtr->proc(dataPtr->clientData, interp, args, &funcResult);
|
||||
ckfree(args);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the result of the call.
|
||||
*/
|
||||
|
||||
if (funcResult.type == TCL_INT) {
|
||||
TclNewIntObj(valuePtr, funcResult.intValue);
|
||||
} else if (funcResult.type == TCL_WIDE_INT) {
|
||||
valuePtr = Tcl_NewWideIntObj(funcResult.wideValue);
|
||||
} else {
|
||||
return CheckDoubleResult(interp, funcResult.doubleValue);
|
||||
}
|
||||
Tcl_SetObjResult(interp, valuePtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* OldMathFuncDeleteProc --
|
||||
*
|
||||
* Cleans up after deleting a math function registered with
|
||||
* Tcl_CreateMathFunc
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Frees allocated memory.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
OldMathFuncDeleteProc(
|
||||
ClientData clientData)
|
||||
{
|
||||
OldMathFuncData *dataPtr = clientData;
|
||||
|
||||
ckfree(dataPtr->argTypes);
|
||||
ckfree(dataPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_GetMathFuncInfo --
|
||||
*
|
||||
* Discovers how a particular math function was created in a given
|
||||
* interpreter.
|
||||
*
|
||||
* Results:
|
||||
* TCL_OK if it succeeds, TCL_ERROR else (leaving an error message in the
|
||||
* interpreter result if that happens.)
|
||||
*
|
||||
* Side effects:
|
||||
* If this function succeeds, the variables pointed to by the numArgsPtr
|
||||
* and argTypePtr arguments will be updated to detail the arguments
|
||||
* allowed by the function. The variable pointed to by the procPtr
|
||||
* argument will be set to NULL if the function is a builtin function,
|
||||
* and will be set to the address of the C function used to implement the
|
||||
* math function otherwise (in which case the variable pointed to by the
|
||||
* clientDataPtr argument will also be updated.)
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_GetMathFuncInfo(
|
||||
Tcl_Interp *interp,
|
||||
const char *name,
|
||||
int *numArgsPtr,
|
||||
Tcl_ValueType **argTypesPtr,
|
||||
Tcl_MathProc **procPtr,
|
||||
ClientData *clientDataPtr)
|
||||
{
|
||||
Tcl_Obj *cmdNameObj;
|
||||
Command *cmdPtr;
|
||||
|
||||
/*
|
||||
* Get the command that implements the math function.
|
||||
*/
|
||||
|
||||
TclNewLiteralStringObj(cmdNameObj, "tcl::mathfunc::");
|
||||
Tcl_AppendToObj(cmdNameObj, name, -1);
|
||||
Tcl_IncrRefCount(cmdNameObj);
|
||||
cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, cmdNameObj);
|
||||
Tcl_DecrRefCount(cmdNameObj);
|
||||
|
||||
/*
|
||||
* Report unknown functions.
|
||||
*/
|
||||
|
||||
if (cmdPtr == NULL) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"unknown math function \"%s\"", name));
|
||||
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "MATHFUNC", name, NULL);
|
||||
*numArgsPtr = -1;
|
||||
*argTypesPtr = NULL;
|
||||
*procPtr = NULL;
|
||||
*clientDataPtr = NULL;
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Retrieve function info for user defined functions; return dummy
|
||||
* information for builtins.
|
||||
*/
|
||||
|
||||
if (cmdPtr->objProc == &OldMathFuncProc) {
|
||||
OldMathFuncData *dataPtr = cmdPtr->clientData;
|
||||
|
||||
*procPtr = dataPtr->proc;
|
||||
*numArgsPtr = dataPtr->numArgs;
|
||||
*argTypesPtr = dataPtr->argTypes;
|
||||
*clientDataPtr = dataPtr->clientData;
|
||||
} else {
|
||||
*procPtr = NULL;
|
||||
*numArgsPtr = -1;
|
||||
*argTypesPtr = NULL;
|
||||
*procPtr = NULL;
|
||||
*clientDataPtr = NULL;
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_ListMathFuncs --
|
||||
*
|
||||
* Produces a list of all the math functions defined in a given
|
||||
* interpreter.
|
||||
*
|
||||
* Results:
|
||||
* A pointer to a Tcl_Obj structure with a reference count of zero, or
|
||||
* NULL in the case of an error (in which case a suitable error message
|
||||
* will be left in the interpreter result.)
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_ListMathFuncs(
|
||||
Tcl_Interp *interp,
|
||||
const char *pattern)
|
||||
{
|
||||
Tcl_Obj *script = Tcl_NewStringObj("::info functions ", -1);
|
||||
Tcl_Obj *result;
|
||||
Tcl_InterpState state;
|
||||
|
||||
if (pattern) {
|
||||
Tcl_Obj *patternObj = Tcl_NewStringObj(pattern, -1);
|
||||
Tcl_Obj *arg = Tcl_NewListObj(1, &patternObj);
|
||||
|
||||
Tcl_AppendObjToObj(script, arg);
|
||||
Tcl_DecrRefCount(arg); /* Should tear down patternObj too */
|
||||
}
|
||||
|
||||
state = Tcl_SaveInterpState(interp, TCL_OK);
|
||||
Tcl_IncrRefCount(script);
|
||||
if (TCL_OK == Tcl_EvalObjEx(interp, script, 0)) {
|
||||
result = Tcl_DuplicateObj(Tcl_GetObjResult(interp));
|
||||
} else {
|
||||
result = Tcl_NewObj();
|
||||
}
|
||||
Tcl_DecrRefCount(script);
|
||||
Tcl_RestoreInterpState(interp, state);
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* !defined(TCL_NO_DEPRECATED) */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -3870,7 +3459,7 @@ Tcl_ListMathFuncs(
|
||||
* otherwise.
|
||||
*
|
||||
* Side effects:
|
||||
* The interpreters object and string results are cleared.
|
||||
* The interpreter's result is cleared.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3882,8 +3471,8 @@ TclInterpReady(
|
||||
register Interp *iPtr = (Interp *) interp;
|
||||
|
||||
/*
|
||||
* Reset both the interpreter's string and object results and clear out
|
||||
* any previous error information.
|
||||
* Reset the interpreter's result and clear out any previous error
|
||||
* information.
|
||||
*/
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
@@ -4463,30 +4052,9 @@ TclNRRunCallbacks(
|
||||
/* All callbacks down to rootPtr not inclusive
|
||||
* are to be run. */
|
||||
{
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
#endif /* !defined(TCL_NO_DEPRECATED) */
|
||||
NRE_callback *callbackPtr;
|
||||
Tcl_NRPostProc *procPtr;
|
||||
|
||||
/*
|
||||
* If the interpreter has a non-empty string result, the result object is
|
||||
* either empty or stale because some function set interp->result
|
||||
* directly. If so, move the string result to the result object, then
|
||||
* reset the string result.
|
||||
*
|
||||
* This only needs to be done for the first item in the list: all other
|
||||
* are for NR function calls, and those are Tcl_Obj based.
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
if (*(iPtr->result) != 0) {
|
||||
(void) Tcl_GetObjResult(interp);
|
||||
}
|
||||
#endif /* !defined(TCL_NO_DEPRECATED) */
|
||||
|
||||
/* This is the trampoline. */
|
||||
|
||||
while (TOP_CB(interp) != rootPtr) {
|
||||
callbackPtr = TOP_CB(interp);
|
||||
procPtr = callbackPtr->procPtr;
|
||||
@@ -4801,7 +4369,7 @@ TEOV_RunEnterTraces(
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Command *cmdPtr = *cmdPtrPtr;
|
||||
unsigned int newEpoch, cmdEpoch = cmdPtr->cmdEpoch;
|
||||
size_t newEpoch, cmdEpoch = cmdPtr->cmdEpoch;
|
||||
int length, traceCode = TCL_OK;
|
||||
const char *command = TclGetStringFromObj(commandPtr, &length);
|
||||
|
||||
@@ -4944,56 +4512,6 @@ Tcl_EvalTokensStandard(
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_EvalTokens --
|
||||
*
|
||||
* Given an array of tokens parsed from a Tcl command (e.g., the tokens
|
||||
* that make up a word or the index for an array variable) this function
|
||||
* evaluates the tokens and concatenates their values to form a single
|
||||
* result value.
|
||||
*
|
||||
* Results:
|
||||
* The return value is a pointer to a newly allocated Tcl_Obj containing
|
||||
* the value of the array of tokens. The reference count of the returned
|
||||
* object has been incremented. If an error occurs in evaluating the
|
||||
* tokens then a NULL value is returned and an error message is left in
|
||||
* interp's result.
|
||||
*
|
||||
* Side effects:
|
||||
* A new object is allocated to hold the result.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* This uses a non-standard return convention; its use is now deprecated. It
|
||||
* is a wrapper for the new function Tcl_EvalTokensStandard, and is not used
|
||||
* in the core any longer. It is only kept for backward compatibility.
|
||||
*/
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_EvalTokens(
|
||||
Tcl_Interp *interp, /* Interpreter in which to lookup variables,
|
||||
* execute nested commands, and report
|
||||
* errors. */
|
||||
Tcl_Token *tokenPtr, /* Pointer to first in an array of tokens to
|
||||
* evaluate and concatenate. */
|
||||
int count) /* Number of tokens to consider at tokenPtr.
|
||||
* Must be at least 1. */
|
||||
{
|
||||
Tcl_Obj *resPtr;
|
||||
|
||||
if (Tcl_EvalTokensStandard(interp, tokenPtr, count) != TCL_OK) {
|
||||
return NULL;
|
||||
}
|
||||
resPtr = Tcl_GetObjResult(interp);
|
||||
Tcl_IncrRefCount(resPtr);
|
||||
Tcl_ResetResult(interp);
|
||||
return resPtr;
|
||||
}
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -5956,50 +5474,7 @@ Tcl_Eval(
|
||||
* previous call to Tcl_CreateInterp). */
|
||||
const char *script) /* Pointer to TCL command to execute. */
|
||||
{
|
||||
int code = Tcl_EvalEx(interp, script, -1, 0);
|
||||
|
||||
/*
|
||||
* For backwards compatibility with old C code that predates the object
|
||||
* system in Tcl 8.0, we have to mirror the object result back into the
|
||||
* string result (some callers may expect it there).
|
||||
*/
|
||||
|
||||
(void) Tcl_GetStringResult(interp);
|
||||
return code;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_EvalObj, Tcl_GlobalEvalObj --
|
||||
*
|
||||
* These functions are deprecated but we keep them around for backwards
|
||||
* compatibility reasons.
|
||||
*
|
||||
* Results:
|
||||
* See the functions they call.
|
||||
*
|
||||
* Side effects:
|
||||
* See the functions they call.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef Tcl_EvalObj
|
||||
int
|
||||
Tcl_EvalObj(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr)
|
||||
{
|
||||
return Tcl_EvalObjEx(interp, objPtr, 0);
|
||||
}
|
||||
#undef Tcl_GlobalEvalObj
|
||||
int
|
||||
Tcl_GlobalEvalObj(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr)
|
||||
{
|
||||
return Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_GLOBAL);
|
||||
return Tcl_EvalEx(interp, script, -1, 0);
|
||||
}
|
||||
#endif /* TCL_NO_DEPRECATED */
|
||||
|
||||
@@ -6388,9 +5863,6 @@ Tcl_ExprLong(
|
||||
Tcl_IncrRefCount(exprPtr);
|
||||
result = Tcl_ExprLongObj(interp, exprPtr, ptr);
|
||||
Tcl_DecrRefCount(exprPtr);
|
||||
if (result != TCL_OK) {
|
||||
(void) Tcl_GetStringResult(interp);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -6417,9 +5889,6 @@ Tcl_ExprDouble(
|
||||
result = Tcl_ExprDoubleObj(interp, exprPtr, ptr);
|
||||
Tcl_DecrRefCount(exprPtr);
|
||||
/* Discard the expression object. */
|
||||
if (result != TCL_OK) {
|
||||
(void) Tcl_GetStringResult(interp);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -6445,14 +5914,6 @@ Tcl_ExprBoolean(
|
||||
Tcl_IncrRefCount(exprPtr);
|
||||
result = Tcl_ExprBooleanObj(interp, exprPtr, ptr);
|
||||
Tcl_DecrRefCount(exprPtr);
|
||||
if (result != TCL_OK) {
|
||||
/*
|
||||
* Move the interpreter's object result to the string result, then
|
||||
* reset the object result.
|
||||
*/
|
||||
|
||||
(void) Tcl_GetStringResult(interp);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -6766,12 +6227,6 @@ Tcl_ExprString(
|
||||
Tcl_DecrRefCount(resultPtr);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Force the string rep of the interp result.
|
||||
*/
|
||||
|
||||
(void) Tcl_GetStringResult(interp);
|
||||
return code;
|
||||
}
|
||||
|
||||
@@ -6878,20 +6333,7 @@ Tcl_AddObjErrorInfo(
|
||||
|
||||
iPtr->flags |= ERR_LEGACY_COPY;
|
||||
if (iPtr->errorInfo == NULL) {
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
if (*(iPtr->result) != 0) {
|
||||
/*
|
||||
* The interp's string result is set, apparently by some extension
|
||||
* making a deprecated direct write to it. That extension may
|
||||
* expect interp->result to continue to be set, so we'll take
|
||||
* special pains to avoid clearing it, until we drop support for
|
||||
* interp->result completely.
|
||||
*/
|
||||
|
||||
iPtr->errorInfo = Tcl_NewStringObj(iPtr->result, -1);
|
||||
} else
|
||||
#endif /* !defined(TCL_NO_DEPRECATED) */
|
||||
iPtr->errorInfo = iPtr->objResultPtr;
|
||||
iPtr->errorInfo = iPtr->objResultPtr;
|
||||
Tcl_IncrRefCount(iPtr->errorInfo);
|
||||
if (!iPtr->errorCode) {
|
||||
Tcl_SetErrorCode(interp, "NONE", NULL);
|
||||
@@ -6913,32 +6355,34 @@ Tcl_AddObjErrorInfo(
|
||||
}
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_VarEvalVA --
|
||||
* Tcl_VarEval --
|
||||
*
|
||||
* Given a variable number of string arguments, concatenate them all
|
||||
* together and execute the result as a Tcl command.
|
||||
*
|
||||
* Results:
|
||||
* A standard Tcl return result. An error message or other result may be
|
||||
* left in the interp's result.
|
||||
* left in the interp.
|
||||
*
|
||||
* Side effects:
|
||||
* Depends on what was done by the command.
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_VarEvalVA(
|
||||
Tcl_Interp *interp, /* Interpreter in which to evaluate command */
|
||||
va_list argList) /* Variable argument list. */
|
||||
Tcl_VarEval(
|
||||
Tcl_Interp *interp,
|
||||
...)
|
||||
{
|
||||
va_list argList;
|
||||
int result;
|
||||
Tcl_DString buf;
|
||||
char *string;
|
||||
int result;
|
||||
|
||||
va_start(argList, interp);
|
||||
/*
|
||||
* Copy the strings one after the other into a single larger string. Use
|
||||
* stack-allocated space for small commands, but if the command gets too
|
||||
@@ -6959,39 +6403,6 @@ Tcl_VarEvalVA(
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_VarEval --
|
||||
*
|
||||
* Given a variable number of string arguments, concatenate them all
|
||||
* together and execute the result as a Tcl command.
|
||||
*
|
||||
* Results:
|
||||
* A standard Tcl return result. An error message or other result may be
|
||||
* left in interp->result.
|
||||
*
|
||||
* Side effects:
|
||||
* Depends on what was done by the command.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_VarEval(
|
||||
Tcl_Interp *interp,
|
||||
...)
|
||||
{
|
||||
va_list argList;
|
||||
int result;
|
||||
|
||||
va_start(argList, interp);
|
||||
result = Tcl_VarEvalVA(interp, argList);
|
||||
va_end(argList);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
|
||||
+1
-1
@@ -267,7 +267,7 @@ const Tcl_ObjType tclByteArrayType = {
|
||||
* fewer mallocs.
|
||||
*/
|
||||
|
||||
typedef struct ByteArray {
|
||||
typedef struct {
|
||||
int used; /* The number of bytes used in the byte
|
||||
* array. */
|
||||
int allocated; /* The amount of space actually allocated
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
* "memory tag" command is invoked, to hold the current tag.
|
||||
*/
|
||||
|
||||
typedef struct MemTag {
|
||||
typedef struct {
|
||||
size_t refCount; /* Number of mem_headers referencing this
|
||||
* tag. */
|
||||
char string[1]; /* Actual size of string will be as large as
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ typedef struct {
|
||||
* Structure containing the fields used in [clock format] and [clock scan]
|
||||
*/
|
||||
|
||||
typedef struct TclDateFields {
|
||||
typedef struct {
|
||||
Tcl_WideInt seconds; /* Time expressed in seconds from the Posix
|
||||
* epoch */
|
||||
Tcl_WideInt localSeconds; /* Local time expressed in nominal seconds
|
||||
|
||||
@@ -147,143 +147,6 @@ Tcl_BreakObjCmd(
|
||||
return TCL_BREAK;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_CaseObjCmd --
|
||||
*
|
||||
* This procedure is invoked to process the "case" Tcl command. See the
|
||||
* user documentation for details on what it does. THIS COMMAND IS
|
||||
* OBSOLETE AND DEPRECATED. SLATED FOR REMOVAL IN TCL 9.0.
|
||||
*
|
||||
* Results:
|
||||
* A standard Tcl object result.
|
||||
*
|
||||
* Side effects:
|
||||
* See the user documentation.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
/* ARGSUSED */
|
||||
int
|
||||
Tcl_CaseObjCmd(
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
register int i;
|
||||
int body, result, caseObjc;
|
||||
const char *stringPtr, *arg;
|
||||
Tcl_Obj *const *caseObjv;
|
||||
Tcl_Obj *armPtr;
|
||||
|
||||
if (objc < 3) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv,
|
||||
"string ?in? ?pattern body ...? ?default body?");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
stringPtr = TclGetString(objv[1]);
|
||||
body = -1;
|
||||
|
||||
arg = TclGetString(objv[2]);
|
||||
if (strcmp(arg, "in") == 0) {
|
||||
i = 3;
|
||||
} else {
|
||||
i = 2;
|
||||
}
|
||||
caseObjc = objc - i;
|
||||
caseObjv = objv + i;
|
||||
|
||||
/*
|
||||
* If all of the pattern/command pairs are lumped into a single argument,
|
||||
* split them out again.
|
||||
*/
|
||||
|
||||
if (caseObjc == 1) {
|
||||
Tcl_Obj **newObjv;
|
||||
|
||||
TclListObjGetElements(interp, caseObjv[0], &caseObjc, &newObjv);
|
||||
caseObjv = newObjv;
|
||||
}
|
||||
|
||||
for (i = 0; i < caseObjc; i += 2) {
|
||||
int patObjc, j;
|
||||
const char **patObjv;
|
||||
const char *pat, *p;
|
||||
|
||||
if (i == caseObjc-1) {
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"extra case pattern with no body", -1));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for special case of single pattern (no list) with no
|
||||
* backslash sequences.
|
||||
*/
|
||||
|
||||
pat = TclGetString(caseObjv[i]);
|
||||
for (p = pat; *p != '\0'; p++) {
|
||||
if (TclIsSpaceProc(*p) || (*p == '\\')) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (*p == '\0') {
|
||||
if ((*pat == 'd') && (strcmp(pat, "default") == 0)) {
|
||||
body = i + 1;
|
||||
}
|
||||
if (Tcl_StringMatch(stringPtr, pat)) {
|
||||
body = i + 1;
|
||||
goto match;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Break up pattern lists, then check each of the patterns in the
|
||||
* list.
|
||||
*/
|
||||
|
||||
result = Tcl_SplitList(interp, pat, &patObjc, &patObjv);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
for (j = 0; j < patObjc; j++) {
|
||||
if (Tcl_StringMatch(stringPtr, patObjv[j])) {
|
||||
body = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ckfree(patObjv);
|
||||
if (j < patObjc) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
match:
|
||||
if (body != -1) {
|
||||
armPtr = caseObjv[body - 1];
|
||||
result = Tcl_EvalObjEx(interp, caseObjv[body], 0);
|
||||
if (result == TCL_ERROR) {
|
||||
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
|
||||
"\n (\"%.50s\" arm line %d)",
|
||||
TclGetString(armPtr), Tcl_GetErrorLine(interp)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Nothing matched: return nothing.
|
||||
*/
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ typedef int (*SortMemCmpFn_t) (const void *, const void *, size_t);
|
||||
* The following structure is used to pass this information.
|
||||
*/
|
||||
|
||||
typedef struct SortInfo {
|
||||
typedef struct {
|
||||
int isIncreasing; /* Nonzero means sort in increasing order. */
|
||||
int sortMode; /* The sort mode. One of SORTMODE_* values
|
||||
* defined below. */
|
||||
|
||||
+4
-5
@@ -1576,11 +1576,9 @@ StringIsCmd(
|
||||
string1 = TclGetStringFromObj(objPtr, &length1);
|
||||
result = length1 == 0;
|
||||
}
|
||||
} else if (index != STR_IS_BOOL) {
|
||||
TclGetBooleanFromObj(NULL, objPtr, &i);
|
||||
if ((index == STR_IS_TRUE) ^ i) {
|
||||
result = 0;
|
||||
}
|
||||
} else if ((objPtr->internalRep.wideValue != 0)
|
||||
? (index == STR_IS_FALSE) : (index == STR_IS_TRUE)) {
|
||||
result = 0;
|
||||
}
|
||||
break;
|
||||
case STR_IS_CONTROL:
|
||||
@@ -2874,6 +2872,7 @@ StringCatCmd(
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
StringBytesCmd(
|
||||
ClientData dummy, /* Not used. */
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* The tree is composed of OpNodes.
|
||||
*/
|
||||
|
||||
typedef struct OpNode {
|
||||
typedef struct {
|
||||
int left; /* "Pointer" to the left operand. */
|
||||
int right; /* "Pointer" to the right operand. */
|
||||
union {
|
||||
|
||||
+4
-22
@@ -129,10 +129,6 @@ InstructionDesc const tclInstructionTable[] = {
|
||||
{"jumpFalse4", 5, -1, 1, {OPERAND_OFFSET4}},
|
||||
/* Jump relative to (pc + op4) if stktop expr object is false */
|
||||
|
||||
{"lor", 1, -1, 0, {OPERAND_NONE}},
|
||||
/* Logical or: push (stknext || stktop) */
|
||||
{"land", 1, -1, 0, {OPERAND_NONE}},
|
||||
/* Logical and: push (stknext && stktop) */
|
||||
{"bitor", 1, -1, 0, {OPERAND_NONE}},
|
||||
/* Bitwise or: push (stknext | stktop) */
|
||||
{"bitxor", 1, -1, 0, {OPERAND_NONE}},
|
||||
@@ -173,10 +169,6 @@ InstructionDesc const tclInstructionTable[] = {
|
||||
/* Bitwise not: push ~stktop */
|
||||
{"not", 1, 0, 0, {OPERAND_NONE}},
|
||||
/* Logical not: push !stktop */
|
||||
{"callBuiltinFunc1", 2, 1, 1, {OPERAND_UINT1}},
|
||||
/* Call builtin math function with index op1; any args are on stk */
|
||||
{"callFunc1", 2, INT_MIN, 1, {OPERAND_UINT1}},
|
||||
/* Call non-builtin func objv[0]; <objc,objv>=<op1,top op1> */
|
||||
{"tryCvtToNumeric", 1, 0, 0, {OPERAND_NONE}},
|
||||
/* Try converting stktop to first int then double if possible. */
|
||||
|
||||
@@ -186,13 +178,6 @@ InstructionDesc const tclInstructionTable[] = {
|
||||
/* Skip to next iteration of closest enclosing loop; if none, return
|
||||
* TCL_CONTINUE code. */
|
||||
|
||||
{"foreach_start4", 5, 0, 1, {OPERAND_AUX4}},
|
||||
/* Initialize execution of a foreach loop. Operand is aux data index
|
||||
* of the ForeachInfo structure for the foreach command. */
|
||||
{"foreach_step4", 5, +1, 1, {OPERAND_AUX4}},
|
||||
/* "Step" or begin next iteration of foreach loop. Push 0 if to
|
||||
* terminate loop, else push 1. */
|
||||
|
||||
{"beginCatch4", 5, 0, 1, {OPERAND_UINT4}},
|
||||
/* Record start of catch with the operand's exception index. Push the
|
||||
* current stack depth onto a special catch stack. */
|
||||
@@ -340,9 +325,6 @@ InstructionDesc const tclInstructionTable[] = {
|
||||
{"dictNext", 5, +3, 1, {OPERAND_LVT4}},
|
||||
/* Get the next iteration from the iterator in op4's local scalar.
|
||||
* Stack: ... => ... value key doneBool */
|
||||
{"dictDone", 5, 0, 1, {OPERAND_LVT4}},
|
||||
/* Terminate the iterator in op4's local scalar. Use unsetScalar
|
||||
* instead (with 0 for flags). */
|
||||
{"dictUpdateStart", 9, 0, 2, {OPERAND_LVT4, OPERAND_AUX4}},
|
||||
/* Create the variables (described in the aux data referred to by the
|
||||
* second immediate argument) to mirror the state of the dictionary in
|
||||
@@ -853,8 +835,8 @@ TclSetByteCodeFromAny(
|
||||
* instruction generator boundaries.
|
||||
*/
|
||||
|
||||
if (iPtr->extra.optimizer) {
|
||||
(iPtr->extra.optimizer)(&compEnv);
|
||||
if (iPtr->optimizer) {
|
||||
(iPtr->optimizer)(&compEnv);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1132,7 +1114,7 @@ CleanupByteCode(
|
||||
}
|
||||
}
|
||||
|
||||
if (codePtr->localCachePtr && (--codePtr->localCachePtr->refCount == 0)) {
|
||||
if (codePtr->localCachePtr && (codePtr->localCachePtr->refCount-- <= 1)) {
|
||||
TclFreeLocalCache(interp, codePtr->localCachePtr);
|
||||
}
|
||||
|
||||
@@ -1428,7 +1410,7 @@ TclInitCompileEnv(
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
|
||||
assert(tclInstructionTable[LAST_INST_OPCODE+1].name == NULL);
|
||||
assert(tclInstructionTable[LAST_INST_OPCODE].name == NULL);
|
||||
|
||||
envPtr->iPtr = iPtr;
|
||||
envPtr->source = stringPtr;
|
||||
|
||||
+243
-263
@@ -87,7 +87,7 @@ typedef enum {
|
||||
* to a catch PC offset. */
|
||||
} ExceptionRangeType;
|
||||
|
||||
typedef struct ExceptionRange {
|
||||
typedef struct {
|
||||
ExceptionRangeType type; /* The kind of ExceptionRange. */
|
||||
int nestingLevel; /* Static depth of the exception range. Used
|
||||
* to find the most deeply-nested range
|
||||
@@ -162,7 +162,7 @@ typedef struct ExceptionAux {
|
||||
* source offset is not monotonic.
|
||||
*/
|
||||
|
||||
typedef struct CmdLocation {
|
||||
typedef struct {
|
||||
int codeOffset; /* Offset of first byte of command code. */
|
||||
int numCodeBytes; /* Number of bytes for command's code. */
|
||||
int srcOffset; /* Offset of first char of the command. */
|
||||
@@ -180,7 +180,7 @@ typedef struct CmdLocation {
|
||||
* frame and associated information, like the path of a sourced file.
|
||||
*/
|
||||
|
||||
typedef struct ECL {
|
||||
typedef struct {
|
||||
int srcOffset; /* Command location to find the entry. */
|
||||
int nline; /* Number of words in the command */
|
||||
int *line; /* Line information for all words in the
|
||||
@@ -190,7 +190,7 @@ typedef struct ECL {
|
||||
* lines. */
|
||||
} ECL;
|
||||
|
||||
typedef struct ExtCmdLoc {
|
||||
typedef struct {
|
||||
int type; /* Context type. */
|
||||
int start; /* Starting line for compiled script. Needed
|
||||
* for the extended recompile check in
|
||||
@@ -417,7 +417,7 @@ typedef struct ByteCode {
|
||||
* procs are specific to an interpreter so the
|
||||
* code emitted will depend on the
|
||||
* interpreter. */
|
||||
unsigned int compileEpoch; /* Value of iPtr->compileEpoch when this
|
||||
size_t compileEpoch; /* Value of iPtr->compileEpoch when this
|
||||
* ByteCode was compiled. Used to invalidate
|
||||
* code when, e.g., commands with compile
|
||||
* procs are redefined. */
|
||||
@@ -425,11 +425,11 @@ typedef struct ByteCode {
|
||||
* compiled. If the code is executed if a
|
||||
* different namespace, it must be
|
||||
* recompiled. */
|
||||
unsigned int nsEpoch; /* Value of nsPtr->resolverEpoch when this
|
||||
size_t nsEpoch; /* Value of nsPtr->resolverEpoch when this
|
||||
* ByteCode was compiled. Used to invalidate
|
||||
* code when new namespace resolution rules
|
||||
* are put into effect. */
|
||||
unsigned int refCount; /* Reference count: set 1 when created plus 1
|
||||
size_t 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. */
|
||||
@@ -519,312 +519,292 @@ typedef struct ByteCode {
|
||||
* Opcodes for the Tcl bytecode instructions. These must correspond to the
|
||||
* entries in the table of instruction descriptions, tclInstructionTable, in
|
||||
* tclCompile.c. Also, the order and number of the expression opcodes (e.g.,
|
||||
* INST_LOR) must match the entries in the array operatorStrings in
|
||||
* INST_BITOR) must match the entries in the array operatorStrings in
|
||||
* tclExecute.c.
|
||||
*/
|
||||
|
||||
/* Opcodes 0 to 9 */
|
||||
#define INST_DONE 0
|
||||
#define INST_PUSH1 1
|
||||
#define INST_PUSH4 2
|
||||
#define INST_POP 3
|
||||
#define INST_DUP 4
|
||||
#define INST_STR_CONCAT1 5
|
||||
#define INST_INVOKE_STK1 6
|
||||
#define INST_INVOKE_STK4 7
|
||||
#define INST_EVAL_STK 8
|
||||
#define INST_EXPR_STK 9
|
||||
enum TclInstruction {
|
||||
|
||||
/* Opcodes 10 to 23 */
|
||||
#define INST_LOAD_SCALAR1 10
|
||||
#define INST_LOAD_SCALAR4 11
|
||||
#define INST_LOAD_SCALAR_STK 12
|
||||
#define INST_LOAD_ARRAY1 13
|
||||
#define INST_LOAD_ARRAY4 14
|
||||
#define INST_LOAD_ARRAY_STK 15
|
||||
#define INST_LOAD_STK 16
|
||||
#define INST_STORE_SCALAR1 17
|
||||
#define INST_STORE_SCALAR4 18
|
||||
#define INST_STORE_SCALAR_STK 19
|
||||
#define INST_STORE_ARRAY1 20
|
||||
#define INST_STORE_ARRAY4 21
|
||||
#define INST_STORE_ARRAY_STK 22
|
||||
#define INST_STORE_STK 23
|
||||
/* Opcodes 0 to 9 */
|
||||
INST_DONE = 0,
|
||||
INST_PUSH1,
|
||||
INST_PUSH4,
|
||||
INST_POP,
|
||||
INST_DUP,
|
||||
INST_STR_CONCAT1,
|
||||
INST_INVOKE_STK1,
|
||||
INST_INVOKE_STK4,
|
||||
INST_EVAL_STK,
|
||||
INST_EXPR_STK,
|
||||
|
||||
/* Opcodes 24 to 33 */
|
||||
#define INST_INCR_SCALAR1 24
|
||||
#define INST_INCR_SCALAR_STK 25
|
||||
#define INST_INCR_ARRAY1 26
|
||||
#define INST_INCR_ARRAY_STK 27
|
||||
#define INST_INCR_STK 28
|
||||
#define INST_INCR_SCALAR1_IMM 29
|
||||
#define INST_INCR_SCALAR_STK_IMM 30
|
||||
#define INST_INCR_ARRAY1_IMM 31
|
||||
#define INST_INCR_ARRAY_STK_IMM 32
|
||||
#define INST_INCR_STK_IMM 33
|
||||
/* Opcodes 10 to 23 */
|
||||
INST_LOAD_SCALAR1,
|
||||
INST_LOAD_SCALAR4,
|
||||
INST_LOAD_SCALAR_STK,
|
||||
INST_LOAD_ARRAY1,
|
||||
INST_LOAD_ARRAY4,
|
||||
INST_LOAD_ARRAY_STK,
|
||||
INST_LOAD_STK,
|
||||
INST_STORE_SCALAR1,
|
||||
INST_STORE_SCALAR4,
|
||||
INST_STORE_SCALAR_STK,
|
||||
INST_STORE_ARRAY1,
|
||||
INST_STORE_ARRAY4,
|
||||
INST_STORE_ARRAY_STK,
|
||||
INST_STORE_STK,
|
||||
|
||||
/* Opcodes 34 to 39 */
|
||||
#define INST_JUMP1 34
|
||||
#define INST_JUMP4 35
|
||||
#define INST_JUMP_TRUE1 36
|
||||
#define INST_JUMP_TRUE4 37
|
||||
#define INST_JUMP_FALSE1 38
|
||||
#define INST_JUMP_FALSE4 39
|
||||
/* Opcodes 24 to 33 */
|
||||
INST_INCR_SCALAR1,
|
||||
INST_INCR_SCALAR_STK,
|
||||
INST_INCR_ARRAY1,
|
||||
INST_INCR_ARRAY_STK,
|
||||
INST_INCR_STK,
|
||||
INST_INCR_SCALAR1_IMM,
|
||||
INST_INCR_SCALAR_STK_IMM,
|
||||
INST_INCR_ARRAY1_IMM,
|
||||
INST_INCR_ARRAY_STK_IMM,
|
||||
INST_INCR_STK_IMM,
|
||||
|
||||
/* Opcodes 40 to 64 */
|
||||
#define INST_LOR 40
|
||||
#define INST_LAND 41
|
||||
#define INST_BITOR 42
|
||||
#define INST_BITXOR 43
|
||||
#define INST_BITAND 44
|
||||
#define INST_EQ 45
|
||||
#define INST_NEQ 46
|
||||
#define INST_LT 47
|
||||
#define INST_GT 48
|
||||
#define INST_LE 49
|
||||
#define INST_GE 50
|
||||
#define INST_LSHIFT 51
|
||||
#define INST_RSHIFT 52
|
||||
#define INST_ADD 53
|
||||
#define INST_SUB 54
|
||||
#define INST_MULT 55
|
||||
#define INST_DIV 56
|
||||
#define INST_MOD 57
|
||||
#define INST_UPLUS 58
|
||||
#define INST_UMINUS 59
|
||||
#define INST_BITNOT 60
|
||||
#define INST_LNOT 61
|
||||
#define INST_CALL_BUILTIN_FUNC1 62
|
||||
#define INST_CALL_FUNC1 63
|
||||
#define INST_TRY_CVT_TO_NUMERIC 64
|
||||
/* Opcodes 34 to 39 */
|
||||
INST_JUMP1,
|
||||
INST_JUMP4,
|
||||
INST_JUMP_TRUE1,
|
||||
INST_JUMP_TRUE4,
|
||||
INST_JUMP_FALSE1,
|
||||
INST_JUMP_FALSE4,
|
||||
|
||||
/* Opcodes 65 to 66 */
|
||||
#define INST_BREAK 65
|
||||
#define INST_CONTINUE 66
|
||||
/* Opcodes 42 to 64 */
|
||||
INST_BITOR,
|
||||
INST_BITXOR,
|
||||
INST_BITAND,
|
||||
INST_EQ,
|
||||
INST_NEQ,
|
||||
INST_LT,
|
||||
INST_GT,
|
||||
INST_LE,
|
||||
INST_GE,
|
||||
INST_LSHIFT,
|
||||
INST_RSHIFT,
|
||||
INST_ADD,
|
||||
INST_SUB,
|
||||
INST_MULT,
|
||||
INST_DIV,
|
||||
INST_MOD,
|
||||
INST_UPLUS,
|
||||
INST_UMINUS,
|
||||
INST_BITNOT,
|
||||
INST_LNOT,
|
||||
INST_TRY_CVT_TO_NUMERIC,
|
||||
|
||||
/* Opcodes 67 to 68 */
|
||||
#define INST_FOREACH_START4 67 /* DEPRECATED */
|
||||
#define INST_FOREACH_STEP4 68 /* DEPRECATED */
|
||||
/* Opcodes 65 to 66 */
|
||||
INST_BREAK,
|
||||
INST_CONTINUE,
|
||||
|
||||
/* Opcodes 69 to 72 */
|
||||
#define INST_BEGIN_CATCH4 69
|
||||
#define INST_END_CATCH 70
|
||||
#define INST_PUSH_RESULT 71
|
||||
#define INST_PUSH_RETURN_CODE 72
|
||||
/* Opcodes 69 to 72 */
|
||||
INST_BEGIN_CATCH4,
|
||||
INST_END_CATCH,
|
||||
INST_PUSH_RESULT,
|
||||
INST_PUSH_RETURN_CODE,
|
||||
|
||||
/* Opcodes 73 to 78 */
|
||||
#define INST_STR_EQ 73
|
||||
#define INST_STR_NEQ 74
|
||||
#define INST_STR_CMP 75
|
||||
#define INST_STR_LEN 76
|
||||
#define INST_STR_INDEX 77
|
||||
#define INST_STR_MATCH 78
|
||||
/* Opcodes 73 to 78 */
|
||||
INST_STR_EQ,
|
||||
INST_STR_NEQ,
|
||||
INST_STR_CMP,
|
||||
INST_STR_LEN,
|
||||
INST_STR_INDEX,
|
||||
INST_STR_MATCH,
|
||||
|
||||
/* Opcodes 78 to 81 */
|
||||
#define INST_LIST 79
|
||||
#define INST_LIST_INDEX 80
|
||||
#define INST_LIST_LENGTH 81
|
||||
/* Opcodes 79 to 81 */
|
||||
INST_LIST,
|
||||
INST_LIST_INDEX,
|
||||
INST_LIST_LENGTH,
|
||||
|
||||
/* Opcodes 82 to 87 */
|
||||
#define INST_APPEND_SCALAR1 82
|
||||
#define INST_APPEND_SCALAR4 83
|
||||
#define INST_APPEND_ARRAY1 84
|
||||
#define INST_APPEND_ARRAY4 85
|
||||
#define INST_APPEND_ARRAY_STK 86
|
||||
#define INST_APPEND_STK 87
|
||||
/* Opcodes 82 to 87 */
|
||||
INST_APPEND_SCALAR1,
|
||||
INST_APPEND_SCALAR4,
|
||||
INST_APPEND_ARRAY1,
|
||||
INST_APPEND_ARRAY4,
|
||||
INST_APPEND_ARRAY_STK,
|
||||
INST_APPEND_STK,
|
||||
|
||||
/* Opcodes 88 to 93 */
|
||||
#define INST_LAPPEND_SCALAR1 88
|
||||
#define INST_LAPPEND_SCALAR4 89
|
||||
#define INST_LAPPEND_ARRAY1 90
|
||||
#define INST_LAPPEND_ARRAY4 91
|
||||
#define INST_LAPPEND_ARRAY_STK 92
|
||||
#define INST_LAPPEND_STK 93
|
||||
/* Opcodes 88 to 93 */
|
||||
INST_LAPPEND_SCALAR1,
|
||||
INST_LAPPEND_SCALAR4,
|
||||
INST_LAPPEND_ARRAY1,
|
||||
INST_LAPPEND_ARRAY4,
|
||||
INST_LAPPEND_ARRAY_STK,
|
||||
INST_LAPPEND_STK,
|
||||
|
||||
/* TIP #22 - LINDEX operator with flat arg list */
|
||||
/* TIP #22 - LINDEX operator with flat arg list */
|
||||
INST_LIST_INDEX_MULTI,
|
||||
|
||||
#define INST_LIST_INDEX_MULTI 94
|
||||
/*
|
||||
* TIP #33 - 'lset' command. Code gen also required a Forth-like
|
||||
* OVER operation.
|
||||
*/
|
||||
INST_OVER,
|
||||
INST_LSET_LIST,
|
||||
INST_LSET_FLAT,
|
||||
|
||||
/*
|
||||
* TIP #33 - 'lset' command. Code gen also required a Forth-like
|
||||
* OVER operation.
|
||||
*/
|
||||
/* TIP#90 - 'return' command. */
|
||||
INST_RETURN_IMM,
|
||||
|
||||
#define INST_OVER 95
|
||||
#define INST_LSET_LIST 96
|
||||
#define INST_LSET_FLAT 97
|
||||
/* TIP#123 - exponentiation operator. */
|
||||
INST_EXPON,
|
||||
|
||||
/* TIP#90 - 'return' command. */
|
||||
/* TIP #157 - {*}... (word expansion) language syntax support. */
|
||||
INST_EXPAND_START,
|
||||
INST_EXPAND_STKTOP,
|
||||
INST_INVOKE_EXPANDED,
|
||||
|
||||
#define INST_RETURN_IMM 98
|
||||
/*
|
||||
* TIP #57 - 'lassign' command. Code generation requires immediate
|
||||
* LINDEX and LRANGE operators.
|
||||
*/
|
||||
INST_LIST_INDEX_IMM,
|
||||
INST_LIST_RANGE_IMM,
|
||||
INST_START_CMD,
|
||||
INST_LIST_IN,
|
||||
INST_LIST_NOT_IN,
|
||||
INST_PUSH_RETURN_OPTIONS,
|
||||
INST_RETURN_STK,
|
||||
|
||||
/* TIP#123 - exponentiation operator. */
|
||||
/*
|
||||
* Dictionary (TIP#111) related commands.
|
||||
*/
|
||||
INST_DICT_GET,
|
||||
INST_DICT_SET,
|
||||
INST_DICT_UNSET,
|
||||
INST_DICT_INCR_IMM,
|
||||
INST_DICT_APPEND,
|
||||
INST_DICT_LAPPEND,
|
||||
INST_DICT_FIRST,
|
||||
INST_DICT_NEXT,
|
||||
INST_DICT_UPDATE_START,
|
||||
INST_DICT_UPDATE_END,
|
||||
|
||||
#define INST_EXPON 99
|
||||
/*
|
||||
* Instruction to support jumps defined by tables (instead of the classic
|
||||
* [switch] technique of chained comparisons).
|
||||
*/
|
||||
INST_JUMP_TABLE,
|
||||
|
||||
/* TIP #157 - {*}... (word expansion) language syntax support. */
|
||||
/*
|
||||
* Instructions to support compilation of global, variable, upvar and
|
||||
* [namespace upvar].
|
||||
*/
|
||||
INST_UPVAR,
|
||||
INST_NSUPVAR,
|
||||
INST_VARIABLE,
|
||||
|
||||
#define INST_EXPAND_START 100
|
||||
#define INST_EXPAND_STKTOP 101
|
||||
#define INST_INVOKE_EXPANDED 102
|
||||
/* Instruction to support compiling syntax error to bytecode */
|
||||
INST_SYNTAX,
|
||||
|
||||
/*
|
||||
* TIP #57 - 'lassign' command. Code generation requires immediate
|
||||
* LINDEX and LRANGE operators.
|
||||
*/
|
||||
/* Instruction to reverse N items on top of stack */
|
||||
INST_REVERSE,
|
||||
|
||||
#define INST_LIST_INDEX_IMM 103
|
||||
#define INST_LIST_RANGE_IMM 104
|
||||
/* regexp instruction */
|
||||
INST_REGEXP,
|
||||
|
||||
#define INST_START_CMD 105
|
||||
/* For [info exists] compilation */
|
||||
INST_EXIST_SCALAR,
|
||||
INST_EXIST_ARRAY,
|
||||
INST_EXIST_ARRAY_STK,
|
||||
INST_EXIST_STK,
|
||||
|
||||
#define INST_LIST_IN 106
|
||||
#define INST_LIST_NOT_IN 107
|
||||
/* For [subst] compilation */
|
||||
INST_NOP,
|
||||
INST_RETURN_CODE_BRANCH,
|
||||
|
||||
#define INST_PUSH_RETURN_OPTIONS 108
|
||||
#define INST_RETURN_STK 109
|
||||
/* For [unset] compilation */
|
||||
INST_UNSET_SCALAR,
|
||||
INST_UNSET_ARRAY,
|
||||
INST_UNSET_ARRAY_STK,
|
||||
INST_UNSET_STK,
|
||||
|
||||
/*
|
||||
* Dictionary (TIP#111) related commands.
|
||||
*/
|
||||
/* For [dict with], [dict exists], [dict create] and [dict merge] */
|
||||
INST_DICT_EXPAND,
|
||||
INST_DICT_RECOMBINE_STK,
|
||||
INST_DICT_RECOMBINE_IMM,
|
||||
INST_DICT_EXISTS,
|
||||
INST_DICT_VERIFY,
|
||||
|
||||
#define INST_DICT_GET 110
|
||||
#define INST_DICT_SET 111
|
||||
#define INST_DICT_UNSET 112
|
||||
#define INST_DICT_INCR_IMM 113
|
||||
#define INST_DICT_APPEND 114
|
||||
#define INST_DICT_LAPPEND 115
|
||||
#define INST_DICT_FIRST 116
|
||||
#define INST_DICT_NEXT 117
|
||||
#define INST_DICT_DONE 118
|
||||
#define INST_DICT_UPDATE_START 119
|
||||
#define INST_DICT_UPDATE_END 120
|
||||
/* For [string map] and [regsub] compilation */
|
||||
INST_STR_MAP,
|
||||
INST_STR_FIND,
|
||||
INST_STR_FIND_LAST,
|
||||
INST_STR_RANGE_IMM,
|
||||
INST_STR_RANGE,
|
||||
|
||||
/*
|
||||
* Instruction to support jumps defined by tables (instead of the classic
|
||||
* [switch] technique of chained comparisons).
|
||||
*/
|
||||
/* For operations to do with coroutines and other NRE-manipulators */
|
||||
INST_YIELD,
|
||||
INST_COROUTINE_NAME,
|
||||
INST_TAILCALL,
|
||||
|
||||
#define INST_JUMP_TABLE 121
|
||||
/* For compilation of basic information operations */
|
||||
INST_NS_CURRENT,
|
||||
INST_INFO_LEVEL_NUM,
|
||||
INST_INFO_LEVEL_ARGS,
|
||||
INST_RESOLVE_COMMAND,
|
||||
|
||||
/*
|
||||
* Instructions to support compilation of global, variable, upvar and
|
||||
* [namespace upvar].
|
||||
*/
|
||||
/* For compilation relating to TclOO */
|
||||
INST_TCLOO_SELF,
|
||||
INST_TCLOO_CLASS,
|
||||
INST_TCLOO_NS,
|
||||
INST_TCLOO_IS_OBJECT,
|
||||
|
||||
#define INST_UPVAR 122
|
||||
#define INST_NSUPVAR 123
|
||||
#define INST_VARIABLE 124
|
||||
/* For compilation of [array] subcommands */
|
||||
INST_ARRAY_EXISTS_STK,
|
||||
INST_ARRAY_EXISTS_IMM,
|
||||
INST_ARRAY_MAKE_STK,
|
||||
INST_ARRAY_MAKE_IMM,
|
||||
|
||||
/* Instruction to support compiling syntax error to bytecode */
|
||||
INST_INVOKE_REPLACE,
|
||||
|
||||
#define INST_SYNTAX 125
|
||||
INST_LIST_CONCAT,
|
||||
|
||||
/* Instruction to reverse N items on top of stack */
|
||||
INST_EXPAND_DROP,
|
||||
|
||||
#define INST_REVERSE 126
|
||||
/* New foreach implementation */
|
||||
INST_FOREACH_START,
|
||||
INST_FOREACH_STEP,
|
||||
INST_FOREACH_END,
|
||||
INST_LMAP_COLLECT,
|
||||
|
||||
/* regexp instruction */
|
||||
/* For compilation of [string trim] and related */
|
||||
INST_STR_TRIM,
|
||||
INST_STR_TRIM_LEFT,
|
||||
INST_STR_TRIM_RIGHT,
|
||||
|
||||
#define INST_REGEXP 127
|
||||
INST_CONCAT_STK,
|
||||
|
||||
/* For [info exists] compilation */
|
||||
#define INST_EXIST_SCALAR 128
|
||||
#define INST_EXIST_ARRAY 129
|
||||
#define INST_EXIST_ARRAY_STK 130
|
||||
#define INST_EXIST_STK 131
|
||||
INST_STR_UPPER,
|
||||
INST_STR_LOWER,
|
||||
INST_STR_TITLE,
|
||||
INST_STR_REPLACE,
|
||||
|
||||
/* For [subst] compilation */
|
||||
#define INST_NOP 132
|
||||
#define INST_RETURN_CODE_BRANCH 133
|
||||
INST_ORIGIN_COMMAND,
|
||||
|
||||
/* For [unset] compilation */
|
||||
#define INST_UNSET_SCALAR 134
|
||||
#define INST_UNSET_ARRAY 135
|
||||
#define INST_UNSET_ARRAY_STK 136
|
||||
#define INST_UNSET_STK 137
|
||||
INST_TCLOO_NEXT,
|
||||
INST_TCLOO_NEXT_CLASS,
|
||||
|
||||
/* For [dict with], [dict exists], [dict create] and [dict merge] */
|
||||
#define INST_DICT_EXPAND 138
|
||||
#define INST_DICT_RECOMBINE_STK 139
|
||||
#define INST_DICT_RECOMBINE_IMM 140
|
||||
#define INST_DICT_EXISTS 141
|
||||
#define INST_DICT_VERIFY 142
|
||||
INST_YIELD_TO_INVOKE,
|
||||
|
||||
/* For [string map] and [regsub] compilation */
|
||||
#define INST_STR_MAP 143
|
||||
#define INST_STR_FIND 144
|
||||
#define INST_STR_FIND_LAST 145
|
||||
#define INST_STR_RANGE_IMM 146
|
||||
#define INST_STR_RANGE 147
|
||||
INST_NUM_TYPE,
|
||||
INST_TRY_CVT_TO_BOOLEAN,
|
||||
INST_STR_CLASS,
|
||||
|
||||
/* For operations to do with coroutines and other NRE-manipulators */
|
||||
#define INST_YIELD 148
|
||||
#define INST_COROUTINE_NAME 149
|
||||
#define INST_TAILCALL 150
|
||||
INST_LAPPEND_LIST,
|
||||
INST_LAPPEND_LIST_ARRAY,
|
||||
INST_LAPPEND_LIST_ARRAY_STK,
|
||||
INST_LAPPEND_LIST_STK,
|
||||
|
||||
/* For compilation of basic information operations */
|
||||
#define INST_NS_CURRENT 151
|
||||
#define INST_INFO_LEVEL_NUM 152
|
||||
#define INST_INFO_LEVEL_ARGS 153
|
||||
#define INST_RESOLVE_COMMAND 154
|
||||
INST_CLOCK_READ,
|
||||
|
||||
/* For compilation relating to TclOO */
|
||||
#define INST_TCLOO_SELF 155
|
||||
#define INST_TCLOO_CLASS 156
|
||||
#define INST_TCLOO_NS 157
|
||||
#define INST_TCLOO_IS_OBJECT 158
|
||||
/* The last opcode */
|
||||
LAST_INST_OPCODE
|
||||
};
|
||||
|
||||
/* For compilation of [array] subcommands */
|
||||
#define INST_ARRAY_EXISTS_STK 159
|
||||
#define INST_ARRAY_EXISTS_IMM 160
|
||||
#define INST_ARRAY_MAKE_STK 161
|
||||
#define INST_ARRAY_MAKE_IMM 162
|
||||
|
||||
#define INST_INVOKE_REPLACE 163
|
||||
|
||||
#define INST_LIST_CONCAT 164
|
||||
|
||||
#define INST_EXPAND_DROP 165
|
||||
|
||||
/* New foreach implementation */
|
||||
#define INST_FOREACH_START 166
|
||||
#define INST_FOREACH_STEP 167
|
||||
#define INST_FOREACH_END 168
|
||||
#define INST_LMAP_COLLECT 169
|
||||
|
||||
/* For compilation of [string trim] and related */
|
||||
#define INST_STR_TRIM 170
|
||||
#define INST_STR_TRIM_LEFT 171
|
||||
#define INST_STR_TRIM_RIGHT 172
|
||||
|
||||
#define INST_CONCAT_STK 173
|
||||
|
||||
#define INST_STR_UPPER 174
|
||||
#define INST_STR_LOWER 175
|
||||
#define INST_STR_TITLE 176
|
||||
#define INST_STR_REPLACE 177
|
||||
|
||||
#define INST_ORIGIN_COMMAND 178
|
||||
|
||||
#define INST_TCLOO_NEXT 179
|
||||
#define INST_TCLOO_NEXT_CLASS 180
|
||||
|
||||
#define INST_YIELD_TO_INVOKE 181
|
||||
|
||||
#define INST_NUM_TYPE 182
|
||||
#define INST_TRY_CVT_TO_BOOLEAN 183
|
||||
#define INST_STR_CLASS 184
|
||||
|
||||
#define INST_LAPPEND_LIST 185
|
||||
#define INST_LAPPEND_LIST_ARRAY 186
|
||||
#define INST_LAPPEND_LIST_ARRAY_STK 187
|
||||
#define INST_LAPPEND_LIST_STK 188
|
||||
|
||||
#define INST_CLOCK_READ 189
|
||||
|
||||
/* The last opcode */
|
||||
#define LAST_INST_OPCODE 189
|
||||
|
||||
/*
|
||||
* Table describing the Tcl bytecode instructions: their name (for displaying
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* the (Tcl_Interp *) in which it is stored, and the encoding.
|
||||
*/
|
||||
|
||||
typedef struct QCCD {
|
||||
typedef struct {
|
||||
Tcl_Obj *pkg;
|
||||
Tcl_Interp *interp;
|
||||
char *encoding;
|
||||
|
||||
+94
-190
@@ -118,9 +118,7 @@ EXTERN void Tcl_DbIncrRefCount(Tcl_Obj *objPtr, const char *file,
|
||||
/* 21 */
|
||||
EXTERN int Tcl_DbIsShared(Tcl_Obj *objPtr, const char *file,
|
||||
int line);
|
||||
/* 22 */
|
||||
EXTERN Tcl_Obj * Tcl_DbNewBooleanObj(int boolValue, const char *file,
|
||||
int line);
|
||||
/* Slot 22 is reserved */
|
||||
/* 23 */
|
||||
EXTERN Tcl_Obj * Tcl_DbNewByteArrayObj(const unsigned char *bytes,
|
||||
int length, const char *file, int line);
|
||||
@@ -130,9 +128,7 @@ EXTERN Tcl_Obj * Tcl_DbNewDoubleObj(double doubleValue,
|
||||
/* 25 */
|
||||
EXTERN Tcl_Obj * Tcl_DbNewListObj(int objc, Tcl_Obj *const *objv,
|
||||
const char *file, int line);
|
||||
/* 26 */
|
||||
EXTERN Tcl_Obj * Tcl_DbNewLongObj(long longValue, const char *file,
|
||||
int line);
|
||||
/* Slot 26 is reserved */
|
||||
/* 27 */
|
||||
EXTERN Tcl_Obj * Tcl_DbNewObj(const char *file, int line);
|
||||
/* 28 */
|
||||
@@ -171,7 +167,7 @@ EXTERN int Tcl_GetIntFromObj(Tcl_Interp *interp,
|
||||
EXTERN int Tcl_GetLongFromObj(Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr, long *longPtr);
|
||||
/* 40 */
|
||||
EXTERN CONST86 Tcl_ObjType * Tcl_GetObjType(const char *typeName);
|
||||
EXTERN const Tcl_ObjType * Tcl_GetObjType(const char *typeName);
|
||||
/* 41 */
|
||||
EXTERN char * Tcl_GetStringFromObj(Tcl_Obj *objPtr, int *lengthPtr);
|
||||
/* 42 */
|
||||
@@ -197,25 +193,21 @@ EXTERN int Tcl_ListObjLength(Tcl_Interp *interp,
|
||||
EXTERN int Tcl_ListObjReplace(Tcl_Interp *interp,
|
||||
Tcl_Obj *listPtr, int first, int count,
|
||||
int objc, Tcl_Obj *const objv[]);
|
||||
/* 49 */
|
||||
EXTERN Tcl_Obj * Tcl_NewBooleanObj(int boolValue);
|
||||
/* Slot 49 is reserved */
|
||||
/* 50 */
|
||||
EXTERN Tcl_Obj * Tcl_NewByteArrayObj(const unsigned char *bytes,
|
||||
int length);
|
||||
/* 51 */
|
||||
EXTERN Tcl_Obj * Tcl_NewDoubleObj(double doubleValue);
|
||||
/* 52 */
|
||||
EXTERN Tcl_Obj * Tcl_NewIntObj(int intValue);
|
||||
/* Slot 52 is reserved */
|
||||
/* 53 */
|
||||
EXTERN Tcl_Obj * Tcl_NewListObj(int objc, Tcl_Obj *const objv[]);
|
||||
/* 54 */
|
||||
EXTERN Tcl_Obj * Tcl_NewLongObj(long longValue);
|
||||
/* Slot 54 is reserved */
|
||||
/* 55 */
|
||||
EXTERN Tcl_Obj * Tcl_NewObj(void);
|
||||
/* 56 */
|
||||
EXTERN Tcl_Obj * Tcl_NewStringObj(const char *bytes, int length);
|
||||
/* 57 */
|
||||
EXTERN void Tcl_SetBooleanObj(Tcl_Obj *objPtr, int boolValue);
|
||||
/* Slot 57 is reserved */
|
||||
/* 58 */
|
||||
EXTERN unsigned char * Tcl_SetByteArrayLength(Tcl_Obj *objPtr, int length);
|
||||
/* 59 */
|
||||
@@ -223,13 +215,11 @@ EXTERN void Tcl_SetByteArrayObj(Tcl_Obj *objPtr,
|
||||
const unsigned char *bytes, int length);
|
||||
/* 60 */
|
||||
EXTERN void Tcl_SetDoubleObj(Tcl_Obj *objPtr, double doubleValue);
|
||||
/* 61 */
|
||||
EXTERN void Tcl_SetIntObj(Tcl_Obj *objPtr, int intValue);
|
||||
/* Slot 61 is reserved */
|
||||
/* 62 */
|
||||
EXTERN void Tcl_SetListObj(Tcl_Obj *objPtr, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
/* 63 */
|
||||
EXTERN void Tcl_SetLongObj(Tcl_Obj *objPtr, long longValue);
|
||||
/* Slot 63 is reserved */
|
||||
/* 64 */
|
||||
EXTERN void Tcl_SetObjLength(Tcl_Obj *objPtr, int length);
|
||||
/* 65 */
|
||||
@@ -261,9 +251,7 @@ EXTERN void Tcl_AsyncMark(Tcl_AsyncHandler async);
|
||||
EXTERN int Tcl_AsyncReady(void);
|
||||
/* 76 */
|
||||
EXTERN void Tcl_BackgroundError(Tcl_Interp *interp);
|
||||
/* 77 */
|
||||
TCL_DEPRECATED("Use Tcl_UtfBackslash")
|
||||
char Tcl_Backslash(const char *src, int *readPtr);
|
||||
/* Slot 77 is reserved */
|
||||
/* 78 */
|
||||
EXTERN int Tcl_BadChannelOption(Tcl_Interp *interp,
|
||||
const char *optionName,
|
||||
@@ -321,12 +309,7 @@ EXTERN void Tcl_CreateExitHandler(Tcl_ExitProc *proc,
|
||||
ClientData clientData);
|
||||
/* 94 */
|
||||
EXTERN Tcl_Interp * Tcl_CreateInterp(void);
|
||||
/* 95 */
|
||||
TCL_DEPRECATED("")
|
||||
void Tcl_CreateMathFunc(Tcl_Interp *interp,
|
||||
const char *name, int numArgs,
|
||||
Tcl_ValueType *argTypes, Tcl_MathProc *proc,
|
||||
ClientData clientData);
|
||||
/* Slot 95 is reserved */
|
||||
/* 96 */
|
||||
EXTERN Tcl_Command Tcl_CreateObjCommand(Tcl_Interp *interp,
|
||||
const char *cmdName, Tcl_ObjCmdProc *proc,
|
||||
@@ -421,8 +404,7 @@ EXTERN int Tcl_Eval(Tcl_Interp *interp, const char *script);
|
||||
/* 130 */
|
||||
EXTERN int Tcl_EvalFile(Tcl_Interp *interp,
|
||||
const char *fileName);
|
||||
/* 131 */
|
||||
EXTERN int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
/* Slot 131 is reserved */
|
||||
/* 132 */
|
||||
EXTERN void Tcl_EventuallyFree(ClientData clientData,
|
||||
Tcl_FreeProc *freeProc);
|
||||
@@ -501,7 +483,7 @@ EXTERN int Tcl_GetChannelOption(Tcl_Interp *interp,
|
||||
Tcl_Channel chan, const char *optionName,
|
||||
Tcl_DString *dsPtr);
|
||||
/* 158 */
|
||||
EXTERN CONST86 Tcl_ChannelType * Tcl_GetChannelType(Tcl_Channel chan);
|
||||
EXTERN const Tcl_ChannelType * Tcl_GetChannelType(Tcl_Channel chan);
|
||||
/* 159 */
|
||||
EXTERN int Tcl_GetCommandInfo(Tcl_Interp *interp,
|
||||
const char *cmdName, Tcl_CmdInfo *infoPtr);
|
||||
@@ -557,9 +539,7 @@ EXTERN const char * Tcl_GetVar2(Tcl_Interp *interp, const char *part1,
|
||||
/* 177 */
|
||||
EXTERN int Tcl_GlobalEval(Tcl_Interp *interp,
|
||||
const char *command);
|
||||
/* 178 */
|
||||
EXTERN int Tcl_GlobalEvalObj(Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr);
|
||||
/* Slot 178 is reserved */
|
||||
/* 179 */
|
||||
EXTERN int Tcl_HideCommand(Tcl_Interp *interp,
|
||||
const char *cmdName,
|
||||
@@ -667,9 +647,7 @@ EXTERN int Tcl_ScanElement(const char *src, int *flagPtr);
|
||||
/* 219 */
|
||||
EXTERN int Tcl_ScanCountedElement(const char *src, int length,
|
||||
int *flagPtr);
|
||||
/* 220 */
|
||||
TCL_DEPRECATED("")
|
||||
int Tcl_SeekOld(Tcl_Channel chan, int offset, int mode);
|
||||
/* Slot 220 is reserved */
|
||||
/* 221 */
|
||||
EXTERN int Tcl_ServiceAll(void);
|
||||
/* 222 */
|
||||
@@ -739,9 +717,7 @@ EXTERN void Tcl_StaticPackage(Tcl_Interp *interp,
|
||||
Tcl_PackageInitProc *safeInitProc);
|
||||
/* 245 */
|
||||
EXTERN int Tcl_StringMatch(const char *str, const char *pattern);
|
||||
/* 246 */
|
||||
TCL_DEPRECATED("")
|
||||
int Tcl_TellOld(Tcl_Channel chan);
|
||||
/* Slot 246 is reserved */
|
||||
/* 247 */
|
||||
EXTERN int Tcl_TraceVar(Tcl_Interp *interp, const char *varName,
|
||||
int flags, Tcl_VarTraceProc *proc,
|
||||
@@ -811,14 +787,8 @@ EXTERN void Tcl_WrongNumArgs(Tcl_Interp *interp, int objc,
|
||||
EXTERN int Tcl_DumpActiveMemory(const char *fileName);
|
||||
/* 266 */
|
||||
EXTERN void Tcl_ValidateAllMemory(const char *file, int line);
|
||||
/* 267 */
|
||||
TCL_DEPRECATED("see TIP #422")
|
||||
void Tcl_AppendResultVA(Tcl_Interp *interp,
|
||||
va_list argList);
|
||||
/* 268 */
|
||||
TCL_DEPRECATED("see TIP #422")
|
||||
void Tcl_AppendStringsToObjVA(Tcl_Obj *objPtr,
|
||||
va_list argList);
|
||||
/* Slot 267 is reserved */
|
||||
/* Slot 268 is reserved */
|
||||
/* 269 */
|
||||
EXTERN char * Tcl_HashStats(Tcl_HashTable *tablePtr);
|
||||
/* 270 */
|
||||
@@ -837,18 +807,11 @@ EXTERN int Tcl_PkgProvide(Tcl_Interp *interp, const char *name,
|
||||
/* 274 */
|
||||
EXTERN const char * Tcl_PkgRequire(Tcl_Interp *interp, const char *name,
|
||||
const char *version, int exact);
|
||||
/* 275 */
|
||||
TCL_DEPRECATED("see TIP #422")
|
||||
void Tcl_SetErrorCodeVA(Tcl_Interp *interp,
|
||||
va_list argList);
|
||||
/* 276 */
|
||||
TCL_DEPRECATED("see TIP #422")
|
||||
int Tcl_VarEvalVA(Tcl_Interp *interp, va_list argList);
|
||||
/* Slot 275 is reserved */
|
||||
/* Slot 276 is reserved */
|
||||
/* 277 */
|
||||
EXTERN Tcl_Pid Tcl_WaitPid(Tcl_Pid pid, int *statPtr, int options);
|
||||
/* 278 */
|
||||
TCL_DEPRECATED("see TIP #422")
|
||||
TCL_NORETURN void Tcl_PanicVA(const char *format, va_list argList);
|
||||
/* Slot 278 is reserved */
|
||||
/* 279 */
|
||||
EXTERN void Tcl_GetVersion(int *major, int *minor,
|
||||
int *patchLevel, int *type);
|
||||
@@ -1012,12 +975,8 @@ EXTERN int Tcl_WriteChars(Tcl_Channel chan, const char *src,
|
||||
EXTERN int Tcl_WriteObj(Tcl_Channel chan, Tcl_Obj *objPtr);
|
||||
/* 340 */
|
||||
EXTERN char * Tcl_GetString(Tcl_Obj *objPtr);
|
||||
/* 341 */
|
||||
TCL_DEPRECATED("Use Tcl_GetEncodingSearchPath")
|
||||
const char * Tcl_GetDefaultEncodingDir(void);
|
||||
/* 342 */
|
||||
TCL_DEPRECATED("Use Tcl_SetEncodingSearchPath")
|
||||
void Tcl_SetDefaultEncodingDir(const char *path);
|
||||
/* Slot 341 is reserved */
|
||||
/* Slot 342 is reserved */
|
||||
/* 343 */
|
||||
EXTERN void Tcl_AlertNotifier(ClientData clientData);
|
||||
/* 344 */
|
||||
@@ -1051,10 +1010,7 @@ EXTERN Tcl_UniChar * Tcl_UtfToUniCharDString(const char *src, int length,
|
||||
/* 356 */
|
||||
EXTERN Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp,
|
||||
Tcl_Obj *patObj, int flags);
|
||||
/* 357 */
|
||||
TCL_DEPRECATED("Use Tcl_EvalTokensStandard")
|
||||
Tcl_Obj * Tcl_EvalTokens(Tcl_Interp *interp,
|
||||
Tcl_Token *tokenPtr, int count);
|
||||
/* Slot 357 is reserved */
|
||||
/* 358 */
|
||||
EXTERN void Tcl_FreeParse(Tcl_Parse *parsePtr);
|
||||
/* 359 */
|
||||
@@ -1229,12 +1185,8 @@ EXTERN int Tcl_UniCharNcasecmp(const Tcl_UniChar *ucs,
|
||||
/* 420 */
|
||||
EXTERN int Tcl_UniCharCaseMatch(const Tcl_UniChar *uniStr,
|
||||
const Tcl_UniChar *uniPattern, int nocase);
|
||||
/* 421 */
|
||||
EXTERN Tcl_HashEntry * Tcl_FindHashEntry(Tcl_HashTable *tablePtr,
|
||||
const void *key);
|
||||
/* 422 */
|
||||
EXTERN Tcl_HashEntry * Tcl_CreateHashEntry(Tcl_HashTable *tablePtr,
|
||||
const void *key, int *newPtr);
|
||||
/* Slot 421 is reserved */
|
||||
/* Slot 422 is reserved */
|
||||
/* 423 */
|
||||
EXTERN void Tcl_InitCustomHashTable(Tcl_HashTable *tablePtr,
|
||||
int keyType, const Tcl_HashKeyType *typePtr);
|
||||
@@ -1272,17 +1224,8 @@ EXTERN Tcl_ThreadId Tcl_GetChannelThread(Tcl_Channel channel);
|
||||
/* 434 */
|
||||
EXTERN Tcl_UniChar * Tcl_GetUnicodeFromObj(Tcl_Obj *objPtr,
|
||||
int *lengthPtr);
|
||||
/* 435 */
|
||||
TCL_DEPRECATED("")
|
||||
int Tcl_GetMathFuncInfo(Tcl_Interp *interp,
|
||||
const char *name, int *numArgsPtr,
|
||||
Tcl_ValueType **argTypesPtr,
|
||||
Tcl_MathProc **procPtr,
|
||||
ClientData *clientDataPtr);
|
||||
/* 436 */
|
||||
TCL_DEPRECATED("")
|
||||
Tcl_Obj * Tcl_ListMathFuncs(Tcl_Interp *interp,
|
||||
const char *pattern);
|
||||
/* Slot 435 is reserved */
|
||||
/* Slot 436 is reserved */
|
||||
/* 437 */
|
||||
EXTERN Tcl_Obj * Tcl_SubstObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
|
||||
int flags);
|
||||
@@ -1332,7 +1275,7 @@ EXTERN int Tcl_FSFileAttrsGet(Tcl_Interp *interp, int index,
|
||||
EXTERN int Tcl_FSFileAttrsSet(Tcl_Interp *interp, int index,
|
||||
Tcl_Obj *pathPtr, Tcl_Obj *objPtr);
|
||||
/* 453 */
|
||||
EXTERN const char *CONST86 * Tcl_FSFileAttrStrings(Tcl_Obj *pathPtr,
|
||||
EXTERN const char *const * Tcl_FSFileAttrStrings(Tcl_Obj *pathPtr,
|
||||
Tcl_Obj **objPtrRef);
|
||||
/* 454 */
|
||||
EXTERN int Tcl_FSStat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf);
|
||||
@@ -1393,7 +1336,7 @@ EXTERN ClientData Tcl_FSData(const Tcl_Filesystem *fsPtr);
|
||||
EXTERN const char * Tcl_FSGetTranslatedStringPath(Tcl_Interp *interp,
|
||||
Tcl_Obj *pathPtr);
|
||||
/* 477 */
|
||||
EXTERN CONST86 Tcl_Filesystem * Tcl_FSGetFileSystemForPath(Tcl_Obj *pathPtr);
|
||||
EXTERN const Tcl_Filesystem * Tcl_FSGetFileSystemForPath(Tcl_Obj *pathPtr);
|
||||
/* 478 */
|
||||
EXTERN Tcl_PathType Tcl_FSGetPathType(Tcl_Obj *pathPtr);
|
||||
/* 479 */
|
||||
@@ -1887,11 +1830,11 @@ typedef struct TclStubs {
|
||||
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 */
|
||||
Tcl_Obj * (*tcl_DbNewBooleanObj) (int boolValue, const char *file, int line); /* 22 */
|
||||
void (*reserved22)(void);
|
||||
Tcl_Obj * (*tcl_DbNewByteArrayObj) (const unsigned char *bytes, int length, const char *file, int line); /* 23 */
|
||||
Tcl_Obj * (*tcl_DbNewDoubleObj) (double doubleValue, const char *file, int line); /* 24 */
|
||||
Tcl_Obj * (*tcl_DbNewListObj) (int objc, Tcl_Obj *const *objv, const char *file, int line); /* 25 */
|
||||
Tcl_Obj * (*tcl_DbNewLongObj) (long longValue, const char *file, int line); /* 26 */
|
||||
void (*reserved26)(void);
|
||||
Tcl_Obj * (*tcl_DbNewObj) (const char *file, int line); /* 27 */
|
||||
Tcl_Obj * (*tcl_DbNewStringObj) (const char *bytes, int length, const char *file, int line); /* 28 */
|
||||
Tcl_Obj * (*tcl_DuplicateObj) (Tcl_Obj *objPtr); /* 29 */
|
||||
@@ -1905,7 +1848,7 @@ typedef struct TclStubs {
|
||||
int (*tcl_GetInt) (Tcl_Interp *interp, const char *src, int *intPtr); /* 37 */
|
||||
int (*tcl_GetIntFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *intPtr); /* 38 */
|
||||
int (*tcl_GetLongFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, long *longPtr); /* 39 */
|
||||
CONST86 Tcl_ObjType * (*tcl_GetObjType) (const char *typeName); /* 40 */
|
||||
const Tcl_ObjType * (*tcl_GetObjType) (const char *typeName); /* 40 */
|
||||
char * (*tcl_GetStringFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 41 */
|
||||
void (*tcl_InvalidateStringRep) (Tcl_Obj *objPtr); /* 42 */
|
||||
int (*tcl_ListObjAppendList) (Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *elemListPtr); /* 43 */
|
||||
@@ -1914,21 +1857,21 @@ typedef struct TclStubs {
|
||||
int (*tcl_ListObjIndex) (Tcl_Interp *interp, Tcl_Obj *listPtr, int index, Tcl_Obj **objPtrPtr); /* 46 */
|
||||
int (*tcl_ListObjLength) (Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr); /* 47 */
|
||||
int (*tcl_ListObjReplace) (Tcl_Interp *interp, Tcl_Obj *listPtr, int first, int count, int objc, Tcl_Obj *const objv[]); /* 48 */
|
||||
Tcl_Obj * (*tcl_NewBooleanObj) (int boolValue); /* 49 */
|
||||
void (*reserved49)(void);
|
||||
Tcl_Obj * (*tcl_NewByteArrayObj) (const unsigned char *bytes, int length); /* 50 */
|
||||
Tcl_Obj * (*tcl_NewDoubleObj) (double doubleValue); /* 51 */
|
||||
Tcl_Obj * (*tcl_NewIntObj) (int intValue); /* 52 */
|
||||
void (*reserved52)(void);
|
||||
Tcl_Obj * (*tcl_NewListObj) (int objc, Tcl_Obj *const objv[]); /* 53 */
|
||||
Tcl_Obj * (*tcl_NewLongObj) (long longValue); /* 54 */
|
||||
void (*reserved54)(void);
|
||||
Tcl_Obj * (*tcl_NewObj) (void); /* 55 */
|
||||
Tcl_Obj * (*tcl_NewStringObj) (const char *bytes, int length); /* 56 */
|
||||
void (*tcl_SetBooleanObj) (Tcl_Obj *objPtr, int boolValue); /* 57 */
|
||||
void (*reserved57)(void);
|
||||
unsigned char * (*tcl_SetByteArrayLength) (Tcl_Obj *objPtr, int length); /* 58 */
|
||||
void (*tcl_SetByteArrayObj) (Tcl_Obj *objPtr, const unsigned char *bytes, int length); /* 59 */
|
||||
void (*tcl_SetDoubleObj) (Tcl_Obj *objPtr, double doubleValue); /* 60 */
|
||||
void (*tcl_SetIntObj) (Tcl_Obj *objPtr, int intValue); /* 61 */
|
||||
void (*reserved61)(void);
|
||||
void (*tcl_SetListObj) (Tcl_Obj *objPtr, int objc, Tcl_Obj *const objv[]); /* 62 */
|
||||
void (*tcl_SetLongObj) (Tcl_Obj *objPtr, long longValue); /* 63 */
|
||||
void (*reserved63)(void);
|
||||
void (*tcl_SetObjLength) (Tcl_Obj *objPtr, int length); /* 64 */
|
||||
void (*tcl_SetStringObj) (Tcl_Obj *objPtr, const char *bytes, int length); /* 65 */
|
||||
void (*tcl_AddErrorInfo) (Tcl_Interp *interp, const char *message); /* 66 */
|
||||
@@ -1942,7 +1885,7 @@ typedef struct TclStubs {
|
||||
void (*tcl_AsyncMark) (Tcl_AsyncHandler async); /* 74 */
|
||||
int (*tcl_AsyncReady) (void); /* 75 */
|
||||
void (*tcl_BackgroundError) (Tcl_Interp *interp); /* 76 */
|
||||
TCL_DEPRECATED_API("Use Tcl_UtfBackslash") char (*tcl_Backslash) (const char *src, int *readPtr); /* 77 */
|
||||
void (*reserved77)(void);
|
||||
int (*tcl_BadChannelOption) (Tcl_Interp *interp, const char *optionName, const char *optionList); /* 78 */
|
||||
void (*tcl_CallWhenDeleted) (Tcl_Interp *interp, Tcl_InterpDeleteProc *proc, ClientData clientData); /* 79 */
|
||||
void (*tcl_CancelIdleCall) (Tcl_IdleProc *idleProc, ClientData clientData); /* 80 */
|
||||
@@ -1960,7 +1903,7 @@ typedef struct TclStubs {
|
||||
void (*tcl_CreateEventSource) (Tcl_EventSetupProc *setupProc, Tcl_EventCheckProc *checkProc, ClientData clientData); /* 92 */
|
||||
void (*tcl_CreateExitHandler) (Tcl_ExitProc *proc, ClientData clientData); /* 93 */
|
||||
Tcl_Interp * (*tcl_CreateInterp) (void); /* 94 */
|
||||
TCL_DEPRECATED_API("") void (*tcl_CreateMathFunc) (Tcl_Interp *interp, const char *name, int numArgs, Tcl_ValueType *argTypes, Tcl_MathProc *proc, ClientData clientData); /* 95 */
|
||||
void (*reserved95)(void);
|
||||
Tcl_Command (*tcl_CreateObjCommand) (Tcl_Interp *interp, const char *cmdName, Tcl_ObjCmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc); /* 96 */
|
||||
Tcl_Interp * (*tcl_CreateSlave) (Tcl_Interp *interp, const char *slaveName, int isSafe); /* 97 */
|
||||
Tcl_TimerToken (*tcl_CreateTimerHandler) (int milliseconds, Tcl_TimerProc *proc, ClientData clientData); /* 98 */
|
||||
@@ -1996,7 +1939,7 @@ typedef struct TclStubs {
|
||||
const char * (*tcl_ErrnoMsg) (int err); /* 128 */
|
||||
int (*tcl_Eval) (Tcl_Interp *interp, const char *script); /* 129 */
|
||||
int (*tcl_EvalFile) (Tcl_Interp *interp, const char *fileName); /* 130 */
|
||||
int (*tcl_EvalObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 131 */
|
||||
void (*reserved131)(void);
|
||||
void (*tcl_EventuallyFree) (ClientData clientData, Tcl_FreeProc *freeProc); /* 132 */
|
||||
TCL_NORETURN1 void (*tcl_Exit) (int status); /* 133 */
|
||||
int (*tcl_ExposeCommand) (Tcl_Interp *interp, const char *hiddenCmdToken, const char *cmdName); /* 134 */
|
||||
@@ -2023,7 +1966,7 @@ typedef struct TclStubs {
|
||||
int (*tcl_GetChannelMode) (Tcl_Channel chan); /* 155 */
|
||||
const char * (*tcl_GetChannelName) (Tcl_Channel chan); /* 156 */
|
||||
int (*tcl_GetChannelOption) (Tcl_Interp *interp, Tcl_Channel chan, const char *optionName, Tcl_DString *dsPtr); /* 157 */
|
||||
CONST86 Tcl_ChannelType * (*tcl_GetChannelType) (Tcl_Channel chan); /* 158 */
|
||||
const Tcl_ChannelType * (*tcl_GetChannelType) (Tcl_Channel chan); /* 158 */
|
||||
int (*tcl_GetCommandInfo) (Tcl_Interp *interp, const char *cmdName, Tcl_CmdInfo *infoPtr); /* 159 */
|
||||
const char * (*tcl_GetCommandName) (Tcl_Interp *interp, Tcl_Command command); /* 160 */
|
||||
int (*tcl_GetErrno) (void); /* 161 */
|
||||
@@ -2051,7 +1994,7 @@ typedef struct TclStubs {
|
||||
const char * (*tcl_GetVar) (Tcl_Interp *interp, const char *varName, int flags); /* 175 */
|
||||
const char * (*tcl_GetVar2) (Tcl_Interp *interp, const char *part1, const char *part2, int flags); /* 176 */
|
||||
int (*tcl_GlobalEval) (Tcl_Interp *interp, const char *command); /* 177 */
|
||||
int (*tcl_GlobalEvalObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 178 */
|
||||
void (*reserved178)(void);
|
||||
int (*tcl_HideCommand) (Tcl_Interp *interp, const char *cmdName, const char *hiddenCmdToken); /* 179 */
|
||||
int (*tcl_Init) (Tcl_Interp *interp); /* 180 */
|
||||
void (*tcl_InitHashTable) (Tcl_HashTable *tablePtr, int keyType); /* 181 */
|
||||
@@ -2093,7 +2036,7 @@ typedef struct TclStubs {
|
||||
void (*tcl_ResetResult) (Tcl_Interp *interp); /* 217 */
|
||||
int (*tcl_ScanElement) (const char *src, int *flagPtr); /* 218 */
|
||||
int (*tcl_ScanCountedElement) (const char *src, int length, int *flagPtr); /* 219 */
|
||||
TCL_DEPRECATED_API("") int (*tcl_SeekOld) (Tcl_Channel chan, int offset, int mode); /* 220 */
|
||||
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, ClientData clientData); /* 223 */
|
||||
@@ -2119,7 +2062,7 @@ typedef struct TclStubs {
|
||||
void (*tcl_SplitPath) (const char *path, int *argcPtr, const char ***argvPtr); /* 243 */
|
||||
void (*tcl_StaticPackage) (Tcl_Interp *interp, const char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc); /* 244 */
|
||||
int (*tcl_StringMatch) (const char *str, const char *pattern); /* 245 */
|
||||
TCL_DEPRECATED_API("") int (*tcl_TellOld) (Tcl_Channel chan); /* 246 */
|
||||
void (*reserved246)(void);
|
||||
int (*tcl_TraceVar) (Tcl_Interp *interp, const char *varName, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 247 */
|
||||
int (*tcl_TraceVar2) (Tcl_Interp *interp, const char *part1, const char *part2, int flags, Tcl_VarTraceProc *proc, ClientData clientData); /* 248 */
|
||||
char * (*tcl_TranslateFileName) (Tcl_Interp *interp, const char *name, Tcl_DString *bufferPtr); /* 249 */
|
||||
@@ -2140,18 +2083,18 @@ typedef struct TclStubs {
|
||||
void (*tcl_WrongNumArgs) (Tcl_Interp *interp, int 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 */
|
||||
TCL_DEPRECATED_API("see TIP #422") void (*tcl_AppendResultVA) (Tcl_Interp *interp, va_list argList); /* 267 */
|
||||
TCL_DEPRECATED_API("see TIP #422") void (*tcl_AppendStringsToObjVA) (Tcl_Obj *objPtr, va_list argList); /* 268 */
|
||||
void (*reserved267)(void);
|
||||
void (*reserved268)(void);
|
||||
char * (*tcl_HashStats) (Tcl_HashTable *tablePtr); /* 269 */
|
||||
const char * (*tcl_ParseVar) (Tcl_Interp *interp, const char *start, const char **termPtr); /* 270 */
|
||||
const char * (*tcl_PkgPresent) (Tcl_Interp *interp, const char *name, const char *version, int exact); /* 271 */
|
||||
const char * (*tcl_PkgPresentEx) (Tcl_Interp *interp, const char *name, const char *version, int exact, void *clientDataPtr); /* 272 */
|
||||
int (*tcl_PkgProvide) (Tcl_Interp *interp, const char *name, const char *version); /* 273 */
|
||||
const char * (*tcl_PkgRequire) (Tcl_Interp *interp, const char *name, const char *version, int exact); /* 274 */
|
||||
TCL_DEPRECATED_API("see TIP #422") void (*tcl_SetErrorCodeVA) (Tcl_Interp *interp, va_list argList); /* 275 */
|
||||
TCL_DEPRECATED_API("see TIP #422") int (*tcl_VarEvalVA) (Tcl_Interp *interp, va_list argList); /* 276 */
|
||||
void (*reserved275)(void);
|
||||
void (*reserved276)(void);
|
||||
Tcl_Pid (*tcl_WaitPid) (Tcl_Pid pid, int *statPtr, int options); /* 277 */
|
||||
TCL_DEPRECATED_API("see TIP #422") TCL_NORETURN1 void (*tcl_PanicVA) (const char *format, va_list argList); /* 278 */
|
||||
void (*reserved278)(void);
|
||||
void (*tcl_GetVersion) (int *major, int *minor, int *patchLevel, int *type); /* 279 */
|
||||
void (*tcl_InitMemory) (Tcl_Interp *interp); /* 280 */
|
||||
Tcl_Channel (*tcl_StackChannel) (Tcl_Interp *interp, const Tcl_ChannelType *typePtr, ClientData instanceData, int mask, Tcl_Channel prevChan); /* 281 */
|
||||
@@ -2214,8 +2157,8 @@ typedef struct TclStubs {
|
||||
int (*tcl_WriteChars) (Tcl_Channel chan, const char *src, int srcLen); /* 338 */
|
||||
int (*tcl_WriteObj) (Tcl_Channel chan, Tcl_Obj *objPtr); /* 339 */
|
||||
char * (*tcl_GetString) (Tcl_Obj *objPtr); /* 340 */
|
||||
TCL_DEPRECATED_API("Use Tcl_GetEncodingSearchPath") const char * (*tcl_GetDefaultEncodingDir) (void); /* 341 */
|
||||
TCL_DEPRECATED_API("Use Tcl_SetEncodingSearchPath") void (*tcl_SetDefaultEncodingDir) (const char *path); /* 342 */
|
||||
void (*reserved341)(void);
|
||||
void (*reserved342)(void);
|
||||
void (*tcl_AlertNotifier) (ClientData clientData); /* 343 */
|
||||
void (*tcl_ServiceModeHook) (int mode); /* 344 */
|
||||
int (*tcl_UniCharIsAlnum) (int ch); /* 345 */
|
||||
@@ -2230,7 +2173,7 @@ typedef struct TclStubs {
|
||||
char * (*tcl_UniCharToUtfDString) (const Tcl_UniChar *uniStr, int uniLength, Tcl_DString *dsPtr); /* 354 */
|
||||
Tcl_UniChar * (*tcl_UtfToUniCharDString) (const char *src, int length, Tcl_DString *dsPtr); /* 355 */
|
||||
Tcl_RegExp (*tcl_GetRegExpFromObj) (Tcl_Interp *interp, Tcl_Obj *patObj, int flags); /* 356 */
|
||||
TCL_DEPRECATED_API("Use Tcl_EvalTokensStandard") Tcl_Obj * (*tcl_EvalTokens) (Tcl_Interp *interp, Tcl_Token *tokenPtr, int count); /* 357 */
|
||||
void (*reserved357)(void);
|
||||
void (*tcl_FreeParse) (Tcl_Parse *parsePtr); /* 358 */
|
||||
void (*tcl_LogCommandInfo) (Tcl_Interp *interp, const char *script, const char *command, int length); /* 359 */
|
||||
int (*tcl_ParseBraces) (Tcl_Interp *interp, const char *start, int numBytes, Tcl_Parse *parsePtr, int append, const char **termPtr); /* 360 */
|
||||
@@ -2294,8 +2237,8 @@ typedef struct TclStubs {
|
||||
int (*tcl_IsChannelExisting) (const char *channelName); /* 418 */
|
||||
int (*tcl_UniCharNcasecmp) (const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsigned long numChars); /* 419 */
|
||||
int (*tcl_UniCharCaseMatch) (const Tcl_UniChar *uniStr, const Tcl_UniChar *uniPattern, int nocase); /* 420 */
|
||||
Tcl_HashEntry * (*tcl_FindHashEntry) (Tcl_HashTable *tablePtr, const void *key); /* 421 */
|
||||
Tcl_HashEntry * (*tcl_CreateHashEntry) (Tcl_HashTable *tablePtr, const void *key, int *newPtr); /* 422 */
|
||||
void (*reserved421)(void);
|
||||
void (*reserved422)(void);
|
||||
void (*tcl_InitCustomHashTable) (Tcl_HashTable *tablePtr, int keyType, const Tcl_HashKeyType *typePtr); /* 423 */
|
||||
void (*tcl_InitObjHashTable) (Tcl_HashTable *tablePtr); /* 424 */
|
||||
ClientData (*tcl_CommandTraceInfo) (Tcl_Interp *interp, const char *varName, int flags, Tcl_CommandTraceProc *procPtr, ClientData prevClientData); /* 425 */
|
||||
@@ -2308,8 +2251,8 @@ typedef struct TclStubs {
|
||||
int (*tcl_AttemptSetObjLength) (Tcl_Obj *objPtr, int length); /* 432 */
|
||||
Tcl_ThreadId (*tcl_GetChannelThread) (Tcl_Channel channel); /* 433 */
|
||||
Tcl_UniChar * (*tcl_GetUnicodeFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 434 */
|
||||
TCL_DEPRECATED_API("") int (*tcl_GetMathFuncInfo) (Tcl_Interp *interp, const char *name, int *numArgsPtr, Tcl_ValueType **argTypesPtr, Tcl_MathProc **procPtr, ClientData *clientDataPtr); /* 435 */
|
||||
TCL_DEPRECATED_API("") Tcl_Obj * (*tcl_ListMathFuncs) (Tcl_Interp *interp, const char *pattern); /* 436 */
|
||||
void (*reserved435)(void);
|
||||
void (*reserved436)(void);
|
||||
Tcl_Obj * (*tcl_SubstObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int flags); /* 437 */
|
||||
int (*tcl_DetachChannel) (Tcl_Interp *interp, Tcl_Channel channel); /* 438 */
|
||||
int (*tcl_IsStandardChannel) (Tcl_Channel channel); /* 439 */
|
||||
@@ -2326,7 +2269,7 @@ typedef struct TclStubs {
|
||||
int (*tcl_FSUtime) (Tcl_Obj *pathPtr, struct utimbuf *tval); /* 450 */
|
||||
int (*tcl_FSFileAttrsGet) (Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef); /* 451 */
|
||||
int (*tcl_FSFileAttrsSet) (Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj *objPtr); /* 452 */
|
||||
const char *CONST86 * (*tcl_FSFileAttrStrings) (Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef); /* 453 */
|
||||
const char *const * (*tcl_FSFileAttrStrings) (Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef); /* 453 */
|
||||
int (*tcl_FSStat) (Tcl_Obj *pathPtr, Tcl_StatBuf *buf); /* 454 */
|
||||
int (*tcl_FSAccess) (Tcl_Obj *pathPtr, int mode); /* 455 */
|
||||
Tcl_Channel (*tcl_FSOpenFileChannel) (Tcl_Interp *interp, Tcl_Obj *pathPtr, const char *modeString, int permissions); /* 456 */
|
||||
@@ -2350,7 +2293,7 @@ typedef struct TclStubs {
|
||||
int (*tcl_FSUnregister) (const Tcl_Filesystem *fsPtr); /* 474 */
|
||||
ClientData (*tcl_FSData) (const Tcl_Filesystem *fsPtr); /* 475 */
|
||||
const char * (*tcl_FSGetTranslatedStringPath) (Tcl_Interp *interp, Tcl_Obj *pathPtr); /* 476 */
|
||||
CONST86 Tcl_Filesystem * (*tcl_FSGetFileSystemForPath) (Tcl_Obj *pathPtr); /* 477 */
|
||||
const Tcl_Filesystem * (*tcl_FSGetFileSystemForPath) (Tcl_Obj *pathPtr); /* 477 */
|
||||
Tcl_PathType (*tcl_FSGetPathType) (Tcl_Obj *pathPtr); /* 478 */
|
||||
int (*tcl_OutputBuffered) (Tcl_Channel chan); /* 479 */
|
||||
void (*tcl_FSMountsChanged) (const Tcl_Filesystem *fsPtr); /* 480 */
|
||||
@@ -2575,16 +2518,14 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_DbIncrRefCount) /* 20 */
|
||||
#define Tcl_DbIsShared \
|
||||
(tclStubsPtr->tcl_DbIsShared) /* 21 */
|
||||
#define Tcl_DbNewBooleanObj \
|
||||
(tclStubsPtr->tcl_DbNewBooleanObj) /* 22 */
|
||||
/* Slot 22 is reserved */
|
||||
#define Tcl_DbNewByteArrayObj \
|
||||
(tclStubsPtr->tcl_DbNewByteArrayObj) /* 23 */
|
||||
#define Tcl_DbNewDoubleObj \
|
||||
(tclStubsPtr->tcl_DbNewDoubleObj) /* 24 */
|
||||
#define Tcl_DbNewListObj \
|
||||
(tclStubsPtr->tcl_DbNewListObj) /* 25 */
|
||||
#define Tcl_DbNewLongObj \
|
||||
(tclStubsPtr->tcl_DbNewLongObj) /* 26 */
|
||||
/* Slot 26 is reserved */
|
||||
#define Tcl_DbNewObj \
|
||||
(tclStubsPtr->tcl_DbNewObj) /* 27 */
|
||||
#define Tcl_DbNewStringObj \
|
||||
@@ -2629,36 +2570,30 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_ListObjLength) /* 47 */
|
||||
#define Tcl_ListObjReplace \
|
||||
(tclStubsPtr->tcl_ListObjReplace) /* 48 */
|
||||
#define Tcl_NewBooleanObj \
|
||||
(tclStubsPtr->tcl_NewBooleanObj) /* 49 */
|
||||
/* Slot 49 is reserved */
|
||||
#define Tcl_NewByteArrayObj \
|
||||
(tclStubsPtr->tcl_NewByteArrayObj) /* 50 */
|
||||
#define Tcl_NewDoubleObj \
|
||||
(tclStubsPtr->tcl_NewDoubleObj) /* 51 */
|
||||
#define Tcl_NewIntObj \
|
||||
(tclStubsPtr->tcl_NewIntObj) /* 52 */
|
||||
/* Slot 52 is reserved */
|
||||
#define Tcl_NewListObj \
|
||||
(tclStubsPtr->tcl_NewListObj) /* 53 */
|
||||
#define Tcl_NewLongObj \
|
||||
(tclStubsPtr->tcl_NewLongObj) /* 54 */
|
||||
/* Slot 54 is reserved */
|
||||
#define Tcl_NewObj \
|
||||
(tclStubsPtr->tcl_NewObj) /* 55 */
|
||||
#define Tcl_NewStringObj \
|
||||
(tclStubsPtr->tcl_NewStringObj) /* 56 */
|
||||
#define Tcl_SetBooleanObj \
|
||||
(tclStubsPtr->tcl_SetBooleanObj) /* 57 */
|
||||
/* Slot 57 is reserved */
|
||||
#define Tcl_SetByteArrayLength \
|
||||
(tclStubsPtr->tcl_SetByteArrayLength) /* 58 */
|
||||
#define Tcl_SetByteArrayObj \
|
||||
(tclStubsPtr->tcl_SetByteArrayObj) /* 59 */
|
||||
#define Tcl_SetDoubleObj \
|
||||
(tclStubsPtr->tcl_SetDoubleObj) /* 60 */
|
||||
#define Tcl_SetIntObj \
|
||||
(tclStubsPtr->tcl_SetIntObj) /* 61 */
|
||||
/* Slot 61 is reserved */
|
||||
#define Tcl_SetListObj \
|
||||
(tclStubsPtr->tcl_SetListObj) /* 62 */
|
||||
#define Tcl_SetLongObj \
|
||||
(tclStubsPtr->tcl_SetLongObj) /* 63 */
|
||||
/* Slot 63 is reserved */
|
||||
#define Tcl_SetObjLength \
|
||||
(tclStubsPtr->tcl_SetObjLength) /* 64 */
|
||||
#define Tcl_SetStringObj \
|
||||
@@ -2685,8 +2620,7 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_AsyncReady) /* 75 */
|
||||
#define Tcl_BackgroundError \
|
||||
(tclStubsPtr->tcl_BackgroundError) /* 76 */
|
||||
#define Tcl_Backslash \
|
||||
(tclStubsPtr->tcl_Backslash) /* 77 */
|
||||
/* Slot 77 is reserved */
|
||||
#define Tcl_BadChannelOption \
|
||||
(tclStubsPtr->tcl_BadChannelOption) /* 78 */
|
||||
#define Tcl_CallWhenDeleted \
|
||||
@@ -2721,8 +2655,7 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_CreateExitHandler) /* 93 */
|
||||
#define Tcl_CreateInterp \
|
||||
(tclStubsPtr->tcl_CreateInterp) /* 94 */
|
||||
#define Tcl_CreateMathFunc \
|
||||
(tclStubsPtr->tcl_CreateMathFunc) /* 95 */
|
||||
/* Slot 95 is reserved */
|
||||
#define Tcl_CreateObjCommand \
|
||||
(tclStubsPtr->tcl_CreateObjCommand) /* 96 */
|
||||
#define Tcl_CreateSlave \
|
||||
@@ -2793,8 +2726,7 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_Eval) /* 129 */
|
||||
#define Tcl_EvalFile \
|
||||
(tclStubsPtr->tcl_EvalFile) /* 130 */
|
||||
#define Tcl_EvalObj \
|
||||
(tclStubsPtr->tcl_EvalObj) /* 131 */
|
||||
/* Slot 131 is reserved */
|
||||
#define Tcl_EventuallyFree \
|
||||
(tclStubsPtr->tcl_EventuallyFree) /* 132 */
|
||||
#define Tcl_Exit \
|
||||
@@ -2893,8 +2825,7 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_GetVar2) /* 176 */
|
||||
#define Tcl_GlobalEval \
|
||||
(tclStubsPtr->tcl_GlobalEval) /* 177 */
|
||||
#define Tcl_GlobalEvalObj \
|
||||
(tclStubsPtr->tcl_GlobalEvalObj) /* 178 */
|
||||
/* Slot 178 is reserved */
|
||||
#define Tcl_HideCommand \
|
||||
(tclStubsPtr->tcl_HideCommand) /* 179 */
|
||||
#define Tcl_Init \
|
||||
@@ -2976,8 +2907,7 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_ScanElement) /* 218 */
|
||||
#define Tcl_ScanCountedElement \
|
||||
(tclStubsPtr->tcl_ScanCountedElement) /* 219 */
|
||||
#define Tcl_SeekOld \
|
||||
(tclStubsPtr->tcl_SeekOld) /* 220 */
|
||||
/* Slot 220 is reserved */
|
||||
#define Tcl_ServiceAll \
|
||||
(tclStubsPtr->tcl_ServiceAll) /* 221 */
|
||||
#define Tcl_ServiceEvent \
|
||||
@@ -3028,8 +2958,7 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_StaticPackage) /* 244 */
|
||||
#define Tcl_StringMatch \
|
||||
(tclStubsPtr->tcl_StringMatch) /* 245 */
|
||||
#define Tcl_TellOld \
|
||||
(tclStubsPtr->tcl_TellOld) /* 246 */
|
||||
/* Slot 246 is reserved */
|
||||
#define Tcl_TraceVar \
|
||||
(tclStubsPtr->tcl_TraceVar) /* 247 */
|
||||
#define Tcl_TraceVar2 \
|
||||
@@ -3070,10 +2999,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_DumpActiveMemory) /* 265 */
|
||||
#define Tcl_ValidateAllMemory \
|
||||
(tclStubsPtr->tcl_ValidateAllMemory) /* 266 */
|
||||
#define Tcl_AppendResultVA \
|
||||
(tclStubsPtr->tcl_AppendResultVA) /* 267 */
|
||||
#define Tcl_AppendStringsToObjVA \
|
||||
(tclStubsPtr->tcl_AppendStringsToObjVA) /* 268 */
|
||||
/* Slot 267 is reserved */
|
||||
/* Slot 268 is reserved */
|
||||
#define Tcl_HashStats \
|
||||
(tclStubsPtr->tcl_HashStats) /* 269 */
|
||||
#define Tcl_ParseVar \
|
||||
@@ -3086,14 +3013,11 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_PkgProvide) /* 273 */
|
||||
#define Tcl_PkgRequire \
|
||||
(tclStubsPtr->tcl_PkgRequire) /* 274 */
|
||||
#define Tcl_SetErrorCodeVA \
|
||||
(tclStubsPtr->tcl_SetErrorCodeVA) /* 275 */
|
||||
#define Tcl_VarEvalVA \
|
||||
(tclStubsPtr->tcl_VarEvalVA) /* 276 */
|
||||
/* Slot 275 is reserved */
|
||||
/* Slot 276 is reserved */
|
||||
#define Tcl_WaitPid \
|
||||
(tclStubsPtr->tcl_WaitPid) /* 277 */
|
||||
#define Tcl_PanicVA \
|
||||
(tclStubsPtr->tcl_PanicVA) /* 278 */
|
||||
/* Slot 278 is reserved */
|
||||
#define Tcl_GetVersion \
|
||||
(tclStubsPtr->tcl_GetVersion) /* 279 */
|
||||
#define Tcl_InitMemory \
|
||||
@@ -3217,10 +3141,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_WriteObj) /* 339 */
|
||||
#define Tcl_GetString \
|
||||
(tclStubsPtr->tcl_GetString) /* 340 */
|
||||
#define Tcl_GetDefaultEncodingDir \
|
||||
(tclStubsPtr->tcl_GetDefaultEncodingDir) /* 341 */
|
||||
#define Tcl_SetDefaultEncodingDir \
|
||||
(tclStubsPtr->tcl_SetDefaultEncodingDir) /* 342 */
|
||||
/* Slot 341 is reserved */
|
||||
/* Slot 342 is reserved */
|
||||
#define Tcl_AlertNotifier \
|
||||
(tclStubsPtr->tcl_AlertNotifier) /* 343 */
|
||||
#define Tcl_ServiceModeHook \
|
||||
@@ -3249,8 +3171,7 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_UtfToUniCharDString) /* 355 */
|
||||
#define Tcl_GetRegExpFromObj \
|
||||
(tclStubsPtr->tcl_GetRegExpFromObj) /* 356 */
|
||||
#define Tcl_EvalTokens \
|
||||
(tclStubsPtr->tcl_EvalTokens) /* 357 */
|
||||
/* Slot 357 is reserved */
|
||||
#define Tcl_FreeParse \
|
||||
(tclStubsPtr->tcl_FreeParse) /* 358 */
|
||||
#define Tcl_LogCommandInfo \
|
||||
@@ -3377,10 +3298,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_UniCharNcasecmp) /* 419 */
|
||||
#define Tcl_UniCharCaseMatch \
|
||||
(tclStubsPtr->tcl_UniCharCaseMatch) /* 420 */
|
||||
#define Tcl_FindHashEntry \
|
||||
(tclStubsPtr->tcl_FindHashEntry) /* 421 */
|
||||
#define Tcl_CreateHashEntry \
|
||||
(tclStubsPtr->tcl_CreateHashEntry) /* 422 */
|
||||
/* Slot 421 is reserved */
|
||||
/* Slot 422 is reserved */
|
||||
#define Tcl_InitCustomHashTable \
|
||||
(tclStubsPtr->tcl_InitCustomHashTable) /* 423 */
|
||||
#define Tcl_InitObjHashTable \
|
||||
@@ -3405,10 +3324,8 @@ extern const TclStubs *tclStubsPtr;
|
||||
(tclStubsPtr->tcl_GetChannelThread) /* 433 */
|
||||
#define Tcl_GetUnicodeFromObj \
|
||||
(tclStubsPtr->tcl_GetUnicodeFromObj) /* 434 */
|
||||
#define Tcl_GetMathFuncInfo \
|
||||
(tclStubsPtr->tcl_GetMathFuncInfo) /* 435 */
|
||||
#define Tcl_ListMathFuncs \
|
||||
(tclStubsPtr->tcl_ListMathFuncs) /* 436 */
|
||||
/* Slot 435 is reserved */
|
||||
/* Slot 436 is reserved */
|
||||
#define Tcl_SubstObj \
|
||||
(tclStubsPtr->tcl_SubstObj) /* 437 */
|
||||
#define Tcl_DetachChannel \
|
||||
@@ -3833,9 +3750,6 @@ extern const TclStubs *tclStubsPtr;
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLIMPORT
|
||||
|
||||
#undef Tcl_SeekOld
|
||||
#undef Tcl_TellOld
|
||||
|
||||
#undef Tcl_PkgPresent
|
||||
#define Tcl_PkgPresent(interp, name, version, exact) \
|
||||
Tcl_PkgPresentEx(interp, name, version, exact, NULL)
|
||||
@@ -3849,15 +3763,12 @@ extern const TclStubs *tclStubsPtr;
|
||||
#define Tcl_GetIndexFromObj(interp, objPtr, tablePtr, msg, flags, indexPtr) \
|
||||
Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, \
|
||||
sizeof(char *), msg, flags, indexPtr)
|
||||
#undef Tcl_NewBooleanObj
|
||||
#define Tcl_NewBooleanObj(boolValue) \
|
||||
Tcl_NewLongObj((boolValue)!=0)
|
||||
#undef Tcl_DbNewBooleanObj
|
||||
Tcl_NewWideIntObj((boolValue)!=0)
|
||||
#define Tcl_DbNewBooleanObj(boolValue, file, line) \
|
||||
Tcl_DbNewLongObj((boolValue)!=0, file, line)
|
||||
#undef Tcl_SetBooleanObj
|
||||
Tcl_DbNewWideIntObj((boolValue)!=0, file, line)
|
||||
#define Tcl_SetBooleanObj(objPtr, boolValue) \
|
||||
Tcl_SetLongObj(objPtr, (boolValue)!=0)
|
||||
Tcl_SetWideIntObj(objPtr, (boolValue)!=0)
|
||||
#undef Tcl_SetVar
|
||||
#define Tcl_SetVar(interp, varName, newValue, flags) \
|
||||
Tcl_SetVar2(interp, varName, NULL, newValue, flags)
|
||||
@@ -3895,20 +3806,20 @@ extern const TclStubs *tclStubsPtr;
|
||||
#undef Tcl_SaveResult
|
||||
#define Tcl_SaveResult(interp, statePtr) \
|
||||
do { \
|
||||
(statePtr)->objResultPtr = Tcl_GetObjResult(interp); \
|
||||
Tcl_IncrRefCount((statePtr)->objResultPtr); \
|
||||
*(statePtr) = Tcl_GetObjResult(interp); \
|
||||
Tcl_IncrRefCount(*(statePtr)); \
|
||||
Tcl_SetObjResult(interp, Tcl_NewObj()); \
|
||||
} while(0)
|
||||
#undef Tcl_RestoreResult
|
||||
#define Tcl_RestoreResult(interp, statePtr) \
|
||||
do { \
|
||||
Tcl_ResetResult(interp); \
|
||||
Tcl_SetObjResult(interp, (statePtr)->objResultPtr); \
|
||||
Tcl_DecrRefCount((statePtr)->objResultPtr); \
|
||||
Tcl_SetObjResult(interp, *(statePtr)); \
|
||||
Tcl_DecrRefCount(*(statePtr)); \
|
||||
} while(0)
|
||||
#undef Tcl_DiscardResult
|
||||
#define Tcl_DiscardResult(statePtr) \
|
||||
Tcl_DecrRefCount((statePtr)->objResultPtr)
|
||||
Tcl_DecrRefCount(*(statePtr))
|
||||
#undef Tcl_SetResult
|
||||
#define Tcl_SetResult(interp, result, freeProc) \
|
||||
do { \
|
||||
@@ -3967,25 +3878,18 @@ extern const TclStubs *tclStubsPtr;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#undef Tcl_NewLongObj
|
||||
#define Tcl_NewLongObj(value) Tcl_NewWideIntObj((long)(value))
|
||||
#undef Tcl_NewIntObj
|
||||
#define Tcl_NewIntObj(value) Tcl_NewWideIntObj((int)(value))
|
||||
#undef Tcl_DbNewLongObj
|
||||
#define Tcl_DbNewLongObj(value, file, line) Tcl_DbNewWideIntObj((long)(value), file, line)
|
||||
#undef Tcl_SetIntObj
|
||||
#define Tcl_SetIntObj(objPtr, value) Tcl_SetWideIntObj(objPtr, (int)(value))
|
||||
#undef Tcl_SetLongObj
|
||||
#define Tcl_SetLongObj(objPtr, value) Tcl_SetWideIntObj(objPtr, (long)(value))
|
||||
|
||||
/*
|
||||
* Deprecated Tcl procedures:
|
||||
*/
|
||||
|
||||
#undef Tcl_EvalObj
|
||||
#define Tcl_EvalObj(interp, objPtr) \
|
||||
Tcl_EvalObjEx(interp, objPtr, 0)
|
||||
#undef Tcl_GlobalEvalObj
|
||||
#define Tcl_GlobalEvalObj(interp, objPtr) \
|
||||
Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_GLOBAL)
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ AllocChainEntry(
|
||||
cPtr = ckalloc(sizeof(ChainEntry));
|
||||
cPtr->entry.key.objPtr = objPtr;
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
cPtr->entry.clientData = NULL;
|
||||
Tcl_SetHashValue(&cPtr->entry, NULL);
|
||||
cPtr->prevPtr = cPtr->nextPtr = NULL;
|
||||
|
||||
return &cPtr->entry;
|
||||
|
||||
@@ -267,9 +267,9 @@ DisassembleByteCodeObj(
|
||||
*/
|
||||
|
||||
Tcl_AppendPrintfToObj(bufferObj,
|
||||
"ByteCode %p, refCt %u, epoch %u, interp %p (epoch %u)\n",
|
||||
codePtr, codePtr->refCount, codePtr->compileEpoch, iPtr,
|
||||
iPtr->compileEpoch);
|
||||
"ByteCode %p, refCt %" TCL_LL_MODIFIER "d, epoch %" TCL_LL_MODIFIER "d, interp %p (epoch %" TCL_LL_MODIFIER "d)\n",
|
||||
codePtr, (Tcl_WideUInt)codePtr->refCount, (Tcl_WideUInt)codePtr->compileEpoch, iPtr,
|
||||
(Tcl_WideUInt)iPtr->compileEpoch);
|
||||
Tcl_AppendToObj(bufferObj, " Source ", -1);
|
||||
PrintSourceToObj(bufferObj, codePtr->source,
|
||||
TclMin(codePtr->numSrcBytes, 55));
|
||||
@@ -312,8 +312,8 @@ DisassembleByteCodeObj(
|
||||
int numCompiledLocals = procPtr->numCompiledLocals;
|
||||
|
||||
Tcl_AppendPrintfToObj(bufferObj,
|
||||
" Proc %p, refCt %u, args %d, compiled locals %d\n",
|
||||
procPtr, procPtr->refCount, procPtr->numArgs,
|
||||
" Proc %p, refCt %" TCL_LL_MODIFIER "d, args %d, compiled locals %d\n",
|
||||
procPtr, (Tcl_WideUInt)procPtr->refCount, procPtr->numArgs,
|
||||
numCompiledLocals);
|
||||
if (numCompiledLocals > 0) {
|
||||
CompiledLocal *localPtr = procPtr->firstLocalPtr;
|
||||
@@ -820,7 +820,7 @@ UpdateStringOfInstName(
|
||||
size_t len, inst = (size_t)objPtr->internalRep.wideValue;
|
||||
char *s, buf[TCL_INTEGER_SPACE + 5];
|
||||
|
||||
if (inst > LAST_INST_OPCODE) {
|
||||
if (inst >= LAST_INST_OPCODE) {
|
||||
sprintf(buf, "inst_%" TCL_Z_MODIFIER "d", inst);
|
||||
s = buf;
|
||||
} else {
|
||||
|
||||
+1
-65
@@ -675,70 +675,6 @@ TclFinalizeEncodingSubsystem(void)
|
||||
Tcl_MutexUnlock(&encodingMutex);
|
||||
}
|
||||
|
||||
/*
|
||||
*-------------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_GetDefaultEncodingDir --
|
||||
*
|
||||
* Legacy public interface to retrieve first directory in the encoding
|
||||
* searchPath.
|
||||
*
|
||||
* Results:
|
||||
* The directory pathname, as a string, or NULL for an empty encoding
|
||||
* search path.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
const char *
|
||||
Tcl_GetDefaultEncodingDir(void)
|
||||
{
|
||||
int numDirs;
|
||||
Tcl_Obj *first, *searchPath = Tcl_GetEncodingSearchPath();
|
||||
|
||||
Tcl_ListObjLength(NULL, searchPath, &numDirs);
|
||||
if (numDirs == 0) {
|
||||
return NULL;
|
||||
}
|
||||
Tcl_ListObjIndex(NULL, searchPath, 0, &first);
|
||||
|
||||
return TclGetString(first);
|
||||
}
|
||||
|
||||
/*
|
||||
*-------------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_SetDefaultEncodingDir --
|
||||
*
|
||||
* Legacy public interface to set the first directory in the encoding
|
||||
* search path.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Modifies the encoding search path.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
Tcl_SetDefaultEncodingDir(
|
||||
const char *path)
|
||||
{
|
||||
Tcl_Obj *searchPath = Tcl_GetEncodingSearchPath();
|
||||
Tcl_Obj *directory = Tcl_NewStringObj(path, -1);
|
||||
|
||||
searchPath = Tcl_DuplicateObj(searchPath);
|
||||
Tcl_ListObjReplace(NULL, searchPath, 0, 0, 1, &directory);
|
||||
Tcl_SetEncodingSearchPath(searchPath);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
*-------------------------------------------------------------------------
|
||||
*
|
||||
@@ -3628,7 +3564,7 @@ unilen(
|
||||
static void
|
||||
InitializeEncodingSearchPath(
|
||||
char **valuePtr,
|
||||
unsigned int *lengthPtr,
|
||||
size_t *lengthPtr,
|
||||
Tcl_Encoding *encodingPtr)
|
||||
{
|
||||
const char *bytes;
|
||||
|
||||
@@ -92,7 +92,7 @@ static const Tcl_ObjType ensembleCmdType = {
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
unsigned int epoch; /* Used to confirm when the data in this
|
||||
size_t epoch; /* Used to confirm when the data in this
|
||||
* really structure matches up with the
|
||||
* ensemble. */
|
||||
Command *token; /* Reference to the command for which this
|
||||
|
||||
+60
-399
@@ -73,11 +73,11 @@ int tclTraceExec = 0;
|
||||
* expression opcodes (e.g., INST_LOR) in tclCompile.h.
|
||||
*
|
||||
* Does not include the string for INST_EXPON (and beyond), as that is
|
||||
* disjoint for backward-compatability reasons.
|
||||
* disjoint for backward-compatibility reasons.
|
||||
*/
|
||||
|
||||
static const char *const operatorStrings[] = {
|
||||
"||", "&&", "|", "^", "&", "==", "!=", "<", ">", "<=", ">=", "<<", ">>",
|
||||
"|", "^", "&", "==", "!=", "<", ">", "<=", ">=", "<<", ">>",
|
||||
"+", "-", "*", "/", "%", "+", "-", "~", "!"
|
||||
};
|
||||
|
||||
@@ -101,64 +101,6 @@ long tclObjsAlloced = 0;
|
||||
long tclObjsFreed = 0;
|
||||
long tclObjsShared[TCL_MAX_SHARED_OBJ_STATS] = { 0, 0, 0, 0, 0 };
|
||||
#endif /* TCL_COMPILE_STATS */
|
||||
|
||||
/*
|
||||
* Support pre-8.5 bytecodes unless specifically requested otherwise.
|
||||
*/
|
||||
|
||||
#ifndef TCL_SUPPORT_84_BYTECODE
|
||||
#define TCL_SUPPORT_84_BYTECODE 1
|
||||
#endif
|
||||
|
||||
#if TCL_SUPPORT_84_BYTECODE
|
||||
/*
|
||||
* We need to know the tclBuiltinFuncTable to support translation of pre-8.5
|
||||
* math functions to the namespace-based ::tcl::mathfunc::op in 8.5+.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
const char *name; /* Name of function. */
|
||||
int numArgs; /* Number of arguments for function. */
|
||||
} BuiltinFunc;
|
||||
|
||||
/*
|
||||
* Table describing the built-in math functions. Entries in this table are
|
||||
* indexed by the values of the INST_CALL_BUILTIN_FUNC instruction's
|
||||
* operand byte.
|
||||
*/
|
||||
|
||||
static BuiltinFunc const tclBuiltinFuncTable[] = {
|
||||
{"acos", 1},
|
||||
{"asin", 1},
|
||||
{"atan", 1},
|
||||
{"atan2", 2},
|
||||
{"ceil", 1},
|
||||
{"cos", 1},
|
||||
{"cosh", 1},
|
||||
{"exp", 1},
|
||||
{"floor", 1},
|
||||
{"fmod", 2},
|
||||
{"hypot", 2},
|
||||
{"log", 1},
|
||||
{"log10", 1},
|
||||
{"pow", 2},
|
||||
{"sin", 1},
|
||||
{"sinh", 1},
|
||||
{"sqrt", 1},
|
||||
{"tan", 1},
|
||||
{"tanh", 1},
|
||||
{"abs", 1},
|
||||
{"double", 1},
|
||||
{"int", 1},
|
||||
{"rand", 0},
|
||||
{"round", 1},
|
||||
{"srand", 1},
|
||||
{"wide", 1},
|
||||
{NULL, 0},
|
||||
};
|
||||
|
||||
#define LAST_BUILTIN_FUNC 25
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NR_TEBC
|
||||
@@ -166,7 +108,7 @@ static BuiltinFunc const tclBuiltinFuncTable[] = {
|
||||
* Minimal data required to fully reconstruct the execution state.
|
||||
*/
|
||||
|
||||
typedef struct TEBCdata {
|
||||
typedef struct {
|
||||
ByteCode *codePtr; /* Constant until the BC returns */
|
||||
/* -----------------------------------------*/
|
||||
ptrdiff_t *catchTop; /* These fields are used on return TO this */
|
||||
@@ -2797,91 +2739,6 @@ TEBCresume(
|
||||
return TclNREvalObjv(interp, objc, objv,
|
||||
TCL_EVAL_NOERR | TCL_EVAL_SOURCE_IN_FRAME, NULL);
|
||||
|
||||
#if TCL_SUPPORT_84_BYTECODE
|
||||
case INST_CALL_BUILTIN_FUNC1:
|
||||
/*
|
||||
* Call one of the built-in pre-8.5 Tcl math functions. This
|
||||
* translates to INST_INVOKE_STK1 with the first argument of
|
||||
* ::tcl::mathfunc::$objv[0]. We need to insert the named math
|
||||
* function into the stack.
|
||||
*/
|
||||
|
||||
opnd = TclGetUInt1AtPtr(pc+1);
|
||||
if ((opnd < 0) || (opnd > LAST_BUILTIN_FUNC)) {
|
||||
TRACE(("UNRECOGNIZED BUILTIN FUNC CODE %d\n", opnd));
|
||||
Tcl_Panic("TclNRExecuteByteCode: unrecognized builtin function code %d", opnd);
|
||||
}
|
||||
|
||||
TclNewLiteralStringObj(objPtr, "::tcl::mathfunc::");
|
||||
Tcl_AppendToObj(objPtr, tclBuiltinFuncTable[opnd].name, -1);
|
||||
|
||||
/*
|
||||
* Only 0, 1 or 2 args.
|
||||
*/
|
||||
|
||||
{
|
||||
int numArgs = tclBuiltinFuncTable[opnd].numArgs;
|
||||
Tcl_Obj *tmpPtr1, *tmpPtr2;
|
||||
|
||||
if (numArgs == 0) {
|
||||
PUSH_OBJECT(objPtr);
|
||||
} else if (numArgs == 1) {
|
||||
tmpPtr1 = POP_OBJECT();
|
||||
PUSH_OBJECT(objPtr);
|
||||
PUSH_OBJECT(tmpPtr1);
|
||||
Tcl_DecrRefCount(tmpPtr1);
|
||||
} else {
|
||||
tmpPtr2 = POP_OBJECT();
|
||||
tmpPtr1 = POP_OBJECT();
|
||||
PUSH_OBJECT(objPtr);
|
||||
PUSH_OBJECT(tmpPtr1);
|
||||
PUSH_OBJECT(tmpPtr2);
|
||||
Tcl_DecrRefCount(tmpPtr1);
|
||||
Tcl_DecrRefCount(tmpPtr2);
|
||||
}
|
||||
objc = numArgs + 1;
|
||||
}
|
||||
pcAdjustment = 2;
|
||||
goto doInvocation;
|
||||
|
||||
case INST_CALL_FUNC1:
|
||||
/*
|
||||
* Call a non-builtin Tcl math function previously registered by a
|
||||
* call to Tcl_CreateMathFunc pre-8.5. This is essentially
|
||||
* INST_INVOKE_STK1 converting the first arg to
|
||||
* ::tcl::mathfunc::$objv[0].
|
||||
*/
|
||||
|
||||
objc = TclGetUInt1AtPtr(pc+1); /* Number of arguments. The function
|
||||
* name is the 0-th argument. */
|
||||
|
||||
objPtr = OBJ_AT_DEPTH(objc-1);
|
||||
TclNewLiteralStringObj(tmpPtr, "::tcl::mathfunc::");
|
||||
Tcl_AppendObjToObj(tmpPtr, objPtr);
|
||||
Tcl_DecrRefCount(objPtr);
|
||||
|
||||
/*
|
||||
* Variation of PUSH_OBJECT.
|
||||
*/
|
||||
|
||||
OBJ_AT_DEPTH(objc-1) = tmpPtr;
|
||||
Tcl_IncrRefCount(tmpPtr);
|
||||
|
||||
pcAdjustment = 2;
|
||||
goto doInvocation;
|
||||
#else
|
||||
/*
|
||||
* INST_CALL_BUILTIN_FUNC1 and INST_CALL_FUNC1 were made obsolete by the
|
||||
* changes to add a ::tcl::mathfunc namespace in 8.5. Optional support
|
||||
* remains for existing bytecode precompiled files.
|
||||
*/
|
||||
|
||||
case INST_CALL_BUILTIN_FUNC1:
|
||||
Tcl_Panic("TclNRExecuteByteCode: obsolete INST_CALL_BUILTIN_FUNC1 found");
|
||||
case INST_CALL_FUNC1:
|
||||
Tcl_Panic("TclNRExecuteByteCode: obsolete INST_CALL_FUNC1 found");
|
||||
#endif
|
||||
|
||||
case INST_INVOKE_REPLACE:
|
||||
objc = TclGetUInt4AtPtr(pc+1);
|
||||
opnd = TclGetUInt1AtPtr(pc+5);
|
||||
@@ -3964,29 +3821,6 @@ TEBCresume(
|
||||
CACHE_STACK_INFO();
|
||||
TRACE_ERROR(interp);
|
||||
goto gotError;
|
||||
|
||||
/*
|
||||
* This is really an unset operation these days. Do not issue.
|
||||
*/
|
||||
|
||||
case INST_DICT_DONE:
|
||||
opnd = TclGetUInt4AtPtr(pc+1);
|
||||
TRACE(("%u => OK\n", opnd));
|
||||
varPtr = LOCAL(opnd);
|
||||
while (TclIsVarLink(varPtr)) {
|
||||
varPtr = varPtr->value.linkPtr;
|
||||
}
|
||||
if (TclIsVarDirectUnsettable(varPtr) && !TclIsVarInHash(varPtr)) {
|
||||
if (!TclIsVarUndefined(varPtr)) {
|
||||
TclDecrRefCount(varPtr->value.objPtr);
|
||||
}
|
||||
varPtr->value.objPtr = NULL;
|
||||
} else {
|
||||
DECACHE_STACK_INFO();
|
||||
TclPtrUnsetVarIdx(interp, varPtr, NULL, NULL, NULL, 0, opnd);
|
||||
CACHE_STACK_INFO();
|
||||
}
|
||||
NEXT_INST_F(5, 0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4307,50 +4141,6 @@ TEBCresume(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* These two instructions are now redundant: the complete logic of the LOR
|
||||
* and LAND is now handled by the expression compiler.
|
||||
*/
|
||||
|
||||
case INST_LOR:
|
||||
case INST_LAND: {
|
||||
/*
|
||||
* Operands must be boolean or numeric. No int->double conversions are
|
||||
* performed.
|
||||
*/
|
||||
|
||||
int i1, i2, iResult;
|
||||
|
||||
value2Ptr = OBJ_AT_TOS;
|
||||
valuePtr = OBJ_UNDER_TOS;
|
||||
if (TclGetBooleanFromObj(NULL, valuePtr, &i1) != TCL_OK) {
|
||||
TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr),
|
||||
(valuePtr->typePtr? valuePtr->typePtr->name : "null")));
|
||||
DECACHE_STACK_INFO();
|
||||
IllegalExprOperandType(interp, pc, valuePtr);
|
||||
CACHE_STACK_INFO();
|
||||
goto gotError;
|
||||
}
|
||||
|
||||
if (TclGetBooleanFromObj(NULL, value2Ptr, &i2) != TCL_OK) {
|
||||
TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(value2Ptr),
|
||||
(value2Ptr->typePtr? value2Ptr->typePtr->name : "null")));
|
||||
DECACHE_STACK_INFO();
|
||||
IllegalExprOperandType(interp, pc, value2Ptr);
|
||||
CACHE_STACK_INFO();
|
||||
goto gotError;
|
||||
}
|
||||
|
||||
if (*pc == INST_LOR) {
|
||||
iResult = (i1 || i2);
|
||||
} else {
|
||||
iResult = (i1 && i2);
|
||||
}
|
||||
objResultPtr = TCONST(iResult);
|
||||
TRACE(("%.20s %.20s => %d\n", O2S(valuePtr),O2S(value2Ptr),iResult));
|
||||
NEXT_INST_F(1, 2, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* -----------------------------------------------------------------
|
||||
* Start of general introspector instructions.
|
||||
@@ -5144,22 +4934,58 @@ TEBCresume(
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* strcmp can't do a simple memcmp in order to handle the
|
||||
* special Tcl \xC0\x80 null encoding for utf-8.
|
||||
* In order to handle the special Tcl \xC0\x80 null encoding
|
||||
* for utf-8, strcmp can't do a simple memcmp.
|
||||
*/
|
||||
|
||||
s1 = TclGetStringFromObj(valuePtr, &s1len);
|
||||
s2 = TclGetStringFromObj(value2Ptr, &s2len);
|
||||
if (TclCheckEmptyString(valuePtr) > 0) {
|
||||
s1 = "";
|
||||
s1len = 0;
|
||||
switch (TclCheckEmptyString(value2Ptr)) {
|
||||
case -1:
|
||||
s2 = TclGetStringFromObj(value2Ptr, &s2len);
|
||||
break;
|
||||
case 0:
|
||||
/* Synthesize a value for comparison */
|
||||
s2 = "1";
|
||||
s2len = 1;
|
||||
break;
|
||||
case 1:
|
||||
s2 = "";
|
||||
s2len = 0;
|
||||
}
|
||||
} else if (TclCheckEmptyString(value2Ptr) > 0) {
|
||||
s2 = "";
|
||||
s2len = 0;
|
||||
switch (TclCheckEmptyString(valuePtr)) {
|
||||
case -1:
|
||||
s1 = TclGetStringFromObj(valuePtr, &s1len);
|
||||
break;
|
||||
case 0:
|
||||
/* Synthesize a value for comparison */
|
||||
s1 = "1";
|
||||
s1len = 1;
|
||||
break;
|
||||
case 1:
|
||||
s1 = "";
|
||||
s1len = 0;
|
||||
}
|
||||
} else {
|
||||
s1 = TclGetStringFromObj(valuePtr, &s1len);
|
||||
s2 = TclGetStringFromObj(value2Ptr, &s2len);
|
||||
}
|
||||
|
||||
if (checkEq) {
|
||||
memCmpFn = memcmp;
|
||||
} else {
|
||||
memCmpFn = (memCmpFn_t) TclpUtfNcmp2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (checkEq && (s1len != s2len)) {
|
||||
match = 1;
|
||||
} else {
|
||||
} else {
|
||||
/*
|
||||
* The comparison function should compare up to the minimum
|
||||
* byte length only.
|
||||
@@ -5739,6 +5565,14 @@ TEBCresume(
|
||||
value2Ptr = OBJ_AT_TOS;
|
||||
valuePtr = OBJ_UNDER_TOS;
|
||||
|
||||
/*
|
||||
Try to determine, without triggering generation of a string
|
||||
representation, whether one value is not a number.
|
||||
*/
|
||||
if (TclCheckEmptyString(valuePtr) > 0 || TclCheckEmptyString(value2Ptr) > 0) {
|
||||
goto stringCompare;
|
||||
}
|
||||
|
||||
if (GetNumberFromObj(NULL, valuePtr, &ptr1, &type1) != TCL_OK
|
||||
|| GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2) != TCL_OK) {
|
||||
/*
|
||||
@@ -6405,170 +6239,6 @@ TEBCresume(
|
||||
TRACE(("=> CONTINUE!\n"));
|
||||
goto processExceptionReturn;
|
||||
|
||||
{
|
||||
ForeachInfo *infoPtr;
|
||||
Var *iterVarPtr, *listVarPtr;
|
||||
Tcl_Obj *oldValuePtr, *listPtr, **elements;
|
||||
ForeachVarList *varListPtr;
|
||||
int numLists, listTmpIndex, listLen, numVars;
|
||||
size_t iterNum;
|
||||
int varIndex, valIndex, continueLoop, j, iterTmpIndex;
|
||||
long i;
|
||||
|
||||
case INST_FOREACH_START4: /* DEPRECATED */
|
||||
/*
|
||||
* Initialize the temporary local var that holds the count of the
|
||||
* number of iterations of the loop body to -1.
|
||||
*/
|
||||
|
||||
opnd = TclGetUInt4AtPtr(pc+1);
|
||||
infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
|
||||
iterTmpIndex = infoPtr->loopCtTemp;
|
||||
iterVarPtr = LOCAL(iterTmpIndex);
|
||||
oldValuePtr = iterVarPtr->value.objPtr;
|
||||
|
||||
if (oldValuePtr == NULL) {
|
||||
TclNewIntObj(iterVarPtr->value.objPtr, -1);
|
||||
Tcl_IncrRefCount(iterVarPtr->value.objPtr);
|
||||
} else {
|
||||
TclSetIntObj(oldValuePtr, -1);
|
||||
}
|
||||
TRACE(("%u => loop iter count temp %d\n", opnd, iterTmpIndex));
|
||||
|
||||
#ifndef TCL_COMPILE_DEBUG
|
||||
/*
|
||||
* Remark that the compiler ALWAYS sets INST_FOREACH_STEP4 immediately
|
||||
* after INST_FOREACH_START4 - let us just fall through instead of
|
||||
* jumping back to the top.
|
||||
*/
|
||||
|
||||
pc += 5;
|
||||
TCL_DTRACE_INST_NEXT();
|
||||
#else
|
||||
NEXT_INST_F(5, 0, 0);
|
||||
#endif
|
||||
|
||||
case INST_FOREACH_STEP4: /* DEPRECATED */
|
||||
/*
|
||||
* "Step" a foreach loop (i.e., begin its next iteration) by assigning
|
||||
* the next value list element to each loop var.
|
||||
*/
|
||||
|
||||
opnd = TclGetUInt4AtPtr(pc+1);
|
||||
TRACE(("%u => ", opnd));
|
||||
infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
|
||||
numLists = infoPtr->numLists;
|
||||
|
||||
/*
|
||||
* Increment the temp holding the loop iteration number.
|
||||
*/
|
||||
|
||||
iterVarPtr = LOCAL(infoPtr->loopCtTemp);
|
||||
valuePtr = iterVarPtr->value.objPtr;
|
||||
iterNum = (size_t)valuePtr->internalRep.wideValue + 1;
|
||||
TclSetIntObj(valuePtr, iterNum);
|
||||
|
||||
/*
|
||||
* Check whether all value lists are exhausted and we should stop the
|
||||
* loop.
|
||||
*/
|
||||
|
||||
continueLoop = 0;
|
||||
listTmpIndex = infoPtr->firstValueTemp;
|
||||
for (i = 0; i < numLists; i++) {
|
||||
varListPtr = infoPtr->varLists[i];
|
||||
numVars = varListPtr->numVars;
|
||||
|
||||
listVarPtr = LOCAL(listTmpIndex);
|
||||
listPtr = listVarPtr->value.objPtr;
|
||||
if (TclListObjLength(interp, listPtr, &listLen) != TCL_OK) {
|
||||
TRACE_APPEND(("ERROR converting list %ld, \"%.30s\": %s\n",
|
||||
i, O2S(listPtr), O2S(Tcl_GetObjResult(interp))));
|
||||
goto gotError;
|
||||
}
|
||||
if ((size_t)listLen > iterNum * numVars) {
|
||||
continueLoop = 1;
|
||||
}
|
||||
listTmpIndex++;
|
||||
}
|
||||
|
||||
/*
|
||||
* If some var in some var list still has a remaining list element
|
||||
* iterate one more time. Assign to var the next element from its
|
||||
* value list. We already checked above that each list temp holds a
|
||||
* valid list object (by calling Tcl_ListObjLength), but cannot rely
|
||||
* on that check remaining valid: one list could have been shimmered
|
||||
* as a side effect of setting a traced variable.
|
||||
*/
|
||||
|
||||
if (continueLoop) {
|
||||
listTmpIndex = infoPtr->firstValueTemp;
|
||||
for (i = 0; i < numLists; i++) {
|
||||
varListPtr = infoPtr->varLists[i];
|
||||
numVars = varListPtr->numVars;
|
||||
|
||||
listVarPtr = LOCAL(listTmpIndex);
|
||||
listPtr = TclListObjCopy(NULL, listVarPtr->value.objPtr);
|
||||
TclListObjGetElements(interp, listPtr, &listLen, &elements);
|
||||
|
||||
valIndex = (iterNum * numVars);
|
||||
for (j = 0; j < numVars; j++) {
|
||||
if (valIndex >= listLen) {
|
||||
TclNewObj(valuePtr);
|
||||
} else {
|
||||
valuePtr = elements[valIndex];
|
||||
}
|
||||
|
||||
varIndex = varListPtr->varIndexes[j];
|
||||
varPtr = LOCAL(varIndex);
|
||||
while (TclIsVarLink(varPtr)) {
|
||||
varPtr = varPtr->value.linkPtr;
|
||||
}
|
||||
if (TclIsVarDirectWritable(varPtr)) {
|
||||
value2Ptr = varPtr->value.objPtr;
|
||||
if (valuePtr != value2Ptr) {
|
||||
if (value2Ptr != NULL) {
|
||||
TclDecrRefCount(value2Ptr);
|
||||
}
|
||||
varPtr->value.objPtr = valuePtr;
|
||||
Tcl_IncrRefCount(valuePtr);
|
||||
}
|
||||
} else {
|
||||
DECACHE_STACK_INFO();
|
||||
if (TclPtrSetVarIdx(interp, varPtr, NULL, NULL, NULL,
|
||||
valuePtr, TCL_LEAVE_ERR_MSG, varIndex)==NULL){
|
||||
CACHE_STACK_INFO();
|
||||
TRACE_APPEND((
|
||||
"ERROR init. index temp %d: %s\n",
|
||||
varIndex, O2S(Tcl_GetObjResult(interp))));
|
||||
TclDecrRefCount(listPtr);
|
||||
goto gotError;
|
||||
}
|
||||
CACHE_STACK_INFO();
|
||||
}
|
||||
valIndex++;
|
||||
}
|
||||
TclDecrRefCount(listPtr);
|
||||
listTmpIndex++;
|
||||
}
|
||||
}
|
||||
TRACE_APPEND(("%d lists, iter %" TCL_Z_MODIFIER "d, %s loop\n",
|
||||
numLists, iterNum, (continueLoop? "continue" : "exit")));
|
||||
|
||||
/*
|
||||
* Run-time peep-hole optimisation: the compiler ALWAYS follows
|
||||
* INST_FOREACH_STEP4 with an INST_JUMP_FALSE. We just skip that
|
||||
* instruction and jump direct from here.
|
||||
*/
|
||||
|
||||
pc += 5;
|
||||
if (*pc == INST_JUMP_FALSE1) {
|
||||
NEXT_INST_F((continueLoop? 2 : TclGetInt1AtPtr(pc+1)), 0, 0);
|
||||
} else {
|
||||
NEXT_INST_F((continueLoop? 5 : TclGetInt4AtPtr(pc+1)), 0, 0);
|
||||
}
|
||||
|
||||
}
|
||||
{
|
||||
ForeachInfo *infoPtr;
|
||||
Tcl_Obj *listPtr, **elements, *tmpPtr;
|
||||
@@ -9059,10 +8729,9 @@ PrintByteCodeInfo(
|
||||
Proc *procPtr = codePtr->procPtr;
|
||||
Interp *iPtr = (Interp *) *codePtr->interpHandle;
|
||||
|
||||
fprintf(stdout, "\nExecuting ByteCode 0x%p, refCt %" TCL_Z_MODIFIER "u, epoch %u, interp 0x%p (epoch %u)\n",
|
||||
fprintf(stdout, "\nExecuting ByteCode 0x%p, refCt %" TCL_Z_MODIFIER "u, epoch %" TCL_Z_MODIFIER "u, interp 0x%p (epoch %" TCL_Z_MODIFIER "u)\n",
|
||||
codePtr, (size_t)codePtr->refCount, codePtr->compileEpoch, iPtr,
|
||||
iPtr->compileEpoch);
|
||||
|
||||
fprintf(stdout, " Source: ");
|
||||
TclPrintSource(stdout, codePtr->source, 60);
|
||||
|
||||
@@ -9088,7 +8757,7 @@ PrintByteCodeInfo(
|
||||
#endif /* TCL_COMPILE_STATS */
|
||||
if (procPtr != NULL) {
|
||||
fprintf(stdout,
|
||||
" Proc 0x%p, refCt %d, args %d, compiled locals %d\n",
|
||||
" Proc 0x%p, refCt %zd, args %d, compiled locals %d\n",
|
||||
procPtr, procPtr->refCount, procPtr->numArgs,
|
||||
procPtr->numCompiledLocals);
|
||||
}
|
||||
@@ -9140,7 +8809,7 @@ ValidatePcAndStackTop(
|
||||
pc);
|
||||
Tcl_Panic("TclNRExecuteByteCode execution failure: bad pc");
|
||||
}
|
||||
if ((unsigned) opCode > LAST_INST_OPCODE) {
|
||||
if ((unsigned) opCode >= LAST_INST_OPCODE) {
|
||||
fprintf(stderr, "\nBad opcode %d at pc %u in TclNRExecuteByteCode\n",
|
||||
(unsigned) opCode, relativePc);
|
||||
Tcl_Panic("TclNRExecuteByteCode execution failure: bad opcode");
|
||||
@@ -9203,20 +8872,11 @@ IllegalExprOperandType(
|
||||
if (opcode == INST_EXPON) {
|
||||
operator = "**";
|
||||
} else if (opcode <= INST_LNOT) {
|
||||
operator = operatorStrings[opcode - INST_LOR];
|
||||
operator = operatorStrings[opcode - INST_BITOR];
|
||||
}
|
||||
|
||||
if (GetNumberFromObj(NULL, opndPtr, &ptr, &type) != TCL_OK) {
|
||||
int numBytes;
|
||||
const char *bytes = TclGetStringFromObj(opndPtr, &numBytes);
|
||||
|
||||
if (numBytes == 0) {
|
||||
description = "empty string";
|
||||
} else if (TclCheckBadOctal(NULL, bytes)) {
|
||||
description = "invalid octal number";
|
||||
} else {
|
||||
description = "non-numeric string";
|
||||
}
|
||||
description = "non-numeric string";
|
||||
} else if (type == TCL_NUMBER_NAN) {
|
||||
description = "non-numeric floating-point value";
|
||||
} else if (type == TCL_NUMBER_DOUBLE) {
|
||||
@@ -9227,7 +8887,8 @@ IllegalExprOperandType(
|
||||
}
|
||||
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"can't use %s as operand of \"%s\"", description, operator));
|
||||
"can't use %s \"%s\" as operand of \"%s\"", description,
|
||||
Tcl_GetString(opndPtr), operator));
|
||||
Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", description, NULL);
|
||||
}
|
||||
|
||||
@@ -10038,7 +9699,7 @@ EvalStatsCmd(
|
||||
*/
|
||||
|
||||
Tcl_AppendPrintfToObj(objPtr, "\nInstruction counts:\n");
|
||||
for (i = 0; i <= LAST_INST_OPCODE; i++) {
|
||||
for (i = 0; i < LAST_INST_OPCODE; i++) {
|
||||
Tcl_AppendPrintfToObj(objPtr, "%20s %8ld ",
|
||||
tclInstructionTable[i].name, statsPtr->instructionCount[i]);
|
||||
if (statsPtr->instructionCount[i]) {
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ Tcl_GetBoolean(
|
||||
Tcl_Panic("invalid sharing of Tcl_Obj on C stack");
|
||||
}
|
||||
if (code == TCL_OK) {
|
||||
TclGetBooleanFromObj(NULL, &obj, boolPtr);
|
||||
*boolPtr = obj.internalRep.wideValue != 0;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
+18
-43
@@ -13,13 +13,6 @@
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
/*
|
||||
* Prevent macros from clashing with function definitions.
|
||||
*/
|
||||
|
||||
#undef Tcl_FindHashEntry
|
||||
#undef Tcl_CreateHashEntry
|
||||
|
||||
/*
|
||||
* When there are this many entries per bucket, on average, rebuild the hash
|
||||
* table to make it larger.
|
||||
@@ -35,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#define RANDOM_INDEX(tablePtr, i) \
|
||||
((((i)*1103515245L) >> (tablePtr)->downShift) & (tablePtr)->mask)
|
||||
((((i)*1103515245UL) >> (tablePtr)->downShift) & (tablePtr)->mask)
|
||||
|
||||
/*
|
||||
* Prototypes for the array hash key methods.
|
||||
@@ -200,7 +193,7 @@ Tcl_InitCustomHashTable(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_FindHashEntry --
|
||||
* FindHashEntry --
|
||||
*
|
||||
* Given a hash table find the entry with a matching key.
|
||||
*
|
||||
@@ -214,14 +207,6 @@ Tcl_InitCustomHashTable(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Tcl_HashEntry *
|
||||
Tcl_FindHashEntry(
|
||||
Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
|
||||
const void *key) /* Key to use to find matching entry. */
|
||||
{
|
||||
return (*((tablePtr)->findProc))(tablePtr, key);
|
||||
}
|
||||
|
||||
static Tcl_HashEntry *
|
||||
FindHashEntry(
|
||||
Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
|
||||
@@ -234,7 +219,7 @@ FindHashEntry(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_CreateHashEntry --
|
||||
* CreateHashEntry --
|
||||
*
|
||||
* Given a hash table with string keys, and a string key, find the entry
|
||||
* with a matching key. If there is no matching entry, then create a new
|
||||
@@ -252,17 +237,6 @@ FindHashEntry(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Tcl_HashEntry *
|
||||
Tcl_CreateHashEntry(
|
||||
Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
|
||||
const void *key, /* Key to use to find or create matching
|
||||
* entry. */
|
||||
int *newPtr) /* Store info here telling whether a new entry
|
||||
* was created. */
|
||||
{
|
||||
return (*((tablePtr)->createProc))(tablePtr, key, newPtr);
|
||||
}
|
||||
|
||||
static Tcl_HashEntry *
|
||||
CreateHashEntry(
|
||||
Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */
|
||||
@@ -274,7 +248,7 @@ CreateHashEntry(
|
||||
register Tcl_HashEntry *hPtr;
|
||||
const Tcl_HashKeyType *typePtr;
|
||||
unsigned int hash;
|
||||
int index;
|
||||
unsigned int index;
|
||||
|
||||
if (tablePtr->keyType == TCL_STRING_KEYS) {
|
||||
typePtr = &tclStringHashKeyType;
|
||||
@@ -308,7 +282,7 @@ CreateHashEntry(
|
||||
|
||||
for (hPtr = tablePtr->buckets[index]; hPtr != NULL;
|
||||
hPtr = hPtr->nextPtr) {
|
||||
if (hash != PTR2UINT(hPtr->hash)) {
|
||||
if (hash != hPtr->hash) {
|
||||
continue;
|
||||
}
|
||||
if (((void *) key == hPtr) || compareKeysProc((void *) key, hPtr)) {
|
||||
@@ -321,7 +295,7 @@ CreateHashEntry(
|
||||
} else {
|
||||
for (hPtr = tablePtr->buckets[index]; hPtr != NULL;
|
||||
hPtr = hPtr->nextPtr) {
|
||||
if (hash != PTR2UINT(hPtr->hash)) {
|
||||
if (hash != hPtr->hash) {
|
||||
continue;
|
||||
}
|
||||
if (key == hPtr->key.oneWordValue) {
|
||||
@@ -351,7 +325,7 @@ CreateHashEntry(
|
||||
}
|
||||
|
||||
hPtr->tablePtr = tablePtr;
|
||||
hPtr->hash = UINT2PTR(hash);
|
||||
hPtr->hash = hash;
|
||||
hPtr->nextPtr = tablePtr->buckets[index];
|
||||
tablePtr->buckets[index] = hPtr;
|
||||
tablePtr->numEntries++;
|
||||
@@ -393,7 +367,7 @@ Tcl_DeleteHashEntry(
|
||||
const Tcl_HashKeyType *typePtr;
|
||||
Tcl_HashTable *tablePtr;
|
||||
Tcl_HashEntry **bucketPtr;
|
||||
int index;
|
||||
unsigned int index;
|
||||
|
||||
tablePtr = entryPtr->tablePtr;
|
||||
|
||||
@@ -410,9 +384,9 @@ Tcl_DeleteHashEntry(
|
||||
|
||||
if (typePtr->hashKeyProc == NULL
|
||||
|| typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) {
|
||||
index = RANDOM_INDEX(tablePtr, PTR2INT(entryPtr->hash));
|
||||
index = RANDOM_INDEX(tablePtr, entryPtr->hash);
|
||||
} else {
|
||||
index = PTR2UINT(entryPtr->hash) & tablePtr->mask;
|
||||
index = entryPtr->hash & tablePtr->mask;
|
||||
}
|
||||
|
||||
bucketPtr = &tablePtr->buckets[index];
|
||||
@@ -767,14 +741,14 @@ HashArrayKey(
|
||||
void *keyPtr) /* Key from which to compute hash value. */
|
||||
{
|
||||
register const int *array = (const int *) keyPtr;
|
||||
register unsigned int result;
|
||||
register TCL_HASH_TYPE result;
|
||||
int count;
|
||||
|
||||
for (result = 0, count = tablePtr->keyType; count > 0;
|
||||
count--, array++) {
|
||||
result += *array;
|
||||
}
|
||||
return (TCL_HASH_TYPE) result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -863,7 +837,7 @@ HashStringKey(
|
||||
void *keyPtr) /* Key from which to compute hash value. */
|
||||
{
|
||||
register const char *string = keyPtr;
|
||||
register unsigned int result;
|
||||
register TCL_HASH_TYPE result;
|
||||
register char c;
|
||||
|
||||
/*
|
||||
@@ -903,7 +877,7 @@ HashStringKey(
|
||||
result += (result << 3) + UCHAR(c);
|
||||
}
|
||||
}
|
||||
return (TCL_HASH_TYPE) result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -985,7 +959,8 @@ static void
|
||||
RebuildTable(
|
||||
register Tcl_HashTable *tablePtr) /* Table to enlarge. */
|
||||
{
|
||||
int count, index, oldSize = tablePtr->numBuckets;
|
||||
int count, oldSize = tablePtr->numBuckets;
|
||||
unsigned int index;
|
||||
Tcl_HashEntry **oldBuckets = tablePtr->buckets;
|
||||
register Tcl_HashEntry **oldChainPtr, **newChainPtr;
|
||||
register Tcl_HashEntry *hPtr;
|
||||
@@ -1038,9 +1013,9 @@ RebuildTable(
|
||||
*oldChainPtr = hPtr->nextPtr;
|
||||
if (typePtr->hashKeyProc == NULL
|
||||
|| typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) {
|
||||
index = RANDOM_INDEX(tablePtr, PTR2INT(hPtr->hash));
|
||||
index = RANDOM_INDEX(tablePtr, hPtr->hash);
|
||||
} else {
|
||||
index = PTR2UINT(hPtr->hash) & tablePtr->mask;
|
||||
index = hPtr->hash & tablePtr->mask;
|
||||
}
|
||||
hPtr->nextPtr = tablePtr->buckets[index];
|
||||
tablePtr->buckets[index] = hPtr;
|
||||
|
||||
@@ -73,13 +73,6 @@ Tcl_RecordAndEval(
|
||||
Tcl_IncrRefCount(cmdPtr);
|
||||
result = Tcl_RecordAndEvalObj(interp, cmdPtr, flags);
|
||||
|
||||
/*
|
||||
* Move the interpreter's object result to the string result, then
|
||||
* reset the object result.
|
||||
*/
|
||||
|
||||
(void) Tcl_GetStringResult(interp);
|
||||
|
||||
/*
|
||||
* Discard the Tcl object created to hold the command.
|
||||
*/
|
||||
|
||||
@@ -9036,20 +9036,6 @@ ZeroTransferTimerProc(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED)
|
||||
int
|
||||
TclCopyChannelOld(
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
Tcl_Channel inChan, /* Channel to read from. */
|
||||
Tcl_Channel outChan, /* Channel to write to. */
|
||||
int toRead, /* Amount of data to copy, or -1 for all. */
|
||||
Tcl_Obj *cmdPtr) /* Pointer to script to execute or NULL. */
|
||||
{
|
||||
return TclCopyChannel(interp, inChan, outChan, (Tcl_WideInt) toRead,
|
||||
cmdPtr);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
TclCopyChannel(
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
|
||||
+1
-28
@@ -15,7 +15,7 @@
|
||||
* Callback structure for accept callback in a TCP server.
|
||||
*/
|
||||
|
||||
typedef struct AcceptCallback {
|
||||
typedef struct {
|
||||
Tcl_Obj *script; /* Script to invoke. */
|
||||
Tcl_Interp *interp; /* Interpreter in which to run it. */
|
||||
} AcceptCallback;
|
||||
@@ -137,19 +137,6 @@ Tcl_PutsObjCmd(
|
||||
chanObjPtr = objv[2];
|
||||
string = objv[3];
|
||||
break;
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
} else if (strcmp(TclGetString(objv[3]), "nonewline") == 0) {
|
||||
/*
|
||||
* The code below provides backwards compatibility with an old
|
||||
* form of the command that is no longer recommended or
|
||||
* documented. See also [Bug #3151675]. Will be removed in Tcl 9,
|
||||
* maybe even earlier.
|
||||
*/
|
||||
|
||||
chanObjPtr = objv[1];
|
||||
string = objv[2];
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
/* Fall through */
|
||||
default: /* [puts] or
|
||||
@@ -439,25 +426,11 @@ Tcl_ReadObjCmd(
|
||||
if (i < objc) {
|
||||
if ((TclGetIntFromObj(interp, objv[i], &toRead) != TCL_OK)
|
||||
|| (toRead < 0)) {
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
/*
|
||||
* The code below provides backwards compatibility with an old
|
||||
* form of the command that is no longer recommended or
|
||||
* documented. See also [Bug #3151675]. Will be removed in Tcl 9,
|
||||
* maybe even earlier.
|
||||
*/
|
||||
|
||||
if (strcmp(TclGetString(objv[i]), "nonewline") != 0) {
|
||||
#endif
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"expected non-negative integer but got \"%s\"",
|
||||
TclGetString(objv[i])));
|
||||
Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", NULL);
|
||||
return TCL_ERROR;
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
}
|
||||
newline = 1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -223,7 +223,7 @@ TclCreateSocketAddress(
|
||||
* using AI_ADDRCONFIG is probably low even in situations where it works,
|
||||
* we'll leave it out for now. After all, it is just an optimisation.
|
||||
*
|
||||
* Missing on: OpenBSD, NetBSD.
|
||||
* Missing on NetBSD.
|
||||
* Causes failure when used on AIX 5.1 and HP-UX
|
||||
*/
|
||||
|
||||
|
||||
+2
-31
@@ -881,29 +881,6 @@ Tcl_WrongNumArgs(
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
const char *elementStr;
|
||||
|
||||
/*
|
||||
* [incr Tcl] does something fairly horrific when generating error
|
||||
* messages for its ensembles; it passes the whole set of ensemble
|
||||
* arguments as a list in the first argument. This means that this code
|
||||
* causes a problem in iTcl if it attempts to correctly quote all
|
||||
* arguments, which would be the correct thing to do. We work around this
|
||||
* nasty behaviour for now, and hope that we can remove it all in the
|
||||
* future...
|
||||
*/
|
||||
|
||||
#ifndef AVOID_HACKS_FOR_ITCL
|
||||
int isFirst = 1; /* Special flag used to inhibit the treating
|
||||
* of the first word as a list element so the
|
||||
* hacky way Itcl generates error messages for
|
||||
* its ensembles will still work. [Bug
|
||||
* 1066837] */
|
||||
# define MAY_QUOTE_WORD (!isFirst)
|
||||
# define AFTER_FIRST_WORD (isFirst = 0)
|
||||
#else /* !AVOID_HACKS_FOR_ITCL */
|
||||
# define MAY_QUOTE_WORD 1
|
||||
# define AFTER_FIRST_WORD (void) 0
|
||||
#endif /* AVOID_HACKS_FOR_ITCL */
|
||||
|
||||
TclNewObj(objPtr);
|
||||
if (iPtr->flags & INTERP_ALTERNATE_WRONG_ARGS) {
|
||||
iPtr->flags &= ~INTERP_ALTERNATE_WRONG_ARGS;
|
||||
@@ -970,7 +947,7 @@ Tcl_WrongNumArgs(
|
||||
flags = 0;
|
||||
len = TclScanElement(elementStr, elemLen, &flags);
|
||||
|
||||
if (MAY_QUOTE_WORD && len != elemLen) {
|
||||
if (len != elemLen) {
|
||||
char *quotedElementStr = TclStackAlloc(interp,
|
||||
(unsigned)len + 1);
|
||||
|
||||
@@ -982,8 +959,6 @@ Tcl_WrongNumArgs(
|
||||
Tcl_AppendToObj(objPtr, elementStr, elemLen);
|
||||
}
|
||||
|
||||
AFTER_FIRST_WORD;
|
||||
|
||||
/*
|
||||
* Add a space if the word is not the last one (which has a
|
||||
* moderately complex condition here).
|
||||
@@ -1021,7 +996,7 @@ Tcl_WrongNumArgs(
|
||||
flags = 0;
|
||||
len = TclScanElement(elementStr, elemLen, &flags);
|
||||
|
||||
if (MAY_QUOTE_WORD && len != elemLen) {
|
||||
if (len != elemLen) {
|
||||
char *quotedElementStr = TclStackAlloc(interp,
|
||||
(unsigned) len + 1);
|
||||
|
||||
@@ -1034,8 +1009,6 @@ Tcl_WrongNumArgs(
|
||||
}
|
||||
}
|
||||
|
||||
AFTER_FIRST_WORD;
|
||||
|
||||
/*
|
||||
* Append a space character (" ") if there is more text to follow
|
||||
* (either another element from objv, or the message string).
|
||||
@@ -1058,8 +1031,6 @@ Tcl_WrongNumArgs(
|
||||
Tcl_AppendStringsToObj(objPtr, "\"", NULL);
|
||||
Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL);
|
||||
Tcl_SetObjResult(interp, objPtr);
|
||||
#undef MAY_QUOTE_WORD
|
||||
#undef AFTER_FIRST_WORD
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+178
-138
@@ -50,10 +50,11 @@ declare 6 {
|
||||
declare 7 {
|
||||
int TclCopyAndCollapse(int count, const char *src, char *dst)
|
||||
}
|
||||
declare 8 {deprecated {}} {
|
||||
int TclCopyChannelOld(Tcl_Interp *interp, Tcl_Channel inChan,
|
||||
Tcl_Channel outChan, int toRead, Tcl_Obj *cmdPtr)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 8 {
|
||||
# int TclCopyChannelOld(Tcl_Interp *interp, Tcl_Channel inChan,
|
||||
# Tcl_Channel outChan, int toRead, Tcl_Obj *cmdPtr)
|
||||
#}
|
||||
|
||||
# TclCreatePipeline unofficially exported for use by BLT.
|
||||
|
||||
@@ -183,7 +184,7 @@ declare 41 {
|
||||
Tcl_Command TclGetOriginalCommand(Tcl_Command command)
|
||||
}
|
||||
declare 42 {
|
||||
CONST86 char *TclpGetUserHome(const char *name, Tcl_DString *bufferPtr)
|
||||
const char *TclpGetUserHome(const char *name, Tcl_DString *bufferPtr)
|
||||
}
|
||||
# Removed in 8.5a2:
|
||||
#declare 43 {
|
||||
@@ -313,9 +314,11 @@ declare 75 {
|
||||
declare 76 {
|
||||
unsigned long TclpGetSeconds(void)
|
||||
}
|
||||
declare 77 {deprecated {}} {
|
||||
void TclpGetTime(Tcl_Time *time)
|
||||
}
|
||||
|
||||
# Removed in 9.0:
|
||||
#declare 77 {
|
||||
# void TclpGetTime(Tcl_Time *time)
|
||||
#}
|
||||
# Removed in 8.6:
|
||||
#declare 78 {
|
||||
# int TclpGetTimeZone(unsigned long time)
|
||||
@@ -355,10 +358,11 @@ declare 81 {
|
||||
# declare 87 {
|
||||
# void TclPlatformInit(Tcl_Interp *interp)
|
||||
# }
|
||||
declare 88 {deprecated {}} {
|
||||
char *TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp,
|
||||
const char *name1, const char *name2, int flags)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 88 {
|
||||
# char *TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp,
|
||||
# const char *name1, const char *name2, int flags)
|
||||
#}
|
||||
declare 89 {
|
||||
int TclPreventAliasLoop(Tcl_Interp *interp, Tcl_Interp *cmdInterp,
|
||||
Tcl_Command cmd)
|
||||
@@ -408,7 +412,7 @@ declare 98 {
|
||||
# Tcl_Obj *objPtr, int flags)
|
||||
#}
|
||||
declare 101 {
|
||||
CONST86 char *TclSetPreInitScript(const char *string)
|
||||
const char *TclSetPreInitScript(const char *string)
|
||||
}
|
||||
declare 102 {
|
||||
void TclSetupEnv(Tcl_Interp *interp)
|
||||
@@ -417,9 +421,10 @@ declare 103 {
|
||||
int TclSockGetPort(Tcl_Interp *interp, const char *str, const char *proto,
|
||||
int *portPtr)
|
||||
}
|
||||
declare 104 {deprecated {}} {
|
||||
int TclSockMinimumBuffersOld(int sock, int size)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 104 {
|
||||
# int TclSockMinimumBuffersOld(int sock, int size)
|
||||
#}
|
||||
# Replaced by Tcl_FSStat in 8.4:
|
||||
#declare 105 {
|
||||
# int TclStat(const char *path, Tcl_StatBuf *buf)
|
||||
@@ -452,29 +457,35 @@ declare 111 {
|
||||
Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc,
|
||||
Tcl_ResolveCompiledVarProc *compiledVarProc)
|
||||
}
|
||||
declare 112 {
|
||||
int TclAppendExportList(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
Tcl_Obj *objPtr)
|
||||
}
|
||||
declare 113 {
|
||||
Tcl_Namespace *TclCreateNamespace(Tcl_Interp *interp, const char *name,
|
||||
ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc)
|
||||
}
|
||||
declare 114 {
|
||||
void TclDeleteNamespace(Tcl_Namespace *nsPtr)
|
||||
}
|
||||
declare 115 {
|
||||
int TclExport(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
const char *pattern, int resetListFirst)
|
||||
}
|
||||
declare 116 {
|
||||
Tcl_Command TclFindCommand(Tcl_Interp *interp, const char *name,
|
||||
Tcl_Namespace *contextNsPtr, int flags)
|
||||
}
|
||||
declare 117 {
|
||||
Tcl_Namespace *TclFindNamespace(Tcl_Interp *interp, const char *name,
|
||||
Tcl_Namespace *contextNsPtr, int flags)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 112 {
|
||||
# int Tcl_AppendExportList(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
# Tcl_Obj *objPtr)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 113 {
|
||||
# Tcl_Namespace *Tcl_CreateNamespace(Tcl_Interp *interp, const char *name,
|
||||
# ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 114 {
|
||||
# void Tcl_DeleteNamespace(Tcl_Namespace *nsPtr)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 115 {
|
||||
# int Tcl_Export(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
# const char *pattern, int resetListFirst)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 116 {
|
||||
# Tcl_Command Tcl_FindCommand(Tcl_Interp *interp, const char *name,
|
||||
# Tcl_Namespace *contextNsPtr, int flags)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 117 {
|
||||
# Tcl_Namespace *Tcl_FindNamespace(Tcl_Interp *interp, const char *name,
|
||||
# Tcl_Namespace *contextNsPtr, int flags)
|
||||
#}
|
||||
declare 118 {
|
||||
int Tcl_GetInterpResolvers(Tcl_Interp *interp, const char *name,
|
||||
Tcl_ResolverInfo *resInfo)
|
||||
@@ -487,31 +498,37 @@ declare 120 {
|
||||
Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp *interp, const char *name,
|
||||
Tcl_Namespace *contextNsPtr, int flags)
|
||||
}
|
||||
declare 121 {
|
||||
int TclForgetImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
const char *pattern)
|
||||
}
|
||||
declare 122 {
|
||||
Tcl_Command TclGetCommandFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
|
||||
}
|
||||
declare 123 {
|
||||
void TclGetCommandFullName(Tcl_Interp *interp, Tcl_Command command,
|
||||
Tcl_Obj *objPtr)
|
||||
}
|
||||
declare 124 {
|
||||
Tcl_Namespace *TclGetCurrentNamespace_(Tcl_Interp *interp)
|
||||
}
|
||||
declare 125 {
|
||||
Tcl_Namespace *TclGetGlobalNamespace_(Tcl_Interp *interp)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 121 {
|
||||
# int Tcl_ForgetImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
# const char *pattern)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 122 {
|
||||
# Tcl_Command Tcl_GetCommandFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 123 {
|
||||
# void Tcl_GetCommandFullName(Tcl_Interp *interp, Tcl_Command command,
|
||||
# Tcl_Obj *objPtr)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 124 {
|
||||
# Tcl_Namespace *Tcl_GetCurrentNamespace(Tcl_Interp *interp)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 125 {
|
||||
# Tcl_Namespace *Tcl_GetGlobalNamespace(Tcl_Interp *interp)
|
||||
#}
|
||||
declare 126 {
|
||||
void Tcl_GetVariableFullName(Tcl_Interp *interp, Tcl_Var variable,
|
||||
Tcl_Obj *objPtr)
|
||||
}
|
||||
declare 127 {
|
||||
int TclImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
const char *pattern, int allowOverwrite)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 127 {
|
||||
# int Tcl_Import(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
# const char *pattern, int allowOverwrite)
|
||||
#}
|
||||
declare 128 {
|
||||
void Tcl_PopCallFrame(Tcl_Interp *interp)
|
||||
}
|
||||
@@ -530,9 +547,10 @@ declare 131 {
|
||||
declare 132 {
|
||||
int TclpHasSockets(Tcl_Interp *interp)
|
||||
}
|
||||
declare 133 {deprecated {}} {
|
||||
struct tm *TclpGetDate(const time_t *time, int useGMT)
|
||||
}
|
||||
# Removed in 9.0
|
||||
#declare 133 {
|
||||
# struct tm *TclpGetDate(const time_t *time, int useGMT)
|
||||
#}
|
||||
# Removed in 8.5
|
||||
#declare 134 {
|
||||
# size_t TclpStrftime(char *s, size_t maxsize, const char *format,
|
||||
@@ -623,12 +641,14 @@ declare 156 {
|
||||
declare 157 {
|
||||
Var *TclVarTraceExists(Tcl_Interp *interp, const char *varName)
|
||||
}
|
||||
declare 158 {deprecated {use public Tcl_SetStartupScript()}} {
|
||||
void TclSetStartupScriptFileName(const char *filename)
|
||||
}
|
||||
declare 159 {deprecated {use public Tcl_GetStartupScript()}} {
|
||||
const char *TclGetStartupScriptFileName(void)
|
||||
}
|
||||
# REMOVED - use public Tcl_SetStartupScript()
|
||||
#declare 158 {
|
||||
# void TclSetStartupScriptFileName(const char *filename)
|
||||
#}
|
||||
# REMOVED - use public Tcl_GetStartupScript()
|
||||
#declare 159 {
|
||||
# const char *TclGetStartupScriptFileName(void)
|
||||
#}
|
||||
#declare 160 {
|
||||
# int TclpMatchFilesTypes(Tcl_Interp *interp, char *separators,
|
||||
# Tcl_DString *dirPtr, char *pattern, char *tail,
|
||||
@@ -672,12 +692,15 @@ declare 166 {
|
||||
int index, Tcl_Obj *valuePtr)
|
||||
}
|
||||
|
||||
declare 167 {deprecated {use public Tcl_SetStartupScript()}} {
|
||||
void TclSetStartupScriptPath(Tcl_Obj *pathPtr)
|
||||
}
|
||||
declare 168 {deprecated {use public Tcl_GetStartupScript()}} {
|
||||
Tcl_Obj *TclGetStartupScriptPath(void)
|
||||
}
|
||||
# VFS-aware versions of Tcl*StartupScriptFileName (158 and 159 above)
|
||||
# REMOVED - use public Tcl_SetStartupScript()
|
||||
#declare 167 {
|
||||
# void TclSetStartupScriptPath(Tcl_Obj *pathPtr)
|
||||
#}
|
||||
# REMOVED - use public Tcl_GetStartupScript()
|
||||
#declare 168 {
|
||||
# Tcl_Obj *TclGetStartupScriptPath(void)
|
||||
#}
|
||||
# variant of Tcl_UtfNCmp that takes n as bytes, not chars
|
||||
declare 169 {
|
||||
int TclpUtfNcmp2(const char *s1, const char *s2, unsigned long n)
|
||||
@@ -723,12 +746,13 @@ declare 177 {
|
||||
void TclVarErrMsg(Tcl_Interp *interp, const char *part1, const char *part2,
|
||||
const char *operation, const char *reason)
|
||||
}
|
||||
declare 178 {
|
||||
void TclSetStartupScript(Tcl_Obj *pathPtr, const char *encodingName)
|
||||
}
|
||||
declare 179 {
|
||||
Tcl_Obj *TclGetStartupScript(const char **encodingNamePtr)
|
||||
}
|
||||
# TIP 338 made these public - now declared in tcl.h
|
||||
#declare 178 {
|
||||
# void Tcl_SetStartupScript(Tcl_Obj *pathPtr, const char *encodingName)
|
||||
#}
|
||||
#declare 179 {
|
||||
# Tcl_Obj *Tcl_GetStartupScript(const char **encodingNamePtr)
|
||||
#}
|
||||
|
||||
# REMOVED
|
||||
# Allocate lists without copying arrays
|
||||
@@ -740,12 +764,14 @@ declare 179 {
|
||||
# const char *file, int line)
|
||||
#}
|
||||
|
||||
declare 182 {deprecated {}} {
|
||||
struct tm *TclpLocaltime(const time_t *clock)
|
||||
}
|
||||
declare 183 {deprecated {}} {
|
||||
struct tm *TclpGmtime(const time_t *clock)
|
||||
}
|
||||
# Removed in 9.0
|
||||
#declare 182 {
|
||||
# struct tm *TclpLocaltime(const time_t *clock)
|
||||
#}
|
||||
# Removed in 9.0
|
||||
#declare 183 {
|
||||
# struct tm *TclpGmtime(const time_t *clock)
|
||||
#}
|
||||
|
||||
# For the new "Thread Storage" subsystem.
|
||||
|
||||
@@ -927,9 +953,12 @@ declare 234 {
|
||||
declare 235 {
|
||||
void TclInitVarHashTable(TclVarHashTable *tablePtr, Namespace *nsPtr)
|
||||
}
|
||||
declare 236 {deprecated {use Tcl_BackgroundException}} {
|
||||
void TclBackgroundException(Tcl_Interp *interp, int code)
|
||||
}
|
||||
|
||||
|
||||
# TIP 337 made this one public
|
||||
#declare 236 {
|
||||
# void TclBackgroundException(Tcl_Interp *interp, int code)
|
||||
#}
|
||||
|
||||
# TIP #285: Script cancellation support.
|
||||
declare 237 {
|
||||
@@ -1038,17 +1067,20 @@ interface tclIntPlat
|
||||
declare 0 win {
|
||||
void TclWinConvertError(DWORD errCode)
|
||||
}
|
||||
declare 1 win {
|
||||
void TclWinConvertWSAError(DWORD errCode)
|
||||
}
|
||||
declare 2 win {
|
||||
struct servent *TclWinGetServByName(const char *nm,
|
||||
const char *proto)
|
||||
}
|
||||
declare 3 win {
|
||||
int TclWinGetSockOpt(SOCKET s, int level, int optname,
|
||||
char *optval, int *optlen)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 1 win {
|
||||
# void TclWinConvertWSAError(DWORD errCode)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 2 win {
|
||||
# struct servent *TclWinGetServByName(const char *nm,
|
||||
# const char *proto)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 3 win {
|
||||
# int TclWinGetSockOpt(SOCKET s, int level, int optname,
|
||||
# char *optval, int *optlen)
|
||||
#}
|
||||
declare 4 win {
|
||||
HINSTANCE TclWinGetTclInstance(void)
|
||||
}
|
||||
@@ -1060,23 +1092,26 @@ declare 5 win {
|
||||
# declare 5 win {
|
||||
# HINSTANCE TclWinLoadLibrary(char *name)
|
||||
# }
|
||||
declare 6 win {
|
||||
unsigned short TclWinNToHS(unsigned short ns)
|
||||
}
|
||||
declare 7 win {
|
||||
int TclWinSetSockOpt(SOCKET s, int level, int optname,
|
||||
const char *optval, int optlen)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 6 win {
|
||||
# unsigned short TclWinNToHS(unsigned short ns)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 7 win {
|
||||
# int TclWinSetSockOpt(SOCKET s, int level, int optname,
|
||||
# const char *optval, int optlen)
|
||||
#}
|
||||
declare 8 win {
|
||||
int TclpGetPid(Tcl_Pid pid)
|
||||
}
|
||||
declare 9 win {
|
||||
int TclWinGetPlatformId(void)
|
||||
}
|
||||
# new for 8.4.20+/8.5.12+ Cygwin only
|
||||
declare 10 win {
|
||||
Tcl_DirEntry *TclpReaddir(DIR *dir)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 9 win {
|
||||
# int TclWinGetPlatformId(void)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 10 win {
|
||||
# Tcl_DirEntry *TclpReaddir(DIR *dir)
|
||||
#}
|
||||
# Removed in 8.3.1 (for Win32s only):
|
||||
#declare 10 win {
|
||||
# int TclWinSynchSpawn(void *args, int type, void **trans, Tcl_Pid *pidPtr)
|
||||
@@ -1127,9 +1162,10 @@ declare 19 win {
|
||||
declare 20 win {
|
||||
void TclWinAddProcess(HANDLE hProcess, DWORD id)
|
||||
}
|
||||
declare 21 win {
|
||||
char *TclpInetNtoa(struct in_addr addr)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 21 win {
|
||||
# char *TclpInetNtoa(struct in_addr addr)
|
||||
#}
|
||||
# removed permanently for 8.4
|
||||
#declare 21 win {
|
||||
# void TclpAsyncMark(Tcl_AsyncHandler async)
|
||||
@@ -1150,9 +1186,10 @@ declare 24 win {
|
||||
#declare 25 win {
|
||||
# TclPlatformType *TclWinGetPlatform(void)
|
||||
#}
|
||||
declare 26 win {
|
||||
void TclWinSetInterfaces(int wide)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 26 win {
|
||||
# void TclWinSetInterfaces(int wide)
|
||||
#}
|
||||
|
||||
# Added in Tcl 8.3.3 / 8.4
|
||||
|
||||
@@ -1162,9 +1199,10 @@ declare 27 win {
|
||||
|
||||
# Added in 8.4.2
|
||||
|
||||
declare 28 win {
|
||||
void TclWinResetInterfaces(void)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 28 win {
|
||||
# void TclWinResetInterfaces(void)
|
||||
#}
|
||||
|
||||
################################
|
||||
# Unix specific functions
|
||||
@@ -1211,20 +1249,22 @@ declare 9 unix {
|
||||
|
||||
# Added in 8.4:
|
||||
|
||||
declare 10 unix {
|
||||
Tcl_DirEntry *TclpReaddir(DIR *dir)
|
||||
}
|
||||
# Slots 11 and 12 are forwarders for functions that were promoted to
|
||||
# generic Stubs
|
||||
declare 11 unix {
|
||||
struct tm *TclpLocaltime_unix(const time_t *clock)
|
||||
}
|
||||
declare 12 unix {
|
||||
struct tm *TclpGmtime_unix(const time_t *clock)
|
||||
}
|
||||
declare 13 unix {
|
||||
char *TclpInetNtoa(struct in_addr addr)
|
||||
}
|
||||
# Removed in 9.0:
|
||||
#declare 10 unix {
|
||||
# Tcl_DirEntry *TclpReaddir(DIR *dir)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 11 unix {
|
||||
# struct tm *TclpLocaltime_unix(const time_t *clock)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 12 unix {
|
||||
# struct tm *TclpGmtime_unix(const time_t *clock)
|
||||
#}
|
||||
# Removed in 9.0:
|
||||
#declare 13 unix {
|
||||
# char *TclpInetNtoa(struct in_addr addr)
|
||||
#}
|
||||
|
||||
# Added in 8.5:
|
||||
|
||||
|
||||
+53
-111
@@ -25,19 +25,6 @@
|
||||
|
||||
#undef ACCEPT_NAN
|
||||
|
||||
/*
|
||||
* In Tcl 8.7, stop supporting special hacks for legacy Itcl 3.
|
||||
* Itcl 4 doesn't need them. Itcl 3 can be updated to not need them
|
||||
* using the Tcl(Init|Reset)RewriteEnsemble() routines in all Tcl 8.6+
|
||||
* releases. Perhaps Tcl 8.7 will add even better public interfaces
|
||||
* supporting all the re-invocation mechanisms extensions like Itcl 3
|
||||
* need. As an absolute last resort, folks who must make Itcl 3 work
|
||||
* unchanged with Tcl 8.7 can remove this line to regain the migration
|
||||
* support. Tcl 9 will no longer offer even that option.
|
||||
*/
|
||||
|
||||
#define AVOID_HACKS_FOR_ITCL 1
|
||||
|
||||
/*
|
||||
* Common include files needed by most of the Tcl source files are included
|
||||
* here, so that system-dependent personalizations for the include files only
|
||||
@@ -51,6 +38,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#ifdef NO_STDLIB_H
|
||||
# include "../compat/stdlib.h"
|
||||
#else
|
||||
@@ -190,9 +178,6 @@ typedef struct Tcl_ResolverInfo {
|
||||
* - Bug #696893 - variable is either proc-local or in the current
|
||||
* namespace; never follow the second (global) resolution path
|
||||
* - Bug #631741 - do not use special namespace or interp resolvers
|
||||
*
|
||||
* It should also not collide with the (deprecated) TCL_PARSE_PART1 flag
|
||||
* (Bug #835020)
|
||||
*/
|
||||
|
||||
#define TCL_AVOID_RESOLVERS 0x40000
|
||||
@@ -265,7 +250,7 @@ typedef struct Namespace {
|
||||
* strings; values have type (Namespace *). If
|
||||
* NULL, there are no children. */
|
||||
#endif
|
||||
unsigned long nsId; /* Unique id for the namespace. */
|
||||
size_t nsId; /* Unique id for the namespace. */
|
||||
Tcl_Interp *interp; /* The interpreter containing this
|
||||
* namespace. */
|
||||
int flags; /* OR-ed combination of the namespace status
|
||||
@@ -274,7 +259,7 @@ typedef struct Namespace {
|
||||
* frames for this namespace that are on the
|
||||
* Tcl call stack. The namespace won't be
|
||||
* freed until activationCount becomes zero. */
|
||||
unsigned int refCount; /* Count of references by namespaceName
|
||||
size_t 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
|
||||
@@ -299,12 +284,12 @@ typedef struct Namespace {
|
||||
* registered using "namespace export". */
|
||||
int maxExportPatterns; /* Mumber of export patterns for which space
|
||||
* is currently allocated. */
|
||||
unsigned int cmdRefEpoch; /* Incremented if a newly added command
|
||||
size_t 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. */
|
||||
unsigned int resolverEpoch; /* Incremented whenever (a) the name
|
||||
size_t 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
|
||||
@@ -331,7 +316,7 @@ typedef struct Namespace {
|
||||
* LookupCompiledLocal to resolve variable
|
||||
* references within the namespace at compile
|
||||
* time. */
|
||||
unsigned int exportLookupEpoch; /* Incremented whenever a command is added to
|
||||
size_t 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
|
||||
@@ -432,7 +417,7 @@ typedef struct EnsembleConfig {
|
||||
* if the command has been deleted (or never
|
||||
* existed; the global namespace never has an
|
||||
* ensemble command.) */
|
||||
unsigned int epoch; /* The epoch at which this ensemble's table of
|
||||
size_t 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
|
||||
@@ -545,7 +530,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
|
||||
size_t 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. */
|
||||
@@ -618,7 +603,7 @@ typedef struct Var {
|
||||
|
||||
typedef struct VarInHash {
|
||||
Var var;
|
||||
unsigned int refCount; /* Counts number of active uses of this
|
||||
size_t 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
|
||||
@@ -950,7 +935,7 @@ typedef struct CompiledLocal {
|
||||
typedef struct Proc {
|
||||
struct Interp *iPtr; /* Interpreter for which this command is
|
||||
* defined. */
|
||||
unsigned int refCount; /* Reference count: 1 if still present in
|
||||
size_t 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
|
||||
@@ -1067,7 +1052,7 @@ typedef struct AssocData {
|
||||
*/
|
||||
|
||||
typedef struct LocalCache {
|
||||
unsigned int refCount;
|
||||
size_t refCount;
|
||||
int numVars;
|
||||
Tcl_Obj *varName0;
|
||||
} LocalCache;
|
||||
@@ -1229,7 +1214,7 @@ typedef struct CmdFrame {
|
||||
typedef struct CFWord {
|
||||
CmdFrame *framePtr; /* CmdFrame to access. */
|
||||
int word; /* Index of the word in the command. */
|
||||
unsigned int refCount; /* Number of times the word is on the
|
||||
size_t refCount; /* Number of times the word is on the
|
||||
* stack. */
|
||||
} CFWord;
|
||||
|
||||
@@ -1634,12 +1619,12 @@ typedef struct Command {
|
||||
* recreated). */
|
||||
Namespace *nsPtr; /* Points to the namespace containing this
|
||||
* command. */
|
||||
unsigned int refCount; /* 1 if in command hashtable plus 1 for each
|
||||
size_t 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. */
|
||||
unsigned int cmdEpoch; /* Incremented to invalidate any references
|
||||
size_t 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
|
||||
@@ -1773,41 +1758,31 @@ typedef struct AllocCache {
|
||||
|
||||
typedef struct Interp {
|
||||
/*
|
||||
* Note: the first three fields must match exactly the fields in a
|
||||
* Tcl_Interp struct (see tcl.h). If you change one, be sure to change the
|
||||
* other.
|
||||
*
|
||||
* The interpreter's result is held in both the string and the
|
||||
* objResultPtr fields. These fields hold, respectively, the result's
|
||||
* string or object value. The interpreter's result is always in the
|
||||
* result field if that is non-empty, otherwise it is in objResultPtr.
|
||||
* The two fields are kept consistent unless some C code sets
|
||||
* interp->result directly. Programs should not access result and
|
||||
* objResultPtr directly; instead, they should always get and set the
|
||||
* result using procedures such as Tcl_SetObjResult, Tcl_GetObjResult, and
|
||||
* Tcl_GetStringResult. See the SetResult man page for details.
|
||||
* The first two fields were named "result" and "freeProc" in earlier
|
||||
* versions of Tcl. They are no longer used within Tcl, and are no
|
||||
* longer available to be accessed by extensions. However, they cannot
|
||||
* be removed. Why? There is a deployed base of stub-enabled extensions
|
||||
* that query the value of iPtr->stubTable. For them to continue to work,
|
||||
* the location of the field "stubTable" within the Interp struct cannot
|
||||
* change. The most robust way to assure that is to leave all fields up to
|
||||
* that one undisturbed.
|
||||
*/
|
||||
|
||||
char *result; /* If the last command returned a string
|
||||
* result, this points to it. Should not be
|
||||
* accessed directly; see comment above. */
|
||||
Tcl_FreeProc *freeProc; /* Zero means a string result is statically
|
||||
* allocated. TCL_DYNAMIC means string result
|
||||
* was allocated with ckalloc and should be
|
||||
* freed with ckfree. Other values give
|
||||
* address of procedure to invoke to free the
|
||||
* string result. Tcl_Eval must free it before
|
||||
* executing next command. */
|
||||
const char *legacyResult;
|
||||
void (*legacyFreeProc) (void);
|
||||
int errorLine; /* When TCL_ERROR is returned, this gives the
|
||||
* line number in the command where the error
|
||||
* occurred (1 means first line). */
|
||||
const struct TclStubs *stubTable;
|
||||
/* Pointer to the exported Tcl stub table. On
|
||||
* previous versions of Tcl this is a pointer
|
||||
* to the objResultPtr or a pointer to a
|
||||
* buckets array in a hash table. We therefore
|
||||
* have to do some careful checking before we
|
||||
* can use this. */
|
||||
/* Pointer to the exported Tcl stub table. In
|
||||
* ancient pre-8.1 versions of Tcl this was a
|
||||
* pointer to the objResultPtr or a pointer to a
|
||||
* buckets array in a hash table. Deployed stubs
|
||||
* enabled extensions check for a NULL pointer value
|
||||
* and for a TCL_STUBS_MAGIC value to verify they
|
||||
* are not [load]ing into one of those pre-stubs
|
||||
* interps.
|
||||
*/
|
||||
|
||||
TclHandle handle; /* Handle used to keep track of when this
|
||||
* interp is deleted. */
|
||||
@@ -1820,15 +1795,7 @@ typedef struct Interp {
|
||||
ClientData interpInfo; /* Information used by tclInterp.c to keep
|
||||
* track of master/slave interps on a
|
||||
* per-interp basis. */
|
||||
union {
|
||||
void (*optimizer)(void *envPtr);
|
||||
Tcl_HashTable unused2; /* No longer used (was mathFuncTable). The
|
||||
* unused space in interp was repurposed for
|
||||
* pluggable bytecode optimizers. The core
|
||||
* contains one optimizer, which can be
|
||||
* selectively overridden by extensions. */
|
||||
} extra;
|
||||
|
||||
void (*optimizer)(void *envPtr);
|
||||
/*
|
||||
* Information related to procedures and variables. See tclProc.c and
|
||||
* tclVar.c for usage.
|
||||
@@ -1857,25 +1824,6 @@ typedef struct Interp {
|
||||
Namespace *lookupNsPtr; /* Namespace to use ONLY on the next
|
||||
* TCL_EVAL_INVOKE call to Tcl_EvalObjv. */
|
||||
|
||||
/*
|
||||
* Information used by Tcl_AppendResult to keep track of partial results.
|
||||
* See Tcl_AppendResult code for details.
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
char *appendResult; /* Storage space for results generated by
|
||||
* Tcl_AppendResult. Ckalloc-ed. NULL means
|
||||
* not yet allocated. */
|
||||
int appendAvl; /* Total amount of space available at
|
||||
* partialResult. */
|
||||
int appendUsed; /* Number of non-null bytes currently stored
|
||||
* at partialResult. */
|
||||
#else
|
||||
char *appendResultDontUse;
|
||||
int appendAvlDontUse;
|
||||
int appendUsedDontUse;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Information about packages. Used only in tclPkg.c.
|
||||
*/
|
||||
@@ -1898,13 +1846,12 @@ typedef struct Interp {
|
||||
* Normally zero, but may be set before
|
||||
* calling Tcl_Eval. See below for valid
|
||||
* values. */
|
||||
int unused1; /* No longer used (was termOffset) */
|
||||
LiteralTable literalTable; /* Contains LiteralEntry's describing all Tcl
|
||||
* objects holding literals of scripts
|
||||
* compiled by the interpreter. Indexed by the
|
||||
* string representations of literals. Used to
|
||||
* avoid creating duplicate objects. */
|
||||
unsigned int compileEpoch; /* Holds the current "compilation epoch" for
|
||||
size_t 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
|
||||
@@ -1936,14 +1883,6 @@ typedef struct Interp {
|
||||
* string. Returned by Tcl_ObjSetVar2 when
|
||||
* variable traces change a variable in a
|
||||
* gross way. */
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
# if !defined(TCL_NO_DEPRECATED)
|
||||
char resultSpace[TCL_DSTRING_STATIC_SIZE+1];
|
||||
/* Static space holding small results. */
|
||||
# else
|
||||
char resultSpaceDontUse[TCL_DSTRING_STATIC_SIZE+1];
|
||||
# endif
|
||||
#endif
|
||||
Tcl_Obj *objResultPtr; /* If the last command returned an object
|
||||
* result, this points to it. Should not be
|
||||
* accessed directly; see comment above. */
|
||||
@@ -2386,7 +2325,7 @@ typedef enum TclEolTranslation {
|
||||
*/
|
||||
|
||||
typedef struct List {
|
||||
unsigned int refCount;
|
||||
size_t refCount;
|
||||
int maxElemCount; /* Total number of element array slots. */
|
||||
int elemCount; /* Current number of list elements. */
|
||||
int canonicalFlag; /* Set if the string representation was
|
||||
@@ -2455,10 +2394,9 @@ typedef struct List {
|
||||
*/
|
||||
|
||||
#define TclGetBooleanFromObj(interp, objPtr, boolPtr) \
|
||||
(((objPtr)->typePtr == &tclIntType) \
|
||||
(((objPtr)->typePtr == &tclIntType \
|
||||
|| (objPtr)->typePtr == &tclBooleanType) \
|
||||
? (*(boolPtr) = ((objPtr)->internalRep.wideValue!=0), TCL_OK) \
|
||||
: ((objPtr)->typePtr == &tclBooleanType) \
|
||||
? (*(boolPtr) = ((objPtr)->internalRep.longValue!=0), TCL_OK) \
|
||||
: Tcl_GetBooleanFromObj((interp), (objPtr), (boolPtr)))
|
||||
|
||||
#ifdef TCL_WIDE_INT_IS_LONG
|
||||
@@ -2624,7 +2562,7 @@ typedef Tcl_ObjCmdProc *TclObjCmdProcType;
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, unsigned int *lengthPtr,
|
||||
typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, size_t *lengthPtr,
|
||||
Tcl_Encoding *encodingPtr);
|
||||
|
||||
/*
|
||||
@@ -2636,9 +2574,9 @@ typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, unsigned int *leng
|
||||
*/
|
||||
|
||||
typedef struct ProcessGlobalValue {
|
||||
unsigned int epoch; /* Epoch counter to detect changes in the
|
||||
size_t epoch; /* Epoch counter to detect changes in the
|
||||
* master value. */
|
||||
unsigned int numBytes; /* Length of the master string. */
|
||||
size_t numBytes; /* Length of the master string. */
|
||||
char *value; /* The master string value. */
|
||||
Tcl_Encoding encoding; /* system encoding when master string was
|
||||
* initialized. */
|
||||
@@ -2760,6 +2698,10 @@ MODULE_SCOPE long tclObjsShared[TCL_MAX_SHARED_OBJ_STATS];
|
||||
|
||||
MODULE_SCOPE char tclEmptyString;
|
||||
|
||||
enum CheckEmptyStringResult {
|
||||
TCL_EMPTYSTRING_UNKNOWN = -1, TCL_EMPTYSTRING_NO, TCL_EMPTYSTRING_YES
|
||||
};
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------
|
||||
* Procedures shared among Tcl modules but not used by the outside world,
|
||||
@@ -2898,8 +2840,6 @@ MODULE_SCOPE void TclChannelPreserve(Tcl_Channel chan);
|
||||
MODULE_SCOPE void TclChannelRelease(Tcl_Channel chan);
|
||||
MODULE_SCOPE int TclCheckArrayTraces(Tcl_Interp *interp, Var *varPtr,
|
||||
Var *arrayPtr, Tcl_Obj *name, int index);
|
||||
MODULE_SCOPE int TclCheckBadOctal(Tcl_Interp *interp,
|
||||
const char *value);
|
||||
MODULE_SCOPE int TclChanCaughtErrorBypass(Tcl_Interp *interp,
|
||||
Tcl_Channel chan);
|
||||
MODULE_SCOPE Tcl_ObjCmdProc TclChannelNamesCmd;
|
||||
@@ -3121,7 +3061,7 @@ MODULE_SCOPE int TclpThreadCreate(Tcl_ThreadId *idPtr,
|
||||
int stackSize, int flags);
|
||||
MODULE_SCOPE int TclpFindVariable(const char *name, int *lengthPtr);
|
||||
MODULE_SCOPE void TclpInitLibraryPath(char **valuePtr,
|
||||
unsigned int *lengthPtr, Tcl_Encoding *encodingPtr);
|
||||
size_t *lengthPtr, Tcl_Encoding *encodingPtr);
|
||||
MODULE_SCOPE void TclpInitLock(void);
|
||||
MODULE_SCOPE void TclpInitPlatform(void);
|
||||
MODULE_SCOPE void TclpInitUnlock(void);
|
||||
@@ -3256,11 +3196,6 @@ MODULE_SCOPE Tcl_Command TclInitBinaryCmd(Tcl_Interp *interp);
|
||||
MODULE_SCOPE int Tcl_BreakObjCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
MODULE_SCOPE int Tcl_CaseObjCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
#endif
|
||||
MODULE_SCOPE int Tcl_CatchObjCmd(ClientData clientData,
|
||||
Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
@@ -3994,6 +3929,7 @@ MODULE_SCOPE int TclCompileStreqOpCmd(Tcl_Interp *interp,
|
||||
MODULE_SCOPE int TclCompileAssembleCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
struct CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclCheckEmptyString(Tcl_Obj *objPtr);
|
||||
|
||||
/*
|
||||
* Routines that provide the [string] ensemble functionality. Possible
|
||||
@@ -4541,6 +4477,12 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
|
||||
|
||||
MODULE_SCOPE int TclIsPureByteArray(Tcl_Obj *objPtr);
|
||||
|
||||
#define TclIsPureDict(objPtr) \
|
||||
(((objPtr)->bytes==NULL) && ((objPtr)->typePtr==&tclDictType))
|
||||
|
||||
#define TclIsPureList(objPtr) \
|
||||
(((objPtr)->bytes==NULL) && ((objPtr)->typePtr==&tclListType))
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------
|
||||
* Macro used by the Tcl core to compare Unicode strings. On big-endian
|
||||
|
||||
+82
-202
@@ -28,22 +28,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9)
|
||||
/* Those macro's are especially for Itcl 3.4 compatibility */
|
||||
# define tclCreateNamespace tcl_CreateNamespace
|
||||
# define tclDeleteNamespace tcl_DeleteNamespace
|
||||
# define tclAppendExportList tcl_AppendExportList
|
||||
# define tclExport tcl_Export
|
||||
# define tclImport tcl_Import
|
||||
# define tclForgetImport tcl_ForgetImport
|
||||
# define tclGetCurrentNamespace_ tcl_GetCurrentNamespace
|
||||
# define tclGetGlobalNamespace_ tcl_GetGlobalNamespace
|
||||
# define tclFindNamespace tcl_FindNamespace
|
||||
# define tclFindCommand tcl_FindCommand
|
||||
# define tclGetCommandFromObj tcl_GetCommandFromObj
|
||||
# define tclGetCommandFullName tcl_GetCommandFullName
|
||||
#endif /* !defined(TCL_NO_DEPRECATED) */
|
||||
|
||||
/*
|
||||
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
||||
* script. Any modifications to the function declarations below should be made
|
||||
@@ -74,11 +58,7 @@ EXTERN void TclCleanupCommand(Command *cmdPtr);
|
||||
/* 7 */
|
||||
EXTERN int TclCopyAndCollapse(int count, const char *src,
|
||||
char *dst);
|
||||
/* 8 */
|
||||
TCL_DEPRECATED("")
|
||||
int TclCopyChannelOld(Tcl_Interp *interp,
|
||||
Tcl_Channel inChan, Tcl_Channel outChan,
|
||||
int toRead, Tcl_Obj *cmdPtr);
|
||||
/* Slot 8 is reserved */
|
||||
/* 9 */
|
||||
EXTERN int TclCreatePipeline(Tcl_Interp *interp, int argc,
|
||||
const char **argv, Tcl_Pid **pidArrayPtr,
|
||||
@@ -152,7 +132,7 @@ EXTERN int TclGetOpenMode(Tcl_Interp *interp, const char *str,
|
||||
/* 41 */
|
||||
EXTERN Tcl_Command TclGetOriginalCommand(Tcl_Command command);
|
||||
/* 42 */
|
||||
EXTERN CONST86 char * TclpGetUserHome(const char *name,
|
||||
EXTERN const char * TclpGetUserHome(const char *name,
|
||||
Tcl_DString *bufferPtr);
|
||||
/* Slot 43 is reserved */
|
||||
/* 44 */
|
||||
@@ -218,9 +198,7 @@ EXTERN void TclpFree(char *ptr);
|
||||
EXTERN unsigned long TclpGetClicks(void);
|
||||
/* 76 */
|
||||
EXTERN unsigned long TclpGetSeconds(void);
|
||||
/* 77 */
|
||||
TCL_DEPRECATED("")
|
||||
void TclpGetTime(Tcl_Time *time);
|
||||
/* Slot 77 is reserved */
|
||||
/* Slot 78 is reserved */
|
||||
/* Slot 79 is reserved */
|
||||
/* Slot 80 is reserved */
|
||||
@@ -232,11 +210,7 @@ EXTERN char * TclpRealloc(char *ptr, unsigned int size);
|
||||
/* Slot 85 is reserved */
|
||||
/* Slot 86 is reserved */
|
||||
/* Slot 87 is reserved */
|
||||
/* 88 */
|
||||
TCL_DEPRECATED("")
|
||||
char * TclPrecTraceProc(ClientData clientData,
|
||||
Tcl_Interp *interp, const char *name1,
|
||||
const char *name2, int flags);
|
||||
/* Slot 88 is reserved */
|
||||
/* 89 */
|
||||
EXTERN int TclPreventAliasLoop(Tcl_Interp *interp,
|
||||
Tcl_Interp *cmdInterp, Tcl_Command cmd);
|
||||
@@ -263,15 +237,13 @@ EXTERN int TclServiceIdle(void);
|
||||
/* Slot 99 is reserved */
|
||||
/* Slot 100 is reserved */
|
||||
/* 101 */
|
||||
EXTERN CONST86 char * TclSetPreInitScript(const char *string);
|
||||
EXTERN const char * TclSetPreInitScript(const char *string);
|
||||
/* 102 */
|
||||
EXTERN void TclSetupEnv(Tcl_Interp *interp);
|
||||
/* 103 */
|
||||
EXTERN int TclSockGetPort(Tcl_Interp *interp, const char *str,
|
||||
const char *proto, int *portPtr);
|
||||
/* 104 */
|
||||
TCL_DEPRECATED("")
|
||||
int TclSockMinimumBuffersOld(int sock, int size);
|
||||
/* Slot 104 is reserved */
|
||||
/* Slot 105 is reserved */
|
||||
/* Slot 106 is reserved */
|
||||
/* Slot 107 is reserved */
|
||||
@@ -287,25 +259,12 @@ EXTERN void Tcl_AddInterpResolvers(Tcl_Interp *interp,
|
||||
Tcl_ResolveCmdProc *cmdProc,
|
||||
Tcl_ResolveVarProc *varProc,
|
||||
Tcl_ResolveCompiledVarProc *compiledVarProc);
|
||||
/* 112 */
|
||||
EXTERN int TclAppendExportList(Tcl_Interp *interp,
|
||||
Tcl_Namespace *nsPtr, Tcl_Obj *objPtr);
|
||||
/* 113 */
|
||||
EXTERN Tcl_Namespace * TclCreateNamespace(Tcl_Interp *interp,
|
||||
const char *name, ClientData clientData,
|
||||
Tcl_NamespaceDeleteProc *deleteProc);
|
||||
/* 114 */
|
||||
EXTERN void TclDeleteNamespace(Tcl_Namespace *nsPtr);
|
||||
/* 115 */
|
||||
EXTERN int TclExport(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
const char *pattern, int resetListFirst);
|
||||
/* 116 */
|
||||
EXTERN Tcl_Command TclFindCommand(Tcl_Interp *interp, const char *name,
|
||||
Tcl_Namespace *contextNsPtr, int flags);
|
||||
/* 117 */
|
||||
EXTERN Tcl_Namespace * TclFindNamespace(Tcl_Interp *interp,
|
||||
const char *name,
|
||||
Tcl_Namespace *contextNsPtr, int flags);
|
||||
/* Slot 112 is reserved */
|
||||
/* Slot 113 is reserved */
|
||||
/* Slot 114 is reserved */
|
||||
/* Slot 115 is reserved */
|
||||
/* Slot 116 is reserved */
|
||||
/* Slot 117 is reserved */
|
||||
/* 118 */
|
||||
EXTERN int Tcl_GetInterpResolvers(Tcl_Interp *interp,
|
||||
const char *name, Tcl_ResolverInfo *resInfo);
|
||||
@@ -317,25 +276,15 @@ EXTERN int Tcl_GetNamespaceResolvers(
|
||||
EXTERN Tcl_Var Tcl_FindNamespaceVar(Tcl_Interp *interp,
|
||||
const char *name,
|
||||
Tcl_Namespace *contextNsPtr, int flags);
|
||||
/* 121 */
|
||||
EXTERN int TclForgetImport(Tcl_Interp *interp,
|
||||
Tcl_Namespace *nsPtr, const char *pattern);
|
||||
/* 122 */
|
||||
EXTERN Tcl_Command TclGetCommandFromObj(Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr);
|
||||
/* 123 */
|
||||
EXTERN void TclGetCommandFullName(Tcl_Interp *interp,
|
||||
Tcl_Command command, Tcl_Obj *objPtr);
|
||||
/* 124 */
|
||||
EXTERN Tcl_Namespace * TclGetCurrentNamespace_(Tcl_Interp *interp);
|
||||
/* 125 */
|
||||
EXTERN Tcl_Namespace * TclGetGlobalNamespace_(Tcl_Interp *interp);
|
||||
/* Slot 121 is reserved */
|
||||
/* Slot 122 is reserved */
|
||||
/* Slot 123 is reserved */
|
||||
/* Slot 124 is reserved */
|
||||
/* Slot 125 is reserved */
|
||||
/* 126 */
|
||||
EXTERN void Tcl_GetVariableFullName(Tcl_Interp *interp,
|
||||
Tcl_Var variable, Tcl_Obj *objPtr);
|
||||
/* 127 */
|
||||
EXTERN int TclImport(Tcl_Interp *interp, Tcl_Namespace *nsPtr,
|
||||
const char *pattern, int allowOverwrite);
|
||||
/* Slot 127 is reserved */
|
||||
/* 128 */
|
||||
EXTERN void Tcl_PopCallFrame(Tcl_Interp *interp);
|
||||
/* 129 */
|
||||
@@ -353,9 +302,7 @@ EXTERN void Tcl_SetNamespaceResolvers(
|
||||
Tcl_ResolveCompiledVarProc *compiledVarProc);
|
||||
/* 132 */
|
||||
EXTERN int TclpHasSockets(Tcl_Interp *interp);
|
||||
/* 133 */
|
||||
TCL_DEPRECATED("")
|
||||
struct tm * TclpGetDate(const time_t *time, int useGMT);
|
||||
/* Slot 133 is reserved */
|
||||
/* Slot 134 is reserved */
|
||||
/* Slot 135 is reserved */
|
||||
/* Slot 136 is reserved */
|
||||
@@ -403,12 +350,8 @@ EXTERN void TclRegError(Tcl_Interp *interp, const char *msg,
|
||||
/* 157 */
|
||||
EXTERN Var * TclVarTraceExists(Tcl_Interp *interp,
|
||||
const char *varName);
|
||||
/* 158 */
|
||||
TCL_DEPRECATED("use public Tcl_SetStartupScript()")
|
||||
void TclSetStartupScriptFileName(const char *filename);
|
||||
/* 159 */
|
||||
TCL_DEPRECATED("use public Tcl_GetStartupScript()")
|
||||
const char * TclGetStartupScriptFileName(void);
|
||||
/* Slot 158 is reserved */
|
||||
/* Slot 159 is reserved */
|
||||
/* Slot 160 is reserved */
|
||||
/* 161 */
|
||||
EXTERN int TclChannelTransform(Tcl_Interp *interp,
|
||||
@@ -426,12 +369,8 @@ EXTERN void TclpSetInitialEncodings(void);
|
||||
EXTERN int TclListObjSetElement(Tcl_Interp *interp,
|
||||
Tcl_Obj *listPtr, int index,
|
||||
Tcl_Obj *valuePtr);
|
||||
/* 167 */
|
||||
TCL_DEPRECATED("use public Tcl_SetStartupScript()")
|
||||
void TclSetStartupScriptPath(Tcl_Obj *pathPtr);
|
||||
/* 168 */
|
||||
TCL_DEPRECATED("use public Tcl_GetStartupScript()")
|
||||
Tcl_Obj * TclGetStartupScriptPath(void);
|
||||
/* Slot 167 is reserved */
|
||||
/* Slot 168 is reserved */
|
||||
/* 169 */
|
||||
EXTERN int TclpUtfNcmp2(const char *s1, const char *s2,
|
||||
unsigned long n);
|
||||
@@ -463,19 +402,12 @@ EXTERN void TclCleanupVar(Var *varPtr, Var *arrayPtr);
|
||||
EXTERN void TclVarErrMsg(Tcl_Interp *interp, const char *part1,
|
||||
const char *part2, const char *operation,
|
||||
const char *reason);
|
||||
/* 178 */
|
||||
EXTERN void TclSetStartupScript(Tcl_Obj *pathPtr,
|
||||
const char *encodingName);
|
||||
/* 179 */
|
||||
EXTERN Tcl_Obj * TclGetStartupScript(const char **encodingNamePtr);
|
||||
/* Slot 178 is reserved */
|
||||
/* Slot 179 is reserved */
|
||||
/* Slot 180 is reserved */
|
||||
/* Slot 181 is reserved */
|
||||
/* 182 */
|
||||
TCL_DEPRECATED("")
|
||||
struct tm * TclpLocaltime(const time_t *clock);
|
||||
/* 183 */
|
||||
TCL_DEPRECATED("")
|
||||
struct tm * TclpGmtime(const time_t *clock);
|
||||
/* Slot 182 is reserved */
|
||||
/* Slot 183 is reserved */
|
||||
/* Slot 184 is reserved */
|
||||
/* Slot 185 is reserved */
|
||||
/* Slot 186 is reserved */
|
||||
@@ -578,9 +510,7 @@ EXTERN Var * TclVarHashCreateVar(TclVarHashTable *tablePtr,
|
||||
/* 235 */
|
||||
EXTERN void TclInitVarHashTable(TclVarHashTable *tablePtr,
|
||||
Namespace *nsPtr);
|
||||
/* 236 */
|
||||
TCL_DEPRECATED("use Tcl_BackgroundException")
|
||||
void TclBackgroundException(Tcl_Interp *interp, int code);
|
||||
/* Slot 236 is reserved */
|
||||
/* 237 */
|
||||
EXTERN int TclResetCancellation(Tcl_Interp *interp, int force);
|
||||
/* 238 */
|
||||
@@ -662,7 +592,7 @@ typedef struct TclIntStubs {
|
||||
int (*tclCleanupChildren) (Tcl_Interp *interp, int numPids, Tcl_Pid *pidPtr, Tcl_Channel errorChan); /* 5 */
|
||||
void (*tclCleanupCommand) (Command *cmdPtr); /* 6 */
|
||||
int (*tclCopyAndCollapse) (int count, const char *src, char *dst); /* 7 */
|
||||
TCL_DEPRECATED_API("") int (*tclCopyChannelOld) (Tcl_Interp *interp, Tcl_Channel inChan, Tcl_Channel outChan, int toRead, Tcl_Obj *cmdPtr); /* 8 */
|
||||
void (*reserved8)(void);
|
||||
int (*tclCreatePipeline) (Tcl_Interp *interp, int 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 */
|
||||
@@ -696,7 +626,7 @@ typedef struct TclIntStubs {
|
||||
TclObjCmdProcType (*tclGetObjInterpProc) (void); /* 39 */
|
||||
int (*tclGetOpenMode) (Tcl_Interp *interp, const char *str, int *seekFlagPtr); /* 40 */
|
||||
Tcl_Command (*tclGetOriginalCommand) (Tcl_Command command); /* 41 */
|
||||
CONST86 char * (*tclpGetUserHome) (const char *name, Tcl_DString *bufferPtr); /* 42 */
|
||||
const char * (*tclpGetUserHome) (const char *name, Tcl_DString *bufferPtr); /* 42 */
|
||||
void (*reserved43)(void);
|
||||
int (*tclGuessPackageName) (const char *fileName, Tcl_DString *bufPtr); /* 44 */
|
||||
int (*tclHideUnsafeCommands) (Tcl_Interp *interp); /* 45 */
|
||||
@@ -731,7 +661,7 @@ typedef struct TclIntStubs {
|
||||
void (*tclpFree) (char *ptr); /* 74 */
|
||||
unsigned long (*tclpGetClicks) (void); /* 75 */
|
||||
unsigned long (*tclpGetSeconds) (void); /* 76 */
|
||||
TCL_DEPRECATED_API("") void (*tclpGetTime) (Tcl_Time *time); /* 77 */
|
||||
void (*reserved77)(void);
|
||||
void (*reserved78)(void);
|
||||
void (*reserved79)(void);
|
||||
void (*reserved80)(void);
|
||||
@@ -742,7 +672,7 @@ typedef struct TclIntStubs {
|
||||
void (*reserved85)(void);
|
||||
void (*reserved86)(void);
|
||||
void (*reserved87)(void);
|
||||
TCL_DEPRECATED_API("") char * (*tclPrecTraceProc) (ClientData clientData, Tcl_Interp *interp, const char *name1, const char *name2, int flags); /* 88 */
|
||||
void (*reserved88)(void);
|
||||
int (*tclPreventAliasLoop) (Tcl_Interp *interp, Tcl_Interp *cmdInterp, Tcl_Command cmd); /* 89 */
|
||||
void (*reserved90)(void);
|
||||
void (*tclProcCleanupProc) (Proc *procPtr); /* 91 */
|
||||
@@ -755,10 +685,10 @@ typedef struct TclIntStubs {
|
||||
int (*tclServiceIdle) (void); /* 98 */
|
||||
void (*reserved99)(void);
|
||||
void (*reserved100)(void);
|
||||
CONST86 char * (*tclSetPreInitScript) (const char *string); /* 101 */
|
||||
const char * (*tclSetPreInitScript) (const char *string); /* 101 */
|
||||
void (*tclSetupEnv) (Tcl_Interp *interp); /* 102 */
|
||||
int (*tclSockGetPort) (Tcl_Interp *interp, const char *str, const char *proto, int *portPtr); /* 103 */
|
||||
TCL_DEPRECATED_API("") int (*tclSockMinimumBuffersOld) (int sock, int size); /* 104 */
|
||||
void (*reserved104)(void);
|
||||
void (*reserved105)(void);
|
||||
void (*reserved106)(void);
|
||||
void (*reserved107)(void);
|
||||
@@ -766,28 +696,28 @@ typedef struct TclIntStubs {
|
||||
int (*tclUpdateReturnInfo) (Interp *iPtr); /* 109 */
|
||||
int (*tclSockMinimumBuffers) (void *sock, int size); /* 110 */
|
||||
void (*tcl_AddInterpResolvers) (Tcl_Interp *interp, const char *name, Tcl_ResolveCmdProc *cmdProc, Tcl_ResolveVarProc *varProc, Tcl_ResolveCompiledVarProc *compiledVarProc); /* 111 */
|
||||
int (*tclAppendExportList) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, Tcl_Obj *objPtr); /* 112 */
|
||||
Tcl_Namespace * (*tclCreateNamespace) (Tcl_Interp *interp, const char *name, ClientData clientData, Tcl_NamespaceDeleteProc *deleteProc); /* 113 */
|
||||
void (*tclDeleteNamespace) (Tcl_Namespace *nsPtr); /* 114 */
|
||||
int (*tclExport) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int resetListFirst); /* 115 */
|
||||
Tcl_Command (*tclFindCommand) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 116 */
|
||||
Tcl_Namespace * (*tclFindNamespace) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 117 */
|
||||
void (*reserved112)(void);
|
||||
void (*reserved113)(void);
|
||||
void (*reserved114)(void);
|
||||
void (*reserved115)(void);
|
||||
void (*reserved116)(void);
|
||||
void (*reserved117)(void);
|
||||
int (*tcl_GetInterpResolvers) (Tcl_Interp *interp, const char *name, Tcl_ResolverInfo *resInfo); /* 118 */
|
||||
int (*tcl_GetNamespaceResolvers) (Tcl_Namespace *namespacePtr, Tcl_ResolverInfo *resInfo); /* 119 */
|
||||
Tcl_Var (*tcl_FindNamespaceVar) (Tcl_Interp *interp, const char *name, Tcl_Namespace *contextNsPtr, int flags); /* 120 */
|
||||
int (*tclForgetImport) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern); /* 121 */
|
||||
Tcl_Command (*tclGetCommandFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 122 */
|
||||
void (*tclGetCommandFullName) (Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 123 */
|
||||
Tcl_Namespace * (*tclGetCurrentNamespace_) (Tcl_Interp *interp); /* 124 */
|
||||
Tcl_Namespace * (*tclGetGlobalNamespace_) (Tcl_Interp *interp); /* 125 */
|
||||
void (*reserved121)(void);
|
||||
void (*reserved122)(void);
|
||||
void (*reserved123)(void);
|
||||
void (*reserved124)(void);
|
||||
void (*reserved125)(void);
|
||||
void (*tcl_GetVariableFullName) (Tcl_Interp *interp, Tcl_Var variable, Tcl_Obj *objPtr); /* 126 */
|
||||
int (*tclImport) (Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char *pattern, int allowOverwrite); /* 127 */
|
||||
void (*reserved127)(void);
|
||||
void (*tcl_PopCallFrame) (Tcl_Interp *interp); /* 128 */
|
||||
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 */
|
||||
TCL_DEPRECATED_API("") struct tm * (*tclpGetDate) (const time_t *time, int useGMT); /* 133 */
|
||||
void (*reserved133)(void);
|
||||
void (*reserved134)(void);
|
||||
void (*reserved135)(void);
|
||||
void (*reserved136)(void);
|
||||
@@ -812,8 +742,8 @@ typedef struct TclIntStubs {
|
||||
void (*reserved155)(void);
|
||||
void (*tclRegError) (Tcl_Interp *interp, const char *msg, int status); /* 156 */
|
||||
Var * (*tclVarTraceExists) (Tcl_Interp *interp, const char *varName); /* 157 */
|
||||
TCL_DEPRECATED_API("use public Tcl_SetStartupScript()") void (*tclSetStartupScriptFileName) (const char *filename); /* 158 */
|
||||
TCL_DEPRECATED_API("use public Tcl_GetStartupScript()") const char * (*tclGetStartupScriptFileName) (void); /* 159 */
|
||||
void (*reserved158)(void);
|
||||
void (*reserved159)(void);
|
||||
void (*reserved160)(void);
|
||||
int (*tclChannelTransform) (Tcl_Interp *interp, Tcl_Channel chan, Tcl_Obj *cmdObjPtr); /* 161 */
|
||||
void (*tclChannelEventScriptInvoker) (ClientData clientData, int flags); /* 162 */
|
||||
@@ -821,8 +751,8 @@ typedef struct TclIntStubs {
|
||||
void (*tclExpandCodeArray) (void *envPtr); /* 164 */
|
||||
void (*tclpSetInitialEncodings) (void); /* 165 */
|
||||
int (*tclListObjSetElement) (Tcl_Interp *interp, Tcl_Obj *listPtr, int index, Tcl_Obj *valuePtr); /* 166 */
|
||||
TCL_DEPRECATED_API("use public Tcl_SetStartupScript()") void (*tclSetStartupScriptPath) (Tcl_Obj *pathPtr); /* 167 */
|
||||
TCL_DEPRECATED_API("use public Tcl_GetStartupScript()") Tcl_Obj * (*tclGetStartupScriptPath) (void); /* 168 */
|
||||
void (*reserved167)(void);
|
||||
void (*reserved168)(void);
|
||||
int (*tclpUtfNcmp2) (const char *s1, const char *s2, unsigned long n); /* 169 */
|
||||
int (*tclCheckInterpTraces) (Tcl_Interp *interp, const char *command, int numChars, Command *cmdPtr, int result, int traceFlags, int objc, Tcl_Obj *const objv[]); /* 170 */
|
||||
int (*tclCheckExecutionTraces) (Tcl_Interp *interp, const char *command, int numChars, Command *cmdPtr, int result, int traceFlags, int objc, Tcl_Obj *const objv[]); /* 171 */
|
||||
@@ -832,12 +762,12 @@ typedef struct TclIntStubs {
|
||||
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 */
|
||||
void (*tclVarErrMsg) (Tcl_Interp *interp, const char *part1, const char *part2, const char *operation, const char *reason); /* 177 */
|
||||
void (*tclSetStartupScript) (Tcl_Obj *pathPtr, const char *encodingName); /* 178 */
|
||||
Tcl_Obj * (*tclGetStartupScript) (const char **encodingNamePtr); /* 179 */
|
||||
void (*reserved178)(void);
|
||||
void (*reserved179)(void);
|
||||
void (*reserved180)(void);
|
||||
void (*reserved181)(void);
|
||||
TCL_DEPRECATED_API("") struct tm * (*tclpLocaltime) (const time_t *clock); /* 182 */
|
||||
TCL_DEPRECATED_API("") struct tm * (*tclpGmtime) (const time_t *clock); /* 183 */
|
||||
void (*reserved182)(void);
|
||||
void (*reserved183)(void);
|
||||
void (*reserved184)(void);
|
||||
void (*reserved185)(void);
|
||||
void (*reserved186)(void);
|
||||
@@ -890,7 +820,7 @@ typedef struct TclIntStubs {
|
||||
void (*tclGetSrcInfoForPc) (CmdFrame *contextPtr); /* 233 */
|
||||
Var * (*tclVarHashCreateVar) (TclVarHashTable *tablePtr, const char *key, int *newPtr); /* 234 */
|
||||
void (*tclInitVarHashTable) (TclVarHashTable *tablePtr, Namespace *nsPtr); /* 235 */
|
||||
TCL_DEPRECATED_API("use Tcl_BackgroundException") void (*tclBackgroundException) (Tcl_Interp *interp, int code); /* 236 */
|
||||
void (*reserved236)(void);
|
||||
int (*tclResetCancellation) (Tcl_Interp *interp, int force); /* 237 */
|
||||
int (*tclNRInterpProc) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 238 */
|
||||
int (*tclNRInterpProcCore) (Tcl_Interp *interp, Tcl_Obj *procNameObj, int skip, ProcErrorProc *errorProc); /* 239 */
|
||||
@@ -937,8 +867,7 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
(tclIntStubsPtr->tclCleanupCommand) /* 6 */
|
||||
#define TclCopyAndCollapse \
|
||||
(tclIntStubsPtr->tclCopyAndCollapse) /* 7 */
|
||||
#define TclCopyChannelOld \
|
||||
(tclIntStubsPtr->tclCopyChannelOld) /* 8 */
|
||||
/* Slot 8 is reserved */
|
||||
#define TclCreatePipeline \
|
||||
(tclIntStubsPtr->tclCreatePipeline) /* 9 */
|
||||
#define TclCreateProc \
|
||||
@@ -1045,8 +974,7 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
(tclIntStubsPtr->tclpGetClicks) /* 75 */
|
||||
#define TclpGetSeconds \
|
||||
(tclIntStubsPtr->tclpGetSeconds) /* 76 */
|
||||
#define TclpGetTime \
|
||||
(tclIntStubsPtr->tclpGetTime) /* 77 */
|
||||
/* Slot 77 is reserved */
|
||||
/* Slot 78 is reserved */
|
||||
/* Slot 79 is reserved */
|
||||
/* Slot 80 is reserved */
|
||||
@@ -1058,8 +986,7 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
/* Slot 85 is reserved */
|
||||
/* Slot 86 is reserved */
|
||||
/* Slot 87 is reserved */
|
||||
#define TclPrecTraceProc \
|
||||
(tclIntStubsPtr->tclPrecTraceProc) /* 88 */
|
||||
/* Slot 88 is reserved */
|
||||
#define TclPreventAliasLoop \
|
||||
(tclIntStubsPtr->tclPreventAliasLoop) /* 89 */
|
||||
/* Slot 90 is reserved */
|
||||
@@ -1085,8 +1012,7 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
(tclIntStubsPtr->tclSetupEnv) /* 102 */
|
||||
#define TclSockGetPort \
|
||||
(tclIntStubsPtr->tclSockGetPort) /* 103 */
|
||||
#define TclSockMinimumBuffersOld \
|
||||
(tclIntStubsPtr->tclSockMinimumBuffersOld) /* 104 */
|
||||
/* Slot 104 is reserved */
|
||||
/* Slot 105 is reserved */
|
||||
/* Slot 106 is reserved */
|
||||
/* Slot 107 is reserved */
|
||||
@@ -1098,38 +1024,26 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
(tclIntStubsPtr->tclSockMinimumBuffers) /* 110 */
|
||||
#define Tcl_AddInterpResolvers \
|
||||
(tclIntStubsPtr->tcl_AddInterpResolvers) /* 111 */
|
||||
#define TclAppendExportList \
|
||||
(tclIntStubsPtr->tclAppendExportList) /* 112 */
|
||||
#define TclCreateNamespace \
|
||||
(tclIntStubsPtr->tclCreateNamespace) /* 113 */
|
||||
#define TclDeleteNamespace \
|
||||
(tclIntStubsPtr->tclDeleteNamespace) /* 114 */
|
||||
#define TclExport \
|
||||
(tclIntStubsPtr->tclExport) /* 115 */
|
||||
#define TclFindCommand \
|
||||
(tclIntStubsPtr->tclFindCommand) /* 116 */
|
||||
#define TclFindNamespace \
|
||||
(tclIntStubsPtr->tclFindNamespace) /* 117 */
|
||||
/* Slot 112 is reserved */
|
||||
/* Slot 113 is reserved */
|
||||
/* Slot 114 is reserved */
|
||||
/* Slot 115 is reserved */
|
||||
/* Slot 116 is reserved */
|
||||
/* Slot 117 is reserved */
|
||||
#define Tcl_GetInterpResolvers \
|
||||
(tclIntStubsPtr->tcl_GetInterpResolvers) /* 118 */
|
||||
#define Tcl_GetNamespaceResolvers \
|
||||
(tclIntStubsPtr->tcl_GetNamespaceResolvers) /* 119 */
|
||||
#define Tcl_FindNamespaceVar \
|
||||
(tclIntStubsPtr->tcl_FindNamespaceVar) /* 120 */
|
||||
#define TclForgetImport \
|
||||
(tclIntStubsPtr->tclForgetImport) /* 121 */
|
||||
#define TclGetCommandFromObj \
|
||||
(tclIntStubsPtr->tclGetCommandFromObj) /* 122 */
|
||||
#define TclGetCommandFullName \
|
||||
(tclIntStubsPtr->tclGetCommandFullName) /* 123 */
|
||||
#define TclGetCurrentNamespace_ \
|
||||
(tclIntStubsPtr->tclGetCurrentNamespace_) /* 124 */
|
||||
#define TclGetGlobalNamespace_ \
|
||||
(tclIntStubsPtr->tclGetGlobalNamespace_) /* 125 */
|
||||
/* Slot 121 is reserved */
|
||||
/* Slot 122 is reserved */
|
||||
/* Slot 123 is reserved */
|
||||
/* Slot 124 is reserved */
|
||||
/* Slot 125 is reserved */
|
||||
#define Tcl_GetVariableFullName \
|
||||
(tclIntStubsPtr->tcl_GetVariableFullName) /* 126 */
|
||||
#define TclImport \
|
||||
(tclIntStubsPtr->tclImport) /* 127 */
|
||||
/* Slot 127 is reserved */
|
||||
#define Tcl_PopCallFrame \
|
||||
(tclIntStubsPtr->tcl_PopCallFrame) /* 128 */
|
||||
#define Tcl_PushCallFrame \
|
||||
@@ -1140,8 +1054,7 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
(tclIntStubsPtr->tcl_SetNamespaceResolvers) /* 131 */
|
||||
#define TclpHasSockets \
|
||||
(tclIntStubsPtr->tclpHasSockets) /* 132 */
|
||||
#define TclpGetDate \
|
||||
(tclIntStubsPtr->tclpGetDate) /* 133 */
|
||||
/* Slot 133 is reserved */
|
||||
/* Slot 134 is reserved */
|
||||
/* Slot 135 is reserved */
|
||||
/* Slot 136 is reserved */
|
||||
@@ -1182,10 +1095,8 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
(tclIntStubsPtr->tclRegError) /* 156 */
|
||||
#define TclVarTraceExists \
|
||||
(tclIntStubsPtr->tclVarTraceExists) /* 157 */
|
||||
#define TclSetStartupScriptFileName \
|
||||
(tclIntStubsPtr->tclSetStartupScriptFileName) /* 158 */
|
||||
#define TclGetStartupScriptFileName \
|
||||
(tclIntStubsPtr->tclGetStartupScriptFileName) /* 159 */
|
||||
/* Slot 158 is reserved */
|
||||
/* Slot 159 is reserved */
|
||||
/* Slot 160 is reserved */
|
||||
#define TclChannelTransform \
|
||||
(tclIntStubsPtr->tclChannelTransform) /* 161 */
|
||||
@@ -1199,10 +1110,8 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
(tclIntStubsPtr->tclpSetInitialEncodings) /* 165 */
|
||||
#define TclListObjSetElement \
|
||||
(tclIntStubsPtr->tclListObjSetElement) /* 166 */
|
||||
#define TclSetStartupScriptPath \
|
||||
(tclIntStubsPtr->tclSetStartupScriptPath) /* 167 */
|
||||
#define TclGetStartupScriptPath \
|
||||
(tclIntStubsPtr->tclGetStartupScriptPath) /* 168 */
|
||||
/* Slot 167 is reserved */
|
||||
/* Slot 168 is reserved */
|
||||
#define TclpUtfNcmp2 \
|
||||
(tclIntStubsPtr->tclpUtfNcmp2) /* 169 */
|
||||
#define TclCheckInterpTraces \
|
||||
@@ -1220,16 +1129,12 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
(tclIntStubsPtr->tclCleanupVar) /* 176 */
|
||||
#define TclVarErrMsg \
|
||||
(tclIntStubsPtr->tclVarErrMsg) /* 177 */
|
||||
#define TclSetStartupScript \
|
||||
(tclIntStubsPtr->tclSetStartupScript) /* 178 */
|
||||
#define TclGetStartupScript \
|
||||
(tclIntStubsPtr->tclGetStartupScript) /* 179 */
|
||||
/* Slot 178 is reserved */
|
||||
/* Slot 179 is reserved */
|
||||
/* Slot 180 is reserved */
|
||||
/* Slot 181 is reserved */
|
||||
#define TclpLocaltime \
|
||||
(tclIntStubsPtr->tclpLocaltime) /* 182 */
|
||||
#define TclpGmtime \
|
||||
(tclIntStubsPtr->tclpGmtime) /* 183 */
|
||||
/* Slot 182 is reserved */
|
||||
/* Slot 183 is reserved */
|
||||
/* Slot 184 is reserved */
|
||||
/* Slot 185 is reserved */
|
||||
/* Slot 186 is reserved */
|
||||
@@ -1310,8 +1215,7 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
(tclIntStubsPtr->tclVarHashCreateVar) /* 234 */
|
||||
#define TclInitVarHashTable \
|
||||
(tclIntStubsPtr->tclInitVarHashTable) /* 235 */
|
||||
#define TclBackgroundException \
|
||||
(tclIntStubsPtr->tclBackgroundException) /* 236 */
|
||||
/* Slot 236 is reserved */
|
||||
#define TclResetCancellation \
|
||||
(tclIntStubsPtr->tclResetCancellation) /* 237 */
|
||||
#define TclNRInterpProc \
|
||||
@@ -1360,28 +1264,4 @@ extern const TclIntStubs *tclIntStubsPtr;
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLIMPORT
|
||||
|
||||
#if defined(USE_TCL_STUBS)
|
||||
# undef TclGetStartupScriptFileName
|
||||
# undef TclSetStartupScriptFileName
|
||||
# undef TclGetStartupScriptPath
|
||||
# undef TclSetStartupScriptPath
|
||||
# undef TclBackgroundException
|
||||
# undef TclSetStartupScript
|
||||
# undef TclGetStartupScript
|
||||
# undef TclCreateNamespace
|
||||
# undef TclDeleteNamespace
|
||||
# undef TclAppendExportList
|
||||
# undef TclExport
|
||||
# undef TclImport
|
||||
# undef TclForgetImport
|
||||
# undef TclGetCurrentNamespace_
|
||||
# undef TclGetGlobalNamespace_
|
||||
# undef TclFindNamespace
|
||||
# undef TclFindCommand
|
||||
# undef TclGetCommandFromObj
|
||||
# undef TclGetCommandFullName
|
||||
# undef TclCopyChannelOld
|
||||
# undef TclSockMinimumBuffersOld
|
||||
#endif
|
||||
|
||||
#endif /* _TCLINTDECLS */
|
||||
|
||||
+55
-116
@@ -71,14 +71,10 @@ EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
||||
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
|
||||
/* 9 */
|
||||
EXTERN TclFile TclpCreateTempFile(const char *contents);
|
||||
/* 10 */
|
||||
EXTERN Tcl_DirEntry * TclpReaddir(DIR *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);
|
||||
/* Slot 10 is reserved */
|
||||
/* Slot 11 is reserved */
|
||||
/* Slot 12 is reserved */
|
||||
/* Slot 13 is reserved */
|
||||
/* 14 */
|
||||
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr,
|
||||
@@ -107,29 +103,19 @@ EXTERN int TclUnixOpenTemporaryFile(Tcl_Obj *dirObj,
|
||||
#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);
|
||||
/* Slot 1 is reserved */
|
||||
/* Slot 2 is reserved */
|
||||
/* Slot 3 is reserved */
|
||||
/* 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);
|
||||
/* Slot 6 is reserved */
|
||||
/* Slot 7 is reserved */
|
||||
/* 8 */
|
||||
EXTERN int TclpGetPid(Tcl_Pid pid);
|
||||
/* 9 */
|
||||
EXTERN int TclWinGetPlatformId(void);
|
||||
/* 10 */
|
||||
EXTERN Tcl_DirEntry * TclpReaddir(DIR *dir);
|
||||
/* Slot 9 is reserved */
|
||||
/* Slot 10 is reserved */
|
||||
/* 11 */
|
||||
EXTERN void TclGetAndDetachPids(Tcl_Interp *interp,
|
||||
Tcl_Channel chan);
|
||||
@@ -158,20 +144,17 @@ EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction);
|
||||
EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
||||
/* 20 */
|
||||
EXTERN void TclWinAddProcess(HANDLE hProcess, DWORD id);
|
||||
/* 21 */
|
||||
EXTERN char * TclpInetNtoa(struct in_addr addr);
|
||||
/* Slot 21 is reserved */
|
||||
/* 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);
|
||||
/* Slot 26 is reserved */
|
||||
/* 27 */
|
||||
EXTERN void TclWinFlushDirtyChannels(void);
|
||||
/* 28 */
|
||||
EXTERN void TclWinResetInterfaces(void);
|
||||
/* Slot 28 is reserved */
|
||||
/* 29 */
|
||||
EXTERN int TclWinCPUID(int index, int *regs);
|
||||
/* 30 */
|
||||
@@ -205,14 +188,10 @@ EXTERN TclFile TclpOpenFile(const char *fname, int mode);
|
||||
EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout);
|
||||
/* 9 */
|
||||
EXTERN TclFile TclpCreateTempFile(const char *contents);
|
||||
/* 10 */
|
||||
EXTERN Tcl_DirEntry * TclpReaddir(DIR *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);
|
||||
/* Slot 10 is reserved */
|
||||
/* Slot 11 is reserved */
|
||||
/* Slot 12 is reserved */
|
||||
/* Slot 13 is reserved */
|
||||
/* 14 */
|
||||
EXTERN int TclUnixCopyFile(const char *src, const char *dst,
|
||||
const Tcl_StatBuf *statBufPtr,
|
||||
@@ -269,10 +248,10 @@ typedef struct TclIntPlatStubs {
|
||||
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
|
||||
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
|
||||
TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
|
||||
Tcl_DirEntry * (*tclpReaddir) (DIR *dir); /* 10 */
|
||||
struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */
|
||||
struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */
|
||||
char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
|
||||
void (*reserved10)(void);
|
||||
void (*reserved11)(void);
|
||||
void (*reserved12)(void);
|
||||
void (*reserved13)(void);
|
||||
int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 14 */
|
||||
void (*reserved15)(void);
|
||||
void (*reserved16)(void);
|
||||
@@ -293,16 +272,16 @@ typedef struct TclIntPlatStubs {
|
||||
#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 */
|
||||
void (*reserved1)(void);
|
||||
void (*reserved2)(void);
|
||||
void (*reserved3)(void);
|
||||
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 */
|
||||
void (*reserved6)(void);
|
||||
void (*reserved7)(void);
|
||||
int (*tclpGetPid) (Tcl_Pid pid); /* 8 */
|
||||
int (*tclWinGetPlatformId) (void); /* 9 */
|
||||
Tcl_DirEntry * (*tclpReaddir) (DIR *dir); /* 10 */
|
||||
void (*reserved9)(void);
|
||||
void (*reserved10)(void);
|
||||
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 */
|
||||
@@ -313,14 +292,14 @@ typedef struct TclIntPlatStubs {
|
||||
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 */
|
||||
void (*reserved21)(void);
|
||||
TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */
|
||||
void (*reserved23)(void);
|
||||
char * (*tclWinNoBackslash) (char *path); /* 24 */
|
||||
void (*reserved25)(void);
|
||||
void (*tclWinSetInterfaces) (int wide); /* 26 */
|
||||
void (*reserved26)(void);
|
||||
void (*tclWinFlushDirtyChannels) (void); /* 27 */
|
||||
void (*tclWinResetInterfaces) (void); /* 28 */
|
||||
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 /* WIN */
|
||||
@@ -335,10 +314,10 @@ typedef struct TclIntPlatStubs {
|
||||
TclFile (*tclpOpenFile) (const char *fname, int mode); /* 7 */
|
||||
int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 8 */
|
||||
TclFile (*tclpCreateTempFile) (const char *contents); /* 9 */
|
||||
Tcl_DirEntry * (*tclpReaddir) (DIR *dir); /* 10 */
|
||||
struct tm * (*tclpLocaltime_unix) (const time_t *clock); /* 11 */
|
||||
struct tm * (*tclpGmtime_unix) (const time_t *clock); /* 12 */
|
||||
char * (*tclpInetNtoa) (struct in_addr addr); /* 13 */
|
||||
void (*reserved10)(void);
|
||||
void (*reserved11)(void);
|
||||
void (*reserved12)(void);
|
||||
void (*reserved13)(void);
|
||||
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 */
|
||||
@@ -391,14 +370,10 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
|
||||
(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 */
|
||||
/* Slot 10 is reserved */
|
||||
/* Slot 11 is reserved */
|
||||
/* Slot 12 is reserved */
|
||||
/* Slot 13 is reserved */
|
||||
#define TclUnixCopyFile \
|
||||
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
|
||||
/* Slot 15 is reserved */
|
||||
@@ -423,26 +398,19 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
|
||||
#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 */
|
||||
/* Slot 1 is reserved */
|
||||
/* Slot 2 is reserved */
|
||||
/* Slot 3 is reserved */
|
||||
#define TclWinGetTclInstance \
|
||||
(tclIntPlatStubsPtr->tclWinGetTclInstance) /* 4 */
|
||||
#define TclUnixWaitForFile \
|
||||
(tclIntPlatStubsPtr->tclUnixWaitForFile) /* 5 */
|
||||
#define TclWinNToHS \
|
||||
(tclIntPlatStubsPtr->tclWinNToHS) /* 6 */
|
||||
#define TclWinSetSockOpt \
|
||||
(tclIntPlatStubsPtr->tclWinSetSockOpt) /* 7 */
|
||||
/* Slot 6 is reserved */
|
||||
/* Slot 7 is reserved */
|
||||
#define TclpGetPid \
|
||||
(tclIntPlatStubsPtr->tclpGetPid) /* 8 */
|
||||
#define TclWinGetPlatformId \
|
||||
(tclIntPlatStubsPtr->tclWinGetPlatformId) /* 9 */
|
||||
#define TclpReaddir \
|
||||
(tclIntPlatStubsPtr->tclpReaddir) /* 10 */
|
||||
/* Slot 9 is reserved */
|
||||
/* Slot 10 is reserved */
|
||||
#define TclGetAndDetachPids \
|
||||
(tclIntPlatStubsPtr->tclGetAndDetachPids) /* 11 */
|
||||
#define TclpCloseFile \
|
||||
@@ -463,20 +431,17 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
|
||||
(tclIntPlatStubsPtr->tclpOpenFile) /* 19 */
|
||||
#define TclWinAddProcess \
|
||||
(tclIntPlatStubsPtr->tclWinAddProcess) /* 20 */
|
||||
#define TclpInetNtoa \
|
||||
(tclIntPlatStubsPtr->tclpInetNtoa) /* 21 */
|
||||
/* Slot 21 is reserved */
|
||||
#define TclpCreateTempFile \
|
||||
(tclIntPlatStubsPtr->tclpCreateTempFile) /* 22 */
|
||||
/* Slot 23 is reserved */
|
||||
#define TclWinNoBackslash \
|
||||
(tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */
|
||||
/* Slot 25 is reserved */
|
||||
#define TclWinSetInterfaces \
|
||||
(tclIntPlatStubsPtr->tclWinSetInterfaces) /* 26 */
|
||||
/* Slot 26 is reserved */
|
||||
#define TclWinFlushDirtyChannels \
|
||||
(tclIntPlatStubsPtr->tclWinFlushDirtyChannels) /* 27 */
|
||||
#define TclWinResetInterfaces \
|
||||
(tclIntPlatStubsPtr->tclWinResetInterfaces) /* 28 */
|
||||
/* Slot 28 is reserved */
|
||||
#define TclWinCPUID \
|
||||
(tclIntPlatStubsPtr->tclWinCPUID) /* 29 */
|
||||
#define TclUnixOpenTemporaryFile \
|
||||
@@ -502,14 +467,10 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
|
||||
(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 */
|
||||
/* Slot 10 is reserved */
|
||||
/* Slot 11 is reserved */
|
||||
/* Slot 12 is reserved */
|
||||
/* Slot 13 is reserved */
|
||||
#define TclUnixCopyFile \
|
||||
(tclIntPlatStubsPtr->tclUnixCopyFile) /* 14 */
|
||||
#define TclMacOSXGetFileAttribute \
|
||||
@@ -543,31 +504,9 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLIMPORT
|
||||
#undef TclpLocaltime_unix
|
||||
#undef TclpGmtime_unix
|
||||
#undef TclWinConvertWSAError
|
||||
#define TclWinConvertWSAError TclWinConvertError
|
||||
#undef TclpInetNtoa
|
||||
#define TclpInetNtoa inet_ntoa
|
||||
|
||||
#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
|
||||
#if !defined(_WIN32)
|
||||
# undef TclpGetPid
|
||||
# define TclpGetPid(pid) ((unsigned long) (pid))
|
||||
#endif
|
||||
|
||||
+9
-9
@@ -25,14 +25,14 @@ static const char *tclPreInitScript = NULL;
|
||||
struct Target;
|
||||
|
||||
/*
|
||||
* struct Alias:
|
||||
* Alias:
|
||||
*
|
||||
* Stores information about an alias. Is stored in the slave interpreter and
|
||||
* used by the source command to find the target command in the master when
|
||||
* the source command is invoked.
|
||||
*/
|
||||
|
||||
typedef struct Alias {
|
||||
typedef struct {
|
||||
Tcl_Obj *token; /* Token for the alias command in the slave
|
||||
* interp. This used to be the command name in
|
||||
* the slave when the alias was first
|
||||
@@ -66,14 +66,14 @@ typedef struct Alias {
|
||||
|
||||
/*
|
||||
*
|
||||
* struct Slave:
|
||||
* Slave:
|
||||
*
|
||||
* Used by the "interp" command to record and find information about slave
|
||||
* interpreters. Maps from a command name in the master to information about a
|
||||
* slave interpreter, e.g. what aliases are defined in it.
|
||||
*/
|
||||
|
||||
typedef struct Slave {
|
||||
typedef struct {
|
||||
Tcl_Interp *masterInterp; /* Master interpreter for this slave. */
|
||||
Tcl_HashEntry *slaveEntryPtr;
|
||||
/* Hash entry in masters slave table for this
|
||||
@@ -112,7 +112,7 @@ typedef struct Target {
|
||||
} Target;
|
||||
|
||||
/*
|
||||
* struct Master:
|
||||
* Master:
|
||||
*
|
||||
* This record is used for two purposes: First, slaveTable (a hashtable) maps
|
||||
* from names of commands to slave interpreters. This hashtable is used to
|
||||
@@ -127,7 +127,7 @@ typedef struct Target {
|
||||
* only load safe extensions.
|
||||
*/
|
||||
|
||||
typedef struct Master {
|
||||
typedef struct {
|
||||
Tcl_HashTable slaveTable; /* Hash table for slave interpreters. Maps
|
||||
* from command names to Slave records. */
|
||||
Target *targetsPtr; /* The head of a doubly-linked list of all the
|
||||
@@ -144,7 +144,7 @@ typedef struct Master {
|
||||
* on a per-interp basis.
|
||||
*/
|
||||
|
||||
typedef struct InterpInfo {
|
||||
typedef struct {
|
||||
Master master; /* Keeps track of all interps for which this
|
||||
* interp is the Master. */
|
||||
Slave slave; /* Information necessary for this interp to
|
||||
@@ -158,7 +158,7 @@ typedef struct InterpInfo {
|
||||
* likely to work properly on 64-bit architectures.
|
||||
*/
|
||||
|
||||
typedef struct ScriptLimitCallback {
|
||||
typedef struct {
|
||||
Tcl_Interp *interp; /* The interpreter in which to execute the
|
||||
* callback. */
|
||||
Tcl_Obj *scriptObj; /* The script to execute to perform the
|
||||
@@ -171,7 +171,7 @@ typedef struct ScriptLimitCallback {
|
||||
* table. */
|
||||
} ScriptLimitCallback;
|
||||
|
||||
typedef struct ScriptLimitCallbackKey {
|
||||
typedef struct {
|
||||
Tcl_Interp *interp; /* The interpreter that the limit callback was
|
||||
* attached to. This is not the interpreter
|
||||
* that the callback runs in! */
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
* variable.
|
||||
*/
|
||||
|
||||
typedef struct Link {
|
||||
typedef struct {
|
||||
Tcl_Interp *interp; /* Interpreter containing Tcl variable. */
|
||||
Tcl_Obj *varName; /* Name of variable (must be global). This is
|
||||
* needed during trace callbacks, since the
|
||||
|
||||
+275
-298
@@ -55,20 +55,22 @@ const Tcl_ObjType tclListType = {
|
||||
*
|
||||
* NewListIntRep --
|
||||
*
|
||||
* Creates a list internal rep with space for objc elements. objc
|
||||
* must be > 0. If objv!=NULL, initializes with the first objc values
|
||||
* in that array. If objv==NULL, initalize list internal rep to have
|
||||
* 0 elements, with space to add objc more. Flag value "p" indicates
|
||||
* Creates a 'List' structure with space for 'objc' elements. 'objc' must
|
||||
* be > 0. If 'objv' is not NULL, The list is initialized with first
|
||||
* 'objc' values in that array. Otherwise the list is initialized to have
|
||||
* 0 elements, with space to add 'objc' more. Flag value 'p' indicates
|
||||
* how to behave on failure.
|
||||
*
|
||||
* Results:
|
||||
* A new List struct with refCount 0 is returned. If some failure
|
||||
* prevents this then if p=0, NULL is returned and otherwise the
|
||||
* routine panics.
|
||||
* Value
|
||||
*
|
||||
* Side effects:
|
||||
* The ref counts of the elements in objv are incremented since the
|
||||
* resulting list now refers to them.
|
||||
* A new 'List' structure with refCount 0. If some failure
|
||||
* prevents this NULL is returned if 'p' is 0 , and 'Tcl_Panic'
|
||||
* is called if it is not.
|
||||
*
|
||||
* Effect
|
||||
*
|
||||
* The refCount of each value in 'objv' is incremented as it is added
|
||||
* to the list.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -132,21 +134,9 @@ NewListIntRep(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* AttemptNewList --
|
||||
* AttemptNewList --
|
||||
*
|
||||
* Creates a list internal rep with space for objc elements. objc
|
||||
* must be > 0. If objv!=NULL, initializes with the first objc values
|
||||
* in that array. If objv==NULL, initalize list internal rep to have
|
||||
* 0 elements, with space to add objc more.
|
||||
*
|
||||
* Results:
|
||||
* A new List struct with refCount 0 is returned. If some failure
|
||||
* prevents this then NULL is returned, and an error message is left
|
||||
* in the interp result, unless interp is NULL.
|
||||
*
|
||||
* Side effects:
|
||||
* The ref counts of the elements in objv are incremented since the
|
||||
* resulting list now refers to them.
|
||||
* Like NewListIntRep, but additionally sets an error message on failure.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -179,23 +169,20 @@ AttemptNewList(
|
||||
*
|
||||
* Tcl_NewListObj --
|
||||
*
|
||||
* This function is normally called when not debugging: i.e., when
|
||||
* TCL_MEM_DEBUG is not defined. It creates a new list object from an
|
||||
* (objc,objv) array: that is, each of the objc elements of the array
|
||||
* referenced by objv is inserted as an element into a new Tcl object.
|
||||
* Creates a new list object and adds values to it. When TCL_MEM_DEBUG is
|
||||
* defined, 'Tcl_DbNewListObj' is called instead.
|
||||
*
|
||||
* When TCL_MEM_DEBUG is defined, this function just returns the result
|
||||
* of calling the debugging version Tcl_DbNewListObj.
|
||||
* Value
|
||||
*
|
||||
* Results:
|
||||
* A new list object is returned that is initialized from the object
|
||||
* pointers in objv. If objc is less than or equal to zero, an empty
|
||||
* object is returned. The new object's string representation is left
|
||||
* NULL. The resulting new list object has ref count 0.
|
||||
* A new list 'Tcl_Obj' to which is appended values from 'objv', or if
|
||||
* 'objc' is less than or equal to zero, a list 'Tcl_Obj' having no
|
||||
* elements. The string representation of the new 'Tcl_Obj' is set to
|
||||
* NULL. The refCount of the list is 0.
|
||||
*
|
||||
* Side effects:
|
||||
* The ref counts of the elements in objv are incremented since the
|
||||
* resulting list now refers to them.
|
||||
* Effect
|
||||
*
|
||||
* The refCount of each elements in 'objv' is incremented as it is added
|
||||
* to the list.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -246,28 +233,14 @@ Tcl_NewListObj(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_DbNewListObj --
|
||||
* Tcl_DbNewListObj --
|
||||
*
|
||||
* This function is normally called when debugging: i.e., when
|
||||
* TCL_MEM_DEBUG is defined. It creates new list objects. It is the same
|
||||
* as the Tcl_NewListObj function above except that it calls
|
||||
* Tcl_DbCkalloc directly with the file name and line number from its
|
||||
* caller. This simplifies debugging since then the [memory active]
|
||||
* command will report the correct file name and line number when
|
||||
* reporting objects that haven't been freed.
|
||||
* Like 'Tcl_NewListObj', but it calls Tcl_DbCkalloc directly with the
|
||||
* file name and line number from its caller. This simplifies debugging
|
||||
* since the [memory active] command will report the correct file
|
||||
* name and line number when reporting objects that haven't been freed.
|
||||
*
|
||||
* When TCL_MEM_DEBUG is not defined, this function just returns the
|
||||
* result of calling Tcl_NewListObj.
|
||||
*
|
||||
* Results:
|
||||
* A new list object is returned that is initialized from the object
|
||||
* pointers in objv. If objc is less than or equal to zero, an empty
|
||||
* object is returned. The new object's string representation is left
|
||||
* NULL. The new list object has ref count 0.
|
||||
*
|
||||
* Side effects:
|
||||
* The ref counts of the elements in objv are incremented since the
|
||||
* resulting list now refers to them.
|
||||
* When TCL_MEM_DEBUG is not defined, 'Tcl_NewListObj' is called instead.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -328,19 +301,8 @@ Tcl_DbNewListObj(
|
||||
*
|
||||
* Tcl_SetListObj --
|
||||
*
|
||||
* Modify an object to be a list containing each of the objc elements of
|
||||
* the object array referenced by objv.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The object is made a list object and is initialized from the object
|
||||
* pointers in objv. If objc is less than or equal to zero, an empty
|
||||
* object is returned. The new object's string representation is left
|
||||
* NULL. The ref counts of the elements in objv are incremented since the
|
||||
* list now refers to them. The object's old string and internal
|
||||
* representations are freed and its type is set NULL.
|
||||
* Like 'Tcl_NewListObj', but operates on an existing 'Tcl_Obj'instead of
|
||||
* creating a new one.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -384,18 +346,20 @@ Tcl_SetListObj(
|
||||
*
|
||||
* TclListObjCopy --
|
||||
*
|
||||
* Makes a "pure list" copy of a list value. This provides for the C
|
||||
* level a counterpart of the [lrange $list 0 end] command, while using
|
||||
* internals details to be as efficient as possible.
|
||||
* Creates a new 'Tcl_Obj' which is a pure copy of a list value. This
|
||||
* provides for the C level a counterpart of the [lrange $list 0 end]
|
||||
* command, while using internals details to be as efficient as possible.
|
||||
*
|
||||
* Results:
|
||||
* Normally returns a pointer to a new Tcl_Obj, that contains the same
|
||||
* list value as *listPtr does. The returned Tcl_Obj has a refCount of
|
||||
* zero. If *listPtr does not hold a list, NULL is returned, and if
|
||||
* interp is non-NULL, an error message is recorded there.
|
||||
* Value
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
* The address of the new 'Tcl_Obj' which shares its internal
|
||||
* representation with 'listPtr', and whose refCount is 0. If 'listPtr'
|
||||
* is not actually a list, the value is NULL, and an error message is left
|
||||
* in 'interp' if it is not NULL.
|
||||
*
|
||||
* Effect
|
||||
*
|
||||
* 'listPtr' is converted to a list if it isn't one already.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -506,27 +470,30 @@ TclListObjRange(
|
||||
*
|
||||
* Tcl_ListObjGetElements --
|
||||
*
|
||||
* This function returns an (objc,objv) array of the elements in a list
|
||||
* object.
|
||||
* Retreive the elements in a list 'Tcl_Obj'.
|
||||
*
|
||||
* Results:
|
||||
* The return value is normally TCL_OK; in this case *objcPtr is set to
|
||||
* the count of list elements and *objvPtr is set to a pointer to an
|
||||
* array of (*objcPtr) pointers to each list element. If listPtr does not
|
||||
* refer to a list object and the object can not be converted to one,
|
||||
* TCL_ERROR is returned and an error message will be left in the
|
||||
* interpreter's result if interp is not NULL.
|
||||
* Value
|
||||
*
|
||||
* The objects referenced by the returned array should be treated as
|
||||
* readonly and their ref counts are _not_ incremented; the caller must
|
||||
* do that if it holds on to a reference. Furthermore, the pointer and
|
||||
* length returned by this function may change as soon as any function is
|
||||
* called on the list object; be careful about retaining the pointer in a
|
||||
* local data structure.
|
||||
* TCL_OK
|
||||
*
|
||||
* Side effects:
|
||||
* The possible conversion of the object referenced by listPtr
|
||||
* to a list object.
|
||||
* A count of list elements is stored, 'objcPtr', And a pointer to the
|
||||
* array of elements in the list is stored in 'objvPtr'.
|
||||
*
|
||||
* The elements accessible via 'objvPtr' should be treated as readonly
|
||||
* and the refCount for each object is _not_ incremented; the caller
|
||||
* must do that if it holds on to a reference. Furthermore, the
|
||||
* pointer and length returned by this function may change as soon as
|
||||
* any function is called on the list object. Be careful about
|
||||
* retaining the pointer in a local data structure.
|
||||
*
|
||||
* TCL_ERROR
|
||||
*
|
||||
* 'listPtr' is not a valid list. An error message is left in the
|
||||
* interpreter's result if 'interp' is not NULL.
|
||||
*
|
||||
* Effect
|
||||
*
|
||||
* 'listPtr' is converted to a list object if it isn't one already.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -567,20 +534,27 @@ Tcl_ListObjGetElements(
|
||||
*
|
||||
* Tcl_ListObjAppendList --
|
||||
*
|
||||
* This function appends the elements in the list value referenced by
|
||||
* elemListPtr to the list value referenced by listPtr.
|
||||
* Appends the elements of elemListPtr to those of listPtr.
|
||||
*
|
||||
* Results:
|
||||
* The return value is normally TCL_OK. If listPtr or elemListPtr do not
|
||||
* refer to list values, TCL_ERROR is returned and an error message is
|
||||
* left in the interpreter's result if interp is not NULL.
|
||||
* Value
|
||||
*
|
||||
* Side effects:
|
||||
* The reference counts of the elements in elemListPtr are incremented
|
||||
* since the list now refers to them. listPtr and elemListPtr are
|
||||
* converted, if necessary, to list objects. Also, appending the new
|
||||
* elements may cause listObj's array of element pointers to grow.
|
||||
* listPtr's old string representation, if any, is invalidated.
|
||||
* TCL_OK
|
||||
*
|
||||
* Success.
|
||||
*
|
||||
* TCL_ERROR
|
||||
*
|
||||
* 'listPtr' or 'elemListPtr' are not valid lists. An error
|
||||
* message is left in the interpreter's result if 'interp' is not NULL.
|
||||
*
|
||||
* Effect
|
||||
*
|
||||
* The reference count of each element of 'elemListPtr' as it is added to
|
||||
* 'listPtr'. 'listPtr' and 'elemListPtr' are converted to 'tclListType'
|
||||
* if they are not already. Appending the new elements may cause the
|
||||
* array of element pointers in 'listObj' to grow. If any objects are
|
||||
* appended to 'listPtr'. Any preexisting string representation of
|
||||
* 'listPtr' is invalidated.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -619,24 +593,27 @@ Tcl_ListObjAppendList(
|
||||
*
|
||||
* Tcl_ListObjAppendElement --
|
||||
*
|
||||
* This function is a special purpose version of Tcl_ListObjAppendList:
|
||||
* it appends a single object referenced by objPtr to the list object
|
||||
* referenced by listPtr. If listPtr is not already a list object, an
|
||||
* attempt will be made to convert it to one.
|
||||
* Like 'Tcl_ListObjAppendList', but Appends a single value to a list.
|
||||
*
|
||||
* Results:
|
||||
* The return value is normally TCL_OK; in this case objPtr is added to
|
||||
* the end of listPtr's list. If listPtr does not refer to a list object
|
||||
* and the object can not be converted to one, TCL_ERROR is returned and
|
||||
* an error message will be left in the interpreter's result if interp is
|
||||
* not NULL.
|
||||
* Value
|
||||
*
|
||||
* Side effects:
|
||||
* The ref count of objPtr is incremented since the list now refers to
|
||||
* it. listPtr will be converted, if necessary, to a list object. Also,
|
||||
* appending the new element may cause listObj's array of element
|
||||
* pointers to grow. listPtr's old string representation, if any, is
|
||||
* invalidated.
|
||||
* TCL_OK
|
||||
*
|
||||
* 'objPtr' is appended to the elements of 'listPtr'.
|
||||
*
|
||||
* TCL_ERROR
|
||||
*
|
||||
* listPtr does not refer to a list object and the object can not be
|
||||
* converted to one. An error message will be left in the
|
||||
* interpreter's result if interp is not NULL.
|
||||
*
|
||||
* Effect
|
||||
*
|
||||
* If 'listPtr' is not already of type 'tclListType', it is converted.
|
||||
* The 'refCount' of 'objPtr' is incremented as it is added to 'listPtr'.
|
||||
* Appending the new element may cause the the array of element pointers
|
||||
* in 'listObj' to grow. Any preexisting string representation of
|
||||
* 'listPtr' is invalidated.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -787,23 +764,27 @@ Tcl_ListObjAppendElement(
|
||||
*
|
||||
* Tcl_ListObjIndex --
|
||||
*
|
||||
* This function returns a pointer to the index'th object from the list
|
||||
* referenced by listPtr. The first element has index 0. If index is
|
||||
* negative or greater than or equal to the number of elements in the
|
||||
* list, a NULL is returned. If listPtr is not a list object, an attempt
|
||||
* will be made to convert it to a list.
|
||||
* Retrieve a pointer to the element of 'listPtr' at 'index'. The index
|
||||
* of the first element is 0.
|
||||
*
|
||||
* Results:
|
||||
* The return value is normally TCL_OK; in this case objPtrPtr is set to
|
||||
* the Tcl_Obj pointer for the index'th list element or NULL if index is
|
||||
* out of range. This object should be treated as readonly and its ref
|
||||
* count is _not_ incremented; the caller must do that if it holds on to
|
||||
* the reference. If listPtr does not refer to a list and can't be
|
||||
* converted to one, TCL_ERROR is returned and an error message is left
|
||||
* in the interpreter's result if interp is not NULL.
|
||||
* Value
|
||||
*
|
||||
* Side effects:
|
||||
* listPtr will be converted, if necessary, to a list object.
|
||||
* TCL_OK
|
||||
*
|
||||
* A pointer to the element at 'index' is stored in 'objPtrPtr'. If
|
||||
* 'index' is out of range, NULL is stored in 'objPtrPtr'. This
|
||||
* object should be treated as readonly and its 'refCount' is _not_
|
||||
* incremented. The caller must do that if it holds on to the
|
||||
* reference.
|
||||
*
|
||||
* TCL_ERROR
|
||||
*
|
||||
* 'listPtr' is not a valid list. An an error message is left in the
|
||||
* interpreter's result if 'interp' is not NULL.
|
||||
*
|
||||
* Effect
|
||||
*
|
||||
* If 'listPtr' is not already of type 'tclListType', it is converted.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -845,19 +826,20 @@ Tcl_ListObjIndex(
|
||||
*
|
||||
* Tcl_ListObjLength --
|
||||
*
|
||||
* This function returns the number of elements in a list object. If the
|
||||
* object is not already a list object, an attempt will be made to
|
||||
* convert it to one.
|
||||
* Retrieve the number of elements in a list.
|
||||
*
|
||||
* Results:
|
||||
* The return value is normally TCL_OK; in this case *intPtr will be set
|
||||
* to the integer count of list elements. If listPtr does not refer to a
|
||||
* list object and the object can not be converted to one, TCL_ERROR is
|
||||
* returned and an error message will be left in the interpreter's result
|
||||
* if interp is not NULL.
|
||||
* Value
|
||||
*
|
||||
* Side effects:
|
||||
* The possible conversion of the argument object to a list object.
|
||||
* TCL_OK
|
||||
*
|
||||
* A count of list elements is stored at the address provided by
|
||||
* 'intPtr'. If 'listPtr' is not already of type 'tclListPtr', it is
|
||||
* converted.
|
||||
*
|
||||
* TCL_ERROR
|
||||
*
|
||||
* 'listPtr' is not a valid list. An error message will be left in
|
||||
* the interpreter's result if 'interp' is not NULL.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -893,35 +875,36 @@ Tcl_ListObjLength(
|
||||
*
|
||||
* Tcl_ListObjReplace --
|
||||
*
|
||||
* This function replaces zero or more elements of the list referenced by
|
||||
* listPtr with the objects from an (objc,objv) array. The objc elements
|
||||
* of the array referenced by objv replace the count elements in listPtr
|
||||
* starting at first.
|
||||
* Replace values in a list.
|
||||
*
|
||||
* If the argument first is zero or negative, it refers to the first
|
||||
* element. If first is greater than or equal to the number of elements
|
||||
* in the list, then no elements are deleted; the new elements are
|
||||
* appended to the list. Count gives the number of elements to replace.
|
||||
* If count is zero or negative then no elements are deleted; the new
|
||||
* elements are simply inserted before first.
|
||||
* If 'first' is zero or negative, it refers to the first element. If
|
||||
* 'first' outside the range of elements in the list, no elements are
|
||||
* deleted.
|
||||
*
|
||||
* The argument objv refers to an array of objc pointers to the new
|
||||
* elements to be added to listPtr in place of those that were deleted.
|
||||
* If objv is NULL, no new elements are added. If listPtr is not a list
|
||||
* object, an attempt will be made to convert it to one.
|
||||
* If 'count' is zero or negative no elements are deleted, and any new
|
||||
* elements are inserted at the beginning of the list.
|
||||
*
|
||||
* Results:
|
||||
* The return value is normally TCL_OK. If listPtr does not refer to a
|
||||
* list object and can not be converted to one, TCL_ERROR is returned and
|
||||
* an error message will be left in the interpreter's result if interp is
|
||||
* not NULL.
|
||||
* Value
|
||||
*
|
||||
* Side effects:
|
||||
* The ref counts of the objc elements in objv are incremented since the
|
||||
* resulting list now refers to them. Similarly, the ref counts for
|
||||
* replaced objects are decremented. listPtr is converted, if necessary,
|
||||
* to a list object. listPtr's old string representation, if any, is
|
||||
* freed.
|
||||
* TCL_OK
|
||||
*
|
||||
* The first 'objc' values of 'objv' replaced 'count' elements in 'listPtr'
|
||||
* starting at 'first'. If 'objc' 0, no new elements are added.
|
||||
*
|
||||
* TCL_ERROR
|
||||
*
|
||||
* 'listPtr' is not a valid list. An error message is left in the
|
||||
* interpreter's result if 'interp' is not NULL.
|
||||
*
|
||||
* Effect
|
||||
*
|
||||
* If 'listPtr' is not of type 'tclListType', it is converted if possible.
|
||||
*
|
||||
* The 'refCount' of each element appended to the list is incremented.
|
||||
* Similarly, the 'refCount' for each replaced element is decremented.
|
||||
*
|
||||
* If 'listPtr' is modified, any previous string representation is
|
||||
* invalidated.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1082,11 +1065,7 @@ Tcl_ListObjReplace(
|
||||
if (listRepPtr == NULL) {
|
||||
for (i = 0; i < objc; i++) {
|
||||
/* See bug 3598580 */
|
||||
#if TCL_MAJOR_VERSION > 8
|
||||
Tcl_DecrRefCount(objv[i]);
|
||||
#else
|
||||
objv[i]->refCount--;
|
||||
#endif
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1179,22 +1158,19 @@ Tcl_ListObjReplace(
|
||||
*
|
||||
* TclLindexList --
|
||||
*
|
||||
* This procedure handles the 'lindex' command when objc==3.
|
||||
* Implements the 'lindex' command when objc==3.
|
||||
*
|
||||
* Results:
|
||||
* Returns a pointer to the object extracted, or NULL if an error
|
||||
* occurred. The returned object already includes one reference count for
|
||||
* the pointer returned.
|
||||
* Implemented entirely as a wrapper around 'TclLindexFlat'. Reconfigures
|
||||
* the argument format into required form while taking care to manage
|
||||
* shimmering so as to tend to keep the most useful intreps
|
||||
* and/or avoid the most expensive conversions.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
* Value
|
||||
*
|
||||
* Notes:
|
||||
* This procedure is implemented entirely as a wrapper around
|
||||
* TclLindexFlat. All it does is reconfigure the argument format into the
|
||||
* form required by TclLindexFlat, while taking care to manage shimmering
|
||||
* in such a way that we tend to keep the most useful intreps and/or
|
||||
* avoid the most expensive conversions.
|
||||
* A pointer to the specified element, with its 'refCount' incremented, or
|
||||
* NULL if an error occurred.
|
||||
*
|
||||
* Notes
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1260,25 +1236,20 @@ TclLindexList(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclLindexFlat --
|
||||
* TclLindexFlat --
|
||||
*
|
||||
* This procedure is the core of the 'lindex' command, with all index
|
||||
* arguments presented as a flat list.
|
||||
* The core of the 'lindex' command, with all index
|
||||
* arguments presented as a flat list.
|
||||
*
|
||||
* Results:
|
||||
* Returns a pointer to the object extracted, or NULL if an error
|
||||
* occurred. The returned object already includes one reference count for
|
||||
* the pointer returned.
|
||||
* Value
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
* A pointer to the object extracted, with its 'refCount' incremented, or
|
||||
* NULL if an error occurred. Thus, the calling code will usually do
|
||||
* something like:
|
||||
*
|
||||
* Tcl_SetObjResult(interp, result);
|
||||
* Tcl_DecrRefCount(result);
|
||||
*
|
||||
* Notes:
|
||||
* The reference count of the returned object includes one reference
|
||||
* corresponding to the pointer returned. Thus, the calling code will
|
||||
* usually do something like:
|
||||
* Tcl_SetObjResult(interp, result);
|
||||
* Tcl_DecrRefCount(result);
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1354,23 +1325,16 @@ TclLindexFlat(
|
||||
*
|
||||
* TclLsetList --
|
||||
*
|
||||
* Core of the 'lset' command when objc == 4. Objv[2] may be either a
|
||||
* The core of [lset] when objc == 4. Objv[2] may be either a
|
||||
* scalar index or a list of indices.
|
||||
*
|
||||
* Results:
|
||||
* Returns the new value of the list variable, or NULL if there was an
|
||||
* error. The returned object includes one reference count for the
|
||||
* pointer returned.
|
||||
* Implemented entirely as a wrapper around 'TclLindexFlat', as described
|
||||
* for 'TclLindexList'.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
* Value
|
||||
*
|
||||
* Notes:
|
||||
* This procedure is implemented entirely as a wrapper around
|
||||
* TclLsetFlat. All it does is reconfigure the argument format into the
|
||||
* form required by TclLsetFlat, while taking care to manage shimmering
|
||||
* in such a way that we tend to keep the most useful intreps and/or
|
||||
* avoid the most expensive conversions.
|
||||
* The new list, with the 'refCount' of 'valuPtr' incremented, or NULL if
|
||||
* there was an error.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1432,36 +1396,39 @@ TclLsetList(
|
||||
*
|
||||
* Core engine of the 'lset' command.
|
||||
*
|
||||
* Results:
|
||||
* Returns the new value of the list variable, or NULL if an error
|
||||
* occurred. The returned object includes one reference count for the
|
||||
* pointer returned.
|
||||
* Value
|
||||
*
|
||||
* Side effects:
|
||||
* On entry, the reference count of the variable value does not reflect
|
||||
* any references held on the stack. The first action of this function is
|
||||
* to determine whether the object is shared, and to duplicate it if it
|
||||
* is. The reference count of the duplicate is incremented. At this
|
||||
* point, the reference count will be 1 for either case, so that the
|
||||
* object will appear to be unshared.
|
||||
* The resulting list
|
||||
*
|
||||
* If an error occurs, and the object has been duplicated, the reference
|
||||
* count on the duplicate is decremented so that it is now 0: this
|
||||
* dismisses any memory that was allocated by this function.
|
||||
* The 'refCount' of 'valuePtr' is incremented. If 'listPtr' was not
|
||||
* duplicated, its 'refCount' is incremented. The reference count of
|
||||
* an unduplicated object is therefore 2 (one for the returned pointer
|
||||
* and one for the variable that holds it). The reference count of a
|
||||
* duplicate object is 1, reflecting that result is the only active
|
||||
* reference. The caller is expected to store the result in the
|
||||
* variable and decrement its reference count. (INST_STORE_* does
|
||||
* exactly this.)
|
||||
*
|
||||
* If no error occurs, the reference count of the original object is
|
||||
* incremented if the object has not been duplicated, and nothing is done
|
||||
* to a reference count of the duplicate. Now the reference count of an
|
||||
* unduplicated object is 2 (the returned pointer, plus the one stored in
|
||||
* the variable). The reference count of a duplicate object is 1,
|
||||
* reflecting that the returned pointer is the only active reference. The
|
||||
* caller is expected to store the returned value back in the variable
|
||||
* and decrement its reference count. (INST_STORE_* does exactly this.)
|
||||
* NULL
|
||||
*
|
||||
* Surgery is performed on the unshared list value to produce the result.
|
||||
* TclLsetFlat maintains a linked list of Tcl_Obj's whose string
|
||||
* An error occurred. If 'listPtr' was duplicated, the reference
|
||||
* count on the duplicate is decremented so that it is 0, causing any
|
||||
* memory allocated by this function to be freed.
|
||||
*
|
||||
*
|
||||
* Effect
|
||||
*
|
||||
* On entry, the reference count of 'listPtr' does not reflect any
|
||||
* references held on the stack. The first action of this function is to
|
||||
* determine whether 'listPtr' is shared and to create a duplicate
|
||||
* unshared copy if it is. The reference count of the duplicate is
|
||||
* incremented. At this point, the reference count is 1 in either case so
|
||||
* that the object is considered unshared.
|
||||
*
|
||||
* The unshared list is altered directly to produce the result.
|
||||
* 'TclLsetFlat' maintains a linked list of 'Tcl_Obj' values whose string
|
||||
* representations must be spoilt by threading via 'ptr2' of the
|
||||
* two-pointer internal representation. On entry to TclLsetFlat, the
|
||||
* two-pointer internal representation. On entry to 'TclLsetFlat', the
|
||||
* values of 'ptr2' are immaterial; on exit, the 'ptr2' field of any
|
||||
* Tcl_Obj that has been modified is set to NULL.
|
||||
*
|
||||
@@ -1676,26 +1643,38 @@ TclLsetFlat(
|
||||
*
|
||||
* TclListObjSetElement --
|
||||
*
|
||||
* Set a single element of a list to a specified value
|
||||
*
|
||||
* Results:
|
||||
* The return value is normally TCL_OK. If listPtr does not refer to a
|
||||
* list object and cannot be converted to one, TCL_ERROR is returned and
|
||||
* an error message will be left in the interpreter result if interp is
|
||||
* not NULL. Similarly, if index designates an element outside the range
|
||||
* [0..listLength-1], where listLength is the count of elements in the
|
||||
* list object designated by listPtr, TCL_ERROR is returned and an error
|
||||
* message is left in the interpreter result.
|
||||
*
|
||||
* Side effects:
|
||||
* Tcl_Panic if listPtr designates a shared object. Otherwise, attempts
|
||||
* to convert it to a list with a non-shared internal rep. Decrements the
|
||||
* ref count of the object at the specified index within the list,
|
||||
* replaces with the object designated by valuePtr, and increments the
|
||||
* ref count of the replacement object.
|
||||
* Set a single element of a list to a specified value.
|
||||
*
|
||||
* It is the caller's responsibility to invalidate the string
|
||||
* representation of the object.
|
||||
* representation of the 'listPtr'.
|
||||
*
|
||||
* Value
|
||||
*
|
||||
* TCL_OK
|
||||
*
|
||||
* Success.
|
||||
*
|
||||
* TCL_ERROR
|
||||
*
|
||||
* 'listPtr' does not refer to a list object and cannot be converted
|
||||
* to one. An error message will be left in the interpreter result if
|
||||
* interp is not NULL.
|
||||
*
|
||||
* TCL_ERROR
|
||||
*
|
||||
* An index designates an element outside the range [0..listLength-1],
|
||||
* where 'listLength' is the count of elements in the list object
|
||||
* designated by 'listPtr'. An error message is left in the
|
||||
* interpreter result.
|
||||
*
|
||||
* Effect
|
||||
*
|
||||
* If 'listPtr' designates a shared object, 'Tcl_Panic' is called. If
|
||||
* 'listPtr' is not already of type 'tclListType', it is converted and the
|
||||
* internal representation is unshared. The 'refCount' of the element at
|
||||
* 'index' is decremented and replaced in the list with the 'valuePtr',
|
||||
* whose 'refCount' in turn is incremented.
|
||||
*
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1813,16 +1792,14 @@ TclListObjSetElement(
|
||||
*
|
||||
* FreeListInternalRep --
|
||||
*
|
||||
* Deallocate the storage associated with a list object's internal
|
||||
* representation.
|
||||
* Deallocate the storage associated with the internal representation of a
|
||||
* a list object.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
* Effect
|
||||
*
|
||||
* Side effects:
|
||||
* Frees listPtr's List* internal representation and sets listPtr's
|
||||
* internalRep.twoPtrValue.ptr1 to NULL. Decrements the ref counts of all
|
||||
* element objects, which may free them.
|
||||
* The storage for the internal 'List' pointer of 'listPtr' is freed, the
|
||||
* 'internalRep.twoPtrValue.ptr1' of 'listPtr' is set to NULL, and the 'refCount'
|
||||
* of each element of the list is decremented.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1851,14 +1828,12 @@ FreeListInternalRep(
|
||||
*
|
||||
* DupListInternalRep --
|
||||
*
|
||||
* Initialize the internal representation of a list Tcl_Obj to share the
|
||||
* Initialize the internal representation of a list 'Tcl_Obj' to share the
|
||||
* internal representation of an existing list object.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
* Effect
|
||||
*
|
||||
* Side effects:
|
||||
* The reference count of the List internal rep is incremented.
|
||||
* The 'refCount' of the List internal rep is incremented.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1878,16 +1853,20 @@ DupListInternalRep(
|
||||
*
|
||||
* SetListFromAny --
|
||||
*
|
||||
* Attempt to generate a list internal form for the Tcl object "objPtr".
|
||||
* Convert any object to a list.
|
||||
*
|
||||
* Results:
|
||||
* The return value is TCL_OK or TCL_ERROR. If an error occurs during
|
||||
* conversion, an error message is left in the interpreter's result
|
||||
* unless "interp" is NULL.
|
||||
* Value
|
||||
*
|
||||
* TCL_OK
|
||||
*
|
||||
* Success. The internal representation of 'objPtr' is set, and the type
|
||||
* of 'objPtr' is 'tclListType'.
|
||||
*
|
||||
* TCL_ERROR
|
||||
*
|
||||
* An error occured during conversion. An error message is left in the
|
||||
* interpreter's result if 'interp' is not NULL.
|
||||
*
|
||||
* Side effects:
|
||||
* If no error occurs, a list is stored as "objPtr"s internal
|
||||
* representation.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2012,18 +1991,16 @@ SetListFromAny(
|
||||
*
|
||||
* UpdateStringOfList --
|
||||
*
|
||||
* Update the string representation for a list object. Note: This
|
||||
* function does not invalidate an existing old string rep so storage
|
||||
* will be lost if this has not already been done.
|
||||
* Update the string representation for a list object.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
* Any previously-exising string representation is not invalidated, so
|
||||
* storage is lost if this has not been taken care of.
|
||||
*
|
||||
* Side effects:
|
||||
* The object's string is set to a valid string that results from the
|
||||
* list-to-string conversion. This string will be empty if the list has
|
||||
* no elements. The list internal representation should not be NULL and
|
||||
* we assume it is not NULL.
|
||||
* Effect
|
||||
*
|
||||
* The string representation of 'listPtr' is set to the resulting string.
|
||||
* This string will be empty if the list has no elements. It is assumed
|
||||
* that the list internal representation is not NULL.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
+4
-6
@@ -470,19 +470,17 @@ Tcl_LoadObjCmd(
|
||||
*/
|
||||
|
||||
if (code != TCL_OK) {
|
||||
#if defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
|
||||
Interp *iPtr = (Interp *) target;
|
||||
if (iPtr->result && *(iPtr->result) && !iPtr->freeProc) {
|
||||
if (iPtr->legacyResult && *(iPtr->legacyResult) && !iPtr->legacyFreeProc) {
|
||||
/*
|
||||
* A call to Tcl_InitStubs() determined the caller extension and
|
||||
* this interp are incompatible in their stubs mechanisms, and
|
||||
* recorded the error in the oldest legacy place we have to do so.
|
||||
*/
|
||||
Tcl_SetObjResult(target, Tcl_NewStringObj(iPtr->result, -1));
|
||||
iPtr->result = &tclEmptyString;
|
||||
iPtr->freeProc = NULL;
|
||||
Tcl_SetObjResult(target, Tcl_NewStringObj(iPtr->legacyResult, -1));
|
||||
iPtr->legacyResult = NULL;
|
||||
iPtr->legacyFreeProc = (void (*) (void))-1;
|
||||
}
|
||||
#endif /* defined(TCL_NO_DEPRECATED) */
|
||||
Tcl_TransferResult(target, code, interp);
|
||||
goto done;
|
||||
}
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
unsigned long numNsCreated; /* Count of the number of namespaces created
|
||||
size_t numNsCreated; /* Count of the number of namespaces created
|
||||
* within the thread. This value is used as a
|
||||
* unique id for each namespace. Cannot be
|
||||
* per-interp because the nsId is used to
|
||||
@@ -52,7 +52,7 @@ static Tcl_ThreadDataKey dataKey;
|
||||
* with some information that is used to check the cached pointer's validity.
|
||||
*/
|
||||
|
||||
typedef struct ResolvedNsName {
|
||||
typedef struct {
|
||||
Namespace *nsPtr; /* A cached pointer to the Namespace that the
|
||||
* name resolved to. */
|
||||
Namespace *refNsPtr; /* Points to the namespace context in which
|
||||
|
||||
+2
-2
@@ -95,7 +95,7 @@ typedef struct {
|
||||
/*
|
||||
* The correct value for the version field of the Tcl_MethodType structure.
|
||||
* This allows new versions of the structure to be introduced without breaking
|
||||
* binary compatability.
|
||||
* binary compatibility.
|
||||
*/
|
||||
|
||||
#define TCL_OO_METHOD_VERSION_CURRENT 1
|
||||
@@ -122,7 +122,7 @@ typedef struct {
|
||||
/*
|
||||
* The correct value for the version field of the Tcl_ObjectMetadataType
|
||||
* structure. This allows new versions of the structure to be introduced
|
||||
* without breaking binary compatability.
|
||||
* without breaking binary compatibility.
|
||||
*/
|
||||
|
||||
#define TCL_OO_METADATA_VERSION_CURRENT 1
|
||||
|
||||
+26
-463
@@ -57,7 +57,7 @@ char tclEmptyString = '\0';
|
||||
* for sanity checking purposes.
|
||||
*/
|
||||
|
||||
typedef struct ObjData {
|
||||
typedef struct {
|
||||
Tcl_Obj *objPtr; /* The pointer to the allocated Tcl_Obj. */
|
||||
const char *file; /* The name of the source file calling this
|
||||
* function; used for debugging. */
|
||||
@@ -210,9 +210,6 @@ static int SetDoubleFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
static int SetIntFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
static void UpdateStringOfDouble(Tcl_Obj *objPtr);
|
||||
static void UpdateStringOfInt(Tcl_Obj *objPtr);
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && !defined(TCL_WIDE_INT_IS_LONG)
|
||||
static void UpdateStringOfOldInt(Tcl_Obj *objPtr);
|
||||
#endif
|
||||
static void FreeBignum(Tcl_Obj *objPtr);
|
||||
static void DupBignum(Tcl_Obj *objPtr, Tcl_Obj *copyPtr);
|
||||
static void UpdateStringOfBignum(Tcl_Obj *objPtr);
|
||||
@@ -241,17 +238,8 @@ static int SetCmdNameFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
* implementations.
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
static const Tcl_ObjType oldBooleanType = {
|
||||
"boolean", /* name */
|
||||
NULL, /* freeIntRepProc */
|
||||
NULL, /* dupIntRepProc */
|
||||
NULL, /* updateStringProc */
|
||||
TclSetBooleanFromAny /* setFromAnyProc */
|
||||
};
|
||||
#endif
|
||||
const Tcl_ObjType tclBooleanType = {
|
||||
"booleanString", /* name */
|
||||
"boolean", /* name */
|
||||
NULL, /* freeIntRepProc */
|
||||
NULL, /* dupIntRepProc */
|
||||
NULL, /* updateStringProc */
|
||||
@@ -265,25 +253,12 @@ const Tcl_ObjType tclDoubleType = {
|
||||
SetDoubleFromAny /* setFromAnyProc */
|
||||
};
|
||||
const Tcl_ObjType tclIntType = {
|
||||
#if defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 || defined(TCL_WIDE_INT_IS_LONG)
|
||||
"int", /* name */
|
||||
#else
|
||||
"wideInt", /* name, keeping maximum compatibility with Tcl 8.6 on 32-bit platforms*/
|
||||
#endif
|
||||
NULL, /* freeIntRepProc */
|
||||
NULL, /* dupIntRepProc */
|
||||
UpdateStringOfInt, /* updateStringProc */
|
||||
SetIntFromAny /* setFromAnyProc */
|
||||
};
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && !defined(TCL_WIDE_INT_IS_LONG)
|
||||
static const Tcl_ObjType oldIntType = {
|
||||
"int", /* name */
|
||||
NULL, /* freeIntRepProc */
|
||||
NULL, /* dupIntRepProc */
|
||||
UpdateStringOfOldInt, /* updateStringProc */
|
||||
SetIntFromAny /* setFromAnyProc */
|
||||
};
|
||||
#endif
|
||||
const Tcl_ObjType tclBignumType = {
|
||||
"bignum", /* name */
|
||||
FreeBignum, /* freeIntRepProc */
|
||||
@@ -349,17 +324,17 @@ typedef struct ResolvedCmdName {
|
||||
* reference (not the namespace that contains
|
||||
* the referenced command). NULL if the name
|
||||
* is fully qualified.*/
|
||||
unsigned long refNsId; /* refNsPtr's unique namespace id. Used to
|
||||
size_t refNsId; /* refNsPtr's unique namespace id. Used to
|
||||
* verify that refNsPtr is still valid (e.g.,
|
||||
* it's possible that the cmd's containing
|
||||
* namespace was deleted and a new one created
|
||||
* at the same address). */
|
||||
unsigned int refNsCmdEpoch; /* Value of the referencing namespace's
|
||||
size_t refNsCmdEpoch; /* Value of the referencing namespace's
|
||||
* cmdRefEpoch when the pointer was cached.
|
||||
* Before using the cached pointer, we check
|
||||
* if the namespace's epoch was incremented;
|
||||
* if so, this cached pointer is invalid. */
|
||||
unsigned int cmdEpoch; /* Value of the command's cmdEpoch when this
|
||||
size_t cmdEpoch; /* Value of the command's cmdEpoch when this
|
||||
* pointer was cached. Before using the cached
|
||||
* pointer, we check if the cmd's epoch was
|
||||
* incremented; if so, the cmd was renamed,
|
||||
@@ -408,15 +383,6 @@ TclInitObjSubsystem(void)
|
||||
Tcl_RegisterObjType(&tclRegexpType);
|
||||
Tcl_RegisterObjType(&tclProcBodyType);
|
||||
|
||||
/* For backward compatibility only ... */
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
Tcl_RegisterObjType(&tclIntType);
|
||||
#if !defined(TCL_WIDE_INT_IS_LONG)
|
||||
Tcl_RegisterObjType(&oldIntType);
|
||||
#endif
|
||||
Tcl_RegisterObjType(&oldBooleanType);
|
||||
#endif
|
||||
|
||||
#ifdef TCL_COMPILE_STATS
|
||||
Tcl_MutexLock(&tclObjMutex);
|
||||
tclObjsAlloced = 0;
|
||||
@@ -1727,146 +1693,6 @@ Tcl_InvalidateStringRep(
|
||||
TclInvalidateStringRep(objPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_NewBooleanObj --
|
||||
*
|
||||
* This function is normally called when not debugging: i.e., when
|
||||
* TCL_MEM_DEBUG is not defined. It creates a new Tcl_Obj and
|
||||
* initializes it from the argument boolean value. A nonzero "boolValue"
|
||||
* is coerced to 1.
|
||||
*
|
||||
* When TCL_MEM_DEBUG is defined, this function just returns the result
|
||||
* of calling the debugging version Tcl_DbNewLongObj.
|
||||
*
|
||||
* Results:
|
||||
* The newly created object is returned. This object will have an invalid
|
||||
* string representation. The returned object has ref count 0.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef Tcl_NewBooleanObj
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_NewBooleanObj(
|
||||
register int boolValue) /* Boolean used to initialize new object. */
|
||||
{
|
||||
return Tcl_DbNewLongObj(boolValue!=0, "unknown", 0);
|
||||
}
|
||||
|
||||
#else /* if not TCL_MEM_DEBUG */
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_NewBooleanObj(
|
||||
register int boolValue) /* Boolean used to initialize new object. */
|
||||
{
|
||||
register Tcl_Obj *objPtr;
|
||||
|
||||
TclNewIntObj(objPtr, boolValue!=0);
|
||||
return objPtr;
|
||||
}
|
||||
#endif /* TCL_MEM_DEBUG */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_DbNewBooleanObj --
|
||||
*
|
||||
* This function is normally called when debugging: i.e., when
|
||||
* TCL_MEM_DEBUG is defined. It creates new boolean objects. It is the
|
||||
* same as the Tcl_NewBooleanObj function above except that it calls
|
||||
* Tcl_DbCkalloc directly with the file name and line number from its
|
||||
* caller. This simplifies debugging since then the [memory active]
|
||||
* command will report the correct file name and line number when
|
||||
* reporting objects that haven't been freed.
|
||||
*
|
||||
* When TCL_MEM_DEBUG is not defined, this function just returns the
|
||||
* result of calling Tcl_NewBooleanObj.
|
||||
*
|
||||
* Results:
|
||||
* The newly created object is returned. This object will have an invalid
|
||||
* string representation. The returned object has ref count 0.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
#undef Tcl_DbNewBooleanObj
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_DbNewBooleanObj(
|
||||
register int boolValue, /* Boolean used to initialize new object. */
|
||||
const char *file, /* The name of the source file calling this
|
||||
* function; used for debugging. */
|
||||
int line) /* Line number in the source file; used for
|
||||
* debugging. */
|
||||
{
|
||||
register Tcl_Obj *objPtr;
|
||||
|
||||
TclDbNewObj(objPtr, file, line);
|
||||
objPtr->bytes = NULL;
|
||||
|
||||
objPtr->internalRep.wideValue = (boolValue != 0);
|
||||
objPtr->typePtr = &tclIntType;
|
||||
return objPtr;
|
||||
}
|
||||
|
||||
#else /* if not TCL_MEM_DEBUG */
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_DbNewBooleanObj(
|
||||
register int boolValue, /* Boolean used to initialize new object. */
|
||||
const char *file, /* The name of the source file calling this
|
||||
* function; used for debugging. */
|
||||
int line) /* Line number in the source file; used for
|
||||
* debugging. */
|
||||
{
|
||||
return Tcl_NewBooleanObj(boolValue);
|
||||
}
|
||||
#endif /* TCL_MEM_DEBUG */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_SetBooleanObj --
|
||||
*
|
||||
* Modify an object to be a boolean object and to have the specified
|
||||
* boolean value. A nonzero "boolValue" is coerced to 1.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The object's old string rep, if any, is freed. Also, any old internal
|
||||
* rep is freed.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef Tcl_SetBooleanObj
|
||||
void
|
||||
Tcl_SetBooleanObj(
|
||||
register Tcl_Obj *objPtr, /* Object whose internal rep to init. */
|
||||
register int boolValue) /* Boolean used to set object's value. */
|
||||
{
|
||||
if (Tcl_IsShared(objPtr)) {
|
||||
Tcl_Panic("%s called with shared object", "Tcl_SetBooleanObj");
|
||||
}
|
||||
|
||||
TclSetIntObj(objPtr, boolValue!=0);
|
||||
}
|
||||
#endif /* TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -1893,14 +1719,10 @@ Tcl_GetBooleanFromObj(
|
||||
register int *boolPtr) /* Place to store resulting boolean. */
|
||||
{
|
||||
do {
|
||||
if (objPtr->typePtr == &tclIntType) {
|
||||
if (objPtr->typePtr == &tclIntType || objPtr->typePtr == &tclBooleanType) {
|
||||
*boolPtr = (objPtr->internalRep.wideValue != 0);
|
||||
return TCL_OK;
|
||||
}
|
||||
if (objPtr->typePtr == &tclBooleanType) {
|
||||
*boolPtr = objPtr->internalRep.longValue != 0;
|
||||
return TCL_OK;
|
||||
}
|
||||
if (objPtr->typePtr == &tclDoubleType) {
|
||||
/*
|
||||
* Caution: Don't be tempted to check directly for the "double"
|
||||
@@ -1942,12 +1764,7 @@ Tcl_GetBooleanFromObj(
|
||||
*
|
||||
* Side effects:
|
||||
* If no error occurs, an integer 1 or 0 is stored as "objPtr"s internal
|
||||
* representation and the type of "objPtr" is set to boolean or int/wideInt.
|
||||
*
|
||||
* Warning: If the returned type is "wideInt" (32-bit platforms) and your
|
||||
* platform is bigendian, you cannot use internalRep.longValue to distinguish
|
||||
* between false and true. On Windows and most other platforms this still will
|
||||
* work fine, but basically it is non-portable.
|
||||
* representation and the type of "objPtr" is set to boolean or int.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2105,7 +1922,7 @@ ParseBoolean(
|
||||
|
||||
goodBoolean:
|
||||
TclFreeIntRep(objPtr);
|
||||
objPtr->internalRep.longValue = newBool;
|
||||
objPtr->internalRep.wideValue = newBool;
|
||||
objPtr->typePtr = &tclBooleanType;
|
||||
return TCL_OK;
|
||||
|
||||
@@ -2341,8 +2158,7 @@ SetDoubleFromAny(
|
||||
* UpdateStringOfDouble --
|
||||
*
|
||||
* Update the string representation for a double-precision floating point
|
||||
* object. This must obey the current tcl_precision value for
|
||||
* double-to-string conversions. Note: This function does not free an
|
||||
* object. Note: This function does not free an
|
||||
* existing old string rep so storage will be lost if this has not
|
||||
* already been done.
|
||||
*
|
||||
@@ -2371,112 +2187,31 @@ UpdateStringOfDouble(
|
||||
objPtr->length = len;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_NewIntObj --
|
||||
*
|
||||
* If a client is compiled with TCL_MEM_DEBUG defined, calls to
|
||||
* Tcl_NewIntObj to create a new integer object end up calling the
|
||||
* debugging function Tcl_DbNewLongObj instead.
|
||||
*
|
||||
* Otherwise, if the client is compiled without TCL_MEM_DEBUG defined,
|
||||
* calls to Tcl_NewIntObj result in a call to one of the two
|
||||
* Tcl_NewIntObj implementations below. We provide two implementations so
|
||||
* that the Tcl core can be compiled to do memory debugging of the core
|
||||
* even if a client does not request it for itself.
|
||||
*
|
||||
* Integer and long integer objects share the same "integer" type
|
||||
* implementation. We store all integers as longs and Tcl_GetIntFromObj
|
||||
* checks whether the current value of the long can be represented by an
|
||||
* int.
|
||||
*
|
||||
* Results:
|
||||
* The newly created object is returned. This object will have an invalid
|
||||
* string representation. The returned object has ref count 0.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef Tcl_NewIntObj
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_NewIntObj(
|
||||
register int intValue) /* Int used to initialize the new object. */
|
||||
{
|
||||
return Tcl_DbNewLongObj((long)intValue, "unknown", 0);
|
||||
}
|
||||
|
||||
#else /* if not TCL_MEM_DEBUG */
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_NewIntObj(
|
||||
register int intValue) /* Int used to initialize the new object. */
|
||||
{
|
||||
register Tcl_Obj *objPtr;
|
||||
|
||||
TclNewIntObj(objPtr, intValue);
|
||||
return objPtr;
|
||||
}
|
||||
#endif /* if TCL_MEM_DEBUG */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_SetIntObj --
|
||||
*
|
||||
* Modify an object to be an integer and to have the specified integer
|
||||
* value.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The object's old string rep, if any, is freed. Also, any old internal
|
||||
* rep is freed.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef Tcl_SetIntObj
|
||||
void
|
||||
Tcl_SetIntObj(
|
||||
register Tcl_Obj *objPtr, /* Object whose internal rep to init. */
|
||||
register int intValue) /* Integer used to set object's value. */
|
||||
{
|
||||
if (Tcl_IsShared(objPtr)) {
|
||||
Tcl_Panic("%s called with shared object", "Tcl_SetIntObj");
|
||||
}
|
||||
|
||||
TclSetIntObj(objPtr, intValue);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_GetIntFromObj --
|
||||
*
|
||||
* Attempt to return an int from the Tcl object "objPtr". If the object
|
||||
* is not already an int, an attempt will be made to convert it to one.
|
||||
* Retrieve the integer value of 'objPtr'.
|
||||
*
|
||||
* Integer and long integer objects share the same "integer" type
|
||||
* implementation. We store all integers as longs and Tcl_GetIntFromObj
|
||||
* checks whether the current value of the long can be represented by an
|
||||
* int.
|
||||
* Value
|
||||
*
|
||||
* Results:
|
||||
* The return value is a standard Tcl object result. If an error occurs
|
||||
* during conversion or if the long integer held by the object can not be
|
||||
* represented by an int, an error message is left in the interpreter's
|
||||
* result unless "interp" is NULL.
|
||||
* TCL_OK
|
||||
*
|
||||
* Side effects:
|
||||
* If the object is not already an int, the conversion will free any old
|
||||
* internal representation.
|
||||
* Success.
|
||||
*
|
||||
* TCL_ERROR
|
||||
*
|
||||
* An error occurred during conversion or the integral value can not
|
||||
* be represented as an integer (it might be too large). An error
|
||||
* message is left in the interpreter's result if 'interp' is not
|
||||
* NULL.
|
||||
*
|
||||
* Effect
|
||||
*
|
||||
* 'objPtr' is converted to an integer if necessary if it is not one
|
||||
* already. The conversion frees any previously-existing internal
|
||||
* representation.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2566,178 +2301,6 @@ UpdateStringOfInt(
|
||||
memcpy(objPtr->bytes, buffer, (unsigned) len + 1);
|
||||
objPtr->length = len;
|
||||
}
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && !defined(TCL_WIDE_INT_IS_LONG)
|
||||
static void
|
||||
UpdateStringOfOldInt(
|
||||
register Tcl_Obj *objPtr) /* Int object whose string rep to update. */
|
||||
{
|
||||
char buffer[TCL_INTEGER_SPACE];
|
||||
register int len;
|
||||
|
||||
len = TclFormatInt(buffer, objPtr->internalRep.longValue);
|
||||
|
||||
objPtr->bytes = ckalloc(len + 1);
|
||||
memcpy(objPtr->bytes, buffer, (unsigned) len + 1);
|
||||
objPtr->length = len;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_NewLongObj --
|
||||
*
|
||||
* If a client is compiled with TCL_MEM_DEBUG defined, calls to
|
||||
* Tcl_NewLongObj to create a new long integer object end up calling the
|
||||
* debugging function Tcl_DbNewLongObj instead.
|
||||
*
|
||||
* Otherwise, if the client is compiled without TCL_MEM_DEBUG defined,
|
||||
* calls to Tcl_NewLongObj result in a call to one of the two
|
||||
* Tcl_NewLongObj implementations below. We provide two implementations
|
||||
* so that the Tcl core can be compiled to do memory debugging of the
|
||||
* core even if a client does not request it for itself.
|
||||
*
|
||||
* Integer and long integer objects share the same "integer" type
|
||||
* implementation. We store all integers as longs and Tcl_GetIntFromObj
|
||||
* checks whether the current value of the long can be represented by an
|
||||
* int.
|
||||
*
|
||||
* Results:
|
||||
* The newly created object is returned. This object will have an invalid
|
||||
* string representation. The returned object has ref count 0.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef Tcl_NewLongObj
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_NewLongObj(
|
||||
register long longValue) /* Long integer used to initialize the
|
||||
* new object. */
|
||||
{
|
||||
return Tcl_DbNewLongObj(longValue, "unknown", 0);
|
||||
}
|
||||
|
||||
#else /* if not TCL_MEM_DEBUG */
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_NewLongObj(
|
||||
register long longValue) /* Long integer used to initialize the
|
||||
* new object. */
|
||||
{
|
||||
register Tcl_Obj *objPtr;
|
||||
|
||||
TclNewIntObj(objPtr, longValue);
|
||||
return objPtr;
|
||||
}
|
||||
#endif /* if TCL_MEM_DEBUG */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_DbNewLongObj --
|
||||
*
|
||||
* If a client is compiled with TCL_MEM_DEBUG defined, calls to
|
||||
* Tcl_NewIntObj and Tcl_NewLongObj to create new integer or long integer
|
||||
* objects end up calling the debugging function Tcl_DbNewLongObj
|
||||
* instead. We provide two implementations of Tcl_DbNewLongObj so that
|
||||
* whether the Tcl core is compiled to do memory debugging of the core is
|
||||
* independent of whether a client requests debugging for itself.
|
||||
*
|
||||
* When the core is compiled with TCL_MEM_DEBUG defined, Tcl_DbNewLongObj
|
||||
* calls Tcl_DbCkalloc directly with the file name and line number from
|
||||
* its caller. This simplifies debugging since then the [memory active]
|
||||
* command will report the caller's file name and line number when
|
||||
* reporting objects that haven't been freed.
|
||||
*
|
||||
* Otherwise, when the core is compiled without TCL_MEM_DEBUG defined,
|
||||
* this function just returns the result of calling Tcl_NewLongObj.
|
||||
*
|
||||
* Results:
|
||||
* The newly created long integer object is returned. This object will
|
||||
* have an invalid string representation. The returned object has ref
|
||||
* count 0.
|
||||
*
|
||||
* Side effects:
|
||||
* Allocates memory.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef Tcl_DbNewLongObj
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_DbNewLongObj(
|
||||
register long longValue, /* Long integer used to initialize the new
|
||||
* object. */
|
||||
const char *file, /* The name of the source file calling this
|
||||
* function; used for debugging. */
|
||||
int line) /* Line number in the source file; used for
|
||||
* debugging. */
|
||||
{
|
||||
register Tcl_Obj *objPtr;
|
||||
|
||||
TclDbNewObj(objPtr, file, line);
|
||||
objPtr->bytes = NULL;
|
||||
|
||||
objPtr->internalRep.wideValue = longValue;
|
||||
objPtr->typePtr = &tclIntType;
|
||||
return objPtr;
|
||||
}
|
||||
|
||||
#else /* if not TCL_MEM_DEBUG */
|
||||
|
||||
Tcl_Obj *
|
||||
Tcl_DbNewLongObj(
|
||||
register long longValue, /* Long integer used to initialize the new
|
||||
* object. */
|
||||
const char *file, /* The name of the source file calling this
|
||||
* function; used for debugging. */
|
||||
int line) /* Line number in the source file; used for
|
||||
* debugging. */
|
||||
{
|
||||
return Tcl_NewLongObj(longValue);
|
||||
}
|
||||
#endif /* TCL_MEM_DEBUG */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_SetLongObj --
|
||||
*
|
||||
* Modify an object to be an integer object and to have the specified
|
||||
* long integer value.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The object's old string rep, if any, is freed. Also, any old internal
|
||||
* rep is freed.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef Tcl_SetLongObj
|
||||
void
|
||||
Tcl_SetLongObj(
|
||||
register Tcl_Obj *objPtr, /* Object whose internal rep to init. */
|
||||
register long longValue) /* Long integer used to initialize the
|
||||
* object's value. */
|
||||
{
|
||||
if (Tcl_IsShared(objPtr)) {
|
||||
Tcl_Panic("%s called with shared object", "Tcl_SetLongObj");
|
||||
}
|
||||
|
||||
TclSetIntObj(objPtr, longValue);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
|
||||
@@ -287,8 +287,6 @@ ConvertZeroEffectToNOP(
|
||||
case INST_INCR_ARRAY_STK:
|
||||
case INST_INCR_SCALAR_STK:
|
||||
case INST_INCR_STK:
|
||||
case INST_LOR:
|
||||
case INST_LAND:
|
||||
case INST_EQ:
|
||||
case INST_NEQ:
|
||||
case INST_LT:
|
||||
|
||||
+15
-41
@@ -63,7 +63,7 @@ Tcl_SetPanicProc(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_PanicVA --
|
||||
* Tcl_Panic --
|
||||
*
|
||||
* Print an error message and kill the process.
|
||||
*
|
||||
@@ -76,16 +76,25 @@ Tcl_SetPanicProc(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* ARGSUSED */
|
||||
/*
|
||||
* The following comment is here so that Coverity's static analizer knows that
|
||||
* a Tcl_Panic() call can never return and avoids lots of false positives.
|
||||
*/
|
||||
|
||||
/* coverity[+kill] */
|
||||
void
|
||||
Tcl_PanicVA(
|
||||
const char *format, /* Format string, suitable for passing to
|
||||
* fprintf. */
|
||||
va_list argList) /* Variable argument list. */
|
||||
Tcl_Panic(
|
||||
const char *format,
|
||||
...)
|
||||
{
|
||||
va_list argList;
|
||||
char *arg1, *arg2, *arg3; /* Additional arguments (variable in number)
|
||||
* to pass to fprintf. */
|
||||
char *arg4, *arg5, *arg6, *arg7, *arg8;
|
||||
|
||||
|
||||
va_start(argList, format);
|
||||
arg1 = va_arg(argList, char *);
|
||||
arg2 = va_arg(argList, char *);
|
||||
arg3 = va_arg(argList, char *);
|
||||
@@ -94,6 +103,7 @@ Tcl_PanicVA(
|
||||
arg6 = va_arg(argList, char *);
|
||||
arg7 = va_arg(argList, char *);
|
||||
arg8 = va_arg(argList, char *);
|
||||
va_end (argList);
|
||||
|
||||
if (panicProc != NULL) {
|
||||
panicProc(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
|
||||
@@ -125,42 +135,6 @@ Tcl_PanicVA(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_Panic --
|
||||
*
|
||||
* Print an error message and kill the process.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The process dies, entering the debugger if possible.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* ARGSUSED */
|
||||
|
||||
/*
|
||||
* The following comment is here so that Coverity's static analizer knows that
|
||||
* a Tcl_Panic() call can never return and avoids lots of false positives.
|
||||
*/
|
||||
|
||||
/* coverity[+kill] */
|
||||
void
|
||||
Tcl_Panic(
|
||||
const char *format,
|
||||
...)
|
||||
{
|
||||
va_list argList;
|
||||
|
||||
va_start(argList, format);
|
||||
Tcl_PanicVA(format, argList);
|
||||
va_end (argList);
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
|
||||
@@ -72,7 +72,7 @@ static const Tcl_ObjType tclFsPathType = {
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct FsPath {
|
||||
typedef struct {
|
||||
Tcl_Obj *translatedPathPtr; /* Name without any ~user sequences. If this
|
||||
* is NULL, then this is a pure normalized,
|
||||
* absolute path object, in which the parent
|
||||
@@ -91,7 +91,7 @@ typedef struct FsPath {
|
||||
* below. */
|
||||
ClientData nativePathPtr; /* Native representation of this path, which
|
||||
* is filesystem dependent. */
|
||||
int filesystemEpoch; /* Used to ensure the path representation was
|
||||
size_t filesystemEpoch; /* Used to ensure the path representation was
|
||||
* generated during the correct filesystem
|
||||
* epoch. The epoch changes when
|
||||
* filesystem-mounts are changed. */
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ typedef struct PkgFiles {
|
||||
* "Tk" (no version number).
|
||||
*/
|
||||
|
||||
typedef struct Package {
|
||||
typedef struct {
|
||||
char *version; /* Version that has been supplied in this
|
||||
* interpreter via "package provide"
|
||||
* (malloc'ed). NULL means the package doesn't
|
||||
|
||||
@@ -53,7 +53,7 @@ TCL_DECLARE_MUTEX(preserveMutex)/* To protect the above statics */
|
||||
* objects that we don't want to live any longer than necessary.
|
||||
*/
|
||||
|
||||
typedef struct HandleStruct {
|
||||
typedef struct {
|
||||
void *ptr; /* Pointer to the memory block being tracked.
|
||||
* This field will become NULL when the memory
|
||||
* block is deleted. This field must be the
|
||||
|
||||
+1
-5
@@ -1051,11 +1051,7 @@ ProcWrongNumArgs(
|
||||
if (framePtr->isProcCallFrame & FRAME_IS_LAMBDA) {
|
||||
desiredObjs[0] = Tcl_NewStringObj("lambdaExpr", -1);
|
||||
} else {
|
||||
#ifdef AVOID_HACKS_FOR_ITCL
|
||||
desiredObjs[0] = framePtr->objv[skip-1];
|
||||
#else
|
||||
desiredObjs[0] = Tcl_NewListObj(1, framePtr->objv + skip - 1);
|
||||
#endif /* AVOID_HACKS_FOR_ITCL */
|
||||
}
|
||||
Tcl_IncrRefCount(desiredObjs[0]);
|
||||
|
||||
@@ -1314,7 +1310,7 @@ InitLocalCache(
|
||||
*namePtr = NULL;
|
||||
} else {
|
||||
*namePtr = TclCreateLiteral(iPtr, localPtr->name,
|
||||
localPtr->nameLength, /* hash */ (unsigned int) -1,
|
||||
localPtr->nameLength, /* hash */ -1,
|
||||
&new, /* nsPtr */ NULL, 0, NULL);
|
||||
Tcl_IncrRefCount(*namePtr);
|
||||
}
|
||||
|
||||
+49
-420
@@ -27,9 +27,6 @@ enum returnKeys {
|
||||
static Tcl_Obj ** GetKeys(void);
|
||||
static void ReleaseKeys(ClientData clientData);
|
||||
static void ResetObjResult(Interp *iPtr);
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
static void SetupAppendBuffer(Interp *iPtr, int newSpace);
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
* This structure is used to take a snapshot of the interpreter state in
|
||||
@@ -247,47 +244,9 @@ Tcl_SaveResult(
|
||||
* reference. Put an empty object into the interpreter.
|
||||
*/
|
||||
|
||||
statePtr->objResultPtr = iPtr->objResultPtr;
|
||||
*statePtr = iPtr->objResultPtr;
|
||||
iPtr->objResultPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(iPtr->objResultPtr);
|
||||
|
||||
/*
|
||||
* Save the string result.
|
||||
*/
|
||||
|
||||
statePtr->freeProc = iPtr->freeProc;
|
||||
if (iPtr->result == iPtr->resultSpace) {
|
||||
/*
|
||||
* Copy the static string data out of the interp buffer.
|
||||
*/
|
||||
|
||||
statePtr->result = statePtr->resultSpace;
|
||||
strcpy(statePtr->result, iPtr->result);
|
||||
statePtr->appendResult = NULL;
|
||||
} else if (iPtr->result == iPtr->appendResult) {
|
||||
/*
|
||||
* Move the append buffer out of the interp.
|
||||
*/
|
||||
|
||||
statePtr->appendResult = iPtr->appendResult;
|
||||
statePtr->appendAvl = iPtr->appendAvl;
|
||||
statePtr->appendUsed = iPtr->appendUsed;
|
||||
statePtr->result = statePtr->appendResult;
|
||||
iPtr->appendResult = NULL;
|
||||
iPtr->appendAvl = 0;
|
||||
iPtr->appendUsed = 0;
|
||||
} else {
|
||||
/*
|
||||
* Move the dynamic or static string out of the interpreter.
|
||||
*/
|
||||
|
||||
statePtr->result = iPtr->result;
|
||||
statePtr->appendResult = NULL;
|
||||
}
|
||||
|
||||
iPtr->result = iPtr->resultSpace;
|
||||
iPtr->resultSpace[0] = 0;
|
||||
iPtr->freeProc = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -318,45 +277,12 @@ Tcl_RestoreResult(
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
|
||||
/*
|
||||
* Restore the string result.
|
||||
*/
|
||||
|
||||
iPtr->freeProc = statePtr->freeProc;
|
||||
if (statePtr->result == statePtr->resultSpace) {
|
||||
/*
|
||||
* Copy the static string data into the interp buffer.
|
||||
*/
|
||||
|
||||
iPtr->result = iPtr->resultSpace;
|
||||
strcpy(iPtr->result, statePtr->result);
|
||||
} else if (statePtr->result == statePtr->appendResult) {
|
||||
/*
|
||||
* Move the append buffer back into the interp.
|
||||
*/
|
||||
|
||||
if (iPtr->appendResult != NULL) {
|
||||
ckfree(iPtr->appendResult);
|
||||
}
|
||||
|
||||
iPtr->appendResult = statePtr->appendResult;
|
||||
iPtr->appendAvl = statePtr->appendAvl;
|
||||
iPtr->appendUsed = statePtr->appendUsed;
|
||||
iPtr->result = iPtr->appendResult;
|
||||
} else {
|
||||
/*
|
||||
* Move the dynamic or static string back into the interpreter.
|
||||
*/
|
||||
|
||||
iPtr->result = statePtr->result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Restore the object result.
|
||||
*/
|
||||
|
||||
Tcl_DecrRefCount(iPtr->objResultPtr);
|
||||
iPtr->objResultPtr = statePtr->objResultPtr;
|
||||
iPtr->objResultPtr = *statePtr;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -382,15 +308,7 @@ void
|
||||
Tcl_DiscardResult(
|
||||
Tcl_SavedResult *statePtr) /* State returned by Tcl_SaveResult. */
|
||||
{
|
||||
TclDecrRefCount(statePtr->objResultPtr);
|
||||
|
||||
if (statePtr->result == statePtr->appendResult) {
|
||||
ckfree(statePtr->appendResult);
|
||||
} else if (statePtr->freeProc == TCL_DYNAMIC) {
|
||||
ckfree(statePtr->result);
|
||||
} else if (statePtr->freeProc) {
|
||||
statePtr->freeProc(statePtr->result);
|
||||
}
|
||||
Tcl_DecrRefCount(*statePtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -420,49 +338,15 @@ Tcl_SetResult(
|
||||
* TCL_STATIC, TCL_VOLATILE, or the address of
|
||||
* a Tcl_FreeProc such as free. */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
register Tcl_FreeProc *oldFreeProc = iPtr->freeProc;
|
||||
char *oldResult = iPtr->result;
|
||||
|
||||
if (result == NULL) {
|
||||
iPtr->resultSpace[0] = 0;
|
||||
iPtr->result = iPtr->resultSpace;
|
||||
iPtr->freeProc = 0;
|
||||
} else if (freeProc == TCL_VOLATILE) {
|
||||
int length = strlen(result);
|
||||
|
||||
if (length > TCL_RESULT_SIZE) {
|
||||
iPtr->result = ckalloc(length + 1);
|
||||
iPtr->freeProc = TCL_DYNAMIC;
|
||||
} else {
|
||||
iPtr->result = iPtr->resultSpace;
|
||||
iPtr->freeProc = 0;
|
||||
}
|
||||
memcpy(iPtr->result, result, (unsigned) length+1);
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(result, -1));
|
||||
if (result == NULL || freeProc == NULL || freeProc == TCL_VOLATILE) {
|
||||
return;
|
||||
}
|
||||
if (freeProc == TCL_DYNAMIC) {
|
||||
ckfree(result);
|
||||
} else {
|
||||
iPtr->result = (char *) result;
|
||||
iPtr->freeProc = freeProc;
|
||||
(*freeProc)(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the old result was dynamically-allocated, free it up. Do it here,
|
||||
* rather than at the beginning, in case the new result value was part of
|
||||
* the old result value.
|
||||
*/
|
||||
|
||||
if (oldFreeProc != 0) {
|
||||
if (oldFreeProc == TCL_DYNAMIC) {
|
||||
ckfree(oldResult);
|
||||
} else {
|
||||
oldFreeProc(oldResult);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Reset the object result since we just set the string result.
|
||||
*/
|
||||
|
||||
ResetObjResult(iPtr);
|
||||
}
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
@@ -488,20 +372,8 @@ Tcl_GetStringResult(
|
||||
register Tcl_Interp *interp)/* Interpreter whose result to return. */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
#ifdef TCL_NO_DEPRECATED
|
||||
return Tcl_GetString(iPtr->objResultPtr);
|
||||
#else
|
||||
/*
|
||||
* If the string result is empty, move the object result to the string
|
||||
* result, then reset the object result.
|
||||
*/
|
||||
|
||||
if (*(iPtr->result) == 0) {
|
||||
Tcl_SetResult(interp, TclGetString(Tcl_GetObjResult(interp)),
|
||||
TCL_VOLATILE);
|
||||
}
|
||||
return iPtr->result;
|
||||
#endif
|
||||
return Tcl_GetString(iPtr->objResultPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -542,23 +414,6 @@ Tcl_SetObjResult(
|
||||
*/
|
||||
|
||||
TclDecrRefCount(oldObjResult);
|
||||
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
/*
|
||||
* Reset the string result since we just set the result object.
|
||||
*/
|
||||
|
||||
if (iPtr->freeProc != NULL) {
|
||||
if (iPtr->freeProc == TCL_DYNAMIC) {
|
||||
ckfree(iPtr->result);
|
||||
} else {
|
||||
iPtr->freeProc(iPtr->result);
|
||||
}
|
||||
iPtr->freeProc = 0;
|
||||
}
|
||||
iPtr->result = iPtr->resultSpace;
|
||||
iPtr->resultSpace[0] = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -587,72 +442,10 @@ Tcl_GetObjResult(
|
||||
Tcl_Interp *interp) /* Interpreter whose result to return. */
|
||||
{
|
||||
register Interp *iPtr = (Interp *) interp;
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
Tcl_Obj *objResultPtr;
|
||||
int length;
|
||||
|
||||
/*
|
||||
* If the string result is non-empty, move the string result to the object
|
||||
* result, then reset the string result.
|
||||
*/
|
||||
|
||||
if (iPtr->result[0] != 0) {
|
||||
ResetObjResult(iPtr);
|
||||
|
||||
objResultPtr = iPtr->objResultPtr;
|
||||
length = strlen(iPtr->result);
|
||||
TclInitStringRep(objResultPtr, iPtr->result, length);
|
||||
|
||||
if (iPtr->freeProc != NULL) {
|
||||
if (iPtr->freeProc == TCL_DYNAMIC) {
|
||||
ckfree(iPtr->result);
|
||||
} else {
|
||||
iPtr->freeProc(iPtr->result);
|
||||
}
|
||||
iPtr->freeProc = 0;
|
||||
}
|
||||
iPtr->result = iPtr->resultSpace;
|
||||
iPtr->result[0] = 0;
|
||||
}
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
return iPtr->objResultPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_AppendResultVA --
|
||||
*
|
||||
* Append a variable number of strings onto the interpreter's result.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The result of the interpreter given by the first argument is extended
|
||||
* by the strings in the va_list (up to a terminating NULL argument).
|
||||
*
|
||||
* If the string result is non-empty, the object result forced to be a
|
||||
* duplicate of it first. There will be a string result afterwards.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
Tcl_AppendResultVA(
|
||||
Tcl_Interp *interp, /* Interpreter with which to associate the
|
||||
* return value. */
|
||||
va_list argList) /* Variable argument list. */
|
||||
{
|
||||
Tcl_Obj *objPtr = Tcl_GetObjResult(interp);
|
||||
|
||||
if (Tcl_IsShared(objPtr)) {
|
||||
objPtr = Tcl_DuplicateObj(objPtr);
|
||||
}
|
||||
Tcl_AppendStringsToObjVA(objPtr, argList);
|
||||
Tcl_SetObjResult(interp, objPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -679,9 +472,23 @@ Tcl_AppendResult(
|
||||
Tcl_Interp *interp, ...)
|
||||
{
|
||||
va_list argList;
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
va_start(argList, interp);
|
||||
Tcl_AppendResultVA(interp, argList);
|
||||
objPtr = Tcl_GetObjResult(interp);
|
||||
|
||||
if (Tcl_IsShared(objPtr)) {
|
||||
objPtr = Tcl_DuplicateObj(objPtr);
|
||||
}
|
||||
while (1) {
|
||||
const char *bytes = va_arg(argList, char *);
|
||||
|
||||
if (bytes == NULL) {
|
||||
break;
|
||||
}
|
||||
Tcl_AppendToObj(objPtr, bytes, -1);
|
||||
}
|
||||
Tcl_SetObjResult(interp, objPtr);
|
||||
va_end(argList);
|
||||
}
|
||||
|
||||
@@ -716,7 +523,6 @@ Tcl_AppendElement(
|
||||
* to result. */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
#ifdef TCL_NO_DEPRECATED
|
||||
Tcl_Obj *elementPtr = Tcl_NewStringObj(element, -1);
|
||||
Tcl_Obj *listPtr = Tcl_NewListObj(1, &elementPtr);
|
||||
const char *bytes;
|
||||
@@ -730,153 +536,25 @@ Tcl_AppendElement(
|
||||
}
|
||||
Tcl_AppendObjToObj(iPtr->objResultPtr, listPtr);
|
||||
Tcl_DecrRefCount(listPtr);
|
||||
#else
|
||||
char *dst;
|
||||
int size;
|
||||
int flags;
|
||||
|
||||
/*
|
||||
* If the string result is empty, move the object result to the string
|
||||
* result, then reset the object result.
|
||||
*/
|
||||
|
||||
(void) Tcl_GetStringResult(interp);
|
||||
|
||||
/*
|
||||
* See how much space is needed, and grow the append buffer if needed to
|
||||
* accommodate the list element.
|
||||
*/
|
||||
|
||||
size = Tcl_ScanElement(element, &flags) + 1;
|
||||
if ((iPtr->result != iPtr->appendResult)
|
||||
|| (iPtr->appendResult[iPtr->appendUsed] != 0)
|
||||
|| ((size + iPtr->appendUsed) >= iPtr->appendAvl)) {
|
||||
SetupAppendBuffer(iPtr, size+iPtr->appendUsed);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert the string into a list element and copy it to the buffer that's
|
||||
* forming, with a space separator if needed.
|
||||
*/
|
||||
|
||||
dst = iPtr->appendResult + iPtr->appendUsed;
|
||||
if (TclNeedSpace(iPtr->appendResult, dst)) {
|
||||
iPtr->appendUsed++;
|
||||
*dst = ' ';
|
||||
dst++;
|
||||
|
||||
/*
|
||||
* If we need a space to separate this element from preceding stuff,
|
||||
* then this element will not lead a list, and need not have it's
|
||||
* leading '#' quoted.
|
||||
*/
|
||||
|
||||
flags |= TCL_DONT_QUOTE_HASH;
|
||||
}
|
||||
iPtr->appendUsed += Tcl_ConvertElement(element, dst, flags);
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* SetupAppendBuffer --
|
||||
*
|
||||
* This function makes sure that there is an append buffer properly
|
||||
* initialized, if necessary, from the interpreter's result, and that it
|
||||
* has at least enough room to accommodate newSpace new bytes of
|
||||
* information.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
static void
|
||||
SetupAppendBuffer(
|
||||
Interp *iPtr, /* Interpreter whose result is being set up. */
|
||||
int newSpace) /* Make sure that at least this many bytes of
|
||||
* new information may be added. */
|
||||
{
|
||||
int totalSpace;
|
||||
|
||||
/*
|
||||
* Make the append buffer larger, if that's necessary, then copy the
|
||||
* result into the append buffer and make the append buffer the official
|
||||
* Tcl result.
|
||||
*/
|
||||
|
||||
if (iPtr->result != iPtr->appendResult) {
|
||||
/*
|
||||
* If an oversized buffer was used recently, then free it up so we go
|
||||
* back to a smaller buffer. This avoids tying up memory forever after
|
||||
* a large operation.
|
||||
*/
|
||||
|
||||
if (iPtr->appendAvl > 500) {
|
||||
ckfree(iPtr->appendResult);
|
||||
iPtr->appendResult = NULL;
|
||||
iPtr->appendAvl = 0;
|
||||
}
|
||||
iPtr->appendUsed = strlen(iPtr->result);
|
||||
} else if (iPtr->result[iPtr->appendUsed] != 0) {
|
||||
/*
|
||||
* Most likely someone has modified a result created by
|
||||
* Tcl_AppendResult et al. so that it has a different size. Just
|
||||
* recompute the size.
|
||||
*/
|
||||
|
||||
iPtr->appendUsed = strlen(iPtr->result);
|
||||
}
|
||||
|
||||
totalSpace = newSpace + iPtr->appendUsed;
|
||||
if (totalSpace >= iPtr->appendAvl) {
|
||||
char *new;
|
||||
|
||||
if (totalSpace < 100) {
|
||||
totalSpace = 200;
|
||||
} else {
|
||||
totalSpace *= 2;
|
||||
}
|
||||
new = ckalloc(totalSpace);
|
||||
strcpy(new, iPtr->result);
|
||||
if (iPtr->appendResult != NULL) {
|
||||
ckfree(iPtr->appendResult);
|
||||
}
|
||||
iPtr->appendResult = new;
|
||||
iPtr->appendAvl = totalSpace;
|
||||
} else if (iPtr->result != iPtr->appendResult) {
|
||||
strcpy(iPtr->appendResult, iPtr->result);
|
||||
}
|
||||
|
||||
Tcl_FreeResult((Tcl_Interp *) iPtr);
|
||||
iPtr->result = iPtr->appendResult;
|
||||
}
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_FreeResult --
|
||||
*
|
||||
* This function frees up the memory associated with an interpreter's
|
||||
* string result. It also resets the interpreter's result object.
|
||||
* Tcl_FreeResult is most commonly used when a function is about to
|
||||
* replace one result value with another.
|
||||
* result, resetting the interpreter's result object. Tcl_FreeResult is
|
||||
* most commonly used when a function is about to replace one result
|
||||
* value with another.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Frees the memory associated with interp's string result and sets
|
||||
* interp->freeProc to zero, but does not change interp->result or clear
|
||||
* error state. Resets interp's result object to an unshared empty
|
||||
* object.
|
||||
* Frees the memory associated with interp's result but does not change
|
||||
* any part of the error dictionary (i.e., the errorinfo and errorcode
|
||||
* remain the same).
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -887,17 +565,6 @@ Tcl_FreeResult(
|
||||
{
|
||||
register Interp *iPtr = (Interp *) interp;
|
||||
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
if (iPtr->freeProc != NULL) {
|
||||
if (iPtr->freeProc == TCL_DYNAMIC) {
|
||||
ckfree(iPtr->result);
|
||||
} else {
|
||||
iPtr->freeProc(iPtr->result);
|
||||
}
|
||||
iPtr->freeProc = 0;
|
||||
}
|
||||
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
ResetObjResult(iPtr);
|
||||
}
|
||||
|
||||
@@ -927,18 +594,6 @@ Tcl_ResetResult(
|
||||
register Interp *iPtr = (Interp *) interp;
|
||||
|
||||
ResetObjResult(iPtr);
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
if (iPtr->freeProc != NULL) {
|
||||
if (iPtr->freeProc == TCL_DYNAMIC) {
|
||||
ckfree(iPtr->result);
|
||||
} else {
|
||||
iPtr->freeProc(iPtr->result);
|
||||
}
|
||||
iPtr->freeProc = 0;
|
||||
}
|
||||
iPtr->result = iPtr->resultSpace;
|
||||
iPtr->resultSpace[0] = 0;
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
if (iPtr->errorCode) {
|
||||
/* Legacy support */
|
||||
if (iPtr->flags & ERR_LEGACY_COPY) {
|
||||
@@ -1009,48 +664,6 @@ ResetObjResult(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_SetErrorCodeVA --
|
||||
*
|
||||
* This function is called to record machine-readable information about
|
||||
* an error that is about to be returned.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The errorCode field of the interp is modified to hold all of the
|
||||
* arguments to this function, in a list form with each argument becoming
|
||||
* one element of the list.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
Tcl_SetErrorCodeVA(
|
||||
Tcl_Interp *interp, /* Interpreter in which to set errorCode */
|
||||
va_list argList) /* Variable argument list. */
|
||||
{
|
||||
Tcl_Obj *errorObj = Tcl_NewObj();
|
||||
|
||||
/*
|
||||
* Scan through the arguments one at a time, appending them to the
|
||||
* errorCode field as list elements.
|
||||
*/
|
||||
|
||||
while (1) {
|
||||
char *elem = va_arg(argList, char *);
|
||||
|
||||
if (elem == NULL) {
|
||||
break;
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, errorObj, Tcl_NewStringObj(elem, -1));
|
||||
}
|
||||
Tcl_SetObjErrorCode(interp, errorObj);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -1075,6 +688,7 @@ Tcl_SetErrorCode(
|
||||
Tcl_Interp *interp, ...)
|
||||
{
|
||||
va_list argList;
|
||||
Tcl_Obj *errorObj;
|
||||
|
||||
/*
|
||||
* Scan through the arguments one at a time, appending them to the
|
||||
@@ -1082,7 +696,22 @@ Tcl_SetErrorCode(
|
||||
*/
|
||||
|
||||
va_start(argList, interp);
|
||||
Tcl_SetErrorCodeVA(interp, argList);
|
||||
errorObj = Tcl_NewObj();
|
||||
|
||||
/*
|
||||
* Scan through the arguments one at a time, appending them to the
|
||||
* errorCode field as list elements.
|
||||
*/
|
||||
|
||||
while (1) {
|
||||
char *elem = va_arg(argList, char *);
|
||||
|
||||
if (elem == NULL) {
|
||||
break;
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, errorObj, Tcl_NewStringObj(elem, -1));
|
||||
}
|
||||
Tcl_SetObjErrorCode(interp, errorObj);
|
||||
va_end(argList);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
* character set.
|
||||
*/
|
||||
|
||||
typedef struct CharSet {
|
||||
typedef struct {
|
||||
int exclude; /* 1 if this is an exclusion set. */
|
||||
int nchars;
|
||||
Tcl_UniChar *chars;
|
||||
|
||||
+4
-68
@@ -483,7 +483,7 @@ TclParseNumber(
|
||||
enum State {
|
||||
INITIAL, SIGNUM, ZERO, ZERO_X,
|
||||
ZERO_O, ZERO_B, ZERO_D, BINARY,
|
||||
HEXADECIMAL, OCTAL, BAD_OCTAL, DECIMAL,
|
||||
HEXADECIMAL, OCTAL, DECIMAL,
|
||||
LEADING_RADIX_POINT, FRACTION,
|
||||
EXPONENT_START, EXPONENT_SIGNUM, EXPONENT,
|
||||
sI, sIN, sINF, sINFI, sINFIN, sINFINI, sINFINIT, sINFINITY
|
||||
@@ -528,7 +528,6 @@ TclParseNumber(
|
||||
char d = 0; /* Last hexadecimal digit scanned; initialized
|
||||
* to avoid a compiler warning. */
|
||||
int shift = 0; /* Amount to shift when accumulating binary */
|
||||
int explicitOctal = 0;
|
||||
|
||||
#define ALL_BITS (~(Tcl_WideUInt)0)
|
||||
#define MOST_BITS (ALL_BITS >> 1)
|
||||
@@ -660,7 +659,6 @@ TclParseNumber(
|
||||
goto zerob;
|
||||
}
|
||||
if (c == 'o' || c == 'O') {
|
||||
explicitOctal = 1;
|
||||
state = ZERO_O;
|
||||
break;
|
||||
}
|
||||
@@ -668,10 +666,7 @@ TclParseNumber(
|
||||
state = ZERO_D;
|
||||
break;
|
||||
}
|
||||
#ifdef TCL_NO_DEPRECATED
|
||||
goto decimal;
|
||||
#endif
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case OCTAL:
|
||||
/*
|
||||
@@ -734,58 +729,6 @@ TclParseNumber(
|
||||
state = OCTAL;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case BAD_OCTAL:
|
||||
if (explicitOctal) {
|
||||
/*
|
||||
* No forgiveness for bad digits in explicitly octal numbers.
|
||||
*/
|
||||
|
||||
goto endgame;
|
||||
}
|
||||
if (flags & TCL_PARSE_INTEGER_ONLY) {
|
||||
/*
|
||||
* No seeking floating point when parsing only integer.
|
||||
*/
|
||||
|
||||
goto endgame;
|
||||
}
|
||||
#ifndef TCL_NO_DEPRECATED
|
||||
|
||||
/*
|
||||
* Scanned a number with a leading zero that contains an 8, 9,
|
||||
* radix point or E. This is an invalid octal number, but might
|
||||
* still be floating point.
|
||||
*/
|
||||
|
||||
if (c == '0') {
|
||||
numTrailZeros++;
|
||||
state = BAD_OCTAL;
|
||||
break;
|
||||
} else if (isdigit(UCHAR(c))) {
|
||||
if (objPtr != NULL) {
|
||||
significandOverflow = AccumulateDecimalDigit(
|
||||
(unsigned)(c-'0'), numTrailZeros,
|
||||
&significandWide, &significandBig,
|
||||
significandOverflow);
|
||||
}
|
||||
if (numSigDigs != 0) {
|
||||
numSigDigs += (numTrailZeros + 1);
|
||||
} else {
|
||||
numSigDigs = 1;
|
||||
}
|
||||
numTrailZeros = 0;
|
||||
state = BAD_OCTAL;
|
||||
break;
|
||||
} else if (c == '.') {
|
||||
state = FRACTION;
|
||||
break;
|
||||
} else if (c == 'E' || c == 'e') {
|
||||
state = EXPONENT_START;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
goto endgame;
|
||||
|
||||
/*
|
||||
@@ -900,9 +843,7 @@ TclParseNumber(
|
||||
* digits.
|
||||
*/
|
||||
|
||||
#ifdef TCL_NO_DEPRECATED
|
||||
decimal:
|
||||
#endif
|
||||
acceptState = state;
|
||||
acceptPoint = p;
|
||||
acceptLen = len;
|
||||
@@ -1186,7 +1127,6 @@ TclParseNumber(
|
||||
TclFreeIntRep(objPtr);
|
||||
switch (acceptState) {
|
||||
case SIGNUM:
|
||||
case BAD_OCTAL:
|
||||
case ZERO_X:
|
||||
case ZERO_O:
|
||||
case ZERO_B:
|
||||
@@ -1384,9 +1324,6 @@ TclParseNumber(
|
||||
|
||||
Tcl_AppendLimitedToObj(msg, bytes, numBytes, 50, "");
|
||||
Tcl_AppendToObj(msg, "\"", -1);
|
||||
if (state == BAD_OCTAL) {
|
||||
Tcl_AppendToObj(msg, " (looks like invalid octal number)", -1);
|
||||
}
|
||||
Tcl_SetObjResult(interp, msg);
|
||||
Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", NULL);
|
||||
}
|
||||
@@ -4031,8 +3968,8 @@ StrictBignumConversion(
|
||||
* This function is a service routine that produces the string of digits for
|
||||
* floating-point-to-decimal conversion. It can do a number of things
|
||||
* according to the 'flags' argument. Valid values for 'flags' include:
|
||||
* TCL_DD_SHORTEST - This is the default for floating point conversion if
|
||||
* ::tcl_precision is 0. It constructs the shortest string of
|
||||
* TCL_DD_SHORTEST - This is the default for floating point conversion.
|
||||
* It constructs the shortest string of
|
||||
* digits that will reconvert to the given number when scanned.
|
||||
* For floating point numbers that are exactly between two
|
||||
* decimal numbers, it resolves using the 'round to even' rule.
|
||||
@@ -4047,8 +3984,7 @@ StrictBignumConversion(
|
||||
* subsequent input conversion is 'round up' or 'round down'
|
||||
* rather than 'round to nearest', but is surprising otherwise.
|
||||
* TCL_DD_E_FORMAT - This value is used to prepare numbers for %e format
|
||||
* conversion (or for default floating->string if tcl_precision
|
||||
* is not 0). It constructs a string of at most 'ndigits' digits,
|
||||
* conversion. It constructs a string of at most 'ndigits' digits,
|
||||
* choosing the one that is closest to the given number (and
|
||||
* resolving ties with 'round to even'). It is allowed to return
|
||||
* fewer than 'ndigits' if the number converts exactly; if the
|
||||
|
||||
+57
-46
@@ -436,6 +436,7 @@ Tcl_GetCharLength(
|
||||
return length;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* OK, need to work with the object as a string.
|
||||
*/
|
||||
@@ -454,6 +455,50 @@ Tcl_GetCharLength(
|
||||
}
|
||||
return numChars;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclCheckEmptyString --
|
||||
*
|
||||
* Determine whether the string value of an object is or would be the
|
||||
* empty string, without generating a string representation.
|
||||
*
|
||||
* Results:
|
||||
* Returns 1 if empty, 0 if not, and -1 if unknown.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
TclCheckEmptyString (
|
||||
Tcl_Obj *objPtr
|
||||
) {
|
||||
int length = -1;
|
||||
|
||||
if (objPtr->bytes == tclEmptyStringRep) {
|
||||
return TCL_EMPTYSTRING_YES;
|
||||
}
|
||||
|
||||
if (TclIsPureList(objPtr)) {
|
||||
Tcl_ListObjLength(NULL, objPtr, &length);
|
||||
return length == 0;
|
||||
}
|
||||
|
||||
if (TclIsPureDict(objPtr)) {
|
||||
Tcl_DictObjSize(NULL, objPtr, &length);
|
||||
return length == 0;
|
||||
}
|
||||
|
||||
if (objPtr->bytes == NULL) {
|
||||
return TCL_EMPTYSTRING_UNKNOWN;
|
||||
}
|
||||
return objPtr->length == 0;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -1615,43 +1660,6 @@ AppendUtfToUtfRep(
|
||||
objPtr->length = newLength;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_AppendStringsToObjVA --
|
||||
*
|
||||
* This function appends one or more null-terminated strings to an
|
||||
* object.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* The contents of all the string arguments are appended to the string
|
||||
* representation of objPtr.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
Tcl_AppendStringsToObjVA(
|
||||
Tcl_Obj *objPtr, /* Points to the object to append to. */
|
||||
va_list argList) /* Variable argument list. */
|
||||
{
|
||||
if (Tcl_IsShared(objPtr)) {
|
||||
Tcl_Panic("%s called with shared object", "Tcl_AppendStringsToObj");
|
||||
}
|
||||
|
||||
while (1) {
|
||||
const char *bytes = va_arg(argList, char *);
|
||||
|
||||
if (bytes == NULL) {
|
||||
break;
|
||||
}
|
||||
Tcl_AppendToObj(objPtr, bytes, -1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -1678,7 +1686,18 @@ Tcl_AppendStringsToObj(
|
||||
va_list argList;
|
||||
|
||||
va_start(argList, objPtr);
|
||||
Tcl_AppendStringsToObjVA(objPtr, argList);
|
||||
if (Tcl_IsShared(objPtr)) {
|
||||
Tcl_Panic("%s called with shared object", "Tcl_AppendStringsToObj");
|
||||
}
|
||||
|
||||
while (1) {
|
||||
const char *bytes = va_arg(argList, char *);
|
||||
|
||||
if (bytes == NULL) {
|
||||
break;
|
||||
}
|
||||
Tcl_AppendToObj(objPtr, bytes, -1);
|
||||
}
|
||||
va_end(argList);
|
||||
}
|
||||
|
||||
@@ -2104,14 +2123,6 @@ Tcl_AppendFormatToObj(
|
||||
Tcl_AppendToObj(segment, "0b", 2);
|
||||
segmentLimit -= 2;
|
||||
break;
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
case 'd':
|
||||
if (gotZero) {
|
||||
Tcl_AppendToObj(segment, "0d", 2);
|
||||
segmentLimit -= 2;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+73
-277
@@ -43,121 +43,21 @@
|
||||
#undef TclpGetPid
|
||||
#undef TclSockMinimumBuffers
|
||||
#undef Tcl_SetIntObj
|
||||
#undef Tcl_SetLongObj
|
||||
#undef TclpInetNtoa
|
||||
#undef TclWinGetServByName
|
||||
#undef TclWinGetSockOpt
|
||||
#undef TclWinSetSockOpt
|
||||
#undef TclWinNToHS
|
||||
|
||||
/* See bug 510001: TclSockMinimumBuffers needs plat imp */
|
||||
#if defined(_WIN64) || defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
|
||||
# define TclSockMinimumBuffersOld 0
|
||||
#else
|
||||
#define TclSockMinimumBuffersOld sockMinimumBuffersOld
|
||||
static int TclSockMinimumBuffersOld(int sock, int size)
|
||||
{
|
||||
return TclSockMinimumBuffers(INT2PTR(sock), size);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
|
||||
# define TclSetStartupScriptPath 0
|
||||
# define TclGetStartupScriptPath 0
|
||||
# define TclSetStartupScriptFileName 0
|
||||
# define TclGetStartupScriptFileName 0
|
||||
# define TclPrecTraceProc 0
|
||||
# define TclpInetNtoa 0
|
||||
# define TclWinGetServByName 0
|
||||
# define TclWinGetSockOpt 0
|
||||
# define TclWinSetSockOpt 0
|
||||
# define TclWinNToHS 0
|
||||
# define TclWinGetPlatformId 0
|
||||
# define TclWinResetInterfaces 0
|
||||
# define TclWinSetInterfaces 0
|
||||
# define TclWinGetPlatformId 0
|
||||
# define TclBNInitBignumFromWideUInt 0
|
||||
# define TclBNInitBignumFromWideInt 0
|
||||
# define TclBNInitBignumFromLong 0
|
||||
# define Tcl_Backslash 0
|
||||
# define Tcl_GetDefaultEncodingDir 0
|
||||
# define Tcl_SetDefaultEncodingDir 0
|
||||
# define Tcl_EvalTokens 0
|
||||
# define Tcl_CreateMathFunc 0
|
||||
# define Tcl_GetMathFuncInfo 0
|
||||
# define Tcl_ListMathFuncs 0
|
||||
#else
|
||||
#define TclSetStartupScriptPath setStartupScriptPath
|
||||
static void TclSetStartupScriptPath(Tcl_Obj *path)
|
||||
{
|
||||
Tcl_SetStartupScript(path, NULL);
|
||||
}
|
||||
#define TclGetStartupScriptPath getStartupScriptPath
|
||||
static Tcl_Obj *TclGetStartupScriptPath(void)
|
||||
{
|
||||
return Tcl_GetStartupScript(NULL);
|
||||
}
|
||||
#define TclSetStartupScriptFileName setStartupScriptFileName
|
||||
static void TclSetStartupScriptFileName(
|
||||
const char *fileName)
|
||||
{
|
||||
Tcl_SetStartupScript(Tcl_NewStringObj(fileName,-1), NULL);
|
||||
}
|
||||
#define TclGetStartupScriptFileName getStartupScriptFileName
|
||||
static const char *TclGetStartupScriptFileName(void)
|
||||
{
|
||||
Tcl_Obj *path = Tcl_GetStartupScript(NULL);
|
||||
if (path == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return Tcl_GetString(path);
|
||||
}
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
#undef TclWinNToHS
|
||||
#undef TclWinGetPlatformId
|
||||
#undef TclWinResetInterfaces
|
||||
#undef TclWinSetInterfaces
|
||||
static void
|
||||
doNothing(void)
|
||||
{
|
||||
/* dummy implementation, no need to do anything */
|
||||
}
|
||||
#define TclWinNToHS winNToHS
|
||||
static unsigned short TclWinNToHS(unsigned short ns) {
|
||||
return ntohs(ns);
|
||||
}
|
||||
#define TclWinGetPlatformId winGetPlatformId
|
||||
static int
|
||||
TclWinGetPlatformId(void)
|
||||
{
|
||||
return 2; /* VER_PLATFORM_WIN32_NT */;
|
||||
}
|
||||
#define TclWinResetInterfaces doNothing
|
||||
#define TclWinSetInterfaces (void (*) (int)) doNothing
|
||||
#endif
|
||||
# define TclBNInitBignumFromWideUInt TclInitBignumFromWideUInt
|
||||
# define TclBNInitBignumFromWideInt TclInitBignumFromWideInt
|
||||
# define TclBNInitBignumFromLong TclInitBignumFromLong
|
||||
#endif /* TCL_NO_DEPRECATED */
|
||||
|
||||
#ifdef _WIN32
|
||||
# define TclUnixWaitForFile 0
|
||||
# define TclUnixCopyFile 0
|
||||
# define TclUnixOpenTemporaryFile 0
|
||||
# define TclpReaddir 0
|
||||
# define TclpIsAtty 0
|
||||
#elif defined(__CYGWIN__)
|
||||
# define TclpIsAtty TclPlatIsAtty
|
||||
#if defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
|
||||
static void
|
||||
doNothing(void)
|
||||
{
|
||||
/* dummy implementation, no need to do anything */
|
||||
}
|
||||
#endif
|
||||
# define TclWinAddProcess (void (*) (void *, unsigned int)) doNothing
|
||||
# define TclWinFlushDirtyChannels doNothing
|
||||
|
||||
static int
|
||||
TclpIsAtty(int fd)
|
||||
{
|
||||
@@ -172,31 +72,6 @@ void *TclWinGetTclInstance()
|
||||
return hInstance;
|
||||
}
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
#define TclWinSetSockOpt winSetSockOpt
|
||||
static int
|
||||
TclWinSetSockOpt(SOCKET s, int level, int optname,
|
||||
const char *optval, int optlen)
|
||||
{
|
||||
return setsockopt((int) s, level, optname, optval, optlen);
|
||||
}
|
||||
|
||||
#define TclWinGetSockOpt winGetSockOpt
|
||||
static int
|
||||
TclWinGetSockOpt(SOCKET s, int level, int optname,
|
||||
char *optval, int *optlen)
|
||||
{
|
||||
return getsockopt((int) s, level, optname, optval, optlen);
|
||||
}
|
||||
|
||||
#define TclWinGetServByName winGetServByName
|
||||
static struct servent *
|
||||
TclWinGetServByName(const char *name, const char *proto)
|
||||
{
|
||||
return getservbyname(name, proto);
|
||||
}
|
||||
#endif /* TCL_NO_DEPRECATED */
|
||||
|
||||
#define TclWinNoBackslash winNoBackslash
|
||||
static char *
|
||||
TclWinNoBackslash(char *path)
|
||||
@@ -319,8 +194,6 @@ static int uniCharNcasecmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsig
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
#if defined(TCL_NO_DEPRECATED)
|
||||
# define Tcl_SeekOld 0
|
||||
# define Tcl_TellOld 0
|
||||
# undef Tcl_SetBooleanObj
|
||||
# define Tcl_SetBooleanObj 0
|
||||
# undef Tcl_PkgPresent
|
||||
@@ -366,83 +239,6 @@ static int uniCharNcasecmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsig
|
||||
# define Tcl_DiscardResult 0
|
||||
# undef Tcl_SetResult
|
||||
# define Tcl_SetResult 0
|
||||
# undef Tcl_EvalObj
|
||||
# define Tcl_EvalObj 0
|
||||
# undef Tcl_GlobalEvalObj
|
||||
# define Tcl_GlobalEvalObj 0
|
||||
# define TclBackgroundException 0
|
||||
# undef TclpReaddir
|
||||
# define TclpReaddir 0
|
||||
# define TclSetStartupScript 0
|
||||
# define TclGetStartupScript 0
|
||||
# define TclCreateNamespace 0
|
||||
# define TclDeleteNamespace 0
|
||||
# define TclAppendExportList 0
|
||||
# define TclExport 0
|
||||
# define TclImport 0
|
||||
# define TclForgetImport 0
|
||||
# define TclGetCurrentNamespace_ 0
|
||||
# define TclGetGlobalNamespace_ 0
|
||||
# define TclFindNamespace 0
|
||||
# define TclFindCommand 0
|
||||
# define TclGetCommandFromObj 0
|
||||
# define TclGetCommandFullName 0
|
||||
# define TclCopyChannelOld 0
|
||||
# define Tcl_AppendResultVA 0
|
||||
# define Tcl_AppendStringsToObjVA 0
|
||||
# define Tcl_SetErrorCodeVA 0
|
||||
# define Tcl_PanicVA 0
|
||||
# define Tcl_VarEvalVA 0
|
||||
# undef TclpGetDate
|
||||
# define TclpGetDate 0
|
||||
# undef TclpLocaltime
|
||||
# define TclpLocaltime 0
|
||||
# undef TclpGmtime
|
||||
# define TclpGmtime 0
|
||||
# define TclpLocaltime_unix 0
|
||||
# define TclpGmtime_unix 0
|
||||
#else /* TCL_NO_DEPRECATED */
|
||||
# define Tcl_SeekOld seekOld
|
||||
# define Tcl_TellOld tellOld
|
||||
# define TclBackgroundException Tcl_BackgroundException
|
||||
# define TclSetStartupScript Tcl_SetStartupScript
|
||||
# define TclGetStartupScript Tcl_GetStartupScript
|
||||
# define TclCreateNamespace Tcl_CreateNamespace
|
||||
# define TclDeleteNamespace Tcl_DeleteNamespace
|
||||
# define TclAppendExportList Tcl_AppendExportList
|
||||
# define TclExport Tcl_Export
|
||||
# define TclImport Tcl_Import
|
||||
# define TclForgetImport Tcl_ForgetImport
|
||||
# define TclGetCurrentNamespace_ Tcl_GetCurrentNamespace
|
||||
# define TclGetGlobalNamespace_ Tcl_GetGlobalNamespace
|
||||
# define TclFindNamespace Tcl_FindNamespace
|
||||
# define TclFindCommand Tcl_FindCommand
|
||||
# define TclGetCommandFromObj Tcl_GetCommandFromObj
|
||||
# define TclGetCommandFullName Tcl_GetCommandFullName
|
||||
# define TclpLocaltime_unix TclpLocaltime
|
||||
# define TclpGmtime_unix TclpGmtime
|
||||
|
||||
static int
|
||||
seekOld(
|
||||
Tcl_Channel chan, /* The channel on which to seek. */
|
||||
int offset, /* Offset to seek to. */
|
||||
int mode) /* Relative to which location to seek? */
|
||||
{
|
||||
Tcl_WideInt wOffset, wResult;
|
||||
|
||||
wOffset = Tcl_LongAsWide((long) offset);
|
||||
wResult = Tcl_Seek(chan, wOffset, mode);
|
||||
return (int) Tcl_WideAsLong(wResult);
|
||||
}
|
||||
|
||||
static int
|
||||
tellOld(
|
||||
Tcl_Channel chan) /* The channel to return pos for. */
|
||||
{
|
||||
Tcl_WideInt wResult = Tcl_Tell(chan);
|
||||
|
||||
return (int) Tcl_WideAsLong(wResult);
|
||||
}
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
@@ -467,7 +263,7 @@ static const TclIntStubs tclIntStubs = {
|
||||
TclCleanupChildren, /* 5 */
|
||||
TclCleanupCommand, /* 6 */
|
||||
TclCopyAndCollapse, /* 7 */
|
||||
TclCopyChannelOld, /* 8 */
|
||||
0, /* 8 */
|
||||
TclCreatePipeline, /* 9 */
|
||||
TclCreateProc, /* 10 */
|
||||
TclDeleteCompiledLocalVars, /* 11 */
|
||||
@@ -536,7 +332,7 @@ static const TclIntStubs tclIntStubs = {
|
||||
TclpFree, /* 74 */
|
||||
TclpGetClicks, /* 75 */
|
||||
TclpGetSeconds, /* 76 */
|
||||
TclpGetTime, /* 77 */
|
||||
0, /* 77 */
|
||||
0, /* 78 */
|
||||
0, /* 79 */
|
||||
0, /* 80 */
|
||||
@@ -547,7 +343,7 @@ static const TclIntStubs tclIntStubs = {
|
||||
0, /* 85 */
|
||||
0, /* 86 */
|
||||
0, /* 87 */
|
||||
TclPrecTraceProc, /* 88 */
|
||||
0, /* 88 */
|
||||
TclPreventAliasLoop, /* 89 */
|
||||
0, /* 90 */
|
||||
TclProcCleanupProc, /* 91 */
|
||||
@@ -563,7 +359,7 @@ static const TclIntStubs tclIntStubs = {
|
||||
TclSetPreInitScript, /* 101 */
|
||||
TclSetupEnv, /* 102 */
|
||||
TclSockGetPort, /* 103 */
|
||||
TclSockMinimumBuffersOld, /* 104 */
|
||||
0, /* 104 */
|
||||
0, /* 105 */
|
||||
0, /* 106 */
|
||||
0, /* 107 */
|
||||
@@ -571,28 +367,28 @@ static const TclIntStubs tclIntStubs = {
|
||||
TclUpdateReturnInfo, /* 109 */
|
||||
TclSockMinimumBuffers, /* 110 */
|
||||
Tcl_AddInterpResolvers, /* 111 */
|
||||
TclAppendExportList, /* 112 */
|
||||
TclCreateNamespace, /* 113 */
|
||||
TclDeleteNamespace, /* 114 */
|
||||
TclExport, /* 115 */
|
||||
TclFindCommand, /* 116 */
|
||||
TclFindNamespace, /* 117 */
|
||||
0, /* 112 */
|
||||
0, /* 113 */
|
||||
0, /* 114 */
|
||||
0, /* 115 */
|
||||
0, /* 116 */
|
||||
0, /* 117 */
|
||||
Tcl_GetInterpResolvers, /* 118 */
|
||||
Tcl_GetNamespaceResolvers, /* 119 */
|
||||
Tcl_FindNamespaceVar, /* 120 */
|
||||
TclForgetImport, /* 121 */
|
||||
TclGetCommandFromObj, /* 122 */
|
||||
TclGetCommandFullName, /* 123 */
|
||||
TclGetCurrentNamespace_, /* 124 */
|
||||
TclGetGlobalNamespace_, /* 125 */
|
||||
0, /* 121 */
|
||||
0, /* 122 */
|
||||
0, /* 123 */
|
||||
0, /* 124 */
|
||||
0, /* 125 */
|
||||
Tcl_GetVariableFullName, /* 126 */
|
||||
TclImport, /* 127 */
|
||||
0, /* 127 */
|
||||
Tcl_PopCallFrame, /* 128 */
|
||||
Tcl_PushCallFrame, /* 129 */
|
||||
Tcl_RemoveInterpResolvers, /* 130 */
|
||||
Tcl_SetNamespaceResolvers, /* 131 */
|
||||
TclpHasSockets, /* 132 */
|
||||
TclpGetDate, /* 133 */
|
||||
0, /* 133 */
|
||||
0, /* 134 */
|
||||
0, /* 135 */
|
||||
0, /* 136 */
|
||||
@@ -617,8 +413,8 @@ static const TclIntStubs tclIntStubs = {
|
||||
0, /* 155 */
|
||||
TclRegError, /* 156 */
|
||||
TclVarTraceExists, /* 157 */
|
||||
TclSetStartupScriptFileName, /* 158 */
|
||||
TclGetStartupScriptFileName, /* 159 */
|
||||
0, /* 158 */
|
||||
0, /* 159 */
|
||||
0, /* 160 */
|
||||
TclChannelTransform, /* 161 */
|
||||
TclChannelEventScriptInvoker, /* 162 */
|
||||
@@ -626,8 +422,8 @@ static const TclIntStubs tclIntStubs = {
|
||||
TclExpandCodeArray, /* 164 */
|
||||
TclpSetInitialEncodings, /* 165 */
|
||||
TclListObjSetElement, /* 166 */
|
||||
TclSetStartupScriptPath, /* 167 */
|
||||
TclGetStartupScriptPath, /* 168 */
|
||||
0, /* 167 */
|
||||
0, /* 168 */
|
||||
TclpUtfNcmp2, /* 169 */
|
||||
TclCheckInterpTraces, /* 170 */
|
||||
TclCheckExecutionTraces, /* 171 */
|
||||
@@ -637,12 +433,12 @@ static const TclIntStubs tclIntStubs = {
|
||||
TclCallVarTraces, /* 175 */
|
||||
TclCleanupVar, /* 176 */
|
||||
TclVarErrMsg, /* 177 */
|
||||
TclSetStartupScript, /* 178 */
|
||||
TclGetStartupScript, /* 179 */
|
||||
0, /* 178 */
|
||||
0, /* 179 */
|
||||
0, /* 180 */
|
||||
0, /* 181 */
|
||||
TclpLocaltime, /* 182 */
|
||||
TclpGmtime, /* 183 */
|
||||
0, /* 182 */
|
||||
0, /* 183 */
|
||||
0, /* 184 */
|
||||
0, /* 185 */
|
||||
0, /* 186 */
|
||||
@@ -695,7 +491,7 @@ static const TclIntStubs tclIntStubs = {
|
||||
TclGetSrcInfoForPc, /* 233 */
|
||||
TclVarHashCreateVar, /* 234 */
|
||||
TclInitVarHashTable, /* 235 */
|
||||
TclBackgroundException, /* 236 */
|
||||
0, /* 236 */
|
||||
TclResetCancellation, /* 237 */
|
||||
TclNRInterpProc, /* 238 */
|
||||
TclNRInterpProcCore, /* 239 */
|
||||
@@ -732,10 +528,10 @@ static const TclIntPlatStubs tclIntPlatStubs = {
|
||||
TclpOpenFile, /* 7 */
|
||||
TclUnixWaitForFile, /* 8 */
|
||||
TclpCreateTempFile, /* 9 */
|
||||
TclpReaddir, /* 10 */
|
||||
TclpLocaltime_unix, /* 11 */
|
||||
TclpGmtime_unix, /* 12 */
|
||||
TclpInetNtoa, /* 13 */
|
||||
0, /* 10 */
|
||||
0, /* 11 */
|
||||
0, /* 12 */
|
||||
0, /* 13 */
|
||||
TclUnixCopyFile, /* 14 */
|
||||
0, /* 15 */
|
||||
0, /* 16 */
|
||||
@@ -756,16 +552,16 @@ static const TclIntPlatStubs tclIntPlatStubs = {
|
||||
#endif /* UNIX */
|
||||
#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */
|
||||
TclWinConvertError, /* 0 */
|
||||
TclWinConvertWSAError, /* 1 */
|
||||
TclWinGetServByName, /* 2 */
|
||||
TclWinGetSockOpt, /* 3 */
|
||||
0, /* 1 */
|
||||
0, /* 2 */
|
||||
0, /* 3 */
|
||||
TclWinGetTclInstance, /* 4 */
|
||||
TclUnixWaitForFile, /* 5 */
|
||||
TclWinNToHS, /* 6 */
|
||||
TclWinSetSockOpt, /* 7 */
|
||||
0, /* 6 */
|
||||
0, /* 7 */
|
||||
TclpGetPid, /* 8 */
|
||||
TclWinGetPlatformId, /* 9 */
|
||||
TclpReaddir, /* 10 */
|
||||
0, /* 9 */
|
||||
0, /* 10 */
|
||||
TclGetAndDetachPids, /* 11 */
|
||||
TclpCloseFile, /* 12 */
|
||||
TclpCreateCommandChannel, /* 13 */
|
||||
@@ -776,14 +572,14 @@ static const TclIntPlatStubs tclIntPlatStubs = {
|
||||
TclpMakeFile, /* 18 */
|
||||
TclpOpenFile, /* 19 */
|
||||
TclWinAddProcess, /* 20 */
|
||||
TclpInetNtoa, /* 21 */
|
||||
0, /* 21 */
|
||||
TclpCreateTempFile, /* 22 */
|
||||
0, /* 23 */
|
||||
TclWinNoBackslash, /* 24 */
|
||||
0, /* 25 */
|
||||
TclWinSetInterfaces, /* 26 */
|
||||
0, /* 26 */
|
||||
TclWinFlushDirtyChannels, /* 27 */
|
||||
TclWinResetInterfaces, /* 28 */
|
||||
0, /* 28 */
|
||||
TclWinCPUID, /* 29 */
|
||||
TclUnixOpenTemporaryFile, /* 30 */
|
||||
#endif /* WIN */
|
||||
@@ -798,10 +594,10 @@ static const TclIntPlatStubs tclIntPlatStubs = {
|
||||
TclpOpenFile, /* 7 */
|
||||
TclUnixWaitForFile, /* 8 */
|
||||
TclpCreateTempFile, /* 9 */
|
||||
TclpReaddir, /* 10 */
|
||||
TclpLocaltime_unix, /* 11 */
|
||||
TclpGmtime_unix, /* 12 */
|
||||
TclpInetNtoa, /* 13 */
|
||||
0, /* 10 */
|
||||
0, /* 11 */
|
||||
0, /* 12 */
|
||||
0, /* 13 */
|
||||
TclUnixCopyFile, /* 14 */
|
||||
TclMacOSXGetFileAttribute, /* 15 */
|
||||
TclMacOSXSetFileAttribute, /* 16 */
|
||||
@@ -902,9 +698,9 @@ const TclTomMathStubs tclTomMathStubs = {
|
||||
TclBN_mp_init_set_int, /* 61 */
|
||||
TclBN_mp_set_int, /* 62 */
|
||||
TclBN_mp_cnt_lsb, /* 63 */
|
||||
TclBNInitBignumFromLong, /* 64 */
|
||||
TclBNInitBignumFromWideInt, /* 65 */
|
||||
TclBNInitBignumFromWideUInt, /* 66 */
|
||||
0, /* 64 */
|
||||
0, /* 65 */
|
||||
0, /* 66 */
|
||||
TclBN_mp_expt_d_ex, /* 67 */
|
||||
TclBN_mp_set_long_long, /* 68 */
|
||||
TclBN_mp_get_long_long, /* 69 */
|
||||
@@ -959,11 +755,11 @@ const TclStubs tclStubs = {
|
||||
Tcl_DbDecrRefCount, /* 19 */
|
||||
Tcl_DbIncrRefCount, /* 20 */
|
||||
Tcl_DbIsShared, /* 21 */
|
||||
Tcl_DbNewBooleanObj, /* 22 */
|
||||
0, /* 22 */
|
||||
Tcl_DbNewByteArrayObj, /* 23 */
|
||||
Tcl_DbNewDoubleObj, /* 24 */
|
||||
Tcl_DbNewListObj, /* 25 */
|
||||
Tcl_DbNewLongObj, /* 26 */
|
||||
0, /* 26 */
|
||||
Tcl_DbNewObj, /* 27 */
|
||||
Tcl_DbNewStringObj, /* 28 */
|
||||
Tcl_DuplicateObj, /* 29 */
|
||||
@@ -986,21 +782,21 @@ const TclStubs tclStubs = {
|
||||
Tcl_ListObjIndex, /* 46 */
|
||||
Tcl_ListObjLength, /* 47 */
|
||||
Tcl_ListObjReplace, /* 48 */
|
||||
Tcl_NewBooleanObj, /* 49 */
|
||||
0, /* 49 */
|
||||
Tcl_NewByteArrayObj, /* 50 */
|
||||
Tcl_NewDoubleObj, /* 51 */
|
||||
Tcl_NewIntObj, /* 52 */
|
||||
0, /* 52 */
|
||||
Tcl_NewListObj, /* 53 */
|
||||
Tcl_NewLongObj, /* 54 */
|
||||
0, /* 54 */
|
||||
Tcl_NewObj, /* 55 */
|
||||
Tcl_NewStringObj, /* 56 */
|
||||
Tcl_SetBooleanObj, /* 57 */
|
||||
0, /* 57 */
|
||||
Tcl_SetByteArrayLength, /* 58 */
|
||||
Tcl_SetByteArrayObj, /* 59 */
|
||||
Tcl_SetDoubleObj, /* 60 */
|
||||
Tcl_SetIntObj, /* 61 */
|
||||
0, /* 61 */
|
||||
Tcl_SetListObj, /* 62 */
|
||||
Tcl_SetLongObj, /* 63 */
|
||||
0, /* 63 */
|
||||
Tcl_SetObjLength, /* 64 */
|
||||
Tcl_SetStringObj, /* 65 */
|
||||
Tcl_AddErrorInfo, /* 66 */
|
||||
@@ -1014,7 +810,7 @@ const TclStubs tclStubs = {
|
||||
Tcl_AsyncMark, /* 74 */
|
||||
Tcl_AsyncReady, /* 75 */
|
||||
Tcl_BackgroundError, /* 76 */
|
||||
Tcl_Backslash, /* 77 */
|
||||
0, /* 77 */
|
||||
Tcl_BadChannelOption, /* 78 */
|
||||
Tcl_CallWhenDeleted, /* 79 */
|
||||
Tcl_CancelIdleCall, /* 80 */
|
||||
@@ -1032,7 +828,7 @@ const TclStubs tclStubs = {
|
||||
Tcl_CreateEventSource, /* 92 */
|
||||
Tcl_CreateExitHandler, /* 93 */
|
||||
Tcl_CreateInterp, /* 94 */
|
||||
Tcl_CreateMathFunc, /* 95 */
|
||||
0, /* 95 */
|
||||
Tcl_CreateObjCommand, /* 96 */
|
||||
Tcl_CreateSlave, /* 97 */
|
||||
Tcl_CreateTimerHandler, /* 98 */
|
||||
@@ -1068,7 +864,7 @@ const TclStubs tclStubs = {
|
||||
Tcl_ErrnoMsg, /* 128 */
|
||||
Tcl_Eval, /* 129 */
|
||||
Tcl_EvalFile, /* 130 */
|
||||
Tcl_EvalObj, /* 131 */
|
||||
0, /* 131 */
|
||||
Tcl_EventuallyFree, /* 132 */
|
||||
Tcl_Exit, /* 133 */
|
||||
Tcl_ExposeCommand, /* 134 */
|
||||
@@ -1123,7 +919,7 @@ const TclStubs tclStubs = {
|
||||
Tcl_GetVar, /* 175 */
|
||||
Tcl_GetVar2, /* 176 */
|
||||
Tcl_GlobalEval, /* 177 */
|
||||
Tcl_GlobalEvalObj, /* 178 */
|
||||
0, /* 178 */
|
||||
Tcl_HideCommand, /* 179 */
|
||||
Tcl_Init, /* 180 */
|
||||
Tcl_InitHashTable, /* 181 */
|
||||
@@ -1165,7 +961,7 @@ const TclStubs tclStubs = {
|
||||
Tcl_ResetResult, /* 217 */
|
||||
Tcl_ScanElement, /* 218 */
|
||||
Tcl_ScanCountedElement, /* 219 */
|
||||
Tcl_SeekOld, /* 220 */
|
||||
0, /* 220 */
|
||||
Tcl_ServiceAll, /* 221 */
|
||||
Tcl_ServiceEvent, /* 222 */
|
||||
Tcl_SetAssocData, /* 223 */
|
||||
@@ -1191,7 +987,7 @@ const TclStubs tclStubs = {
|
||||
Tcl_SplitPath, /* 243 */
|
||||
Tcl_StaticPackage, /* 244 */
|
||||
Tcl_StringMatch, /* 245 */
|
||||
Tcl_TellOld, /* 246 */
|
||||
0, /* 246 */
|
||||
Tcl_TraceVar, /* 247 */
|
||||
Tcl_TraceVar2, /* 248 */
|
||||
Tcl_TranslateFileName, /* 249 */
|
||||
@@ -1212,18 +1008,18 @@ const TclStubs tclStubs = {
|
||||
Tcl_WrongNumArgs, /* 264 */
|
||||
Tcl_DumpActiveMemory, /* 265 */
|
||||
Tcl_ValidateAllMemory, /* 266 */
|
||||
Tcl_AppendResultVA, /* 267 */
|
||||
Tcl_AppendStringsToObjVA, /* 268 */
|
||||
0, /* 267 */
|
||||
0, /* 268 */
|
||||
Tcl_HashStats, /* 269 */
|
||||
Tcl_ParseVar, /* 270 */
|
||||
Tcl_PkgPresent, /* 271 */
|
||||
Tcl_PkgPresentEx, /* 272 */
|
||||
Tcl_PkgProvide, /* 273 */
|
||||
Tcl_PkgRequire, /* 274 */
|
||||
Tcl_SetErrorCodeVA, /* 275 */
|
||||
Tcl_VarEvalVA, /* 276 */
|
||||
0, /* 275 */
|
||||
0, /* 276 */
|
||||
Tcl_WaitPid, /* 277 */
|
||||
Tcl_PanicVA, /* 278 */
|
||||
0, /* 278 */
|
||||
Tcl_GetVersion, /* 279 */
|
||||
Tcl_InitMemory, /* 280 */
|
||||
Tcl_StackChannel, /* 281 */
|
||||
@@ -1286,8 +1082,8 @@ const TclStubs tclStubs = {
|
||||
Tcl_WriteChars, /* 338 */
|
||||
Tcl_WriteObj, /* 339 */
|
||||
Tcl_GetString, /* 340 */
|
||||
Tcl_GetDefaultEncodingDir, /* 341 */
|
||||
Tcl_SetDefaultEncodingDir, /* 342 */
|
||||
0, /* 341 */
|
||||
0, /* 342 */
|
||||
Tcl_AlertNotifier, /* 343 */
|
||||
Tcl_ServiceModeHook, /* 344 */
|
||||
Tcl_UniCharIsAlnum, /* 345 */
|
||||
@@ -1302,7 +1098,7 @@ const TclStubs tclStubs = {
|
||||
Tcl_UniCharToUtfDString, /* 354 */
|
||||
Tcl_UtfToUniCharDString, /* 355 */
|
||||
Tcl_GetRegExpFromObj, /* 356 */
|
||||
Tcl_EvalTokens, /* 357 */
|
||||
0, /* 357 */
|
||||
Tcl_FreeParse, /* 358 */
|
||||
Tcl_LogCommandInfo, /* 359 */
|
||||
Tcl_ParseBraces, /* 360 */
|
||||
@@ -1366,8 +1162,8 @@ const TclStubs tclStubs = {
|
||||
Tcl_IsChannelExisting, /* 418 */
|
||||
Tcl_UniCharNcasecmp, /* 419 */
|
||||
Tcl_UniCharCaseMatch, /* 420 */
|
||||
Tcl_FindHashEntry, /* 421 */
|
||||
Tcl_CreateHashEntry, /* 422 */
|
||||
0, /* 421 */
|
||||
0, /* 422 */
|
||||
Tcl_InitCustomHashTable, /* 423 */
|
||||
Tcl_InitObjHashTable, /* 424 */
|
||||
Tcl_CommandTraceInfo, /* 425 */
|
||||
@@ -1380,8 +1176,8 @@ const TclStubs tclStubs = {
|
||||
Tcl_AttemptSetObjLength, /* 432 */
|
||||
Tcl_GetChannelThread, /* 433 */
|
||||
Tcl_GetUnicodeFromObj, /* 434 */
|
||||
Tcl_GetMathFuncInfo, /* 435 */
|
||||
Tcl_ListMathFuncs, /* 436 */
|
||||
0, /* 435 */
|
||||
0, /* 436 */
|
||||
Tcl_SubstObj, /* 437 */
|
||||
Tcl_DetachChannel, /* 438 */
|
||||
Tcl_IsStandardChannel, /* 439 */
|
||||
|
||||
@@ -66,8 +66,8 @@ Tcl_InitStubs(
|
||||
*/
|
||||
|
||||
if (!stubsPtr || (stubsPtr->magic != (((exact&0xff00) >= 0x900) ? magic : TCL_STUB_MAGIC))) {
|
||||
iPtr->result = (char *)"interpreter uses an incompatible stubs mechanism";
|
||||
iPtr->freeProc = 0;
|
||||
iPtr->legacyResult = "interpreter uses an incompatible stubs mechanism";
|
||||
iPtr->legacyFreeProc = 0; /* TCL_STATIC */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
+2
-6
@@ -5075,7 +5075,6 @@ TestsaveresultCmd(
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* The argument objects. */
|
||||
{
|
||||
Interp* iPtr = (Interp*) interp;
|
||||
int discard, result, index;
|
||||
Tcl_SavedResult state;
|
||||
Tcl_Obj *objPtr;
|
||||
@@ -5143,12 +5142,9 @@ TestsaveresultCmd(
|
||||
}
|
||||
|
||||
switch ((enum options) index) {
|
||||
case RESULT_DYNAMIC: {
|
||||
int presentOrFreed = (iPtr->freeProc == TestsaveresultFree) ^ freeCount;
|
||||
|
||||
Tcl_AppendElement(interp, presentOrFreed ? "presentOrFreed" : "missingOrLeak");
|
||||
case RESULT_DYNAMIC:
|
||||
Tcl_AppendElement(interp, freeCount ? "freed" : "leak");
|
||||
break;
|
||||
}
|
||||
case RESULT_OBJECT:
|
||||
Tcl_AppendElement(interp, Tcl_GetObjResult(interp) == objPtr
|
||||
? "same" : "different");
|
||||
|
||||
@@ -34,7 +34,7 @@ static const char procCommand[] = "proc";
|
||||
* procs
|
||||
*/
|
||||
|
||||
typedef struct CmdTable {
|
||||
typedef struct {
|
||||
const char *cmdName; /* command name */
|
||||
Tcl_ObjCmdProc *proc; /* command proc */
|
||||
int exportIt; /* if 1, export the command */
|
||||
|
||||
@@ -82,7 +82,7 @@ typedef union Block {
|
||||
* and statistics information.
|
||||
*/
|
||||
|
||||
typedef struct Bucket {
|
||||
typedef struct {
|
||||
Block *firstPtr; /* First block available */
|
||||
Block *lastPtr; /* End of block list */
|
||||
long numFree; /* Number of blocks available */
|
||||
|
||||
@@ -47,7 +47,7 @@ static struct TSDMaster {
|
||||
* The type of the data held per thread in a system TSD.
|
||||
*/
|
||||
|
||||
typedef struct TSDTable {
|
||||
typedef struct {
|
||||
ClientData *tablePtr; /* The table of Tcl TSDs. */
|
||||
sig_atomic_t allocated; /* The size of the table in the current
|
||||
* thread. */
|
||||
|
||||
@@ -223,15 +223,18 @@ declare 63 {
|
||||
|
||||
# Formerly internal API to allow initialisation of bignums without knowing the
|
||||
# typedefs of how a bignum works internally.
|
||||
declare 64 {deprecated {Use mp_init() + mp_set_long_long()}} {
|
||||
void TclBNInitBignumFromLong(mp_int *bignum, long initVal)
|
||||
}
|
||||
declare 65 {deprecated {Use mp_init() + mp_set_long_long()}} {
|
||||
void TclBNInitBignumFromWideInt(mp_int *bignum, Tcl_WideInt initVal)
|
||||
}
|
||||
declare 66 {deprecated {Use mp_init() + mp_set_long_long()}} {
|
||||
void TclBNInitBignumFromWideUInt(mp_int *bignum, Tcl_WideUInt initVal)
|
||||
}
|
||||
# Removed in 9.0
|
||||
#declare 64 {
|
||||
# void TclBNInitBignumFromLong(mp_int *bignum, long initVal)
|
||||
#}
|
||||
# Removed in 9.0
|
||||
#declare 65 {
|
||||
# void TclBNInitBignumFromWideInt(mp_int *bignum, Tcl_WideInt initVal)
|
||||
#}
|
||||
# Removed in 9.0
|
||||
#declare 66 {
|
||||
# void TclBNInitBignumFromWideUInt(mp_int *bignum, Tcl_WideUInt initVal)
|
||||
#}
|
||||
|
||||
# Added in libtommath 1.0
|
||||
declare 67 {
|
||||
|
||||
@@ -302,17 +302,9 @@ EXTERN int TclBN_mp_init_set_int(mp_int *a, unsigned long i);
|
||||
EXTERN int TclBN_mp_set_int(mp_int *a, unsigned long i);
|
||||
/* 63 */
|
||||
EXTERN int TclBN_mp_cnt_lsb(const mp_int *a);
|
||||
/* 64 */
|
||||
TCL_DEPRECATED("Use mp_init() + mp_set_long_long()")
|
||||
void TclBNInitBignumFromLong(mp_int *bignum, long initVal);
|
||||
/* 65 */
|
||||
TCL_DEPRECATED("Use mp_init() + mp_set_long_long()")
|
||||
void TclBNInitBignumFromWideInt(mp_int *bignum,
|
||||
Tcl_WideInt initVal);
|
||||
/* 66 */
|
||||
TCL_DEPRECATED("Use mp_init() + mp_set_long_long()")
|
||||
void TclBNInitBignumFromWideUInt(mp_int *bignum,
|
||||
Tcl_WideUInt initVal);
|
||||
/* Slot 64 is reserved */
|
||||
/* Slot 65 is reserved */
|
||||
/* Slot 66 is reserved */
|
||||
/* 67 */
|
||||
EXTERN int TclBN_mp_expt_d_ex(const mp_int *a, mp_digit b,
|
||||
mp_int *c, int fast);
|
||||
@@ -393,9 +385,9 @@ typedef struct TclTomMathStubs {
|
||||
int (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */
|
||||
int (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */
|
||||
int (*tclBN_mp_cnt_lsb) (const mp_int *a); /* 63 */
|
||||
TCL_DEPRECATED_API("Use mp_init() + mp_set_long_long()") void (*tclBNInitBignumFromLong) (mp_int *bignum, long initVal); /* 64 */
|
||||
TCL_DEPRECATED_API("Use mp_init() + mp_set_long_long()") void (*tclBNInitBignumFromWideInt) (mp_int *bignum, Tcl_WideInt initVal); /* 65 */
|
||||
TCL_DEPRECATED_API("Use mp_init() + mp_set_long_long()") void (*tclBNInitBignumFromWideUInt) (mp_int *bignum, Tcl_WideUInt initVal); /* 66 */
|
||||
void (*reserved64)(void);
|
||||
void (*reserved65)(void);
|
||||
void (*reserved66)(void);
|
||||
int (*tclBN_mp_expt_d_ex) (const mp_int *a, mp_digit b, mp_int *c, int fast); /* 67 */
|
||||
int (*tclBN_mp_set_long_long) (mp_int *a, Tcl_WideUInt i); /* 68 */
|
||||
Tcl_WideUInt (*tclBN_mp_get_long_long) (const mp_int *a); /* 69 */
|
||||
@@ -543,12 +535,9 @@ extern const TclTomMathStubs *tclTomMathStubsPtr;
|
||||
(tclTomMathStubsPtr->tclBN_mp_set_int) /* 62 */
|
||||
#define TclBN_mp_cnt_lsb \
|
||||
(tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */
|
||||
#define TclBNInitBignumFromLong \
|
||||
(tclTomMathStubsPtr->tclBNInitBignumFromLong) /* 64 */
|
||||
#define TclBNInitBignumFromWideInt \
|
||||
(tclTomMathStubsPtr->tclBNInitBignumFromWideInt) /* 65 */
|
||||
#define TclBNInitBignumFromWideUInt \
|
||||
(tclTomMathStubsPtr->tclBNInitBignumFromWideUInt) /* 66 */
|
||||
/* Slot 64 is reserved */
|
||||
/* Slot 65 is reserved */
|
||||
/* Slot 66 is reserved */
|
||||
#define TclBN_mp_expt_d_ex \
|
||||
(tclTomMathStubsPtr->tclBN_mp_expt_d_ex) /* 67 */
|
||||
#define TclBN_mp_set_long_long \
|
||||
|
||||
@@ -125,7 +125,7 @@ TclInitBignumFromLong(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclBNInitBignumFromWideInt --
|
||||
* TclInitBignumFromWideInt --
|
||||
*
|
||||
* Allocate and initialize a 'bignum' from a Tcl_WideInt
|
||||
*
|
||||
@@ -157,7 +157,7 @@ TclInitBignumFromWideInt(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclBNInitBignumFromWideUInt --
|
||||
* TclInitBignumFromWideUInt --
|
||||
*
|
||||
* Allocate and initialize a 'bignum' from a Tcl_WideUInt
|
||||
*
|
||||
|
||||
+32
-375
@@ -93,13 +93,6 @@ static ProcessGlobalValue executableName = {
|
||||
#define CONVERT_MASK (CONVERT_BRACE | CONVERT_ESCAPE)
|
||||
#define CONVERT_ANY 16
|
||||
|
||||
/*
|
||||
* The following key is used by Tcl_PrintDouble and TclPrecTraceProc to
|
||||
* access the precision to be used for double formatting.
|
||||
*/
|
||||
|
||||
static Tcl_ThreadDataKey precisionKey;
|
||||
|
||||
/*
|
||||
* Prototypes for functions defined later in this file.
|
||||
*/
|
||||
@@ -1608,42 +1601,6 @@ Tcl_Merge(
|
||||
return result;
|
||||
}
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_Backslash --
|
||||
*
|
||||
* Figure out how to handle a backslash sequence.
|
||||
*
|
||||
* Results:
|
||||
* The return value is the character that should be substituted in place
|
||||
* of the backslash sequence that starts at src. If readPtr isn't NULL
|
||||
* then it is filled in with a count of the number of characters in the
|
||||
* backslash sequence.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
char
|
||||
Tcl_Backslash(
|
||||
const char *src, /* Points to the backslash character of a
|
||||
* backslash sequence. */
|
||||
int *readPtr) /* Fill in with number of characters read from
|
||||
* src, unless NULL. */
|
||||
{
|
||||
char buf[TCL_UTF_MAX];
|
||||
Tcl_UniChar ch = 0;
|
||||
|
||||
Tcl_UtfBackslash(src, readPtr, buf);
|
||||
TclUtfToUniChar(buf, &ch);
|
||||
return (char) ch;
|
||||
}
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -3024,86 +2981,12 @@ Tcl_DStringGetResult(
|
||||
Tcl_DString *dsPtr) /* Dynamic string that is to become the result
|
||||
* of interp. */
|
||||
{
|
||||
#ifdef TCL_NO_DEPRECATED
|
||||
Tcl_Obj *obj = Tcl_GetObjResult(interp);
|
||||
const char *bytes = TclGetString(obj);
|
||||
int length;
|
||||
char *bytes = TclGetStringFromObj(Tcl_GetObjResult(interp), &length);
|
||||
|
||||
Tcl_DStringFree(dsPtr);
|
||||
Tcl_DStringAppend(dsPtr, bytes, obj->length);
|
||||
Tcl_DStringAppend(dsPtr, bytes, length);
|
||||
Tcl_ResetResult(interp);
|
||||
#else
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
|
||||
if (dsPtr->string != dsPtr->staticSpace) {
|
||||
ckfree(dsPtr->string);
|
||||
}
|
||||
|
||||
/*
|
||||
* Do more efficient transfer when we know the result is a Tcl_Obj. When
|
||||
* there's no string result, we only have to deal with two cases:
|
||||
*
|
||||
* 1. When the string rep is the empty string, when we don't copy but
|
||||
* instead use the staticSpace in the DString to hold an empty string.
|
||||
|
||||
* 2. When the string rep is not there or there's a real string rep, when
|
||||
* we use Tcl_GetString to fetch (or generate) the string rep - which
|
||||
* we know to have been allocated with ckalloc() - and use it to
|
||||
* populate the DString space. Then, we free the internal rep. and set
|
||||
* the object's string representation back to the canonical empty
|
||||
* string.
|
||||
*/
|
||||
|
||||
if (!iPtr->result[0] && iPtr->objResultPtr
|
||||
&& !Tcl_IsShared(iPtr->objResultPtr)) {
|
||||
if (iPtr->objResultPtr->bytes == &tclEmptyString) {
|
||||
dsPtr->string = dsPtr->staticSpace;
|
||||
dsPtr->string[0] = 0;
|
||||
dsPtr->length = 0;
|
||||
dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE;
|
||||
} else {
|
||||
dsPtr->string = TclGetString(iPtr->objResultPtr);
|
||||
dsPtr->length = iPtr->objResultPtr->length;
|
||||
dsPtr->spaceAvl = dsPtr->length + 1;
|
||||
TclFreeIntRep(iPtr->objResultPtr);
|
||||
iPtr->objResultPtr->bytes = &tclEmptyString;
|
||||
iPtr->objResultPtr->length = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the string result is empty, move the object result to the string
|
||||
* result, then reset the object result.
|
||||
*/
|
||||
|
||||
(void) Tcl_GetStringResult(interp);
|
||||
|
||||
dsPtr->length = strlen(iPtr->result);
|
||||
if (iPtr->freeProc != NULL) {
|
||||
if (iPtr->freeProc == TCL_DYNAMIC) {
|
||||
dsPtr->string = iPtr->result;
|
||||
dsPtr->spaceAvl = dsPtr->length+1;
|
||||
} else {
|
||||
dsPtr->string = ckalloc(dsPtr->length+1);
|
||||
memcpy(dsPtr->string, iPtr->result, (unsigned) dsPtr->length+1);
|
||||
iPtr->freeProc(iPtr->result);
|
||||
}
|
||||
dsPtr->spaceAvl = dsPtr->length+1;
|
||||
iPtr->freeProc = NULL;
|
||||
} else {
|
||||
if (dsPtr->length < TCL_DSTRING_STATIC_SIZE) {
|
||||
dsPtr->string = dsPtr->staticSpace;
|
||||
dsPtr->spaceAvl = TCL_DSTRING_STATIC_SIZE;
|
||||
} else {
|
||||
dsPtr->string = ckalloc(dsPtr->length+1);
|
||||
dsPtr->spaceAvl = dsPtr->length + 1;
|
||||
}
|
||||
memcpy(dsPtr->string, iPtr->result, (unsigned) dsPtr->length+1);
|
||||
}
|
||||
|
||||
iPtr->result = iPtr->resultSpace;
|
||||
iPtr->resultSpace[0] = 0;
|
||||
#endif /* !TCL_NO_DEPRECATED */
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3229,10 +3112,9 @@ Tcl_DStringEndSublist(
|
||||
* string using.
|
||||
*
|
||||
* Results:
|
||||
* The ASCII equivalent of "value" is written at "dst". It is written
|
||||
* using the current precision, and it is guaranteed to contain a decimal
|
||||
* point or exponent, so that it looks like a floating-point value and
|
||||
* not an integer.
|
||||
* The ASCII equivalent of "value" is written at "dst". It is guaranteed
|
||||
* to contain a decimal point or exponent, so that it looks like a
|
||||
* floating-point value and not an integer.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
@@ -3242,9 +3124,7 @@ Tcl_DStringEndSublist(
|
||||
|
||||
void
|
||||
Tcl_PrintDouble(
|
||||
Tcl_Interp *interp, /* Interpreter whose tcl_precision variable
|
||||
* used to be used to control printing. It's
|
||||
* ignored now. */
|
||||
Tcl_Interp *interp, /* Not used */
|
||||
double value, /* Value to print as string. */
|
||||
char *dst) /* Where to store converted value; must have
|
||||
* at least TCL_DOUBLE_SPACE characters. */
|
||||
@@ -3254,7 +3134,6 @@ Tcl_PrintDouble(
|
||||
int signum;
|
||||
char *digits;
|
||||
char *end;
|
||||
int *precisionPtr = Tcl_GetThreadData(&precisionKey, sizeof(int));
|
||||
|
||||
/*
|
||||
* Handle NaN.
|
||||
@@ -3286,53 +3165,8 @@ Tcl_PrintDouble(
|
||||
* Ordinary (normal and denormal) values.
|
||||
*/
|
||||
|
||||
if (*precisionPtr == 0) {
|
||||
digits = TclDoubleDigits(value, -1, TCL_DD_SHORTEST,
|
||||
&exponent, &signum, &end);
|
||||
} else {
|
||||
/*
|
||||
* There are at least two possible interpretations for tcl_precision.
|
||||
*
|
||||
* The first is, "choose the decimal representation having
|
||||
* $tcl_precision digits of significance that is nearest to the given
|
||||
* number, breaking ties by rounding to even, and then trimming
|
||||
* trailing zeros." This gives the greatest possible precision in the
|
||||
* decimal string, but offers the anomaly that [expr 0.1] will be
|
||||
* "0.10000000000000001".
|
||||
*
|
||||
* The second is "choose the decimal representation having at most
|
||||
* $tcl_precision digits of significance that is nearest to the given
|
||||
* number. If no such representation converts exactly to the given
|
||||
* number, choose the one that is closest, breaking ties by rounding
|
||||
* to even. If more than one such representation converts exactly to
|
||||
* the given number, choose the shortest, breaking ties in favour of
|
||||
* the nearest, breaking remaining ties in favour of the one ending in
|
||||
* an even digit."
|
||||
*
|
||||
* Tcl 8.4 implements the first of these, which gives rise to
|
||||
* anomalies in formatting:
|
||||
*
|
||||
* % expr 0.1
|
||||
* 0.10000000000000001
|
||||
* % expr 0.01
|
||||
* 0.01
|
||||
* % expr 1e-7
|
||||
* 9.9999999999999995e-08
|
||||
*
|
||||
* For human readability, it appears better to choose the second rule,
|
||||
* and let [expr 0.1] return 0.1. But for 8.4 compatibility, we prefer
|
||||
* the first (the recommended zero value for tcl_precision avoids the
|
||||
* problem entirely).
|
||||
*
|
||||
* Uncomment TCL_DD_SHORTEN_FLAG in the next call to prefer the method
|
||||
* that allows floating point values to be shortened if it can be done
|
||||
* without loss of precision.
|
||||
*/
|
||||
|
||||
digits = TclDoubleDigits(value, *precisionPtr,
|
||||
TCL_DD_E_FORMAT /* | TCL_DD_SHORTEN_FLAG */,
|
||||
&exponent, &signum, &end);
|
||||
}
|
||||
digits = TclDoubleDigits(value, -1, TCL_DD_SHORTEST,
|
||||
&exponent, &signum, &end);
|
||||
if (signum) {
|
||||
*dst++ = '-';
|
||||
}
|
||||
@@ -3352,16 +3186,7 @@ Tcl_PrintDouble(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Tcl 8.4 appears to format with at least a two-digit exponent;
|
||||
* preserve that behaviour when tcl_precision != 0
|
||||
*/
|
||||
|
||||
if (*precisionPtr == 0) {
|
||||
sprintf(dst, "e%+d", exponent);
|
||||
} else {
|
||||
sprintf(dst, "e%+03d", exponent);
|
||||
}
|
||||
sprintf(dst, "e%+d", exponent);
|
||||
} else {
|
||||
/*
|
||||
* F format for others.
|
||||
@@ -3396,86 +3221,6 @@ Tcl_PrintDouble(
|
||||
ckfree(digits);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclPrecTraceProc --
|
||||
*
|
||||
* This function is invoked whenever the variable "tcl_precision" is
|
||||
* written.
|
||||
*
|
||||
* Results:
|
||||
* Returns NULL if all went well, or an error message if the new value
|
||||
* for the variable doesn't make sense.
|
||||
*
|
||||
* Side effects:
|
||||
* If the new value doesn't make sense then this function undoes the
|
||||
* effect of the variable modification. Otherwise it modifies the format
|
||||
* string that's used by Tcl_PrintDouble.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
|
||||
/* ARGSUSED */
|
||||
char *
|
||||
TclPrecTraceProc(
|
||||
ClientData clientData, /* Not used. */
|
||||
Tcl_Interp *interp, /* Interpreter containing variable. */
|
||||
const char *name1, /* Name of variable. */
|
||||
const char *name2, /* Second part of variable name. */
|
||||
int flags) /* Information about what happened. */
|
||||
{
|
||||
Tcl_Obj *value;
|
||||
int prec;
|
||||
int *precisionPtr = Tcl_GetThreadData(&precisionKey, sizeof(int));
|
||||
|
||||
/*
|
||||
* If the variable is unset, then recreate the trace.
|
||||
*/
|
||||
|
||||
if (flags & TCL_TRACE_UNSETS) {
|
||||
if ((flags & TCL_TRACE_DESTROYED) && !Tcl_InterpDeleted(interp)) {
|
||||
Tcl_TraceVar2(interp, name1, name2,
|
||||
TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES
|
||||
|TCL_TRACE_UNSETS, TclPrecTraceProc, clientData);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* When the variable is read, reset its value from our shared value. This
|
||||
* is needed in case the variable was modified in some other interpreter
|
||||
* so that this interpreter's value is out of date.
|
||||
*/
|
||||
|
||||
|
||||
if (flags & TCL_TRACE_READS) {
|
||||
Tcl_SetVar2Ex(interp, name1, name2, Tcl_NewIntObj(*precisionPtr),
|
||||
flags & TCL_GLOBAL_ONLY);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* The variable is being written. Check the new value and disallow it if
|
||||
* it isn't reasonable or if this is a safe interpreter (we don't want
|
||||
* safe interpreters messing up the precision of other interpreters).
|
||||
*/
|
||||
|
||||
if (Tcl_IsSafe(interp)) {
|
||||
return (char *) "can't modify precision from a safe interpreter";
|
||||
}
|
||||
value = Tcl_GetVar2Ex(interp, name1, name2, flags & TCL_GLOBAL_ONLY);
|
||||
if (value == NULL
|
||||
|| Tcl_GetIntFromObj(NULL, value, &prec) != TCL_OK
|
||||
|| prec < 0 || prec > TCL_MAX_PREC) {
|
||||
return (char *) "improper value for precision";
|
||||
}
|
||||
*precisionPtr = prec;
|
||||
return NULL;
|
||||
}
|
||||
#endif /* !TCL_NO_DEPRECATED)*/
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -3656,21 +3401,26 @@ TclFormatInt(
|
||||
*
|
||||
* TclGetIntForIndex --
|
||||
*
|
||||
* This function returns an integer corresponding to the list index held
|
||||
* in a Tcl object. The Tcl object's value is expected to be in the
|
||||
* format integer([+-]integer)? or the format end([+-]integer)?.
|
||||
* Provides an integer corresponding to the list index held in a Tcl
|
||||
* object. The string value 'objPtr' is expected have the format
|
||||
* integer([+-]integer)? or end([+-]integer)?.
|
||||
*
|
||||
* Results:
|
||||
* The return value is normally TCL_OK, which means that the index was
|
||||
* successfully stored into the location referenced by "indexPtr". If the
|
||||
* Tcl object referenced by "objPtr" has the value "end", the value
|
||||
* stored is "endValue". If "objPtr"s values is not of one of the
|
||||
* expected formats, TCL_ERROR is returned and, if "interp" is non-NULL,
|
||||
* an error message is left in the interpreter's result object.
|
||||
* Value
|
||||
* TCL_OK
|
||||
*
|
||||
* Side effects:
|
||||
* The object referenced by "objPtr" might be converted to an integer,
|
||||
* wide integer, or end-based-index object.
|
||||
* The index is stored at the address given by by 'indexPtr'. If
|
||||
* 'objPtr' has the value "end", the value stored is 'endValue'.
|
||||
*
|
||||
* TCL_ERROR
|
||||
*
|
||||
* The value of 'objPtr' does not have one of the expected formats. If
|
||||
* 'interp' is non-NULL, an error message is left in the interpreter's
|
||||
* result object.
|
||||
*
|
||||
* Effect
|
||||
*
|
||||
* The object referenced by 'objPtr' is converted, as needed, to an
|
||||
* integer, wide integer, or end-based-index object.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3752,7 +3502,6 @@ TclGetIntForIndex(
|
||||
if (!strncmp(bytes, "end-", 4)) {
|
||||
bytes += 4;
|
||||
}
|
||||
TclCheckBadOctal(interp, bytes);
|
||||
Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX", NULL);
|
||||
}
|
||||
|
||||
@@ -4035,73 +3784,6 @@ TclIndexDecode(
|
||||
return encoded;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclCheckBadOctal --
|
||||
*
|
||||
* This function checks for a bad octal value and appends a meaningful
|
||||
* error to the interp's result.
|
||||
*
|
||||
* Results:
|
||||
* 1 if the argument was a bad octal, else 0.
|
||||
*
|
||||
* Side effects:
|
||||
* The interpreter's result is modified.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclCheckBadOctal(
|
||||
Tcl_Interp *interp, /* Interpreter to use for error reporting. If
|
||||
* NULL, then no error message is left after
|
||||
* errors. */
|
||||
const char *value) /* String to check. */
|
||||
{
|
||||
register const char *p = value;
|
||||
|
||||
/*
|
||||
* A frequent mistake is invalid octal values due to an unwanted leading
|
||||
* zero. Try to generate a meaningful error message.
|
||||
*/
|
||||
|
||||
while (TclIsSpaceProc(*p)) {
|
||||
p++;
|
||||
}
|
||||
if (*p == '+' || *p == '-') {
|
||||
p++;
|
||||
}
|
||||
if (*p == '0') {
|
||||
if ((p[1] == 'o') || p[1] == 'O') {
|
||||
p += 2;
|
||||
}
|
||||
while (isdigit(UCHAR(*p))) { /* INTL: digit. */
|
||||
p++;
|
||||
}
|
||||
while (TclIsSpaceProc(*p)) {
|
||||
p++;
|
||||
}
|
||||
if (*p == '\0') {
|
||||
/*
|
||||
* Reached end of string.
|
||||
*/
|
||||
|
||||
if (interp != NULL) {
|
||||
/*
|
||||
* Don't reset the result here because we want this result to
|
||||
* be added to an existing error message as extra info.
|
||||
*/
|
||||
|
||||
Tcl_AppendToObj(Tcl_GetObjResult(interp),
|
||||
" (looks like invalid octal number)", -1);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -4266,7 +3948,7 @@ TclSetProcessGlobalValue(
|
||||
Tcl_IncrRefCount(newValue);
|
||||
cacheMap = GetThreadHash(&pgvPtr->key);
|
||||
ClearHash(cacheMap);
|
||||
hPtr = Tcl_CreateHashEntry(cacheMap, (void *)(size_t)(pgvPtr->epoch), &dummy);
|
||||
hPtr = Tcl_CreateHashEntry(cacheMap, (void *)(pgvPtr->epoch), &dummy);
|
||||
Tcl_SetHashValue(hPtr, newValue);
|
||||
Tcl_MutexUnlock(&pgvPtr->mutex);
|
||||
}
|
||||
@@ -4292,7 +3974,7 @@ TclGetProcessGlobalValue(
|
||||
Tcl_Obj *value = NULL;
|
||||
Tcl_HashTable *cacheMap;
|
||||
Tcl_HashEntry *hPtr;
|
||||
unsigned int epoch = pgvPtr->epoch;
|
||||
size_t epoch = pgvPtr->epoch;
|
||||
|
||||
if (pgvPtr->encoding) {
|
||||
Tcl_Encoding current = Tcl_GetEncoding(NULL, NULL);
|
||||
@@ -4326,7 +4008,7 @@ TclGetProcessGlobalValue(
|
||||
}
|
||||
}
|
||||
cacheMap = GetThreadHash(&pgvPtr->key);
|
||||
hPtr = Tcl_FindHashEntry(cacheMap, (void *)(size_t)epoch);
|
||||
hPtr = Tcl_FindHashEntry(cacheMap, (void *) (epoch));
|
||||
if (NULL == hPtr) {
|
||||
int dummy;
|
||||
|
||||
@@ -4359,7 +4041,7 @@ TclGetProcessGlobalValue(
|
||||
|
||||
value = Tcl_NewStringObj(pgvPtr->value, pgvPtr->numBytes);
|
||||
hPtr = Tcl_CreateHashEntry(cacheMap,
|
||||
(void *)(size_t)(pgvPtr->epoch), &dummy);
|
||||
(void *)(pgvPtr->epoch), &dummy);
|
||||
Tcl_MutexUnlock(&pgvPtr->mutex);
|
||||
Tcl_SetHashValue(hPtr, value);
|
||||
Tcl_IncrRefCount(value);
|
||||
@@ -4451,31 +4133,6 @@ Tcl_GetNameOfExecutable(void)
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclpGetTime --
|
||||
*
|
||||
* Deprecated synonym for Tcl_GetTime. This function is provided for the
|
||||
* benefit of extensions written before Tcl_GetTime was exported from the
|
||||
* library.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Stores current time in the buffer designated by "timePtr"
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
TclpGetTime(
|
||||
Tcl_Time *timePtr)
|
||||
{
|
||||
Tcl_GetTime(timePtr);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
|
||||
+6
-6
@@ -858,12 +858,8 @@ TclLookupSimpleVar(
|
||||
*indexPtr = -1;
|
||||
flags = (flags | TCL_GLOBAL_ONLY) & ~TCL_NAMESPACE_ONLY;
|
||||
} else {
|
||||
if (flags & TCL_AVOID_RESOLVERS) {
|
||||
flags = (flags | TCL_NAMESPACE_ONLY);
|
||||
}
|
||||
if (flags & TCL_NAMESPACE_ONLY) {
|
||||
*indexPtr = -2;
|
||||
}
|
||||
flags = (flags | TCL_NAMESPACE_ONLY);
|
||||
*indexPtr = -2;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5828,6 +5824,10 @@ ObjFindNamespaceVar(
|
||||
* Find the namespace(s) that contain the variable.
|
||||
*/
|
||||
|
||||
if (!(flags & TCL_GLOBAL_ONLY)) {
|
||||
flags |= TCL_NAMESPACE_ONLY;
|
||||
}
|
||||
|
||||
TclGetNamespaceForQualName(interp, name, (Namespace *) contextNsPtr,
|
||||
flags, &nsPtr[0], &nsPtr[1], &cxtNsPtr, &simpleName);
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
if {[info commands package] == ""} {
|
||||
error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]"
|
||||
}
|
||||
package require -exact Tcl 8.7a2
|
||||
package require -exact Tcl 9.0a0
|
||||
|
||||
# Compute the auto path to use in this interpreter.
|
||||
# The values on the path come from several locations:
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ proc ::safe::CheckInterp {slave} {
|
||||
# we had the bad idea to support for the sake of user simplicity in
|
||||
# create/init but which makes life hard in configure...
|
||||
# So this will be hopefully written and some integrated with opt1.0
|
||||
# (hopefully for tcl8.1 ?)
|
||||
# (hopefully for tcl9.0 ?)
|
||||
proc ::safe::interpConfigure {args} {
|
||||
switch [llength $args] {
|
||||
1 {
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(America/Puerto_Rico)]} {
|
||||
LoadTimeZoneFile America/Puerto_Rico
|
||||
}
|
||||
set TZData(:SystemV/AST4) $TZData(:America/Puerto_Rico)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(America/Halifax)]} {
|
||||
LoadTimeZoneFile America/Halifax
|
||||
}
|
||||
set TZData(:SystemV/AST4ADT) $TZData(:America/Halifax)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(America/Regina)]} {
|
||||
LoadTimeZoneFile America/Regina
|
||||
}
|
||||
set TZData(:SystemV/CST6) $TZData(:America/Regina)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(America/Chicago)]} {
|
||||
LoadTimeZoneFile America/Chicago
|
||||
}
|
||||
set TZData(:SystemV/CST6CDT) $TZData(:America/Chicago)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(America/Indianapolis)]} {
|
||||
LoadTimeZoneFile America/Indianapolis
|
||||
}
|
||||
set TZData(:SystemV/EST5) $TZData(:America/Indianapolis)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(America/New_York)]} {
|
||||
LoadTimeZoneFile America/New_York
|
||||
}
|
||||
set TZData(:SystemV/EST5EDT) $TZData(:America/New_York)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(Pacific/Honolulu)]} {
|
||||
LoadTimeZoneFile Pacific/Honolulu
|
||||
}
|
||||
set TZData(:SystemV/HST10) $TZData(:Pacific/Honolulu)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(America/Phoenix)]} {
|
||||
LoadTimeZoneFile America/Phoenix
|
||||
}
|
||||
set TZData(:SystemV/MST7) $TZData(:America/Phoenix)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(America/Denver)]} {
|
||||
LoadTimeZoneFile America/Denver
|
||||
}
|
||||
set TZData(:SystemV/MST7MDT) $TZData(:America/Denver)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(Pacific/Pitcairn)]} {
|
||||
LoadTimeZoneFile Pacific/Pitcairn
|
||||
}
|
||||
set TZData(:SystemV/PST8) $TZData(:Pacific/Pitcairn)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(America/Los_Angeles)]} {
|
||||
LoadTimeZoneFile America/Los_Angeles
|
||||
}
|
||||
set TZData(:SystemV/PST8PDT) $TZData(:America/Los_Angeles)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(Pacific/Gambier)]} {
|
||||
LoadTimeZoneFile Pacific/Gambier
|
||||
}
|
||||
set TZData(:SystemV/YST9) $TZData(:Pacific/Gambier)
|
||||
@@ -1,5 +0,0 @@
|
||||
# created by ../tools/tclZIC.tcl - do not edit
|
||||
if {![info exists TZData(America/Anchorage)]} {
|
||||
LoadTimeZoneFile America/Anchorage
|
||||
}
|
||||
set TZData(:SystemV/YST9YDT) $TZData(:America/Anchorage)
|
||||
+3
-3
@@ -113,7 +113,7 @@ The following build configurations are available:
|
||||
The Xcode projects refer to the toplevel tcl source directory via the
|
||||
TCL_SRCROOT user build setting, by default this is set to the project-relative
|
||||
path '../../tcl', if your tcl source directory is named differently, e.g.
|
||||
'../../tcl8.7', you need to manually change the TCL_SRCROOT setting by editing
|
||||
'../../tcl9.0', you need to manually change the TCL_SRCROOT setting by editing
|
||||
your ${USER}.pbxuser file (located inside the Tcl.xcodeproj bundle directory)
|
||||
with a text editor.
|
||||
|
||||
@@ -141,9 +141,9 @@ Detailed Instructions for building with macosx/GNUmakefile
|
||||
- Unpack the Tcl source release archive.
|
||||
|
||||
- The following instructions assume the Tcl source tree is named "tcl${ver}",
|
||||
(where ${ver} is a shell variable containing the Tcl version number e.g. '8.7').
|
||||
(where ${ver} is a shell variable containing the Tcl version number e.g. '9.0').
|
||||
Setup this shell variable as follows:
|
||||
ver="8.7"
|
||||
ver="9.0"
|
||||
If you are building from CVS, omit this step (CVS source tree names usually do
|
||||
not contain a version number).
|
||||
|
||||
|
||||
@@ -34,4 +34,4 @@ TCL_CONFIGURE_ARGS = --enable-threads --enable-dtrace
|
||||
TCL_LIBRARY = $(LIBDIR)/tcl$(VERSION)
|
||||
TCL_PACKAGE_PATH = "$(LIBDIR)"
|
||||
TCL_DEFS = HAVE_TCL_CONFIG_H
|
||||
VERSION = 8.7
|
||||
VERSION = 9.0
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user